This was apparently unintentionally added in r15050 to all files of the
widgets sample and somehow survived in this one only until now.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63241 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
We were not getting HDN_TRACK from the system because apparently it is not
sent for header controls with HDS_FULLDRAG style which is used by default by
the native list control. A possible solution would be to forcefully unset this
style but this would make the UI look old fashioned and less intuitive so
instead send these DRAGGING events from HDN_ITEMCHANGING.
Closes#9471,
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63240 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The condition for which this workaround is needed has already changed once
(see #11605) and may change again in the future as we test with more compilers
so use a symbolic name for it.
No real changes otherwise.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63237 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This allows to avoid problems with hiding all but the overridden overloads of
Insert() in wxSizer-derived classes, see #11616, without having to explicitly
write any using statements.
Keep Insert(size_t, wxSizerItem) virtual to allow the existing code overriding
it to keep working.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63230 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Failure to create a wxPaintDC in EVT_PAINT handler resulted in many serious
and difficult to debug problems under wxMSW. We used to document that the user
shouldn't do it but this wasn't enough (see #11648). We could also assert if
we detected that a handler didn't create a wxPaintDC but it seems better to
just handle this case gracefully for consistency with the other platforms.
Add wxDidCreatePaintDC global variable which is reset before generating
wxPaintEvent and set to true when ::BeginPaint() is called from wxPaintDC
ctor and validate the update region of the window ourselves if it wasn't set
(meaning that wxPaintDC wasn't created).
Update the documentation to emphasize the link between EVT_PAINT handlers and
wxPaintDC but without saying that wxPaintDC object must always be created in
the handler as this is not true any more.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63229 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The label was offset by 1 pixel vertically and the check marks were 1 pixel
too wide compared to the native ones under XP, correct this.
Closes#11420 (again).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63227 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
We must not set MENUITEMINFO::hbmpItem for the checkable items as it would
then be used for both checked and unchecked state.
Closes#11244.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63221 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
wxSTB_SIZEGRIP is part of default status bar style but it doesn't make sense
for non-resizeable TLWs, so turn it off in this case.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63195 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
If ConvertPixelsToDialog() or ConvertDialogToPixels() was called with
one of the two input values set to -1, the respective font metric was
queried needlessly.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63192 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Add links to samples sources in svn to all the individual samples and be even
more explicit about their location on the local disk.
Move the paragraph explaining the samples location further below -- but <hr>
still doesn't work somehow.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63190 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This was accidentally done because wxWindowBase::CreateBase() didn't recognize
the window as being top level as it was called before the window was appended
to wxTopLevelWindows list.
Fix this by doing the same thing wxGTK already did: just call
wxTopLevelWindows.Append() before CreateBase().
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63188 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This makes it possible to easily pass custom data between threads, in
type-safe way (thanks to internal use of wxAny). This adds
sizeof(wxAny)==16+sizeof(void*) overhead to wxThreadEvent, but I think
it's cheaper than doing malloc/free on copying.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63187 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
It's enough to do it once to ensure thread-safety. Doing it twice (once
in copy ctor called by Clone(), once in Clone() itself) only wastes
time.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63186 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
If the toolbar is not big enough for its fixed-size contents, we set the size
of the tools corresponding to stretchable spacers to 0 but this didn't really
work and resulted in bad toolbar appearance even after resizing it to be big
enough (as could be seen in samples/xrc).
So set the spacers size to at least 1 to ensure that we do resize them
correctly.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63173 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Notice that currently only stretchable spacers are supported via
separator-like "space" XRC element. If we ever add support for fixed spacers
in the toolbar we should do it via its fixed sub-element, e.g. they would be
specified with <fixed>1</fixed> in XRC file.
Also use spacers instead of separator in the XRC sample and ensure that the
toolbars in it are resized.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63172 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The old test was needlessly complicated, didn't take all cases into account
and had a typo in it which prevented it from working in half of the cases
which it did [try to] take into account.
Correct this by simply checking if the parent rectangle intersects the visible
display area at all.
Also simplify the code a little by checking for the window being maximized
from the beginning as centering a maximized window on either screen or parent
is a no-op.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63171 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
m_htSelStart and m_htClickedItem stored in wxTreeCtrl must be invalidated when
the item they point to is deleted (which also happens when all the items are
deleted), otherwise the selection doesn't behave correctly after doing it.
Closes#11619.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63170 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
We only generated wxEVT_COMMAND_TREE_KEY_DOWN events for the keys which can be
used for tree control navigation and which are handled specially in the code
but not the wxEVT_KEY_DOWN ones. This was inconsistent with the other keys and
incompatible with wx 2.8 and other ports, so generate both events unless the
wxEVT_KEY_DOWN one was handled by the user code.
Closes#11621.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63169 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775