////////////////////////////////////////////////////////////////////////////////// // Slider control GSlider::GSlider(int id, int x, int y, int cx, int cy, const char *name, bool vert) : ResObject(Res_Slider) { SetId(id); GRect r(x, y, x+cx, y+cy); SetPos(r); Name(name); Vertical = vert; Min = Max = 0; Val = 0; SetTabStop(true); }
// // ColorButton::ColorButton // ColorButton::ColorButton(IControl *parent) : ICButton(parent) { // Clear the var var = NULL; // Styles SetTabStop(FALSE); // Set the default size of the button SetSize(30, 20); }
OpPersonalbar::OpPersonalbar(PrefsCollectionUI::integerpref prefs_setting) : OpToolbar(prefs_setting), m_is_inline(FALSE), m_listeners_set(FALSE), m_disable_indicator(FALSE) { SetListener(this); SetWrapping(OpBar::WRAPPING_OFF); SetShrinkToFit(TRUE); // Not use FIXED_HEIGHT_BUTTON_AND_EDIT since edit it too high SetFixedHeight(FIXED_HEIGHT_BUTTON); SetButtonType(OpButton::TYPE_LINK); SetStandardToolbar(FALSE); SetTabStop(TRUE); }
GCombo::GCombo(int id, int x, int y, int cx, int cy, char *name) : ResObject(Res_ComboBox) { d = new GComboPrivate; Name(name); GRect r(x, y, x+cx, y+200); SetPos(r); SetId(id); SetTabStop(true); SetClass("COMBOBOX"); SetStyle(GetStyle() | CBS_DROPDOWNLIST); }
OP_STATUS OpSpeedDialView::InitSpeedDial(OpWidget* container) { RETURN_IF_ERROR(Init()); RETURN_IF_ERROR(AddListener(this)); container->AddChild(this); #ifdef ACCESSIBILITY_EXTENSION_SUPPORT AccessibilityPrunesMe(ACCESSIBILITY_PRUNE_WHEN_INVISIBLE); #endif //ACCESSIBILITY_EXTENSION_SUPPORT SetTabStop(TRUE); return OpStatus::OK; }
GButton::GButton(int id, int x, int y, int cx, int cy, char *name) : ResObject(Res_Button) { d = new GButtonPrivate; Name(name); GRect r(x, y, x+cx, y+cy); SetPos(r); SetId(id); SetTabStop(true); #ifdef SKIN_MAGIC SetClass("BUTTON"); #else SetClass(ClassName); d->Class->SubClass("BUTTON"); #endif }
// // ICWindow::HandleEvent // // Handle input events // U32 ICWindow::HandleEvent(Event &e) { if (e.type == Input::EventID()) { // Input events switch (e.subType) { case Input::MOUSEBUTTONDOWN: { if (e.input.code == Input::LeftButtonCode()) { if (InWindow(Point<S32>(e.input.mouseX, e.input.mouseY))) { // Raise window SendNotify(this, ICWindowMsg::Raise, FALSE); // Handled return (TRUE); } } break; } case Input::KEYDOWN: case Input::KEYREPEAT: { switch (e.input.code) { case DIK_TAB: { // If nothing has the focus then activate the first tab stop control if (IFace::GetFocus() == NULL) { SetTabStop(NULL, TRUE); // Handled return (TRUE); } // Not handled break; } case DIK_ESCAPE: { // If modal then issue the Window::Close notification if ((controlStyle & STYLE_MODAL) && !(windowStyle & STYLE_NOSYSBUTTONS)) { // Close window SendNotify(this, ICWindowMsg::Close, FALSE); // Handled return (TRUE); } // Not handled break; } } // Not handled break; } } } else if (e.type == IFace::EventID()) { switch (e.subType) { // Notification events case IFace::NOTIFY: { switch (e.iface.p1) { case ICWindowMsg::Raise: { // Raise the window SetZPos(0); // Handled return (TRUE); } case ICWindowMsg::Close: { // Close window Deactivate(); // Handled return (TRUE); } case ICWindowMsg::Maximize: case ICWindowMsg::Minimize: { // Not implemented break; } case ICWindowMsg::Destroy: { // Mark for deletion MarkForDeletion(); // Handled return (TRUE); } } // Not handled break; } } } // This event can't be handled by this control, so pass it to the parent class return (IControl::HandleEvent(e)); }