diff options
author | slotwin <slotwin@users.noreply.github.com> | 2014-05-23 01:26:12 +0000 |
---|---|---|
committer | slotwin <slotwin@users.noreply.github.com> | 2014-05-23 01:26:12 +0000 |
commit | 7c8227d28d71752509dfac29723141eba4733f06 (patch) | |
tree | ab55d8b6c798f2f980783b75ce6bf04f0b5e0aee | |
parent | 1b0d42c165afe2a1506489c237c793547e796768 (diff) |
Clist_nicer: proper capitalization in options and menus
options: use system checkboxes instead custom icons for TreeView controls
rearrange list of icons in IcoLib
code cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@9284 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | plugins/Clist_nicer/res/resource.rc | 123 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp | 166 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/CLUIFrames/cluiframes.h | 12 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/CLUIFrames/framesmenu.cpp | 16 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp | 563 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/Include/resource.h | 4 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clcopts.cpp | 90 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clui.cpp | 26 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/statusbar.cpp | 21 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/viewmodes.cpp | 6 |
10 files changed, 529 insertions, 498 deletions
diff --git a/plugins/Clist_nicer/res/resource.rc b/plugins/Clist_nicer/res/resource.rc index cd1134ba09..b83222a8d7 100644 --- a/plugins/Clist_nicer/res/resource.rc +++ b/plugins/Clist_nicer/res/resource.rc @@ -14,11 +14,11 @@ #undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
-// Русский (Россия) resources
+// Neutral resources
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
-LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
-#pragma code_page(1251)
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
+#pragma code_page(1250)
/////////////////////////////////////////////////////////////////////////////
//
@@ -27,7 +27,7 @@ LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT IDD_EXCEPTION DIALOGEX 0, 0, 370, 131
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "CList Nicer exception"
+CAPTION "Clist Nicer exception"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
EDITTEXT IDC_EXCEPTION_DETAILS,7,18,356,60,ES_MULTILINE | ES_READONLY
@@ -82,7 +82,7 @@ IDD_OPT_CLIST DIALOGEX 0, 0, 305, 226 STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
- GROUPBOX "Contact List",IDC_STCLISTGROUP,1,0,163,91
+ GROUPBOX "Contact list",IDC_STCLISTGROUP,1,0,163,91
CONTROL "Hide offline users",IDC_HIDEOFFLINE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,12,147,10
CONTROL "Hide empty groups",IDC_HIDEEMPTYGROUPS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,25,147,10
CONTROL "Disable groups",IDC_DISABLEGROUPS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,38,147,10
@@ -155,7 +155,7 @@ BEGIN LTEXT "Indent groups by:",IDC_STATIC,11,175,233,8
EDITTEXT IDC_GROUPINDENT,249,172,45,12,ES_RIGHT | ES_NUMBER
CONTROL "Spin1",IDC_GROUPINDENTSPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,284,173,11,14
- LTEXT "Inner Row vertical padding",IDC_STATIC,11,189,233,8
+ LTEXT "Inner row vertical padding",IDC_STATIC,11,189,233,8
EDITTEXT IDC_AVATARPADDING,249,186,45,12,ES_RIGHT | ES_AUTOHSCROLL
CONTROL "",IDC_AVATARPADDINGSPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,284,187,11,14
GROUPBOX "Margins and spacing",IDC_STATIC,1,109,299,95
@@ -165,7 +165,7 @@ IDD_OPT_DSPITEMS DIALOGEX 0, 0, 305, 167 STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
- GROUPBOX "Contact List Sorting",IDC_STATIC,1,0,142,145,WS_GROUP
+ GROUPBOX "Contact list sorting",IDC_STATIC,1,0,142,145,WS_GROUP
LTEXT "First by",IDC_STATIC,5,15,57,9
COMBOBOX IDC_SORTPRIMARY,65,12,73,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "Then by",IDC_STATIC,5,29,57,9
@@ -177,7 +177,7 @@ BEGIN CONTROL "Do not separate offline contacts",IDC_DONTSEPARATE,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,80,132,10
LTEXT "Hide as offline",IDC_STATIC,151,1,73,8
- CONTROL "Tree1",IDC_HIDEOFFLINEOPTS,"SysTreeView32",TVS_HASBUTTONS | TVS_DISABLEDRAGDROP | TVS_NOTOOLTIPS | TVS_CHECKBOXES | TVS_NONEVENHEIGHT | WS_BORDER | WS_HSCROLL | WS_TABSTOP,147,11,152,134
+ CONTROL "Tree Hide Offline",IDC_HIDEOFFLINEOPTS,"SysTreeView32",TVS_DISABLEDRAGDROP | TVS_NOTOOLTIPS | TVS_NONEVENHEIGHT | WS_BORDER | WS_HSCROLL | WS_TABSTOP,147,11,152,134
LTEXT "Right align contacts",IDC_STATIC,5,150,130,10
COMBOBOX IDC_CLISTALIGN,147,148,77,56,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
END
@@ -224,7 +224,7 @@ BEGIN "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,40,277,10
CONTROL "Use metacontact protocol icons instead of subcontacts",IDC_SHOWMETA,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,52,277,10
- CONTROL "Use Overlay icons on avatars",IDC_OVERLAYICONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,64,277,10
+ CONTROL "Use overlay icons on avatars",IDC_OVERLAYICONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,64,277,10
CONTROL "Dim idle contacts",IDC_IDLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,76,277,10
CONTROL "Replace status icons with xStatus",IDC_XSTATUSASSTATUS,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,88,277,10
@@ -260,7 +260,7 @@ BEGIN CONTROL "Size upwards",IDC_AUTOSIZEUPWARD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,150,59,149,10
CONTROL "If window is partially covered, bring to front instead of hiding",IDC_BRINGTOFRONT,
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,139,76,160,16
- CONTROL "Always Hide On Taskbar",IDC_ALWAYSHIDEONTASKBAR,"Button",BS_AUTOCHECKBOX | BS_TOP | BS_MULTILINE | WS_TABSTOP,139,94,158,10
+ CONTROL "Always hide on taskbar",IDC_ALWAYSHIDEONTASKBAR,"Button",BS_AUTOCHECKBOX | BS_TOP | BS_MULTILINE | WS_TABSTOP,139,94,158,10
LTEXT "Client margins",IDC_STATIC,11,144,50,10
EDITTEXT IDC_CLEFT,64,142,31,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
CONTROL "",IDC_CLEFTSPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_HOTTRACK,84,139,10,14
@@ -320,7 +320,7 @@ BEGIN LTEXT "milliseconds",IDC_STATIC12,114,137,73,8,SS_CENTERIMAGE
CONTROL "Hide vertical scroll bar",IDC_NOSCROLLBAR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,152,282,10
CONTROL "Gray out entire list when:",IDC_GREYOUT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,168,282,10
- CONTROL "Tree1",IDC_GREYOUTOPTS,"SysTreeView32",TVS_DISABLEDRAGDROP | TVS_NOTOOLTIPS | TVS_NONEVENHEIGHT | WS_BORDER | WS_HSCROLL | WS_TABSTOP,11,181,182,39
+ CONTROL "Tree Gray Out",IDC_GREYOUTOPTS,"SysTreeView32",TVS_DISABLEDRAGDROP | TVS_NOTOOLTIPS | TVS_NONEVENHEIGHT | WS_BORDER | WS_HSCROLL | WS_TABSTOP,11,181,182,39
END
IDD_OPT_CLCBKG DIALOGEX 0, 0, 305, 226
@@ -328,7 +328,7 @@ STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | DS_CENTER | WS_CHILD EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- GROUPBOX "Contact List Background",IDC_STATIC,1,4,302,177
+ GROUPBOX "Contact list background",IDC_STATIC,1,4,302,177
CONTROL "Use Windows colors",IDC_WINCOLOUR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,20,282,10
CONTROL "",IDC_BKGCOLOUR,"ColourPicker",WS_TABSTOP,22,34,22,10
LTEXT "Background color",IDC_STATIC,48,35,246,8,NOT WS_GROUP
@@ -350,7 +350,7 @@ IDD_OPT_SBAR DIALOGEX 0, 0, 303, 226 STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | DS_CENTER | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- GROUPBOX "Status Bar",IDC_STATIC,3,4,297,214
+ GROUPBOX "Status bar",IDC_STATIC,3,4,297,214
CONTROL "Show status bar",IDC_SHOWSBAR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,17,275,10
CONTROL "Show icons",IDC_SHOWICON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,33,265,10
CONTROL "Show protocol names",IDC_SHOWPROTO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,48,265,10
@@ -485,7 +485,7 @@ BEGIN LTEXT "To show a previously hidden contact, navigate to Options->Events->Ignore, search the contact in the list and tick the checkbox next to its name.",IDC_STATIC,18,146,182,34
GROUPBOX "Display options",IDC_STATIC,209,3,143,218
CONTROL "Show contact with priority",IDC_IGN_PRIORITY,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,219,13,127,11
- LTEXT "Show Avatar:",IDC_STATIC,225,28,94,11
+ LTEXT "Show avatar:",IDC_STATIC,225,28,94,11
COMBOBOX IDC_AVATARDISPMODE,219,38,127,56,CBS_DROPDOWNLIST | CBS_SORT | WS_DISABLED | WS_VSCROLL | WS_TABSTOP
LTEXT "Show 2nd line:",IDC_STATIC,225,54,94,11
COMBOBOX IDC_SECONDLINEMODE,219,64,127,56,CBS_DROPDOWNLIST | CBS_SORT | WS_DISABLED | WS_VSCROLL | WS_TABSTOP
@@ -512,7 +512,8 @@ END 2 TEXTINCLUDE
BEGIN
"#include <winres.h>\r\n"
- "#include <statusmodes.h>\r\0"
+ "#include <statusmodes.h>\r\n"
+ "\0"
END
3 TEXTINCLUDE
@@ -591,8 +592,8 @@ BEGIN MENUITEM "&DND\tCtrl+5", ID_STATUS_DND
MENUITEM "&Free for chat\tCtrl+6", ID_STATUS_FREECHAT
MENUITEM "&Invisible\tCtrl+7", ID_STATUS_INVISIBLE
- MENUITEM "On the &Phone\tCtrl+8", ID_STATUS_ONTHEPHONE
- MENUITEM "Out to &Lunch\tCtrl+9", ID_STATUS_OUTTOLUNCH
+ MENUITEM "On the &phone\tCtrl+8", ID_STATUS_ONTHEPHONE
+ MENUITEM "Out to &lunch\tCtrl+9", ID_STATUS_OUTTOLUNCH
END
END
@@ -606,33 +607,33 @@ BEGIN END
POPUP "Nowhere"
BEGIN
- MENUITEM "&New Group", POPUP_NEWGROUP
+ MENUITEM "&New group", POPUP_NEWGROUP
MENUITEM SEPARATOR
- MENUITEM "&Hide Offline Users", POPUP_HIDEOFFLINE
- MENUITEM "Hide &Offline Users out here", POPUP_HIDEOFFLINEROOT
- MENUITEM "Hide &Empty Groups", POPUP_HIDEEMPTYGROUPS
- MENUITEM "Disable &Groups", POPUP_DISABLEGROUPS
+ MENUITEM "&Hide offline users", POPUP_HIDEOFFLINE
+ MENUITEM "Hide &offline users out here", POPUP_HIDEOFFLINEROOT
+ MENUITEM "Hide &empty groups", POPUP_HIDEEMPTYGROUPS
+ MENUITEM "Disable &groups", POPUP_DISABLEGROUPS
MENUITEM SEPARATOR
MENUITEM SEPARATOR
MENUITEM "Hide Miranda", POPUP_HIDEMIRANDA
END
POPUP "Group"
BEGIN
- MENUITEM "&New Subgroup", POPUP_NEWSUBGROUP
- MENUITEM "&Hide Offline Users in here", POPUP_GROUPHIDEOFFLINE
+ MENUITEM "&New subgroup", POPUP_NEWSUBGROUP
+ MENUITEM "&Hide offline users in here", POPUP_GROUPHIDEOFFLINE
MENUITEM SEPARATOR
- MENUITEM "&Rename Group", POPUP_RENAMEGROUP
- MENUITEM "&Delete Group", POPUP_DELETEGROUP
+ MENUITEM "&Rename group", POPUP_RENAMEGROUP
+ MENUITEM "&Delete group", POPUP_DELETEGROUP
MENUITEM SEPARATOR
- MENUITEM "Move marked Contacts to this Group", POPUP_MOVEMARKEDHERE, GRAYED
+ MENUITEM "Move marked contacts to this group", POPUP_MOVEMARKEDHERE, GRAYED
END
POPUP "Appearance"
BEGIN
- MENUITEM "Show Status Icons", POPUP_SHOWSTATUSICONS
- MENUITEM "Show Metacontact proto Icons", POPUP_SHOWMETAICONS
+ MENUITEM "Show status icons", POPUP_SHOWSTATUSICONS
+ MENUITEM "Show MetaContact proto icons", POPUP_SHOWMETAICONS
MENUITEM SEPARATOR
- MENUITEM "Show additional Buttons", POPUP_BUTTONS
- MENUITEM "Draw sunken Frame", POPUP_FRAME
+ MENUITEM "Show additional buttons", POPUP_BUTTONS
+ MENUITEM "Draw sunken frame", POPUP_FRAME
END
END
@@ -645,10 +646,38 @@ END #ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO
BEGIN
+ IDD_EXCEPTION, DIALOG
+ BEGIN
+ END
+
IDD_CLNABOUT, DIALOG
BEGIN
END
+ IDD_DELETECONTACT, DIALOG
+ BEGIN
+ END
+
+ IDD_OPTIONSDIALOG, DIALOG
+ BEGIN
+ END
+
+ IDD_OPT_CLIST, DIALOG
+ BEGIN
+ END
+
+ IDD_OPT_DSPGROUPS, DIALOG
+ BEGIN
+ END
+
+ IDD_OPT_DSPITEMS, DIALOG
+ BEGIN
+ END
+
+ IDD_OPT_DSPADVANCED, DIALOG
+ BEGIN
+ END
+
IDD_OPT_ICONS, DIALOG
BEGIN
VERTGUIDE, 5
@@ -662,10 +691,38 @@ BEGIN BEGIN
HORZGUIDE, 127
END
+
+ IDD_OPT_CLC, DIALOG
+ BEGIN
+ END
+
+ IDD_OPT_CLCBKG, DIALOG
+ BEGIN
+ END
+
+ IDD_OPT_SBAR, DIALOG
+ BEGIN
+ END
+
+ IDD_OPT_VIEWMODES, DIALOG
+ BEGIN
+ END
+
+ IDD_OPT_SKIN, DIALOG
+ BEGIN
+ END
+
+ IDD_OPT, DIALOG
+ BEGIN
+ END
+
+ IDD_QUICKIGNORE, DIALOG
+ BEGIN
+ END
END
#endif // APSTUDIO_INVOKED
-#endif // Русский (Россия) resources
+#endif // Neutral resources
/////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp index d1d8629caf..71224107c0 100644 --- a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp +++ b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp @@ -54,7 +54,7 @@ extern HINSTANCE g_hInst; #define frame_menu_visible 2
#define frame_menu_showtitlebar 3
#define frame_menu_floating 4
-#define frame_menu_skinned 5
+#define frame_menu_skinned 5
static int UpdateTBToolTip(int framepos);
INT_PTR CLUIFrameSetFloat(WPARAM wParam, LPARAM lParam);
@@ -75,7 +75,7 @@ static int sortfunc(const void *a, const void *b) sd1 = (SortData *)a;
sd2 = (SortData *)b;
if (sd1->order > sd2->order)
- return(1);
+ return 1;
if (sd1->order < sd2->order)
return -1;
return 0;
@@ -97,7 +97,7 @@ static HANDLE contMIVisible, contMITitle, contMITBVisible, contMILock, contMICol static HANDLE contMIAlignRoot;
static HANDLE contMIAlignTop, contMIAlignClient, contMIAlignBottom;
static HANDLE contMIBorder, contMISkinned;
-static HGENMENU MainMIRoot = (HGENMENU) - 1;
+static HGENMENU MainMIRoot = (HGENMENU)-1;
// others
static int ContactListHeight;
@@ -114,7 +114,7 @@ static int GapBetweenFrames = 1; static int RemoveItemFromList(int pos, FRAMEWND **lpFrames, int *FrameItemCount)
{
- memcpy(&((*lpFrames)[pos]), &((*lpFrames)[pos+1]), sizeof(FRAMEWND)*(*FrameItemCount - pos - 1));
+ memcpy(&((*lpFrames)[pos]), &((*lpFrames)[pos + 1]), sizeof(FRAMEWND) * (*FrameItemCount - pos - 1));
(*FrameItemCount)--;
return 0;
}
@@ -126,16 +126,16 @@ static int id2pos(int id) if (FramesSysNotStarted)
return -1;
- for (i = 0;i < nFramescount;i++) {
+ for (i = 0; i < nFramescount; i++) {
if (Frames[i].id == id)
- return(i);
+ return i;
}
return -1;
}
int __forceinline btoint(BOOLEAN b)
{
- return(b ? 1 : 0);
+ return (b ? 1 : 0);
}
void __forceinline lockfrm()
@@ -149,31 +149,29 @@ void __forceinline ulockfrm() LeaveCriticalSection(&csFrameHook);
}
-static FRAMEWND* FindFrameByWnd(HWND hwnd)
+static FRAMEWND *FindFrameByWnd(HWND hwnd)
{
- BOOL bFound = FALSE;
+ BOOL bFound = FALSE;
int i;
if (hwnd == NULL)
- return(NULL);
+ return (NULL);
- for (i = 0;i < nFramescount;i++) {
+ for (i = 0; i < nFramescount; i++) {
if ((Frames[i].floating) && (Frames[i].ContainerWnd == hwnd))
- return(&Frames[i]);
+ return (&Frames[i]);
}
return(NULL);
}
-
static void DockThumbs(FRAMEWND *pThumbLeft, FRAMEWND *pThumbRight, BOOL bMoveLeft)
{
if ((pThumbRight->dockOpt.hwndLeft == NULL) && (pThumbLeft->dockOpt.hwndRight == NULL)) {
- pThumbRight->dockOpt.hwndLeft = pThumbLeft->ContainerWnd;
- pThumbLeft->dockOpt.hwndRight = pThumbRight->ContainerWnd;
+ pThumbRight->dockOpt.hwndLeft = pThumbLeft->ContainerWnd;
+ pThumbLeft->dockOpt.hwndRight = pThumbRight->ContainerWnd;
}
}
-
static void UndockThumbs(FRAMEWND *pThumb1, FRAMEWND *pThumb2)
{
if ((pThumb1 == NULL) || (pThumb2 == NULL))
@@ -196,21 +194,21 @@ BOOLEAN bMoveTogether; static void PositionThumb(FRAMEWND *pThumb, short nX, short nY)
{
- FRAMEWND *pCurThumb = &Frames[0];
- FRAMEWND *pDockThumb = pThumb;
- FRAMEWND fakeMainWindow;
- FRAMEWND fakeTaskBarWindow;
- RECT rc;
- RECT rcThumb;
- RECT rcOld;
- SIZE sizeScreen;
- int nOffs = 10;
- POINT pt;
- RECT rcLeft;
- RECT rcTop;
- RECT rcRight;
- RECT rcBottom;
- int frmidx = 0;
+ FRAMEWND *pCurThumb = &Frames[0];
+ FRAMEWND *pDockThumb = pThumb;
+ FRAMEWND fakeMainWindow;
+ FRAMEWND fakeTaskBarWindow;
+ RECT rc;
+ RECT rcThumb;
+ RECT rcOld;
+ SIZE sizeScreen;
+ int nOffs = 10;
+ POINT pt;
+ RECT rcLeft;
+ RECT rcTop;
+ RECT rcRight;
+ RECT rcBottom;
+ int frmidx = 0;
if (pThumb == NULL)
return;
@@ -220,7 +218,7 @@ static void PositionThumb(FRAMEWND *pThumb, short nX, short nY) // Get thumb dimnsions
GetWindowRect(pThumb->ContainerWnd, &rcThumb);
- int nWidth = rcThumb.right - rcThumb.left;
+ int nWidth = rcThumb.right - rcThumb.left;
int nHeight = rcThumb.bottom - rcThumb.top;
// Docking to the edges of the screen
@@ -232,7 +230,7 @@ static void PositionThumb(FRAMEWND *pThumb, short nX, short nY) bool bLeading = pThumb->dockOpt.hwndRight != NULL;
if (bMoveTogether) {
- UndockThumbs(pThumb, FindFrameByWnd(pThumb->dockOpt.hwndLeft));
+ UndockThumbs(pThumb, FindFrameByWnd(pThumb->dockOpt.hwndLeft));
GetWindowRect(pThumb->ContainerWnd, &rcOld);
}
@@ -253,34 +251,34 @@ static void PositionThumb(FRAMEWND *pThumb, short nX, short nY) GetWindowRect(pCurThumb->ContainerWnd, &rc);
- rcLeft.left = rc.left - nOffs;
- rcLeft.top = rc.top - nOffs;
- rcLeft.right = rc.left + nOffs;
- rcLeft.bottom = rc.bottom + nOffs;
+ rcLeft.left = rc.left - nOffs;
+ rcLeft.top = rc.top - nOffs;
+ rcLeft.right = rc.left + nOffs;
+ rcLeft.bottom = rc.bottom + nOffs;
- rcTop.left = rc.left - nOffs;
- rcTop.top = rc.top - nOffs;
- rcTop.right = rc.right + nOffs;
- rcTop.bottom = rc.top + nOffs;
+ rcTop.left = rc.left - nOffs;
+ rcTop.top = rc.top - nOffs;
+ rcTop.right = rc.right + nOffs;
+ rcTop.bottom = rc.top + nOffs;
- rcRight.left = rc.right - nOffs;
- rcRight.top = rc.top - nOffs;
- rcRight.right = rc.right + nOffs;
- rcRight.bottom = rc.bottom + nOffs;
+ rcRight.left = rc.right - nOffs;
+ rcRight.top = rc.top - nOffs;
+ rcRight.right = rc.right + nOffs;
+ rcRight.bottom = rc.bottom + nOffs;
- rcBottom.left = rc.left - nOffs;
- rcBottom.top = rc.bottom - nOffs;
- rcBottom.right = rc.right + nOffs;
+ rcBottom.left = rc.left - nOffs;
+ rcBottom.top = rc.bottom - nOffs;
+ rcBottom.right = rc.right + nOffs;
rcBottom.bottom = rc.bottom + nOffs;
bool bDockedLeft = false, bDockedRight = false, bDocked = false;
// Upper-left
- pt.x = rcThumb.left;
- pt.y = rcThumb.top;
+ pt.x = rcThumb.left;
+ pt.y = rcThumb.top;
if (PtInRect(&rcRight, pt)) {
- nNewX = rc.right;
+ nNewX = rc.right;
bDocked = true;
}
@@ -291,18 +289,18 @@ static void PositionThumb(FRAMEWND *pThumb, short nX, short nY) }
if (PtInRect(&rcTop, pt)) {
- nNewY = rc.top;
+ nNewY = rc.top;
bDockedLeft = bDocked;
}
// Upper-right
- pt.x = rcThumb.right;
- pt.y = rcThumb.top;
+ pt.x = rcThumb.right;
+ pt.y = rcThumb.top;
bDocked = false;
- if ( !bLeading && PtInRect(&rcLeft, pt)) {
- if ( !bDockedLeft) {
- nNewX = rc.left - nWidth;
+ if (!bLeading && PtInRect(&rcLeft, pt)) {
+ if (!bDockedLeft) {
+ nNewX = rc.left - nWidth;
bDocked = true;
}
else if (rc.right == rcThumb.left)
@@ -316,9 +314,9 @@ static void PositionThumb(FRAMEWND *pThumb, short nX, short nY) nNewX = rc.right - nWidth;
}
- if ( !bLeading && PtInRect(&rcTop, pt)) {
- nNewY = rc.top;
- bDockedRight = bDocked;
+ if (!bLeading && PtInRect(&rcTop, pt)) {
+ nNewY = rc.top;
+ bDockedRight = bDocked;
}
if (bMoveTogether) {
@@ -348,10 +346,10 @@ static void PositionThumb(FRAMEWND *pThumb, short nX, short nY) pt.x = rcThumb.right;
pt.y = rcThumb.bottom;
- if ( !bLeading && PtInRect(&rcLeft, pt))
+ if (!bLeading && PtInRect(&rcLeft, pt))
nNewX = rc.left - nWidth;
- if ( !bLeading && PtInRect(&rcTop, pt)) {
+ if (!bLeading && PtInRect(&rcTop, pt)) {
nNewY = rc.top - nHeight;
if (PtInRect(&rcRight, pt))
@@ -432,26 +430,26 @@ int DBLoadFrameSettingsAtPos(int pos, int Frameid) _itoa(pos, sadd, 10);
- Frames[Frameid].collapsed = cfg::getByte(CLUIFrameModule, AS(buf, "Collapse", sadd), Frames[Frameid].collapsed);
+ Frames[Frameid].collapsed = cfg::getByte(CLUIFrameModule, AS(buf, "Collapse", sadd), Frames[Frameid].collapsed);
- Frames[Frameid].Locked = cfg::getByte(CLUIFrameModule, AS(buf, "Locked", sadd), Frames[Frameid].Locked);
- Frames[Frameid].visible = cfg::getByte(CLUIFrameModule, AS(buf, "Visible", sadd), Frames[Frameid].visible);
- Frames[Frameid].TitleBar.ShowTitleBar = cfg::getByte(CLUIFrameModule, AS(buf, "TBVisile", sadd), Frames[Frameid].TitleBar.ShowTitleBar);
+ Frames[Frameid].Locked = cfg::getByte(CLUIFrameModule, AS(buf, "Locked", sadd), Frames[Frameid].Locked);
+ Frames[Frameid].visible = cfg::getByte(CLUIFrameModule, AS(buf, "Visible", sadd), Frames[Frameid].visible);
+ Frames[Frameid].TitleBar.ShowTitleBar = cfg::getByte(CLUIFrameModule, AS(buf, "TBVisile", sadd), Frames[Frameid].TitleBar.ShowTitleBar);
- Frames[Frameid].height = cfg::getWord(CLUIFrameModule, AS(buf, "Height", sadd), Frames[Frameid].height);
- Frames[Frameid].HeightWhenCollapsed = cfg::getWord(CLUIFrameModule, AS(buf, "HeightCollapsed", sadd), 0);
- Frames[Frameid].align = cfg::getWord(CLUIFrameModule, AS(buf, "Align", sadd), Frames[Frameid].align);
+ Frames[Frameid].height = cfg::getWord(CLUIFrameModule, AS(buf, "Height", sadd), Frames[Frameid].height);
+ Frames[Frameid].HeightWhenCollapsed = cfg::getWord(CLUIFrameModule, AS(buf, "HeightCollapsed", sadd), 0);
+ Frames[Frameid].align = cfg::getWord(CLUIFrameModule, AS(buf, "Align", sadd), Frames[Frameid].align);
- Frames[Frameid].FloatingPos.x = DBGetContactSettingRangedWord(0, CLUIFrameModule, AS(buf, "FloatX", sadd), 100, 0, 1024);
- Frames[Frameid].FloatingPos.y = DBGetContactSettingRangedWord(0, CLUIFrameModule, AS(buf, "FloatY", sadd), 100, 0, 1024);
- Frames[Frameid].FloatingSize.x = DBGetContactSettingRangedWord(0, CLUIFrameModule, AS(buf, "FloatW", sadd), 100, 0, 1024);
- Frames[Frameid].FloatingSize.y = DBGetContactSettingRangedWord(0, CLUIFrameModule, AS(buf, "FloatH", sadd), 100, 0, 1024);
+ Frames[Frameid].FloatingPos.x = DBGetContactSettingRangedWord(0, CLUIFrameModule, AS(buf, "FloatX", sadd), 100, 0, 1024);
+ Frames[Frameid].FloatingPos.y = DBGetContactSettingRangedWord(0, CLUIFrameModule, AS(buf, "FloatY", sadd), 100, 0, 1024);
+ Frames[Frameid].FloatingSize.x = DBGetContactSettingRangedWord(0, CLUIFrameModule, AS(buf, "FloatW", sadd), 100, 0, 1024);
+ Frames[Frameid].FloatingSize.y = DBGetContactSettingRangedWord(0, CLUIFrameModule, AS(buf, "FloatH", sadd), 100, 0, 1024);
- Frames[Frameid].floating = cfg::getByte(CLUIFrameModule, AS(buf, "Floating", sadd), 0);
- Frames[Frameid].order = cfg::getWord(CLUIFrameModule, AS(buf, "Order", sadd), 0);
+ Frames[Frameid].floating = cfg::getByte(CLUIFrameModule, AS(buf, "Floating", sadd), 0);
+ Frames[Frameid].order = cfg::getWord(CLUIFrameModule, AS(buf, "Order", sadd), 0);
- Frames[Frameid].UseBorder = cfg::getByte(CLUIFrameModule, AS(buf, "UseBorder", sadd), Frames[Frameid].UseBorder);
- Frames[Frameid].Skinned = cfg::getByte(CLUIFrameModule, AS(buf, "Skinned", sadd), Frames[Frameid].Skinned);
+ Frames[Frameid].UseBorder = cfg::getByte(CLUIFrameModule, AS(buf, "UseBorder", sadd), Frames[Frameid].UseBorder);
+ Frames[Frameid].Skinned = cfg::getByte(CLUIFrameModule, AS(buf, "Skinned", sadd), Frames[Frameid].Skinned);
return 0;
}
@@ -490,10 +488,10 @@ int LocateStorePosition(int Frameid, int maxstored) {
if (Frames[Frameid].name == NULL) return -1;
- for (int i = 0;i < maxstored;i++) {
+ for (int i = 0; i < maxstored; i++) {
char settingname[255];
mir_snprintf(settingname, sizeof(settingname), "Name%d", i);
- ptrT frmname( db_get_tsa(0, CLUIFrameModule, settingname));
+ ptrT frmname(db_get_tsa(0, CLUIFrameModule, settingname));
if (frmname == NULL) continue;
if (lstrcmpi(frmname, Frames[Frameid].name) == 0)
return i;
@@ -663,7 +661,7 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid, int root, int popuppos, HGENMENU mi.pszPopupName = (char *)root;
mi.popupPosition = frameid;
mi.position = popuppos++;
- mi.pszName = LPGEN("&Floating Mode");
+ mi.pszName = LPGEN("&Floating mode");
mi.flags = CMIF_CHILDPOPUP;
mi.pszService = "Set_Floating";
mi.pszContactOwner = 0;
@@ -1201,7 +1199,7 @@ INT_PTR CLUIFramesShowHideFrame(WPARAM wParam, LPARAM lParam) lockfrm();
pos = id2pos((INT_PTR)wParam);
- if (pos >= 0 && !lstrcmp(Frames[pos].name, _T("My Contacts")))
+ if (pos >= 0 && !lstrcmp(Frames[pos].name, _T("My contacts")))
Frames[pos].visible = 1;
else {
if (pos >= 0 && (int)pos < nFramescount)
@@ -1582,7 +1580,7 @@ static int CLUIFramesLoadMainMenu() mi.flags = CMIF_ROOTHANDLE;
mi.position = separator++;
mi.hParentMenu = MainMIRoot;
- mi.pszName = LPGEN("Show All Frames");
+ mi.pszName = LPGEN("Show all frames");
mi.pszService = MS_CLIST_FRAMES_SHOWALLFRAMES;
Menu_AddMainMenuItem(&mi);
@@ -2598,9 +2596,9 @@ LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA AppendMenu(hmenu, MF_SEPARATOR, 16, _T(""));
if (Frames[framepos].Locked)
- AppendMenu(hmenu, MF_STRING | MF_CHECKED, frame_menu_lock, TranslateT("Lock Frame"));
+ AppendMenu(hmenu, MF_STRING | MF_CHECKED, frame_menu_lock, TranslateT("Lock frame"));
else
- AppendMenu(hmenu, MF_STRING, frame_menu_lock, TranslateT("Lock Frame"));
+ AppendMenu(hmenu, MF_STRING, frame_menu_lock, TranslateT("Lock frame"));
if (Frames[framepos].visible)
AppendMenu(hmenu, MF_STRING | MF_CHECKED, frame_menu_visible, TranslateT("Visible"));
diff --git a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.h b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.h index 0174e37743..89ce883477 100644 --- a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.h +++ b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.h @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. int LoadCLUIFramesModule(void);
int UnLoadCLUIFramesModule(void);
int CLUIFramesGetMinHeight();
-int CLUIFramesOnClistResize(WPARAM wParam,LPARAM lParam);
+int CLUIFramesOnClistResize(WPARAM wParam, LPARAM lParam);
int SizeFramesByWindowRect(RECT *r);
int CLUIFramesResizeFrames(RECT *rc);
@@ -39,7 +39,7 @@ typedef struct {
int order;
int realpos;
-}SortData;
+} SortData;
@@ -81,8 +81,8 @@ struct FrameTitleBar struct DockOpt
{
- HWND hwndLeft;
- HWND hwndRight;
+ HWND hwndLeft;
+ HWND hwndRight;
};
struct FRAMEWND
@@ -120,7 +120,7 @@ struct FRAMEWND #define OFFSET_PROTOPOS 200
#define OFFSET_VISIBLE 400
-#define CLUIFrameTitleBarClassName _T("CLUIFrameTitleBar")
-#define CLUIFrameModule "CLUIFrames"
+#define CLUIFrameTitleBarClassName _T("CLUIFrameTitleBar")
+#define CLUIFrameModule "CLUIFrames"
#endif
diff --git a/plugins/Clist_nicer/src/CLUIFrames/framesmenu.cpp b/plugins/Clist_nicer/src/CLUIFrames/framesmenu.cpp index a8974665cc..8b2f6987b1 100644 --- a/plugins/Clist_nicer/src/CLUIFrames/framesmenu.cpp +++ b/plugins/Clist_nicer/src/CLUIFrames/framesmenu.cpp @@ -11,7 +11,7 @@ typedef struct{ char *szServiceName;
int Frameid;
INT_PTR param1;
-}FrameMenuExecParam,*lpFrameMenuExecParam;
+} FrameMenuExecParam, *lpFrameMenuExecParam;
INT_PTR FreeOwnerDataFrameMenu(WPARAM wParam, LPARAM lParam)
{
@@ -25,10 +25,10 @@ INT_PTR FreeOwnerDataFrameMenu(WPARAM wParam, LPARAM lParam) static INT_PTR AddContextFrameMenuItem(WPARAM wParam, LPARAM lParam)
{
- CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam;
+ CLISTMENUITEM *mi = (CLISTMENUITEM *)lParam;
TMO_MenuItem tmi;
- if ( !pcli->pfnConvertMenu(mi, &tmi))
+ if (!pcli->pfnConvertMenu(mi, &tmi))
return NULL;
tmi.root = (mi->flags & CMIF_ROOTHANDLE) ? mi->hParentMenu : NULL;
@@ -47,7 +47,7 @@ static INT_PTR AddContextFrameMenuItem(WPARAM wParam, LPARAM lParam) static INT_PTR RemoveContextFrameMenuItem(WPARAM wParam, LPARAM lParam)
{
- CallService(MO_REMOVEMENUITEM,wParam,0);
+ CallService(MO_REMOVEMENUITEM, wParam, 0);
return 0;
}
@@ -61,7 +61,7 @@ INT_PTR FrameMenuExecService(WPARAM wParam, LPARAM lParam) return -1;
CallService(fmep->szServiceName, lParam, fmep->param1);
- RedrawWindow(pcli->hwndContactList,NULL,NULL,RDW_INVALIDATE|RDW_ERASE|RDW_FRAME|RDW_UPDATENOW|RDW_ALLCHILDREN);
+ RedrawWindow(pcli->hwndContactList, NULL, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN);
return 0;
}
@@ -86,13 +86,13 @@ INT_PTR FrameMenuCheckService(WPARAM wParam, LPARAM lParam) static INT_PTR ContextFrameMenuNotify(WPARAM wParam, LPARAM lParam)
{
- NotifyEventHooks(hPreBuildFrameMenuEvent,wParam,lParam);
+ NotifyEventHooks(hPreBuildFrameMenuEvent, wParam, lParam);
return 0;
}
-static INT_PTR BuildContextFrameMenu(WPARAM wParam,LPARAM lParam)
+static INT_PTR BuildContextFrameMenu(WPARAM wParam, LPARAM lParam)
{
- ListParam param = { 0 };
+ ListParam param = {0};
param.MenuObjectHandle = hFrameMenuObject;
param.wParam = wParam;
param.lParam = lParam;
diff --git a/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp b/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp index e7d6a0f438..4fd3471746 100644 --- a/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp +++ b/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp @@ -46,7 +46,7 @@ HGENMENU hNewSubGroupMenuItem; int NewGroupIconidx;
extern HIMAGELIST hCListImages;
-extern HICON LoadIconFromExternalFile (char *filename,int i,boolean UseLibrary,boolean registerit,char *IconName,char *SectName,char *Description,int internalidx);
+extern HICON LoadIconFromExternalFile(char *filename, int i, boolean UseLibrary, boolean registerit, char *IconName, char *SectName, char *Description, int internalidx);
void InitSubGroupMenus(void);
@@ -54,44 +54,43 @@ void InitSubGroupMenus(void); typedef struct {
char *szServiceName;
int Param1,Param2;
-}GroupMenuExecParam,*lpGroupMenuExecParam;
+} GroupMenuExecParam, *lpGroupMenuExecParam;
/*
wparam=handle to the menu item returned by MS_CLIST_ADDCONTACTMENUITEM
return 0 on success.
*/
-static INT_PTR RemoveGroupMenuItem(WPARAM wParam,LPARAM lParam)
+static INT_PTR RemoveGroupMenuItem(WPARAM wParam, LPARAM lParam)
{
- CallService(MO_REMOVEMENUITEM,wParam,0);
+ CallService(MO_REMOVEMENUITEM, wParam, 0);
return 0;
}
-
-static INT_PTR BuildGroupMenu(WPARAM wParam,LPARAM lParam)
+static INT_PTR BuildGroupMenu(WPARAM wParam, LPARAM lParam)
{
int tick;
HMENU hMenu;
- ListParam param = { 0 };
- param.MenuObjectHandle=hGroupMenuObject;
+ ListParam param = {0};
+ param.MenuObjectHandle = hGroupMenuObject;
- //hMenu=hMainMenu;
- hMenu=CreatePopupMenu();
- //hMenu=wParam;
- tick=GetTickCount();
+ //hMenu = hMainMenu;
+ hMenu = CreatePopupMenu();
+ //hMenu = wParam;
+ tick = GetTickCount();
- NotifyEventHooks(hPreBuildGroupMenuEvent,0,0);
+ NotifyEventHooks(hPreBuildGroupMenuEvent, 0, 0);
- CallService(MO_BUILDMENU,(WPARAM)hMenu,(LPARAM)¶m);
+ CallService(MO_BUILDMENU, (WPARAM)hMenu, (LPARAM)¶m);
//DrawMenuBar((HWND)CallService("CLUI/GetHwnd",0,0));
- tick=GetTickCount()-tick;
- return(INT_PTR)hMenu;
+ tick = GetTickCount() - tick;
+ return (INT_PTR)hMenu;
}
-static INT_PTR AddGroupMenuItem(WPARAM wParam,LPARAM lParam)
+static INT_PTR AddGroupMenuItem(WPARAM wParam, LPARAM lParam)
{
TMO_MenuItem tmi;
- CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam;
- if ( !pcli->pfnConvertMenu(mi, &tmi))
+ CLISTMENUITEM *mi = (CLISTMENUITEM *)lParam;
+ if (!pcli->pfnConvertMenu(mi, &tmi))
return NULL;
lpGroupMenuExecParam mmep = (lpGroupMenuExecParam)mir_alloc(sizeof(GroupMenuExecParam));
@@ -101,51 +100,51 @@ static INT_PTR AddGroupMenuItem(WPARAM wParam,LPARAM lParam) //we need just one parametr.
mmep->szServiceName = mir_strdup(mi->pszService);
mmep->Param1 = mi->popupPosition;
- lpGroupMenuParam gmp=(lpGroupMenuParam)wParam;
+ lpGroupMenuParam gmp = (lpGroupMenuParam)wParam;
if (gmp != NULL) {
mmep->Param1 = gmp->wParam;
mmep->Param2 = gmp->lParam;
}
- tmi.ownerdata=mmep;
+ tmi.ownerdata = mmep;
char buf[1024];
mir_snprintf(buf, SIZEOF(buf), "%s/%s", mi->pszService, mi->pszName);
OptParam op;
- op.Handle=(HANDLE)CallService(MO_ADDNEWMENUITEM,(WPARAM)hGroupMenuObject,(LPARAM)&tmi);
- op.Setting=OPT_MENUITEMSETUNIQNAME;
- op.Value=(INT_PTR)buf;
- CallService(MO_SETOPTIONSMENUITEM,0,(LPARAM)&op);
+ op.Handle = (HANDLE)CallService(MO_ADDNEWMENUITEM, (WPARAM)hGroupMenuObject, (LPARAM)&tmi);
+ op.Setting = OPT_MENUITEMSETUNIQNAME;
+ op.Value = (INT_PTR)buf;
+ CallService(MO_SETOPTIONSMENUITEM, 0, (LPARAM)&op);
return (INT_PTR)op.Handle;
}
-INT_PTR GroupMenuCheckService(WPARAM wParam,LPARAM lParam)
+INT_PTR GroupMenuCheckService(WPARAM wParam, LPARAM lParam)
{
return 0;
}
-INT_PTR GroupMenuonAddService(WPARAM wParam,LPARAM lParam)
+INT_PTR GroupMenuonAddService(WPARAM wParam, LPARAM lParam)
{
- MENUITEMINFO *mii=(MENUITEMINFO* )wParam;
- if (mii==NULL) return 0;
+ MENUITEMINFO *mii = (MENUITEMINFO *)wParam;
+ if (mii == NULL) return 0;
- if (hHideShowMainMenuItem==(HANDLE)lParam) {
- mii->fMask|=MIIM_STATE;
- mii->fState|=MFS_DEFAULT;
+ if (hHideShowMainMenuItem == (HANDLE)lParam) {
+ mii->fMask |= MIIM_STATE;
+ mii->fState |= MFS_DEFAULT;
}
- if (hGroupMainMenuItemProxy==(HANDLE)lParam) {
- mii->fMask|=MIIM_SUBMENU;
- //mi.fType=MFT_STRING;
- mii->hSubMenu=(HMENU)CallService(MS_CLIST_MENUGETMAIN,0,0);
+ if (hGroupMainMenuItemProxy == (HANDLE)lParam) {
+ mii->fMask |= MIIM_SUBMENU;
+ //mi.fType = MFT_STRING;
+ mii->hSubMenu = (HMENU)CallService(MS_CLIST_MENUGETMAIN, 0, 0);
}
- if (hGroupStatusMenuItemProxy==(HANDLE)lParam) {
- mii->fMask|=MIIM_SUBMENU;
- //mi.fType=MFT_STRING;
- mii->hSubMenu=(HMENU)CallService(MS_CLIST_MENUGETSTATUS,0,0);
+ if (hGroupStatusMenuItemProxy == (HANDLE)lParam) {
+ mii->fMask |= MIIM_SUBMENU;
+ //mi.fType = MFT_STRING;
+ mii->hSubMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS, 0, 0);
}
- if (hAppearanceMenuItemProxy==(HANDLE)lParam) {
+ if (hAppearanceMenuItemProxy == (HANDLE)lParam) {
hMenuOldContext = GetSubMenu(LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_CONTEXT)), 3);
TranslateMenu(hMenuOldContext);
@@ -155,30 +154,28 @@ INT_PTR GroupMenuonAddService(WPARAM wParam,LPARAM lParam) CheckMenuItem(hMenuOldContext, POPUP_SHOWSTATUSICONS, MF_BYCOMMAND | (cfg::dat.dwFlags & CLUI_FRAME_STATUSICONS ? MF_CHECKED : MF_UNCHECKED));
mii->fMask |= MIIM_SUBMENU;
- mii->hSubMenu=(HMENU)hMenuOldContext;
+ mii->hSubMenu = (HMENU)hMenuOldContext;
}
- return(TRUE);
+ return (TRUE);
};
-
//called with:
//wparam - ownerdata
//lparam - lparam from winproc
-INT_PTR GroupMenuExecService(WPARAM wParam,LPARAM lParam)
+INT_PTR GroupMenuExecService(WPARAM wParam, LPARAM lParam)
{
- if (wParam!=0) {
- lpGroupMenuExecParam mmep=(lpGroupMenuExecParam)wParam;
- if ( !strcmp(mmep->szServiceName,"Help/AboutCommand")) {
+ if (wParam != 0) {
+ lpGroupMenuExecParam mmep = (lpGroupMenuExecParam)wParam;
+ if (!strcmp(mmep->szServiceName, "Help/AboutCommand")) {
//bug in help.c,it used wparam as parent window handle without reason.
- mmep->Param1=0;
- CallService(mmep->szServiceName,mmep->Param1,lParam);
- }
- else {
- CallService(mmep->szServiceName,mmep->Param1,mmep->Param2);
+ mmep->Param1 = 0;
+ CallService(mmep->szServiceName, mmep->Param1, lParam);
}
+ else
+ CallService(mmep->szServiceName, mmep->Param1, mmep->Param2);
- };
- return(1);
+ }
+ return 1;
}
INT_PTR FreeOwnerDataGroupMenu(WPARAM wParam, LPARAM lParam)
@@ -191,45 +188,43 @@ INT_PTR FreeOwnerDataGroupMenu(WPARAM wParam, LPARAM lParam) return 0;
}
-INT_PTR HideGroupsHelper(WPARAM wParam,LPARAM lParam)
+INT_PTR HideGroupsHelper(WPARAM wParam, LPARAM lParam)
{
- int newVal=!(GetWindowLongPtr((HWND)CallService(MS_CLUI_GETHWNDTREE,0,0),GWL_STYLE)&CLS_HIDEEMPTYGROUPS);
- cfg::writeByte("CList","HideEmptyGroups",(BYTE)newVal);
- SendMessage((HWND)CallService(MS_CLUI_GETHWNDTREE,0,0),CLM_SETHIDEEMPTYGROUPS,newVal,0);
+ int newVal = !(GetWindowLongPtr((HWND)CallService(MS_CLUI_GETHWNDTREE, 0, 0), GWL_STYLE) & CLS_HIDEEMPTYGROUPS);
+ cfg::writeByte("CList", "HideEmptyGroups", (BYTE)newVal);
+ SendMessage((HWND)CallService(MS_CLUI_GETHWNDTREE, 0, 0), CLM_SETHIDEEMPTYGROUPS, newVal, 0);
return 0;
}
-INT_PTR UseGroupsHelper(WPARAM wParam,LPARAM lParam)
+INT_PTR UseGroupsHelper(WPARAM wParam, LPARAM lParam)
{
- int newVal=!(GetWindowLongPtr((HWND)CallService(MS_CLUI_GETHWNDTREE,0,0),GWL_STYLE)&CLS_USEGROUPS);
- cfg::writeByte("CList","UseGroups",(BYTE)newVal);
- SendMessage((HWND)CallService(MS_CLUI_GETHWNDTREE,0,0),CLM_SETUSEGROUPS,newVal,0);
+ int newVal = !(GetWindowLongPtr((HWND)CallService(MS_CLUI_GETHWNDTREE, 0, 0), GWL_STYLE) & CLS_USEGROUPS);
+ cfg::writeByte("CList", "UseGroups", (BYTE)newVal);
+ SendMessage((HWND)CallService(MS_CLUI_GETHWNDTREE, 0, 0), CLM_SETUSEGROUPS, newVal,0);
return 0;
}
-INT_PTR HideOfflineRootHelper(WPARAM wParam,LPARAM lParam)
+INT_PTR HideOfflineRootHelper(WPARAM wParam, LPARAM lParam)
{
- SendMessage(
- (HWND)CallService(MS_CLUI_GETHWNDTREE,0,0),
- CLM_SETHIDEOFFLINEROOT,
- !SendMessage((HWND)CallService(MS_CLUI_GETHWNDTREE,0,0),CLM_GETHIDEOFFLINEROOT,0,0),
+ SendMessage((HWND)CallService(MS_CLUI_GETHWNDTREE, 0, 0), CLM_SETHIDEOFFLINEROOT,
+ !SendMessage((HWND)CallService(MS_CLUI_GETHWNDTREE, 0, 0), CLM_GETHIDEOFFLINEROOT, 0, 0),
0);
return 0;
}
-static int OnBuildGroupMenu(WPARAM wParam,LPARAM lParam)
+static int OnBuildGroupMenu(WPARAM wParam, LPARAM lParam)
{
CLISTMENUITEM mi = { sizeof(mi) };
- mi.flags = CMIM_FLAGS | (cfg::getByte("CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT)?CMIF_CHECKED:0);
+ mi.flags = CMIM_FLAGS | (cfg::getByte("CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? CMIF_CHECKED : 0);
Menu_ModifyItem(hHideOfflineUsersMenuItem, &mi);
- mi.flags = CMIM_FLAGS | (SendMessage(pcli->hwndContactTree,CLM_GETHIDEOFFLINEROOT,0,0)?CMIF_CHECKED:0);
+ mi.flags = CMIM_FLAGS | (SendMessage(pcli->hwndContactTree, CLM_GETHIDEOFFLINEROOT, 0, 0) ? CMIF_CHECKED : 0);
Menu_ModifyItem(hHideOfflineUsersOutHereMenuItem, &mi);
- mi.flags = CMIM_FLAGS | (GetWindowLongPtr(pcli->hwndContactTree,GWL_STYLE)&CLS_HIDEEMPTYGROUPS?CMIF_CHECKED:0);
+ mi.flags = CMIM_FLAGS | (GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & CLS_HIDEEMPTYGROUPS ? CMIF_CHECKED : 0);
Menu_ModifyItem(hHideEmptyGroupsMenuItem, &mi);
- mi.flags = CMIM_FLAGS | (GetWindowLongPtr(pcli->hwndContactTree,GWL_STYLE)&CLS_USEGROUPS?0:CMIF_CHECKED);
+ mi.flags = CMIM_FLAGS | (GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & CLS_USEGROUPS ? 0 : CMIF_CHECKED);
Menu_ModifyItem(hDisableGroupsMenuItem, &mi);
mi.flags = CMIM_FLAGS;
@@ -240,7 +235,7 @@ static int OnBuildGroupMenu(WPARAM wParam,LPARAM lParam) return 0;
}
-int static OnIconLibIconChanged(WPARAM wParam,LPARAM lParam)
+int static OnIconLibIconChanged(WPARAM wParam, LPARAM lParam)
{
CLISTMENUITEM clmi = { sizeof(clmi) };
clmi.flags = CMIM_ICON;
@@ -252,18 +247,18 @@ int static OnIconLibIconChanged(WPARAM wParam,LPARAM lParam) void InitGroupMenus(void)
{
- CreateServiceFunction("CLISTMENUSGroup/ExecService",GroupMenuExecService);
- CreateServiceFunction("CLISTMENUSGroup/FreeOwnerDataGroupMenu",FreeOwnerDataGroupMenu);
- CreateServiceFunction("CLISTMENUSGroup/GroupMenuonAddService",GroupMenuonAddService);
- CreateServiceFunction("CLISTMENUSGroup/HideGroupsHelper",HideGroupsHelper);
- CreateServiceFunction("CLISTMENUSGroup/UseGroupsHelper",UseGroupsHelper);
- CreateServiceFunction("CLISTMENUSGroup/HideOfflineRootHelper",HideOfflineRootHelper);
-
- CreateServiceFunction("CList/AddGroupMenuItem",AddGroupMenuItem);
- CreateServiceFunction(MS_CLIST_REMOVEGROUPMENUITEM,RemoveGroupMenuItem);
- CreateServiceFunction(MS_CLIST_MENUBUILDGROUP,BuildGroupMenu);
+ CreateServiceFunction("CLISTMENUSGroup/ExecService", GroupMenuExecService);
+ CreateServiceFunction("CLISTMENUSGroup/FreeOwnerDataGroupMenu", FreeOwnerDataGroupMenu);
+ CreateServiceFunction("CLISTMENUSGroup/GroupMenuonAddService", GroupMenuonAddService);
+ CreateServiceFunction("CLISTMENUSGroup/HideGroupsHelper", HideGroupsHelper);
+ CreateServiceFunction("CLISTMENUSGroup/UseGroupsHelper", UseGroupsHelper);
+ CreateServiceFunction("CLISTMENUSGroup/HideOfflineRootHelper", HideOfflineRootHelper);
+
+ CreateServiceFunction("CList/AddGroupMenuItem", AddGroupMenuItem);
+ CreateServiceFunction(MS_CLIST_REMOVEGROUPMENUITEM, RemoveGroupMenuItem);
+ CreateServiceFunction(MS_CLIST_MENUBUILDGROUP, BuildGroupMenu);
hPreBuildGroupMenuEvent = CreateHookableEvent(ME_CLIST_PREBUILDGROUPMENU);
- HookEvent(ME_CLIST_PREBUILDGROUPMENU,OnBuildGroupMenu);
+ HookEvent(ME_CLIST_PREBUILDGROUPMENU, OnBuildGroupMenu);
InitSubGroupMenus();
@@ -277,106 +272,108 @@ void InitGroupMenus(void) GroupMenuParam gmp;
CLISTMENUITEM mi = { sizeof(mi) };
- mi.position=1900000;
- mi.pszService="CloseAction";
- mi.pszName=LPGEN("E&xit");
- AddGroupMenuItem(0,(LPARAM)&mi);
-
- memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=500;
- mi.pszService=MS_CLIST_SHOWHIDE;
- mi.pszName=LPGEN("&Hide/Show");
- hHideShowMainMenuItem = (HGENMENU)AddGroupMenuItem(0,(LPARAM)&mi);
-
- memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=200000;
- mi.icolibItem=LoadSkinnedIconHandle(SKINICON_OTHER_FINDUSER); //LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_FINDUSER));
- mi.pszService="FindAdd/FindAddCommand";
- mi.pszName=LPGEN("&Find/Add Contacts...");
- AddGroupMenuItem(0,(LPARAM)&mi);
-
- memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=300000;
- mi.pszService="";
- mi.pszName=LPGEN("&Main menu");
- hGroupMainMenuItemProxy = (HGENMENU)AddGroupMenuItem(0,(LPARAM)&mi);
-
- memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=300100;
- mi.pszService="";
- mi.pszName=LPGEN("&Status");
- hGroupStatusMenuItemProxy = (HGENMENU)AddGroupMenuItem(0,(LPARAM)&mi);
-
- memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=390100;
- mi.pszService="";
- mi.pszName=LPGEN("Appearance");
- hAppearanceMenuItemProxy = (HGENMENU)AddGroupMenuItem(0,(LPARAM)&mi);
-
- memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=400000;
- mi.icolibItem=LoadSkinnedIconHandle(SKINICON_OTHER_OPTIONS); //LoadIcon(GetModuleHandle(NULL),MAKEINTRESOURCE(IDI_OPTIONS));
- mi.pszService="Options/OptionsCommand";
- mi.pszName=LPGEN("&Options...");
-
- AddGroupMenuItem(0,(LPARAM)&mi);
-
- memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=500000;
- mi.icolibItem=LoadSkinnedIconHandle(SKINICON_OTHER_MIRANDA); //LoadIcon(GetModuleHandle(NULL),MAKEINTRESOURCE(IDI_MIRANDA));
- mi.pszService="CLN/About";
- mi.pszName=LPGEN("&About the contact list...");
-
- AddGroupMenuItem(0,(LPARAM)&mi);
-
- memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=100000;
- mi.hIcon=ImageList_GetIcon(hCListImages,NewGroupIconidx,0);
- mi.pszService="CLISTMENUSSubGroup/GroupMenuExecProxy";
- mi.pszName=LPGEN("&New Group");
- gmp.lParam=0;gmp.wParam=POPUP_NEWGROUP;
- hNewGroupMenuItem = (HGENMENU)AddGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
-
- memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=100001;
- mi.hIcon=NULL;
- mi.pszService=MS_CLIST_SETHIDEOFFLINE;
- mi.pszName=LPGEN("&Hide Offline Users");
- gmp.lParam=0;gmp.wParam=-1;
- hHideOfflineUsersMenuItem = (HGENMENU)AddGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
-
- memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=100002;
- mi.hIcon=NULL;
- mi.pszService="CLISTMENUSGroup/HideOfflineRootHelper";
- mi.pszName=LPGEN("Hide &Offline Users out here");
- hHideOfflineUsersOutHereMenuItem = (HGENMENU)AddGroupMenuItem(0,(LPARAM)&mi);
-
- memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=100003;
- mi.hIcon=NULL;
- mi.pszService="CLISTMENUSGroup/HideGroupsHelper";
- mi.pszName=LPGEN("Hide &Empty Groups");
- hHideEmptyGroupsMenuItem = (HGENMENU)AddGroupMenuItem(0,(LPARAM)&mi);
-
- memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=100004;
- mi.hIcon=NULL;
- mi.pszService="CLISTMENUSGroup/UseGroupsHelper";
- mi.pszName=LPGEN("Disable &Groups");
- hDisableGroupsMenuItem = (HGENMENU)AddGroupMenuItem(0,(LPARAM)&mi);
+ mi.position = 1900000;
+ mi.pszService = "CloseAction";
+ mi.pszName = LPGEN("E&xit");
+ AddGroupMenuItem(0, (LPARAM)&mi);
+
+ memset(&mi, 0, sizeof(mi));
+ mi.cbSize = sizeof(mi);
+ mi.position = 500;
+ mi.pszService = MS_CLIST_SHOWHIDE;
+ mi.pszName = LPGEN("&Hide/Show");
+ hHideShowMainMenuItem = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
+
+ memset(&mi, 0, sizeof(mi));
+ mi.cbSize = sizeof(mi);
+ mi.position = 200000;
+ mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_FINDUSER); //LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_FINDUSER));
+ mi.pszService = "FindAdd/FindAddCommand";
+ mi.pszName = LPGEN("&Find/Add contacts...");
+ AddGroupMenuItem(0, (LPARAM)&mi);
+
+ memset(&mi, 0, sizeof(mi));
+ mi.cbSize = sizeof(mi);
+ mi.position = 300000;
+ mi.pszService = "";
+ mi.pszName = LPGEN("&Main menu");
+ hGroupMainMenuItemProxy = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
+
+ memset(&mi, 0, sizeof(mi));
+ mi.cbSize = sizeof(mi);
+ mi.position = 300100;
+ mi.pszService = "";
+ mi.pszName = LPGEN("&Status");
+ hGroupStatusMenuItemProxy = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
+
+ memset(&mi, 0, sizeof(mi));
+ mi.cbSize = sizeof(mi);
+ mi.position = 390100;
+ mi.pszService = "";
+ mi.pszName = LPGEN("Appearance");
+ hAppearanceMenuItemProxy = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
+
+ memset(&mi, 0, sizeof(mi));
+ mi.cbSize = sizeof(mi);
+ mi.position = 400000;
+ mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_OPTIONS); //LoadIcon(GetModuleHandle(NULL),MAKEINTRESOURCE(IDI_OPTIONS));
+ mi.pszService = "Options/OptionsCommand";
+ mi.pszName = LPGEN("&Options...");
+
+ AddGroupMenuItem(0, (LPARAM)&mi);
+
+ memset(&mi, 0, sizeof(mi));
+ mi.cbSize = sizeof(mi);
+ mi.position = 500000;
+ mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_MIRANDA); //LoadIcon(GetModuleHandle(NULL),MAKEINTRESOURCE(IDI_MIRANDA));
+ mi.pszService = "CLN/About";
+ mi.pszName = LPGEN("&About the contact list...");
+
+ AddGroupMenuItem(0, (LPARAM)&mi);
+
+ memset(&mi, 0, sizeof(mi));
+ mi.cbSize = sizeof(mi);
+ mi.position = 100000;
+ mi.hIcon = ImageList_GetIcon(hCListImages, NewGroupIconidx, 0);
+ mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
+ mi.pszName = LPGEN("&New group");
+ gmp.lParam = 0;
+ gmp.wParam = POPUP_NEWGROUP;
+ hNewGroupMenuItem = (HGENMENU)AddGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi);
+
+ memset(&mi, 0, sizeof(mi));
+ mi.cbSize = sizeof(mi);
+ mi.position = 100001;
+ mi.hIcon = NULL;
+ mi.pszService = MS_CLIST_SETHIDEOFFLINE;
+ mi.pszName = LPGEN("&Hide offline users");
+ gmp.lParam = 0;
+ gmp.wParam = -1;
+ hHideOfflineUsersMenuItem = (HGENMENU)AddGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi);
+
+ memset(&mi, 0, sizeof(mi));
+ mi.cbSize = sizeof(mi);
+ mi.position = 100002;
+ mi.hIcon = NULL;
+ mi.pszService = "CLISTMENUSGroup/HideOfflineRootHelper";
+ mi.pszName = LPGEN("Hide &offline users out here");
+ hHideOfflineUsersOutHereMenuItem = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
+
+ memset(&mi, 0, sizeof(mi));
+ mi.cbSize = sizeof(mi);
+ mi.position = 100003;
+ mi.hIcon = NULL;
+ mi.pszService = "CLISTMENUSGroup/HideGroupsHelper";
+ mi.pszName = LPGEN("Hide &empty groups");
+ hHideEmptyGroupsMenuItem = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
+
+ memset(&mi, 0, sizeof(mi));
+ mi.cbSize = sizeof(mi);
+ mi.position = 100004;
+ mi.hIcon = NULL;
+ mi.pszService = "CLISTMENUSGroup/UseGroupsHelper";
+ mi.pszName = LPGEN("Disable &groups");
+ hDisableGroupsMenuItem = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
}
}
@@ -391,52 +388,52 @@ HGENMENU hHideOfflineUsersHereMenuItem; //SubGroupmenu exec param(ownerdata)
typedef struct {
char *szServiceName;
- int Param1,Param2;
-}SubGroupMenuExecParam,*lpSubGroupMenuExecParam;
+ int Param1, Param2;
+} SubGroupMenuExecParam, *lpSubGroupMenuExecParam;
/*
wparam=handle to the menu item returned by MS_CLIST_ADDCONTACTMENUITEM
return 0 on success.
*/
-static INT_PTR RemoveSubGroupMenuItem(WPARAM wParam,LPARAM lParam)
+static INT_PTR RemoveSubGroupMenuItem(WPARAM wParam, LPARAM lParam)
{
- CallService(MO_REMOVEMENUITEM,wParam,0);
+ CallService(MO_REMOVEMENUITEM, wParam, 0);
return 0;
}
-static int OnBuildSubGroupMenu(WPARAM wParam,LPARAM lParam)
+static int OnBuildSubGroupMenu(WPARAM wParam, LPARAM lParam)
{
- ClcGroup *group=(ClcGroup *)wParam;
+ ClcGroup *group = (ClcGroup *)wParam;
if (group == 0)
return 0;
//contact->group
CLISTMENUITEM mi = { sizeof(mi) };
- mi.flags = CMIM_FLAGS | (group->hideOffline?CMIF_CHECKED:0);
+ mi.flags = CMIM_FLAGS | (group->hideOffline ? CMIF_CHECKED : 0);
Menu_ModifyItem(hHideOfflineUsersHereMenuItem, &mi);
return 0;
}
-static INT_PTR BuildSubGroupMenu(WPARAM wParam,LPARAM lParam)
+static INT_PTR BuildSubGroupMenu(WPARAM wParam, LPARAM lParam)
{
- ListParam param = { 0 };
+ ListParam param = {0};
param.MenuObjectHandle = hSubGroupMenuObject;
param.wParam = wParam;
HMENU hMenu = CreatePopupMenu();
int tick = GetTickCount();
- NotifyEventHooks(hPreBuildSubGroupMenuEvent,wParam,0);
+ NotifyEventHooks(hPreBuildSubGroupMenuEvent, wParam, 0);
- CallService(MO_BUILDMENU,(WPARAM)hMenu,(LPARAM)¶m);
- tick = GetTickCount()-tick;
- return(INT_PTR)hMenu;
+ CallService(MO_BUILDMENU, (WPARAM)hMenu, (LPARAM)¶m);
+ tick = GetTickCount() - tick;
+ return (INT_PTR)hMenu;
}
-static INT_PTR AddSubGroupMenuItem(WPARAM wParam,LPARAM lParam)
+static INT_PTR AddSubGroupMenuItem(WPARAM wParam, LPARAM lParam)
{
TMO_MenuItem tmi;
- CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam;
- if ( !pcli->pfnConvertMenu(mi, &tmi))
+ CLISTMENUITEM *mi = (CLISTMENUITEM *)lParam;
+ if (!pcli->pfnConvertMenu(mi, &tmi))
return NULL;
lpSubGroupMenuExecParam mmep = (lpSubGroupMenuExecParam)mir_alloc(sizeof(SubGroupMenuExecParam));
@@ -444,7 +441,7 @@ static INT_PTR AddSubGroupMenuItem(WPARAM wParam,LPARAM lParam) return 0;
//we need just one parametr.
- lpGroupMenuParam gmp=(lpGroupMenuParam)wParam;
+ lpGroupMenuParam gmp = (lpGroupMenuParam)wParam;
mmep->szServiceName = mir_strdup(mi->pszService);
mmep->Param1 = mi->popupPosition;
if (gmp != NULL) {
@@ -457,68 +454,62 @@ static INT_PTR AddSubGroupMenuItem(WPARAM wParam,LPARAM lParam) mir_snprintf(buf, SIZEOF(buf), "%s/%s", mi->pszService, mi->pszName);
OptParam op;
- op.Handle=(HANDLE)CallService(MO_ADDNEWMENUITEM,(WPARAM)hSubGroupMenuObject,(LPARAM)&tmi);
- op.Setting=OPT_MENUITEMSETUNIQNAME;
- op.Value=(INT_PTR)buf;
- CallService(MO_SETOPTIONSMENUITEM,0,(LPARAM)&op);
+ op.Handle = (HANDLE)CallService(MO_ADDNEWMENUITEM, (WPARAM)hSubGroupMenuObject, (LPARAM)&tmi);
+ op.Setting = OPT_MENUITEMSETUNIQNAME;
+ op.Value = (INT_PTR)buf;
+ CallService(MO_SETOPTIONSMENUITEM, 0, (LPARAM)&op);
return (INT_PTR)op.Handle;
}
-INT_PTR SubGroupMenuCheckService(WPARAM wParam,LPARAM lParam) {
+INT_PTR SubGroupMenuCheckService(WPARAM wParam, LPARAM lParam) {
//not used
return 0;
};
-INT_PTR SubGroupMenuonAddService(WPARAM wParam,LPARAM lParam) {
+INT_PTR SubGroupMenuonAddService(WPARAM wParam, LPARAM lParam) {
- MENUITEMINFO *mii=(MENUITEMINFO* )wParam;
+ MENUITEMINFO *mii = (MENUITEMINFO *)wParam;
- if (mii==NULL) return 0;
+ if (mii == NULL) return 0;
/*
- if (hHideShowMainMenuItem==(HANDLE)lParam)
- {
- mii->fMask|=MIIM_STATE;
- mii->fState|=MFS_DEFAULT;
-
+ if (hHideShowMainMenuItem == (HANDLE)lParam) {
+ mii->fMask |= MIIM_STATE;
+ mii->fState |= MFS_DEFAULT;
}
- if (hSubGroupMainMenuItemProxy==(HANDLE)lParam)
- {
- mii->fMask|=MIIM_SUBMENU;
- //mi.fType=MFT_STRING;
- mii->hSubMenu=(HMENU)CallService(MS_CLIST_MENUGETMAIN,0,0);
+ if (hSubGroupMainMenuItemProxy == (HANDLE)lParam) {
+ mii->fMask |= MIIM_SUBMENU;
+ //mi.fType = MFT_STRING;
+ mii->hSubMenu = (HMENU)CallService(MS_CLIST_MENUGETMAIN, 0, 0);
}
- if (hSubGroupStatusMenuItemProxy==(HANDLE)lParam)
- {
- mii->fMask|=MIIM_SUBMENU;
- //mi.fType=MFT_STRING;
- mii->hSubMenu=(HMENU)CallService(MS_CLIST_MENUGETSTATUS,0,0);
+ if (hSubGroupStatusMenuItemProxy == (HANDLE)lParam) {
+ mii->fMask |= MIIM_SUBMENU;
+ //mi.fType = MFT_STRING;
+ mii->hSubMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS, 0, 0);
}
*/
- return(TRUE);
+ return TRUE;
};
-
//called with:
//wparam - ownerdata
//lparam - lparam from winproc
-INT_PTR SubGroupMenuExecService(WPARAM wParam,LPARAM lParam) {
+INT_PTR SubGroupMenuExecService(WPARAM wParam, LPARAM lParam) {
if (wParam!=0) {
- lpSubGroupMenuExecParam mmep=(lpSubGroupMenuExecParam)wParam;
- if ( !strcmp(mmep->szServiceName,"Help/AboutCommand")) {
+ lpSubGroupMenuExecParam mmep = (lpSubGroupMenuExecParam)wParam;
+ if (!strcmp(mmep->szServiceName, "Help/AboutCommand")) {
//bug in help.c,it used wparam as parent window handle without reason.
- mmep->Param1=0;
- CallService(mmep->szServiceName,mmep->Param1,lParam);
- }
- else {
- CallService(mmep->szServiceName,mmep->Param1,mmep->Param2);
+ mmep->Param1 = 0;
+ CallService(mmep->szServiceName, mmep->Param1, lParam);
}
+ else
+ CallService(mmep->szServiceName, mmep->Param1, mmep->Param2);
}
- return(1);
+ return 1;
}
-INT_PTR FreeOwnerDataSubGroupMenu (WPARAM wParam,LPARAM lParam)
+INT_PTR FreeOwnerDataSubGroupMenu (WPARAM wParam, LPARAM lParam)
{
lpSubGroupMenuExecParam mmep = (lpSubGroupMenuExecParam)lParam;
if (mmep != NULL) {
@@ -529,28 +520,28 @@ INT_PTR FreeOwnerDataSubGroupMenu (WPARAM wParam,LPARAM lParam) }
//wparam menu handle to pass to clc.c
-INT_PTR GroupMenuExecProxy(WPARAM wParam,LPARAM lParam)
+INT_PTR GroupMenuExecProxy(WPARAM wParam, LPARAM lParam)
{
- SendMessage((HWND)CallService(MS_CLUI_GETHWNDTREE,0,0),WM_COMMAND,wParam,0);
+ SendMessage((HWND)CallService(MS_CLUI_GETHWNDTREE, 0, 0), WM_COMMAND, wParam, 0);
return 0;
}
void InitSubGroupMenus(void)
{
- CreateServiceFunction("CLISTMENUSSubGroup/ExecService",SubGroupMenuExecService);
- CreateServiceFunction("CLISTMENUSSubGroup/FreeOwnerDataSubGroupMenu",FreeOwnerDataSubGroupMenu);
- CreateServiceFunction("CLISTMENUSSubGroup/SubGroupMenuonAddService",SubGroupMenuonAddService);
- CreateServiceFunction("CLISTMENUSSubGroup/GroupMenuExecProxy",GroupMenuExecProxy);
+ CreateServiceFunction("CLISTMENUSSubGroup/ExecService", SubGroupMenuExecService);
+ CreateServiceFunction("CLISTMENUSSubGroup/FreeOwnerDataSubGroupMenu", FreeOwnerDataSubGroupMenu);
+ CreateServiceFunction("CLISTMENUSSubGroup/SubGroupMenuonAddService", SubGroupMenuonAddService);
+ CreateServiceFunction("CLISTMENUSSubGroup/GroupMenuExecProxy", GroupMenuExecProxy);
- //CreateServiceFunction("CLISTMENUSSubGroup/HideSubGroupsHelper",HideSubGroupsHelper);
- //CreateServiceFunction("CLISTMENUSSubGroup/UseSubGroupsHelper",UseSubGroupsHelper);
- //CreateServiceFunction("CLISTMENUSSubGroup/HideOfflineRootHelper",HideOfflineRootHelper);
+ //CreateServiceFunction("CLISTMENUSSubGroup/HideSubGroupsHelper", HideSubGroupsHelper);
+ //CreateServiceFunction("CLISTMENUSSubGroup/UseSubGroupsHelper", UseSubGroupsHelper);
+ //CreateServiceFunction("CLISTMENUSSubGroup/HideOfflineRootHelper", HideOfflineRootHelper);
- CreateServiceFunction("CList/AddSubGroupMenuItem",AddSubGroupMenuItem);
- CreateServiceFunction(MS_CLIST_REMOVESUBGROUPMENUITEM,RemoveSubGroupMenuItem);
- CreateServiceFunction(MS_CLIST_MENUBUILDSUBGROUP,BuildSubGroupMenu);
- hPreBuildSubGroupMenuEvent=CreateHookableEvent(ME_CLIST_PREBUILDSUBGROUPMENU);
- HookEvent(ME_CLIST_PREBUILDSUBGROUPMENU,OnBuildSubGroupMenu);
+ CreateServiceFunction("CList/AddSubGroupMenuItem", AddSubGroupMenuItem);
+ CreateServiceFunction(MS_CLIST_REMOVESUBGROUPMENUITEM, RemoveSubGroupMenuItem);
+ CreateServiceFunction(MS_CLIST_MENUBUILDSUBGROUP, BuildSubGroupMenu);
+ hPreBuildSubGroupMenuEvent = CreateHookableEvent(ME_CLIST_PREBUILDSUBGROUPMENU);
+ HookEvent(ME_CLIST_PREBUILDSUBGROUPMENU, OnBuildSubGroupMenu);
// SubGroup menu
hSubGroupMenuObject = MO_CreateMenuObject("SubGroupMenu", LPGEN("Subgroup menu"), 0, "CLISTMENUSSubGroup/ExecService");
@@ -563,39 +554,43 @@ void InitSubGroupMenus(void) GroupMenuParam gmp;
CLISTMENUITEM mi = { sizeof(mi) };
- mi.position=1000;
- mi.hIcon=ImageList_GetIcon(hCListImages,NewGroupIconidx,0);
- mi.pszService="CLISTMENUSSubGroup/GroupMenuExecProxy";
- mi.pszName=LPGEN("&New SubGroup");
- gmp.lParam=0;gmp.wParam=POPUP_NEWSUBGROUP;
- hNewSubGroupMenuItem=(HGENMENU)AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
-
- memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=1001;
- mi.hIcon=NULL;
- mi.pszService="CLISTMENUSSubGroup/GroupMenuExecProxy";
- mi.pszName=LPGEN("&Hide Offline Users in here");
- gmp.lParam=0;gmp.wParam=POPUP_GROUPHIDEOFFLINE;
- hHideOfflineUsersHereMenuItem = (HGENMENU)AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
-
- memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=900001;
- mi.icolibItem=LoadSkinnedIconHandle(SKINICON_OTHER_RENAME); //LoadIcon(GetModuleHandle(NULL),MAKEINTRESOURCE(IDI_RENAME));
- mi.pszService="CLISTMENUSSubGroup/GroupMenuExecProxy";
- mi.pszName=LPGEN("&Rename Group");
- gmp.lParam=0;gmp.wParam=POPUP_RENAMEGROUP;
- AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
-
- memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=900002;
- mi.icolibItem=LoadSkinnedIconHandle(SKINICON_OTHER_DELETE); //LoadIcon(GetModuleHandle(NULL),MAKEINTRESOURCE(IDI_DELETE));
- mi.pszService="CLISTMENUSSubGroup/GroupMenuExecProxy";
- mi.pszName=LPGEN("&Delete Group");
- gmp.lParam=0;gmp.wParam=POPUP_DELETEGROUP;
- AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
+ mi.position = 1000;
+ mi.hIcon = ImageList_GetIcon(hCListImages, NewGroupIconidx, 0);
+ mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
+ mi.pszName = LPGEN("&New subgroup");
+ gmp.lParam = 0;
+ gmp.wParam = POPUP_NEWSUBGROUP;
+ hNewSubGroupMenuItem = (HGENMENU)AddSubGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi);
+
+ memset(&mi, 0, sizeof(mi));
+ mi.cbSize = sizeof(mi);
+ mi.position = 1001;
+ mi.hIcon = NULL;
+ mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
+ mi.pszName = LPGEN("&Hide offline users in here");
+ gmp.lParam = 0;
+ gmp.wParam = POPUP_GROUPHIDEOFFLINE;
+ hHideOfflineUsersHereMenuItem = (HGENMENU)AddSubGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi);
+
+ memset(&mi, 0, sizeof(mi));
+ mi.cbSize = sizeof(mi);
+ mi.position = 900001;
+ mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_RENAME); //LoadIcon(GetModuleHandle(NULL),MAKEINTRESOURCE(IDI_RENAME));
+ mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
+ mi.pszName = LPGEN("&Rename group");
+ gmp.lParam = 0;
+ gmp.wParam = POPUP_RENAMEGROUP;
+ AddSubGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi);
+
+ memset(&mi, 0, sizeof(mi));
+ mi.cbSize = sizeof(mi);
+ mi.position = 900002;
+ mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_DELETE); //LoadIcon(GetModuleHandle(NULL),MAKEINTRESOURCE(IDI_DELETE));
+ mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
+ mi.pszName = LPGEN("&Delete group");
+ gmp.lParam = 0;
+ gmp.wParam = POPUP_DELETEGROUP;
+ AddSubGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi);
}
}
diff --git a/plugins/Clist_nicer/src/Include/resource.h b/plugins/Clist_nicer/src/Include/resource.h index 76c82fa2a3..33ebca1ec5 100644 --- a/plugins/Clist_nicer/src/Include/resource.h +++ b/plugins/Clist_nicer/src/Include/resource.h @@ -1,6 +1,6 @@ //{{NO_DEPENDENCIES}}
-// Включаемый файл, созданный в Microsoft Visual C++.
-// Используется d:\MNG_orig\plugins\Clist_nicer\res\resource.rc
+// Microsoft Visual C++ generated include file.
+// Used by ..\res\resource.rc
//
#define IDD_OPT_VIEWMODES 1
#define IDD_OPT_SKIN 4
diff --git a/plugins/Clist_nicer/src/clcopts.cpp b/plugins/Clist_nicer/src/clcopts.cpp index 78cf391dc5..b3b1171f30 100644 --- a/plugins/Clist_nicer/src/clcopts.cpp +++ b/plugins/Clist_nicer/src/clcopts.cpp @@ -27,9 +27,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_extraicons.h>
-#define DBFONTF_BOLD 1
-#define DBFONTF_ITALIC 2
-#define DBFONTF_UNDERLINE 4
+#define DBFONTF_BOLD 1
+#define DBFONTF_ITALIC 2
+#define DBFONTF_UNDERLINE 4
static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
@@ -41,55 +41,42 @@ extern INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L extern INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
struct CheckBoxToStyleEx_t {
- int id;
- DWORD flag;
- int not_t;
+ int id;
+ DWORD flag;
+ int not_t;
} static const checkBoxToStyleEx[] = {
- {IDC_DISABLEDRAGDROP,CLS_EX_DISABLEDRAGDROP,0}, {IDC_NOTEDITLABELS,CLS_EX_EDITLABELS,1},
- {IDC_SHOWSELALWAYS,CLS_EX_SHOWSELALWAYS,0}, {IDC_TRACKSELECT,CLS_EX_TRACKSELECT,0},
- {IDC_DIVIDERONOFF,CLS_EX_DIVIDERONOFF,0}, {IDC_NOTNOTRANSLUCENTSEL,CLS_EX_NOTRANSLUCENTSEL,1},
- {IDC_NOTNOSMOOTHSCROLLING,CLS_EX_NOSMOOTHSCROLLING,1}
+ {IDC_DISABLEDRAGDROP,CLS_EX_DISABLEDRAGDROP,0}, {IDC_NOTEDITLABELS,CLS_EX_EDITLABELS,1},
+ {IDC_SHOWSELALWAYS,CLS_EX_SHOWSELALWAYS,0}, {IDC_TRACKSELECT,CLS_EX_TRACKSELECT,0},
+ {IDC_DIVIDERONOFF,CLS_EX_DIVIDERONOFF,0}, {IDC_NOTNOTRANSLUCENTSEL,CLS_EX_NOTRANSLUCENTSEL,1},
+ {IDC_NOTNOSMOOTHSCROLLING,CLS_EX_NOSMOOTHSCROLLING,1}
};
struct CheckBoxToGroupStyleEx_t {
- int id;
- DWORD flag;
- int not_t;
+ int id;
+ DWORD flag;
+ int not_t;
} static const checkBoxToGroupStyleEx[] = {
- {IDC_SHOWGROUPCOUNTS,CLS_EX_SHOWGROUPCOUNTS,0}, {IDC_HIDECOUNTSWHENEMPTY,CLS_EX_HIDECOUNTSWHENEMPTY,0},
- {IDC_LINEWITHGROUPS,CLS_EX_LINEWITHGROUPS,0}, {IDC_QUICKSEARCHVISONLY,CLS_EX_QUICKSEARCHVISONLY,0},
- {IDC_SORTGROUPSALPHA,CLS_EX_SORTGROUPSALPHA,0}
+ {IDC_SHOWGROUPCOUNTS,CLS_EX_SHOWGROUPCOUNTS,0}, {IDC_HIDECOUNTSWHENEMPTY,CLS_EX_HIDECOUNTSWHENEMPTY,0},
+ {IDC_LINEWITHGROUPS,CLS_EX_LINEWITHGROUPS,0}, {IDC_QUICKSEARCHVISONLY,CLS_EX_QUICKSEARCHVISONLY,0},
+ {IDC_SORTGROUPSALPHA,CLS_EX_SORTGROUPSALPHA,0}
};
struct CheckBoxValues_t {
- DWORD style;
- TCHAR *szDescr;
+ DWORD style;
+ TCHAR *szDescr;
};
static const struct CheckBoxValues_t greyoutValues[] = {
- {GREYF_UNFOCUS,LPGENT("Not focused")}, {MODEF_OFFLINE,LPGENT("Offline")}, {PF2_ONLINE,LPGENT("Online")}, {PF2_SHORTAWAY,LPGENT("Away")}, {PF2_LONGAWAY,LPGENT("NA")}, {PF2_LIGHTDND,LPGENT("Occupied")}, {PF2_HEAVYDND,LPGENT("DND")}, {PF2_FREECHAT,LPGENT("Free for chat")}, {PF2_INVISIBLE,LPGENT("Invisible")}, {PF2_OUTTOLUNCH,LPGENT("Out to lunch")}, {PF2_ONTHEPHONE,LPGENT("On the phone")}
+ {GREYF_UNFOCUS,LPGENT("Not focused")}, {MODEF_OFFLINE,LPGENT("Offline")}, {PF2_ONLINE,LPGENT("Online")}, {PF2_SHORTAWAY,LPGENT("Away")},
+ {PF2_LONGAWAY,LPGENT("NA")}, {PF2_LIGHTDND,LPGENT("Occupied")}, {PF2_HEAVYDND,LPGENT("DND")}, {PF2_FREECHAT,LPGENT("Free for chat")},
+ {PF2_INVISIBLE,LPGENT("Invisible")}, {PF2_OUTTOLUNCH,LPGENT("Out to lunch")}, {PF2_ONTHEPHONE,LPGENT("On the phone")}
};
static const struct CheckBoxValues_t offlineValues[] = {
- {MODEF_OFFLINE,LPGENT("Offline")}, {PF2_ONLINE,LPGENT("Online")}, {PF2_SHORTAWAY,LPGENT("Away")}, {PF2_LONGAWAY,LPGENT("NA")}, {PF2_LIGHTDND,LPGENT("Occupied")}, {PF2_HEAVYDND,LPGENT("DND")}, {PF2_FREECHAT,LPGENT("Free for chat")}, {PF2_INVISIBLE,LPGENT("Invisible")}, {PF2_OUTTOLUNCH,LPGENT("Out to lunch")}, {PF2_ONTHEPHONE,LPGENT("On the phone")}
+ {MODEF_OFFLINE,LPGENT("Offline")}, {PF2_ONLINE,LPGENT("Online")}, {PF2_SHORTAWAY,LPGENT("Away")}, {PF2_LONGAWAY,LPGENT("NA")},
+ {PF2_LIGHTDND,LPGENT("Occupied")}, {PF2_HEAVYDND,LPGENT("DND")}, {PF2_FREECHAT,LPGENT("Free for chat")}, {PF2_INVISIBLE,LPGENT("Invisible")},
+ {PF2_OUTTOLUNCH,LPGENT("Out to lunch")}, {PF2_ONTHEPHONE,LPGENT("On the phone")}
};
-static HIMAGELIST himlCheckBoxes = 0;
-
-static void CreateStateImageList()
-{
- HICON hIconNoTick = reinterpret_cast<HICON>(LoadImage(g_hInst, MAKEINTRESOURCE(IDI_NOTICK), IMAGE_ICON, 16, 16, 0));
- HICON hIconTick = reinterpret_cast<HICON>(LoadImage(g_hInst, MAKEINTRESOURCE(IDI_TICK), IMAGE_ICON, 16, 16, 0));
-
- himlCheckBoxes = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 2, 2);
- ImageList_AddIcon(himlCheckBoxes, hIconNoTick);
- ImageList_AddIcon(himlCheckBoxes, hIconTick);
- ImageList_AddIcon(himlCheckBoxes, hIconNoTick);
-
- DestroyIcon(hIconTick);
- DestroyIcon(hIconNoTick);
-}
-
-
static UINT sortCtrlIDs[] = {IDC_SORTPRIMARY, IDC_SORTTHEN, IDC_SORTFINALLY, 0};
static void FillCheckBoxTree(HWND hwndTree, const struct CheckBoxValues_t *values, int nValues, DWORD style)
@@ -104,7 +91,7 @@ static void FillCheckBoxTree(HWND hwndTree, const struct CheckBoxValues_t *value tvis.item.lParam = values[i].style;
tvis.item.pszText = TranslateTS(values[i].szDescr);
tvis.item.stateMask = TVIS_STATEIMAGEMASK;
- tvis.item.state = INDEXTOSTATEIMAGEMASK((style & tvis.item.lParam) != 0 ? 1 : 2);
+ tvis.item.state = INDEXTOSTATEIMAGEMASK((style & tvis.item.lParam) != 0 ? 2 : 1);
TreeView_InsertItem(hwndTree, &tvis);
}
}
@@ -118,7 +105,7 @@ static DWORD MakeCheckBoxTreeFlags(HWND hwndTree) tvi.hItem = TreeView_GetRoot(hwndTree);
while (tvi.hItem) {
TreeView_GetItem(hwndTree, &tvi);
- if ((tvi.state & TVIS_STATEIMAGEMASK) >> 12 == 1)
+ if ((tvi.state & TVIS_STATEIMAGEMASK) >> 12 == 2)
flags |= tvi.lParam;
tvi.hItem = TreeView_GetNextSibling(hwndTree, tvi.hItem);
}
@@ -164,8 +151,8 @@ static INT_PTR CALLBACK DlgProcDspGroups(HWND hwndDlg, UINT msg, WPARAM wParam, case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
{
- SendDlgItemMessage(hwndDlg, IDC_GROUPALIGN, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Always Left"));
- SendDlgItemMessage(hwndDlg, IDC_GROUPALIGN, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Always Right"));
+ SendDlgItemMessage(hwndDlg, IDC_GROUPALIGN, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Always left"));
+ SendDlgItemMessage(hwndDlg, IDC_GROUPALIGN, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Always right"));
SendDlgItemMessage(hwndDlg, IDC_GROUPALIGN, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Automatic (RTL)"));
DWORD exStyle = cfg::getDword("CLC", "ExStyle", pcli->pfnGetDefaultExStyle());
@@ -253,11 +240,7 @@ static INT_PTR CALLBACK DlgProcDspItems(HWND hwndDlg, UINT msg, WPARAM wParam, L case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
{
- if (himlCheckBoxes == 0)
- CreateStateImageList();
-
- HIMAGELIST himlOld = TreeView_SetImageList(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS), himlCheckBoxes, TVSIL_STATE);
- ImageList_Destroy(himlOld);
+ SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS), GWL_STYLE) | TVS_NOHSCROLL | TVS_CHECKBOXES);
for (int i = 0; sortCtrlIDs[i] != 0; i++) {
SendDlgItemMessage(hwndDlg, sortCtrlIDs[i], CB_INSERTSTRING, -1, (LPARAM)TranslateT("Nothing"));
@@ -272,7 +255,7 @@ static INT_PTR CALLBACK DlgProcDspItems(HWND hwndDlg, UINT msg, WPARAM wParam, L SendDlgItemMessage(hwndDlg, IDC_CLISTALIGN, CB_INSERTSTRING, -1, (LPARAM)TranslateT("For RTL only"));
SendDlgItemMessage(hwndDlg, IDC_CLISTALIGN, CB_INSERTSTRING, -1, (LPARAM)TranslateT("RTL TEXT only"));
- FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS), offlineValues, SIZEOF(offlineValues), cfg::getDword("CLC", "OfflineModes", CLCDEFAULT_OFFLINEMODES));
+ FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS), offlineValues, sizeof(offlineValues) / sizeof(offlineValues[0]), cfg::getDword("CLC", "OfflineModes", CLCDEFAULT_OFFLINEMODES));
CheckDlgButton(hwndDlg, IDC_EVENTSONTOP, (cfg::dat.dwFlags & CLUI_STICKYEVENTS) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_DONTSEPARATE, cfg::dat.bDontSeparateOffline);
for (int i = 0; sortCtrlIDs[i] != 0; i++)
@@ -334,6 +317,7 @@ static INT_PTR CALLBACK DlgProcDspItems(HWND hwndDlg, UINT msg, WPARAM wParam, L }
break;
}
+ break;
}
return FALSE;
}
@@ -353,10 +337,10 @@ static INT_PTR CALLBACK DlgProcDspAdvanced(HWND hwndDlg, UINT msg, WPARAM wParam SendDlgItemMessage(hwndDlg, IDC_DUALROWMODE, CB_INSERTSTRING, -1, (LPARAM)TranslateT("When space allows it"));
SendDlgItemMessage(hwndDlg, IDC_DUALROWMODE, CB_INSERTSTRING, -1, (LPARAM)TranslateT("When needed"));
- SendDlgItemMessage(hwndDlg, IDC_ALIGNMENT, CB_INSERTSTRING, -1, (LPARAM)TranslateT("With Nickname - left"));
+ SendDlgItemMessage(hwndDlg, IDC_ALIGNMENT, CB_INSERTSTRING, -1, (LPARAM)TranslateT("With nickname - left"));
SendDlgItemMessage(hwndDlg, IDC_ALIGNMENT, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Far left"));
SendDlgItemMessage(hwndDlg, IDC_ALIGNMENT, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Far right"));
- SendDlgItemMessage(hwndDlg, IDC_ALIGNMENT, CB_INSERTSTRING, -1, (LPARAM)TranslateT("With Nickname - right"));
+ SendDlgItemMessage(hwndDlg, IDC_ALIGNMENT, CB_INSERTSTRING, -1, (LPARAM)TranslateT("With nickname - right"));
{
int i = 0;
if (cfg::dat.bAvatarServiceAvail) {
@@ -559,7 +543,7 @@ int ClcOptInit(WPARAM wParam, LPARAM lParam) odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CLCBKG);
Options_AddPage(wParam, &odp);
- odp.pszTab = LPGEN("Status Bar");
+ odp.pszTab = LPGEN("Status bar");
odp.pfnDlgProc = DlgProcSBarOpts;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_SBAR);
Options_AddPage(wParam, &odp);
@@ -569,7 +553,7 @@ int ClcOptInit(WPARAM wParam, LPARAM lParam) odp.position = 0;
odp.pszGroup = LPGEN("Contact list");
- odp.pszTitle = LPGEN("Contact rows");
+ odp.pszTitle = LPGEN("Row items");
odp.pszTab = LPGEN("Contacts");
odp.pfnDlgProc = DlgProcDspItems;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_DSPITEMS);
@@ -709,10 +693,6 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam }
}
break;
-
- case WM_DESTROY:
- ImageList_Destroy(TreeView_GetImageList(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS), TVSIL_STATE));
- break;
}
return FALSE;
}
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp index 216ed57ce7..3514d9b00a 100644 --- a/plugins/Clist_nicer/src/clui.cpp +++ b/plugins/Clist_nicer/src/clui.cpp @@ -182,7 +182,7 @@ static int CreateCLC(HWND parent) CLISTFrame frame = {0};
frame.cbSize = sizeof(frame);
frame.tname = _T("EventArea");
- frame.TBtname = TranslateT("Event Area");
+ frame.TBtname = TranslateT("Event area");
frame.hIcon = LoadSkinnedIcon(SKINICON_OTHER_FRAME);
frame.height = 20;
frame.Flags = F_VISIBLE | F_SHOWTBTIP | F_NOBORDER | F_TCHAR;
@@ -203,12 +203,12 @@ static int CreateCLC(HWND parent) Frame.align = alClient;
Frame.hIcon = LoadSkinnedIcon(SKINICON_OTHER_FRAME);
Frame.Flags = F_VISIBLE | F_SHOWTB | F_SHOWTBTIP | F_NOBORDER | F_TCHAR;
- Frame.tname = _T("My Contacts");
- Frame.TBtname = TranslateT("My Contacts");
+ Frame.tname = _T("My contacts");
+ Frame.TBtname = TranslateT("My contacts");
Frame.height = 200;
hFrameContactTree = (HWND)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM) & Frame, 0);
//free(Frame.name);
- CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS, MAKEWPARAM(FO_TBTIPNAME, hFrameContactTree), (LPARAM)Translate("My Contacts"));
+ CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS, MAKEWPARAM(FO_TBTIPNAME, hFrameContactTree), (LPARAM)Translate("My contacts"));
// ugly, but working hack. Prevent that annoying little scroll bar from appearing in the "My Contacts" title bar
DWORD flags = (DWORD)CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS, MAKEWPARAM(FO_FLAGS, hFrameContactTree), 0);
@@ -253,13 +253,13 @@ static void CacheClientIcons() static void InitIcoLib()
{
- Icon_Register(g_hInst, LPGEN("CList - Nicer/Default"), myIcons, SIZEOF(myIcons));
+ Icon_Register(g_hInst, LPGEN("Contact list/Default"), myIcons, SIZEOF(myIcons));
for (int i = IDI_OVL_OFFLINE; i <= IDI_OVL_OUTTOLUNCH; i++) {
char szBuffer[128];
mir_snprintf(szBuffer, sizeof(szBuffer), "cln_ovl_%d", ID_STATUS_OFFLINE + (i - IDI_OVL_OFFLINE));
IconItemT icon = { pcli->pfnGetStatusModeDescription(ID_STATUS_OFFLINE + (i - IDI_OVL_OFFLINE), GSMDF_TCHAR), szBuffer, i };
- Icon_RegisterT(g_hInst, LPGENT("CList - Nicer/Overlay Icons"), &icon, 1);
+ Icon_RegisterT(g_hInst, LPGENT("Contact list/Overlay icons"), &icon, 1);
}
PROTOACCOUNT **accs = NULL;
@@ -270,9 +270,9 @@ static void InitIcoLib() continue;
TCHAR szDescr[128];
- mir_sntprintf(szDescr, SIZEOF(szDescr), TranslateT("%s Connecting"), accs[k]->tszAccountName);
+ mir_sntprintf(szDescr, SIZEOF(szDescr), TranslateT("%s connecting"), accs[k]->tszAccountName);
IconItemT icon = { szDescr, "conn", IDI_PROTOCONNECTING };
- Icon_RegisterT(g_hInst, LPGENT("CList - Nicer/Connecting Icons"), &icon, 1, accs[k]->szModuleName);
+ Icon_RegisterT(g_hInst, LPGENT("Contact list/Connecting icons"), &icon, 1, accs[k]->szModuleName);
}
}
@@ -1544,7 +1544,7 @@ buttons_done: case POPUP_HIDEEMPTYGROUPS:
{
int newVal = !(GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & CLS_HIDEEMPTYGROUPS);
- cfg::writeByte("CList", "HideEmptyGroups", (BYTE) newVal);
+ cfg::writeByte("CList", "HideEmptyGroups", (BYTE)newVal);
SendMessage(pcli->hwndContactTree, CLM_SETHIDEEMPTYGROUPS, newVal, 0);
}
break;
@@ -1553,7 +1553,7 @@ buttons_done: case POPUP_DISABLEGROUPS:
{
int newVal = !(GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & CLS_USEGROUPS);
- cfg::writeByte("CList", "UseGroups", (BYTE) newVal);
+ cfg::writeByte("CList", "UseGroups", (BYTE)newVal);
SendMessage(pcli->hwndContactTree, CLM_SETUSEGROUPS, newVal, 0);
CheckDlgButton(hwnd, IDC_TBHIDEGROUPS, newVal ? BST_CHECKED : BST_UNCHECKED);
}
@@ -2079,19 +2079,19 @@ void FS_RegisterFonts() ColourRegisterT(&colourid);
strncpy(colourid.setting, "SelTextColour", sizeof(colourid.setting));
- _tcsncpy(colourid.name, LPGENT("Selected Text"), SIZEOF(colourid.name));
+ _tcsncpy(colourid.name, LPGENT("Selected text"), SIZEOF(colourid.name));
colourid.order = 1;
colourid.defcolour = CLCDEFAULT_SELTEXTCOLOUR;
ColourRegisterT(&colourid);
strncpy(colourid.setting, "HotTextColour", sizeof(colourid.setting));
- _tcsncpy(colourid.name, LPGENT("Hottrack Text"), SIZEOF(colourid.name));
+ _tcsncpy(colourid.name, LPGENT("Hottrack text"), SIZEOF(colourid.name));
colourid.order = 1;
colourid.defcolour = CLCDEFAULT_HOTTEXTCOLOUR;
ColourRegisterT(&colourid);
strncpy(colourid.setting, "QuickSearchColour", sizeof(colourid.setting));
- _tcsncpy(colourid.name, LPGENT("Quicksearch Text"), SIZEOF(colourid.name));
+ _tcsncpy(colourid.name, LPGENT("Quicksearch text"), SIZEOF(colourid.name));
colourid.order = 1;
colourid.defcolour = CLCDEFAULT_QUICKSEARCHCOLOUR;
ColourRegisterT(&colourid);
diff --git a/plugins/Clist_nicer/src/statusbar.cpp b/plugins/Clist_nicer/src/statusbar.cpp index fa2887f0e8..1726803ae9 100644 --- a/plugins/Clist_nicer/src/statusbar.cpp +++ b/plugins/Clist_nicer/src/statusbar.cpp @@ -31,28 +31,28 @@ static int timer_set = 0, tooltip_active = 0; extern HANDLE hStatusBarShowToolTipEvent, hStatusBarHideToolTipEvent;
extern HBRUSH g_CLUISkinnedBkColor;
-extern HANDLE (WINAPI *MyOpenThemeData)(HWND, LPCWSTR);
-extern HRESULT (WINAPI *MyCloseThemeData)(HANDLE);
-extern HRESULT (WINAPI *MyDrawThemeBackground)(HANDLE, HDC, int, int, const RECT *, const RECT *);
+extern HANDLE (WINAPI *MyOpenThemeData)(HWND, LPCWSTR);
+extern HRESULT (WINAPI *MyCloseThemeData)(HANDLE);
+extern HRESULT (WINAPI *MyDrawThemeBackground)(HANDLE, HDC, int, int, const RECT *, const RECT *);
#define TIMERID_HOVER 1000
LRESULT CALLBACK NewStatusBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch(msg) {
+ switch (msg) {
case WM_SETCURSOR:
{
POINT pt;
GetCursorPos(&pt);
- SendMessage(GetParent(hwnd),msg,wParam,lParam);
+ SendMessage(GetParent(hwnd), msg, wParam, lParam);
if (pt.x == ptMouse.x && pt.y == ptMouse.y)
return 1;//return(TestCursorOnBorders());
ptMouse = pt;
if (tooltip_active){
KillTimer(hwnd, TIMERID_HOVER);
- if ( !NotifyEventHooks(hStatusBarHideToolTipEvent, 0, 0))
+ if (!NotifyEventHooks(hStatusBarHideToolTipEvent, 0, 0))
CallService("mToolTip/HideTip", 0, 0);
tooltip_active = FALSE;
}
@@ -78,7 +78,7 @@ LRESULT CALLBACK NewStatusBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case WM_LBUTTONDOWN:
case WM_RBUTTONDOWN:
KillTimer(hwnd, TIMERID_HOVER);
- if ( !NotifyEventHooks(hStatusBarHideToolTipEvent, 0, 0))
+ if (!NotifyEventHooks(hStatusBarHideToolTipEvent, 0, 0))
CallService("mToolTip/HideTip", 0, 0);
tooltip_active = FALSE;
break;
@@ -109,7 +109,7 @@ LRESULT CALLBACK NewStatusBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM HFONT hOldFont = reinterpret_cast<HFONT>(SelectObject(hdcMem, GetStockObject(DEFAULT_GUI_FONT)));
BitBlt(hdcMem, 0, 0, rcClient.right, rcClient.bottom, cfg::dat.hdcBg, pt.x, pt.y, SRCCOPY);
StatusItems_t *item = arStatusItems[ID_EXTBKSTATUSBAR - ID_STATUS_OFFLINE];
- if ( !item->IGNORED) {
+ if (!item->IGNORED) {
RECT rc = rcClient;
rc.left += item->MARGIN_LEFT;
rc.right -= item->MARGIN_RIGHT;
@@ -119,7 +119,8 @@ LRESULT CALLBACK NewStatusBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM item->CORNER, item->BORDERSTYLE, item->imageItem);
SetTextColor(hdcMem, item->TEXTCOLOR);
}
- else SetTextColor(hdcMem, GetSysColor(COLOR_BTNTEXT));
+ else
+ SetTextColor(hdcMem, GetSysColor(COLOR_BTNTEXT));
dis.hwndItem = hwnd;
dis.hDC = hdcMem;
@@ -154,7 +155,7 @@ LRESULT CALLBACK NewStatusBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM for (int i = 0; i < nParts; i++) {
RECT rc;
SendMessage(hwnd, SB_GETRECT, i, (LPARAM)&rc);
- if ( PtInRect(&rc,pt)) {
+ if (PtInRect(&rc,pt)) {
ProtocolData *PD = (ProtocolData *)SendMessageA(hwnd, SB_GETTEXTA, i, 0);
if (PD == NULL)
continue;
diff --git a/plugins/Clist_nicer/src/viewmodes.cpp b/plugins/Clist_nicer/src/viewmodes.cpp index 7b7544ff88..1d60f93b88 100644 --- a/plugins/Clist_nicer/src/viewmodes.cpp +++ b/plugins/Clist_nicer/src/viewmodes.cpp @@ -816,8 +816,8 @@ void BuildViewModeMenu() if (GetMenuItemCount(hViewModeMenu) > 0)
AppendMenu(hViewModeMenu, MF_SEPARATOR, 0, NULL);
- AppendMenu(hViewModeMenu, MF_STRING, 10001, TranslateT("Setup View Modes..."));
- AppendMenu(hViewModeMenu, MF_STRING, 10002, TranslateT("Clear current View Mode"));
+ AppendMenu(hViewModeMenu, MF_STRING, 10001, TranslateT("Setup view modes..."));
+ AppendMenu(hViewModeMenu, MF_STRING, 10002, TranslateT("Clear current view mode"));
}
struct
@@ -1028,7 +1028,7 @@ void CreateViewModeFrame() ZeroMemory(&frame, sizeof(frame));
frame.cbSize = sizeof(frame);
frame.tname = _T("View modes");
- frame.TBtname = TranslateT("View Modes");
+ frame.TBtname = TranslateT("View modes");
frame.hIcon = LoadSkinnedIcon(SKINICON_OTHER_FRAME);
frame.height = 22;
frame.Flags = F_VISIBLE | F_SHOWTBTIP | F_NOBORDER | F_TCHAR;
|