void ModifierConfigWidget::setModifier(Modifier *modifier) { if (_modifier == modifier) return; _modifier = modifier; connect(_modifier, SIGNAL(settingsChanged()), this, SLOT(refreshControls())); // Need a refresh for the first time refreshControls(); }
//! constructor CGUIMessageBox::CGUIMessageBox(IGUIEnvironment* environment, const wchar_t* caption, const wchar_t* text, s32 flags, IGUIElement* parent, s32 id, core::rect<s32> rectangle, video::ITexture* image) : CGUIWindow(environment, parent, id, rectangle), OkButton(0), CancelButton(0), YesButton(0), NoButton(0), StaticText(0), Icon(0), IconTexture(image), Flags(flags), MessageText(text), Pressed(false) { #ifdef _DEBUG setDebugName("CGUIMessageBox"); #endif // set element type Type = EGUIET_MESSAGE_BOX; // remove focus Environment->setFocus(0); // remove buttons getMaximizeButton()->remove(); getMinimizeButton()->remove(); if (caption) setText(caption); Environment->setFocus(this); if ( IconTexture ) IconTexture->grab(); refreshControls(); }
void CGUIScrollBar::updateAbsolutePosition() { IGUIElement::updateAbsolutePosition(); // todo: properly resize refreshControls(); setPos(Pos); }
void CGUIScrollBar::updateAbsolutePosition() { IGUIElement::updateAbsolutePosition(); if (NoClip) AbsoluteClippingRect = AbsoluteRect; refreshControls(); }
void InfoWidget::createControls() { style::margins margin(0, 0, 0, 0); style::margins slidedPadding(0, 0, 0, 0); createChildRow(_mobileNumber, margin, slidedPadding, st::settingsBlockOneLineTextPart); createChildRow(_username, margin, slidedPadding, st::settingsBlockOneLineTextPart); createChildRow(_bio, margin, slidedPadding, st::settingsBioValue); refreshControls(); }
GeneralWidget::GeneralWidget(QWidget *parent, UserData *self) : BlockWidget(parent, self, lang(lng_settings_section_general)) , _changeLanguage(this, lang(lng_settings_change_lang), st::boxLinkButton) { connect(_changeLanguage, SIGNAL(clicked()), this, SLOT(onChangeLanguage())); subscribe(Global::RefChooseCustomLang(), [this]() { chooseCustomLang(); }); subscribe(FileDialog::QueryDone(), [this](const FileDialog::QueryUpdate &update) { notifyFileQueryUpdated(update); }); refreshControls(); }
//! Reads attributes of the element void CGUIScrollBar::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0) { IGUIScrollBar::deserializeAttributes(in,options); Horizontal = in->getAttributeAsBool("Horizontal"); setMax(in->getAttributeAsInt("Max")); setPos(in->getAttributeAsInt("Value")); setSmallStep(in->getAttributeAsInt("SmallStep")); setLargeStep(in->getAttributeAsInt("LargeStep")); refreshControls(); }
void PlayerVideo::load(Nameable *_tag, bool _isVideo, const QString &filename) { tag = _tag; isVideo = _isVideo; if(!isVideo) { QIcon icon; icon.addFile(QString::fromUtf8(":/icons/res_icon_audio_off.png"), QSize(), QIcon::Normal, QIcon::Off); icon.addFile(QString::fromUtf8(":/icons/res_icon_audio_on.png"), QSize(), QIcon::Normal, QIcon::On); ui->showVideo->setIcon(icon); } ui->playerVideo->load(MediaSource(filename)); refreshControls(); }
//! Reads attributes of the element void CGUIScrollBar::deserializeAttributes(IAttributes* in, SAttributeReadWriteOptions* options = 0) { IGUIScrollBar::deserializeAttributes(in, options); Horizontal = in->getAttributeAsBool("Horizontal"); setMin(in->getAttributeAsInt("Min")); setMax(in->getAttributeAsInt("Max")); setPos(in->getAttributeAsInt("Value")); setSmallStep(in->getAttributeAsInt("SmallStep")); setLargeStep(in->getAttributeAsInt("LargeStep")); // CurrentIconColor - not serialized as continuiously updated refreshControls(); }
//! constructor CGUIScrollBar::CGUIScrollBar(bool horizontal, IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle, bool noclip) : IGUIScrollBar(environment, parent, id, rectangle), UpButton(0), DownButton(0), Horizontal(horizontal), Pos(0), Max(100), SmallStep(10), DrawHeight(0), DrawPos(0), Dragging(false), NoClip(noclip) { #ifdef _DEBUG setDebugName("CGUIScrollBar"); #endif if (noclip) AbsoluteClippingRect = AbsoluteRect; refreshControls(); setPos(0); }
//! draws the element and its children void CGUIScrollBar::draw() { if (!IsVisible) return; IGUISkin* skin = Environment->getSkin(); if (!skin) return; ColourValue iconColor = skin->getColor(isEnabled() ? EGDC_WINDOW_SYMBOL : EGDC_GRAY_WINDOW_SYMBOL); if (iconColor != CurrentIconColor) { refreshControls(); } SliderRect = AbsoluteRect; // draws the background skin->draw2DRectangle(this, skin->getColor(EGDC_SCROLLBAR), SliderRect, &AbsoluteClippingRect); if (!Math::iszero(range())) { // recalculate slider rectangle if (Horizontal) { SliderRect.UpperLeftCorner.x = AbsoluteRect.UpperLeftCorner.x + DrawPos + RelativeRect.getHeight() - DrawHeight / 2; SliderRect.LowerRightCorner.x = SliderRect.UpperLeftCorner.x + DrawHeight; } else { SliderRect.UpperLeftCorner.y = AbsoluteRect.UpperLeftCorner.y + DrawPos + RelativeRect.getWidth() - DrawHeight / 2; SliderRect.LowerRightCorner.y = SliderRect.UpperLeftCorner.y + DrawHeight; } skin->draw3DButtonPaneStandard(this, SliderRect, &AbsoluteClippingRect); } // draw buttons IGUIElement::draw(); }
void CGUIScrollBar::updateAbsolutePosition() { IGUIElement::updateAbsolutePosition(); // todo: properly resize refreshControls(); if (Horizontal) { const f32 f = (RelativeRect.getWidth() - ((f32)RelativeRect.getHeight()*3.0f)) / (f32)Max; DrawPos = (s32)((Pos * f) + ((f32)RelativeRect.getHeight() * 0.5f)); DrawHeight = RelativeRect.getHeight(); } else { f32 f = 0.0f; if (Max != 0) f = (RelativeRect.getHeight() - ((f32)RelativeRect.getWidth()*3.0f)) / (f32)Max; DrawPos = (s32)((Pos * f) + ((f32)RelativeRect.getWidth() * 0.5f)); DrawHeight = RelativeRect.getWidth(); } }
//! constructor CGUIScrollBar::CGUIScrollBar(bool horizontal, IGUIEnvironment* environment, IGUIElement* parent, SINT32 id, rect<SINT32> rectangle, bool noclip) : IGUIScrollBar(environment, parent, id, rectangle), UpButton(0), DownButton(0), Dragging(false), Horizontal(horizontal), DraggedBySlider(false), TrayClick(false), Pos(0), DrawPos(0), DrawHeight(0), Min(0), Max(100), SmallStep(10), LargeStep(50), DesiredPos(0), LastChange(0) { #ifdef _DEBUG setDebugName("CGUIScrollBar"); #endif refreshControls(); setNotClipped(noclip); // this element can be tabbed to setTabStop(true); setTabOrder(-1); setPos(0); }
void IRCConfigWindow::initWindow() { SetTitle(conversions::from_utf16<wxString>(getText(_S("ui.irc_config_window.title")))); m_usernameLabel->SetLabel(conversions::from_utf16<wxString>(getText(_S("ui.irc_config_window.username")))); m_emailLabel->SetLabel(conversions::from_utf16<wxString>(getText(_S("ui.irc_config_window.email")))); m_nicknameLabel->SetLabel(conversions::from_utf16<wxString>(getText(_S("ui.irc_config_window.nickname")))); m_alternateNicknameLabel->SetLabel(conversions::from_utf16<wxString>(getText(_S("ui.irc_config_window.alternate_nickname")))); m_defaultChannelLabel->SetLabel(conversions::from_utf16<wxString>(getText(_S("ui.irc_config_window.default_channel")))); m_automaticConnectionCheckBox->SetLabel(conversions::from_utf16<wxString>(getText(_S("ui.irc_config_window.automatic_connection")))); m_serverLabel->SetLabel(conversions::from_utf16<wxString>(getText(_S("ui.irc_config_window.server")))); m_portLabel->SetLabel(conversions::from_utf16<wxString>(getText(_S("ui.irc_config_window.port")))); m_portSslLabel->SetLabel(conversions::from_utf16<wxString>(getText(_S("ui.irc_config_window.port_ssl")))); m_enableSslCheckBox->SetLabel(conversions::from_utf16<wxString>(getText(_S("ui.irc_config_window.enable_ssl")))); m_timeoutLabel->SetLabel(conversions::from_utf16<wxString>(getText(_S("ui.irc_config_window.timeout")))); loadConfig(); m_nicknameText->Connect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(IRCConfigWindow::onControlsChanged), NULL, this); m_serverText->Connect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(IRCConfigWindow::onControlsChanged), NULL, this); m_portText->Connect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(IRCConfigWindow::onControlsChanged), NULL, this); m_portSslText->Connect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(IRCConfigWindow::onControlsChanged), NULL, this); m_timeoutText->Connect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(IRCConfigWindow::onControlsChanged), NULL, this); m_enableSslCheckBox->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(IRCConfigWindow::onControlsChanged), NULL, this); m_pages->SetSelection(0); m_nicknameText->SetFocus(); refreshControls(); // Il codice generato da designer da problemi (viene richiamato prima della creazione dei controlli figli e le wx lanciano un'assert) m_basicPageGridSizer->AddGrowableCol(1); m_basicPageGridSizer->Layout(); m_advancedPageGridSizer->AddGrowableCol(1); m_advancedPageGridSizer->Layout(); }
//! Reads attributes of the element void CGUIMessageBox::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0) { Flags = 0; Flags = in->getAttributeAsBool("OkayButton") ? EMBF_OK : 0; Flags |= in->getAttributeAsBool("CancelButton")? EMBF_CANCEL : 0; Flags |= in->getAttributeAsBool("YesButton") ? EMBF_YES : 0; Flags |= in->getAttributeAsBool("NoButton") ? EMBF_NO : 0; if ( IconTexture ) { IconTexture->drop(); IconTexture = NULL; } IconTexture = in->getAttributeAsTexture("Texture"); if ( IconTexture ) IconTexture->grab(); MessageText = in->getAttributeAsStringW("MessageText").c_str(); CGUIWindow::deserializeAttributes(in,options); refreshControls(); }
void PlayerVideo::seek(qint64 time) { refreshControls(); ui->playerVideo->seek(time); }
void IRCConfigWindow::onControlsChanged(wxCommandEvent &e) { refreshControls(); }
void PlayerVideo::resizeEvent(QResizeEvent *) { refreshControls(); ui->globalFramePlayer->resize(QSize(width(), ui->globalFramePlayer->height())); ui->playerVideo ->resize(QSize(width(), height() - ui->globalFramePlayer->height())); ui->globalFramePlayer->move(ui->playerVideo->geometry().bottomLeft()); }
GeneralWidget::GeneralWidget(QWidget *parent, UserData *self) : BlockWidget(parent, self, lang(lng_settings_section_general)) , _changeLanguage(this, lang(lng_settings_change_lang), st::boxLinkButton) { connect(_changeLanguage, SIGNAL(clicked()), this, SLOT(onChangeLanguage())); refreshControls(); }
void PlayerVideo::pause() { refreshControls(); ui->playerVideo->pause(); }