Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
fc9ccf9
Declare loop variable inside the loop in wxAuiDefaultDockArt
vadz Feb 22, 2025
43b55cf
Avoid scaling small metrics by DPI in wxAuiDockArt
vadz Feb 22, 2025
46ff95c
Fix showing labels of newly added wxNotebook pages in wxOSX
vadz Feb 24, 2025
c8abec0
Merge branch 'aui-metrics-dpi'
vadz Feb 24, 2025
08976f9
Fix wxBookCtrl::GetPageText() test to really use multiline strings
vadz Feb 24, 2025
568bc14
Use RemoveMnemonics() not wxStripMenuCodes() in wxGTK wxNotebook
vadz Feb 24, 2025
3835619
Store the original page text in wxGTK wxNotebook
vadz Feb 24, 2025
65c26e5
Factor out wxCocoaTabView::SetupTabItem()
vadz Feb 24, 2025
00f5bbb
Avoid using wxWindow::SetLabel() in wxOSX wxNotebook code
vadz Feb 24, 2025
b40585c
Fix documentation of wxAUI_TBART_DROPDOWN_SIZE
vadz Feb 24, 2025
ee0b039
Remove useless overrides from wxAuiMSWToolBarArt
vadz Feb 24, 2025
0e7420f
Fix per-monitor DPI handling of wxAuiToolBarArt element sizes
vadz Feb 24, 2025
26d2a66
Remove mnemonics from page text in wxChoicebook and wxListbook
vadz Feb 24, 2025
59b1faf
Update wxBookCtrl unit test to cover mnemonics in page text
vadz Feb 24, 2025
380cf41
Ignore unknown events read from IOCP in wxMSW wxFileSystemWatcher
vadz Feb 25, 2025
3754077
Minor cleanup in wxMSW wxFileSystemWatcher code
vadz Feb 25, 2025
55d8e8d
Remove code that couldn't be executed from wxFileSystemWatcher
vadz Feb 25, 2025
ef8508a
Don't use "else" after "return"
vadz Feb 25, 2025
f5d238a
Serialize and restore wxAUI pane visibility too
vadz Feb 21, 2025
34fd35b
Merge branch 'bookctrl-text'
vadz Feb 26, 2025
2346d2a
Merge branch 'aui-bar-art-dpi'
vadz Feb 26, 2025
c4625de
Merge branch 'msw-fswatch-unknown-events'
vadz Feb 26, 2025
cc42b23
Avoid shadowed-variable warnings
paulcor Feb 27, 2025
889d458
Suppress some -Wunused-member-function warnings
paulcor Feb 27, 2025
28a499a
Use g_object_set() to avoid deprecated gtk_settings_set_long_property()
paulcor Feb 27, 2025
0f7652c
Avoid some -Wcomma warnings
paulcor Feb 27, 2025
77eaa7a
Remove unused member variable
paulcor Feb 27, 2025
abdc493
Avoid -Wdeprecated-this-capture warning
paulcor Feb 27, 2025
0254135
Avoid -Wunused-member-function warnings
paulcor Feb 28, 2025
7c909d4
Avoid -Wunused-template warnings
paulcor Feb 28, 2025
14f5690
Avoid -Wshadow warning
paulcor Feb 28, 2025
afdada7
Avoid unreachable code warnings
paulcor Feb 28, 2025
318e97e
Avoid -Wcast-qual warnings
paulcor Feb 28, 2025
2034ac4
Remove unused C #includes in headers
lanurmi Feb 24, 2025
f222eda
Do not #include "wx/list.h" for no reason in various headers
lanurmi Feb 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ Changes in behaviour not resulting in compilation errors
the page on screen, which doesn't make sense without reference to the tab
control containing it, use GetPagePosition() to retrieve both of them.

- wxListbook and wxChoicebook now interpret (but ignore) mnemonics in their
page titles, just as the other wx*book classes already did. Double "&"
in the page text if it should be interpreted as a literal "&".


Changes in behaviour which may result in build errors
-----------------------------------------------------
Expand Down
6 changes: 6 additions & 0 deletions include/wx/aui/auibar.h
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,12 @@ class WXDLLIMPEXP_AUI wxAuiToolBarArt
wxWindow* wnd,
const wxAuiToolBarItem& item) = 0;

// This function should be used for querying element sizes in the new code,
// as it scales them by the DPI of the provided window. GetElementSize()
// still exists (and is simpler to override), but is usually _not_ what you
// need.
virtual int GetElementSizeForWindow(int elementId, const wxWindow* window);

