Vadim Zeitlin pushed to branch master at wxWidgets / wxWidgets
Commits:
062bbe5b by Vadim Zeitlin at 2026-04-05T15:44:30+02:00
Mention wxTextEntry::SetMaxLength() wxMSW-specific behaviour
In wxMSW it's possible to insert more than max length characters
programmatically, but this is not the case in the other ports and at
least in wxGTK such behaviour simply can't be implemented because
gtk_entry_set_max_length() imposes this limit on the text in the
control, wherever it comes from.
See #26314.
- - - - -
8dbe20b8 by Vadim Zeitlin at 2026-04-05T15:46:57+02:00
Initialize wxTextEntry members in their declarations
No real changes, just a minor simplification/cleanup.
- - - - -
97532483 by Vadim Zeitlin at 2026-04-05T18:17:17+02:00
Insert as much text as fits in max length in wxGTK wxTextEntry
This is better than not inserting anything at all as was the case
before.
- - - - -
97bc607b by Vadim Zeitlin at 2026-04-06T01:34:19+02:00
Fix appearance of wxListCtrl corner in MSW dark mode
Paint the corner not covered by the scrollbars, when both of them are
shown, ourselves in dark mode as it doesn't have the right colour
otherwise.
Closes #26333.
Co-Authored-By: Dan <
CEXT...@users.noreply.github.com>
- - - - -
38bd238d by Blake-Madden at 2026-04-06T01:37:50+02:00
Fix special characters such as "&" in wxSVGFileDC title
Escape them to preserve the special characters.
Closes #26355.
- - - - -
1f0d74de by Bill Su at 2026-04-06T18:14:48+02:00
wxScrolled<>: reduce public API
Reduce the number of functions declared public by making functions
only used in the implementation private and giving internal classes
friend access.
This commit is best viewed with git diff --color-moved and
--color-moved-ws=ignore-all-space options.
Closes #26319.
- - - - -
9ea34551 by utelle at 2026-04-06T18:14:48+02:00
Update German translation of the internat sample
See #26354.
- - - - -
d3734f2f by utelle at 2026-04-06T18:18:56+02:00
Fix wxUILocale when regional format differs from Windows language
On Windows the default locale instantiated by wxUILocale::UseDefault()
referenced the locale configured for regional formatting in the Windows
settings. This could lead to unintended behaviour (like using the wrong
layout direction), if the locale for the Windows display language
was different from the locale for regional formatting.
Fix this by using the correct locale, i.e. either the one corresponding
to the display language or the one corresponding to the regional
formatting, depending on the locale property in question.
Closes #26274.
Closes #26354.
- - - - -
ba3f6c05 by Stefan Csomor at 2026-04-07T00:03:34+02:00
Centralize setting styles for normal and toggle buttons in wxOSX
Make SetBezelStyleFromBorderFlags() function internally public, rename
it to use "wxOSX" prefix and use it for toggle buttons as well.
See #26300.
Closes #26308.
- - - - -
638af54a by Vadim Zeitlin at 2026-04-07T00:05:05+02:00
Merge branch 'text-max-len-fixes'
Miscellaneous fixes related to max length of wxTextEntry.
See #26351.
- - - - -
15 changed files:
- include/wx/gtk/textentry.h
- include/wx/osx/cocoa/private.h
- include/wx/scrolwin.h
- include/wx/uilocale.h
- interface/wx/textentry.h
- interface/wx/uilocale.h
- samples/internat/de/internat.mo
- samples/internat/de/internat.po
- src/common/dcsvg.cpp
- src/common/uilocale.cpp
- src/gtk/textentry.cpp
- src/msw/listctrl.cpp
- src/msw/uilocale.cpp
- src/osx/cocoa/
button.mm
- src/osx/cocoa/
tglbtn.mm
Changes:
=====================================
include/wx/gtk/textentry.h
=====================================
@@ -134,16 +134,16 @@ private:
// Various auto-completion-related stuff, only used if any of AutoComplete()
// methods are called.
- wxTextAutoCompleteData *m_autoCompleteData;
+ wxTextAutoCompleteData *m_autoCompleteData = nullptr;
// It needs to call our GetEntry() method.
friend class wxTextAutoCompleteData;
// Data used for coalescing "changed" events resulting from a single user
// action.
- mutable wxTextCoalesceData* m_coalesceData;
+ mutable wxTextCoalesceData* m_coalesceData = nullptr;
- bool m_isUpperCase;
+ bool m_isUpperCase = false;
};
// We don't need the generic version.
=====================================
include/wx/osx/cocoa/private.h
=====================================
@@ -50,7 +50,12 @@ wxBitmapBundle WXDLLIMPEXP_CORE wxOSXCreateSystemBitmapBundle(const wxString& id
WXWindow WXDLLIMPEXP_CORE wxOSXGetMainWindow();
WXWindow WXDLLIMPEXP_CORE wxOSXGetKeyWindow();
WXImage WXDLLIMPEXP_CORE wxOSXGetNSImageFromNSCursor(const WXHCURSOR cursor);
-
+void wxOSXSetBezelStyleFromBorderFlags(WX_NSButton v,
+ long style,
+ wxWindowID winid,
+ const wxString& label = wxString(),
+ const wxBitmapBundle& bitmap = wxBitmapBundle(),
+ wxWindow *peer = nullptr);
class WXDLLIMPEXP_FWD_CORE wxDialog;
class WXDLLIMPEXP_FWD_CORE wxWidgetCocoaImpl;
=====================================
include/wx/scrolwin.h
=====================================
@@ -68,9 +68,6 @@ enum wxScrollbarVisibility
class WXDLLIMPEXP_CORE wxAnyScrollHelperBase
{
public:
- explicit wxAnyScrollHelperBase(wxWindow* win);
- virtual ~wxAnyScrollHelperBase() = default;
-
// Disable use of keyboard keys for scrolling. By default cursor movement
// keys (including Home, End, Page Up and Down) are used to scroll the
// window appropriately. If the derived class uses these keys for something
@@ -107,12 +104,10 @@ public:
// Simple accessor for the window that is really being scrolled.
wxWindow *GetTargetWindow() const { return m_targetWindow; }
-
- // The methods called from the window event handlers.
- void HandleOnChar(wxKeyEvent& event);
- void HandleOnPaint(wxPaintEvent& event);
-
protected:
+ explicit wxAnyScrollHelperBase(wxWindow* win);
+ virtual ~wxAnyScrollHelperBase() = default;
+
// the window that receives the scroll events and the window to actually
// scroll, respectively
wxWindow *m_win,
@@ -120,16 +115,20 @@ protected:
// whether cursor keys should scroll the window
bool m_kbdScrollingEnabled;
+
+private:
+ // The methods called from the window event handlers.
+ void HandleOnChar(wxKeyEvent& event);
+ void HandleOnPaint(wxPaintEvent& event);
+
+ friend class wxScrollHelperEvtHandler;
+ friend class wxVarScrollHelperEvtHandler;
};
// This is the class containing the guts of (uniform) scrolling logic.
class WXDLLIMPEXP_CORE wxScrollHelperBase : public wxAnyScrollHelperBase
{
public:
- // ctor must be given the associated window
- wxScrollHelperBase(wxWindow *winToScroll);
- virtual ~wxScrollHelperBase();
-
// configure the scrolling
virtual void SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY,
int noUnitsX, int noUnitsY,
@@ -161,13 +160,6 @@ public:
// Forbid autoscrolling when the mouse is outside the window
void DisableAutoScrollOutside();
- // Check whether clientPt triggers autoscrolling in each direction: return
- // true if it does and fill the corresponding output parameter with the
- // event type to generate.
- bool AutoscrollTest(wxPoint clientPt,
- wxEventType& evtHorzScroll,
- wxEventType& evtVertScroll) const;
-
// 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
@@ -176,7 +168,6 @@ public:
// EnableAutoscrollWithoutCapture() when processing a
// drag-enter, and DisableAutoscrollWithoutCapture() when
// processing a drag-exit or drag-drop.
- bool GetAutoscrollWithoutCapture() const;
void EnableAutoscrollWithoutCapture();
void DisableAutoscrollWithoutCapture();
@@ -254,15 +245,9 @@ public:
return p2;
}
- void DoCalcScrolledPosition(int x, int y, int *xx, int *yy) const;
- void DoCalcUnscrolledPosition(int x, int y, int *xx, int *yy) const;
-
// Adjust the scrollbars
virtual void AdjustScrollbars() = 0;
- // Calculate scroll increment
- int CalcScrollInc(wxScrollWinEvent& event);
-
// Normally the wxScrolledWindow will scroll itself, but in some rare
// occasions you might want it to scroll [part of] another window (e.g. a
// child of it in order to scroll only a portion the area between the
@@ -288,19 +273,11 @@ public:
// the base class version just returns true
virtual bool SendAutoScrollEvents(wxScrollWinEvent& event) const;
- // the methods to be called from the window event handlers
- void HandleOnScroll(wxScrollWinEvent& event);
- void HandleOnSize(wxSizeEvent& event);
- void OnMotion(wxMouseEvent& event);
- void OnLeftDown(wxMouseEvent& event);
- void OnLeaveAutoScrollRegion();
- void OnEnterAutoScrollRegion();
-#if wxUSE_MOUSEWHEEL
- void HandleOnMouseWheel(wxMouseEvent& event);
-#endif // wxUSE_MOUSEWHEEL
- void HandleOnChildFocus(wxChildFocusEvent& event);
-
protected:
+ // ctor must be given the associated window
+ wxScrollHelperBase(wxWindow* winToScroll);
+ virtual ~wxScrollHelperBase();
+
// get pointer to our scroll rect if we use it or nullptr
const wxRect *GetScrollRect() const
{
@@ -415,6 +392,37 @@ protected:
wxScrollHelperEvtHandler *m_handler;
wxDECLARE_NO_COPY_CLASS(wxScrollHelperBase);
+
+private:
+ // Check whether clientPt triggers autoscrolling in each direction: return
+ // true if it does and fill the corresponding output parameter with the
+ // event type to generate.
+ bool AutoscrollTest(wxPoint clientPt,
+ wxEventType& evtHorzScroll,
+ wxEventType& evtVertScroll) const;
+
+ bool GetAutoscrollWithoutCapture() const;
+
+ void DoCalcScrolledPosition(int x, int y, int* xx, int* yy) const;
+ void DoCalcUnscrolledPosition(int x, int y, int* xx, int* yy) const;
+
+ // Calculate scroll increment
+ int CalcScrollInc(wxScrollWinEvent& event);
+
+ // the methods to be called from the window event handlers
+ void HandleOnScroll(wxScrollWinEvent& event);
+ void HandleOnSize(wxSizeEvent& event);
+ void OnMotion(wxMouseEvent& event);
+ void OnLeftDown(wxMouseEvent& event);
+ void OnLeaveAutoScrollRegion();
+ void OnEnterAutoScrollRegion();
+#if wxUSE_MOUSEWHEEL
+ void HandleOnMouseWheel(wxMouseEvent& event);
+#endif // wxUSE_MOUSEWHEEL
+ void HandleOnChildFocus(wxChildFocusEvent& event);
+
+ friend class wxAutoScrollTimer;
+ friend class wxScrollHelperEvtHandler;
};
// this macro can be used in a wxScrollHelper-derived class to forward wxWindow
@@ -447,6 +455,7 @@ public: \
// helper class for wxScrolled<T> below
struct WXDLLIMPEXP_CORE wxScrolledT_Helper
{
+protected:
static wxSize FilterBestSize(const wxWindow *win,
const wxScrollHelper *helper,
const wxSize& origBest);
=====================================
include/wx/uilocale.h
=====================================
@@ -158,6 +158,9 @@ public:
// not supported, the other functions will behave as for the "C" locale.
bool IsSupported() const;
+ // Check if the locale was instantiated via UseDefault()
+ bool IsDefault() const { return m_isDefault; }
+
// Get the platform-dependent name of the current locale.
wxString GetName() const;
@@ -273,6 +276,7 @@ private:
static wxUILocale ms_current;
wxUILocaleImpl* m_impl;
+ bool m_isDefault = false;
};
inline wxString wxGetUIDateFormat()
=====================================
interface/wx/textentry.h
=====================================
@@ -410,6 +410,11 @@ public:
event is sent to notify the program about it (giving it the possibility
to show an explanatory message, for example) and the extra input is discarded.
+ @note In wxMSW the program may write more than @a len characters into
+ the control programmatically, even if the user is not able to enter
+ more than @a len characters. This is, however, not the case in the
+ other ports and it is recommended not to rely on this behaviour.
+
@note This function may be used with single line text controls in all
ports but only works for multi-line text controls in wxMSW and wxGTK.
*/
=====================================
interface/wx/uilocale.h
=====================================
@@ -407,6 +407,13 @@ public:
*/
bool IsSupported() const;
+ /**
+ Return true if locale was instantiated via UseDefault(), false otherwise.
+
+ @since 3.3.3
+ */
+ bool IsDefault() const;
+
/**
Adds custom, user-defined language to the database of known languages.
*/
=====================================
samples/internat/de/internat.mo
=====================================
Binary files a/samples/internat/de/internat.mo and b/samples/internat/de/internat.mo differ
=====================================
samples/internat/de/internat.po
=====================================
@@ -5,190 +5,203 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
-"POT-Creation-Date: 2021-12-10 10:06+0100\n"
-"PO-Revision-Date: 2021-12-10 10:15+0100\n"
+"POT-Creation-Date: 2026-04-04 14:40+0200\n"
+"PO-Revision-Date: 2026-04-04 14:43+0200\n"
"Last-Translator: Ulrich Telle <
ulr...@telle-online.eu>\n"
"Language-Team: \n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Generator: Poedit 3.0\n"
-"X-Poedit-Basepath: ..\n"
-"X-Poedit-KeywordsList: _;wxTRANSLATE;wxPLURAL:1,2;wxGETTEXT_IN_CONTEXT:1c,2;"
-"wxGETTEXT_IN_CONTEXT_PLURAL:1c,2,3\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"X-Generator: Poedit 3.9\n"
+"X-Poedit-Basepath: ..\n"
+"X-Poedit-KeywordsList: "
+"_;wxTRANSLATE;wxPLURAL:1,2;wxGETTEXT_IN_CONTEXT:1c,2;wxGETTEXT_IN_CONTEXT_PLURAL:1c,2,3\n"
"X-Poedit-SearchPath-0: .\n"
-#: internat.cpp:168
+#: internat.cpp:169
msgid "skip setting locale on startup"
msgstr "Setzen des Gebietsschemas überspringen"
-#: internat.cpp:170
+#: internat.cpp:171
msgid "do set locale on startup without asking"
msgstr "Setze das Gebietsschema beim Start ohne Nachfrage"
-#: internat.cpp:253
+#: internat.cpp:254
#, c-format
msgid "Couldn't find/load 'internat' catalog for %s."
msgstr "Konnte den 'internat'-Katalog für %s nicht finden/laden."
-#: internat.cpp:289
+#: internat.cpp:290
msgid "International wxWidgets App"
msgstr "Internationale wxWidgets-Anwendung"
-#: internat.cpp:295
+#: internat.cpp:296
msgid "&Test locale availability...\tCtrl-T"
msgstr "&Teste Gebietsschemaverfügbarkeit...\tStrg-T"
-#: internat.cpp:300
+#: internat.cpp:301
msgid "E&xit"
msgstr "&Schließen"
-#: internat.cpp:303
+#: internat.cpp:304
msgid "&Open bogus file"
msgstr "Ö&ffne Unsinn-Datei"
-#: internat.cpp:303
+#: internat.cpp:304
msgid "Shows a wxWidgets localized error message"
msgstr "Zeigt eine lokalisierte wxWidgets-Fehlermeldung"
-#: internat.cpp:304
+#: internat.cpp:305
msgid "&Save dummy file"
msgstr "&Speichere Dummy-Datei"
-#: internat.cpp:304
+#: internat.cpp:305
msgid "Shows a localized standard dialog"
msgstr "Zeigt einen lokalisierten Standard-Dialog"
-#: internat.cpp:305
+#: internat.cpp:306
msgid "&Play a game"
msgstr "Spiele ein S&piel"
-#: internat.cpp:305
+#: internat.cpp:306
msgid "A little game; hint: 17 is a lucky number for many"
msgstr "Ein kleines Spiel; Hinweis: 17 ist für viele eine Glückszahl"
-#: internat.cpp:307
+#: internat.cpp:308
msgid "&1 _() (gettext)"
msgstr "&1 _() (gettext)"
-#: internat.cpp:307
+#: internat.cpp:308
msgid "Tests the _() macro"
msgstr "Testet das _() Makro"
-#: internat.cpp:308
+#: internat.cpp:309
msgid "&2 _N() (ngettext)"
msgstr "&2 _N() (ngettext)"
-#: internat.cpp:308
+#: internat.cpp:309
msgid "Tests the _N() macro"
msgstr "Testet das _N() Makro"
-#: internat.cpp:309
+#: internat.cpp:310
msgid "&3 wxTRANSLATE() (gettext_noop)"
msgstr "&3 wxTRANSLATE() (gettext_noop)"
-#: internat.cpp:309
+#: internat.cpp:310
msgid "Tests the wxTRANSLATE() macro"
msgstr "Testet das wxTRANSLATE() Makro"
-#: internat.cpp:310
+#: internat.cpp:311
msgid "&Message box test"
msgstr "&Hinweisfenster-Test"
-#: internat.cpp:311
+#: internat.cpp:312
msgid "Tests message box buttons labels translation"
msgstr "Testet die Übersetzung der Schaltflächen im Hinweisfenster"
-#: internat.cpp:316
+#: internat.cpp:315
msgid "item"
msgstr "Eintrag ohne Kontext"
-#: internat.cpp:317
+#: internat.cpp:316
msgctxt "context_1"
msgid "item"
msgstr "Eintrag Kontext 1"
-#: internat.cpp:318
+#: internat.cpp:317
msgctxt "context_2"
msgid "item"
msgstr "Eintrag Kontext 2"
-#: internat.cpp:319 internat.cpp:320
+#: internat.cpp:318 internat.cpp:319
msgid "sing"
msgid_plural "plur"
msgstr[0] "Einzahl ohne Kontext"
msgstr[1] "Mehrzahl ohne Kontext"
-#: internat.cpp:321 internat.cpp:322
+#: internat.cpp:320 internat.cpp:321
msgctxt "context_1"
msgid "sing"
msgid_plural "plur"
msgstr[0] "Einzahl Kontext 1"
msgstr[1] "Mehrzahl Kontext 1"
-#: internat.cpp:323 internat.cpp:324
+#: internat.cpp:322 internat.cpp:323
msgctxt "context_2"
msgid "sing"
msgid_plural "plur"
msgstr[0] "Einzahl Kontext 2"
msgstr[1] "Mehrzahl Kontext 2"
-#: internat.cpp:328
+#: internat.cpp:327
msgid "Show coreutils &help"
msgstr "Zeige coreutils-&Hilfe"
-#: internat.cpp:331
+#: internat.cpp:330
msgid "&About"
msgstr "Ü&ber"
-#: internat.cpp:336
+#: internat.cpp:335
msgid "&Test"
msgstr "&Test"
-#: internat.cpp:337
+#: internat.cpp:336
msgid "&Macro"
msgstr "&Makro"
-#: internat.cpp:343
+#: internat.cpp:342
msgctxt "standard Windows menu"
msgid "&Help"
msgstr "&Hilfe"
-#: internat.cpp:360
+#: internat.cpp:359
#, c-format
msgid "Current UI locale: %s; C locale: %s"
msgstr "Aktuelles UI Gebietsschema: %s; C Gebietsschema: %s"
-#: internat.cpp:373
+#: internat.cpp:372
#, c-format
msgid "UI locale name in English: %s"
msgstr "Name des UI Gebietsschema auf Englisch: %s"
-#: internat.cpp:385
+#: internat.cpp:384
#, c-format
msgid "... and in the locale language: %s"
msgstr "… und in der Sprache des Gebietsschemas: %s"
#: internat.cpp:396
+#, c-format
+msgid "Preferred UI languages: [%s]"
+msgstr "Bevorzugte UI-Sprachen: [%s]"
+
+#: internat.cpp:410
msgid "Numeric input:"
msgstr "Numerische Eingabe:"
-#: internat.cpp:417
+#: internat.cpp:419
+msgid "Date input:"
+msgstr "Datumseingabe:"
+
+#: internat.cpp:425
+msgid "Time input:"
+msgstr "Zeiteingabe:"
+
+#: internat.cpp:443
msgid "Number"
msgstr "Zahl"
-#: internat.cpp:421
+#: internat.cpp:447
msgid "Date"
msgstr "Datum"
-#: internat.cpp:437
+#: internat.cpp:463
#, c-format
msgid "Number in UI locale: %s; in C locale: %.2f"
msgstr "Zahl im UI Gebietsschema: %s; im C Gebietsschema: %.2f"
-#: internat.cpp:457
+#: internat.cpp:483
msgid ""
"I18n sample\n"
"(c) 1998, 1999 Vadim Zeitlin and Julian Smart"
@@ -196,45 +209,41 @@ msgstr ""
"I18n Beispiel\n"
"© 1998, 1999 Vadim Zeitlin und Julian Smart"
-#: internat.cpp:458
+#: internat.cpp:484
msgid "About Internat"
msgstr "Über Internat"
-#: internat.cpp:491
+#: internat.cpp:517
msgid "Enter your number:"
msgstr "Geben Sie eine Zahl ein:"
-#: internat.cpp:492
+#: internat.cpp:518
msgid "Try to guess my number!"
msgstr "Versuchen Sie, die Zahl zu raten!"
-#: internat.cpp:506
+#: internat.cpp:532
msgid "You've probably entered an invalid number."
msgstr "Sie haben wahrscheinlich eine ungültige Zahl eingegeben."
-#: internat.cpp:520
+#: internat.cpp:546
msgid "Congratulations! you've won. Here is the magic phrase:"
msgstr ""
"Herzlichen Glückwunsch! Sie haben gewonnen. Hier ist der magische Satz:"
-#: internat.cpp:521
+#: internat.cpp:547
#, c-format
msgid "cannot create fifo `%s'"
msgstr "Fifo `%s' kann nicht erzeugt werden"
-#: internat.cpp:530
-msgid "Bad luck! try again..."
-msgstr "Pech gehabt! Versuchen Sie es noch einmal..."
-
-#: internat.cpp:538
+#: internat.cpp:557
msgid "Result"
msgstr "Ergebnis"
-#: internat.cpp:546
+#: internat.cpp:565
msgid "Enter the locale to test"
msgstr "Geben Sie das zu testende Gebietsschema ein"
-#: internat.cpp:562
+#: internat.cpp:580
#, c-format
msgid ""
"Locale \"%s\" is available.\n"
@@ -247,60 +256,60 @@ msgstr ""
"Englischer Name: %s\n"
"Lokaler Name: %s"
-#: internat.cpp:569
+#: internat.cpp:587
#, c-format
msgid "Locale \"%s\" is not available."
msgstr "Gebietsschema \"%s\" ist nicht verfügbar."
-#: internat.cpp:584
+#: internat.cpp:603
msgid "Dummy file dialog"
msgstr "Dummy-Datei-Dialog"
-#: internat.cpp:589
+#: internat.cpp:608
msgid "Testing _() (gettext)"
msgstr "Test von _() (gettext)"
-#: internat.cpp:597
+#: internat.cpp:616
msgid "Please enter text to translate"
msgstr "Bitte geben Sie einen zu übersetzenden Text ein"
-#: internat.cpp:598
+#: internat.cpp:617
msgid "default value"
msgstr "Default-Wert"
-#: internat.cpp:612
+#: internat.cpp:631
msgid "Testing _N() (ngettext)"
msgstr "Test von _N() (ngettext)"
-#: internat.cpp:614
+#: internat.cpp:633
msgid "Please enter range for plural forms of \"n files deleted\" phrase"
msgstr ""
"Bitte geben Sie einen Bereich für Pluralformen des Satzes \"n Dateien "
"gelöscht\" ein"
-#: internat.cpp:626
+#: internat.cpp:645
msgid "file deleted"
msgid_plural "files deleted"
msgstr[0] "Datei gelöscht"
msgstr[1] "Dateien gelöscht"
-#: internat.cpp:637
+#: internat.cpp:656
msgid "line 1"
msgstr "Zeile 1"
-#: internat.cpp:638
+#: internat.cpp:657
msgid "line 2"
msgstr "Zeile 2"
-#: internat.cpp:639
+#: internat.cpp:658
msgid "line 3"
msgstr "Zeile 3"
-#: internat.cpp:642
+#: internat.cpp:661
msgid "Testing wxTRANSLATE() (gettext_noop)"
msgstr "Test von wxTRANSLATE() (gettext_noop)"
-#: internat.cpp:655
+#: internat.cpp:674
msgid ""
"Are the labels of the buttons in this message box translated into the "
"current locale language?"
@@ -308,14 +317,17 @@ msgstr ""
"Wurden die Beschriftungen der Schaltflächen in diesem Hinweisfenster in die "
"Sprache des aktuellen Gebietsschemas übersetzt?"
-#: internat.cpp:657
+#: internat.cpp:676
msgid "wxWidgets i18n sample"
msgstr "wxWidgets I18n Beispiel"
-#: internat.cpp:662
+#: internat.cpp:681
msgid "Please report the details of your platform to us."
msgstr "Bitte teilen Sie uns über die Details Ihrer Plattform mit."
+#~ msgid "Bad luck! try again..."
+#~ msgstr "Pech gehabt! Versuchen Sie es noch einmal..."
+
#, c-format
#~ msgid "Locale \"%s\" is unknown."
#~ msgstr "Gebietsschema \"%s\" ist unbekannt."
=====================================
src/common/dcsvg.cpp
=====================================
@@ -567,7 +567,13 @@ void wxSVGFileDCImpl::Init(const wxString& filename, int width, int height,
s += wxS("<svg xmlns=\"
http://www.w3.org/2000/svg\" xmlns:xlink=\"
http://www.w3.org/1999/xlink\"");
s += wxString::Format(wxS(" width=\"%scm\" height=\"%scm\" viewBox=\"0 0 %d %d\">\n"),
NumStr(m_width / m_dpi * 2.54), NumStr(m_height / m_dpi * 2.54), m_width, m_height);
- s += wxString::Format(wxS("<title>%s</title>\n"), title);
+ s += wxString::Format(wxS("<title>%s</title>\n"),
+#if wxUSE_MARKUP
+ wxMarkupParser::Quote(title)
+#else
+ title
+#endif
+ );
s += wxString::Format(wxS("<desc>Created with %s</desc>\n\n"), wxVERSION_STRING);
s += wxS("<g fill=\"black\" stroke=\"black\" stroke-width=\"1\">\n");
write(s);
=====================================
src/common/uilocale.cpp
=====================================
@@ -819,6 +819,7 @@ bool wxUILocale::UseDefault()
impl->Use();
ms_current = wxUILocale(impl);
+ ms_current.m_isDefault = true;
wxUILocaleIsSet = true;
return true;
@@ -854,6 +855,7 @@ bool wxUILocale::UseLocaleName(const wxString& localeName)
impl->Use();
ms_current = wxUILocale(impl);
+ ms_current.m_isDefault = false;
wxUILocaleIsSet = true;
return true;
=====================================
src/gtk/textentry.cpp
=====================================
@@ -185,15 +185,21 @@ wx_gtk_insert_text_callback(GtkEditable *editable,
// characters (in first approximation, anyhow...).
if ( text_length + g_utf8_strlen(new_text, -1) > text_max_length )
{
- // Prevent the new text from being inserted.
- handled = true;
-
- // Currently we don't insert anything at all, but it would be better to
- // insert as many characters as would fit into the text control and
- // only discard the rest.
-
// Notify the user code about overflow.
text->SendMaxLenEvent();
+
+ // Don't prevent the new text from being inserted, the native
+ // control will insert as much of it as possible, which is better
+ // than not inserting anything at all.
+
+#ifndef __WXGTK3__
+ // GTK 2 will generate a "changed" signal even if the text doesn't
+ // change at all, as happens when it's already at max length, which
+ // is unexpected and shouldn't result in a spurious wxEVT_TEXT
+ // event, so pretend that we handled the signal in this case.
+ if ( text_length == text_max_length )
+ handled = true;
+#endif // GTK < 3
}
}
@@ -610,12 +616,7 @@ wx_gtk_entry_parent_grab_notify (GtkWidget *widget,
// initialization and destruction
// ----------------------------------------------------------------------------
-wxTextEntry::wxTextEntry()
-{
- m_autoCompleteData = nullptr;
- m_coalesceData = nullptr;
- m_isUpperCase = false;
-}
+wxTextEntry::wxTextEntry() = default;
wxTextEntry::~wxTextEntry()
{
=====================================
src/msw/listctrl.cpp
=====================================
@@ -3734,6 +3734,46 @@ wxListCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
// PRF_CHILDREN flag, so leave it to the native control itself
return MSWDefWindowProc(nMsg, wParam, lParam);
+ case WM_NCPAINT:
+ // In dark mode the corner between the 2 scrollbars is not drawn in
+ // the correct colour by default, so paint it over if necessary.
+ if ( wxMSWDarkMode::IsActive() )
+ {
+ // Let the control paint itself first.
+ auto const rc =
+ wxListCtrlBase::MSWWindowProc(nMsg, wParam, lParam);
+
+ WinStruct<SCROLLBARINFO> sbiV, sbiH;
+
+ // Check if both scrollbars are actually visible.
+ if ( ::GetScrollBarInfo(GetHwnd(), OBJID_VSCROLL, &sbiV) &&
+ ::GetScrollBarInfo(GetHwnd(), OBJID_HSCROLL, &sbiH) &&
+ !(sbiV.rgstate[0] & STATE_SYSTEM_INVISIBLE) &&
+ !(sbiH.rgstate[0] & STATE_SYSTEM_INVISIBLE) )
+ {
+ // They are, so now paint the corner between them.
+ wxWindowDC dc(this);
+ dc.SetPen(*wxTRANSPARENT_PEN);
+
+ // We don't have any wxSYS_COLOUR_XXX value matching this.
+ dc.SetBrush(wxColour(0x17, 0x17, 0x17));
+
+ // SCROLLBARINFO::rcScrollBar contains screen coordinates,
+ // but we need client ones, so subtract the window origin.
+ const RECT rcWin = wxGetWindowRect(GetHwnd());
+
+ int x = sbiV.rcScrollBar.left - rcWin.left;
+ int y = sbiH.rcScrollBar.top - rcWin.top;
+ int width = sbiV.rcScrollBar.right - sbiV.rcScrollBar.left;
+ int height = sbiH.rcScrollBar.bottom - sbiH.rcScrollBar.top;
+
+ dc.DrawRectangle(x, y, width, height);
+ }
+
+ return rc;
+ }
+ break;
+
case WM_CONTEXTMENU:
// because this message is propagated upwards the child-parent
// chain, we get it for the right clicks on the header window but
=====================================
src/msw/uilocale.cpp
=====================================
@@ -173,14 +173,24 @@ WXDLLIMPEXP_BASE wxString wxGetMSWDateTimeFormat(wxLocaleInfo index)
return wxString{};
}
+ // Determine the name of the locale to be used for querying the date/time
+ // format: if a locale is explicitly specified, use it, but otherwise use
+ // LOCALE_NAME_USER_DEFAULT to get the format configured in the regional
+ // settings.
+ const wchar_t* name = LOCALE_NAME_USER_DEFAULT;
wxString format;
- wxString localeName = wxUILocale::GetCurrent().GetName();
- if (localeName.IsSameAs("C"))
+ wxString localeName;
+ if ( !wxUILocale::GetCurrent().IsDefault() )
{
- localeName = "en-US";
+ localeName = wxUILocale::GetCurrent().GetName();
+ if ( localeName.IsSameAs("C") )
+ {
+ // Handle the case when the application uses the C locale
+ localeName = "en-US";
+ }
+ name = localeName.wc_str();
}
- const wchar_t* name = localeName.wc_str();
LCTYPE lctype = wxGetLCTYPEFormatFromLocalInfo(index);
if (lctype != 0)
{
@@ -194,6 +204,7 @@ WXDLLIMPEXP_BASE wxString wxGetMSWDateTimeFormat(wxLocaleInfo index)
wxLogLastError(wxT("GetLocaleInfoEx"));
}
}
+
return format;
}
@@ -482,15 +493,19 @@ public:
~wxUILocaleImplName() override
{
- free(const_cast<wchar_t*>(m_name));
+ if (m_nameDisplay != m_nameRegion)
+ {
+ free(const_cast<wchar_t*>(m_nameDisplay));
+ }
+ free(const_cast<wchar_t*>(m_nameRegion));
}
void Use() override
{
// Construct a double NUL-terminated buffer.
wchar_t buf[256];
- if ( m_name )
- wxStrlcpy(buf, m_name, WXSIZEOF(buf) - 1);
+ if ( m_nameDisplay )
+ wxStrlcpy(buf, m_nameDisplay, WXSIZEOF(buf) - 1);
else
buf[0] = L'\0';
buf[wxWcslen(buf) + 1] = L'\0';
@@ -503,7 +518,7 @@ public:
wxString GetName() const override
{
- return DoGetInfo(LOCALE_SNAME);
+ return DoGetInfo(m_nameDisplay, LOCALE_SNAME);
}
wxLocaleIdent GetLocaleId() const override
@@ -517,13 +532,13 @@ public:
switch ( index )
{
case wxLOCALE_THOUSANDS_SEP:
- str = DoGetInfo(cat == wxLOCALE_CAT_MONEY
+ str = DoGetInfo(m_nameRegion, cat == wxLOCALE_CAT_MONEY
? LOCALE_SMONTHOUSANDSEP
: LOCALE_STHOUSAND);
break;
case wxLOCALE_DECIMAL_POINT:
- str = DoGetInfo(cat == wxLOCALE_CAT_MONEY
+ str = DoGetInfo(m_nameRegion, cat == wxLOCALE_CAT_MONEY
? LOCALE_SMONDECIMALSEP
: LOCALE_SDECIMAL);
break;
@@ -531,7 +546,7 @@ public:
case wxLOCALE_SHORT_DATE_FMT:
case wxLOCALE_LONG_DATE_FMT:
case wxLOCALE_TIME_FMT:
- str = DoGetInfo(wxGetLCTYPEFormatFromLocalInfo(index));
+ str = DoGetInfo(m_nameRegion, wxGetLCTYPEFormatFromLocalInfo(index));
if ( !str.empty() )
str = wxTranslateFromUnicodeFormat(str);
break;
@@ -564,10 +579,10 @@ public:
switch (form)
{
case wxLOCALE_FORM_NATIVE:
- str = DoGetInfo(LOCALE_SNATIVEDISPLAYNAME);
+ str = DoGetInfo(m_nameDisplay, LOCALE_SNATIVEDISPLAYNAME);
break;
case wxLOCALE_FORM_ENGLISH:
- str = DoGetInfo(LOCALE_SENGLISHDISPLAYNAME);
+ str = DoGetInfo(m_nameDisplay, LOCALE_SENGLISHDISPLAYNAME);
break;
default:
wxFAIL_MSG("unknown wxLocaleForm");
@@ -577,10 +592,10 @@ public:
switch (form)
{
case wxLOCALE_FORM_NATIVE:
- str = DoGetInfo(LOCALE_SNATIVELANGUAGENAME);
+ str = DoGetInfo(m_nameDisplay, LOCALE_SNATIVELANGUAGENAME);
break;
case wxLOCALE_FORM_ENGLISH:
- str = DoGetInfo(LOCALE_SENGLISHLANGUAGENAME);
+ str = DoGetInfo(m_nameDisplay, LOCALE_SENGLISHLANGUAGENAME);
break;
default:
wxFAIL_MSG("unknown wxLocaleForm");
@@ -590,10 +605,10 @@ public:
switch (form)
{
case wxLOCALE_FORM_NATIVE:
- str = DoGetInfo(LOCALE_SNATIVECOUNTRYNAME);
+ str = DoGetInfo(m_nameDisplay, LOCALE_SNATIVECOUNTRYNAME);
break;
case wxLOCALE_FORM_ENGLISH:
- str = DoGetInfo(LOCALE_SENGLISHCOUNTRYNAME);
+ str = DoGetInfo(m_nameDisplay, LOCALE_SENGLISHCOUNTRYNAME);
break;
default:
wxFAIL_MSG("unknown wxLocaleForm");
@@ -639,7 +654,7 @@ public:
break;
}
- return DoGetInfo(lctype);
+ return DoGetInfo(m_nameRegion, lctype);
}
wxString GetWeekDayName(wxDateTime::WeekDay weekday, wxDateTime::NameForm form) const override
@@ -670,7 +685,7 @@ public:
break;
}
- return DoGetInfo(lctype);
+ return DoGetInfo(m_nameRegion, lctype);
}
#endif // wxUSE_DATETIME
@@ -678,7 +693,7 @@ public:
{
if ( m_layoutDir == wxLayout_Default )
{
- wxString str = DoGetInfo(LOCALE_IREADINGLAYOUT);
+ wxString str = DoGetInfo(m_nameDisplay, LOCALE_IREADINGLAYOUT);
// str contains a number between 0 and 3:
// 0 = LTR, 1 = RTL, 2 = TTB+RTL, 3 = TTB + LTR
// If str equals 1 return RTL, otherwise LTR
@@ -696,12 +711,12 @@ public:
wxString GetCurrencySymbol() const override
{
- return DoGetInfo(LOCALE_SCURRENCY);
+ return DoGetInfo(m_nameRegion, LOCALE_SCURRENCY);
}
wxString GetCurrencyCode() const override
{
- return wxString(DoGetInfo(LOCALE_SINTLSYMBOL)).Left(3);
+ return wxString(DoGetInfo(m_nameRegion, LOCALE_SINTLSYMBOL)).Left(3);
}
wxCurrencySymbolPosition GetCurrencySymbolPosition() const override
@@ -709,7 +724,7 @@ public:
static std::array<wxCurrencySymbolPosition, 4> symPos = {
wxCurrencySymbolPosition::PrefixNoSep, wxCurrencySymbolPosition::SuffixNoSep,
wxCurrencySymbolPosition::PrefixWithSep, wxCurrencySymbolPosition::SuffixWithSep };
- wxString posStr = wxString(DoGetInfo(LOCALE_ICURRENCY));
+ wxString posStr = wxString(DoGetInfo(m_nameRegion, LOCALE_ICURRENCY));
unsigned int posIdx;
return posStr.ToUInt(&posIdx) && posIdx < symPos.size()
? symPos[posIdx]
@@ -728,7 +743,7 @@ public:
wxMeasurementSystem UsesMetricSystem() const override
{
- wxString str = DoGetInfo(LOCALE_IMEASURE);
+ wxString str = DoGetInfo(m_nameRegion, LOCALE_IMEASURE);
if (!str.empty())
{
return (str.IsSameAs("0")) ? wxMeasurementSystem::Metric : wxMeasurementSystem::NonMetric;
@@ -746,7 +761,7 @@ public:
const int ret = ::CompareStringEx
(
- m_name,
+ m_nameDisplay,
dwFlags,
lhs.wc_str(), -1,
rhs.wc_str(), -1,
@@ -774,14 +789,23 @@ private:
//
// Note that "name" can be null here (LOCALE_NAME_USER_DEFAULT).
explicit wxUILocaleImplName(const wchar_t* name)
- : m_name(name ? wxStrdup(name) : nullptr)
+ : m_nameRegion(name ? wxStrdup(name) : nullptr)
{
+ m_nameDisplay = m_nameRegion;
+ if (!m_nameRegion)
+ {
+ wxVector<wxString> preferred = GetPreferredUILanguages();
+ if (!preferred.empty())
+ {
+ m_nameDisplay = wxStrdup(preferred[0].wc_str());
+ }
+ }
}
- wxString DoGetInfo(LCTYPE lctype) const
+ wxString DoGetInfo(const wchar_t* const name, LCTYPE lctype) const
{
wchar_t buf[256];
- if ( !::GetLocaleInfoEx(m_name, lctype, buf, WXSIZEOF(buf)) )
+ if ( !::GetLocaleInfoEx(name, lctype, buf, WXSIZEOF(buf)) )
{
wxLogLastError(wxT("GetLocaleInfoEx"));
return wxString();
@@ -792,16 +816,16 @@ private:
wxLocaleNumberFormatting DoGetNumberFormatting(wxLocaleCategory cat) const
{
- wxString groupSeparator = DoGetInfo(cat == wxLOCALE_CAT_MONEY
+ wxString groupSeparator = DoGetInfo(m_nameRegion, cat == wxLOCALE_CAT_MONEY
? LOCALE_SMONTHOUSANDSEP
: LOCALE_STHOUSAND);
- wxString groupingInfo = DoGetInfo(cat == wxLOCALE_CAT_MONEY
+ wxString groupingInfo = DoGetInfo(m_nameRegion, cat == wxLOCALE_CAT_MONEY
? LOCALE_SMONGROUPING
: LOCALE_SGROUPING);
- wxString decimalSeparator = DoGetInfo(cat == wxLOCALE_CAT_MONEY
+ wxString decimalSeparator = DoGetInfo(m_nameRegion, cat == wxLOCALE_CAT_MONEY
? LOCALE_SMONDECIMALSEP
: LOCALE_SDECIMAL);
- wxString digits = DoGetInfo(cat == wxLOCALE_CAT_MONEY
+ wxString digits = DoGetInfo(m_nameRegion, cat == wxLOCALE_CAT_MONEY
? LOCALE_ICURRDIGITS
: LOCALE_IDIGITS);
int fractionalDigits;
@@ -820,7 +844,20 @@ private:
return wxLocaleNumberFormatting(groupSeparator, grouping, decimalSeparator, fractionalDigits);
}
- const wchar_t* const m_name;
+ // On Windows we need to distinguish between the name of the display
+ // language locale and the regional formatting locale when using the
+ // default locale.
+ //
+ // Although both are often the same, Windows can be set up to use different
+ // locales by the user in the Control Panel: the "display language" can be
+ // set to one locale, while the "regional format" can be set to a different
+ // one.
+ //
+ // Note that we currently don't allow the application to request using
+ // different locales for display and regional formatting, so if an
+ // non-default locale is used, both names are always identical.
+ const wchar_t* const m_nameRegion; // Name of locale for regional formatting
+ const wchar_t* m_nameDisplay; // Name of locale for display language
mutable wxLayoutDirection m_layoutDir = wxLayout_Default;
=====================================
src/osx/cocoa/
button.mm
=====================================
@@ -91,14 +91,20 @@ wxButtonCocoaImpl::wxButtonCocoaImpl(wxWindowMac *wxpeer, wxNSButton *v)
// Set bezel style depending on the wxBORDER_XXX flags specified by the style
// and also accounting for the label (bezels are different for multiline
// buttons and normal ones) and the ID (special bezel is used for help button).
-static
+
void
-SetBezelStyleFromBorderFlags(NSButton *v,
+wxOSXSetBezelStyleFromBorderFlags(WX_NSButton v,
long style,
wxWindowID winid,
- const wxString& label = wxString(),
- const wxBitmapBundle& bitmap = wxBitmapBundle())
+ const wxString& label,
+ const wxBitmapBundle& bitmap,
+ wxWindow *peer)
{
+#if wxUSE_TOGGLEBTN
+ bool isToggleButton = peer && peer->IsKindOf(wxCLASSINFO(wxToggleButton));
+ NSButtonType toggleButtonType = NSOnOffButton;
+#endif
+
// We can't display a custom label inside a button with help bezel style so
// we only use it if we are using the default label. wxButton itself checks
// if the label is just "Help" in which case it discards it and passes us
@@ -123,6 +129,7 @@ SetBezelStyleFromBorderFlags(NSButton *v,
case wxBORDER_NONE:
bezel = NSShadowlessSquareBezelStyle;
[v setBordered:NO];
+ toggleButtonType = NSToggleButton;
break;
case wxBORDER_SIMPLE:
@@ -148,6 +155,10 @@ SetBezelStyleFromBorderFlags(NSButton *v,
}
[v setBezelStyle:bezel];
+#if wxUSE_TOGGLEBTN
+ if (isToggleButton)
+ [v setButtonType:toggleButtonType];
+#endif
}
}
@@ -155,11 +166,12 @@ void wxButtonCocoaImpl::SetBitmap(const wxBitmapBundle& bitmap)
{
// Update the bezel style as may be necessary if our new label is multi
// line while the old one wasn't (or vice versa).
- SetBezelStyleFromBorderFlags(GetNSButton(),
+ wxOSXSetBezelStyleFromBorderFlags(GetNSButton(),
GetWXPeer()->GetWindowStyle(),
GetWXPeer()->GetId(),
GetWXPeer()->GetLabel(),
- bitmap );
+ bitmap,
+ GetWXPeer());
wxWidgetCocoaImpl::SetBitmap(bitmap);
}
@@ -238,11 +250,12 @@ void wxButton::OSXUpdateAfterLabelChange(const wxString& label)
// Update the bezel style as may be necessary if our new label is multi
// line while the old one wasn't (or vice versa).
- SetBezelStyleFromBorderFlags(impl->GetNSButton(),
+ wxOSXSetBezelStyleFromBorderFlags(impl->GetNSButton(),
GetWindowStyle(),
GetId(),
label,
- GetBitmap() );
+ GetBitmap(),
+ this);
// Skip setting the accelerator for the default buttons as this would
@@ -271,7 +284,7 @@ wxWidgetImplType* wxWidgetImpl::CreateButton( wxWindowMac* wxpeer,
NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
wxNSButton* v = [[wxNSButton alloc] initWithFrame:r];
- SetBezelStyleFromBorderFlags(v, style, winid, label);
+ wxOSXSetBezelStyleFromBorderFlags(v, style, winid, label, wxBitmapBundle(), wxpeer);
[v setButtonType:NSMomentaryPushInButton];
wxButtonCocoaImpl* const impl = new wxButtonCocoaImpl( wxpeer, v );
@@ -313,12 +326,11 @@ wxWidgetImplType* wxWidgetImpl::CreateBitmapButton( wxWindowMac* wxpeer,
NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
wxNSButton* v = [[wxNSButton alloc] initWithFrame:r];
- SetBezelStyleFromBorderFlags(v, style, winid, wxString(), bitmap);
+ wxOSXSetBezelStyleFromBorderFlags(v, style, winid, wxString(), bitmap, wxpeer);
if (bitmap.IsOk())
[v setImage: wxOSXGetImageFromBundle(bitmap) ];
- [v setButtonType:NSMomentaryPushInButton];
wxWidgetCocoaImpl* c = new wxButtonCocoaImpl( wxpeer, v );
return c;
}
=====================================
src/osx/cocoa/
tglbtn.mm
=====================================
@@ -24,44 +24,10 @@
#include "wx/osx/private.h"
#include "wx/private/bmpbndl.h"
-static
-void
-SetToggleButtonStyle(NSButton *v, long style)
-{
- NSButtonType type = NSOnOffButton;
-
- // This is the appropriate default bezel style for the toggle buttons.
- NSBezelStyle bezel = NSShadowlessSquareBezelStyle;
-
- switch ( style & wxBORDER_MASK )
- {
- case 0:
- break;
-
- case wxBORDER_NONE:
- [v setBordered:NO];
- type = NSToggleButton;
- break;
-
- case wxBORDER_SIMPLE:
- bezel = NSSmallSquareBezelStyle;
- break;
-
- case wxBORDER_STATIC:
- case wxBORDER_RAISED:
- case wxBORDER_THEME:
- case wxBORDER_SUNKEN:
- break;
- }
-
- [v setBezelStyle:bezel];
- [v setButtonType:type];
-}
-
wxWidgetImplType* wxWidgetImpl::CreateToggleButton( wxWindowMac* wxpeer,
wxWindowMac* WXUNUSED(parent),
- wxWindowID WXUNUSED(winid),
- const wxString& WXUNUSED(label),
+ wxWindowID winid,
+ const wxString& label,
const wxPoint& pos,
const wxSize& size,
long style,
@@ -70,7 +36,7 @@ wxWidgetImplType* wxWidgetImpl::CreateToggleButton( wxWindowMac* wxpeer,
NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
wxNSButton* v = [[wxNSButton alloc] initWithFrame:r];
- SetToggleButtonStyle(v, style);
+ wxOSXSetBezelStyleFromBorderFlags(v, style, winid, label, wxBitmapBundle(), wxpeer);
wxWidgetCocoaImpl* c = new wxButtonCocoaImpl( wxpeer, v );
return c;
@@ -78,8 +44,8 @@ wxWidgetImplType* wxWidgetImpl::CreateToggleButton( wxWindowMac* wxpeer,
wxWidgetImplType* wxWidgetImpl::CreateBitmapToggleButton( wxWindowMac* wxpeer,
wxWindowMac* WXUNUSED(parent),
- wxWindowID WXUNUSED(winid),
- const wxBitmapBundle& label,
+ wxWindowID winid,
+ const wxBitmapBundle& bundle,
const wxPoint& pos,
const wxSize& size,
long style,
@@ -88,13 +54,13 @@ wxWidgetImplType* wxWidgetImpl::CreateBitmapToggleButton( wxWindowMac* wxpeer,
NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
wxNSButton* v = [[wxNSButton alloc] initWithFrame:r];
- SetToggleButtonStyle(v, style);
+ wxOSXSetBezelStyleFromBorderFlags(v, style, winid, wxEmptyString, bundle, wxpeer);
- if (label.IsOk())
- [v setImage: wxOSXGetImageFromBundle(label) ];
+ if (bundle.IsOk())
+ [v setImage: wxOSXGetImageFromBundle(bundle) ];
- [v setButtonType:NSOnOffButton];
wxWidgetCocoaImpl* c = new wxButtonCocoaImpl( wxpeer, v );
+
return c;
}
View it on GitLab:
https://gitlab.com/wxwidgets/wxwidgets/-/compare/fda62b4c2ad81f5c1b4b782fe2ade14954778522...638af54a8a0df223f460397da7ac07d69ae881b7
--
View it on GitLab:
https://gitlab.com/wxwidgets/wxwidgets/-/compare/fda62b4c2ad81f5c1b4b782fe2ade14954778522...638af54a8a0df223f460397da7ac07d69ae881b7
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