[Git][wxwidgets/wxwidgets][master] 2 commits: Improve precision of wxScrollBar position in wxOSX

3 views
Skip to first unread message

Vadim Zeitlin (@_VZ_)

unread,
Jul 7, 2024, 6:34:35 PMJul 7
to wx-commi...@googlegroups.com

Vadim Zeitlin pushed to branch master at wxWidgets / wxWidgets

Commits:

  • ec779278
    by Alex Contreras at 2024-07-08T00:10:36+02:00
    Improve precision of wxScrollBar position in wxOSX
    
    Use doubleValue instead of floatValue when retrieving scrollbar position
    for consistency with setDoubleValue: used when setting it.
    
    This avoids problems due to rounding that could result in noticeable
    effects when using wxListCtrl with many (millions of) items.
    
    Closes #24669.
    
    Closes #24670.
    
  • fbf4ac52
    by Stefan Csomor at 2024-07-08T00:14:59+02:00
    Fix regression with not accepting keyboard focus in wxOSX
    
    Support keyboard focus even when NSClipView has to be used, fixing
    multiple problems which resulted due to not taking focus before, notably
    in wxListCtrl and wxTreeCtrl.
    
    Closes #24605.
    
    Closes #24667.
    
    Closes #24678.
    

2 changed files:

Changes:

  • src/osx/cocoa/scrolbar.mm
    ... ... @@ -62,7 +62,7 @@ public :
    62 62
     
    
    63 63
         virtual wxInt32 GetValue() const override
    
    64 64
         {
    
    65
    -        return wxRound([(wxNSScroller*) m_osxView floatValue] * m_maximum);
    
    65
    +        return wxRound([(wxNSScroller*) m_osxView doubleValue] * m_maximum);
    
    66 66
         }
    
    67 67
     
    
    68 68
         virtual wxInt32 GetMaximum() const override
    

  • src/osx/cocoa/window.mm
    ... ... @@ -3245,6 +3245,21 @@ bool wxWidgetCocoaImpl::CanFocus() const
    3245 3245
     
    
    3246 3246
     @implementation wxNSClipView
    
    3247 3247
     
    
    3248
    ++ (void)initialize
    
    3249
    +{
    
    3250
    +    static BOOL initialized = NO;
    
    3251
    +    if (!initialized)
    
    3252
    +    {
    
    3253
    +        initialized = YES;
    
    3254
    +        wxOSXCocoaClassAddWXMethods( self, wxOSXSKIP_DRAW);
    
    3255
    +    }
    
    3256
    +}
    
    3257
    +
    
    3258
    +- (BOOL) needsPanelToBecomeKey
    
    3259
    +{
    
    3260
    +    return YES;
    
    3261
    +}
    
    3262
    +
    
    3248 3263
     #if wxOSX_USE_NATIVE_FLIPPED
    
    3249 3264
     - (BOOL)isFlipped
    
    3250 3265
     {
    
    ... ... @@ -4123,6 +4138,8 @@ void wxWidgetCocoaImpl::UseClippingView()
    4123 4138
                 [(NSClipView*)m_osxClipView setDrawsBackground: NO];
    
    4124 4139
                 [m_osxView addSubview:m_osxClipView];
    
    4125 4140
     
    
    4141
    +            wxWidgetImpl::Associate( m_osxClipView, this ) ;
    
    4142
    +
    
    4126 4143
                 // TODO check for additional subwindows which might have to be moved to the clip view ?
    
    4127 4144
             }
    
    4128 4145
         }
    


View it on GitLab.
You're receiving this email because of your account on gitlab.com. Manage all notifications · Help

Reply all
Reply to author
Forward
0 new messages