Instead, use just top and bottom N/2 items for some large enough value
of N. N is determined dynamically so that column best width calculation
doesn't take more than 50ms.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65951 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
For calling SetValue() and SetAttr() consistently, instead of having the
same code duplicated all over the place.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65950 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
When determining cell content's size, GetSize() measured the text using
wxDataViewCtrl's font, even though it could be renderer in bold or
italics.
Corrected by setting the attributes - and not only the value - prior to
GetSize() calls, and by using the right font in GetTextExtent() calls.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65949 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use doubles to avoid accumulated rounding errors from using integers in the
generic implementation of wxDC::GradientFillConcentric(). This results in
smoother gradient.
Also avoid using the expensive pow() function inside the inner loop when we
just need to calculate a square.
Closes#12337.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65944 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The selected colour was not used as the code simply changed the value of
m_pen but didn't call SetPen() to actually use it. This resulted in always
using the default (black) colour when drawing concentric gradients.
Fix this by calling SetPen().
See #12337.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65943 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Changes of r65824 resulted in asserts when creating wxCheckBox with just
wxBORDER_NONE style. This is useless but used to be harmless so continue to
allow this.
Closes#12628.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65942 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Put the min/max labels on the sides or a horizontal slider or above/below a
vertical one to make them visually more distinct from the current value label.
See #11427.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65941 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Making wxListBoxBase::CalcAndSendEvent() broke wxOSX/Carbon build, fix it by
making the class which needs to call it friend of wxListBox in this port.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65940 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The changes of r65882 adding wxThread::On{Delete,Kill}() introduced a bug
which made normal wxThread::Wait() crash.
Fix it by calling OnDelete() only if we're really deleting a thread.
Closed#12627, see #9046.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65939 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Select an item initially to prevent GTK from doing it automatically as soon as
the listbox is clicked anywhere (even outside of the items area).
This makes all GUI tests finally pass under wxGTK.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65938 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use smart pointer class instead of manually writing g_object_unref(). This
makes code shorter and less error-prone.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65937 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Reuse wxListBoxBase::SetEvent() instead of duplicating its code in wxGTK.
Also get rid of the code checking for selection of the item with index -1:
this can't happen any more since r65865 which changed GTK_SELECTION_SINGLE to
GTK_SELECTION_BROWSE.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65936 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Bring wxGTK in line with wxMSW behaviour and avoid sending the
wxEVT_COMMAND_LISTBOX_SELECTED events when the user clicks on an already
selected item.
Refactor wxMSW code to extract the logic to avoid such events into a reusable
in other ports wxListBoxBase::DoChangeSingleSelection() function. Also add
wxListBox::GTKOnSelectionChanged() to wxGTK to avoid having to make the new
function public just so that it could be called by GTK callback and make the
previously existing CalcAndSendEvent() protected as well.
This fixes a unit test failure in ListBoxTestCase::ClickEvents() under wxGTK.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65935 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxMax, wxMin and wxClip work correctly when called with a mix of signed and
unsigned arguments but give warnings about comparing them when compiled with
g++.
Cast both arguments to the result type, which is defined consistently with
standard C rules for implicit promotion, before comparing them to avoid this.
Also add more tests to check that using these functions in this case doesn't
provoke warnings.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65933 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
All book control classes with the exception of wxGTK wxNotebook stored the
currently selected page in m_selection or m_nSelection (or, in wxUniv
wxNotebook case, m_sel) variable. Remove all of them and add m_selection
directly to the base class itself so that it can be reused everywhere.
Closes#12622.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65931 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
We only want to continue dispatching messages while waiting for another thread
to terminate if we are waiting in the main thread.
Closes#12618.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65929 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Construct wxScopedWCharBuffer using CreateNonOwned() in
wxString::ToStdWstring() in this case, creating it directly from wc_str()
doesn't work (intentionally, as this doesn't tell if the buffer owns the
string or not).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65928 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Previously used macro's arguments were evaluated twice, but there were
many occurences of their use in our code that didn't account for this
and used expensive-to-evaluate arguments as if they were functions.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65920 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
There are no real changes but ensure that the new objects of classes using
DECLARE_OLE_UNKNOWN() macro are created with valid reference count of 1
instead of being created in phantom state with reference count of 0.
Remove the now unnecessary AddRef() and add the now required DecRef() calls.
See #11566.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65912 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Ensure that the IFrameSite object is created with valid (i.e. non-zero)
reference count by calling AddRef() on it immediately after creation and
remove the weird QueryInterface() call which was used to work around this bug.
Closes#11566.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65911 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Handle CONNECT_E_NOCONNECTION return value from IConnectionPointContainer::
FindConnectionPoint() as an expected error and don't complain about it.
See #11566.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65910 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Add SWP_NOACTIVATE to the flags used by wxWindow::MSWUpdateStyle(). This
allows to change the style of a window without necessarily activating it.
Closes#11560.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65909 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Replace wxLogDebug() with wxLogTrace() as was probably intended. This fixes
the assert which happened when running the sample because of the wrong number
of parameters passed to wxLogDebug().
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65908 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This makes it more convenient to run the sample repeatedly as the directory to
watch can be specified only once instead of having to choose it interactively
after the sample startup every time.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65907 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
When changing the selected item programmatically 2 CHANGING and CHANGED events
were sent because the assumption that comctl32.dll didn't send these events
itself was not correct any more, it does send them at least since XP. However
to avoid the tests for its exact version it's simpler to just ignore the
events it generates and continue sending our own ones.
Closes#11274.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65906 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The workaround for the unexpected events order introduced in r49588 should
only apply to the situation when the user selects an item in the tree, not
when it's done programmatically as this results in unexpected focus changes
(see #11274).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65905 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The generic wxTreeCtrl version only sends this event when the mouse is right
clicked on a valid item so do the same in wxMSW version too for consistency.
This is also consistent with wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK event and
avoids strange problems with unexpected wxEVT_COMMAND_TREE_ITEM_MENU events
generated on right double click.
Finally, replace the checks for item validity in the event handler in the
sample with asserts which should loudly complain if it happens to be invalid.
Closes#11226.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65903 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use helper GetWeek{Start,End}() functions instead of repeating tests for
wxCAL_MONDAY_FIRST over and over again.
Also replace some occurrences of GetWindowStyle() with shorter and more clear
HasFlag().
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65902 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
When the date was constrained to a range in wxGenericCalendarCtrl, the display
of the month in the month combobox could get out of sync with its real value.
Ensure that the correct month is always displayed and also simplify the code
by removing the apparently unnecessarily complex logic in ChangeYear() and
ChangeMonth() functions.
Closes#11060.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65901 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
After removing wxDIB::m_hasAlpha in the previous commit, this method became
completely trivial so put it inline in the header.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65900 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This field can't be set reliably as we don't know if LoadImage() Windows
function loaded an 0RGB or an RGB bitmap so remove it completely to avoid the
risk of using it wrongly.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65899 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775