QAccessible::State QAccessibleGroupBox::state() const { QAccessible::State st = QAccessibleWidget::state(); st.checkable = groupBox()->isCheckable(); st.checked = groupBox()->isChecked(); return st; }
QStringList QAccessibleGroupBox::actionNames() const { QStringList actions = QAccessibleWidget::actionNames(); if (groupBox()->isCheckable()) { actions.prepend(QAccessibleActionInterface::toggleAction()); } return actions; }
QString QAccessibleGroupBox::text(QAccessible::Text t) const { QString txt = QAccessibleWidget::text(t); if (txt.isEmpty()) { switch (t) { case QAccessible::Name: txt = qt_accStripAmp(groupBox()->title()); break; case QAccessible::Description: txt = qt_accStripAmp(groupBox()->toolTip()); break; default: break; } } return txt; }
QVector<QPair<QAccessibleInterface*, QAccessible::Relation> > QAccessibleGroupBox::relations(QAccessible::Relation match /* = QAccessible::AllRelations */) const { QVector<QPair<QAccessibleInterface*, QAccessible::Relation> > rels = QAccessibleWidget::relations(match); if ((match & QAccessible::Labelled) && (!groupBox()->title().isEmpty())) { const QList<QWidget*> kids = childWidgets(widget()); for (int i = 0; i < kids.count(); ++i) { QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(kids.at(i)); if (iface) rels.append(qMakePair(iface, QAccessible::Relation(QAccessible::Labelled))); } } return rels; }
LRESULT CAboutDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { #ifdef _USE_AERO AERO_CONTROL(CButton, m_Ok, IDOK) //AERO_CONTROL(CStatic, staticMessage, IDC_STATIC_VERSION) //AERO_CONTROL(CStatic, m_Label, IDC_APPTEXT) CWindow groupBox(GetDlgItem(IDC_STATIC)); groupBox.ShowWindow(SW_HIDE); this->OpenThemeData(VSCLASS_WINDOW); #else CString strMsg; strMsg.Format(L"\nConsoleZ %i.%i.%i.%i\n", VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD, VERSION_BUILD2); CWindow staticMessage(GetDlgItem(IDC_STATIC_VERSION)); staticMessage.SetWindowText(strMsg); #endif CenterWindow(GetParent()); return TRUE; }
/*------------------------------------------------------------------------------ | Dialog::createControlsFromTemplate | ------------------------------------------------------------------------------*/ Dialog& Dialog :: createControlsFromTemplate( ) { PDLGTEMPLATE pdlgt; /* Dialog Template Pointer */ void* pvStart; /* Dialog Template Item Pointer */ register unsigned long cItems, /* Dialog Items Counter */ ulRc, /* Return code */ i; /* Loop Counter */ /* Set mouse pointer to "wait" in case template */ /* is large */ IPointerHandle oldPointer = mousePointer(); ISystemPointerHandle systemPointer( ISystemPointerHandle::wait ); setMousePointer( systemPointer ); /* Try reading in the dialog template for the */ /* given dialog ID */ ulRc = DosGetResource( 0, RT_DIALOG, this->ulId, (void **)&pdlgt ); if ( ulRc != 0 ) { /* Dialog template not found; reset mouse */ /* pointer and throw exception */ setMousePointer( oldPointer ); ITHROWSYSTEMERROR( ulRc, "DosGetResource", IErrorInfo::accessError, IException::recoverable ); } /* Save pointer to the start of the dlg template */ pvStart = (void *)pdlgt; /* Save the number of controls found within the */ /* dialog template */ cItems = pdlgt->adlgti[0].cChildren + 1; /* Read in and create an Open Class Library C++ */ /* object for each of the controls within the */ /* dialog template */ for ( i = 1; i < cItems; i++ ) { /* Obtain the id of the control */ unsigned long ulId = (unsigned long)(pdlgt->adlgti[i].id & 0xffff); /* Skip the control if its id is -1 */ if ( ulId != 0xffff ) { /* Check to see if a custom control is specified */ /* or if a standard PM control class is being */ /* used */ if ( pdlgt->adlgti[i].cchClassName ) { /* Since a length for the class name present, */ /* a custom control class name is being used for */ /* the control. Point to the memory location */ /* where the class name is found within the */ /* dialog template information. */ customControl( ulId, ((char *)pvStart + pdlgt->adlgti[i].offClassName) ); } else { /* No class name length given indicating that a */ /* standard PM class is being used. The class */ /* name is stored as an index value. For */ /* example, the class for static's is defined as */ /* */ /* #define WC_STATIC ((PSZ)0xffff0005L) */ /* */ /* The values within the dialog template for */ /* the static class would be */ /* */ /* adlgti[i].cchClassName = 0 */ /* adlgti[i].offClassName = 5 */ /* */ /* Therefore, the value of offClassName field */ /* must be used as an index that is used to */ /* actually select the class name. */ switch ( pdlgt->adlgti[i].offClassName ) { case WINCLASS_BUTTON : { unsigned long ulStyle = pdlgt->adlgti[i].flStyle & BS_PRIMARYSTYLES; switch ( ulStyle ) { case BS_PUSHBUTTON: { if ( pdlgt->adlgti[i].flStyle & (BS_BITMAP | BS_ICON) ) { IGraphicPushButton* pGraphicPushButton = new IGraphicPushButton( ulId, this ); pGraphicPushButton->setAutoDeleteObject( true ); graphicPushButton( pGraphicPushButton ); } else { IPushButton* pPushButton = new IPushButton( ulId, this ); pPushButton->setAutoDeleteObject( true ); this->pushButton( pPushButton ); } } break; case BS_CHECKBOX: case BS_AUTOCHECKBOX: { ICheckBox* pCheckBox = new ICheckBox( ulId, this ); pCheckBox->setAutoDeleteObject( true ); checkBox( pCheckBox ); } break; case BS_RADIOBUTTON: case BS_AUTORADIOBUTTON: { IRadioButton* pRadioButton = new IRadioButton( ulId, this ); pRadioButton->setAutoDeleteObject( true ); radioButton( pRadioButton ); } break; case BS_3STATE: case BS_AUTO3STATE: { I3StateCheckBox* p3StateCheckBox = new I3StateCheckBox( ulId, this ); p3StateCheckBox->setAutoDeleteObject( true ); threeStateCheckBox( p3StateCheckBox ); } break; case BS_USERBUTTON: { customButton( ulId ); } break; } //end switch } //WINCLASS_BUTTON break; case WINCLASS_SCROLLBAR : { IScrollBar* pScrollBar = new IScrollBar( ulId, this ); pScrollBar->setAutoDeleteObject( true ); scrollBar( pScrollBar ); } break; case WINCLASS_LISTBOX : { IListBox* pListBox = new IListBox( ulId, this ); pListBox->setAutoDeleteObject( true ); listBox( pListBox ); } break; case WINCLASS_ENTRYFIELD : { IEntryField* pEntryField = new IEntryField( ulId, this ); pEntryField->setAutoDeleteObject( true ); entryField( pEntryField ); } break; case WINCLASS_STATIC : { unsigned long ulStyle = pdlgt->adlgti[i].flStyle & (SS_TEXT | SS_GROUPBOX | SS_ICON | SS_BITMAP); switch ( ulStyle ) { case SS_TEXT: { IStaticText* pStaticText = new IStaticText( ulId, this ); pStaticText->setAutoDeleteObject( true ); staticText( pStaticText ); } break; case SS_GROUPBOX: { IGroupBox* pGroupBox = new IGroupBox( ulId, this ); pGroupBox->setAutoDeleteObject( true ); groupBox( pGroupBox ); } break; case SS_ICON: { IIconControl* pIcon = new IIconControl( ulId, this ); pIcon->setAutoDeleteObject( true ); iconControl( pIcon ); } break; case SS_BITMAP: { IBitmapControl* pBitmap = new IBitmapControl( ulId, this ); pBitmap->setAutoDeleteObject( true ); bitmapControl( pBitmap ); } break; } //end switch } //WINCLASS_STATIC break; case WINCLASS_COMBOBOX : { IComboBox* pComboBox = new IComboBox( ulId, this ); pComboBox->setAutoDeleteObject( true ); comboBox( pComboBox ); } break; case WINCLASS_MLE : { IMultiLineEdit* pMLE = new IMultiLineEdit( ulId, this ); pMLE->setAutoDeleteObject( true ); mle( pMLE ); } break; case WINCLASS_SPINBUTTON : { if ( pdlgt->adlgti[i].flStyle & SPBS_NUMERICONLY ) { INumericSpinButton* pNumericSpinButton = new INumericSpinButton( ulId, this ); pNumericSpinButton->setAutoDeleteObject( true ); numericSpinButton( pNumericSpinButton ); } else { ITextSpinButton* pTextSpinButton = new ITextSpinButton( ulId, this ); pTextSpinButton->setAutoDeleteObject( true ); textSpinButton( pTextSpinButton ); } } break; case WINCLASS_CONTAINER : { IContainerControl* pContainer = new IContainerControl( ulId, this ); pContainer->setAutoDeleteObject( true ); container( pContainer ); } break; case WINCLASS_SLIDER : { if ( pdlgt->adlgti[i].flStyle & SLS_READONLY ) { IProgressIndicator* pProgressIndicator = new IProgressIndicator( ulId, this ); pProgressIndicator->setAutoDeleteObject( true ); progressIndicator( pProgressIndicator ); } else { ISlider* pSlider = new ISlider( ulId, this ); pSlider->setAutoDeleteObject( true ); slider( pSlider ); } } break; case WINCLASS_VALUESET : //No valueset class - see OS/2 C++ Class Library Power GUI //Programming with C Set++ for an implementation of a //valueset class. break; case WINCLASS_NOTEBOOK : { INotebook* pNotebook = new INotebook( ulId, this ); pNotebook->setAutoDeleteObject( true ); notebook( pNotebook ); } break; case WINCLASS_CIRCULARSLIDER : { ICircularSlider* pCircularSlider = new ICircularSlider( ulId, this ); pCircularSlider->setAutoDeleteObject( true ); circularSlider( pCircularSlider ); } break; } //end switch } //end if } //end if - id != -1 } //end for /* Release the memory allocated for the dlg */ /* template before returning */ DosFreeResource( pvStart ); /* Reset mouse pointer */ setMousePointer( oldPointer ); return( *this ); } //Dialog::createControlsFromTemplate
void QAccessibleGroupBox::doAction(const QString &actionName) { if (actionName == QAccessibleActionInterface::toggleAction()) groupBox()->setChecked(!groupBox()->isChecked()); }
QAccessible::Role QAccessibleGroupBox::role() const { return groupBox()->isCheckable() ? QAccessible::CheckBox : QAccessible::Grouping; }