It is not necessary to test for the condition which is already known to be
true or false because the code is inside the if statement checking it.
See #15893.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75661 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
No real changes, just avoid the unnecessary copying and also make the
signatures more consistent by adding the apparently forgotten "&" in a couple
of places.
See #15893.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75657 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The changes in this revision meant to prevent the closure of transient dialogs
from quitting the application (see #15880) prevented any application using AUI,
including the aui sample, from exiting as the AUI utility frames deleted
during the main frame destruction were returning false from their
IsLastBeforeExit() now.
Fix this by relaxing the check and ignoring the parent if it is already being
deleted anyhow -- in this case there is no danger of closing it accidentally.
Closes#15894.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75656 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Somewhat surprisingly, Windows can return a non-ASCII string from
gethostname(). It's not really clear what happens if the host name is not
representable in the current locale encoding at all, but at least make the
function work in case it is.
Closes#15875.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75655 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Don't set the pending size to (-1, valid-height) as it is always supposed to
be either fully valid or fully invalid (meaning there is no pending size
change).
Closes#15723.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75654 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
NEVER_USE_DIB is meant to be used only in conjunction with
{SOMETIMES,ALWAYS}_USE_DIB constants, use wxUSE_WXDIB elsewhere.
This is more logical and also fixes inadvertent use of NEVER_USE_DIB before it
is defined added by the changes of r75648.
See #13328.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75652 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use alpha in the combined toolbar bitmap if any of its tools has a bitmap
using alpha. This greatly improves the appearance of the automatically
generated disabled images for the tools with bitmaps using alpha.
See #15876.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75650 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Recent changes broke the handling of tools with alpha bitmaps as drawing them
on the global toolbar bitmap changes its underlying HBITMAP now, but the code
in wxToolBar didn't expect this.
Fix it by updating the HBITMAP used after every DrawBitmap() call, just in
case it changed (it doesn't cost anything to reset it if it did not).
Closes#15876.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75649 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Ensure that 32bpp bitmaps selected in wxMemoryDC use DIB for their internal
representation as GDI+ functions don't seem to work correctly with DDBs with
alpha channel.
Closes#13328.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75648 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
AssocQueryString() is more reliable and should work under all Windows
versions, including Windows 8 for which our previous implementation, reading
the values directly from the registry, had some problems.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75647 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The changes of r74515 didn't quite restore the old behaviour, the document was
still not being cleaned up if its OnCreate() simply returned false and not
threw an exception.
Do add cleanup in this code branch too, just duplicating what we in case of
exception (this duplication can't be easily avoided unfortunately).
Closes#15883.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75646 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This is consistent with the behaviour of the native control under MSW and GTK
and generally makes sense as otherwise focus could remain on a completely
unrelated control.
Closes#15885.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75645 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
{Freeze,Thaw}() themselves are not virtual any more, so overriding them
doesn't really work and it is unnecessary to reimplement the reference
counting already done by the base class anyhow, so override the DoXXX()
versions instead.
Closes#15877.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75640 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Make MyThread a friend to allow it accessing the private fields of MyFrame.
Notice that this example still remains badly written and should be ideally
entirely redone using conditions and mutexes.
See #15881.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75637 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Document that this function adjusts the window font size under non-OS X
systems and explain why it should still be used instead of changing the font
size directly.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75635 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Do prevent the app from exiting when the help frame is shown in the special
case of the help viewer application where the default behaviour of exiting the
application when only the help window remains open is inappropriate and
results in unexpected program exit if we open and then close any dialog, e.g.
from the help frame toolbar.
Even though the previous commit actually already fixed the problem in the
current code, still apply this fix as well, just in case we can (or could, in
the future) should any dialogs with NULL parent in this program.
Closes#15880.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75634 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This counterintuitive behaviour could happen when a dialog of a frame
returning false from its ShouldPreventAppExit() was closed: if there were no
other TLWs in the application, then the parent frame could be closed as well,
even if this clearly shouldn't happen.
See #15880.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75633 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
If we failed to find the "open" command, try the "show" one as some programs
(notable Microsoft viewers for Office file formats) only define the latter but
not the former.
Closes#15821.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75606 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Replace them with wxFONTWEIGHT_BOLD, wxFONTSTYLE_NORMAL or wxFONTWEIGHT_NORMAL
and equivalents in the code of the library itself and in the samples.
Also simplify font construction using wxFontInfo where possible to avoid
specifying these constants at all if they are not needed.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75590 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
No real changes, just remove the unnecessary line and its outdated comment
(wxPaintDC::Clear() can be called in wxGTK, it's just not useful).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75589 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Explicitly reset wxBitmap alpha flag after clearing its alpha channel to
ensure that we don't treat it as having alpha after going to all the trouble
of ensuring that it doesn't/
See #14403.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75588 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wx/osx/setup0.h is auto-generated, so r74708 shouldn't have changed it as the
change was overwritten by r75568 which regenerated that file. Instead, disable
wxUSE_PREFERENCES_EDITOR in iPhone-specific file.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75571 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The changes of r75448 were wrong, we can't ask Windows for the item state
before attaching it to the menu, so just check the internal flag here.
See ##15748.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75570 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
While compiler TLS support is simpler to use and much faster than using our
own Win32 API-based TLS implementation, it results in difficult to debug
crashes when used inside a dynamically loaded DLL under Windows XP, so disable
it by default to be safe.
Closes#13116.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75568 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Don't use mask and alpha together, this results in visual artefacts and masks
are unnecessary with RGBA bitmaps anyhow.
The only potentially problematic remaining case is mixing bitmaps with alpha
and mask inside the same image list (as we need to indicate whether we use the
mask or not when creating it), but this should probably be rare and in the
meanwhile we can at least RGBA bitmaps with image lists, which includes doing
this implicitly when they are used as button bitmaps.
Also refactor wxBitmap code to extract part of CopyFromIconOrCursor() to allow
reusing it in the newly added MSWUpdateAlpha().
See #11476.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75567 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Previously, the area of the bitmap outside of the rectangle covered by the
bitmap being drawn became completely transparent, "losing" the original bitmap
contents. This was due to some pixels of the bitmap having non-0 alpha value
after AlphaBlend() call, as it updates both the colours and alpha of the
destination. As there doesn't seem to be any way to prevent it from doing
this, just reset alpha back to 0 after calling it to avoid the problem.
Closes#14403.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75566 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Deprecate the use of the old untyped constants but don't schedule them from
removal in a future wx version by removing "#if WXWIN_COMPATIBILITY_3_0" tests
around their definition and use. Provoking deprecation warnings in the code
using these constants is worth it as they are unclear and it's easy to make
mistakes when using them, but breaking this code compilation outright can't be
justified -- even in the future.
Also use more informational wxDEPRECATED_MSG() instead of a simple
wxDEPRECATED() as it might not be obvious at all how should the code be
updated exactly.
Finally, avoid the use of deprecated constants inside the library itself.
As a side effect, this closes#15814.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75565 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775