int TextWidget::Load(XmlSynthElem *elem) { SynthWidget::Load(elem); char *txt; if (elem->GetAttribute("lbl", &txt) == 0) { SetText(txt); delete txt; } if (elem->GetAttribute("fmt", &txt) == 0) { SetFormat(txt); delete txt; } short th; if (elem->GetAttribute("th", th) == 0) SetTextHeight(th); if (elem->GetAttribute("bold", th) == 0) SetBold(th); if (elem->GetAttribute("italic", th) == 0) SetItalic(th); if (elem->GetAttribute("filled", th) == 0) SetFilled(th); if (elem->GetAttribute("align", th) == 0) SetAlign(th); if (elem->GetAttribute("shadow", th) == 0) SetShadow(th); if (elem->GetAttribute("inset", th) == 0) SetInset(th); if (elem->GetAttribute("edit", th) == 0) editable = (int) th; return 0; }
void CControlUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue) { if( _tcscmp(pstrName, _T("id")) == 0 ) SetID(_ttoi(pstrValue)); else if(_tcscmp(pstrName,_T("font")) == 0) SetFont(_ttoi(pstrValue)); else if(_tcscmp(pstrName, _T("name")) == 0) SetName(pstrValue); else if( _tcscmp(pstrName, _T("width")) == 0 ) SetFixedWidth(_ttoi(pstrValue)); else if( _tcscmp(pstrName, _T("height")) == 0 ) SetFixedHeight(_ttoi(pstrValue)); else if( _tcscmp(pstrName, _T("minwidth")) == 0 ) SetMinWidth(_ttoi(pstrValue)); else if( _tcscmp(pstrName, _T("minheight")) == 0 ) SetMinHeight(_ttoi(pstrValue)); else if( _tcscmp(pstrName, _T("maxwidth")) == 0 ) SetMaxWidth(_ttoi(pstrValue)); else if( _tcscmp(pstrName, _T("maxheight")) == 0 ) SetMaxHeight(_ttoi(pstrValue)); else if( _tcscmp(pstrName, _T("inset")) == 0) { RECT rcInset = { 0 }; LPTSTR pstr = NULL; rcInset.left = _tcstol(pstrValue, &pstr, 10); rcInset.top = _tcstol(pstr + 1, &pstr, 10); rcInset.right = _tcstol(pstr + 1, &pstr, 10); rcInset.bottom = _tcstol(pstr + 1, &pstr, 10); SetInset(rcInset); } else if(_tcscmp(pstrName, _T("visible")) == 0){ bool bVisible = _tcscmp(pstrValue, _T("true"))==0; SetVisible(bVisible); } else if(_tcscmp(pstrName, _T("display")) == 0) SetDisplayed(_tcscmp(pstrValue, _T("true"))==0); else{ #ifdef _DEBUG MessageBox(NULL, pstrValue, pstrName, MB_ICONEXCLAMATION); #endif } }
void CContainerUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue) { if( _tcscmp(pstrName, _T("inset")) == 0 ) SetInset(CSize(_ttoi(pstrValue), _ttoi(pstrValue))); else if( _tcscmp(pstrName, _T("padding")) == 0 ) SetPadding(_ttoi(pstrValue)); else if( _tcscmp(pstrName, _T("width")) == 0 ) SetWidth(_ttoi(pstrValue)); else if( _tcscmp(pstrName, _T("height")) == 0 ) SetHeight(_ttoi(pstrValue)); else if( _tcscmp(pstrName, _T("scrollbar")) == 0 ) EnableScrollBar(_tcscmp(pstrValue, _T("true")) == 0); else CControlUI::SetAttribute(pstrName, pstrValue); }
void CContainerUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue) { if( _tcsicmp(pstrName, _T("inset")) == 0 ) { RECT rcInset = { 0 }; LPTSTR pstr = NULL; rcInset.left = _tcstol(pstrValue, &pstr, 10); ASSERT(pstr); rcInset.top = _tcstol(pstr + 1, &pstr, 10); ASSERT(pstr); rcInset.right = _tcstol(pstr + 1, &pstr, 10); ASSERT(pstr); rcInset.bottom = _tcstol(pstr + 1, &pstr, 10); ASSERT(pstr); SetInset(rcInset); } else if( _tcsicmp(pstrName, _T("mousechild")) == 0 ) SetMouseChildEnabled(_tcsicmp(pstrValue, _T("true")) == 0); else if( _tcsicmp(pstrName, _T("vscrollbar")) == 0 ) { EnableScrollBar(_tcsicmp(pstrValue, _T("true")) == 0, GetHorizontalScrollBar() != NULL); } else if( _tcsicmp(pstrName, _T("vscrollbarstyle")) == 0 ) { m_sVerticalScrollBarStyle = pstrValue; EnableScrollBar(TRUE, GetHorizontalScrollBar() != NULL); if( GetVerticalScrollBar() ) { LPCTSTR pStyle = m_pManager->GetStyle(m_sVerticalScrollBarStyle); if( pStyle ) { GetVerticalScrollBar()->ApplyAttributeList(pStyle); } else { GetVerticalScrollBar()->ApplyAttributeList(pstrValue); } } } //else if( _tcsicmp(pstrName, _T("vscrollbarstyle")) == 0 ) { // EnableScrollBar(true, GetHorizontalScrollBar() != NULL); // if( GetVerticalScrollBar() ) GetVerticalScrollBar()->ApplyAttributeList(pstrValue); //} else if( _tcsicmp(pstrName, _T("hscrollbar")) == 0 ) { EnableScrollBar(GetVerticalScrollBar() != NULL, _tcsicmp(pstrValue, _T("true")) == 0); } else if( _tcsicmp(pstrName, _T("hscrollbarstyle")) == 0 ) { m_sHorizontalScrollBarStyle = pstrValue; EnableScrollBar(TRUE, GetHorizontalScrollBar() != NULL); if( GetHorizontalScrollBar() ) { LPCTSTR pStyle = m_pManager->GetStyle(m_sHorizontalScrollBarStyle); if( pStyle ) { GetHorizontalScrollBar()->ApplyAttributeList(pStyle); } else { GetHorizontalScrollBar()->ApplyAttributeList(pstrValue); } } } //else if( _tcsicmp(pstrName, _T("hscrollbarstyle")) == 0 ) { // EnableScrollBar(GetVerticalScrollBar() != NULL, true); // if( GetHorizontalScrollBar() ) GetHorizontalScrollBar()->ApplyAttributeList(pstrValue); //} else if( _tcsicmp(pstrName, _T("childpadding")) == 0 ) SetChildPadding(_ttoi(pstrValue)); else if( _tcsicmp(pstrName, _T("scrollstepsize")) == 0 ) SetScrollStepSize(_ttoi(pstrValue)); else CControlUI::SetAttribute(pstrName, pstrValue); }
CTileLayoutUI::CTileLayoutUI() : m_nColumns(2), m_cyNeeded(0) { SetPadding(10); SetInset(CSize(10, 10)); }
CTabFolderCanvasUI::CTabFolderCanvasUI() { SetInset(CSize(0, 0)); COLORREF clrColor1; m_pManager->GetThemeColorPair(UICOLOR_TAB_FOLDER_NORMAL, clrColor1, m_clrBack); }
CDialogCanvasUI::CDialogCanvasUI() { SetInset(CSize(10, 10)); m_clrBack = m_pManager->GetThemeColor(UICOLOR_DIALOG_BACKGROUND); }
CWhiteCanvasUI::CWhiteCanvasUI() { SetInset(CSize(0, 0)); m_clrBack = m_pManager->GetThemeColor(UICOLOR_STANDARD_WHITE); }
CControlCanvasUI::CControlCanvasUI() { SetInset(CSize(0, 0)); m_clrBack = m_pManager->GetThemeColor(UICOLOR_CONTROL_BACKGROUND_NORMAL); }
CWindowCanvasUI::CWindowCanvasUI() { SetInset(CSize(10, 10)); m_clrBack = m_pManager->GetThemeColor(UICOLOR_WINDOW_BACKGROUND); }
CSearchTitlePanelUI::CSearchTitlePanelUI() : m_iIconIndex(-1) { SetInset(CSize(0, 0)); }
CTaskPanelUI::CTaskPanelUI() : m_hFadeBitmap(NULL) { SetInset(CSize(8, 8)); SetPadding(10); SetWidth(165); // By default it gets a fixed 165 pixel width }
CTabPageUI::CTabPageUI() { SetInset(CSize(6, 6)); }
CGroupBoxUI::CGroupBoxUI(): m_uTextStyle(DT_SINGLELINE | DT_VCENTER | DT_CENTER), m_dwTextColor(0), m_dwDisabledTextColor(0), m_iFont(-1) { SetInset(CDuiRect(20, 25, 20, 20)); ::ZeroMemory(&m_rcTextPadding, sizeof(m_rcTextPadding)); }
CListHeaderUI::CListHeaderUI() { SetInset(CSize(0, 0)); }
SearchTitlePanelUI::SearchTitlePanelUI() : m_iconIdx(-1) { SetInset(CSize(0, 0)); }