[Git][wxwidgets/wxwidgets][master] 10 commits: wxScrolled<>: document how to drag between windows

1 view
Skip to first unread message

Vadim Zeitlin (@_VZ_)

unread,
Mar 18, 2026, 9:47:28 PM (11 days ago) Mar 18
to wx-commi...@googlegroups.com


Vadim Zeitlin pushed to branch master at wxWidgets / wxWidgets


Commits:
708eeb77 by Bill Su at 2026-03-16T21:09:34-04:00
wxScrolled<>: document how to drag between windows

- - - - -
1d91d71a by Bill Su at 2026-03-17T00:57:43-04:00
dnd: improve autoscroll example

Using wxScrolled<> on the wxFrame meant that the status
bar moved when scrolling, so use give the frame a
wxScrolledCanvas child.

Also, wxDC::FloodFill() doesn't seem to work well with a
scrolling window. (Maybe because the center point isn't
necessarily visible?) Using DrawRectangle(), etc works
better.

- - - - -
6f935341 by Václav Slavík at 2026-03-17T17:12:41+01:00
Implement C++20 three-way comparison for wxString

Implement operator<=> for wxString comparison.

This is not merely nice to have, but important in order to prevent code
that relies on <=>, such as parts of the standard library, from using
the operator available through implicit conversion to const wchar_t*.

- - - - -
785569dd by Milo Ivir at 2026-03-17T18:55:42+01:00
Update Croatian translation

- completed the Croatian translation
- made some minor changes in wording

Closes #26305.

- - - - -
2e6689f8 by Bill Su at 2026-03-18T00:10:12-04:00
wxScrolled<>: fix wrong @since versions

- - - - -
b51b388f by Bill Su at 2026-03-18T00:11:22-04:00
dnd: comment purpose of DnDShapeFrame::TryBefore()

- - - - -
f972df83 by Václav Slavík at 2026-03-18T17:26:03+01:00
Add test for wxString::operator<=>

- - - - -
8d483b5c by Vadim Zeitlin at 2026-03-19T02:08:32+01:00
Merge branch 'c++20-spaceship' of github.com:vslavik/wxWidgets

Implement C++20 spaceship operator for wxString.

Fixes silent wxString comparison breakage in C++20 with std::tuple etc.

See #26306.

- - - - -
813a15c8 by ali kettab at 2026-03-19T02:19:49+01:00
wxQt: Fix memory leak of wxTextAutoCompleteData

Delete wxTextEntry member pointer which was forgotten in 602f4f3
(2025-02-08, wxQt: Add auto-completion support to wxTextEntry).

Note that some code had to be moved to make full declaration of
wxTextAutoCompleteData available to wxTextEntry destructor, this commit
is best viewed using Git --color-moved option.

Closes #26283.

Closes #26310.

- - - - -
d05c5c1d by Vadim Zeitlin at 2026-03-19T02:24:57+01:00
Merge branch 'autoscroll-drag' of github.com:wsu-cb/wxWidgets

wxScrolled<>: documentation and sample improvements.

See #26304.

- - - - -


9 changed files:

- include/wx/qt/textentry.h
- include/wx/scrolwin.h
- include/wx/string.h
- interface/wx/scrolwin.h
- locale/hr.po
- samples/dnd/d_and_d.txt
- samples/dnd/dnd.cpp
- src/qt/textentry.cpp
- tests/strings/strings.cpp


Changes:

=====================================
include/wx/qt/textentry.h
=====================================
@@ -14,6 +14,7 @@ class WXDLLIMPEXP_CORE wxTextEntry : public wxTextEntryBase
{
public:
wxTextEntry();
+ ~wxTextEntry();

virtual void WriteText(const wxString& text) override;



=====================================
include/wx/scrolwin.h
=====================================
@@ -168,7 +168,7 @@ public:
wxEventType& evtHorzScroll,
wxEventType& evtVertScroll) const;

- // wxWidgets <= 3.3.1 mostly restricted autoscroll to the
+ // wxWidgets <= 3.3.2 mostly restricted autoscroll to the
// window holding the mouse capture. However, when dragging
// objects between windows, the destination window should be
// the window that is scrolling (to allow positioning the


=====================================
include/wx/string.h
=====================================
@@ -49,6 +49,11 @@
#endif
#endif

+// Check if C++20 three-way-comparison operator is available
+#ifdef __cpp_impl_three_way_comparison
+ #include <compare>
+#endif
+
#include "wx/afterstd.h"

// by default we cache the mapping of the positions in UTF-8 string to the byte
@@ -2288,6 +2293,19 @@ public:
friend bool operator>=(const wxString& s1, const wxString& s2)
{ return s1.Cmp(s2) >= 0; }

+#ifdef __cpp_impl_three_way_comparison
+ friend auto operator<=>(const wxString& s1, const wxString& s2)
+ {
+ const int cmp = s1.Cmp(s2);
+ if (cmp < 0)
+ return std::strong_ordering::less;
+ else if (cmp > 0)
+ return std::strong_ordering::greater;
+ else
+ return std::strong_ordering::equal;
+ }
+#endif
+
friend bool operator==(const wxString& s1, const wxCStrData& s2)
{ return s1 == s2.AsString(); }
friend bool operator==(const wxCStrData& s1, const wxString& s2)


=====================================
interface/wx/scrolwin.h
=====================================
@@ -116,6 +116,18 @@ enum wxScrollbarVisibility
To disable autoscrolling completely, call DisableAutoScrollOutside()
without calling EnableAutoScrollInside().

+ wxWidgets <= 3.3.2 mostly restricted autoscroll to the window holding the
+ mouse capture. However, when dragging objects between windows, the
+ destination window, which may or may not be the capturing window, should be
+ the window that is scrolling (to allow positioning the dragged object).
+ To support this, as of wxWidgets 3.3.3, a window can call
+ EnableAutoscrollWithoutCapture() when processing a drag-enter, and
+ DisableAutoscrollWithoutCapture() when processing a drag-exit or drag-drop.
+ (If a window supports dragging content to another window, it should use
+ EnableAutoScrollInside() and DisableAutoScrollOutside() to avoid
+ autoscrolling while a destination window is also autoscrolling.) See the
+ shape frame portion of the @sample{dnd} for an example of dragging
+ from one window to another.

@beginStyleTable
@style{wxHSCROLL}
@@ -541,6 +553,23 @@ public:
*/
void Scroll(const wxPoint& pt);

