Forward declare more classes, in particular use tagRECT which can be forward
declared, instead of RECT typedef in public headers.
Also include more header in #ifndef WX_PRECOMP case.
See #11595.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63272 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Don't use HDC in public headers, it may not be declared there. Use WXHDC
instead even if this means having ugly casts.
This fixed mingw32 compilation (see #11595).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63252 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Only keep common code in the base class and extract all menu/listbox-specific
stuff into derived classes.
This makes the code cleaner and more maintainable but introduces some problems
in wxCheckListBox appearance which will be fixed by the next patch.
Closes#10635.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63220 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
When wxTR_FULL_ROW_HIGHLIGHT is used, the item visually takes up the entire
breadth of the window so clicking both to the left or to the right of the item
should have the same effect as clicking on it.
So add a MSWIsOnItem() helper which tests for whether a point is above the
item correctly and use it in order to:
1. In multi selection mode, allow clicking anywhere to select the item(s)
when Ctrl or Shift is pressed (Closes#11598).
2. Generate activation event when clicking to the right of the item too
(Closes#11602).
3. Detect item bounds correctly in WM_LBUTTONUP handler (although it's
not really clear what does this code do and hence what problem does this
fix...).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63089 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This replaces WX_DECLARE_AUTOOLE with easier-to-debug version. The
macro is still preserved for backward compatibility.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63038 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Also correct wxWinVersion_2003 definition, it should have the same value as
wxWinVersion_XP. And add wxWinVersion_XP_SP2 == wxWinVersion_2003_SP1.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63030 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Forward declaring enums is illegal in standard C++ and while MSVC allows this
as an extension, it doesn't compile with g++.
Just include wx/settings.h instead.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62993 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Do use TBSTYLE_FLAT and TBSTYLE_TRANSPARENT (the former actually implies the
latter) for MSW toolbar as it is the only way to avoid the flicker of toolbar
buttons. These styles were disabled before because of lack of understanding
about how they worked: with them, the toolbar supposes that its parent takes
care of erasing its background but wx didn't do this (in fact wxFrame did
accidentally erase toolbar background because of the use of Win32 client
rectangle, including tool/status bars, instead of wx client rectangle,
excluding them, in wxWindowMSW::DoEraseBackground(), but it didn't do it
correctly).
Now we allow hooking WM_ERASEBKGND events processing in a parent window by a
child one and use this to handle toolbar background erasing in toolbar itself.
We still prevent the native toolbar from drawing dummy separators and always
erase the area occupied by them ourselves and thus avoid the flicker entirely.
The only remaining flicker in the toolbar sample is that of embedded
wxStaticText control. It does appear with correctly transparent background and
bitmaps with alpha channel also (still) are drawn correctly in wxStaticBitmaps
embedded in the toolbar.
Finally, we still use solid background brush for toolbar but we can easily use
a themed background if really desired, there is just a single function to
change to do it (MSWGetToolbarBgBrush()).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62971 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Prevent the native toolbar from drawing the separators which we use simply as
placeholders by excluding them from the update region when handling WM_PAINT.
This reduces flicker by not redrawing the areas occupied by these separators
twice and also prevents them from ever being shown (you could see them briefly
appear before being erased before).
The other toolbar tools still flicker though, there doesn't seem to be any
simple way to prevent the control from entirely invalidating itself whenever
it is resized.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62934 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Pass wxWindow instead of HWND to it as in most cases we already have wxWindow
for the HWND we have and calling wxFindWinFromHandle() once more is
unnecessary.
This also makes the code of MSWGetBgBrushForChild() slightly simpler.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62932 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Native toolbars don't have themed background under Vista/7 and don't look good
with rebar background (which is the same one as used for the menus) as
toolbars don't appear on the top of the window.
Erasing background ourselves also results in flicker and display problems and
makes the code much more complicated. Simply don't do this to avoid all the
problems.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62931 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Not using FVIRTKEY results in problems in non-US keyboard layouts and, in
fact, we were already always using it because wxCharCodeWXToMSW() returned
true in its output IsVirtual argument most of the time.
Just do it always now and also remove IsVirtual parameter with badly (if at
all...) defined meaning from wxCharCodeWXToMSW() as it's not used anywhere any
longer.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62913 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Stretchable spaces consume all extra toolbar space not allocated to the fixed
size items. They can in particular be used to right-align (some) toolbar tools.
Add and document the new API, change the sample to show it and implement it
for MSW, GTK and OS X/Cocoa.
Also refactor MSW background erasing/repainting code to avoid duplicated calls
to DrawThemeBackground(), call it from a new helper MSWEraseRect() function.
Note that we may want to add support for "invisible" separators, IOW
non-stretchable spaces. This could be easily done for MSW after the changes in
this commit and is supported natively by GTK+ and Cocoa so implementing this
would be trivial if there is any interest.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62850 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit doesn't introduce any changes in the control behaviour, it simply
moves the existing method to the base class because it is not MSW-specific.
Also implement wxTextCtrlBase::GetClassDefaultAttributes() because if a class
implements GetDefaultAttributes() it should implement it as well.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62803 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxFileDialog::GetPath() didn't return the value set by a previous call to
SetPath() in wxMSW version. Fix this and also implement SetPath() and
SetDirectory() methods in the generic versions in the same way as
SetFilename().
Closes#3672.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62722 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxFont::GetNativeFontInfoDesc() and GetNativeFontInfoUserDesc() were
overridden just to ensure that the font is realized but it makes sense to do
it in wxFontRefData::GetNativeFontInfo() itself as detecting the face name
won't work if the font is not realized anyhow. And then we don't need these
functions at all as the only thing they do is checking that the font is valid
when they are called but this can be done in the base class itself as this
should happen in all ports (document that this is the case).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62717 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
For MSW, check for gdiplus.h availability when using configure but only
support it for MSVC 7+ otherwise. For the other platforms, always support it.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62704 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
PostQueuedCompletionStatus() may be either an int or a pointer, pass 0 instead
of NULL when we don't care about its value anyhow.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62678 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Merges everything from the branch with only some minor changes, mostly renamed
wxUSE_FSWATCHER_{INOTIFY,KQUEUE} to wxHAS_{INOTIFY,KQUEUE}.
Add wxFileSystemWatcher and related classes.
Also introduces wxEventLoopSource.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62474 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This function is not MSW-specific and should be used in generic implementation
of controls such as wxListCtrl, wxTreeCtrl and wxDataViewCtrl. Even if it is
needed by MSW only now, move it to the common code to avoid #ifdefs in these
controls code.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62151 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Because Windows uses margins around the text drawn in the status bar, naively
setting a field width to the size of the text didn't work (see previous
commit for an example). As this seems a natural enough thing to do, account
for this margin inside wxStatusBar itself to avoid the user code the trouble
of having to call some special function to do it. Notice that this does mean
that fields not containing text may be slightly larger than needed, but we
consider that this (rarer) case is less important.
Also account correctly for the status bar grip size. And while we still hard
code its size, do it in a clearly named function instead of using completely
mysterious constants here and there.
Closes#10696.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61992 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
If wxMDIParentFrame object was created without its Create() ever being called,
it crashed in its dtor trying to delete an uninitialized pointer, so do
initialize it to NULL in all ctors (via a helper Init() method, as usual).
Closes#11216.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61986 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxUSE_RIBBON was apparently added to the different wx/*/setup.h files manually
instead of being added to wx/setup_inc.h and regenerating the rest, correct it.
Also check that it is defined in wx/chkconf.h.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61968 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Under Unix wxDEBUG_LEVEL can be set using configure --enable-debug=max option
but under Windows it needs to be changed in wx/msw/setup.h so add it to this
file with a comment explaining its meaning.
Also document this symbol with the other preprocessor constants.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61890 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
By default include assertions and debug logging in both debug and release
builds but disable them in application release builds (when NDEBUG is
defined).
Also update (more accurately, replace) debugging overview.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61886 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The default colours for this control are wxTextCtrl-like and not wxButton-like
(which is the default). Override GetDefaultAttributes() to indicate this and
to avoid returning a wrong background from wxControl::DoMSWControlColor() when
just a foreground is set.
See #1691.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61858 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This allows the code in wxWindowMSW::HandleCtlColor() to find the correct
control when handling the messages from the buddy control and hence setting
the colours for wxSpinCtrl works after this change.
Closes#1691.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61845 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775