// Note that these functions work with the size in DIPs, not physical
// pixels.
virtual int GetElementSize(int elementId) = 0;
Expand Down
3 changes: 0 additions & 3 deletions include/wx/aui/barartmsw.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@ class WXDLLIMPEXP_AUI wxAuiMSWToolBarArt : public wxAuiGenericToolBarArt
wxWindow* wnd,
const wxAuiToolBarItem& item) override;

virtual int GetElementSize(int element) override;
virtual void SetElementSize(int elementId, int size) override;

virtual int ShowDropDown(wxWindow* wnd,
const wxAuiToolBarItemArray& items) override;

Expand Down
7 changes: 7 additions & 0 deletions include/wx/aui/dockart.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ class WXDLLIMPEXP_AUI wxAuiDockArt
virtual ~wxAuiDockArt() = default;

virtual wxAuiDockArt* Clone() = 0;

// This function should be used for querying metrics in the new code, as it
// will scale them by the DPI of the provided window if necessary. The
// older GetMetric() function is kept for compatibility and shouldn't be
// used outside of this class itself.
virtual int GetMetricForWindow(int id, wxWindow* window);

virtual int GetMetric(int id) = 0;
virtual void SetMetric(int id, int newVal) = 0;
virtual void SetFont(int id, const wxFont& font) = 0;
Expand Down
11 changes: 8 additions & 3 deletions include/wx/aui/serializer.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,16 @@ struct wxAuiPaneLayoutInfo : wxAuiDockLayoutInfo
wxSize floating_size = wxDefaultSize;


// The remaining fields correspond to individual bits of the pane state
// flags instead of corresponding to wxAuiPaneInfo fields directly because
// we prefer not storing the entire state -- this would be less readable
// and extensible.

// True if the pane is currently maximized.
//
// Note that it's the only field of this struct which doesn't directly
// correspond to a field of wxAuiPaneInfo.
bool is_maximized = false;

// True if the pane is currently hidden.
bool is_hidden = false;
};

// wxAuiBookSerializer is used for serializing wxAuiNotebook layout.
Expand Down
2 changes: 0 additions & 2 deletions include/wx/datetime.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@

#include <vector>

#include <limits.h> // for INT_MIN

#include "wx/longlong.h"
#include "wx/anystr.h"

Expand Down
1 change: 0 additions & 1 deletion include/wx/filefn.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#ifndef _FILEFN_H_
#define _FILEFN_H_

#include "wx/list.h"
#include "wx/arrstr.h"

#include <time.h>
Expand Down
1 change: 1 addition & 0 deletions include/wx/filesys.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "wx/stream.h"
#include "wx/datetime.h"
#include "wx/filename.h"
#include "wx/list.h"

#include <unordered_map>

Expand Down
4 changes: 3 additions & 1 deletion include/wx/hashmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,7 @@ struct WXDLLIMPEXP_BASE wxStringEqual
#define wxPTROP_NOP(pointer)

