diff options
author | George Hazan <george.hazan@gmail.com> | 2014-12-01 12:56:22 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-12-01 12:56:22 +0000 |
commit | 70e0c09fcffa5520d3cfdc4708c81248b135c796 (patch) | |
tree | 6d000d835ddf3c890d1d23a7f946fd62111f8497 /plugins/Popup/src/opt_adv.cpp | |
parent | 4a58d85d8dd5f120eb0d0c429e0b46cdeb25c629 (diff) |
- more warning fixes;
- code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@11191 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Popup/src/opt_adv.cpp')
-rw-r--r-- | plugins/Popup/src/opt_adv.cpp | 98 |
1 files changed, 49 insertions, 49 deletions
diff --git a/plugins/Popup/src/opt_adv.cpp b/plugins/Popup/src/opt_adv.cpp index 40728b454f..1b9adc6327 100644 --- a/plugins/Popup/src/opt_adv.cpp +++ b/plugins/Popup/src/opt_adv.cpp @@ -28,7 +28,7 @@ HWND hwndBox = NULL; 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
+// effekt name for drop down box
LIST<TCHAR> g_lstPopupVfx(5, _tcsicmp);
void OptAdv_RegisterVfx(char *name)
{
@@ -42,66 +42,66 @@ void OptAdv_UnregisterVfx() g_lstPopupVfx.destroy();
}
-//Main Dialog Proc
+// Main Dialog Proc
void LoadOption_AdvOpts()
{
- //History
+ // History
PopupOptions.EnableHistory = db_get_b(NULL, MODULNAME, "EnableHistory", TRUE);
PopupOptions.HistorySize = db_get_w(NULL, MODULNAME, "HistorySize", SETTING_HISTORYSIZE_DEFAULT);
PopupOptions.UseHppHistoryLog = db_get_b(NULL, MODULNAME, "UseHppHistoryLog", TRUE);
- //Avatars
+ // Avatars
PopupOptions.avatarBorders = db_get_b(NULL, MODULNAME, "AvatarBorders", TRUE);
PopupOptions.avatarPNGBorders = db_get_b(NULL, MODULNAME, "AvatarPNGBorders", FALSE);
PopupOptions.avatarRadius = db_get_b(NULL, MODULNAME, "AvatarRadius", 2);
PopupOptions.avatarSize = db_get_w(NULL, MODULNAME, "AvatarSize", SETTING_AVTSIZE_DEFAULT);
PopupOptions.EnableAvatarUpdates = db_get_b(NULL, MODULNAME, "EnableAvatarUpdates", FALSE);
- //Monitor
+ // Monitor
PopupOptions.Monitor = db_get_b(NULL, MODULNAME, "Monitor", SETTING_MONITOR_DEFAULT);
- //Transparency
+ // Transparency
PopupOptions.UseTransparency = db_get_b(NULL, MODULNAME, "UseTransparency", TRUE);
PopupOptions.Alpha = db_get_b(NULL, MODULNAME, "Alpha", SETTING_ALPHA_DEFAULT);
PopupOptions.OpaqueOnHover = db_get_b(NULL, MODULNAME, "OpaqueOnHover", TRUE);
- //Effects
+ // Effects
PopupOptions.UseAnimations = db_get_b(NULL, MODULNAME, "UseAnimations", TRUE);
PopupOptions.UseEffect = db_get_b(NULL, MODULNAME, "Fade", TRUE);
PopupOptions.Effect = (LPTSTR)DBGetContactSettingStringX(NULL, MODULNAME, "Effect", "", DBVT_TCHAR);
PopupOptions.FadeIn = db_get_dw(NULL, MODULNAME, "FadeInTime", SETTING_FADEINTIME_DEFAULT);
PopupOptions.FadeOut = db_get_dw(NULL, MODULNAME, "FadeOutTime", SETTING_FADEOUTTIME_DEFAULT);
- //other old stuff
+ // other old stuff
PopupOptions.MaxPopups = db_get_w(NULL, MODULNAME, "MaxPopups", 20);
}
INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
TCHAR tstr[64];
- 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
UINT idCtrl;
switch (msg) {
case WM_INITDIALOG:
- //Create preview box:
+ // Create preview box:
{
hwndBox = CreateWindowEx(
- WS_EX_TOOLWINDOW|WS_EX_TOPMOST, // dwStyleEx
- _T(BOXPREVIEW_WNDCLASS), // Class name
- NULL, // Title
- DS_SETFONT|DS_FIXEDSYS|WS_POPUP, // dwStyle
- CW_USEDEFAULT, // x
- CW_USEDEFAULT, // y
- CW_USEDEFAULT, // Width
- CW_USEDEFAULT, // Height
- HWND_DESKTOP, // Parent
- NULL, // menu handle
- hInst, // Instance
+ WS_EX_TOOLWINDOW|WS_EX_TOPMOST, // dwStyleEx
+ _T(BOXPREVIEW_WNDCLASS), // Class name
+ NULL, // Title
+ DS_SETFONT|DS_FIXEDSYS|WS_POPUP, // dwStyle
+ CW_USEDEFAULT, // x
+ CW_USEDEFAULT, // y
+ CW_USEDEFAULT, // Width
+ CW_USEDEFAULT, // Height
+ HWND_DESKTOP, // Parent
+ NULL, // menu handle
+ hInst, // Instance
(LPVOID)0);
ShowWindow(hwndBox, SW_HIDE);
}
- //Group: History
+ // Group: History
{
CheckDlgButton(hwnd, IDC_ENABLE_HISTORY, PopupOptions.EnableHistory);
SetDlgItemInt(hwnd, IDC_HISTORYSIZE, PopupOptions.HistorySize, FALSE);
@@ -121,16 +121,16 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM EnableWindow(GetDlgItem(hwnd, IDC_SHOWHISTORY), PopupOptions.EnableHistory);
EnableWindow(GetDlgItem(hwnd, IDC_HPPLOG), PopupOptions.EnableHistory && gbHppInstalled);
}
- //Group: Avatars
+ // Group: Avatars
{
- //Borders
+ // Borders
CheckDlgButton(hwnd, IDC_AVT_BORDER, PopupOptions.avatarBorders);
CheckDlgButton(hwnd, IDC_AVT_PNGBORDER, PopupOptions.avatarPNGBorders);
EnableWindow(GetDlgItem(hwnd, IDC_AVT_PNGBORDER), PopupOptions.avatarBorders);
- //Radius
+ // Radius
SetDlgItemInt(hwnd, IDC_AVT_RADIUS, PopupOptions.avatarRadius, FALSE);
SendDlgItemMessage(hwnd, IDC_AVT_RADIUS_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG((PopupOptions.avatarSize / 2), 0));
- //Size
+ // Size
mir_subclassWindow(GetDlgItem(hwnd, IDC_AVT_SIZE_SLIDE), AvatarTrackBarWndProc);
SendDlgItemMessage(hwnd, IDC_AVT_SIZE_SLIDE, TBM_SETRANGE, FALSE,
@@ -138,10 +138,10 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM SendDlgItemMessage(hwnd, IDC_AVT_SIZE_SLIDE, TBM_SETPOS, TRUE,
max(PopupOptions.avatarSize, SETTING_AVTSIZE_MIN));
SetDlgItemInt(hwnd, IDC_AVT_SIZE, PopupOptions.avatarSize, FALSE);
- //Request avatars
+ // Request avatars
CheckDlgButton(hwnd, IDC_AVT_REQUEST, PopupOptions.EnableAvatarUpdates);
}
- //Group: Monitor
+ // Group: Monitor
{
BOOL bMonitor = 0;
@@ -154,9 +154,9 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM EnableWindow(GetDlgItem(hwnd, IDC_MIRANDAWND), bMonitor);
EnableWindow(GetDlgItem(hwnd, IDC_ACTIVEWND), bMonitor);
}
- //Group: Transparency
+ // Group: Transparency
{
- //win2k+
+ // win2k+
CheckDlgButton(hwnd, IDC_TRANS, PopupOptions.UseTransparency);
SendDlgItemMessage(hwnd, IDC_TRANS_SLIDER, TBM_SETRANGE, FALSE, MAKELONG(1, 255));
SendDlgItemMessage(hwnd, IDC_TRANS_SLIDER, TBM_SETPOS, TRUE, PopupOptions.Alpha);
@@ -175,11 +175,11 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM }
ShowWindow(GetDlgItem(hwnd, IDC_TRANS), SW_SHOW);
}
- //Group: Effects
+ // Group: Effects
{
- //Use Animations
+ // Use Animations
CheckDlgButton(hwnd, IDC_USEANIMATIONS, PopupOptions.UseAnimations);
- //Fade
+ // Fade
SetDlgItemInt(hwnd, IDC_FADEIN, PopupOptions.FadeIn, FALSE);
SetDlgItemInt(hwnd, IDC_FADEOUT, PopupOptions.FadeOut, FALSE);
UDACCEL aAccels[] = {{0,50},{1,100},{3,500}};
@@ -197,7 +197,7 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM EnableWindow(GetDlgItem(hwnd, IDC_FADEOUT), how);
EnableWindow(GetDlgItem(hwnd, IDC_FADEOUT_SPIN), how);
EnableWindow(GetDlgItem(hwnd, IDC_FADEOUT_TXT2), how);
- //effects drop down
+ // effects drop down
{
DWORD dwItem, dwActiveItem = 0;
@@ -220,11 +220,11 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM }
}
- //later check stuff
+ // later check stuff
SetDlgItemInt(hwnd, IDC_MAXPOPUPS, PopupOptions.MaxPopups, FALSE);
SendDlgItemMessage(hwnd, IDC_MAXPOPUPS_SPIN, UDM_SETBUDDY, (WPARAM)GetDlgItem(hwnd, IDC_MAXPOPUPS), 0);
SendDlgItemMessage(hwnd, IDC_MAXPOPUPS_SPIN, UDM_SETRANGE, 0, MAKELONG(999, 1));
- TranslateDialogDefault(hwnd); //do it on end of WM_INITDIALOG
+ TranslateDialogDefault(hwnd); // do it on end of WM_INITDIALOG
bDlgInit = true;
return TRUE;
@@ -249,7 +249,7 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case WM_COMMAND:
idCtrl = LOWORD(wParam);
switch (HIWORD(wParam)) {
- case BN_CLICKED: //Button controls
+ case BN_CLICKED: // Button controls
switch (idCtrl) {
case IDC_ENABLE_HISTORY:
PopupOptions.EnableHistory = !PopupOptions.EnableHistory;
@@ -337,7 +337,7 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM break;
case CBN_SELCHANGE:
- //lParam = Handle to the control
+ // lParam = Handle to the control
switch (idCtrl) {
case IDC_EFFECT:
{
@@ -361,9 +361,9 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM }
break;
- case EN_CHANGE: //Edit controls change
+ case EN_CHANGE: // Edit controls change
if (!bDlgInit) break;
- //lParam = Handle to the control
+ // lParam = Handle to the control
switch (idCtrl) {
case IDC_MAXPOPUPS:
{
@@ -413,8 +413,8 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM }
break;
- case EN_KILLFOCUS: //Edit controls lost fokus
- //lParam = Handle to the control
+ case EN_KILLFOCUS: // Edit controls lost fokus
+ // lParam = Handle to the control
switch (idCtrl) {
case IDC_MAXPOPUPS:
{
@@ -423,7 +423,7 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM PopupOptions.MaxPopups = 20;
if (maxPop != PopupOptions.MaxPopups) {
SetDlgItemInt(hwnd, idCtrl, PopupOptions.MaxPopups, FALSE);
- //ErrorMSG(1);
+ // ErrorMSG(1);
SetFocus((HWND)lParam);
}
}
@@ -494,31 +494,31 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM return TRUE;
case PSN_APPLY:
- //History
+ // History
db_set_b(NULL, MODULNAME, "EnableHistory", (BYTE)PopupOptions.EnableHistory);
db_set_w(NULL, MODULNAME, "HistorySize", PopupOptions.HistorySize);
PopupHistoryResize();
db_set_b(NULL, MODULNAME, "UseHppHistoryLog", PopupOptions.UseHppHistoryLog);
- //Avatars
+ // Avatars
db_set_b(NULL, MODULNAME, "AvatarBorders", PopupOptions.avatarBorders);
db_set_b(NULL, MODULNAME, "AvatarPNGBorders", PopupOptions.avatarPNGBorders);
db_set_b(NULL, MODULNAME, "AvatarRadius", PopupOptions.avatarRadius);
db_set_w(NULL, MODULNAME, "AvatarSize", PopupOptions.avatarSize);
db_set_b(NULL, MODULNAME, "EnableAvatarUpdates", PopupOptions.EnableAvatarUpdates);
- //Monitor
+ // Monitor
db_set_b(NULL, MODULNAME, "Monitor", PopupOptions.Monitor);
- //Transparency
+ // Transparency
db_set_b(NULL, MODULNAME, "UseTransparency", PopupOptions.UseTransparency);
db_set_b(NULL, MODULNAME, "Alpha", PopupOptions.Alpha);
db_set_b(NULL, MODULNAME, "OpaqueOnHover", PopupOptions.OpaqueOnHover);
- //Effects
+ // Effects
db_set_b(NULL, MODULNAME, "UseAnimations", PopupOptions.UseAnimations);
db_set_b(NULL, MODULNAME, "Fade", PopupOptions.UseEffect);
db_set_ts(NULL, MODULNAME, "Effect", PopupOptions.Effect);
db_set_dw(NULL, MODULNAME, "FadeInTime", PopupOptions.FadeIn);
db_set_dw(NULL, MODULNAME, "FadeOutTime", PopupOptions.FadeOut);
- //other old stuff
+ // other old stuff
db_set_w(NULL, MODULNAME, "MaxPopups", (BYTE)PopupOptions.MaxPopups);
}
return TRUE;
|