diff options
author | pescuma <pescuma@c086bb3d-8645-0410-b8da-73a8550f86e7> | 2009-01-09 02:46:23 +0000 |
---|---|---|
committer | pescuma <pescuma@c086bb3d-8645-0410-b8da-73a8550f86e7> | 2009-01-09 02:46:23 +0000 |
commit | 283ebdc88fe0867c50f56306bf53dcdeec0da013 (patch) | |
tree | abab71b8038f352d2db28390bc2922936b96b19a /Plugins/skins/options.cpp | |
parent | fefa34c8d2d2501ca1ec2e7cd57f98a8816f3939 (diff) |
skins: List of skins and notification on options
git-svn-id: http://pescuma.googlecode.com/svn/trunk/Miranda@126 c086bb3d-8645-0410-b8da-73a8550f86e7
Diffstat (limited to 'Plugins/skins/options.cpp')
-rw-r--r-- | Plugins/skins/options.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
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<std::tstring> 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;
|