To get access to the control used for editing items, we need to create
it ourselves, which involves defining our own factory for doing this,
but seems to be the only way of achieving our goal.
Closes https://github.com/wxWidgets/wxWidgets/pull/1204
Similarly to the previous commit, it doesn't seem to be worth it to
avoid including these simple and common headers from there and it
simplifies code and will allow making the converter functions inline.
Follow standard practice and include the header corresponding to the
source file from it explicitly.
Also include wx/gdicmn.h from the header itself, this is a pretty common
header and there is no real advantage in avoiding it there and including
it allows to avoid a bunch of forward declarations.
Harmonize events sent by wxNotebook::AddPage(): they are now sent only
when adding any page except the first one if it is selected in all
ports.
See https://github.com/wxWidgets/wxWidgets/pull/1192
No real changes, just clean up sources by removing trailing spaces from
all the non-generated files.
This should hopefully avoid future commits mixing significant changes
with insignificant whitespace ones.
Under some (not totally clear) circumstances, a TLW can remain inactive
after being shown, which is undesirable, as it prevents setting focus to
its children from working.
Work around this by calling activateWindow() explicitly if necessary.
Closes https://github.com/wxWidgets/wxWidgets/pull/1179
This uses the cursor variant (as opposed to the icon one) since these actually are cursors, the base class looks like cursors are meant to be used, and the icon thing looks like a hack.
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 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
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
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.
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
Use QEventLoop for wxEventLoop implementation in wxQt to fix several
issues with wxEventLoop, notably avoid "QApplication::exec is already
running" errors.
See https://github.com/wxWidgets/wxWidgets/pull/1165
In EVT_HEADER_RESIZING event handler there is necessary to update actual
column width and redraw the control to show the column with new width.
Closes#18331.
Store QToolBar pointer in wxFrame itself to avoid having to query the
already half-destroyed wxToolBar object when SetToolBar() is called from
its base class dtor.
This fixes crash when toggling the toolbar in the toolbar sample.
Closes https://github.com/wxWidgets/wxWidgets/pull/1140
This method has no reason to be virtual.
Also move it to the end of the class public section and document that
it's not part of the public API.
See https://github.com/wxWidgets/wxWidgets/pull/1140
Implement point/pixel size accessors correctly.
Implement support for strike-through fonts.
Also implement DoSetNativeFontInfo() for wxQt.
Make wxFont unit test pass by accounting for Qt-specific aspects.
Closes https://github.com/wxWidgets/wxWidgets/pull/1113
This extends and replaces MSWSetModernEmulationLevel() by allowing a
more fine-grained choice of the emulation level used by wxWebViewIE.
Closes https://github.com/wxWidgets/wxWidgets/pull/1133
wxPropertyGridHeader associated with wxPropertyGrid has to be notified about every horizontal scroll of the grid.
New position is sent with dedicated wxEVT_PG_HSCROLL event being handled by wxPropertyGridManager which in turn scrolls the header accordingly.
See #18313.
Use QScrollbar directly instead of wxScrollbar for the window scrollbars
to ensure that wxWindow::GetChildren() doesn't return these scrollbars.
Closes https://github.com/wxWidgets/wxWidgets/pull/1124
This workaround was already disabled for MSVC, as it resulted in a
warning there, but it also gives a similar warning with clang and it
seems better to restrict this workaround to gcc only rather than
excluding another compiler.
New method of calculating of the new position/size of the editor (introduced in 95461c566d) doesn't work well in all cases so we have to go back to the (modified) old method. To get the correct position of the editor cell from the absolute position of the splitter 0 we have to shift it by the origin of the scrolled view area.
See #18313.
Add wxGridCellDateRenderer and wxGridCellDateRenderer which can be used
for the grid cells containing only dates, without times.
Also add wxGrid::SetColFormatDate() convenience function.
Refactor wxGridCellDateTimeRenderer slightly to reuse its code.
Closes https://github.com/wxWidgets/wxWidgets/pull/1101
The cache added in 990c8bfd73 was not
invalidated properly, meaning that wrong information was returned when
displays were [dis]connected after the application startup.
Fix this at least for MSW by invalidating the cache on receiving
WM_DISPLAYCHANGE (which means that sometimes we will do it
unnecessarily, as the change in resolution of an existing display
doesn't require cache invalidation, but this shouldn't be a big problem
in practice as the speed with which the user can change the display
resolution is not very high).
Closes https://github.com/wxWidgets/wxWidgets/pull/1090
NSOpenGLView is needed under 10.14 as a native view, but it doesn’t have its own native key handling, therefore use the same code we have for non-native custom views.
This is a more hackish but more compatible solution to the problem of
data sent using wxIPC_UTF8TEXT format being simply lost when using DDE
for IPC classes. We must use CF_TEXT for the DDE to pass our data, but
we can try to decode it as UTF-8 in the client and assume it was sent in
this format if it worked. This obviously suffers from false positives as
any ASCII string will still be assumed to be UTF-8, but there shouldn't
be any real harm coming from this.
This change also makes sending data in wxIPC_UTF{16,32}TEXT formats work
as well by converting it to UTF-8.
Update the sample to call Advise() with both wxIPC_UTF{8,16}TEXT formats
and remove the now unnecessary wxDDEConnection::m_dataType member.
Closes#17900.
This reverts commit c657fd3d61 because
changing the format of DDE advise requests/replies is not a good idea:
other applications (those using previous versions of wxWidgets or even
not using wxWidgets at all) may rely on getting data in real CF_TEXT
format rather than in one of text formats preceded by the extra byte
containing the actual format and the previous commit would have silently
broken this.
Another fix for #17900 will be implemented instead.
Introduce wxQtEdit class and wxQtMultiLineEdit and wxQtSingleLineEdit
derived classes instead of using ifs in many wxTextCtrl methods, making
the code more clear and maintainable.
Also fix some wxTextCtrl-related unit test failures with wxQt and
disable some other ones which still don't pass.
Closes https://github.com/wxWidgets/wxWidgets/pull/1039
wxIPC API doesn't map well onto DDE, as we don't have wxIPCFormat
parameter in StartAdvise() but do allow specifying the format when
calling Advise() itself, whereas DDE requires specifying the format when
establishing the advise loop and the data always must use this format
later.
Because of this, we have to pass the actual format with the data itself
instead of relying on DDE formats support. This has the advantage of
allowing wxIPC_UTF8TEXT to work, while previously it didn't and
couldn't, as DDE only supports the standard (or custom, but registered)
clipboard formats and it wasn't one of them. Of course, this also has a
disadvantage of having to make another copy of the data, but this seems
unavoidable.
This change allow Advise() overload taking wxString to work, including
for non-ASCII strings, as shown by the update to the IPC sample. It also
makes wxDDEConnection::m_dataType unnecessary, as we must always use the
format passed to DDE callback anyhow when handling XTYP_ADVREQ.
Closes#17900.
The latest changes to wxTranslations::AddCatalog() behaviour were not
backwards-compatible and also had other problem, so revert them for now,
even if this means that #18227 has to be reopened.
This is a combination of the following commits:
----
Revert "Fix regression in wxTranslations::AddCatalog()"
This reverts commit 14e905858d.
See #18297.
----
Revert "Fix crash in translations code when no translations are found"
This reverts commit 80904d1bc7.
See #18299.
----
Revert "Rename new wxTranslations method to GetAcceptableTranslations()"
This reverts commit 20b02d6169.
----
Revert "Load catalogs for all preferred languages, if they exist"
This reverts commit 2d784da2ee.
----
Revert "Allow getting all usable translations languages"
This reverts commit 5d08e404c7.
----
See #18227, #18300.
Closes#18302.
Compute the best size of the notebook, taking into account all the
different layout possibilities, and add a test checking that this works
as expected.
Closes https://github.com/wxWidgets/wxWidgets/pull/1085
The new method takes minimal size just computed by RecalcSizes() as its
argument making it unnecessary to store it as a member variable in the derived
classes such as wx{Box,FlexGrid}Sizer.
The old method can still be overridden for compatibility and by the derived
class that don't need minimal size when updating children.
Under wxQT, wxMemoryDC was previously rendering to a temporary image
which was only being blitted back to the original wxBitmap when either
the DC wx destroyed or a new bitmap was selected (via SelectObject).
With these change wxMemoryDCImpl now draws directly to the bitmap
managed by wxBitmap, this makes the behaviour more consistent with the
MSW and GTK implementations.
Closes https://github.com/wxWidgets/wxWidgets/pull/1083
As wxDataViewColumnList was never public, it should be fine to not
define it any more and use a vector instead.
This makes the code more clear and also marginally more efficient.
Previously, the last column couldn't be effectively resized at all, as
its size was always automatically set to the remaining width of the
window after subtracting the widths of all the previous columns. Now
this is only done if this remaining width is greater than the width
given to the column by the user or by the program.
Effectively, this means that the user can now drag-resize the column to
increase its size (at the price of showing the horizontal scrollbar).
See #18295.
This reverts commit 24054c95d8 as it
actually should be possible to increase the size of the last column,
even if this shows the horizontal scroll bar.
If a QGroupBox is disabled, then you cannot set any of its items to be
enabled without first enabling it. Enabling/disabling it will set that
value (true/false) on all of its items, although setting the QGroupBox
to an enabled state which it already has does not result in this
behaviour.
Fix wxQt to match the expected wxRadioBox behaviour and allow the unit
test to pass.
Closes https://github.com/wxWidgets/wxWidgets/pull/1064
This is slightly simpler, as it doesn't require checking whether the
control state really changes or not (it always does if DoEnable() is
called) and allows disabling the controls before creating them, e.g.
code like
wxButton* const b = new wxButton();
b->Disable();
b->Create(this, wxID_OK);
works as expected now instead of spewing GTK+ errors.
Make wxUxThemeIsActive() available even in this case to fix compilation
in some places and add the unavoidable preprocessor checks in other
ones.
Closes#18207.
RandomAccessIterator requirements include LessThanComparable, so
implement the missing comparison operators for this class, as well as
for const_reverse_iterator.
This also fixes compilation problems with MSVS 2013 in debug mode, where
the CRT uses these operators to check the iterators correctness.
See https://github.com/wxWidgets/wxWidgets/pull/1048
Avoid creating a default wxGraphicsContext unnecessarily, only to
immediately delete it and replace it with the provided one.
This was at best unnecessary and at worst resulted in a crash if the
default context couldn't be created, as happened on a headless system
(where wxImage-based wxGraphicsContext can still be created
successfully).
If nothing else, this avoids 2 calls to each of wxGetDisplaySize() and
wxGetDisplaySizeMM() on each and every wxGCDC construction which are
completely unnecessary as wxGCDCImpl uses its own hardcoded resolution
of 72 DPI, as do some other classes deriving from wxDCImpl.
And even for the classes which do compute these fields using the display
resolution, it may still be unnecessary to do it as they can be never
used if neither GetSizeMM() nor SetLogicalScale() are called on the
corresponding wxDC object.
Finally, this is more than an optimization as when using Cairo-based
wxGCDC without display (which is explicitly supported), calling
wxGetDisplaySize() simply doesn't work at all.
Removing a page from wxToolbook could result in crashes due to
dereferencing the now invalid page index. Fix this by not assuming that
the page index is the same as its tool ID, but adding functions to
explicitly map one to the other.
Also fix inserting pages into wxToolbook, which worked as appending them
before.
Closes https://github.com/wxWidgets/wxWidgets/pull/1042Closes#18275.
Update the colours used when the system theme changes.
This is especially important to use the colour scheme compatible with
macOS 10.14+ dark mode.
Note that this commit is best viewed with "git diff --color-moved".
Closes https://github.com/wxWidgets/wxWidgets/pull/916
Add functions to enable or disable pages inside wxToolbook.
Using the new functions you can present disabled icons so that the user
can expect more functionality and you do not need to add/remove pages in
different states.
Closes https://github.com/wxWidgets/wxWidgets/pull/1038
private field 'm_dwCookie' is not used
'return' will never be executed
result of comparison of unsigned enum expression < 0 is always false
'FlushDC' overrides a member function but is not marked 'override'
potentially uninitialized local variable 'bound' used
Under wxMSW this method is re-entered due to triggering EVT_ACTIVATE when EVT_LEFT_UP is being already handled.
We need to prevent this to avoid generating spurious EVT_TEXT events and raising errors on calling SetFocus().
Closes#18260.
Dragging a column header in a wxHeaderCtrl and dropping it past the
rightmost column resulted in a crash due to accessing a column with
invalid index.
Fix this and correctly move the column to the last position when this
happens instead.
This bug notably affected dragging columns in wxGrid.
Closes https://github.com/wxWidgets/wxWidgets/pull/972
This fixes the access specifier effectively used for the members
following these macros, as it's changed to "public" inside them, meaning
that e.g. m_privateContextMenu was actually public even though it was
ostensibly declared in the private section and the intention was for it
to be private.
Closes#16038.