There are no real changes in this commit but it removes all trailing white
space from our source files. This avoids problems when applying patches and
making diffs and it would be nice to prevent it from reappearing.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65680 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This was broken by the changes of r64879 which erroneously used
wxRendererNative::DrawItemSelectionRect() even for the non-selected items.
Now only use DrawItemSelectionRect() for the selected items to make them
appear natively while drawing the non-selected items with custom background
colour ourselves.
Also refactor the code to avoid (the not quite and hence especially
pernicious) duplication between wxListLineData::Draw() and DrawInReportMode():
rename SetAttributes() to ApplyAttributes() and draw the item background in
this function now instead of doing it in both Draw() and DrawInReportMode().
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65541 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
For consistency with the generic version and because it makes more sense than
blocking in the dialog destructor (which is the only other alternative for the
dialogs without wxPD_AUTO_HIDE to work), we should block in Update() when the
maximal value is reached for dialogs without wxPD_AUTO_HIDE style until the
dialog is dismissed.
Document this behaviour even more clearly.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65507 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Provide a SetMaximum() function for setting just m_maximum and return its
value from GetRange() instead of using m_gauge->GetRange() which doesn't work
when the native MSW version is used nor when the range is > USHRT_MAX under
MSW in any case.
More generally, this should fix a lot of bugs for progress dialogs using such
range as the values were not interpreted correctly in many places.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65506 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Storing progress dialog styles in the normal window style didn't work because
they clashed with the TLW styles. The original progress dialog implementation
worked around this by using separate m_has{Abort,Skip}Button variables instead
of relying on wxPD_CAN_{ABORT,SKIP} style bits but this didn't work for the
other styles and was unclear so the new native MSW implementation blithely
used m_windowStyle to test or them and other bits which didn't work at all,
see #12416.
Solve this by using a separate m_pdStyle variable for storing the progress
dialog styles and use it for all wxPD_XXX tests in both the generic and MSW
code. This fixes some bugs (although not all of them yet) and allows to get
rid of m_has{Abort,Skip}Button.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65501 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxGenericProgressDialog needs to have an active event loop in order to repaint
itself and process clicks on its buttons but it's more helpful to create a
temporary event loop if there is no currently active one instead of just
asserting. In particular, this allows to use wxProgressDialog from overridden
wxApp::OnInit().
Add temporary event loop creation and remove the now unnecessary asserts
verifying that there is an active event loop as there always will be one.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65499 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This field wasn't initialized by Init() which might have been harmless
considering the current code structure but still untidy, do set it to NULL
there.
Also move the forward declaration of wxWindowDisabler class in
wx/generic/progdlgg.h to the top of the file for consistency with the other
forward declarations.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65498 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
A cached attribute may continue to be used even though the attribute returned
by a custom wxGridCellAttrProvider has changed so add a method to force wxGrid
to update the attribute by forgetting the cached copy.
Closes#12406.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65451 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Custom labels set for wxGenericMessageDialog buttons were simply ignored as it
used CreateSeparatedButtonSizer() to create the actual buttons which in turn
always used the standard labels.
Fix this by explicitly creating the buttons with custom labels if necessary.
This also fixes custom label support in wxGenericRichMessageDialog deriving
from this class.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65449 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Move IsCheckBoxChecked() to the .cpp file where wxCheckBox is fully defined
and not just forward declared (at least when not using PCH).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65356 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
If available, the task dialog is now used for the wxProgressDialog under
Windows. This provides a much more native looking dialog which doesn't look
out of place under modern Windows versions, unlike the generic implementation.
The internals of the code had to be significantly changed as the task dialog
can only be shown modally so, to emulate wxProgressDialog modeless nature, a
separate thread is used for the progress dialog management.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65352 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This is a generalization of wxMessageDialog based on the native task dialog
under recent (Vista and later) Windows versions and implemented generically
for the other ports for now.
It provides the possibility to use additional controls in the message boxes
(checkbox useful for the "Don't ask me again" kind of dialogs and collapsible
detailed explanations field) and better look and feel under Windows.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65349 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use the task dialog instead of the legacy message box for wxMessageDialog
implementation under wxMSW on recent (Vista and later) Windows versions.
As part of this change, remove wxMessageDialogWithCustomLabels and integrate
its functionality in wxMessageDialogBase itself as it's now used by all
platforms.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65348 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use the "syslink" native control to implement wxHyperlinkCtrl under (recent
enough, i.e. XP or later) versions of Windows.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65334 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
With MSWSetTransparentBackground() hack only the panel which was the immediate
child of wxNotebook (i.e. its page) inherited the notebook background but not
its children. This resulted in jarring background discontinuities when nested
panels were used.
Fix this by inheriting notebook background in all child panels by testing for
the return value of the parents MSWHasInheritableBackground() method in
wxPanel::HasTransparentBackground() recursively.
Closes#12317.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65238 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Current item is the same as the selected item in single selection mode but in
multiple selection mode there was no way to neither get this item nor change
it before so add the new functions to allow doing this now.
The new methods are implemented for the generic, GTK and OS X/Cocoa versions
but only stubs are provided for OS X/Carbon.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65228 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
As all the other wxWidgets controls take the parameter in their ctor/Create()
it's unexpected that wxDataViewCtrl does not. Add the name parameter and pass
it to wxWindowBase::CreateBase() as usual.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65215 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The control itself can't accept focus as its window is disabled so set the
focus to its text part instead if SetFocus() is explicitly called.
Closes#12259.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65043 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
For some unknown reason wxGrid decided to store its scroll units in its own
m_scrollLine[XY] variables instead of just using the base wxScrollWindow class
m_[xy]ScrollPixelsPerLine ones. And, of course, the two could get out of sync
because wxGrid didn't update the base class version correctly.
Just don't duplicate these values at all and use the base class fields. This
makes the code simpler and also fixes changing the size of the scroll units.
Closes#12221.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64918 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Don't just return a hard-coded value but at least return something big
enough to show the largest item in the control in non-report mode.
This fixes the appearance of wxListbook which simply truncated its items
before if they didn't fit in 80 pixels horizontally.
Also switch to implementing DoGetBestClientSize() instead of DoGetBestSize()
as this method doesn't account for the control borders (it does account for
the scrollbars however).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64884 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Handling of activation in the generic implementation of standard renderers was
broken since r62589 which stopped calling their Activate() method. Restore it
by introducing a special WXOnActivate() replacing it (but clearly marked as
private and implementation-only) and calling it instead.
Closes#11460.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64654 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Implement compatibility aliases for non-prefixed macro names.
Require a final semicolon where possible.
Correct a recurring error in the docs: IMPLEMENT/DECLARE_CLASS are alias to the DYNAMIC macros, not to the ABSTRACT macros.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64532 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Yield for input event processing before updating the dialog instead of doing
it after this as the latter apparently doesn't always work.
Closes#10645.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64385 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Check for the transparency of the window background in MSWGetBgBrush() itself
and let MSWGetBgBrushForChild() just return the brush to be used.
This required adding a MSW-specific hack to wxPanel to allow inheriting
background of wxNotebook by its children which is slightly ugly but is exactly
what we need to do in this case and makes the rest of the code much simpler.
Also add a possibility to set the background of the page containing the
control being tested to the widgets sample to test for background inheritance.
This shows problems with wxSlider and wxRadioBox backgrounds but they're not
new with this patch.
Closes#12057.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64372 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
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
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
Although the information about "Cancel" and "Skip" buttons presses is returned
from Update(), sometimes it may be more convenient to ask the dialog about
whether it was cancelled or skipped instead of storing it in the program
itself.
Add the methods which allow to check for this.
Closes#10903.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64057 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The generic wxListCtrl didn't properly support switching between report and
non-report modes without invalidating the control contents, the required in
non report view geometry info pointers were not allocated when the control was
switched to a, say, list mode and not created in it.
Fix this by updating all list control lines when the report mode changes.
Closes#11698.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63946 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This fixes the styles used in the native wxGTK version after changes in
r63654: we must initialize base class m_pickerStyle now and the code didn't do
this before resulting in various asserts and incorrect behaviour.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63690 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The picker styles don't make sense for the button so we don't use them when
creating the button but we do need to somehow use the style the picker was
created with to create an appropriate dialog when it's clicked.
Fix the problem by simply storing the style in a member variable and using it
instead of wxWindow::m_windowStyle.
Closes#11635.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63654 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This is simply unnecessary and resulted in a crash in wxDFB because the window
was used for this variable initialization before being created.
Closes#11711.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63638 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Behaviour of GetCellSize() may be very surprising for the unwary as it can
return negative or null "size" of the cell.
Add CellSpan return value to allow the caller to check what kind of cell are
we dealing with easier.
Also document the new return value as well as the function (and matching
SetCellSize()) itself carefully as its behaviour is far from obvious.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63000 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Accessibility of these methods was accidentally changed to protected in r62821
and this broke wxUniv compilation, make them public again.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62877 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The base class already does exactly the same thing -- except that it also
accounts for the borders properly.
Also fix access for a couple of DoXXX() member functions which should be
protected and an event handler which can be private.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62821 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775