Although returning wxFONTFAMILY_UNKNOWN when the font family is not recognized
makes more sense, it breaks a lot of existing code including all the
font-related code generated by DialogBlocks, so prefer to return
wxFONTFAMILY_DEFAULT instead -- which can't be confused for a valid font
family neither but can be passed to wxFont ctor or SetFamily() without
problems.
To ensure that this behaviour is correctly implemented by all ports, rename
the existing wxFont::GetFamily() to DoGetFamily() and call the new method from
wxFontBase::GetFamily() which adjusts the return value if needed.
Closes#12330.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65670 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
We need to include wx/defs.h that (indirectly) defines wxUSE_RADIOBOX
before testing for it in wx/radiobox.h, otherwise the test may fail if the
latter header is the first wx header included by the user code.
This is similar to r65210 fix for wxUSE_CHECKLISTBOX.
Closes#12526.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65668 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Move wxObjectEventFunctor::operator() definition after wxEvtHandler
declaration as it uses call through a pointer to member of this class and Sun
CC refuses to compile this without having the full class declaration.
Closes#12452.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65658 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use wxString::utf8_str() and FromUTF8() to convert to and from UTF-8. This is
more efficient than using wxConvUTF8 as the code did before as it avoids the
conversion entirely when wxString uses UTF-8 internally (as it does by default
in wxX11) and also has the advantage of compiling in STL build unlike the old
code.
Closes#12518.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65657 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Don't use unnecessary explicit casts of wxCharBuffer to "const char *".
Use wxCharBuffer::length() instead of strlen().
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65656 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The close button in the dialog title bar should work even if there are no
buttons in the dialog itself (unlike the Escape key which works as an
accelerator for a button), so close the dialog explicitly if the emulated
button click wasn't processed in wxDialogBase::OnCloseWindow().
Closes#12513.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65653 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Document the enum itself and also correct GetLocalizedResourcesDir()
documentation which didn't specify the default value for the category
parameter.
Closes#12523.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65652 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
std::tr1::unordeded_map<T *>::find() doesn't accept "const T *" pointer, at
least with MinGW 4.4.0 standard library version, so add an explicit
const_cast<> to fix compilation.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65651 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Explicitly choose the comparison operator to use when comparing wchar_t and
int values, otherwise MinGW (correctly) complains about ambiguity between
(int, int) and (wchar_t, const wxUniChar&) overloads.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65650 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
There doesn't seem any reason to allow access to all the other struct Tm
fields but not yday so make it public, fill it in correctly when creating Tm
without using its ctor from struct tm and document struct Tm itself including
its yday field.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65649 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Set Tm::yday to a fixed value in the ctor as well instead of not initializing
it at all.
This bug actually didn't have any visible consequences as yday is currently a
private member of struct tm and didn't seem to be used anywhere but it at
least avoids MinGW 4.x warnings about possibly uninitialized variable and
might become important in the future if we allow accessing this field.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65648 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Several warnings were generated for wxLogLastError() calls inside
CALL_CARET_API macro by MinGW 4.4. Fix them by adding the extra braces.
See also r61475.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65647 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Because ExpandPaths selects the item we can simply grab a list of selected paths and then expand them all in the multiple selection case. The single selection case is unchanged.
Closes#12340
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65591 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Don't generate key events without any valid key code (this shouldn't normally
happen but might on exotic keyboards with keys that we don't know about).
Also ensure that we can distinguish between VKToWX() returning dead keys and
non-Latin-1 keys by setting wchar_t output parameter to WXK_NONE too in the
former case but not the latter.
Generate wxEVT_CHAR_HOOK events for non-Latin-1 keys too in Unicode build.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65590 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Changes to VKToWX() semantics broke the logic of the global keyboard hook
function in wxMSW which didn't generate wxEVT_CHAR_HOOK events for ASCII
special keys such as WXK_ESCAPE any more.
Fix this and also generate wxEVT_CHAR_HOOK for all events, not just the
non-ASCII keys for consistency with the documentation and wxGTK.
Closes#12501.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65589 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Define WM_QUERYUISTATE in wx/msw/missing.h too as src/msw/statbox.cpp uses it
now.
Also move DT_HIDEPREFIX definition from wx/msw/private/button.h to missing.h
as well as it's now used in statbox.cpp too. Include missing.h explicitly from
the files that use DT_HIDEPREFIX.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65582 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Include sys/filio.h to define FIONBIO in all cases (sometimes this header is
already included from sys/ioctl.h but not always).
Closes#12481.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65581 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Only show the mnemonics if they need to be shown, i.e. use the same logic as
the standard controls use, to avoid showing mnemonics in wxStaticBox with
custom label colour even when other wxStaticBoxes don't show it.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65580 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The default handling for Alt key press in the standard control is to redraw
the label to account for showing of the keyboard queues (i.e. if the mnemonics
were initially hidden, they are shown when Alt is pressed) but it doesn't
redraw it in the correct colour resulting in any custom label colour being
lost whenever Alt is pressed anywhere in the window containing the box.
Fix this by forcing the box refresh which will result in repainting it using
our code which does use the correct colour.
Also update the static page of the widgets sample to allow changing the
colours of all static controls on this page, including the wxStaticBox, and
not just the main wxStaticText.
Closes#12497.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65579 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This function returns TRUE even if it failed to find any matching formats, so
test not only its return value but also the number of formats it found.
Closes#12474.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65575 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use task dialogs even for the dialogs with wxPD_AUTO_HIDE style flag and
without wxPD_CAN_ABORT one. Generic fallback was used in this case as native
task dialog doesn't support dialogs without buttons but it is finally better
to create a dummy button and use the native dialog nevertheless. We already
have a mostly disabled "Close" button for the dialogs without wxPD_AUTO_HIDE
style so it seems logical to also have it (but just never enable it at all)
when this style is used.
Closes#12462.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65574 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This is similar to the fix of r64208 for wxCalendarCtrl and ignores the time
component of SYSTEMTIME objects returned by the native functions in
wxDatePickerCtrl too to ensure that we operate with pure dates only.
Closes#12493.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65573 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
While the native CompareString() is much more efficient than MSVC CRT version
of _wcsicmp(), it gives unexpected results for non-letter characters, so don't
use it but use the slow but correct wxStricmp() instead.
At least don't use char-by-char comparison (in non-UTF-8 case) as it's the
slowest possible implementation of this function, the new one using
wxStricmp() is 3 times faster (by comparison, using CompareString() is 16
times faster still -- but wrong).
Closes#10375.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65572 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775