CUICustomEdit::CUICustomEdit() { m_max_symb_count = u32(-1); char l_c; for(l_c = 'a'; l_c <= 'z'; ++l_c) gs_DIK2CHR[DILetters[l_c-'a']] = l_c; for(l_c = '0'; l_c <= '9'; ++l_c) gs_DIK2CHR[DILetters['z'-'a'+l_c+1-'0']] = l_c; m_bShift = false; m_bInputFocus = false; m_iKeyPressAndHold = 0; m_bHoldWaitMode = false; m_lines.SetVTextAlignment(valCenter); m_lines.SetColoringMode(false); m_lines.SetCutWordsMode(true); m_lines.SetUseNewLineMode(false); SetText(""); m_textPos.set(3,0); m_bNumbersOnly = false; m_bFloatNumbers = false; m_bFocusByDbClick = false; m_textColor[0]=color_argb(255,235,219,185); m_textColor[1]=color_argb(255,100,100,100); }
CUICustomSpin::CUICustomSpin() { m_pFrameLine = xr_new<CUIFrameLineWnd>(); m_pBtnUp = xr_new<CUI3tButton>(); m_pBtnDown = xr_new<CUI3tButton>(); m_pLines = xr_new<CUILines>(); m_pFrameLine->SetAutoDelete (true); m_pBtnUp->SetAutoDelete (true); m_pBtnDown->SetAutoDelete (true); AttachChild (m_pFrameLine); AttachChild (m_pBtnUp); AttachChild (m_pBtnDown); m_pLines->SetTextAlignment (CGameFont::alLeft); m_pLines->SetVTextAlignment (valCenter); m_pLines->SetFont (UI().Font().pFontLetterica16Russian); m_pLines->SetTextColor (color_argb(255,235,219,185)); m_time_begin = 0; m_p_delay = 500; m_u_delay = 0; m_textColor[0] = color_argb(255,235,219,185); m_textColor[1] = color_argb(255,100,100,100); }
CUIListItemEx::CUIListItemEx(void) { //. this->InitTexture("ui\\hud_map_point"); //. this->SetStretchTexture(true); this->m_dwSelectionColor = color_argb(200, 95, 82, 74); this->SetColor(color_argb(0, 0, 0, 0)); }
// %c[255,255,255,255] u32 CUILines::GetColorFromText(const xr_string& str)const { // typedef xr_string::size_type size; StrSize begin, end, comma1_pos, comma2_pos, comma3_pos; begin = str.find(BEGIN); end = str.find(END, begin); R_ASSERT2(npos != begin, "CUISubLine::GetColorFromText -- can't find beginning tag %c["); R_ASSERT2(npos != end, "CUISubLine::GetColorFromText -- can't find ending tag ]"); // try default color if (npos != str.find("%c[default]", begin, end - begin)) return m_dwTextColor; // Try predefined in XML colors // CUIXmlInit xml; for (CUIXmlInit::ColorDefs::const_iterator it = CUIXmlInit::GetColorDefs()->begin(); it != CUIXmlInit::GetColorDefs()->end(); ++it) { int cmp = str.compare(begin+3, end-begin-3, *it->first); if (cmp == 0) return it->second; } // try parse values separated by commas comma1_pos = str.find(",", begin); comma2_pos = str.find(",", comma1_pos + 1); comma3_pos = str.find(",", comma2_pos + 1); R_ASSERT2(npos != comma1_pos, "CUISubLine::GetColorFromText -- can't find first comma"); R_ASSERT2(npos != comma2_pos, "CUISubLine::GetColorFromText -- can't find second comma"); R_ASSERT2(npos != comma3_pos, "CUISubLine::GetColorFromText -- can't find third comma"); u32 a, r, g, b; xr_string single_color; begin+=3; single_color = str.substr(begin, comma1_pos - 1); a = atoi(single_color.c_str()); single_color = str.substr(comma1_pos + 1, comma2_pos - 1); r = atoi(single_color.c_str()); single_color = str.substr(comma2_pos + 1, comma3_pos - 1); g = atoi(single_color.c_str()); single_color = str.substr(comma3_pos + 1, end - 1); b = atoi(single_color.c_str()); return color_argb(a,r,g,b); }
void CUIListItemEx::SendMessage(CUIWindow* pWnd, s16 msg, void* pData){ //inherited::SendMessage(pWnd, msg, pData); switch (msg) { case LIST_ITEM_SELECT: this->SetColor(m_dwSelectionColor); // this->Draw(); break; case LIST_ITEM_UNSELECT: this->SetColor(color_argb(0, 0, 0, 0)); // this->Draw(); break; } }
CUIFrameLineWnd::CUIFrameLineWnd() :bHorizontal(true), m_bTextureVisible(false) { m_texture_color = color_argb(255,255,255,255); }
CUIFrameWindow::CUIFrameWindow() :m_bTextureVisible(false) { m_texture_color = color_argb(255,255,255,255); }