void UISelector::selectPrevItem(char c) { if(mChildren.empty()) { return; } int i = mSelectedIndex - 1; c = tolower(c); while(i != mSelectedIndex) { if(i < 0) { i = mChildren.size() - 1; } UIText *text = dynamic_cast<UIText *>(mChildren[i]); if(text != NULL) { char f = tolower(text->getFirstUnformatted()); if(c == f) { mSelectedIndex = i; break; } } i--; } updateScroll(); }
UIText* Application::CreateRenderText(Vec3 Pos, std::string text, UIPanel* Pan) { if(!m_UIManager) return 0; UIText* Tex = new UIText(); Tex->SetFont(m_UIManager->GetFont()); Tex->SetText(text); Tex->SetTextSize(22); Tex->SetPosition(Pos); Pan->AddChild(Tex); return Tex; }
void primary_timer_func() override { std::string message = "Number of active bubbles: "; message += tostring(this->num_children()); bubble_count_text->set_text(message); UIScreen::primary_timer_func(); }
UISetPasswordLayout::UISetPasswordLayout() : mPasswordEntryState( 0 ), mOldStarString ("Old Pwd:"), mNewStarString ( "New Pwd:"), mConfirmStarString( "Confirm Pwd:"), mOldPwdUIText(NULL), mNewPwdUIText(NULL), mConfirmPwdUIText(NULL), mOldPwd(""), mNewPwd(""), mConfirmPwd(""), mCreatingPassword( false ) { mName = "SetPassword"; UIImage* backDrop = new UIImage( "castleplain_darkened.png" ); mElements.push_back( backDrop ); // Old Password mOldPwdUIText = new UIText(mOldStarString, 30, 255, 255, 255); mOldPwdUIText->SetPos( Point(175, 145) ); mElements.push_back(mOldPwdUIText); // New Password mNewPwdUIText = new UIText(mNewStarString, 30, 255, 255, 255); mNewPwdUIText->SetPos( Point(175, 185) ); mNewPwdUIText->SetVisible( false ); mElements.push_back(mNewPwdUIText); // Confirm Password mConfirmPwdUIText = new UIText(mConfirmStarString, 30, 255, 255, 255 ); mConfirmPwdUIText->SetPos( Point(175, 225) ); mConfirmPwdUIText->SetVisible(false); mElements.push_back(mConfirmPwdUIText); UIText *tempText = new UIText("Set Password", 40, 255, 255, 255 ); tempText->SetPos( Point(98,50) ); mElements.push_back(tempText); tempText = new UIText("Press CONFIRM to advance", 18, 255, 255, 255); tempText->SetPos( Point(200, 420) ); mElements.push_back(tempText); UIText* inputMessage = new UIText("Press Direction Keys to Enter Password", 18, 255, 255, 255); inputMessage->SetPos( Point(140, 340) ); mElements.push_back(inputMessage); UIText* backMessage = new UIText("Press CANCEL to Go Back to Profile Selection", 18, 255, 255, 255); backMessage->SetPos( Point(120, 380) ); mElements.push_back(backMessage); }// UISetPasswordLayout
void WebBrowserLauncher::ShowBlockUITip() { CDisplay::CacheDisabler forceDraw; if(m_msgBoxTip) { SafeDeletePointer(m_msgBoxTip); } m_msgBoxTip = new UIMessageBox(GUISystem::GetInstance()->GetTopFullScreenContainer(), StringManager::GetStringById(WEBBROSER_START), MB_WITHOUTBTN); m_msgBoxTip->SetTipText(StringManager::GetStringById(WEBBROSER_START_TIP)); m_msgBoxTip->SetEnableHookTouch(true); UIText* displayText = m_msgBoxTip->GetTextDisplay(); displayText->SetAlign(ALIGN_CENTER); displayText->SetFontSize(GetWindowFontSize(FontSize24Index)); UIText* tipText = m_msgBoxTip->GetTextTip(); tipText->SetFontSize(GetWindowFontSize(FontSize16Index)); tipText->SetAlign(ALIGN_CENTER); m_msgBoxTip->Popup(); CDisplay* display = CDisplay::GetDisplay(); display->ForceDraw(PAINT_FLAG_FULL); }
//---------------------------------------------------------------------------- UIFrame *LP_Manager::AddTabFrame(const std::string &name, const std::string &title) { UIFrame *uiFrame = new0 UIFrame(); uiFrame->SetAnchorHor(0.0f, 1.0f); uiFrame->SetAnchorVer(0.0f, 1.0f); uiFrame->SetActivateSelfCtrled(true); UIFPicBox *fpicBox = new0 UIFPicBox(); uiFrame->AttachChild(fpicBox); fpicBox->LocalTransform.SetTranslateY(-10.0f); fpicBox->SetAnchorHor(0.0f, 1.0f); fpicBox->SetAnchorVer(1.0f, 1.0f); fpicBox->SetPivot(0.5f, 1.0f); fpicBox->SetSize(0.0f, 3.0f); UIPicBox *picBox = fpicBox->GetUIPicBox(); picBox->SetTexture("Data/engine/white.png"); picBox->SetColor(Float3::YELLOW); mTableFrame->AddTab(name, title, uiFrame); UIText *text = mTableFrame->GetTabButton(name)->GetText(); text->SetColorSelfCtrled(true); text->SetBrightnessSelfCtrled(true); text->SetFontScale(0.65f); text->SetFontColor(Float3::WHITE); text->SetColor(Float3::WHITE); text->SetDrawStyle(FD_SHADOW); text->SetBorderShadowAlpha(0.8f); if ("ManyKit" == name) { text->SetFont("DataLauncher/fonts/msyh.ttc", 24, 24); } else { text->SetFont("DataLauncher/fonts/msyhl.ttc", 24, 24); } UIButton *tabBut = mTableFrame->GetTabButton(name); Float3 color = Float3::MakeColor(237, 28, 36); if ("ManyKit" == name) { color = Float3::MakeColor(237, 28, 36); } else if ("Edu" == name) { color = Float3::MakeColor(0, 162, 233); } else if ("Toys" == name) { color = Float3::MakeColor(255, 127, 39); } else if ("Games" == name) { color = Float3::MakeColor(24, 177, 76); } picBox->SetColor(color); tabBut->SetStateColor(UIButtonBase::BS_NORMAL, color); tabBut->SetStateColor(UIButtonBase::BS_HOVERED, color); tabBut->SetStateBrightness(UIButtonBase::BS_HOVERED, 1.2f); tabBut->SetStateColor(UIButtonBase::BS_PRESSED, color); tabBut->SetStateBrightness(UIButtonBase::BS_PRESSED, 1.0f); tabBut->SetActivateColor(color); return uiFrame; }