Call DoSetSelectionAfterInsertion() instead of partially duplicating it.
This ensures that m_selection is correct after inserting a new page,
which wasn't the case before. Surprisingly, this didn't actually matter
because wxGTK implementation doesn't really use the base class
m_selection neither and just queries GTK+ widget directly for its
selection in GetSelection() instead, but it was at the very least
confusing.
Make wxGTK consistent with wxMSW and wxOSX and also make it pass the
unit test added in the previous commit by suppressing events generated
by gtk_notebook_insert_page() when adding the first page (but not any
subsequent ones).
Just use DoSetSelectionAfterInsertion() provided by the base class,
which does the right thing already, including both setting m_selection
and sending (or not sending) the corresponding events.
Having this method didn't really help, it's simpler and more
straightforward to implement ChangeSelection() as a signal-blocking
wrapper around SetSelection() instead.
No real changes in behaviour, this is a pure refactoring.
We ended up not needing the underlying QMimeData-based implementation, as the classes sitting on top of it
bypassed it anyway. It now treats the hierarchy as a pure data storage mechanism, generating the
QMimeData when drag-drop is initiated.
Kept "mime type" and "id" conceptually separate in the interface in case they need to diverge later.
Got rid of the odd "wxChar *" variants and the QString one.
Implemented unimplemented "type" functions.
Implemented "!=" in terms of "==", to keep from having two places to keep in sync.
Several improvements to the buttons pages of the widgets sample:
- Use a valid font when creating the bitmap.
- Create the bitmap with an DPI independent size.
- Use different images for different button states, as described by the
checkbox options.
- Add a checkbox to disable the bitmap.
- Recreate the button when changing label, so the bitmap is updated.
- Implement the 'fit exactly' option on ToggleButton page.
- Use more wxSizerFlags in widgets sample.
See https://github.com/wxWidgets/wxWidgets/pull/1188
Several wxRadioBox-related improvements:
- Fix its minimum width calculation to take the title into account.
- Remove unused nor useful wxRA_LEFTTORIGHT and wxRA_TOPTOBOTTOM.
- Tidy up the radiobox page of the widgets sample.
See https://github.com/wxWidgets/wxWidgets/pull/1187
Several fixes:
* Clear the buttons background, which can be important if their (custom)
bitmap is transparent.
* Only add margin before/after the corresponding button if it is
actually visible.
* Select the bitmap out of wxMemoryDC before modifying it.
* Don't assume that the "Cancel" button is always square.
Closes https://github.com/wxWidgets/wxWidgets/pull/1142
This restores the default behavior of a popup window in MSW to the
behavior it had before 56c4191168. The new
flag added by this commit can be used to give the popup window the
behavior from after that commit, i.e. choose the implementation using a
WS_POPUP window rather than the default one using a WS_CHILD of the
desktop.
The old behavior kept the popup from taking focus from its parent window
but left some controls not working. The new behavior has the popup take
focus and lets all controls work.
Closes https://github.com/wxWidgets/wxWidgets/pull/1123
Including <winsock.h> and <winsock2.h> is incompatible and if the
application wants to use the latter, it may be convenient to define
wxUSE_WINSOCK2 when building wxWidgets instead of having to work around
winsock.h implicit inclusion from include/wx/msw/wrapwin.h.
Closes https://github.com/wxWidgets/wxWidgets/pull/1122
Use a valid font when creating the bitmap.
Create the bitmap with a DPI independent size.
Use different images for different button states, as described by the checkbox
options.
Add a checkbox to disable the bitmap.
Recreate the button when changing label, so the bitmap is updated.
Implement the 'fit exactly' option on ToggleButton page.
Make the reset button work by binding to OnUpdateUIReset.
Use wxSizerFlags based API.
Remove minimum size of right panel so the minimum size of wxRadioBox can be
verified.
Use wxArrayString instead of manually creating and deleting an array of
wxString pointers.
Reapply disabling and hiding the test button, and check if test button is
available.
Layout the entire page instead of only the sizer, see #18100.
This was only used in wxUniv, wxRA_SPECIFY_[COLS/ROWS] can be used instead.
Do not remove them from the definitions, to not break user code.
Closes#18100.
Ensure the selected state tracks the Qt selection: without this, if
no explicit selection is made after adding the pages,
wxNotebook::GetSelection() returns wxNOT_FOUND even though the first
page is selected.
Closes https://github.com/wxWidgets/wxWidgets/pull/1182
Qt documentation advises to avoid calling repaint() except when an
immediate update is required, i.e. it corresponds to wxWindow::Update().
Use update() instead to avoid many Qt warnings that appeared when
resizing the caret sample window, for example.
Closes https://github.com/wxWidgets/wxWidgets/pull/1178
Update the actual tool tip used by Qt and not just the internal variable
when SetTip() is called.
Also implement wxToolTip::SetWindow().
Closes https://github.com/wxWidgets/wxWidgets/pull/1175
We already had WX_ASSERT_EVENT_OCCURS_IN macro and a recent commit also
added code doing almost the same thing manually in wxTopLevelWindow unit
test, which was one version too many.
Replace both of them with the new EventCounter::WaitEvent().
No real changes, this is just a refactoring.
The last argument passed to this function should be an int flag not a Boolean value.
Boolean value 'true' passed here is converted to int 1 so wxPG_RECURSE flag is never set and the background colour is never changed for sub-properties.
Closes#18333.
It seems better to have them in the class itself, near the connect()
call binding them.
This also resolves an inconsistency between wxQtSpinBox::valueChanged(),
which was defined elsewhere in the source file, and the same method of
wxQtDoubleSpinBox, which was defined directly after the class
declaration.
See https://github.com/wxWidgets/wxWidgets/pull/1168