+ /**
+ Set this window to autoscroll even if it has not captured the mouse
+ (assuming the mouse cursor is in its autoscroll zone). This is
+ intended to be called on drag-enter to support drag and drop between
+ windows.
+
+ @since 3.3.3
+ */
+ void EnableAutoscrollWithoutCapture();
+ /**
+ Undo EnableAutoscrollWithoutCapture(). This is intended to be called on
+ drag-exit and drag-drop when supporting drag and drop between windows.
+
+ @since 3.3.3
+ */
+ void DisableAutoscrollWithoutCapture();
+
/**
Set the horizontal and vertical scrolling increment only. See the
pixelsPerUnit parameter in SetScrollbars().


=====================================
locale/hr.po
=====================================
@@ -1,14 +1,14 @@
# Croatian translations for wxWidgets
# Copyright (C) 2019 wxWidgets
# This file is distributed under the same license as the wxWidgets package.
-# Milo Ivir <ma...@milotype.de>, 2019.
+# Milo Ivir <ma...@milotype.de>, 2019., 2026.
#
msgid ""
msgstr ""
"Project-Id-Version: wxWidgets 3.3.x\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-05-14 20:23+0200\n"
-"PO-Revision-Date: 2023-05-14 14:24+0200\n"
+"PO-Revision-Date: 2026-03-17 15:07+0100\n"
"Last-Translator: Milo Ivir <ma...@milotype.de>\n"
"Language-Team: \n"
"Language: hr\n"
@@ -17,7 +17,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
"n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);\n"
-"X-Generator: Poedit 3.0\n"
+"X-Generator: Poedit 3.9\n"

#: ../include/wx/defs.h:2582
msgid "All files (*.*)|*.*"
@@ -216,7 +216,7 @@ msgstr "&Prethodno"
#: ../src/generic/mdig.cpp:307 ../src/generic/mdig.cpp:311
#: ../src/msw/mdi.cpp:337 ../src/qt/mdi.cpp:462
msgid "&Window"
-msgstr "&Prozor"
+msgstr "Pro&zor"

#: ../src/common/accelcmn.cpp:47
msgctxt "keyboard key"
@@ -719,7 +719,6 @@ msgid "SPECIAL"
msgstr "SPECIJALNO"

#: ../src/common/accelcmn.cpp:373
-#, fuzzy
msgid "Ctrl"
msgstr "Ctrl"

@@ -1318,26 +1317,25 @@ msgid ""
" and additionally, the existing configuration file was renamed to \"%s\" and "
"couldn't be renamed back, please rename it to its original path \"%s\""
msgstr ""
+"i dodatno, postojeća konfiguracijska datoteka je preimenovana u „%s” i nije "
+"je bilo moguće vratiti na izvorno ime. Preimenuj je natrag na izvornu stazu "
+"„%s”"

#: ../src/common/fileconf.cpp:389
-#, fuzzy
msgid " due to the following error:\n"
-msgstr "I sadržava sljedeće datoteke:\n"
+msgstr " zbog sljedeće greške:\n"

#: ../src/common/fileconf.cpp:412
-#, fuzzy
msgid "failed to rename the existing file"
-msgstr "Neuspjelo čitanje tekstualne datoteke „%s”."
+msgstr "neuspjelo preimenovanje postojeće datoteke"

#: ../src/common/fileconf.cpp:421
-#, fuzzy
msgid "failed to create the new file directory"
-msgstr "Neuspjelo dohvaćanje radne mape"
+msgstr "neuspjelo stvaranje novog direktorija datoteka"

#: ../src/common/fileconf.cpp:428
-#, fuzzy
msgid "failed to move the file to the new location"
-msgstr "Neuspjelo postavljanje web-prikaza na modernu razinu emulacije"
+msgstr "neuspjelo premještanje datoteke na novu lokaciju"

#: ../src/common/fileconf.cpp:462
#, c-format
@@ -1397,9 +1395,8 @@ msgid "Config entry name cannot start with '%c'."
msgstr "Konfiguracijsko ulazno ime ne može početi s „%c”."

#: ../src/common/fileconf.cpp:1146
-#, fuzzy
msgid "Failed to create configuration file directory."
-msgstr "Neuspjela izrada objekta konfiguracije fontova."
+msgstr "Neuspjelo stvaranje direktorija konfiguracijskih datoteka."

#: ../src/common/fileconf.cpp:1158
msgid "can't open user configuration file."
@@ -2215,7 +2212,7 @@ msgstr "DIB zaglavlje: Kodiranje se ne poklapa s bit-dubinom."
#: ../src/common/imagbmp.cpp:1180
#, c-format
msgid "BMP Header: Invalid number of colors (%d)."
-msgstr ""
+msgstr "BMP zaglavlje: Nevaljan broj boja (%d)."

#: ../src/common/imagbmp.cpp:1273
msgid "Error in reading image DIB."
@@ -2450,43 +2447,40 @@ msgid "TIFF: Error writing image."
msgstr "TIFF: Greška prilikom pisanja slike."

#: ../src/common/imagtiff.cpp:881
-#, fuzzy
msgid "TIFF: Error flushing data."
-msgstr "TIFF: Greška prilikom spremanja slike."
+msgstr "TIFF: Greška prilikom zapisivanja podataka."

#: ../src/common/imagwebp.cpp:56
msgid "WebP: Invalid data (failed to get features)."
-msgstr ""
+msgstr "WebP: Nevaljani podaci (neuspjelo dobivanje funkcija)."

#: ../src/common/imagwebp.cpp:65
msgid "WebP: Allocating image memory failed."
-msgstr ""
+msgstr "WebP: Dodjellivanje memorije slika nije uspjela."

#: ../src/common/imagwebp.cpp:82
msgid "WebP: Decoding RGBA image data failed."
-msgstr ""
+msgstr "WebP: Dekodiranje RGBA slikovnih podataka nije uspjelo."

#: ../src/common/imagwebp.cpp:98
msgid "WebP: Decoding RGB image data failed."
-msgstr ""
+msgstr "WebP: Dekodiranje RGB slikovnih podataka nije uspjelo."

#: ../src/common/imagwebp.cpp:113 ../src/common/imagwebp.cpp:201
msgid "WebP: Allocating stream buffer failed."
-msgstr ""
+msgstr "WebP: Dodjeljivanje međuspremnika za tok podataka nije uspjelo."

#: ../src/common/imagwebp.cpp:131
-#, fuzzy
msgid "WebP: Failed to parse container data."
-msgstr "Neuspjelo postavljanje podataka međuspremnika."
+msgstr "WebP: Neuspjela obrada podataka kontejnera."

#: ../src/common/imagwebp.cpp:222
-#, fuzzy
msgid "WebP: Error decoding animation."
-msgstr "Greška prilikom čitanja opcija konfiguracije."
+msgstr "WebP: Greška pri dekodiranju animacije."

#: ../src/common/imagwebp.cpp:240
msgid "WebP: Error getting next animation frame."
-msgstr ""
+msgstr "WebP: Greška pri dobivanju sljedeće slike animacije."

#: ../src/common/init.cpp:172
#, c-format
@@ -2596,7 +2590,7 @@ msgstr "Greška LZMA komprimiranja: %s"
#: ../src/common/lzmastream.cpp:350
#, c-format
msgid "LZMA compression error when flushing output: %s"
-msgstr "Greška LZMA komprimiranja prilikom nedovršavanja iznošaja: %s"
+msgstr "Greška LZMA komprimiranja prilikom zapisivanja rezultata: %s"

#: ../src/common/mimecmn.cpp:167
#, c-format
@@ -3960,7 +3954,7 @@ msgstr "„%s” nije jedan od valjanih znakovnih nizova"
#: ../src/common/valtext.cpp:199
#, c-format
msgid "'%s' contains invalid character(s)"
-msgstr "„%s” sadržava nevažeće slovne znakove"
+msgstr "„%s” sadržava nevaljane znakove"

#: ../src/common/webrequest.cpp:139
#, c-format
@@ -3968,15 +3962,17 @@ msgid "Error: %s (%d)"
msgstr "Greška: %s (%d)"

#: ../src/common/webrequest.cpp:655
-#, fuzzy, c-format
+#, c-format
msgid ""
"Not enough free disk space for download: %llu needed but only %llu available."
-msgstr "Nema dovoljno memorije na disku za preuzimanje."
+msgstr ""
+"Nema dovoljno slobodne memorije na disku za preuzimanje: potrebno: %llu, "
+"dostupno: %llu."

#: ../src/common/webrequest.cpp:669
-#, fuzzy, c-format
+#, c-format
msgid "Failed to create temporary file in %s"
-msgstr "Neuspjelo stvaranje imena privremene datoteke"
+msgstr "Neuspjelo stvaranje privremene datoteke u %s"

#: ../src/common/webrequest_curl.cpp:1106
msgid "libcurl could not be initialized"
@@ -3992,33 +3988,33 @@ msgid "Error running JavaScript: %s"
msgstr "Greška prilikom pokretanja JavaScripta: %s"

#: ../src/common/webview_chromium.cpp:858
-#, fuzzy, c-format
+#, c-format
msgid "Failed to set proxy \"%s\": %s"
-msgstr "Neuspjelo stvaranje mape „%s”"
+msgstr "Neuspjelo postavljanje proxyja „%s“: %s"

#: ../src/common/webview_chromium.cpp:989
msgid ""
"Chromium can't be used because libcef.so wasn't loaded early enough; please "
"relink the application or use LD_PRELOAD to load it earlier."
msgstr ""
+"Chromium se ne može koristiti jer libcef.so nije učitan dovoljno rano; "
+"ponovo poveži aplikaciju ili koristi LD_PRELOAD kako bi se ranije učitao."

#: ../src/common/webview_chromium.cpp:1108
-#, fuzzy
msgid "Could not initialize Chromium"
-msgstr "Nije moguće inicijalizirati OLE"
+msgstr "Nije bilo moguće inicijalizirati Chromium"

#: ../src/common/webview_chromium.cpp:1616
msgid "Show DevTools"
-msgstr ""
+msgstr "Prikaži alate za razvoj"

#: ../src/common/webview_chromium.cpp:1617
-#, fuzzy
msgid "Close DevTools"
-msgstr "Zatvori sve"
+msgstr "Zatvori alate za razvoj"

#: ../src/common/webview_chromium.cpp:1623
msgid "Inspect"
-msgstr ""
+msgstr "Pregledaj"

#: ../src/common/wincmn.cpp:1628
msgid "This platform does not support background transparency."
@@ -4422,12 +4418,11 @@ msgstr "Desno"
#, c-format
msgid ""
"\"%s\" is not in the expected date format, please enter it as e.g. \"%s\"."
-msgstr ""
+msgstr "„%s“ nije očekivani format datuma. Upiši ga npr. kao „%s“."

#: ../src/generic/datectlg.cpp:94
-#, fuzzy
msgid "Invalid date"
-msgstr "PCX: nevaljana slika"
+msgstr "Nevaljan datum"

#: ../src/generic/dbgrptg.cpp:159
#, c-format
@@ -4845,36 +4840,37 @@ msgid ""
"Error copying grid to the clipboard. Either selected cells were not "
"contiguous or no cell was selected."
msgstr ""
+"Greška pri kopiranju mreže u međuspremnik. Odabrane ćelije nisu bile u nizu "
+"ili nije odabrana nijedna ćelija."

#: ../src/generic/grid.cpp:12739
-#, fuzzy
msgid "Grid Corner"
-msgstr "Kut"
+msgstr "Ugao mreže"

#: ../src/generic/grid.cpp:12741
-#, fuzzy, c-format
+#, c-format
msgid "Column %s Header"
-msgstr "Stupac %u"
+msgstr "Zaglavlje stupca %s"

#: ../src/generic/grid.cpp:12743
#, c-format
msgid "Row %s Header"
-msgstr ""
+msgstr "Zaglavlje retka %s"

#: ../src/generic/grid.cpp:12745
-#, fuzzy, c-format
+#, c-format
msgid "Column %s: %s"
-msgstr "Stupac %u"
+msgstr "Stupac %s: %s"

#: ../src/generic/grid.cpp:12749
-#, fuzzy, c-format
+#, c-format
msgid "Row %s: %s"
-msgstr "Redak %i"
+msgstr "Redak %s: %s"

#: ../src/generic/grid.cpp:12753
#, c-format
msgid "Row %s, Column %s: %s"
-msgstr ""
+msgstr "Redak %s, stupac %s: %s"

#: ../src/generic/helpext.cpp:257
#, c-format
@@ -5264,40 +5260,39 @@ msgid "MDI child"
msgstr "MDI child"

#: ../src/gtk/power.cpp:188
-#, fuzzy, c-format
+#, c-format
msgid "Failed to open D-Bus connection to the login manager: %s"
-msgstr "Neuspjelo povezivanje na server „%s” na temu „%s”"
+msgstr "Neuspjelo otvaranje D-Bus veze s upravljačem prijava: %s"

#: ../src/gtk/power.cpp:214
-#, fuzzy
msgid "wxWidgets application"
-msgstr "Sakrij aplikaciju"
+msgstr "Aplikacija wxWidgets"

#: ../src/gtk/power.cpp:226
msgid "Application needs to keep running"
-msgstr ""
+msgstr "Aplikacija mora nastaviti raditi"

#: ../src/gtk/power.cpp:233
msgid "Clean up before suspend"
-msgstr ""
+msgstr "Očisti prije prelaska u stanje mirovanja"

#: ../src/gtk/power.cpp:259
-#, fuzzy, c-format
+#, c-format
msgid "Failed to inhibit sleep: %s"
-msgstr "Neuspjelo inicijaliziranje povezivanja: %s"
+msgstr "Neuspjelo sprečavanje prelaska u stanje mirovanja: %s"

#: ../src/gtk/power.cpp:265
msgid "Unexpected response to D-Bus \"Inhibit\" request."
-msgstr ""
+msgstr "Neočekivan odgovor na D-Bus zahtjev za sprečavanje (Inhibit)."

#: ../src/gtk/print.cpp:218
msgid "Custom size"
msgstr "Prilagođena veličina"

#: ../src/gtk/print.cpp:752
-#, fuzzy, c-format
+#, c-format
msgid "Error while printing: %s"
-msgstr "Greška prilikom spisa: "
+msgstr "Greška prilikom ispisa: %s"

#: ../src/gtk/print.cpp:816
msgid "Page Setup"
@@ -5305,16 +5300,17 @@ msgstr "Postavke stranice"

#: ../src/gtk/webview_webkit.cpp:932
msgid "Retrieving JavaScript script output is not supported with WebKit v1"
-msgstr "Dohvaćanje iznošaja JavaScript skripta nije podržano s WebKit v1"
+msgstr "Dohvaćanje rezultata JavaScript skripta nije podržano s WebKit v1"

#: ../src/gtk/webview_webkit2.cpp:1098
msgid ""
"Setting proxy is not supported by WebKit, at least version 2.16 is required."
msgstr ""
+"WebKit ne podržava postavljanje proxyja, potrebna je barem verzija 2.16."

#: ../src/gtk/webview_webkit2.cpp:1104
msgid "This program was compiled without support for setting WebKit proxy."
-msgstr ""
+msgstr "Ovaj je program kompiliran bez podrške za postavljanje WebKit proxyja."

#: ../src/gtk/window.cpp:6289
msgid ""
@@ -5713,9 +5709,9 @@ msgstr ": datoteka ne postoji!"

#. TRANSLATORS: %s may be a document title.
#: ../src/html/htmprint.cpp:717
-#, fuzzy, c-format
+#, c-format
msgid "%s Preview"
-msgstr " Pregled"
+msgstr "Pregled za %s"

#: ../src/html/htmprint.cpp:755 ../src/richtext/richtextprint.cpp:618
msgid ""
@@ -5817,7 +5813,7 @@ msgid ""
msgstr ""
"jedna DDEML funkcija je pozvana bez prethodnog pozivanja funkcije "
"DdeInitialize,\n"
-"ili je jedan nevažeći identifikator instance\n"
+"ili je jedan nevaljan identifikator instance\n"
"proslijeđen DDEML funkciji."

#: ../src/msw/dde.cpp:1147
@@ -5892,7 +5888,7 @@ msgid ""
"Once the application has returned from an XTYP_XACT_COMPLETE callback,\n"
"the transaction identifier for that callback is no longer valid."
msgstr ""
-"neispravni identifikator transakcije proslijeđen je DDEML funkciji.\n"
+"nevaljan identifikator transakcije proslijeđen je DDEML funkciji.\n"
"Nakon što se aplikacija vrati iz povratnog poziva XTYP_XACT_COMPLETE,\n"
"identifikator transakcije za taj povratni poziv više nije valjan."

@@ -6022,11 +6018,11 @@ msgstr ""

#: ../src/msw/filedlg.cpp:1241
msgid "Access to the file system is not allowed from secure desktop."
-msgstr ""
+msgstr "Pristup datotečnom sustavu nije dopušten sa sigurne radne površine."

#: ../src/msw/filedlg.cpp:1242
msgid "Security warning"
-msgstr ""
+msgstr "Sigurnosno upozorenje"

#: ../src/msw/filedlg.cpp:1533
#, c-format
@@ -6501,7 +6497,7 @@ msgstr "Nije moguće učitati ikone iz „%s”."

#: ../src/msw/webview_edge.cpp:285
msgid "This program was compiled without support for setting Edge proxy."
-msgstr ""
+msgstr "Ovaj je program kompiliran bez podrške za postavljanje Edge proxyja."

#: ../src/msw/webview_ie.cpp:1010
msgid "Failed to find web view emulation level in the registry"
@@ -7042,7 +7038,7 @@ msgstr "Greška svojstva"
#: ../src/propgrid/propgrid.cpp:3259
msgid "You have entered invalid value. Press ESC to cancel editing."
msgstr ""
-"Uneseni su nevaljane vrijednosti. Pritisni ESC za odustajanje od uređivanja."
+"Unesena ja nevaljana vrijednosti. Pritisni ESC za odustajanje od uređivanja."

#: ../src/propgrid/propgrid.cpp:6608
#, c-format
@@ -7093,7 +7089,7 @@ msgstr "Odaberi datoteku"

#: ../src/qt/mdi.cpp:254
msgid "&Tile"
-msgstr ""
+msgstr "&Poploči"

#: ../src/richtext/richtextbackgroundpage.cpp:147
#: ../src/richtext/richtextformatdlg.cpp:376
@@ -8651,7 +8647,7 @@ msgstr "Jedinice za donji položaj."

#: ../src/richtext/richtextsizepage.cpp:671
msgid "&Move the object to:"
-msgstr "&Premjesti objekt u:"
+msgstr "Pre&mjesti objekt u:"

#: ../src/richtext/richtextsizepage.cpp:674
msgid "&Previous Paragraph"
@@ -8664,7 +8660,7 @@ msgstr "Premješta objekt u prethodni odlomak."

#: ../src/richtext/richtextsizepage.cpp:680
msgid "&Next Paragraph"
-msgstr "&Sljedeći odlomak"
+msgstr "Sljedeći &odlomak"

#: ../src/richtext/richtextsizepage.cpp:681
#: ../src/richtext/richtextsizepage.cpp:683
@@ -9263,7 +9259,7 @@ msgstr "Neuspjelo postavljanje prioriteta procesa"

#: ../src/unix/utilsunx.cpp:712
msgid "Failed to redirect child process input/output"
-msgstr "Neuspjelo preusmjeravanje unosa/iznošaja podređenog procesa"
+msgstr "Neuspjelo preusmjeravanje unosa/rezultata podređenog procesa"

#: ../src/unix/utilsunx.cpp:816
msgid "Failed to set up non-blocking pipe, the program might hang."
@@ -9315,9 +9311,9 @@ msgid "XML parsing error: '%s' at line %d"
msgstr "Greška u XML obradi: „%s” u %d. retku"

#: ../src/xrc/xh_propgrid.cpp:239
-#, fuzzy, c-format
+#, c-format
msgid "Page %i"
-msgstr "Stranica %d"
+msgstr "Stranica %i"

#: ../src/xrc/xmlres.cpp:448
#, c-format


=====================================
samples/dnd/d_and_d.txt
=====================================
@@ -84,10 +84,14 @@ must have been registered) and their values.
drop source will delete the corresponding data - which would lead to
data loss if you didn't paste it properly.

+ If wxScrolled<>::EnableAutoscrollWithoutCapture() was called previously,
+ wxScrolled<>::DisableAutoscrollWithoutCapture() should be called here.
+
c) OnEnter()

called when the mouse enters the window: you might use this function to
- give some additional visual feedback.
+ give some additional visual feedback and/or call
+ wxScrolled<>::EnableAutoscrollWithoutCapture().

d) OnLeave()

@@ -140,7 +144,7 @@ blocking function which enters into its own message loop and may return after
an arbitrarily long time interval. During it, the QueryContinueDrag() is called
whenever the mouse or keyboard state changes. The default behaviour is quite
reasonable for 99% of cases: the drag operation is cancelled if the <Esc> key
-is preessed and the drop is initiated if the mouse button is released.
+is pressed and the drop is initiated if the mouse button is released.

b) After the end of d&d

@@ -160,6 +164,5 @@ wxDropSource::Move code.

@@@@ TODO: support tymed != TYMED_HGLOBAL;
better support of CF_BMP, CF_METAFILE
- scrolling support!! (how?)
sample demonstrating use of user-defined formats
sample which really does something useful


=====================================
samples/dnd/dnd.cpp
=====================================
@@ -32,6 +32,7 @@
#endif

#if wxUSE_DRAG_AND_DROP
+class DnDShapeCanvas;

// ----------------------------------------------------------------------------
// Derive two simple classes which just put in the listbox the strings (text or
@@ -381,17 +382,14 @@ public:

// well, it's a bit difficult to describe a triangle by position and
// size, but we're not doing geometry here, do we? ;-)
- wxPoint p1(m_pos);
- wxPoint p2(m_pos.x + m_size.x, m_pos.y);
- wxPoint p3(m_pos.x, m_pos.y + m_size.y);
+ wxPoint p[3] = {
+ { m_pos },
+ { m_pos.x + m_size.x, m_pos.y },
+ { m_pos.x, m_pos.y + m_size.y },
+ };

- dc.DrawLine(p1, p2);
- dc.DrawLine(p2, p3);
- dc.DrawLine(p3, p1);
-
- //works in multicolor modes; on GTK (at least) will fail in 16-bit color
dc.SetBrush(wxBrush(m_col));
- dc.FloodFill(GetCentre(), m_col, wxFLOOD_BORDER);
+ dc.DrawPolygon(3, p);
}
};

@@ -416,18 +414,8 @@ public:
{
DnDShape::Draw(dc);

- wxPoint p1(m_pos);
- wxPoint p2(p1.x + m_size.x, p1.y);
- wxPoint p3(p2.x, p2.y + m_size.y);
- wxPoint p4(p1.x, p3.y);
-
- dc.DrawLine(p1, p2);
- dc.DrawLine(p2, p3);
- dc.DrawLine(p3, p4);
- dc.DrawLine(p4, p1);
-
dc.SetBrush(wxBrush(m_col));
- dc.FloodFill(GetCentre(), m_col, wxFLOOD_BORDER);
+ dc.DrawRectangle(m_pos, m_size);
}
};

@@ -452,10 +440,8 @@ public:
{
DnDShape::Draw(dc);

- dc.DrawEllipse(m_pos, m_size);
-
dc.SetBrush(wxBrush(m_col));
- dc.FloodFill(GetCentre(), m_col, wxFLOOD_BORDER);
+ dc.DrawEllipse(m_pos, m_size);
}
};

@@ -669,7 +655,7 @@ private:
class DnDShapeDialog : public wxDialog
{
public:
- DnDShapeDialog(wxFrame *parent, DnDShape *shape);
+ DnDShapeDialog(wxWindow *parent, DnDShape *shape);

DnDShape *GetShape() const;

@@ -702,17 +688,34 @@ private:
// A frame for the shapes which can be drag-and-dropped between frames
// ----------------------------------------------------------------------------

-class DnDShapeFrame : public wxScrolled<wxFrame>
+class DnDShapeFrame : public wxFrame
{
public:
DnDShapeFrame(wxFrame *parent);
- ~DnDShapeFrame();
+
+protected:
+ // The menu and updateUI events are sent to the frame, but
+ // I think implementing their handlers is more natural in
+ // the canvas. Use TryBefore() to forward those events to
+ // the canvas.
+ bool TryBefore(wxEvent& event) override;
+
+private:
+ DnDShapeCanvas *m_canvas = nullptr;
+};
+
+// ----------------------------------------------------------------------------
+// A canvas for the shapes which can be drag-and-dropped between frames
+// ----------------------------------------------------------------------------
+
+class DnDShapeCanvas : public wxScrolledCanvas
+{
+public:
+ DnDShapeCanvas(DnDShapeFrame *parent);
+
+ DnDShapeFrame *GetParent();

void SetShape(DnDShape *shape);
- virtual bool SetShape(const wxRegion &region)
- {
- return wxFrame::SetShape( region );
- }

// callbacks
void OnNewShape(wxCommandEvent& event);
@@ -730,9 +733,9 @@ public:
void OnDrop(wxCoord x, wxCoord y, DnDShape *shape);

private:
- DnDShape *m_shape;
+ std::unique_ptr<DnDShape> m_shape;

- static DnDShapeFrame *ms_lastDropTarget;
+ static DnDShapeCanvas *ms_lastDropTarget;

wxDECLARE_EVENT_TABLE();
};
@@ -744,31 +747,31 @@ private:
class DnDShapeDropTarget : public wxDropTarget
{
public:
- DnDShapeDropTarget(DnDShapeFrame *frame)
+ DnDShapeDropTarget(DnDShapeCanvas *canvas)
: wxDropTarget(new DnDShapeDataObject)
{
- m_frame = frame;
+ m_canvas = canvas;
}

// override base class (pure) virtuals
virtual wxDragResult OnEnter(wxCoord x, wxCoord y, wxDragResult def) override
{
#if wxUSE_STATUSBAR
- m_frame->SetStatusText("Mouse entered the frame");
+ m_canvas->GetParent()->SetStatusText("Mouse entered the frame");
#endif // wxUSE_STATUSBAR
- m_frame->EnableAutoscrollWithoutCapture();
+ m_canvas->EnableAutoscrollWithoutCapture();
return OnDragOver(x, y, def);
}
virtual void OnLeave() override
{
#if wxUSE_STATUSBAR
- m_frame->SetStatusText("Mouse left the frame");
+ m_canvas->GetParent()->SetStatusText("Mouse left the frame");
#endif // wxUSE_STATUSBAR
- m_frame->DisableAutoscrollWithoutCapture();
+ m_canvas->DisableAutoscrollWithoutCapture();
}
virtual bool OnDrop(wxCoord x, wxCoord y) override
{
- m_frame->DisableAutoscrollWithoutCapture();
+ m_canvas->DisableAutoscrollWithoutCapture();
return wxDropTarget::OnDrop(x, y);
}
virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def) override
@@ -780,14 +783,14 @@ public:
return wxDragNone;
}

- m_frame->OnDrop(x, y,
+ m_canvas->OnDrop(x, y,
((DnDShapeDataObject *)GetDataObject())->GetShape());

return def;
}

private:
- DnDShapeFrame *m_frame;
+ DnDShapeCanvas *m_canvas;
};

#endif // wxUSE_DRAG_AND_DROP
@@ -867,20 +870,20 @@ wxEND_EVENT_TABLE()

#if wxUSE_DRAG_AND_DROP

-wxBEGIN_EVENT_TABLE(DnDShapeFrame, wxFrame)
- EVT_MENU(Menu_Shape_New, DnDShapeFrame::OnNewShape)
- EVT_MENU(Menu_Shape_Edit, DnDShapeFrame::OnEditShape)
- EVT_MENU(Menu_Shape_Clear, DnDShapeFrame::OnClearShape)
+wxBEGIN_EVENT_TABLE(DnDShapeCanvas, wxScrolledCanvas)
+ EVT_MENU(Menu_Shape_New, DnDShapeCanvas::OnNewShape)
+ EVT_MENU(Menu_Shape_Edit, DnDShapeCanvas::OnEditShape)
+ EVT_MENU(Menu_Shape_Clear, DnDShapeCanvas::OnClearShape)

- EVT_MENU(Menu_ShapeClipboard_Copy, DnDShapeFrame::OnCopyShape)
- EVT_MENU(Menu_ShapeClipboard_Paste, DnDShapeFrame::OnPasteShape)
+ EVT_MENU(Menu_ShapeClipboard_Copy, DnDShapeCanvas::OnCopyShape)
+ EVT_MENU(Menu_ShapeClipboard_Paste, DnDShapeCanvas::OnPasteShape)

- EVT_UPDATE_UI(Menu_ShapeClipboard_Copy, DnDShapeFrame::OnUpdateUICopy)
- EVT_UPDATE_UI(Menu_ShapeClipboard_Paste, DnDShapeFrame::OnUpdateUIPaste)
+ EVT_UPDATE_UI(Menu_ShapeClipboard_Copy, DnDShapeCanvas::OnUpdateUICopy)
+ EVT_UPDATE_UI(Menu_ShapeClipboard_Paste, DnDShapeCanvas::OnUpdateUIPaste)

- EVT_LEFT_DOWN(DnDShapeFrame::OnDrag)
+ EVT_LEFT_DOWN(DnDShapeCanvas::OnDrag)

- EVT_PAINT(DnDShapeFrame::OnPaint)
+ EVT_PAINT(DnDShapeCanvas::OnPaint)
wxEND_EVENT_TABLE()

wxBEGIN_EVENT_TABLE(DnDShapeDialog, wxDialog)
@@ -1596,7 +1599,7 @@ bool DnDFile::OnDropFiles(wxCoord, wxCoord, const wxArrayString& filenames)
// DnDShapeDialog
// ----------------------------------------------------------------------------

-DnDShapeDialog::DnDShapeDialog(wxFrame *parent, DnDShape *shape)
+DnDShapeDialog::DnDShapeDialog(wxWindow *parent, DnDShape *shape)
:wxDialog( parent, 6001, "Choose Shape", wxPoint( 10, 10 ),
wxSize( 40, 40 ),
wxDEFAULT_DIALOG_STYLE | wxRAISED_BORDER | wxRESIZE_BORDER )
@@ -1741,28 +1744,14 @@ void DnDShapeDialog::OnColour(wxCommandEvent& WXUNUSED(event))
// DnDShapeFrame
// ----------------------------------------------------------------------------

-bool wxCreateScrolled(wxFrame* self,
- wxWindow *parent, wxWindowID winid,
- const wxPoint& WXUNUSED(pos), const wxSize& WXUNUSED(size),
- long WXUNUSED(style), const wxString& name)
-{
- return self->Create(parent, winid, name);
-}
-
-DnDShapeFrame *DnDShapeFrame::ms_lastDropTarget = nullptr;
-
DnDShapeFrame::DnDShapeFrame(wxFrame *parent)
- : wxScrolled<wxFrame>(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxScrolledWindowStyle, "Shape Frame")
+ : wxFrame(parent, wxID_ANY, "Shape Frame")
{
#if wxUSE_STATUSBAR
CreateStatusBar();
#endif // wxUSE_STATUSBAR

- // this is completely arbitrary and is done just for illustration purposes
- SetVirtualSize(1000, 1000);
- SetScrollRate(20, 20);
- EnableAutoScrollInside(20);
- DisableAutoScrollOutside();
+ m_canvas = new DnDShapeCanvas(this);

wxMenu *menuShape = new wxMenu;
menuShape->Append(Menu_Shape_New, "&New default shape\tCtrl-S");
@@ -1783,30 +1772,53 @@ DnDShapeFrame::DnDShapeFrame(wxFrame *parent)
#if wxUSE_STATUSBAR
SetStatusText("Press Ctrl-S to create a new shape");
#endif // wxUSE_STATUSBAR
+}

- SetDropTarget(new DnDShapeDropTarget(this));
+bool DnDShapeFrame::TryBefore(wxEvent& event)
+{
+ if (event.GetEventType() == wxEVT_MENU ||
+ event.GetEventType() == wxEVT_UPDATE_UI)
+ {
+ wxPropagationDisabler disablePropagation(event);
+ if (m_canvas && m_canvas->ProcessWindowEvent(event))
+ {
+ return true;
+ }
+ }
+
+ return wxFrame::TryBefore(event);
+}

- m_shape = nullptr;
+DnDShapeCanvas *DnDShapeCanvas::ms_lastDropTarget = nullptr;
+
+DnDShapeCanvas::DnDShapeCanvas(DnDShapeFrame *parent)
+ : wxScrolledCanvas(parent)
+{
+ // this is completely arbitrary and is done just for illustration purposes
+ SetVirtualSize(1000, 1000);
+ SetScrollRate(20, 20);
+ EnableAutoScrollInside(20);
+ DisableAutoScrollOutside();
+
+ SetDropTarget(new DnDShapeDropTarget(this));

SetBackgroundColour(*wxWHITE);
}

-DnDShapeFrame::~DnDShapeFrame()
+DnDShapeFrame *DnDShapeCanvas::GetParent()
{
- if (m_shape)
- delete m_shape;
+ wxWindow *parent = wxScrolledCanvas::GetParent();
+ return wxCheckCast<DnDShapeFrame>(parent);
}

-void DnDShapeFrame::SetShape(DnDShape *shape)
+void DnDShapeCanvas::SetShape(DnDShape *shape)
{
- if (m_shape)
- delete m_shape;
- m_shape = shape;
+ m_shape.reset(shape);
Refresh();
}

// callbacks
-void DnDShapeFrame::OnDrag(wxMouseEvent& event)
+void DnDShapeCanvas::OnDrag(wxMouseEvent& event)
{
if ( !m_shape )
{
@@ -1816,7 +1828,7 @@ void DnDShapeFrame::OnDrag(wxMouseEvent& event)
}

// start drag operation
- DnDShapeDataObject shapeData(m_shape);
+ DnDShapeDataObject shapeData(m_shape.get());
wxDropSource source(shapeData, this);

wxString msg;
@@ -1829,7 +1841,7 @@ void DnDShapeFrame::OnDrag(wxMouseEvent& event)

case wxDragNone:
#if wxUSE_STATUSBAR
- SetStatusText("Nothing happened");
+ GetParent()->SetStatusText("Nothing happened");
#endif // wxUSE_STATUSBAR
break;

@@ -1848,7 +1860,7 @@ void DnDShapeFrame::OnDrag(wxMouseEvent& event)

case wxDragCancel:
#if wxUSE_STATUSBAR
- SetStatusText("Drag and drop operation cancelled");
+ GetParent()->SetStatusText("Drag and drop operation cancelled");
#endif // wxUSE_STATUSBAR
break;
}
@@ -1856,13 +1868,13 @@ void DnDShapeFrame::OnDrag(wxMouseEvent& event)
if (msg.length() )
{
#if wxUSE_STATUSBAR
- SetStatusText(wxString("Shape successfully ") + msg);
+ GetParent()->SetStatusText(wxString("Shape successfully ") + msg);
#endif // wxUSE_STATUSBAR
}
//else: status text already set
}

-void DnDShapeFrame::OnDrop(wxCoord x, wxCoord y, DnDShape *shape)
+void DnDShapeCanvas::OnDrop(wxCoord x, wxCoord y, DnDShape *shape)
{
ms_lastDropTarget = this;

@@ -1872,16 +1884,16 @@ void DnDShapeFrame::OnDrop(wxCoord x, wxCoord y, DnDShape *shape)
#if wxUSE_STATUSBAR
wxString s;
s.Printf("Shape dropped at (%d, %d)", pt.x, pt.y);
- SetStatusText(s);
+ GetParent()->SetStatusText(s);
#endif // wxUSE_STATUSBAR

shape->Move(pt);
SetShape(shape);
}

-void DnDShapeFrame::OnEditShape(wxCommandEvent& WXUNUSED(event))
+void DnDShapeCanvas::OnEditShape(wxCommandEvent& WXUNUSED(event))
{
- DnDShapeDialog dlg(this, m_shape);
+ DnDShapeDialog dlg(this, m_shape.get());
if ( dlg.ShowModal() == wxID_OK )
{
SetShape(dlg.GetShape());
@@ -1889,27 +1901,27 @@ void DnDShapeFrame::OnEditShape(wxCommandEvent& WXUNUSED(event))
#if wxUSE_STATUSBAR
if ( m_shape )
{
- SetStatusText("You can now drag the shape to another frame");
+ GetParent()->SetStatusText("You can now drag the shape to another frame");
}
#endif // wxUSE_STATUSBAR
}
}

-void DnDShapeFrame::OnNewShape(wxCommandEvent& WXUNUSED(event))
+void DnDShapeCanvas::OnNewShape(wxCommandEvent& WXUNUSED(event))
{
SetShape(new DnDEllipticShape(wxPoint(10, 10), wxSize(80, 60), *wxRED));

#if wxUSE_STATUSBAR
- SetStatusText("You can now drag the shape to another frame");
+ GetParent()->SetStatusText("You can now drag the shape to another frame");
#endif // wxUSE_STATUSBAR
}

-void DnDShapeFrame::OnClearShape(wxCommandEvent& WXUNUSED(event))
+void DnDShapeCanvas::OnClearShape(wxCommandEvent& WXUNUSED(event))
{
SetShape(nullptr);
}

-void DnDShapeFrame::OnCopyShape(wxCommandEvent& WXUNUSED(event))
+void DnDShapeCanvas::OnCopyShape(wxCommandEvent& WXUNUSED(event))
{
if ( m_shape )
{
@@ -1921,11 +1933,11 @@ void DnDShapeFrame::OnCopyShape(wxCommandEvent& WXUNUSED(event))
return;
}

- wxTheClipboard->AddData(new DnDShapeDataObject(m_shape));
+ wxTheClipboard->AddData(new DnDShapeDataObject(m_shape.get()));
}
}

-void DnDShapeFrame::OnPasteShape(wxCommandEvent& WXUNUSED(event))
+void DnDShapeCanvas::OnPasteShape(wxCommandEvent& WXUNUSED(event))
{
wxClipboardLocker clipLocker;
if ( !clipLocker )
@@ -1946,17 +1958,17 @@ void DnDShapeFrame::OnPasteShape(wxCommandEvent& WXUNUSED(event))
}
}

-void DnDShapeFrame::OnUpdateUICopy(wxUpdateUIEvent& event)
+void DnDShapeCanvas::OnUpdateUICopy(wxUpdateUIEvent& event)
{
event.Enable( m_shape != nullptr );
}

-void DnDShapeFrame::OnUpdateUIPaste(wxUpdateUIEvent& event)
+void DnDShapeCanvas::OnUpdateUIPaste(wxUpdateUIEvent& event)
{
event.Enable( wxTheClipboard->IsSupported(wxDataFormat(ShapeFormatId())) );
}

-void DnDShapeFrame::OnPaint(wxPaintEvent& WXUNUSED(event))
+void DnDShapeCanvas::OnPaint(wxPaintEvent& WXUNUSED(event))
{
wxPaintDC dc(this);
DoPrepareDC(dc);


=====================================
src/qt/textentry.cpp
=====================================
@@ -21,119 +21,6 @@
#include <QtWidgets/QLineEdit>
#include <QtWidgets/QWidget>

-wxTextEntry::wxTextEntry()
-{
-}
-
-void wxTextEntry::WriteText(const wxString& WXUNUSED(text))
-{
-}
-
-void wxTextEntry::Remove(long from, long to)
-{
- const long insertionPoint = GetInsertionPoint();
- wxString string = GetValue();
- string.erase(from, to - from);
- SetValue(string);
- SetInsertionPoint( std::min(insertionPoint, static_cast<long>(string.length())) );
-}
-
-void wxTextEntry::Copy()
-{
-}
-
-void wxTextEntry::Cut()
-{
-}
-
-void wxTextEntry::Paste()
-{
-}
-
-void wxTextEntry::Undo()
-{
-}
-
-void wxTextEntry::Redo()
-{
-}
-
-bool wxTextEntry::CanUndo() const
-{
- return false;
-}
-
-bool wxTextEntry::CanRedo() const
-{
- return false;
-}
-
-void wxTextEntry::SetInsertionPoint(long WXUNUSED(pos))
-{
-}
-
-long wxTextEntry::GetInsertionPoint() const
-{
- return 0;
-}
-
-long wxTextEntry::GetLastPosition() const
-{
- return GetValue().length();
-}
-
-void wxTextEntry::SetSelection(long WXUNUSED(from), long WXUNUSED(to))
-{
- wxFAIL_MSG("wxTextEntry::SetSelection should be overridden");
-}
-
-void wxTextEntry::GetSelection(long *from, long *to) const
-{
- // no unified get selection method in Qt (overridden in textctrl & combobox)
- // only called if no selection
- // If the return values from and to are the same, there is no
- // selection.
- {
- *from =
- *to = GetInsertionPoint();
- }
-}
-
-bool wxTextEntry::IsEditable() const
-{
- return false;
-}
-
-void wxTextEntry::SetEditable(bool WXUNUSED(editable))
-{
-}
-
-wxString wxTextEntry::DoGetValue() const
-{
- return wxString();
-}
-
-void wxTextEntry::DoSetValue(const wxString& value, int flags)
-{
- wxTextEntryBase::DoSetValue(value, flags);
-}
-
-wxWindow *wxTextEntry::GetEditableWindow()
-{
- return nullptr;
-}
-
-void wxTextEntry::EnableTextChangedEvents(bool enable)
-{
- wxWindow* const win = GetEditableWindow();
-
- if ( win )
- win->GetHandle()->blockSignals(!enable);
-}
-
-// ----------------------------------------------------------------------------
-// auto-completion
-// ----------------------------------------------------------------------------
namespace
{
// This class is taken from Qt documentation "as is" to see "C:\Program Files"
@@ -327,6 +214,129 @@ private:
wxDECLARE_NO_COPY_CLASS(wxTextAutoCompleteData);
};

+// ============================================================================
+// wxTextEntry implementation
+// ============================================================================
+
+wxTextEntry::wxTextEntry()
+{
+}
+
+wxTextEntry::~wxTextEntry()
+{
+ delete m_autoCompleteData;
+}
+
+void wxTextEntry::WriteText(const wxString& WXUNUSED(text))
+{
+}
+
+void wxTextEntry::Remove(long from, long to)
+{
+ const long insertionPoint = GetInsertionPoint();
+ wxString string = GetValue();
+ string.erase(from, to - from);
+ SetValue(string);
+ SetInsertionPoint( std::min(insertionPoint, static_cast<long>(string.length())) );
+}
+
+void wxTextEntry::Copy()
+{
+}
+
+void wxTextEntry::Cut()
+{
+}
+
+void wxTextEntry::Paste()
+{
+}
+
+void wxTextEntry::Undo()
+{
+}
+
+void wxTextEntry::Redo()
+{
+}
+
+bool wxTextEntry::CanUndo() const
+{
+ return false;
+}
+
+bool wxTextEntry::CanRedo() const
+{
+ return false;
+}
+
+void wxTextEntry::SetInsertionPoint(long WXUNUSED(pos))
+{
+}
+
+long wxTextEntry::GetInsertionPoint() const
+{
+ return 0;
+}
+
+long wxTextEntry::GetLastPosition() const
+{
+ return GetValue().length();
+}
+
+void wxTextEntry::SetSelection(long WXUNUSED(from), long WXUNUSED(to))
+{
+ wxFAIL_MSG("wxTextEntry::SetSelection should be overridden");
+}
+
+void wxTextEntry::GetSelection(long *from, long *to) const
+{
+ // no unified get selection method in Qt (overridden in textctrl & combobox)
+ // only called if no selection
+ // If the return values from and to are the same, there is no
+ // selection.
+ {
+ *from =
+ *to = GetInsertionPoint();
+ }
+}
+
+bool wxTextEntry::IsEditable() const
+{
+ return false;
+}
+
+void wxTextEntry::SetEditable(bool WXUNUSED(editable))
+{
+}
+
+wxString wxTextEntry::DoGetValue() const
+{
+ return wxString();
+}
+
+void wxTextEntry::DoSetValue(const wxString& value, int flags)
+{
+ wxTextEntryBase::DoSetValue(value, flags);
+}
+
+wxWindow *wxTextEntry::GetEditableWindow()
+{
+ return nullptr;
+}
+
+void wxTextEntry::EnableTextChangedEvents(bool enable)
+{
+ wxWindow* const win = GetEditableWindow();
+
+ if ( win )
+ win->GetHandle()->blockSignals(!enable);
+}
+
+// ----------------------------------------------------------------------------
+// auto-completion
+// ----------------------------------------------------------------------------
+
bool wxTextEntry::DoAutoCompleteFileNames(int WXUNUSED(flags))
{
if ( m_autoCompleteData )


=====================================
tests/strings/strings.cpp
=====================================
@@ -453,6 +453,21 @@ TEST_CASE("StringCompare", "[wxString]")
CHECK( wxString("!").Cmp("z") < 0 );
}

+#ifdef __cpp_lib_three_way_comparison
+TEST_CASE("StringCompareThreeWay", "[wxString]")
+{
+ // test that operator<=> works and compares by string contents
+
+ wxString a(wxT("bar"));
+ wxString b(wxT("bar"));
+ wxString c(wxT("baz"));
+
+ CHECK((a <=> b) == std::strong_ordering::equal);
+ CHECK((a <=> c) == std::strong_ordering::less);
+ CHECK((c <=> a) == std::strong_ordering::greater);
+}
+#endif // __cpp_lib_three_way_comparison
+
TEST_CASE("StringCompareNoCase", "[wxString]")
{
wxString s1 = wxT("AHH");



View it on GitLab: https://gitlab.com/wxwidgets/wxwidgets/-/compare/03d9f9a831512a6b9a533c2c8fc90eaa9e3400af...d05c5c1d3e55542e63711778193175c099774f60

--
View it on GitLab: https://gitlab.com/wxwidgets/wxwidgets/-/compare/03d9f9a831512a6b9a533c2c8fc90eaa9e3400af...d05c5c1d3e55542e63711778193175c099774f60
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help


Reply all
Reply to author
Forward
0 new messages