Use just one type, wxDataViewTreeNode, to represent any kind of node.
Previously a complicated structure that represented leaves and non-leaf
nodes differently was used. This make the code way too complicated and
caused some smaller bugs (see e.g. #13256).
As a side effect, this change makes the control react correctly to
changes in IsContainer() return values.
Also fixes#13256.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68913 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Call the node object corresponding to 'parent' 'parentNode' instead
of just the more vague 'node'. Also, 'nodes' instead of 'nds'.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68912 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Derive generic wxSearchCtrl from wxCompositeWindow<> to ensure that calls to
its Set{Fore,Back}groundColour() are propagated to all its children, otherwise
they applied only to the composite control itself but not e.g. its text part.
Also update the bitmaps when the background colour changes to ensure that it
appears as transparent.
Closes#13428.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68911 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxCompositeWindow::GetCompositeWindowParts() becomes simpler to implement in
the derived classes with optionally shown elements if NULL windows are allowed
(and ignored) in the list returned by it.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68910 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Removed wxNotebook::DoGetBestClientSize to let wxBookCtrlBase::DoGetBestSize do its job and fix the best size of a wxNotebook (formerly when running the notebook sample the notebook was not wide enough).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68903 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Many wxUniv controls had a way too small best size which was noticeable when running e.g. the widgets sample. Regression started in r61169 where wxWindowBase::DoGetClientBestSize() was introduced but that virtual function already existed in wxUniv's wxWindow. Removing wxUniv's wxWindow::DoGetBestSize and wxWindow::DoGetBestClientSize fixes sizing issues.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68902 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The AdjustSize renderer function for wxUniv's GTK and MSW theme adjusted the size of a scrollbar while it already had the correct size, resulting in scrollbars being twice as wide. Fixed by not adjusting the size of a scrollbar anymore in AdjustSize.
Closes#11660.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68901 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Buttons had a border of wxBORDER_NONE resulting in wxButton::DoDraw not drawing the button's border. Fixed by adding wxAnyButton::GetDefaultBorder() for wxUniv which returns wxBORDER_STATIC. Regression since r67931.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68900 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
MSW-only functions were compiled in, disabled their usage by adding #ifndef __WXUNIVERSAL__ blocks.
Closes#13399 (again, after r68723 already should have closed it but its commit message contained a typo).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68899 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The code in wxSplitterWindow tried to remember the requested position and set
the real sash position to it later, even if the initial window size was too
small to allow for it, but it didn't work because the requested position was
forgotten after the first size event, even though it was quite possible that
this event didn't really change the window size from the initial, small, one.
Try to make this more robust by ignoring the size events which don't really
change the window size. Also set m_lastSize correctly initially.
Now setting the sash position does work even if the splitter itself is inside
nested sizers (which results in many size events).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68876 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
m_rawControlDown is supposed to be only used under OS X so put an #ifdef
__WXOSX__ around it in wxKeyboardState::GetModifiers() to fix compilation
under the other platforms.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68870 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Don't return the whole event object from SendExpanderEvent() just to check if
it wasn't vetoed, simply return a boolean value indicating if this was the
case from this function itself.
This makes it both more efficient and easier to use.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68867 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The code sending the event must check whether the event was vetoed or not, not
whether it was skipped or not. This is the minimal change resulting in correct
behaviour even if an event handler does skip the event.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68866 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Using setlocale() can thoroughly confuse wxNumValidator because it results in
a mismatch between the decimal and/or thousands separators it uses, returned
by wxLocale, and the actual separators in the strings, formatted by the CRT.
So mention in the documentation that using setlocale() is a bad idea.
Closes#12970.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68863 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Under wxMSW it's possible to have mismatch between the CRT locale (used by
various printf-related functions) and the system locale (queried by
wxLocale::GetInfo()).
Warn if such a mismatch occurs and tell people to use wxLocale instead of just
setlocale() to change the locale.
See #12970.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68861 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Don't use WXDLLEXPORT_DATA when defining the variable, it can be only used
when declaring it.
This fixes wxMSW DLL build with MSVC.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68860 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Having wxBITMAP_TYPE_TIFF and wxBITMAP_TYPE_TIFF_RESOURCE is more consistent with already using the complete short name of an image format elsewhere (e.g. wxBITMAP_TYPE_JPEG, not wxBTMAP_TYPE_JPG, and wxTIFFHandler as opposed to wxTIFHandler). Renamed all existing occurrences and kept the old enum values for backwards compatibility.
Also renamed occurrences of wxBITMAP_TYPE_RESOURCE to the already existing wxBITMAP_TYPE_BMP_RESOURCE.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68859 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Native wxAnyButton headers were being included but the sources aren't used in wxUniv. Fixed this by not including any native header in wxUniv and instead made wxAnyButton a typedef of wxAnyButtonBase.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68858 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Make use of HasImageList() and GetImageList() instead of accessing the now private m_imageList directly. Fixed for wxUniv, wxGTK1, and wxOS2 (the latter 2 blindly). Changes are similar to r68856 and should have been a part of that.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68857 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxUniv's wxNotebook was accessing m_imageList which now is a private in wxWithImages since r68809. Fixed by using wxWithImages::HasImageList.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68856 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
If the text of any of wxDataViewCtrl cells was set before the control was
realized (e.g. during its creation), the code tried to refresh the not yet
shown widget resulting in GTK+ errors.
Avoid this by only refreshing the tree if it's realized.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68853 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Non-const wxWindow pointers are unfortunately needed quite often in wx API so
return a non-const pointer here to allow using it with e.g. wxRendererNative
(whose methods all take non-const wxWindow pointers) in the derived classes.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68852 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Add IsSameAs() to make it simpler to call from the derived class operator==()
implementation.
Also make comparison operators themselves members instead of global functions
to avoid considering them as matches for all operator==() uses in the program,
there is really no need for this as we do _not_ want to allow implicitly
converting something to wxDataViewIconText when comparing.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68851 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The standard size of the small icons in list controls under MSW is
traditionally 16*16 so return this from wxMSW wxArtProvider.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68850 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxDataViewCtrl::GetSelection() now always returns invalid item if more than
a single item is selected in a multi-selection control.
Also add HasSelection() and GetSelectedItemsCount() to allow checking if any
items are selected.
Updated the documentation, all ports and added a test for all these functions.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68844 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
CPPUNIT_ASSERT_EQUAL() gives more informative error messages in case of
failure which is important when running tests unattended on build slaves.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68843 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Add an extremely simple RAII wrapper around GList and use it.
Also add wxGtkTreePathList which also automatically frees its contents to
simplify working with the lists of GtkTreePaths.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68842 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Doing this is unnecessary and results in compilation errors in PPC and x86
builds when using old (4.0.1) version of the compiler.
So make WXEXPORT added in r67575 specific to 64 bit builds.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68841 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Move it from wxButtonXmlHandler into a reusable wxXmlResourceHandler::
GetDirection() that can used by the other handlers too.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68839 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This allows to provide just a single image (in "generic" subdirectory) for the
generic controls that look the same in all ports instead of having to create
three identical ones (in "wxmsw", "wxgtk" and "wxmac" subdirectories) that are
required by @appearance.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68837 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775