Don't complain if neither wxOK nor wxYES[_NO] are specified but just assume
wxOK by default. This allows the code calling wxMessageBox() with just an icon
flag to continue to work in the same way in 2.9 as it did in 2.8.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72479 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Initialize the variables to the correct values when defining them instead of
initializing them as 0 first and then assigning them the real value.
Closes#14652.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72478 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Just as wxBITMAP() provides a portable way of loading bitmaps from either
Windows BMP resources or embedded XPM data depending on the platform,
wxBITMAP_PNG() hides the difference between loading bitmaps from PNG resources
under Windows and embedded PNG data elsewhere.
Also add wxBITMAP_PNG_FROM_DATA() macro which always loads PNG data from
memory: it's needed anyhow as part of wxBITMAP_PNG() implementation and some
people may prefer to always use it under all platforms.
Finally modify the image sample to demonstrate loading PNG images from both
resources and memory. This involved creation of a new Windows .rc file for it
and copying its data files to Resources bundle directory under OS X.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72477 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This simple function can be used to create a wxBitmap from the raw image data
in PNG format. It is just a thin wrapper around wxImage load functions under
almost all platforms but has two advantages:
1. It can be implemented natively for some platforms (currently only OS X).
2. It can be used in a single expression as it doesn't require creating a
temporary wxMemoryInputStream and this will be required by wxBITMAP_PNG()
macro that will be added soon.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72476 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
File/directory picker controls with wxFLP_FILE_MUST_EXIST/wxDIRP_DIR_MUST_EXIST
style simply ignored any value entered by user if it didn't correspond to an
existing file/directory. This meant that the program didn't use the value that
was shown on the screen resulting in very confusing UI -- e.g. a program could
complain that no value was entered when actually it was and just corresponded
to a non-existing file.
As we can't prevent the entry of arbitrary strings in the text field of the
file picker control, stop pretending that we can validate it and just update
the control value, and send the corresponding event, whenever the text control
value changes.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72475 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Such buttons may be needed in other places and it's not obvious to create
them, so add a new public wxBitmapButton::NewCloseButton() method to allow
creating them easily.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72474 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Document the new and preferred overload avoiding copying the data. Also
document the new (since 2.9.1) parameters of the old one.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72473 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Resource types can be either strings for custom types or integers casted to a
TCHAR* for the standard ones. Using wxString for the resource type prevented
us from using the latter as any attempt to initialize wxString for such a
pseudo-string resulted in an immediate crash.
Change wxLoadUserResource() resource type parameter type to wxChar* to avoid
this and allow passing standard resource types, such as RT_RCDATE, to this
function directly.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72472 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Calling InitAlpha() when we already had loaded alpha from the resource data
results in an assert. Fix this by only initializing alpha if don't have it
yet.
Closes#14643.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72471 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Return the deepest child of the window and not the first one as this function
needs to return the window that is at the top of Z-order.
Closes#14591.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72470 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Recognize this control as part of wxComboBox and so handle WM_CTLCOLOR for it.
To do this, override ContainsHWND() in wxComboBox and use it, on the parent
window, in wxControl::DoMSWControlColor(), if we fail to find the window
directly.
Closes#811.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72468 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Recent changes (r71308) optimizing away setting the text of the text entry if
it didn't really change completely broke the generic text hints implementation
as e.g. clearing the hint didn't change anything because the entry was already
logically empty anyhow.
Fix this by simply comparing the new value with the real value of the entry
returned by DoGetValue() and not GetValue() that takes hints into account.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72458 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use wxVScrolledWindow::ScrollToRow() instead of the old and ambiguous
ScrollToLine() which is only preserved for compatibility reasons.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72457 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
libnotify 0.4.5 included in Ubuntu Lucid (10.04) can be used for implementing
wxNotificationMessage too, there is only a minor difference with 0.7 API. So
while we stick check for 0.7 initially, accept lower versions too if 0.7 is
not available.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72456 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Simply use ChangeValue() instead of SetValue() to avoid the unwanted events
instead of using guard variables.
No real changes but the code is simpler and shorter now.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72454 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Create wxFileDialog with correct initial directory and default file name from
the very beginning instead of updating it later. This makes the code simpler
and also actually makes it work as the initial directory setting was
overwritten by setting the default path later even if it didn't contain any
directory component.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72451 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Override the other StrokeLines() overload in wxGDIPlusContext just to avoid
the warning about hiding a base class virtual method from MinGW compiler.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72450 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
GetKeyCode() will always return valid key codes for Latin-1 symbols but won't
do it for other non-ASCII Unicode characters even if they are representable in
the current locale.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72449 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This is incorrect as wxIsprint() is locale-dependent and only really works as
expected in UTF-8 locales (which are never used under Windows). Instead, just
test for control characters directly.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72448 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This doesn't work when the listbox is scrolled as the result of a click to
make the selected item fully visible and results in the index of the item
being off by 1 in the generated event which is a pretty serious problem.
Fix it by simply retrieving the item from the listbox itself, without doing
any hit testing. This seems to give the correct result in all cases and also
makes the code much simpler as we don't have to use 2 different ways of
finding the item depending on whether it was selected using the keyboard or
the mouse and makes it unnecessary to keep track of how the selection was done
completely, i.e. reverts r64498 which is not needed any more.
Closes#14635.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72444 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Using this string format results in very condensed strings when using small
fonts. The results of GDI+ font rendering are still pretty bad even without it
but they are at least slightly better.
Closes#14537.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72442 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Instead of creating StringFormat in DrawText() and Get[Partial]TextExtent[s],
create it once and simply use it from both functions.
This might be slightly more efficient as we don't waste time recreating it but
the main advantage is that it ensures that these functions use the same string
format and no discrepancies between them are possible.
See #14537.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72441 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
USE_RTTI, USE_AUI, USE_PROPGRID, USE_RIBBON, USE_RICHTEXT, USE_STC and USE_XRC
options were not output to the build configuration file, unlike the rest of
them.
Do output those ones as well now for consistency.
Also sort the options corresponding to different wx libraries alphabetically.
Closes#14608.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72440 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
These functions were present in the interface header but didn't have their own
documentation and somehow inherited the documentation of the first function in
the same section which didn't make any sense for them. Do document them now.
Closes#14607.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72439 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Catch the misguided attempts to pass the size of the border as the first
parameter of the Border(direction, size) overload.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72434 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Without it, the hidden faces are shown resulting in wrong display of both the
cube and the penguin, at least with Mesa (but it also seems to be the correct
thing to do according to OpenGL documentation).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72433 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Implement preferred language selection on modern systems (OS X, Windows
Vista+). User settings for locale (aka "regional settings") and UI
language are independent there and the UI language shouldn't be
determined from the locale.
Moreover, the OS provides a list of preferred languages, not a single
value (as with locale), so we should use the best language given user's
preferences and available translations. A Czech user may prefer Slovak
UI over English, for example, and we should use Slovak translation in
absence of Czech one in that case instead of falling back to English.
On Unix, locale is language and so things remain as before.
Notice that calling wxLocale::Init(wxLANGUAGE_DEFAULT) does the right
thing now: it sets the locale to whatever the user has configured in
regional settings and loads translations corresponding to default
wxTranslations language, which is determined as described above.
Previously, UI would be translated using a language corresponding to the
regional settings.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72430 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
A newer version of XML Tools has been released (2.9.4) which supports OS X 10.6 and later. As such a link to the beta version of 2.9.4 is not needed anymore.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72428 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
HandleSubItemPrepaint() calls wxGetListCtrlSubItemRect() (a thin
replacement of ListView_GetSubItemRect) with subitem argument
corresponding to MSDN documentation: it should be 0 for the whole item
and 1-based for subitems.
Unfortunately, as pointed out in an explanatory comment for
wxGetListCtrlSubItemRect(), MSDN lies and the index actually is 0-based.
The bug causes wxListCtrl's content to be shifted by one column and
rendered with additional artifacts as soon as custom drawing is used,
e.g. when a custom font is used.
This bug was introduced in r55378; the code correctly accounted for this
before that. This change partially reverts that commit.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72427 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775