summaryrefslogtreecommitdiff
path: root/plugins/Popup/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Popup/src')
-rw-r--r--plugins/Popup/src/opt_adv.cpp119
-rw-r--r--plugins/Popup/src/opt_skins.cpp345
2 files changed, 199 insertions, 265 deletions
diff --git a/plugins/Popup/src/opt_adv.cpp b/plugins/Popup/src/opt_adv.cpp
index 3469238530..44fae7fca9 100644
--- a/plugins/Popup/src/opt_adv.cpp
+++ b/plugins/Popup/src/opt_adv.cpp
@@ -25,8 +25,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
HWND hwndBox = NULL;
-INT_PTR CALLBACK AvatarTrackBarWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-INT_PTR CALLBACK AlphaTrackBarWndProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
+LRESULT CALLBACK AvatarTrackBarWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
+LRESULT CALLBACK AlphaTrackBarWndProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
//effekt name for drop down box
LIST<TCHAR> g_lstPopupVfx(5, _tcsicmp);
@@ -121,8 +121,7 @@ INT_PTR CALLBACK DlgProcPopUpAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
SetDlgItemInt(hwnd, IDC_AVT_RADIUS, PopUpOptions.avatarRadius, FALSE);
SendDlgItemMessage(hwnd, IDC_AVT_RADIUS_SPIN,UDM_SETRANGE, 0, (LPARAM)MAKELONG((PopUpOptions.avatarSize / 2),0));
//Size
- SetWindowLongPtr(GetDlgItem(hwnd, IDC_AVT_SIZE_SLIDE), GWLP_USERDATA, GetWindowLongPtr(GetDlgItem(hwnd, IDC_AVT_SIZE_SLIDE), GWLP_WNDPROC));
- SetWindowLongPtr(GetDlgItem(hwnd, IDC_AVT_SIZE_SLIDE), GWLP_WNDPROC, (LONG_PTR)AvatarTrackBarWndProc);
+ mir_subclassWindow(GetDlgItem(hwnd, IDC_AVT_SIZE_SLIDE), AvatarTrackBarWndProc);
SendDlgItemMessage(hwnd, IDC_AVT_SIZE_SLIDE, TBM_SETRANGE,FALSE,
MAKELONG(SETTING_AVTSIZE_MIN, SETTING_AVTSIZE_MAX));
@@ -577,22 +576,21 @@ INT_PTR CALLBACK DlgProcPopUpAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
return FALSE;
}
-INT_PTR CALLBACK AvatarTrackBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+LRESULT CALLBACK AvatarTrackBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
if (!IsWindowEnabled(hwnd))
- return CallWindowProc((WNDPROC)GetWindowLongPtr(hwnd, GWLP_USERDATA), hwnd, msg, wParam, lParam);
+ return mir_callNextSubclass(hwnd, AvatarTrackBarWndProc, msg, wParam, lParam);
static int oldVal = -1;
switch (msg) {
- case WM_MOUSEWHEEL:
- case WM_KEYDOWN:
- case WM_KEYUP:
- {
- if (!IsWindowVisible(hwndBox))
- break;
- }
- case WM_MOUSEMOVE:
- {
+ case WM_MOUSEWHEEL:
+ case WM_KEYDOWN:
+ case WM_KEYUP:
+ if (!IsWindowVisible(hwndBox))
+ break;
+
+ case WM_MOUSEMOVE:
+ {
TRACKMOUSEEVENT tme;
tme.cbSize = sizeof(tme);
tme.dwFlags = TME_LEAVE;
@@ -615,69 +613,31 @@ INT_PTR CALLBACK AvatarTrackBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
InvalidateRect(hwndBox, NULL, FALSE);
oldVal = newVal;
}
- }
- break;
- case WM_MOUSELEAVE:
- {
-/*
- SetWindowLongPtr(hwndBox, GWLP_USERDATA, 2);
- SetWindowPos(hwndBox, NULL,
- 0, 0, 201, 201,
- SWP_NOACTIVATE|SWP_DEFERERASE|SWP_NOSENDCHANGING|SWP_SHOWWINDOW);
-
- HRGN hrgnWindow, hrgnTmp, hrgnTmp2;
- hrgnWindow = CreateRectRgn(0, 0, 201, 201);
- hrgnTmp = CreateEllipticRgn(-90, -90, 90, 90);
- SubtractRgn(hrgnWindow, hrgnWindow, hrgnTmp);
- hrgnTmp = CreateEllipticRgn(112, -90, 292, 90);
- SubtractRgn(hrgnWindow, hrgnWindow, hrgnTmp);
- hrgnTmp = CreateEllipticRgn(-90, 112, 90, 292);
- SubtractRgn(hrgnWindow, hrgnWindow, hrgnTmp);
- hrgnTmp = CreateEllipticRgn(112, 112, 292, 292);
- SubtractRgn(hrgnWindow, hrgnWindow, hrgnTmp);
-
- hrgnTmp = CreateRectRgn(5, 5, 196, 196);
- hrgnTmp2 = CreateRoundRectRgn(89, 0, 113, 201, 8, 8);
- UnionRgn(hrgnTmp, hrgnTmp, hrgnTmp2);
- hrgnTmp2 = CreateRoundRectRgn(0, 89, 201, 113, 8, 8);
- UnionRgn(hrgnTmp, hrgnTmp, hrgnTmp2);
- IntersectRgn(hrgnWindow, hrgnWindow, hrgnTmp);
-
- SetWindowRgn(hwndBox, hrgnWindow, FALSE);
-
- if (MySetLayeredWindowAttributes)
- {
- SetWindowLongPtr(hwndBox, GWL_EXSTYLE, GetWindowLongPtr(hwndBox, GWL_EXSTYLE) | WS_EX_LAYERED);
- MySetLayeredWindowAttributes(hwndBox, NULL, PopUpOptions.Alpha, LWA_ALPHA);
- }
-*/
- SetWindowRgn(hwndBox, NULL, TRUE);
- ShowWindow(hwndBox, SW_HIDE);
- oldVal = -1;
- }
- break;
- default:
- break;
+ }
+ break;
+ case WM_MOUSELEAVE:
+ SetWindowRgn(hwndBox, NULL, TRUE);
+ ShowWindow(hwndBox, SW_HIDE);
+ oldVal = -1;
+ break;
}
- return CallWindowProc((WNDPROC)GetWindowLongPtr(hwnd, GWLP_USERDATA), hwnd, msg, wParam, lParam);
+ return mir_callNextSubclass(hwnd, AvatarTrackBarWndProc, msg, wParam, lParam);
}
-INT_PTR CALLBACK AlphaTrackBarWndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+LRESULT CALLBACK AlphaTrackBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
if (!IsWindowEnabled(hwnd))
- return CallWindowProc((WNDPROC)GetWindowLongPtr(hwnd, GWLP_USERDATA), hwnd, msg, wParam, lParam);
+ return mir_callNextSubclass(hwnd, AlphaTrackBarWndProc, msg, wParam, lParam);
static int oldVal = -1;
- switch (msg)
- {
- case WM_MOUSEWHEEL:
- case WM_KEYDOWN:
- case WM_KEYUP:
- {
- if (!IsWindowVisible(hwndBox))
- break;
- }
- case WM_MOUSEMOVE:
+ switch (msg) {
+ case WM_MOUSEWHEEL:
+ case WM_KEYDOWN:
+ case WM_KEYUP:
+ if (!IsWindowVisible(hwndBox))
+ break;
+
+ case WM_MOUSEMOVE:
{
TRACKMOUSEEVENT tme;
tme.cbSize = sizeof(tme);
@@ -706,17 +666,14 @@ INT_PTR CALLBACK AlphaTrackBarWndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARA
}
break;
}
- case WM_MOUSELEAVE:
- {
-
- SetWindowLongPtr(hwndBox, GWL_EXSTYLE, GetWindowLongPtr(hwndBox, GWL_EXSTYLE) & ~WS_EX_LAYERED);
- SetLayeredWindowAttributes(hwndBox, NULL, 255, LWA_ALPHA);
+ case WM_MOUSELEAVE:
+ SetWindowLongPtr(hwndBox, GWL_EXSTYLE, GetWindowLongPtr(hwndBox, GWL_EXSTYLE) & ~WS_EX_LAYERED);
+ SetLayeredWindowAttributes(hwndBox, NULL, 255, LWA_ALPHA);
- ShowWindow(hwndBox, SW_HIDE);
- oldVal = -1;
- break;
- }
+ ShowWindow(hwndBox, SW_HIDE);
+ oldVal = -1;
+ break;
}
- return CallWindowProc((WNDPROC)GetWindowLongPtr(hwnd, GWLP_USERDATA), hwnd, msg, wParam, lParam);
+ return mir_callNextSubclass(hwnd, AlphaTrackBarWndProc, msg, wParam, lParam);
}
diff --git a/plugins/Popup/src/opt_skins.cpp b/plugins/Popup/src/opt_skins.cpp
index 62996597e2..3110a6283b 100644
--- a/plugins/Popup/src/opt_skins.cpp
+++ b/plugins/Popup/src/opt_skins.cpp
@@ -149,35 +149,29 @@ static void DrawPreview(HWND hwnd, HDC hdc)
FrameRect(hdc, &rc, GetStockBrush(LTGRAY_BRUSH));
}
-static WNDPROC WndProcPreviewBoxSave;
LRESULT CALLBACK WndProcPreviewBox(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
if (!wndPreview)
- return CallWindowProc(WndProcPreviewBoxSave, hwnd, msg, wParam, lParam);
+ return mir_callNextSubclass(hwnd, WndProcPreviewBox, msg, wParam, lParam);
- switch (msg)
- {
- case WM_PAINT:
- {
- if (GetUpdateRect(hwnd, 0, FALSE))
- {
- PAINTSTRUCT ps;
- HDC hdc = BeginPaint(hwnd, &ps);
- DrawPreview(hwnd, hdc);
- EndPaint(hwnd, &ps);
- return 0;
- }
- }
-
- case WM_PRINT:
- case WM_PRINTCLIENT:
+ switch (msg) {
+ case WM_PAINT:
+ if (GetUpdateRect(hwnd, 0, FALSE))
{
- HDC hdc = (HDC)wParam;
+ PAINTSTRUCT ps;
+ HDC hdc = BeginPaint(hwnd, &ps);
DrawPreview(hwnd, hdc);
+ EndPaint(hwnd, &ps);
return 0;
}
+
+ case WM_PRINT:
+ case WM_PRINTCLIENT:
+ HDC hdc = (HDC)wParam;
+ DrawPreview(hwnd, hdc);
+ return 0;
}
- return CallWindowProc(WndProcPreviewBoxSave, hwnd, msg, wParam, lParam);
+ return mir_callNextSubclass(hwnd, WndProcPreviewBox, msg, wParam, lParam);
}
int SkinOptionList_AddSkin(OPTTREE_OPTION* &options, int *OptionsCount, int pos, DWORD *dwGlobalOptions) {
@@ -332,26 +326,24 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
}
else if (lstrcmp(skinOptions[index].pszSettingName, _T("Global settings")) == 0) {
switch (skinOptions[index].dwFlag) {
- case (1 << 0):
- PopUpOptions.DisplayTime = skinOptions[index].bState;
- break;
- case (1 << 1):
- PopUpOptions.DropShadow = skinOptions[index].bState;
- break;
- case (1 << 2):
- PopUpOptions.EnableFreeformShadows = skinOptions[index].bState;
- break;
- case (1 << 3):
- PopUpOptions.EnableAeroGlass = skinOptions[index].bState;
- break;
- case (1 << 4):
- PopUpOptions.UseWinColors = skinOptions[index].bState;
- break;
- case (1 << 5):
- PopUpOptions.UseMText = skinOptions[index].bState;
- break;
- default:
- break;
+ case (1 << 0):
+ PopUpOptions.DisplayTime = skinOptions[index].bState;
+ break;
+ case (1 << 1):
+ PopUpOptions.DropShadow = skinOptions[index].bState;
+ break;
+ case (1 << 2):
+ PopUpOptions.EnableFreeformShadows = skinOptions[index].bState;
+ break;
+ case (1 << 3):
+ PopUpOptions.EnableAeroGlass = skinOptions[index].bState;
+ break;
+ case (1 << 4):
+ PopUpOptions.UseWinColors = skinOptions[index].bState;
+ break;
+ case (1 << 5):
+ PopUpOptions.UseMText = skinOptions[index].bState;
+ break;
}
}
updatePreviewImage(GetDlgItem(hwndDlg, IDC_PREVIEWBOX));
@@ -360,8 +352,8 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
}
switch (msg) {
- case WM_INITDIALOG:
- {
+ case WM_INITDIALOG:
+ {
HWND hCtrl = NULL;
DWORD dwIndex = 0;
@@ -385,7 +377,7 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
SkinOptionList_Update (skinOptions, &skinOptionsCount, hwndDlg);
//PreviewBox
- WndProcPreviewBoxSave = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_PREVIEWBOX), GWLP_WNDPROC, (LONG_PTR)WndProcPreviewBox);
+ mir_subclassWindow(GetDlgItem(hwndDlg, IDC_PREVIEWBOX), WndProcPreviewBox);
updatePreviewImage(GetDlgItem(hwndDlg, IDC_PREVIEWBOX));
//hooks
@@ -393,164 +385,149 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
TranslateDialogDefault(hwndDlg);
bDlgInit = true;
- }
- return TRUE;
+ }
+ return TRUE;
- case WM_USER:
- {
- updatePreviewImage(GetDlgItem(hwndDlg, IDC_PREVIEWBOX));
- }
- return TRUE;
+ case WM_USER:
+ updatePreviewImage(GetDlgItem(hwndDlg, IDC_PREVIEWBOX));
+ return TRUE;
- case WM_COMMAND: {
+ case WM_COMMAND:
+ {
HWND hCtrl = NULL;
UINT idCtrl = LOWORD(wParam);
switch (HIWORD(wParam)) {
- case BN_KILLFOCUS: //Button controls
- case BN_SETFOCUS: //Button controls
- return TRUE;
+ case BN_KILLFOCUS: //Button controls
+ case BN_SETFOCUS: //Button controls
+ return TRUE;
+ break;
+ case BN_CLICKED: //Button controls
+ switch(idCtrl) {
+ case IDC_PREVIEW:
+ PopUpPreview();
break;
- case BN_CLICKED: //Button controls
- switch(idCtrl)
+
+ case IDC_BTN_RELOAD:
{
- case IDC_PREVIEW:
- {
- PopUpPreview();
- }
- break;
- case IDC_BTN_RELOAD:
- {
- LPTSTR Temp = NULL;
- DWORD dwIndex = 0;
- TCHAR szNewSkin[128];
- LPTSTR pszOldSkin = mir_tstrdup(PopUpOptions.SkinPack);
- skins.load(_T(""));
- hCtrl = GetDlgItem(hwndDlg, IDC_SKINLIST);
- ListBox_ResetContent(hCtrl);
- for (const Skins::SKINLIST *sl = skins.getSkinList(); sl; sl = sl->next)
- {
- dwIndex = ListBox_AddString(hCtrl, sl->name);
- ListBox_SetItemData(hCtrl, dwIndex, sl->name);
- }
- ListBox_SetCurSel(hCtrl, ListBox_FindString(hCtrl, 0, PopUpOptions.SkinPack));
- //make shure we have select skin (ListBox_SetCurSel may be fail)
- ListBox_GetText(hCtrl, ListBox_GetCurSel(hCtrl), &szNewSkin);
- if (lstrcmp(pszOldSkin, szNewSkin) != 0) {
- mir_free(PopUpOptions.SkinPack);
- PopUpOptions.SkinPack = mir_tstrdup(szNewSkin);
- }
- mir_free(pszOldSkin);
-
- const PopupSkin *skin = 0;
- if (skin = skins.getSkin(PopUpOptions.SkinPack)) {
- //update Skin Option List from reload SkinPack
- bDlgInit = false;
- bDlgInit = SkinOptionList_Update (skinOptions, &skinOptionsCount, hwndDlg);
- }
-
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }//end IDC_BTN_RELOAD:
- break;
- case IDC_GETSKINS:
- CallService(MS_UTILS_OPENURL,0,(LPARAM)"http://miranda-ng.org/");
- break;
- default:
- break;
- }//end switch(idCtrl)
- updatePreviewImage(GetDlgItem(hwndDlg, IDC_PREVIEWBOX));
- break;
- case CBN_SELCHANGE: //combo box controls
- switch(idCtrl) {
- case IDC_SKINLIST: {
- //Skin list change
+ LPTSTR Temp = NULL;
+ DWORD dwIndex = 0;
+ TCHAR szNewSkin[128];
+ LPTSTR pszOldSkin = mir_tstrdup(PopUpOptions.SkinPack);
+ skins.load(_T(""));
+ hCtrl = GetDlgItem(hwndDlg, IDC_SKINLIST);
+ ListBox_ResetContent(hCtrl);
+ for (const Skins::SKINLIST *sl = skins.getSkinList(); sl; sl = sl->next)
+ {
+ dwIndex = ListBox_AddString(hCtrl, sl->name);
+ ListBox_SetItemData(hCtrl, dwIndex, sl->name);
+ }
+ ListBox_SetCurSel(hCtrl, ListBox_FindString(hCtrl, 0, PopUpOptions.SkinPack));
+ //make shure we have select skin (ListBox_SetCurSel may be fail)
+ ListBox_GetText(hCtrl, ListBox_GetCurSel(hCtrl), &szNewSkin);
+ if (lstrcmp(pszOldSkin, szNewSkin) != 0) {
mir_free(PopUpOptions.SkinPack);
- PopUpOptions.SkinPack = mir_tstrdup((TCHAR *)SendDlgItemMessage(
- hwndDlg,
- IDC_SKINLIST,
- LB_GETITEMDATA,
- (WPARAM)SendDlgItemMessage(hwndDlg, IDC_SKINLIST, LB_GETCURSEL,0,0),
- 0));
- const PopupSkin *skin = 0;
- if (skin = skins.getSkin(PopUpOptions.SkinPack)) {
- mir_free(PopUpOptions.SkinPack);
- PopUpOptions.SkinPack = mir_tstrdup(skin->getName());
-
- //update Skin Option List
- bDlgInit = false;
- bDlgInit = SkinOptionList_Update (skinOptions, &skinOptionsCount, hwndDlg);
- }
- updatePreviewImage(GetDlgItem(hwndDlg, IDC_PREVIEWBOX));
- }
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
- default:
- break;
- }//end switch(idCtrl)
- break;
- default:
- break;
- }//end switch (HIWORD(wParam))
- break;
- }// end WM_COMMAND
- return FALSE;
+ PopUpOptions.SkinPack = mir_tstrdup(szNewSkin);
+ }
+ mir_free(pszOldSkin);
- case WM_NOTIFY: {
- if (!bDlgInit) return FALSE;
- switch (((LPNMHDR)lParam)->idFrom) {
- case 0: {
- switch (((LPNMHDR)lParam)->code) {
- case PSN_RESET:
- LoadOption_Skins();
- return TRUE;
- case PSN_APPLY:
- { //skin pack
- DBWriteContactSettingTString(NULL, MODULNAME, "SkinPack", PopUpOptions.SkinPack);
- //skin options
const PopupSkin *skin = 0;
- if (skin = skins.getSkin(PopUpOptions.SkinPack))
- skin->saveOpts();
- skins.freeAllButActive();
- //more Skin options
- DBWriteContactSettingByte(NULL, MODULNAME, "DisplayTime", PopUpOptions.DisplayTime);
- DBWriteContactSettingByte(NULL, MODULNAME, "DropShadow", PopUpOptions.DropShadow);
- DBWriteContactSettingByte(NULL, MODULNAME, "EnableShadowRegion", PopUpOptions.EnableFreeformShadows);
- DBWriteContactSettingByte(NULL, MODULNAME, "EnableAeroGlass", PopUpOptions.EnableAeroGlass);
- DBWriteContactSettingByte(NULL, MODULNAME, "UseMText", PopUpOptions.UseMText);
- }//end PSN_APPLY:
- return TRUE;
+ if (skin = skins.getSkin(PopUpOptions.SkinPack)) {
+ //update Skin Option List from reload SkinPack
+ bDlgInit = false;
+ bDlgInit = SkinOptionList_Update (skinOptions, &skinOptionsCount, hwndDlg);
+ }
+
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ }//end IDC_BTN_RELOAD:
+ break;
+ case IDC_GETSKINS:
+ CallService(MS_UTILS_OPENURL,0,(LPARAM)"http://miranda-ng.org/");
+ break;
default:
break;
- }//switch (((LPNMHDR)lParam)->code)
- }// end case 0:
- break;
- default:
+ }//end switch(idCtrl)
+ updatePreviewImage(GetDlgItem(hwndDlg, IDC_PREVIEWBOX));
break;
- }//end switch (((LPNMHDR)lParam)->idFrom)
- }//end WM_NOTIFY:
- return FALSE;
+ case CBN_SELCHANGE: //combo box controls
+ switch(idCtrl) {
+ case IDC_SKINLIST:
+ {
+ //Skin list change
+ mir_free(PopUpOptions.SkinPack);
+ PopUpOptions.SkinPack = mir_tstrdup((TCHAR *)SendDlgItemMessage(
+ hwndDlg,
+ IDC_SKINLIST,
+ LB_GETITEMDATA,
+ (WPARAM)SendDlgItemMessage(hwndDlg, IDC_SKINLIST, LB_GETCURSEL,0,0),
+ 0));
+ const PopupSkin *skin = 0;
+ if (skin = skins.getSkin(PopUpOptions.SkinPack)) {
+ mir_free(PopUpOptions.SkinPack);
+ PopUpOptions.SkinPack = mir_tstrdup(skin->getName());
- case WM_DESTROY:
- {
- if (wndPreview) {
- delete wndPreview;
- wndPreview = NULL;
- gPreviewOk = false;
- }
- if (hhkFontsReload) UnhookEvent(hhkFontsReload);
- if (skinOptions) {
- for (int i=0; i < skinOptionsCount; ++i) {
- mir_free(skinOptions[i].pszOptionName);
- mir_free(skinOptions[i].pszSettingName);
+ //update Skin Option List
+ bDlgInit = false;
+ bDlgInit = SkinOptionList_Update (skinOptions, &skinOptionsCount, hwndDlg);
+ }
+ updatePreviewImage(GetDlgItem(hwndDlg, IDC_PREVIEWBOX));
}
- mir_free(skinOptions);
- skinOptions = NULL;
- skinOptionsCount = 0;
- }
- }
- return TRUE;
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ }//end switch(idCtrl)
+ break;
+ }//end switch (HIWORD(wParam))
+ break;
+ }// end WM_COMMAND
+ return FALSE;
+
+ case WM_NOTIFY:
+ if (!bDlgInit) return FALSE;
+ switch (((LPNMHDR)lParam)->idFrom) {
+ case 0:
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_RESET:
+ LoadOption_Skins();
+ return TRUE;
- default:
+ case PSN_APPLY:
+ {
+ //skin pack
+ DBWriteContactSettingTString(NULL, MODULNAME, "SkinPack", PopUpOptions.SkinPack);
+ //skin options
+ const PopupSkin *skin = 0;
+ if (skin = skins.getSkin(PopUpOptions.SkinPack))
+ skin->saveOpts();
+ skins.freeAllButActive();
+ //more Skin options
+ DBWriteContactSettingByte(NULL, MODULNAME, "DisplayTime", PopUpOptions.DisplayTime);
+ DBWriteContactSettingByte(NULL, MODULNAME, "DropShadow", PopUpOptions.DropShadow);
+ DBWriteContactSettingByte(NULL, MODULNAME, "EnableShadowRegion", PopUpOptions.EnableFreeformShadows);
+ DBWriteContactSettingByte(NULL, MODULNAME, "EnableAeroGlass", PopUpOptions.EnableAeroGlass);
+ DBWriteContactSettingByte(NULL, MODULNAME, "UseMText", PopUpOptions.UseMText);
+ }//end PSN_APPLY:
+ return TRUE;
+ }//switch (((LPNMHDR)lParam)->code)
break;
+ }//end switch (((LPNMHDR)lParam)->idFrom)
+ return FALSE;
+
+ case WM_DESTROY:
+ if (wndPreview) {
+ delete wndPreview;
+ wndPreview = NULL;
+ gPreviewOk = false;
+ }
+ if (hhkFontsReload) UnhookEvent(hhkFontsReload);
+ if (skinOptions) {
+ for (int i=0; i < skinOptionsCount; ++i) {
+ mir_free(skinOptions[i].pszOptionName);
+ mir_free(skinOptions[i].pszSettingName);
+ }
+ mir_free(skinOptions);
+ skinOptions = NULL;
+ skinOptionsCount = 0;
+ }
+ return TRUE;
}//end switch (msg)
return FALSE;
}