summaryrefslogtreecommitdiff
path: root/plugins/Popup/src/opt_skins.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Popup/src/opt_skins.cpp')
-rw-r--r--plugins/Popup/src/opt_skins.cpp96
1 files changed, 48 insertions, 48 deletions
diff --git a/plugins/Popup/src/opt_skins.cpp b/plugins/Popup/src/opt_skins.cpp
index c859e7f620..6fa00b6af1 100644
--- a/plugins/Popup/src/opt_skins.cpp
+++ b/plugins/Popup/src/opt_skins.cpp
@@ -40,7 +40,7 @@ void RegisterOptPrevBox()
wcl.hInstance = hInst;
wcl.hIcon = NULL;
wcl.hCursor = LoadCursor(NULL, IDC_ARROW);
- wcl.hbrBackground = NULL; //(HBRUSH)GetStockObject(LTGRAY_BRUSH);
+ wcl.hbrBackground = NULL; // (HBRUSH)GetStockObject(LTGRAY_BRUSH);
wcl.lpszMenuName = NULL;
wcl.lpszClassName = _T(BOXPREVIEW_WNDCLASS);
wcl.hIconSm = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_POPUP), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);
@@ -52,8 +52,8 @@ void RegisterOptPrevBox()
MSGERROR(msg);
}
- // register custom class for dialog box with drop-shadow attribute
- // "#32770" stays for class name of default system dialog box
+ // register custom class for dialog box with drop-shadow attribute
+ // "#32770" stays for class name of default system dialog box
GetClassInfoEx(hInst, _T("#32770"), &wcl);
wcl.hInstance = hInst;
wcl.lpszClassName = _T("PopupPlusDlgBox");
@@ -189,9 +189,9 @@ int SkinOptionList_AddSkin(OPTTREE_OPTION* &options, int *OptionsCount, int pos
options[pos].pszOptionName = (LPTSTR)mir_alloc(sizeof(TCHAR)*(
mir_tstrlen(options[pos].pszSettingName)+
mir_strlen(skin->getFlagName(i)) +10 ));
- wsprintf(options[pos].pszOptionName, _T("%s/%hs"), options[pos].pszSettingName, skin->getFlagName(i)); //!!!!!!!!!!!!!
+ wsprintf(options[pos].pszOptionName, _T("%s/%hs"), options[pos].pszSettingName, skin->getFlagName(i)); // !!!!!!!!!!!!!
options[pos].bState = skin->getFlag(i) ? TRUE : FALSE;
- options[pos].Data = i; //skin flag index
+ options[pos].Data = i; // skin flag index
*dwGlobalOptions |= skin->getFlag(i) ? (1 << (i-1)) : 0;
pos++;
}
@@ -199,7 +199,7 @@ int SkinOptionList_AddSkin(OPTTREE_OPTION* &options, int *OptionsCount, int pos
return pos;
}
-/////////////////////////////////////////////////////////////////////////////////////////
+// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /
static LPTSTR mainOption [] = {
LPGENT("Show clock"),
@@ -250,7 +250,7 @@ int SkinOptionList_AddMain(OPTTREE_OPTION* &options, int *OptionsCount, int pos,
options[pos].pszOptionName = (LPTSTR)mir_alloc(sizeof(TCHAR)*(
mir_tstrlen(options[pos].pszSettingName)+
mir_tstrlen(mainOption[i]) + 10));
- wsprintf(options[pos].pszOptionName, _T("%s/%s"), options[pos].pszSettingName, mainOption[i]); //!!!!!!!!!!!!!
+ wsprintf(options[pos].pszOptionName, _T("%s/%s"), options[pos].pszSettingName, mainOption[i]); // !!!!!!!!!!!!!
options[pos].bState = bCheck;
pos++;
}
@@ -269,23 +269,23 @@ bool SkinOptionList_Update (OPTTREE_OPTION* &options, int *OptionsCount, HWND hw
options = NULL;
*OptionsCount = 0;
}
- //add "Global options"
+ // add "Global options"
DWORD dwGlobalOptions = 0;
int pos = SkinOptionList_AddMain(options, OptionsCount, 0, &dwGlobalOptions);
- //add "Skin options"
+ // add "Skin options"
DWORD dwSkinOptions = 0;
pos = SkinOptionList_AddSkin(options, OptionsCount, pos, &dwSkinOptions);
- //generate treeview
+ // generate treeview
int index = -1;
OptTree_ProcessMessage(hwndDlg, WM_INITDIALOG, 0, 0, &index, IDC_SKIN_LIST_OPT, options, *OptionsCount);
- //check "Skin options" state
+ // check "Skin options" state
char prefix[128];
mir_snprintf(prefix, SIZEOF(prefix),"skin.%S", PopupOptions.SkinPack);
OptTree_SetOptions(hwndDlg, IDC_SKIN_LIST_OPT, options, *OptionsCount,
db_get_dw(NULL, MODULNAME, prefix, dwSkinOptions), _T("Skin options"));
- //check "Global Settings"
+ // check "Global Settings"
OptTree_SetOptions(hwndDlg, IDC_SKIN_LIST_OPT, options, *OptionsCount,
dwGlobalOptions, _T("Global settings"));
@@ -293,9 +293,9 @@ bool SkinOptionList_Update (OPTTREE_OPTION* &options, int *OptionsCount, HWND hw
}
void LoadOption_Skins() {
- //skin pack
+ // skin pack
PopupOptions.SkinPack = (LPTSTR)DBGetContactSettingStringX(NULL,MODULNAME, "SkinPack", "* Popup Classic",DBVT_TCHAR);
- //more Skin options
+ // more Skin options
PopupOptions.DisplayTime = db_get_b(NULL,MODULNAME, "DisplayTime", TRUE);
PopupOptions.DropShadow = db_get_b(NULL,MODULNAME, "DropShadow", TRUE);
PopupOptions.EnableFreeformShadows = db_get_b(NULL,MODULNAME, "EnableShadowRegion", 1);
@@ -306,7 +306,7 @@ void LoadOption_Skins() {
INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- static bool bDlgInit = false; //some controls send WM_COMMAND before or during WM_INITDIALOG
+ static bool bDlgInit = false; // some controls send WM_COMMAND before or during WM_INITDIALOG
static HANDLE hhkFontsReload = 0;
static OPTTREE_OPTION *skinOptions = NULL;
static int skinOptionsCount = 0;
@@ -354,7 +354,7 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
HWND hCtrl = NULL;
DWORD dwIndex = 0;
- //Skin List
+ // Skin List
hCtrl = GetDlgItem(hwndDlg, IDC_SKINLIST);
ListBox_ResetContent(hCtrl);
LPTSTR Temp = NULL;
@@ -365,19 +365,19 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
}
ListBox_SetCurSel(hCtrl, ListBox_FindString(hCtrl, 0, PopupOptions.SkinPack));
- //Skin List reload button
+ // Skin List reload button
SendMessage(GetDlgItem(hwndDlg, IDC_BTN_RELOAD), BUTTONSETASFLATBTN, TRUE, 0);
SendMessage(GetDlgItem(hwndDlg, IDC_BTN_RELOAD), BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIcon(ICO_OPT_RELOAD,0));
SendMessage(GetDlgItem(hwndDlg, IDC_BTN_RELOAD), BUTTONADDTOOLTIP, (WPARAM)Translate("Refresh List"), 0);
- //Skin Option List
+ // Skin Option List
SkinOptionList_Update (skinOptions, &skinOptionsCount, hwndDlg);
- //PreviewBox
+ // PreviewBox
mir_subclassWindow(GetDlgItem(hwndDlg, IDC_PREVIEWBOX), WndProcPreviewBox);
updatePreviewImage(GetDlgItem(hwndDlg, IDC_PREVIEWBOX));
- //hooks
+ // hooks
hhkFontsReload = HookEventMessage(ME_FONT_RELOAD, hwndDlg, WM_USER);
TranslateDialogDefault(hwndDlg);
@@ -394,11 +394,11 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
HWND hCtrl = NULL;
UINT idCtrl = LOWORD(wParam);
switch (HIWORD(wParam)) {
- case BN_KILLFOCUS: //Button controls
- case BN_SETFOCUS: //Button controls
+ case BN_KILLFOCUS: // Button controls
+ case BN_SETFOCUS: // Button controls
return TRUE;
break;
- case BN_CLICKED: //Button controls
+ case BN_CLICKED: // Button controls
switch(idCtrl) {
case IDC_PREVIEW:
PopupPreview();
@@ -419,7 +419,7 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
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)
+ // make shure we have select skin (ListBox_SetCurSel may be fail)
ListBox_GetText(hCtrl, ListBox_GetCurSel(hCtrl), &szNewSkin);
if (mir_tstrcmp(pszOldSkin, szNewSkin) != 0) {
mir_free(PopupOptions.SkinPack);
@@ -429,25 +429,25 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
const PopupSkin *skin = 0;
if (skin = skins.getSkin(PopupOptions.SkinPack)) {
- //update Skin Option List from reload 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:
+ }// end IDC_BTN_RELOAD:
break;
case IDC_GETSKINS:
- CallService(MS_UTILS_OPENURL,0,(LPARAM)"http://miranda-ng.org/addons/category/13");
+ CallService(MS_UTILS_OPENURL,0,(LPARAM)"http:// miranda-ng.org/addons/category/13");
break;
- }//end switch(idCtrl)
+ }// end switch(idCtrl)
updatePreviewImage(GetDlgItem(hwndDlg, IDC_PREVIEWBOX));
break;
- case CBN_SELCHANGE: //combo box controls
+ case CBN_SELCHANGE: // combo box controls
switch(idCtrl) {
case IDC_SKINLIST:
{
- //Skin list change
+ // Skin list change
mir_free(PopupOptions.SkinPack);
PopupOptions.SkinPack = mir_tstrdup((TCHAR *)SendDlgItemMessage(
hwndDlg,
@@ -460,7 +460,7 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
mir_free(PopupOptions.SkinPack);
PopupOptions.SkinPack = mir_tstrdup(skin->getName());
- //update Skin Option List
+ // update Skin Option List
bDlgInit = false;
bDlgInit = SkinOptionList_Update (skinOptions, &skinOptionsCount, hwndDlg);
}
@@ -468,11 +468,11 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
}
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
- }//end switch(idCtrl)
+ }// end switch(idCtrl)
break;
- }//end switch (HIWORD(wParam))
+ }// end switch (HIWORD(wParam))
break;
- }// end WM_COMMAND
+ }// end WM_COMMAND
return FALSE;
case WM_NOTIFY:
@@ -486,24 +486,24 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
case PSN_APPLY:
{
- //skin pack
+ // skin pack
db_set_ts(NULL, MODULNAME, "SkinPack", PopupOptions.SkinPack);
- //skin options
+ // skin options
const PopupSkin *skin = 0;
if (skin = skins.getSkin(PopupOptions.SkinPack))
skin->saveOpts();
skins.freeAllButActive();
- //more Skin options
+ // more Skin options
db_set_b(NULL, MODULNAME, "DisplayTime", PopupOptions.DisplayTime);
db_set_b(NULL, MODULNAME, "DropShadow", PopupOptions.DropShadow);
db_set_b(NULL, MODULNAME, "EnableShadowRegion", PopupOptions.EnableFreeformShadows);
db_set_b(NULL, MODULNAME, "EnableAeroGlass", PopupOptions.EnableAeroGlass);
db_set_b(NULL, MODULNAME, "UseMText", PopupOptions.UseMText);
- }//end PSN_APPLY:
+ }// end PSN_APPLY:
return TRUE;
- }//switch (((LPNMHDR)lParam)->code)
+ }// switch (((LPNMHDR)lParam)->code)
break;
- }//end switch (((LPNMHDR)lParam)->idFrom)
+ }// end switch (((LPNMHDR)lParam)->idFrom)
return FALSE;
case WM_DESTROY:
@@ -523,7 +523,7 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
skinOptionsCount = 0;
}
return TRUE;
- }//end switch (msg)
+ }// end switch (msg)
return FALSE;
}
@@ -533,7 +533,7 @@ static void BoxPreview_OnPaint(HWND hwnd, HDC mydc, int mode)
switch (mode) {
case 0:
- { // Avatar
+ { // Avatar
HDC hdcAvatar = CreateCompatibleDC(mydc);
HBITMAP hbmSave = (HBITMAP)SelectObject(hdcAvatar, hbmNoAvatar);
GetClientRect(hwnd, &rc);
@@ -548,7 +548,7 @@ static void BoxPreview_OnPaint(HWND hwnd, HDC mydc, int mode)
break;
}
case 1:
- { // Opacity
+ { // Opacity
HBRUSH hbr = CreateSolidBrush(fonts.clBack);
HFONT hfnt = (HFONT)SelectObject(mydc, fonts.title);
GetClientRect(hwnd, &rc);
@@ -556,15 +556,15 @@ static void BoxPreview_OnPaint(HWND hwnd, HDC mydc, int mode)
DrawIconEx(mydc, 10, (rc.bottom-rc.top-16)/2, IcoLib_GetIcon(ICO_POPUP_ON,0), 16, 16, 0, hbr, DI_NORMAL);
SetBkMode(mydc, TRANSPARENT);
GetClientRect(hwnd, &rc);
- rc.left += 30; // 10+16+4 -- icon
+ rc.left += 30; // 10+16+4 -- icon
rc.right -= (rc.right-rc.left)/3;
rc.bottom -= (rc.bottom-rc.top)/3;
- DrawText(mydc, _T(MODULNAME_LONG), mir_tstrlen(_T(MODULNAME_LONG)), &rc, DT_CENTER|DT_NOPREFIX|DT_SINGLELINE|DT_VCENTER);
+ DrawText(mydc, _T(MODULNAME_LONG), (int)mir_tstrlen(_T(MODULNAME_LONG)), &rc, DT_CENTER | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER);
GetClientRect(hwnd, &rc);
- rc.left += 30; // 10+16+4 -- icon
+ rc.left += 30; // 10+16+4 -- icon
rc.left += (rc.right-rc.left)/3;
rc.top += (rc.bottom-rc.top)/3;
- DrawText(mydc, _T(MODULNAME_LONG), mir_tstrlen(_T(MODULNAME_LONG)), &rc, DT_CENTER|DT_NOPREFIX|DT_SINGLELINE|DT_VCENTER);
+ DrawText(mydc, _T(MODULNAME_LONG), (int)mir_tstrlen(_T(MODULNAME_LONG)), &rc, DT_CENTER | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER);
GetClientRect(hwnd, &rc);
FrameRect(mydc, &rc, (HBRUSH)GetStockObject(BLACK_BRUSH));
SelectObject(mydc, hfnt);
@@ -573,7 +573,7 @@ static void BoxPreview_OnPaint(HWND hwnd, HDC mydc, int mode)
break;
case 2:
- { // Position
+ { // Position
HBRUSH hbr = CreateSolidBrush(GetSysColor(COLOR_WINDOW));
GetClientRect(hwnd, &rc);
FillRect(mydc, &rc, hbr);