Allow retrieving the text from columns other than the first one directly.
Add implementations for MSW and generic versions, documentation and a unit
test.
Closes#11597.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64281 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use a bit freed by removing wxTINY_CAPTION_HORIZ for wxDIALOG_NO_PARENT. This
allows to move it out from the lower byte of the style word to avoid conflicts
with the button selection flags which can be commonly combined with the dialog
styles.
More precisely, wxDIALOG_NO_PARENT used to clash with wxCENTRE, meaning that
wxSingleChoiceDialog, for example, was always created without parent because
its default style included wxCENTRE. This commit fixes this particular bug and
probably more similar ones.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64280 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
These two styles were always equivalent so we can just as well replace them
with a single one and stop wasting an extra bit.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64279 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Add comments allowing to see more clearly the styles allocation.
Please make sure to amend them if you change any style values in the future.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64278 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Painting on both wxPaintDC and wxClientDC simultaneously doesn't work well,
e.g. under Windows the client DC can be actually erased after we finished
painting the window contents, overwriting it.
Simply use wxDC::Clear() instead of wxWindow::ClearBackground() to avoid this
and document the danger of using ClearBackground() from EVT_PAINT handler.
Closes#10700.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64277 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
ProcessEventHere() doesn't have to be public any more now that we have
ProcessEventLocally() which is safe to call from the outside (i.e. doesn't
forget about the chained event handlers and validators).
Still keep this function because it makes the code more modular and also
because we might want to make it virtual for consistency with TryBefore() and
TryAfter() later. Also rename it to TryHere() to make the symmetry with these
functions more manifest.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64264 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use wxEvtHandler::ProcessEventLocally() instead of ProcessEventHere() when
forwarding events in the docview code. This ensures that any event handlers
chained with the objects involved (document manager, document, view) will be
used.
Incidentally the old code didn't work at all as ProcessEventHere() didn't even
call TryBefore() where the (further) forwarding was implemented.
Closes#10640.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64263 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Add ProcessWindowEventLocally() which wraps ProcessEventLocally() in the same
way as ProcessWindowEvent() wraps ProcessEvent(). I.e. it allows to process
the event in this window only, without propagating it upwards, but taking into
account any event handlers associated with it.
Use the new method in wxMDIParentFrame code in wxMSW to ensure that event
handlers pushed on MDI children frames are taken into account. Add a test for
this to the MDI sample.
Closes#11225.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64262 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This new method can be used to only process the event in this handler or any
handlers connected to it (unlike ProcessEventHere() which doesn't follow the
chain at all), without propagating the event upwards (unlike ProcessEvent()).
Unfortunately implementing this required a field to wxEvent but there doesn't
seem to be any other way to do what we need.
There should be no user-visible changes after this commit, it just paves the
way for the upcoming fixes.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64261 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The event pre-processing hooks associated with the window should be called
only once during the event processing, we don't need to call TryBefore() for
each and every event handler associated with the window too.
This makes the code slightly simpler and faster and shouldn't change the
behaviour of any existing code.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64260 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Popup menus with title set via SetTitle() had bold font, but menus
created by passing title as ctor argument used normal font. Fixed this
by using the same code (SetTitle) in both cases, instead of having two
independent (and out of sync) implementations of the same functionality.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64255 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Since r53743 the listbox best size was only invalidated during idle time but
this meant that it could be laid out using incorrect old best size. So while
we still defer (expensive) horizontal extent calculation until later, do
invalidate the best size immediately to ensure the listbox is laid out
correctly.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64246 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Performing N commands (where N is the maximal number of commands stored by
wxCommandProcessor), undoing N-1 of them and performing another command
resulted in a crash because a dangling pointer was left.
Closes#12027.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64245 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Add separators with correct kind, setting m_kind doesn't work any more because
it's overwritten below.
Also add a comment explaining why is overriding the user-specified kind the
right thing to do here.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64244 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Add missing wxRibbonControl::Create() method. Ensure that member variables are
always initialized by the ctor. Check that we're fully initialized in EVT_SIZE
handler.
Closes#12018.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64243 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
GTK+ provides GtkRecentManager for this purpose since 2.10. Use it in
wxFileHistory if available. Integration is simple, we just add a file to
GtkRecentManager in addition to normal wxFileHistory handling.
A well-behaved GNOME application would use GtkRecentManager as the
primary store for recent files, so that it reflects when the user works
with supported files in another editor(s) too. But for now, this is much
better than no support at all.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64240 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This window is only used as a container for the sub-windows and shouldn't
accept focus, trying to set it to it doesn't work anyhow (see #12004).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64230 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The generic double spin control sent UPDATED events whenever it lost focus,
whether anything changed or not.
Don't send events unless the controls value has really changed.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64229 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
We could be left with an invalid value in the control when leaving it. E.g. in
the widgets sample whose double spin control has range from 0 to 10, 123 could
be entered in it and was not replaced by 10 when the control lost focus. This
happened because the code didn't bother to update the text control if its
contents already corresponded to the internally stored value -- but this was
wrong as it could have a different representation.
Just always update the text unconditionally when synchronizing it with the
internal value.
See #12004.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64228 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
In the native OS X tree control right cursor arrow expands the current item
and the left one collapses it if it's expanded, make the generic control work
like this too under Mac.
Closes#12019.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64227 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
We already check that positive (i.e. specified by user and not generated by
wx) window ids are in 0..SHRT_MAX range. Now do the same for the menu ids as
ids outside of this range suffer from the same problem under MSW: they get
wrapped and become negative when we receive events for them.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64226 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Instead of calling back into wxTranslations to actually load the data,
return wxMsgCatalog instance from
wxTranslationsLoader::LoadCatalog(). This requires making wxMsgCatalog
public.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64223 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wx incorrectly assumes that Unix locale codes have the form of xx_YY,
where both xx and yy are two characters long. This is wrong, xx is
ISO 639 code, which can often have 3 characters ("ast", "gez" etc.);
future ISO 639-6 will have up to 4 chars. Similarly, ISO 3166 has
alpha-3 variant of country codes too (even though they aren't used in
this context today).
For parsing needs, we can just look for '_' in the code. The only place
where a check for xx_YY code was performed was GetSystemLanguage().
Instead of bothering with correct check (or a heuristic), let's simply
assume locale is xx_YY code and only do alternative handling if that
assumption fails. According to the comments, this alternative handling
was for cases such as LANG=german environment on SuSE, but it's safe to
say that no modern systems do that anymore, so it's OK that this patch
is marginally less efficient on such legacy systems.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64218 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This class is used by wxDataViewCtrl implementation only, there is no need for
it to be in a public header.
Move the class declaration from wx/dataview.h to datavcmn.cpp.
See #11732.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64217 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775