void CUISkinSelectorWnd::Init(const char* strSectionName) { R_ASSERT(0 != strSectionName[0]); m_strSection = strSectionName; CUIXml xml_doc; xml_doc.Load(CONFIG_PATH, UI_PATH, "skin_selector.xml"); CUIXmlInit::InitWindow(xml_doc,"skin_selector", 0, this); CUIXmlInit::InitStatic(xml_doc,"skin_selector:caption", 0, m_pCaption); CUIXmlInit::InitStatic(xml_doc,"skin_selector:background", 0, m_pBackground); CUIXmlInit::InitStatic(xml_doc,"skin_selector:image_frames",0, m_pFrames); // CUIXmlInit::Init3tButton(xml_doc,"skin_selector:image_frames:btn_left", 0, m_pButtons[0]); // CUIXmlInit::Init3tButton(xml_doc,"skin_selector:image_frames:btn_right",0, m_pButtons[1]); // CUIXmlInit::InitAnimatedStatic(xml_doc,"skin_selector:image_frames:a_static_1", 0, m_pAnims[0]); // CUIXmlInit::InitAnimatedStatic(xml_doc,"skin_selector:image_frames:a_static_2", 0, m_pAnims[1]); CUIXmlInit::Init3tButton(xml_doc,"skin_selector:btn_spectator", 0,m_pBtnSpectator); CUIXmlInit::Init3tButton(xml_doc,"skin_selector:btn_autoselect",0,m_pBtnAutoSelect); CUIXmlInit::Init3tButton(xml_doc,"skin_selector:btn_back", 0,m_pBtnBack); if (xml_doc.NavigateToNode("skin_selector:skin_shader",0)) m_shader = xml_doc.Read("skin_selector:skin_shader",0,""); InitSkins(); string64 buff; for (int i = 0; i<6; i++) { xr_sprintf(buff,"skin_selector:image_%d",i); CUIXmlInit::InitStatic(xml_doc,buff,0,m_pImage[i]); } UpdateSkins(); }
void CUISkinSelectorWnd::OnKeyRight() { if (m_firstSkin + 4 < (int)m_skins.size()) { m_firstSkin++; UpdateSkins(); } }
void CUISkinSelectorWnd::OnKeyLeft() { if (m_firstSkin > 0) { m_firstSkin--; UpdateSkins(); } }
void CUISkinSelectorWnd::SetCurSkin(int skin){ R_ASSERT2(skin>= -1 && skin <= (int)m_skins.size(), "invalid skin index"); m_iActiveIndex = skin; if (m_iActiveIndex != -1 && (m_iActiveIndex< m_firstSkin || m_iActiveIndex > m_firstSkin + 3)) { if (m_iActiveIndex > (int)m_skins.size() - 4) m_firstSkin = (int)m_skins.size() - 4; else m_firstSkin = m_iActiveIndex; } UpdateSkins(); }
/* ** Called when tab is displayed. ** */ void CDialogManage::CTabSkins::Initialize() { m_Initialized = true; BUTTON_SPLITINFO bsi; bsi.mask = BCSIF_SIZE; bsi.size.cx = 20; bsi.size.cy = 14; HWND item = GetDlgItem(m_Window, IDC_MANAGESKINS_ACTIVESKINS_BUTTON); CDialog::SetMenuButton(item); item = GetDlgItem(m_Window, IDC_MANAGESKINS_DISPLAYMONITOR_BUTTON); CDialog::SetMenuButton(item); // Load folder/.ini icons from shell32 HIMAGELIST hImageList = ImageList_Create(16, 16, ILC_COLOR32, 2, 10); HMODULE hDLL = GetModuleHandle(L"shell32"); HICON hIcon = (HICON)LoadImage(hDLL, MAKEINTRESOURCE(4), IMAGE_ICON, 16, 16, LR_SHARED); ImageList_AddIcon(hImageList, hIcon); hIcon = (HICON)LoadImage(hDLL, MAKEINTRESOURCE(151), IMAGE_ICON, 16, 16, LR_SHARED); ImageList_AddIcon(hImageList, hIcon); // Apply icons and populate tree item = GetDlgItem(m_Window, IDC_MANAGESKINS_SKINS_TREEVIEW); TreeView_SetImageList(item, hImageList, TVSIL_NORMAL); UpdateSkins(NULL); // Get rid of the EDITTEXT control border item = GetDlgItem(m_Window, IDC_MANAGESKINS_DESCRIPTION_TEXT); SetWindowLongPtr(item, GWL_EXSTYLE, GetWindowLongPtr(item, GWL_EXSTYLE) &~ WS_EX_CLIENTEDGE); SetWindowPos(item, NULL, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER); item = GetDlgItem(m_Window, IDC_MANAGESKINS_TRANSPARENCY_COMBOBOX); ComboBox_AddString(item, L"0%"); ComboBox_AddString(item, L"10%"); ComboBox_AddString(item, L"20%"); ComboBox_AddString(item, L"30%"); ComboBox_AddString(item, L"40%"); ComboBox_AddString(item, L"50%"); ComboBox_AddString(item, L"60%"); ComboBox_AddString(item, L"70%"); ComboBox_AddString(item, L"80%"); ComboBox_AddString(item, L"90%"); item = GetDlgItem(m_Window, IDC_MANAGESKINS_ZPOSITION_COMBOBOX); ComboBox_AddString(item, GetString(ID_STR_ONDESKTOP)); ComboBox_AddString(item, GetString(ID_STR_BOTTOM)); ComboBox_AddString(item, GetString(ID_STR_NORMAL)); ComboBox_AddString(item, GetString(ID_STR_TOPMOST)); ComboBox_AddString(item, GetString(ID_STR_STAYTOPMOST)); item = GetDlgItem(m_Window, IDC_MANAGESKINS_ONHOVER_COMBOBOX); ComboBox_AddString(item, GetString(ID_STR_DONOTHING)); ComboBox_AddString(item, GetString(ID_STR_HIDE)); ComboBox_AddString(item, GetString(ID_STR_FADEIN)); ComboBox_AddString(item, GetString(ID_STR_FADEOUT)); m_HandleCommands = true; }
void CUISkinSelectorWnd::Update () { UpdateSkins(); inherited::Update(); }