[Git][wxwidgets/wxwidgets][master] 5 commits: Fix harmless unused parameter warning in wxOSX

0 views
Skip to first unread message

Vadim Zeitlin (@_VZ_)

unread,
Oct 15, 2025, 4:35:06 PM (6 days ago) Oct 15
to wx-commi...@googlegroups.com

Vadim Zeitlin pushed to branch master at wxWidgets / wxWidgets

Commits:

  • 33b289bb
    by Blake-Madden at 2025-10-15T22:12:31+02:00
    Fix harmless unused parameter warning in wxOSX
    
    Add missing WXUNUSED().
    
    Closes #25880.
    
  • 3f9d34b4
    by Blake-Madden at 2025-10-15T22:19:44+02:00
    Check that wxRibbonBar tab icon is valid before using it
    
    Using invalid item resulted in an assert, avoid it by checking if it is
    valid before using it.
    
    Also avoid calling GetIcon() and GetLogicalWidth() twice in a row by
    storing the result in a variable.
    
    Closes #25881.
    
    Co-authored-by: Vadim Zeitlin <va...@wxwidgets.org>
    
  • 450aa484
    by Václav Slavík at 2025-10-15T22:23:08+02:00
    Improve padding when using HiDPI in generic wxDataViewCtrl
    
    It looked almost non-existent at 200%, so scale it with DPI to improve
    the control appearance.
    
    Closes #25882.
    
  • 7d91e361
    by Václav Slavík at 2025-10-15T22:25:08+02:00
    Fix compilation with wxUSE_OWNER_DRAWN==0
    
    Add missing wxUSE_OWNER_DRAWN check to wxMenuItem code.
    
    Closes #25883.
    
  • c7e57347
    by DietmarSchwertberger at 2025-10-15T22:26:20+02:00
    Fix selecting individual columns with Ctrl-Click in wxGrid
    
    This didn't work correctly because the check if the column was already
    selected in wxGridColumnOperations::IsLineInSelection() used incorrect
    parameter order when calling IsInSelection().
    
    Closes #25884.
    

5 changed files:

Changes:

  • include/wx/generic/private/grid.h
    ... ... @@ -980,7 +980,7 @@ public:
    980 980
             { grid->DeselectCol(line); }
    
    981 981
     
    
    982 982
         virtual bool IsLineInSelection(wxGrid *grid, int line) const override
    
    983
    -        { return grid->m_selection->IsInSelection(line, 0); }
    
    983
    +        { return grid->m_selection->IsInSelection(0, line); }
    
    984 984
     
    
    985 985
         virtual wxGrid::EventResult SendEvent(wxGrid *grid, wxEventType eventType,
    
    986 986
             int line, const wxMouseEvent& event) const override
    

  • include/wx/osx/cocoa/private/markuptoattr.h
    ... ... @@ -27,7 +27,7 @@ protected:
    27 27
               m_attrString(nullptr)
    
    28 28
         {}
    
    29 29
     
    
    30
    -    void Parse(const wxFont& font, const wxString& markup)
    
    30
    +    void Parse(const wxFont& WXUNUSED(font), const wxString& markup)
    
    31 31
         {
    
    32 32
             const wxCFStringRef label(PrepareText(wxMarkupParser::Strip(markup)));
    
    33 33
             m_attrString = [[NSMutableAttributedString alloc]
    

  • src/generic/datavgen.cpp
    ... ... @@ -2506,7 +2506,7 @@ wxBitmap wxDataViewMainWindow::CreateItemBitmap( unsigned int row, int &indent )
    2506 2506
             if ( cell->PrepareForItem(model, item, column->GetModelColumn()) )
    
    2507 2507
             {
    
    2508 2508
                 wxRect item_rect(x, 0, width, height);
    
    2509
    -            item_rect.Deflate(PADDING_RIGHTLEFT, 0);
    
    2509
    +            item_rect.Deflate(FromDIP(PADDING_RIGHTLEFT), 0);
    
    2510 2510
     
    
    2511 2511
                 // dc.SetClippingRegion( item_rect );
    
    2512 2512
                 cell->WXCallRender(item_rect, &dc, 0);
    
    ... ... @@ -2931,7 +2931,7 @@ void wxDataViewMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
    2931 2931
                 }
    
    2932 2932
     
    
    2933 2933
                 wxRect item_rect = cell_rect;
    
    2934
    -            item_rect.Deflate(PADDING_RIGHTLEFT, 0);
    
    2934
    +            item_rect.Deflate(FromDIP(PADDING_RIGHTLEFT), 0);
    
    2935 2935
     
    
    2936 2936
                 // account for the tree indent (harmless if we're not indented)
    
    2937 2937
                 item_rect.x += indent;
    
    ... ... @@ -6158,7 +6158,7 @@ unsigned int wxDataViewCtrl::GetBestColumnWidth(int idx) const
    6158 6158
     
    
    6159 6159
         int max_width = calculator.GetMaxWidth();
    
    6160 6160
         if ( max_width > 0 )
    
    6161
    -        max_width += 2 * PADDING_RIGHTLEFT;
    
    6161
    +        max_width += 2 * FromDIP(PADDING_RIGHTLEFT);
    
    6162 6162
     
    
    6163 6163
         const_cast<wxDataViewCtrl*>(this)->m_colsBestWidths[idx].width = max_width;
    
    6164 6164
         return max_width;
    

  • src/msw/menuitem.cpp
    ... ... @@ -733,12 +733,14 @@ void wxMenuItem::DoSetBitmap(const wxBitmapBundle& bmpNew, bool bChecked)
    733 733
     
    
    734 734
     void wxMenuItem::SetupBitmaps()
    
    735 735
     {
    
    736
    +#if wxUSE_OWNER_DRAWN
    
    736 737
         // Owner-drawn items must not return valid bitmaps even if they have them,
    
    737 738
         // this somehow breaks the item measuring logic and the menu may not become
    
    738 739
         // wide enough to accommodate the items text, so just don't do anything at
    
    739 740
         // all for them here.
    
    740 741
         if ( IsOwnerDrawn() )
    
    741 742
             return;
    
    743
    +#endif // wxUSE_OWNER_DRAWN
    
    742 744
     
    
    743 745
         const int itemPos = MSGetMenuItemPos();
    
    744 746
         if ( itemPos == -1 )
    

  • src/ribbon/art_msw.cpp
    ... ... @@ -1490,8 +1490,13 @@ void wxRibbonMSWArtProvider::DrawTab(
    1490 1490
                 int x = tab.rect.x + 3;
    
    1491 1491
                 if(m_flags & wxRIBBON_BAR_SHOW_PAGE_ICONS)
    
    1492 1492
                 {
    
    1493
    -                x += 3 + tab.page->GetIcon().GetLogicalWidth();
    
    1494
    -                width -= 3 + tab.page->GetIcon().GetLogicalWidth();
    
    1493
    +                const wxBitmap& icon = tab.page->GetIcon();
    
    1494
    +                if (icon.IsOk())
    
    1495
    +                {
    
    1496
    +                    const int iconWidth = icon.GetLogicalWidth();
    
    1497
    +                    x += 3 + iconWidth;
    
    1498
    +                    width -= 3 + iconWidth;
    
    1499
    +                }
    
    1495 1500
                 }
    
    1496 1501
                 int y = tab.rect.y + (tab.rect.height - text_height) / 2;
    
    1497 1502
     
    

Reply all
Reply to author
Forward
0 new messages