#define _WX_DECLARE_HASH_MAP( KEY_T, VALUE_T, HASH_T, KEY_EQ_T, CLASSNAME, CLASSEXP ) \
wxCLANG_WARNING_SUPPRESS(unused-member-function) \
_WX_DECLARE_PAIR( KEY_T, VALUE_T, CLASSNAME##_wxImplementation_Pair, CLASSEXP ) \
_WX_DECLARE_HASH_MAP_KEY_EX( KEY_T, CLASSNAME##_wxImplementation_Pair, CLASSNAME##_wxImplementation_KeyEx, CLASSEXP ) \
_WX_DECLARE_HASHTABLE( CLASSNAME##_wxImplementation_Pair, KEY_T, HASH_T, \
Expand Down Expand Up @@ -621,7 +622,8 @@ public: \
{ \
return GetNode( key ) ? 1u : 0u; \
} \
}
} \
wxCLANG_WARNING_RESTORE(unused-member-function)

#endif // wxNEEDS_WX_HASH_MAP

Expand Down
23 changes: 21 additions & 2 deletions include/wx/osx/notebook.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
// ----------------------------------------------------------------------------
#include "wx/event.h"

#include <vector>

// ----------------------------------------------------------------------------
// types
// ----------------------------------------------------------------------------
Expand Down Expand Up @@ -128,8 +130,25 @@ class WXDLLIMPEXP_CORE wxNotebook : public wxNotebookBase

int DoSetSelection(size_t nPage, int flags = 0) override;

// the icon indices
wxArrayInt m_images;
private:
// this vector is synchronized with m_pages in the base class
struct PageData
{
PageData(const wxString& text_, int image_)
: text{text_}, image{image_}
{
}

PageData(const PageData&) = default;
PageData& operator=(const PageData&) = default;

PageData(PageData&&) = default;
PageData& operator=(PageData&&) = default;

wxString text;
int image = wxNOT_FOUND;
};
std::vector<PageData> m_pagesData;

wxDECLARE_DYNAMIC_CLASS(wxNotebook);
wxDECLARE_EVENT_TABLE();
Expand Down
1 change: 0 additions & 1 deletion include/wx/statusbr.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#if wxUSE_STATUSBAR

#include "wx/control.h"
#include "wx/list.h"
#include "wx/dynarray.h"
#include "wx/weakref.h"

Expand Down
2 changes: 0 additions & 2 deletions include/wx/strconv.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
#include "wx/chartype.h"
#include "wx/buffer.h"

#include <stdlib.h>

class WXDLLIMPEXP_FWD_BASE wxString;

// the error value returned by wxMBConv methods
Expand Down
1 change: 0 additions & 1 deletion include/wx/stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

#if wxUSE_STREAMS

#include <stdio.h>
#include "wx/object.h"
#include "wx/string.h"
#include "wx/filefn.h" // for wxFileOffset, wxInvalidOffset and wxSeekMode
Expand Down
3 changes: 0 additions & 3 deletions include/wx/string.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@
#endif

#include <string.h>
#include <stdio.h>
#include <stdarg.h>
#include <limits.h>
#include <stdlib.h>

#include "wx/chartype.h" // for wxChar
#include "wx/wxcrtbase.h" // for wxChar, wxStrlen() etc.
Expand Down
2 changes: 2 additions & 0 deletions include/wx/unix/private/uilocale.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ namespace
class TempLocaleSetter
{
public:
wxCLANG_WARNING_SUPPRESS(unused-member-function)
explicit TempLocaleSetter(int localeCategory,
const wxString& localeId = wxString())
: m_localeCategory(localeCategory),
Expand All @@ -54,6 +55,7 @@ class TempLocaleSetter
setlocale(m_localeCategory, m_localeOrig);
free(m_localeOrig);
}
wxCLANG_WARNING_RESTORE(unused-member-function)

private:
const int m_localeCategory;
Expand Down
3 changes: 0 additions & 3 deletions include/wx/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
// ----------------------------------------------------------------------------

#include "wx/object.h"
#include "wx/list.h"
#include "wx/filefn.h"
#include "wx/versioninfo.h"
#include "wx/meta/implicitconversion.h"
Expand Down Expand Up @@ -48,8 +47,6 @@ class WXDLLIMPEXP_FWD_BASE wxArrayInt;
#include <unistd.h>
#endif

#include <stdio.h>

#include <unordered_map>

// ----------------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion include/wx/xml/xml.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

#include "wx/string.h"
#include "wx/object.h"
#include "wx/list.h"
#include "wx/textbuf.h"
#include "wx/versioninfo.h"
#include "wx/filefn.h"
Expand Down
1 change: 0 additions & 1 deletion include/wx/xrc/xmlres.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "wx/dynarray.h"
#include "wx/arrstr.h"
#include "wx/datetime.h"
#include "wx/list.h"
#include "wx/gdicmn.h"
#include "wx/filesys.h"
#include "wx/bitmap.h"
Expand Down
86 changes: 81 additions & 5 deletions interface/wx/aui/auibar.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ enum wxAuiToolBarArtSetting
/**
Overflow button size in wxAuiToolBar.
*/
wxAUI_TBART_OVERFLOW_SIZE = 2
wxAUI_TBART_OVERFLOW_SIZE = 2,

/**
Drop down button size in wxAuiToolBar.
Expand Down Expand Up @@ -547,8 +547,56 @@ class wxAuiToolBarArt
wxWindow* wnd,
const wxAuiToolBarItem& item) = 0;

virtual int GetElementSize(int element_id) = 0;
virtual void SetElementSize(int element_id, int size) = 0;
/**
Get the element size scaled by the DPI of the given window.

This function should be used to get the size of the element in pixels.

The default version delegates to GetElementSize(), override this
function if a different behaviour (e.g. to use some smarter algorithm
for scaling instead of just multiplying by the DPI factor) is needed.

@param elementId
One of ::wxAuiToolBarArtSetting elements.
@param window
A valid window, typically wxAuiToolBar itself.
@return
The size of the element in pixels.

@see SetElementSize()

@since 3.3.0
*/
virtual int GetElementSizeForWindow(int elementId, const wxWindow* window);

/**
Returns the size of the given element in DIPs.

This function is typically more convenient to override, as it can just
return the same value as was passed to SetElementSize(), but it
shouldn't usually be called, use GetElementSizeForWindow() instead.

@param elementId
One of ::wxAuiToolBarArtSetting elements.
@return
The size of the element in DIPs.
*/
virtual int GetElementSize(int elementId) = 0;

/**
Sets the size of the given element in DIPs.

Note that this function takes the size in DPI-independent pixels and
this size will be scaled by the factor depending on the DPI being
actually used by GetElementSizeForWindow(). In particular, do _not_ use
wxWindow::FromDIP() for the @a size argument passed to this function.

@param elementId
One of ::wxAuiToolBarArtSetting elements.
@param size
The size of the element in DIPs.
*/
virtual void SetElementSize(int elementId, int size) = 0;

virtual int ShowDropDown(
wxWindow* wnd,
Expand Down Expand Up @@ -638,8 +686,24 @@ class wxAuiDefaultToolBarArt : public wxAuiToolBarArt
wxWindow* wnd,
const wxAuiToolBarItem& item);

virtual int GetElementSize(int element);
virtual void SetElementSize(int element_id, int size);
/**
Return the size of the element.

Implement the base class pure virtual function by returning the default
element size or the last value passed to SetElementSize().
*/
virtual int GetElementSize(int elementId);

/**
Change the size of the element.

Implements the base class pure virtual function by storing the value to
be returned by GetElementSize() and used by GetElementSizeForWindow().

As for the base class function, @a size is in DIPs, _not_ pixels, so
wxWindow::FromDIP() should _not_ be used for it.
*/
virtual void SetElementSize(int elementId, int size);

virtual int ShowDropDown(wxWindow* wnd,
const wxAuiToolBarItemArray& items);
Expand Down Expand Up @@ -925,7 +989,19 @@ class wxAuiToolBar : public wxControl
void SetToolProportion(int toolId, int proportion);
int GetToolProportion(int toolId) const;

/**
Set the tool separation in DIPs.

Please note that because this function passes @a separation to
wxAuiToolBarArt::SetElementSize() it should be given in DIPs, not in
(logical) pixels. I.e. do _not_ use wxWindow::FromDIP() for this
function argument.
*/
void SetToolSeparation(int separation);

/**
Returns the separation between tools in logical pixels.
*/
int GetToolSeparation() const;

void SetToolSticky(int toolId, bool sticky);
Expand Down
31 changes: 29 additions & 2 deletions interface/wx/aui/dockart.h
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,34 @@ class wxAuiDockArt
/**
Get the value of a certain setting.
@a id can be one of the size values of @b wxAuiPaneDockArtSetting.
Sizes are in DPI-independent pixel values.

This function returns the same value that was set by SetMetric(), use
GetMetricForWindow() to get the value appropriate for the given window
for metrics that express sizes.
*/
virtual int GetMetric(int id) = 0;

/**
Get metric value scaled by the DPI of the given window if appropriate.

Call this function instead of GetMetric() to get the metric value
scaled by the window DPI for the metrics that are expressed in pixels
and must be scaled.

The default implementation doesn't scale ::wxAUI_DOCKART_SASH_SIZE and
::wxAUI_DOCKART_PANE_BORDER_SIZE metrics in order to allow setting them
to just a single pixel (which is the default value for the latter in
wxAuiDefaultDockArt) even in high DPI. You may override this function
in your custom art implementation to scale these metrics too if you
prefer to have thicker borders in high DPI.

Note that values of ::wxAUI_DOCKART_GRADIENT_TYPE are not expressed in
pixels and so should never be scaled by this function.

@since 3.3.0
*/
virtual int GetMetricForWindow(int id, wxWindow* window);

/**
Set a certain setting with the value @e colour.
@a id can be one of the colour values of @b wxAuiPaneDockArtSetting.
Expand All @@ -282,8 +306,11 @@ class wxAuiDockArt

/**
Set a certain setting with the value @e new_val.

@a id can be one of the size values of @b wxAuiPaneDockArtSetting.
Sizes should be in DPI-independent pixel values.

The interpretation of @a new_val depends on the metric being set, see
GetMetricForWindow().
*/
virtual void SetMetric(int id, int new_val) = 0;
};
Expand Down
Loading
Loading