Vadim Zeitlin [Thu, 8 Dec 2011 14:47:37 +0000 (14:47 +0000)]
Only declare wxComboBox::Popup/Dismiss() when using Cocoa in wxOSX.
wxOSX/Carbon doesn't use the core implementation file so declaring these
methods for the Carbon version resulted in linking errors. Just don't do this,
they're not implemented for Carbon anyhow.
Vadim Zeitlin [Wed, 7 Dec 2011 23:41:14 +0000 (23:41 +0000)]
Work around impossibility to use wxCombobox in wxGrid in wxOSX.
Open the combobox when the editor is initially shown, this somehow ensures
that the combobox selection is taken into account when it is closed while
without this the selection is simply completely ignored.
This is just a hack but at least it allows to use wxGridCellChoiceEditor under
wxOSX which was previously impossible at all.
Vadim Zeitlin [Wed, 7 Dec 2011 23:41:10 +0000 (23:41 +0000)]
Use NSApp abortModal instead of stopModal to end modal dialogs.
Using abortModal is apparently the right thing to do if the dialog is not
being closed as the result of user action (but e.g. because a timer expired)
and shouldn't change anything if it done because of something the user did
(e.g. clicked on a button).
Vadim Zeitlin [Wed, 7 Dec 2011 23:21:06 +0000 (23:21 +0000)]
Don't use gtk_menu_item_set_submenu() with NULL menu with GTK+ < 2.12.
In GTK+ 2.10 and earlier gtk_menu_item_remove_submenu() had to be used to
remove the items submenu as gtk_menu_item_set_submenu() gave errors when
passed NULL submenu, so call the old function when using old GTK+ version.
Vadim Zeitlin [Wed, 7 Dec 2011 14:35:23 +0000 (14:35 +0000)]
Fix the size of the buffer when using wxIPC::Execute() with DDE.
Don't multiply the "realSize" variable by sizeof(wxChar) when passing it to
DdeClientTransaction(), as its name indicates it is already supposed to be the
size of the data and not the length of the string so just ensure that it is
always correctly set to the size and not length when initializing it.
Vadim Zeitlin [Wed, 7 Dec 2011 14:05:11 +0000 (14:05 +0000)]
Remove vertical wxTextCtrl adjustment hacks for wxMSW in wxComboCtrl code.
Because wxTextCtrl used to wrongly report its best size in wxNO_BORDER case
under MSW, wxComboCtrl manually adjusted its position to work around this.
However since r69066 wxTextCtrl::GetBestSize() was fixed and now these
adjustments resulted in wrong vertical position for the control.
Just remove all manual adjustments completely now to fix this.
Vadim Zeitlin [Wed, 7 Dec 2011 00:59:48 +0000 (00:59 +0000)]
Pretend that the window showing popup menu has focus in wxGTK.
This is necessary for compatibility with wxMSW as the focus remains on the
window which had it before the popup menu was shown there and existing code
relies on it, while in wxGTK the popup steals the focus when it's shown.
Vadim Zeitlin [Wed, 7 Dec 2011 00:59:43 +0000 (00:59 +0000)]
Fix build with Sun CC under Linux.
We need to explicitly define _GNU_SOURCE when building our code as we use it
configure when running the tests and it's not predefined by Sun CC, unlike g++
so we need to add it to CXXFLAGS ourselves.
An alternative solution would be to run the tests without _GNU_SOURCE but this
would lose too much functionality so it doesn't seem like a good idea.
Vadim Zeitlin [Wed, 7 Dec 2011 00:59:40 +0000 (00:59 +0000)]
Remove wxHAVE_GLIBC2 from configure, always predefine _GNU_SOURCE.
We used to test for glibc version first and predefined _GNU_SOURCE only if it
was greater than 2.1 but there doesn't seem to be any harm to just always
predefine _GNU_SOURCE under Linux (not that there are any systems with glibc <
2.1 left anyhow). Also do it much earlier to ensure that all tests are
affected by it.
And as we don't use wxHAVE_GLIBC2 anywhere else just remove it.
Vadim Zeitlin [Sun, 4 Dec 2011 23:57:36 +0000 (23:57 +0000)]
Add virtual dtor to wxCustomBackgroundWindowBase.
Suppress g++ warnings about a class with virtual methods but non-virtual dtor
by making the dtor virtual even if we don't need it to be virtual in this
class.
Vadim Zeitlin [Sun, 4 Dec 2011 12:26:24 +0000 (12:26 +0000)]
Do not declare "environ" variable ourselves under MSW.
The changes of r69564 making "environ" declaration unconditional broke
MinGW 4.6 build, presumably because "environ" is declared differently (as DLL
exported?) there, so avoid declaring it under MSW, we don't need to do it
there anyhow as it's always defined in system headers.
Vadim Zeitlin [Sat, 3 Dec 2011 00:34:00 +0000 (00:34 +0000)]
Fix bug with wxStopWatch::Start() not resuming paused stopwatch any more.
Since r69835 the stop watch remained paused even when Start() was called. Do
resume it when restarting it both for backwards compatibility and because it
makes more sense and also document this behaviour.
Mentioned more files in tn0011.txt that need version updating, and made it more clear which ones need to be changed manually. Modified inc_release to update docs/readme.txt and changed the version references in the readme.txt to 2.9.3. Also changed two references to the month of release from July to December.
Fixed x64 application termination after exceptions in a file dialog callback.
Since Windows 7 exceptions thrown in a file dialog callback (possibly by third-party utilities) aren't swallowed anymore. Make use of SetProcessUserModeExceptionPolicy (available in Windows 7 SP1) to temporarily restore the old behaviour and prevent the crashing (or summoning of the Program Compatibility Assistant) of an x64 application.
Vadim Zeitlin [Fri, 2 Dec 2011 00:50:41 +0000 (00:50 +0000)]
Update all controls using in-place editors to handle Escape/Return correctly.
Define EVT_CHAR_HOOK handlers to ensure that pressing Escape/Return while an
in-place edit control is active affects only it and is not used for the
keyboard navigation.
Vadim Zeitlin [Fri, 2 Dec 2011 00:50:35 +0000 (00:50 +0000)]
Fix reentrancy in wxDataViewRendererBase::FinishEditing().
Switching focus to the main wxDataViewCtrl window resulted in focus loss event
and a reentrant call to FinishEditing() itself if it wasn't called because the
in-place edit control was being destroyed the first time.
Fix this by destroying the in-place control first and adjusting the focus
later, the effect should be exactly the same but now FinishEditing() can be
safely called from anywhere in the code.
Vadim Zeitlin [Fri, 2 Dec 2011 00:50:29 +0000 (00:50 +0000)]
Don't use ListView_CancelEditLabel() as it doesn't work as expected.
ListView_CancelEditLabel() doesn't revert the controls value to the original
text as expected, so don't use it and revert to sending VK_ESCAPE to the
in-place edit control instead under all versions of Windows.
Vadim Zeitlin [Fri, 2 Dec 2011 00:50:25 +0000 (00:50 +0000)]
Make wxEVT_CHAR_HOOK propagate upwards and send it to the window itself.
Send wxEVT_CHAR_HOOK events to the focused window itself but make them
propagatable to ensure that the parent windows (including the top level
parent) still get it. This still allows the TLW parent to intercept keyboard
handling in its child but allows the child (or an intermediate parent window)
to have some say in the matter.
Vadim Zeitlin [Fri, 2 Dec 2011 00:50:19 +0000 (00:50 +0000)]
Added wxKeyEvent ctor for creating event of the different type for same key.
This is useful for implementation code in a couple of ports so provide a
higher level ctor doing this instead of having to use a copy ctor and then
manually changing the event type.
Vadim Zeitlin [Fri, 2 Dec 2011 00:50:16 +0000 (00:50 +0000)]
Refactor wxKeyEvent copying code.
Avoid duplication between copy ctor and assignment operator.
Also extract the assignment of everything not including the event type in a
reusable function as this can be useful for key event generation code in wxGTK
and possibly other ports.
Vadim Zeitlin [Thu, 1 Dec 2011 14:22:07 +0000 (14:22 +0000)]
Fix timeout used in POSIX implementation of wxCondition::WaitTimeout().
The time passed to pthread_cond_timedwait() must be in UTC, not local time,
but wxGetLocalTimeMillis() now really returns the time in local time zone so
we must use wxGetUTCTimeMillis() instead.
Vadim Zeitlin [Wed, 30 Nov 2011 09:16:44 +0000 (09:16 +0000)]
Fix wxWebView compilation in STL build with wxGTK.
Convert wxString to GTK+ strings explicitly, implicit conversion doesn't
happen in STL build and may be wrong anyhow as it doesn't necessarily convert
the strings to UTF-8 expected by GTK+.
Vadim Zeitlin [Wed, 30 Nov 2011 00:52:34 +0000 (00:52 +0000)]
Make wxMSW status bar slightly less tall by default.
The status bar in wxMSW applications was too big under Windows 7 because it
used EDIT_HEIGHT_FROM_CHAR_HEIGHT() to calculate the height which was simply
unwarranted here. Instead, make the status bar tall enough to accommodate
simple text contents by default and fix SetMinHeight() to actually work for
the cases when a taller toolbar is needed.
Vadim Zeitlin [Tue, 29 Nov 2011 19:27:14 +0000 (19:27 +0000)]
Don't include pbt.h from wxMSW code unnecessarily.
The contents of this header is available from winuser.h (included by
windows.h) since at least 15 years and pbt.h itself is not included in the
latest Platform SDK releases (8+) so simply don't include it and also don't
test for its availability in configure.
Steve Lamerton [Mon, 28 Nov 2011 20:19:16 +0000 (20:19 +0000)]
Override MSWTranslateMessage for wxActiveXContainer. Calling IOleInPlaceActiveObject::TranslateAccelerator ensures that accelerators and other keyboard functionality behaves correctly.
Vadim Zeitlin [Mon, 28 Nov 2011 19:15:57 +0000 (19:15 +0000)]
Correct HasFocus() to work with subwindows of a composite control.
When a subwindow (i.e. one that overrides GetMainWindowOfCompositeControl() to
return a parent window) has focus, HasFocus() should return true for it too,
in addition to returning true for the main window.
Vadim Zeitlin [Mon, 28 Nov 2011 18:58:52 +0000 (18:58 +0000)]
Extend wxBannerWindow background bitmap if necessary.
Ensure that the entire banner window uses the same background colour as the
bitmap, even when the bitmap is too small for the window size. This allows to
avoid using huge bitmaps if extending the bitmap with solid colour looks good
enough.
Vadim Zeitlin [Mon, 28 Nov 2011 14:16:03 +0000 (14:16 +0000)]
Added instructions about building applications using wxMSW.
Explaining how to build wxWidgets itself is insufficient as usually people
want to actually build their programs using it and not just the library
itself, so add a section explaining how to build the projects using wxMSW.
Also add a table of contents and mention that MSVC and g++ are the main
supported compilers.
Vadim Zeitlin [Mon, 28 Nov 2011 13:34:16 +0000 (13:34 +0000)]
Ignore WXK_NONE events in wxStyledTextCtrl.
Scintilla use of 0 indicating "modifier key" conflicts with our use of
WXK_NONE indicating absence of a valid key code. As Scintilla can't do
anything with the keys without a key code anyhow, simply ignore them
immediately, without passing them to Scintilla, in DoKeyDown().
This fixes handling of IME input in wxStyledTextCtrl under MSW and possibly
other problems (e.g. with dead char keys).
Vadim Zeitlin [Sun, 27 Nov 2011 20:28:43 +0000 (20:28 +0000)]
No changes, just moved wxLocaltime_r() and wxGmtime_r() to wx/time.h.
These functions are used by wxGetTimeZone() defined in time.cpp and so need to
be available from wx/time.h. This is also the most logical place for them.
Vadim Zeitlin [Sun, 27 Nov 2011 19:50:53 +0000 (19:50 +0000)]
Add support for VK_OEM_102 key under wxMSW.
This is the "<>|" key on German keyboard and is also used in many other
layouts so failing to handle it resulted in not receiving EVT_KEY_XXX events
for these keys in wxWidgets programs.
Vadim Zeitlin [Sun, 27 Nov 2011 19:50:49 +0000 (19:50 +0000)]
Set Unicode key code correctly for key events for WXK_RETURN in wxMSW.
WXK_RETURN is an ASCII character so return it from wxKeyEvent::GetUnicodeKey()
for EVT_KEY_{DOWN,UP} events, especially as it was already done for EVT_CHAR
ones.
Vadim Zeitlin [Sun, 27 Nov 2011 19:50:45 +0000 (19:50 +0000)]
Change value of wxHELP to avoid clash with wxSTAY_ON_TOP.
Using wxSTAY_ON_TOP with wxMessageDialog resulted in "Help" button appearing
since r68537 because these two constants had the same numeric value.
Avoid this by changing wxHELP value to be the same as wxCLOSE_BOX instead: the
latter can't be used with wxMessageDialog so this should solve the problem,
even if there are still conflicts. Also adjust the other button constants
values to account for wxHELP change.
Vadim Zeitlin [Sun, 27 Nov 2011 19:50:42 +0000 (19:50 +0000)]
Use wxGetUTCTimeUSec() in wxStopWatch under Unix for higher precision.
If gettimeofday() is available we can achieve better than millisecond
precision (even if it usually isn't as high as microsecond), so use it as
clock source in wxStopWatch.