From 283ebdc88fe0867c50f56306bf53dcdeec0da013 Mon Sep 17 00:00:00 2001 From: pescuma Date: Fri, 9 Jan 2009 02:46:23 +0000 Subject: skins: List of skins and notification on options git-svn-id: http://pescuma.googlecode.com/svn/trunk/Miranda@126 c086bb3d-8645-0410-b8da-73a8550f86e7 --- Plugins/skins/options.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'Plugins/skins/options.cpp') diff --git a/Plugins/skins/options.cpp b/Plugins/skins/options.cpp index eab82c4..730df6d 100644 --- a/Plugins/skins/options.cpp +++ b/Plugins/skins/options.cpp @@ -133,6 +133,15 @@ static BOOL CALLBACK SkinOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA _ASSERT(dlg != NULL); SetWindowLong(hwndDlg, GWL_USERDATA, (LONG) NULL); + std::vector skins; + getAvaiableSkins(skins, dlg); + for(unsigned int i = 0; i < skins.size(); i++) + { + std::tstring &sk = skins[i]; + SendDlgItemMessage(hwndDlg, IDC_SKIN, CB_ADDSTRING, 0, (LONG) skins[i].c_str()); + } + SendDlgItemMessage(hwndDlg, IDC_SKIN, CB_SELECTSTRING, (WPARAM)-1, (LPARAM)dlg->getSkinName()); + HWND skinOptsLabel = GetDlgItem(hwndDlg, IDC_SKIN_OPTS_L); SkinOptions *opts = dlg->getOpts(); @@ -348,6 +357,13 @@ static BOOL CALLBACK SkinOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA if (dlg == NULL) break; + if (LOWORD(wParam) == IDC_SKIN) + { + if (HIWORD(wParam) == CBN_SELCHANGE && (HWND)lParam == GetFocus()) + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); + break; + } + SkinOptions *opts = dlg->getOpts(); if (opts == NULL) break; @@ -431,6 +447,15 @@ static BOOL CALLBACK SkinOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA dlg->storeToDB(opts); + // TODO Correctly handle changing skins + int pos = SendDlgItemMessage(hwndDlg, IDC_SKIN, CB_GETCURSEL, 0, 0); + if (pos != CB_ERR) + { + TCHAR tmp[1024]; + GetWindowText(GetDlgItem(hwndDlg, IDC_SKIN), tmp, MAX_REGS(tmp)); + dlg->setSkinName(tmp); + } + return TRUE; } break; -- cgit v1.2.3