Beispiel #1
0
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);
}
Beispiel #3
0
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);
}
Beispiel #5
0
void Text::ApplyAttributes()
{
    UIElement::ApplyAttributes();

    DecodeToUnicode();

    fontSize_ = Max(fontSize_, 1);
    ValidateSelection();
    UpdateText();
}
Beispiel #6
0
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();
}
Beispiel #7
0
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();
}
Beispiel #8
0
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();
}
Beispiel #9
0
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();
}
Beispiel #10
0
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();
    }
}
Beispiel #11
0
void 		 CGameGUIList::SetSelectedElement(int nElement){m_nSelectedElement=nElement;if(nElement!=-1){ValidateSelection();}}
Beispiel #12
0
void CGameGUIList::SelectPreviousPage(){m_nSelectedElement-=m_nVisibleCount;ValidateSelection();}
Beispiel #13
0
void CGameGUIList::SelectNextPage(){m_nSelectedElement+=m_nVisibleCount;ValidateSelection();}
Beispiel #14
0
void CGameGUIList::SelectNext(){m_nSelectedElement++;ValidateSelection();}
bool CPActionReverse::SaveState(const CMainFrame &MainFrm)
{
	if (!ValidateSelection(*GET_PATTERN_EDITOR()))
		return false;
	return CPSelectionAction::SaveState(MainFrm);
}
Beispiel #16
0
void Text::SetSelection(unsigned start, unsigned length)
{
    selectionStart_ = start;
    selectionLength_ = length;
    ValidateSelection();
}
Beispiel #17
0
void CGameGUIList::SelectPrevious(){m_nSelectedElement--;ValidateSelection();}