Benchmark the abstraction overhead of wxString methods compared to plain
functions and also benchmark native functions for string comparison under MSW.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65571 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This purely cosmetic change simply allows to see the output of the benchmarks
sooner which is more user-friendly when running several long benchmarks.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65570 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The fix applied in r64394 wasn't enough and the control could still decide to
overwrite the font used by default when non-ASCII characters were inserted
into it. To really force it to use the font we want we apparently must send it
EM_SETCHARFORMAT with SCF_ALL flag (MSDN also documents SCF_DEFAULT but it's
not clear if we should use it instead or together with SCF_ALL, for now it
doesn't seem to be necessary).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65565 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Split this overly long function into MSWSetCharFormat() and MSWSetParaFormat().
No real changes otherwise except for the use of PARAFORMAT instead of
PARAFORMAT2 if wxUSE_RICHEDIT2 is not set as it was certainly intended (but
the fact that nobody complained about this problem means that nobody must be
compiling without wxUSE_RICHEDIT2 by now so arguably we should just remove it
completely).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65564 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Set m_verRichEdit to a different value for the version 4.1 of the control as
it behaves subtly differently from the previous versions.
Also clarify that value of 2 is used for both 2.0 and 3.0 versions of the
control.
No real changes yet.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65563 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Add missing svn:eol-style property to all .cpp files. Also set svn:keywords for .cpp files which don't have that property yet to Id, including src/osx/core/glgrab.cpp for consistency (it doesn't make use of the property).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65561 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
If s_macAboutMenuItemId or s_macPreferencesMenuItemId was explicitly set to
wxID_NONE by the application, don't add them to the standard menu at all,
otherwise they would be present there but be always disabled and useless.
This is still not documented because we really need a better API for this but
it at least provides a temporary workaround for having useless menu items
under OS X.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65560 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The use of wxListBook in report mode was disabled for wxOSX in r54001 and
r54318 (see #9484) because it created problems with the native wxListCtrl
implementation but the report mode can be used if we're using the generic
wxListCtrl version so do allow to use it if the system option governing the
choice of the version to use is set to "generic".
Of course, the real fix would be to correct the bugs in the native wxListCtrl
version and use report mode always but for now this at least restores correct
behaviour with the generic version.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65559 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The linking optimization this macro protects against can't happen when using
DLL and so using it is at best useless and actually harmful (because it
doesn't contain the correct DLL export declarations) in the latter case.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65558 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Somehow MSVC 9 compiled invalid wxT(__FUNCTION__) expressions but both MinGW
and MSVC 6 (correctly) failed. Don't use this construct at all but instead
call wxLogLastError() with the real function name.
Also refactor the code slightly to avoid having to repeat this fix thrice.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65557 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
When a modal dialog showed another modal dialog, parts of the parent
window weren't refreshed correctly. This demonstrated itself as
rendering artifacts when moving the child dialog to another position:
parts of the dialog were shown as disabled, parts as enabled.
Fixed by explicitly refreshing the window.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65556 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Don't cache display rectangle and client rectangle as they can both change
during the program lifetime (especially the latter which changes whenever
taskbar is moved or shown/hidden) and retrieving them every time they're
needed doesn't seem to be a problem performance-wise anyhow.
We still cache the list of all the monitors, ideally we'd refresh it when we
receive a notification about a display being [dis]connected.
Closes#4582.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65555 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Under some unknown circumstances two added source files are concatenated into one faulty entry in an Xcode project (this probably occurs either at the Xcode or XMLTools2 level). Try to detect these errors in the Python script and fix them by patching up the project.pbxproj file.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65554 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxTextEntry::ChangeValue() doesn't generate any events so we need to
explicitly update the text stored by wxTextEntryHintData when it is called to
ensure that it corresponds to the real controls value.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65552 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The text controls contents and colour was not updated correctly in several
situations (see #12475).
The old code was completely wrong as it didn't store the actual value of the
control at all and so could never work. Do store and update it now and show
the hint if and only if the real contents is empty.
Also handle "text updated" event to correctly update the hint when the control
becomes [non-]empty.
Closes#12475.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65551 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Translation of wx (-1, -1) selection to (0, GetValue().length()) in
wxTextCtrl::SetSelection() was unnecessary as it ended up calling the base
class wxTextEntry::SetSelection() version which didn't need it. Moreover, this
translation was actually harmful when the text control happened to show a hint
string as its official value was empty in this case and so SetSelection(0, 0)
was called which didn't do anything and broke clearing/changing the controls
text when it was showing a hint.
Simply don't translate the indices when using a single line control to fix
this.
See #12475.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65550 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Instead of using uuid.NAMESPACE_DNS as namespace use a newly generated UUID. Also minor cleanup of import uuid statement.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65549 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Making them consecutive groups source files that are repeated next to each other in the project file like Xcode does, instead of creating a complete new random identifier which resulted in creating a distance between the source files after they were sorted.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65548 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Previously, it behaved differently from native combo box: clicking the
popup while its opening animation was running had no effect. This was
different from the native control, which would close the popup in this
case (just like when it's fully opened).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65547 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This was broken by the changes of r64879 which erroneously used
wxRendererNative::DrawItemSelectionRect() even for the non-selected items.
Now only use DrawItemSelectionRect() for the selected items to make them
appear natively while drawing the non-selected items with custom background
colour ourselves.
Also refactor the code to avoid (the not quite and hence especially
pernicious) duplication between wxListLineData::Draw() and DrawInReportMode():
rename SetAttributes() to ApplyAttributes() and draw the item background in
this function now instead of doing it in both Draw() and DrawInReportMode().
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65541 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
We don't need to run a modal event loop waiting for the wxProgressDialog to be
closed when it has wxPD_AUTO_HIDE style because it does it on its own.
Closes#12472.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65540 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
We deleted the data associated with the item too soon as we did it before the
handler for the item deletion event was run and this handler could still
access this data.
Only free the data after the handler returns now.
Closes#12449.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65536 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Our logic for detection of whether the first argument of
PENUMLOADED_MODULES_CALLBACK is const or not didn't work for MinGW64 4.5.
Replace it with a less error-prone (even if more ugly) version which simply
casts the callback to the type expected by the function.
Closes#12465.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65535 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Add new special API for wxDataViewVirtualIndexModel::Reset() as
wxDataViewModel::Clear is something different and needs a different, two
step API under GTK+, one for destroying the current view and one for
rereading the new contents.
Added ::BeforeReset() and ::AfterReset() notifications for that purpose.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65533 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Resolve the discrepancy between modifier flags of the key events corresponding
to the modifier key itself between wxMSW and wxGTK by changing the latter to
follow wxMSW behaviour.
Clearly document the now officially correct behaviour of the modifiers for the
key events corresponding to the modifiers keys themselves in the manual.
This fix also makes it unnecessary to work around this bug in the keyboard
unit test so remove it from there.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65527 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxGTK generated wxEVT_KEY_XXX with key codes corresponding to the unshifted
state of the key (except for the letters) but Unicode key codes corresponding
to the current shift state. This was inconsistent with wxMSW and also with the
idea that key events, unlike char ones, don't depend on the modifiers states.
Change wxGTK to behave as wxMSW and use unshifted values for Unicode key codes
as well.
Remove the now unnecessary workaround for different key event Unicode codes
from test.
Also try to explain the difference between normal and Unicode keys and key and
char events even better and mention that the Unicode key codes for the key
events are also untranslated in the documentation.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65526 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Don't hardcode the values of VK_OEM_XXX keys which are completely nonsensical
on keyboards with non-US layouts. Use the real unshifted value of the key as
its key code instead -- at least if it's a Latin-1 character. Otherwise, use
WXK_NONE as the key code and pass the character generated by the key as
Unicode character code.
Also generate WXK_NONE events for dead keys to avoid confusing them with the
corresponding normal key events.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65525 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Add missing elements of wxKeyCode enum ("Windows" and "Command" keys) to the
GetVirtualKeyCodeName() function in the sample.
Also output "unknown" and not blank for WXK_NONE.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65524 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
These functions were confusingly named as they work with MSW (virtual) key
codes and not character codes, rename them to better indicate what they do.
They also don't need to be in wx/msw/window.h included by all wx code when
they are only really needed in a couple of files, so move them to a private
header.
No changes in behaviour.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65523 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Only set Unicode key code if the event corresponds to a character key and set
it to (newly added) WXK_NONE for the other ones to avoid nonsensical values in
it for e.g. "Home" key presses.
Also set non-Unicode key to WXK_NONE for the characters that can't be
represented in the current locale. This is consistent with wxGTK and avoids
conflicts between special key values and Unicode keys.
Clearly document the above behaviour.
Notice that implementing the correct behaviour in wxMSW involved untangling
previously interwoven WM_KEY{DOWN,UP} and WM_CHAR messages handlers. Clearly
separate them now as they get different input (key codes for the former,
characters for the latter) and especially don't try to convert from both kinds
of input using a single wxCharCodeMSWToWX() function. As this function doesn't
need to distinguish between keys and characters any more it can simply return
the converted value in all cases instead of returning 0 sometimes to indicate
a character value instead of a key. Simplify the code using this function
accordingly.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65522 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxKeyEvent::GetKeyCode() and GetUnicodeKey() return 0 to indicate that the key
code or Unicode character is not available, give symbolic name to this 0 to
make the code using these methods more clear.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65521 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
KF_EXTENDED is defined in Windows headers as the mask for extracting the
"extended" bit from LPARAM of the keyboard messages. Use it instead of
explicitly writing less clear "1 << 24".
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65520 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Check that the events generated by wxUIActionSimulator result in the same
wxKeyEvents being generated under all platforms. This is not the same as
checking the event generation for the actual keys pressed by the user as there
are some small differences between the two but better than nothing.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65519 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Simulating keys such as WXK_END resulted in WXK_NUMPAD_END event being
generated instead of the expected WXK_END one.
Fix this by returning from wxCharCodeWXToMSW() whether the key code is a
normal or extended one and use this to set KEYEVENTF_EXTENDEDKEY in
wxUIActionSimulator::DoKey().
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65518 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Save the last key event before calling IM filter to be able to get the correct
modifiers, timestamp, position &c to use for the CHAR event generated from IM
commit callback.
This restores the changes of r34504 which were reverted for unknown (or at
least unmentioned) reason in r34521.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65517 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Key down/up events for the modifiers were already explicitly sent under wxMSW
and wxOSX but not under wxGTK where, as the result, the corresponding events
were not generated at all.
Do send these events explicitly to make the events generation consistent under
all platforms now. This means that wxUIActionSimulator::DoKey() now generates
exactly one event everywhere.
Notice that the modifiers for the key events generated by the modifier keys
are also the same under all platforms now which is not the case for the events
actually generated by the user (wxMSW sets the corresponding bit for the
modifier key down event but not the key up one while wxGTK does exactly the
contrary). This should be fixed in the future so that wxUIActionSimulator
generates the same sequence of events as the user would and that it's still
the same for all platforms.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65516 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
It doesn't make sense to fail if modifiers parameter includes wxMOD_CONTROL
telling the caller to use wxMOD_CMD instead as the latter is exactly the same
as the former under non-Mac platforms.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65515 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This macro can be used to easily register a test following a standard naming
convention in both the global test suite and the test suite with the same name
as this test instead of having to use 2 different cppunit macros to do the
same thing.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65514 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
No changes, just use more clear variable name ("keycode" instead of "id") and
anonymous namespace instead of static keyword.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65513 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775