VirtualBox

Changeset 63796 in vbox for trunk


Ignore:
Timestamp:
Sep 12, 2016 12:47:43 PM (8 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:6899: Accessibility support (step 21): Mac OS X: Selector UI: Extend segmented-button with the additional API required for work with the accessibility interface.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/platform/darwin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/platform/darwin/UICocoaSpecialControls.h

    r62493 r63796  
    7272
    7373    UICocoaSegmentedButton(QWidget *pParent, int count, CocoaSegmentType type = RoundRectSegment);
    74     ~UICocoaSegmentedButton();
     74
     75    /** Returns the number of segments. */
     76    int count() const;
     77
     78    /** Returns whether the @a iSegment is selected. */
     79    bool isSelected(int iSegment) const;
     80
     81    /** Returns the @a iSegment description. */
     82    QString description(int iSegment) const;
    7583
    7684    QSize sizeHint() const;
  • trunk/src/VBox/Frontends/VirtualBox/src/platform/darwin/UICocoaSpecialControls.mm

    r63492 r63796  
    404404}
    405405
    406 UICocoaSegmentedButton::~UICocoaSegmentedButton()
    407 {
     406int UICocoaSegmentedButton::count() const
     407{
     408    return [nativeRef() segmentCount];
     409}
     410
     411bool UICocoaSegmentedButton::isSelected(int iSegment) const
     412{
     413    return [nativeRef() isSelectedForSegment: iSegment];
     414}
     415
     416QString UICocoaSegmentedButton::description(int iSegment) const
     417{
     418    /* Return segment description if segment index inside the bounds: */
     419    if (iSegment >=0 && iSegment < count())
     420        return ::darwinNSStringToQString([nativeRef() labelForSegment: iSegment]);
     421
     422    /* Null-string by default: */
     423    return QString();
    408424}
    409425
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette