void CGameGUIList::OnKeyDown(int nKey,bool *pbProcessed) { CGameWindowBase::OnKeyDown(nKey,pbProcessed); if(nKey==GK_UP){SelectPrevious();*pbProcessed=true;} if(nKey==GK_DOWN){SelectNext();*pbProcessed=true;} if(nKey==GK_PAGEDOWN){SelectNextPage();*pbProcessed=true;} if(nKey==GK_PAGEUP){SelectPreviousPage();*pbProcessed=true;} if(nKey==GK_HOME){m_nSelectedElement=0;ValidateSelection();*pbProcessed=true;} if(nKey==GK_END){m_nSelectedElement=m_vElements.size()-1;ValidateSelection();*pbProcessed=true;} }
bool CPActionInterpolate::SaveState(const CMainFrame &MainFrm) { const CPatternEditor *pPatternEditor = GET_PATTERN_EDITOR(); if (!ValidateSelection(*pPatternEditor)) return false; m_iSelectionSize = pPatternEditor->GetSelectionSize(pPatternEditor->GetSelection()); return CPSelectionAction::SaveState(MainFrm); }
void Text::HandleChangeLanguage(StringHash eventType, VariantMap& eventData) { auto* l10n = GetSubsystem<Localization>(); text_ = l10n->Get(stringId_); DecodeToUnicode(); ValidateSelection(); UpdateText(); }
bool CPActionStretch::SaveState(const CMainFrame &MainFrm) { if (m_iStretchMap.empty()) return false; if (!ValidateSelection(*GET_PATTERN_EDITOR())) return false; return CPSelectionAction::SaveState(MainFrm); }
void Text::ApplyAttributes() { UIElement::ApplyAttributes(); DecodeToUnicode(); fontSize_ = Max(fontSize_, 1); ValidateSelection(); UpdateText(); }
void Text::SetText(const String& text) { text_ = text; // Decode to Unicode now unicodeText_.Clear(); for (unsigned i = 0; i < text_.Length();) unicodeText_.Push(text_.NextUTF8Char(i)); ValidateSelection(); UpdateText(); }
void Text::ApplyAttributes() { UIElement::ApplyAttributes(); // Decode to Unicode now unicodeText_.Clear(); for (unsigned i = 0; i < text_.Length();) unicodeText_.Push(text_.NextUTF8Char(i)); fontSize_ = Max(fontSize_, 1); ValidateSelection(); UpdateText(); }
void Text::SetText(const ea::string& text) { if (autoLocalizable_) { stringId_ = text; auto* l10n = GetSubsystem<Localization>(); text_ = l10n->Get(stringId_); } else { text_ = text; } DecodeToUnicode(); ValidateSelection(); UpdateText(); }
void Text::ApplyAttributes() { UISelectable::ApplyAttributes(); // Localize now if attributes were loaded out-of-order if (autoLocalizable_ && stringId_.length()) { auto* l10n = GetSubsystem<Localization>(); text_ = l10n->Get(stringId_); } DecodeToUnicode(); fontSize_ = Max(fontSize_, 1); strokeThickness_ = Abs(strokeThickness_); ValidateSelection(); UpdateText(); }
void Text::SetAutoLocalizable(bool enable) { if (enable != autoLocalizable_) { autoLocalizable_ = enable; if (enable) { stringId_ = text_; auto* l10n = GetSubsystem<Localization>(); text_ = l10n->Get(stringId_); SubscribeToEvent(E_CHANGELANGUAGE, URHO3D_HANDLER(Text, HandleChangeLanguage)); } else { text_ = stringId_; stringId_ = ""; UnsubscribeFromEvent(E_CHANGELANGUAGE); } DecodeToUnicode(); ValidateSelection(); UpdateText(); } }
void CGameGUIList::SetSelectedElement(int nElement){m_nSelectedElement=nElement;if(nElement!=-1){ValidateSelection();}}
void CGameGUIList::SelectPreviousPage(){m_nSelectedElement-=m_nVisibleCount;ValidateSelection();}
void CGameGUIList::SelectNextPage(){m_nSelectedElement+=m_nVisibleCount;ValidateSelection();}
void CGameGUIList::SelectNext(){m_nSelectedElement++;ValidateSelection();}
bool CPActionReverse::SaveState(const CMainFrame &MainFrm) { if (!ValidateSelection(*GET_PATTERN_EDITOR())) return false; return CPSelectionAction::SaveState(MainFrm); }
void Text::SetSelection(unsigned start, unsigned length) { selectionStart_ = start; selectionLength_ = length; ValidateSelection(); }
void CGameGUIList::SelectPrevious(){m_nSelectedElement--;ValidateSelection();}