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.
Vadim Zeitlin [Sun, 27 Nov 2011 19:50:23 +0000 (19:50 +0000)]
Added wxGetUTCTimeMillis() and wxGetUTCTimeUSec().
Fixed wxGetLocalTimeMillis() to really return the local time and provide
wxGetUTCTimeMillis() doing what this function used to do before. Closes #13610.
Also add wxGetUTCTimeUSec() for even higher resolution time stamps as it is
basically the same as wxGetUTCTimeMillis() anyhow, at least for MSW and
non-ancient Unix systems providing gettimeofday().
Vadim Zeitlin [Sun, 27 Nov 2011 19:50:08 +0000 (19:50 +0000)]
Use ::QueryPerformanceCounter() for wxStopWatch implementation in wxMSW.
QueryPerformanceCounter() provides higher resolution and precision for
measuring time under MSW, even though it suffers from some problems in older
Windows versions.
Vadim Zeitlin [Sun, 27 Nov 2011 19:50:05 +0000 (19:50 +0000)]
Use shorter sleep times in wxStopWatch unit test.
Make wxStopWatchTestCase::Misc() run in 2.5 seconds instead of 7. This not
only makes the test run faster but allows us to test wxMilliSleep() and
precision of wxStopWatch for time periods in fractional seconds.
Vadim Zeitlin [Sun, 27 Nov 2011 19:50:01 +0000 (19:50 +0000)]
Correct wxTLS_PTR definition for !wxHAS_COMPILER_TLS case.
wxTLS_PTR should have type of "T*" instead of being simply usable as "T*"
because of its overloaded operator->(), otherwise the code relying on it being
"T*" and compiling without problems in wxHAS_COMPILER_TLS case could fail to
compile without compiler TLS support.
Vadim Zeitlin [Sun, 27 Nov 2011 19:49:54 +0000 (19:49 +0000)]
Don't crash when changing label of label-less wxToggleButton in wxGTK.
If a button doesn't show any text label, simply don't do anything when
SetLabel() is called instead of replacing the image shown by the button with a
text label as the button doesn't expect this to happen and doing it breaks its
assumptions about the widgets it has and results in assert failures later.
Vadim Zeitlin [Sun, 27 Nov 2011 19:49:48 +0000 (19:49 +0000)]
Include webview library headers in the list of all headers.
Due to a typo in files.bkl (${...} was used instead of $(...) so the variable
didn't get really dereferenced), the web view headers were not included in the
list of all headers and hence not installed by "make install" under Unix.
Vadim Zeitlin [Sun, 27 Nov 2011 19:49:43 +0000 (19:49 +0000)]
Merge similar but not quite identical translated strings.
Some translated strings appeared several times in almost but not quite
identical form. Remove a few of them so that they don't have to be translated
multiple times.
Vadim Zeitlin [Wed, 23 Nov 2011 23:58:54 +0000 (23:58 +0000)]
Fix crash in wxTreeListCtrl::GetItemText() if text was never set.
Asking for the text of an item is not an error even if it was never set for
any column but the first one so just return an empty string in this case
instead of crashing.
Vadim Zeitlin [Tue, 22 Nov 2011 13:18:55 +0000 (13:18 +0000)]
Dismiss wxSplashScreen on any user input, not necessarily on splash itself.
Use wxEventFilter to remove the splash screen as soon as any user input is
detected anywhere in the application, not necessarily over the splash screen
itself.
This ensures that the splash screen disappears as soon as the user starts
working with the application instead of sticking around and covering the main
window.
Vadim Zeitlin [Tue, 22 Nov 2011 13:18:53 +0000 (13:18 +0000)]
Ensure that wxSplashScreen doesn't appear on taskbar nor in Alt-TAB list.
Having the splash screen in Alt-TAB window list under MSW was useless and ugly
(as it didn't even have the proper application icon) so use the appropriate
styles to avoid this.
Vadim Zeitlin [Tue, 22 Nov 2011 13:18:45 +0000 (13:18 +0000)]
Hack wxMSW wxNotebook to show the text controls correctly initially.
Add an Update() call to ensure that text controls in the initially selected
notebook page are shown correctly. It's almost certainly not the right fix for
the real bug that results in text controls not being shown when the notebook
comes up but it doesn't cost much and at least allows us to get correct
appearance for the themed notebooks.
Vadim Zeitlin [Fri, 18 Nov 2011 23:40:53 +0000 (23:40 +0000)]
Fix HasFocus() for composite controls.
Comparing the result of DoFindFocus() with the main window of composite
control doesn't work as it can return a child window so HasFocus() still
returned false for a composite control such as generic wxListCtrl even when it
did have focus.
Just use FindFocus() instead of DoFindFocus() to fix this.
Steve Lamerton [Thu, 17 Nov 2011 20:43:34 +0000 (20:43 +0000)]
Remove double buffering from wxWebViewIE as this is handled by the web browser control itself and actually makes flickering worse. Also remove an unnecessary background style.
Vadim Zeitlin [Tue, 15 Nov 2011 15:46:01 +0000 (15:46 +0000)]
Only update status bar fields after they were created in wxMSW.
Postpone updating statu bar panes after they were actually created.
Setting the status bar fields contents before setting the number of them
failed resulting in debug error messages and the text not appearing in the
status bar.
Vadim Zeitlin [Mon, 14 Nov 2011 13:35:52 +0000 (13:35 +0000)]
Replace wxT() with wxS() in image options definitions.
The optimal way of creating a literal strings consisting of only ASCII
characters is to use wxS() as this avoids the need for run-time conversion in
all builds while wxT() requires a conversion from wchar_t to UTF-8 in UTF-8
builds. So replace wxT() with wxS() in wxImage options definitions.
Also remove wxT() from the options documentation, it's just useless there.
Vadim Zeitlin [Mon, 14 Nov 2011 12:51:53 +0000 (12:51 +0000)]
Fall back on ::GetMessagePos() if ::GetCursorPos() fails under MSW.
In some rare but reproducible cases GetCursorPos() can fail and return without
filling in the provided point. Fall back to GetMessagePos() if this happens:
this is not ideal but clearly better than using uninitialized position or hard
coding something like (0, 0).
Vadim Zeitlin [Mon, 14 Nov 2011 12:51:47 +0000 (12:51 +0000)]
No changes, just add another case to a switch on wxMouseButton.
Fix warnings given when wx headers are compiled with g++ -Wswitch-enum option.
Also make the assert messages more precise and less verbose as there is no
need to include the function name in them, all relatively recent compilers
provide it via __FUNCTION__ and wxFAIL_MSG() already uses it.
Vadim Zeitlin [Fri, 11 Nov 2011 14:26:06 +0000 (14:26 +0000)]
Intercept some keys in wxMSW wxTextCtrl even if they're used as accelerators.
Bare (i.e. without any modifiers) Delete, Home and End keys are also required
by the text control itself so don't handle them as accelerators when wxTextCtrl
has focus.
Vadim Zeitlin [Thu, 10 Nov 2011 11:58:04 +0000 (11:58 +0000)]
Compilation fix for wxUSE_UNICODE=0 build after wxUSE_STL=1 fix.
The result of wxString::mb_str() can't be converted to wxScopedCharBuffer in
non-Unicode build but converting it to wxCharBuffer is always fine (though
slightly less efficient).
Vadim Zeitlin [Thu, 10 Nov 2011 00:30:04 +0000 (00:30 +0000)]
Remove all unwanted occurrences of -mt/-pthread in configure.
Remove all inappropriate compiler options and not just the first one as they
can occur multiple times because they may come from pkg-config output for
several different libraries.
Vadim Zeitlin [Tue, 8 Nov 2011 11:02:05 +0000 (11:02 +0000)]
Move GDK_META_MASK definition in the header in which it is also used.
The code using GDK_META_MASK was moved to wx/gtk/private/event.h from
gtk/window.cpp but the fallback definition of GDK_META_MASK for GTK+ < 2.10
remained in window.cpp.
Move it to the header as well now so that it can be compiled with GTK+ < 2.10
again.
Vadim Zeitlin [Tue, 8 Nov 2011 11:01:58 +0000 (11:01 +0000)]
Add missing stdio.h include to wxGTK assert dialog code.
As we use FILE for saving the assert message to a file, we must include
<stdio.h> (which is not included from any other header, at least not under
Solaris).