summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/Clist_modern/src/init.cpp16
-rw-r--r--plugins/Clist_modern/src/modern_clcopts.cpp74
-rw-r--r--plugins/Clist_modern/src/modern_clcpaint.cpp38
-rw-r--r--plugins/Clist_modern/src/modern_clistmenus.cpp117
-rw-r--r--plugins/Clist_modern/src/modern_clistmod.cpp4
-rw-r--r--plugins/Clist_modern/src/modern_clui.cpp4
-rw-r--r--plugins/Clist_modern/src/modern_groupmenu.cpp206
-rw-r--r--plugins/Clist_modern/src/modern_skinengine.cpp6
-rw-r--r--plugins/Clist_modern/src/modern_skinopt.cpp76
-rw-r--r--plugins/Clist_modern/src/modern_skinselector.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_statusbar.cpp6
-rw-r--r--plugins/Clist_modern/src/modern_statusbar_options.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_viewmodebar.cpp213
13 files changed, 340 insertions, 424 deletions
diff --git a/plugins/Clist_modern/src/init.cpp b/plugins/Clist_modern/src/init.cpp
index 83c0135e72..81785bb3c7 100644
--- a/plugins/Clist_modern/src/init.cpp
+++ b/plugins/Clist_modern/src/init.cpp
@@ -86,15 +86,15 @@ PLUGININTERFACE PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
PLUGININTERFACE int CListInitialise()
{
- HMODULE hKernel = GetModuleHandleA( "kernel32.dll" );
- fnTryEnterCriticalSection = ( pfnTryEnterCriticalSection )GetProcAddress( hKernel, "TryEnterCriticalSection" );
+ HMODULE hKernel = GetModuleHandleA("kernel32.dll");
+ fnTryEnterCriticalSection = ( pfnTryEnterCriticalSection )GetProcAddress( hKernel, "TryEnterCriticalSection");
- HMODULE hUser = GetModuleHandleA( "user32.dll" );
- fnGetMenuBarInfo = ( pfnGetMenuBarInfo )GetProcAddress( hUser, "GetMenuBarInfo" );
- fnGetScrollBarInfo = ( pfnGetScrollBarInfo )GetProcAddress( hUser, "GetScrollBarInfo" );
- fnMsgWaitForMultipleObjectsEx = ( pfnMsgWaitForMultipleObjectsEx )GetProcAddress( hUser, "MsgWaitForMultipleObjectsEx" );
+ HMODULE hUser = GetModuleHandleA("user32.dll");
+ fnGetMenuBarInfo = ( pfnGetMenuBarInfo )GetProcAddress( hUser, "GetMenuBarInfo");
+ fnGetScrollBarInfo = ( pfnGetScrollBarInfo )GetProcAddress( hUser, "GetScrollBarInfo");
+ fnMsgWaitForMultipleObjectsEx = ( pfnMsgWaitForMultipleObjectsEx )GetProcAddress( hUser, "MsgWaitForMultipleObjectsEx");
- if (( fnGetAncestor = ( pfnGetAncestor )GetProcAddress( hUser, "GetAncestor" )) == NULL )
+ if (( fnGetAncestor = ( pfnGetAncestor )GetProcAddress( hUser, "GetAncestor")) == NULL )
fnGetAncestor = MyGetAncestor;
g_dwMainThreadID = GetCurrentThreadId();
@@ -112,7 +112,7 @@ PLUGININTERFACE int CListInitialise()
CHECKRES ( ToolbarButtonLoadModule( ) );
CHECKRES ( ToolbarLoadModule() );
- TRACE( "CListInitialise Modern Contact List ... Done\r\n" );
+ TRACE("CListInitialise Modern Contact List ... Done\r\n");
return S_OK;
}
diff --git a/plugins/Clist_modern/src/modern_clcopts.cpp b/plugins/Clist_modern/src/modern_clcopts.cpp
index a43322a6e0..c735ab547c 100644
--- a/plugins/Clist_modern/src/modern_clcopts.cpp
+++ b/plugins/Clist_modern/src/modern_clcopts.cpp
@@ -69,32 +69,32 @@ struct FontOptionsList
#define DEFAULT_SMALLSIZE -8
static struct FontOptionsList fontOptionsList[] = {
- { FIDF_CLASSGENERAL, FONTID_CONTACTS, CLCGROUP, LPGENT( "Standard contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_AWAY, CLCGROUP, LPGENT( "Away contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_DND, CLCGROUP, LPGENT( "DND contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_NA, CLCGROUP, LPGENT( "NA contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_OCCUPIED, CLCGROUP, LPGENT( "Occupied contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_CHAT, CLCGROUP, LPGENT( "Free for chat contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_INVISIBLE, CLCGROUP, LPGENT( "Invisible contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_PHONE, CLCGROUP, LPGENT( "On the phone contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_LUNCH, CLCGROUP, LPGENT( "Out to lunch contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_OFFLINE, CLCGROUP, LPGENT( "Offline contacts"), DEFAULT_GREYCOLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_INVIS, CLCGROUP, LPGENT( "Online contacts to whom you have a different visibility"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_OFFINVIS, CLCGROUP, LPGENT( "Offline contacts to whom you have a different visibility"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_NOTONLIST, CLCGROUP, LPGENT( "Contacts who are 'not on list'"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSHEADER, FONTID_OPENGROUPS, CLCGROUP, LPGENT( "Open groups"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_BOLD, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSHEADER, FONTID_OPENGROUPCOUNTS, CLCGROUP, LPGENT( "Open group member counts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSHEADER, FONTID_CLOSEDGROUPS, CLCGROUP, LPGENT( "Closed groups"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_BOLD, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSHEADER, FONTID_CLOSEDGROUPCOUNTS, CLCGROUP, LPGENT( "Closed group member counts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSSMALL, FONTID_DIVIDERS, CLCGROUP, LPGENT( "Dividers"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
-
- { FIDF_CLASSSMALL, FONTID_SECONDLINE, CLCLINESGROUP, LPGENT( "Second line"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SMALLSIZE, DEFAULT_EFFECT },
- { FIDF_CLASSSMALL, FONTID_THIRDLINE, CLCLINESGROUP, LPGENT( "Third line"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SMALLSIZE, DEFAULT_EFFECT },
- { FIDF_CLASSSMALL, FONTID_CONTACT_TIME, CLCLINESGROUP, LPGENT( "Contact time"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SMALLSIZE, DEFAULT_EFFECT },
-
- { FIDF_CLASSGENERAL, FONTID_STATUSBAR_PROTONAME, CLCFRAMESGROUP, LPGENT( "Status bar text"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_EVENTAREA, CLCFRAMESGROUP, LPGENT( "Event area text"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_VIEMODES, CLCFRAMESGROUP, LPGENT( "Current view mode text"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_CONTACTS, CLCGROUP, LPGENT("Standard contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_AWAY, CLCGROUP, LPGENT("Away contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_DND, CLCGROUP, LPGENT("DND contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_NA, CLCGROUP, LPGENT("NA contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_OCCUPIED, CLCGROUP, LPGENT("Occupied contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_CHAT, CLCGROUP, LPGENT("Free for chat contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_INVISIBLE, CLCGROUP, LPGENT("Invisible contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_PHONE, CLCGROUP, LPGENT("On the phone contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_LUNCH, CLCGROUP, LPGENT("Out to lunch contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_OFFLINE, CLCGROUP, LPGENT("Offline contacts"), DEFAULT_GREYCOLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_INVIS, CLCGROUP, LPGENT("Online contacts to whom you have a different visibility"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_OFFINVIS, CLCGROUP, LPGENT("Offline contacts to whom you have a different visibility"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_NOTONLIST, CLCGROUP, LPGENT("Contacts who are 'not on list'"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSHEADER, FONTID_OPENGROUPS, CLCGROUP, LPGENT("Open groups"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_BOLD, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSHEADER, FONTID_OPENGROUPCOUNTS, CLCGROUP, LPGENT("Open group member counts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSHEADER, FONTID_CLOSEDGROUPS, CLCGROUP, LPGENT("Closed groups"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_BOLD, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSHEADER, FONTID_CLOSEDGROUPCOUNTS, CLCGROUP, LPGENT("Closed group member counts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSSMALL, FONTID_DIVIDERS, CLCGROUP, LPGENT("Dividers"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+
+ { FIDF_CLASSSMALL, FONTID_SECONDLINE, CLCLINESGROUP, LPGENT("Second line"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SMALLSIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSSMALL, FONTID_THIRDLINE, CLCLINESGROUP, LPGENT("Third line"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SMALLSIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSSMALL, FONTID_CONTACT_TIME, CLCLINESGROUP, LPGENT("Contact time"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SMALLSIZE, DEFAULT_EFFECT },
+
+ { FIDF_CLASSGENERAL, FONTID_STATUSBAR_PROTONAME, CLCFRAMESGROUP, LPGENT("Status bar text"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_EVENTAREA, CLCFRAMESGROUP, LPGENT("Event area text"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_VIEMODES, CLCFRAMESGROUP, LPGENT("Current view mode text"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
};
struct ColourOptionsList
@@ -108,19 +108,19 @@ struct ColourOptionsList
static struct ColourOptionsList colourOptionsList[] = {
- { "CLC", "BkColour", CLCGROUP, LPGENT( "Background"), DEFAULT_BACKCOLOUR },
- { "CLC", "Rows_BkColour", CLCLINESGROUP, LPGENT( "Background"), DEFAULT_BACKCOLOUR },
- { "CLC", "Frames_BkColour", CLCFRAMESGROUP, LPGENT( "Background"), DEFAULT_BACKCOLOUR},
+ { "CLC", "BkColour", CLCGROUP, LPGENT("Background"), DEFAULT_BACKCOLOUR },
+ { "CLC", "Rows_BkColour", CLCLINESGROUP, LPGENT("Background"), DEFAULT_BACKCOLOUR },
+ { "CLC", "Frames_BkColour", CLCFRAMESGROUP, LPGENT("Background"), DEFAULT_BACKCOLOUR},
- { "CLC", "HotTextColour", CLCCOLOURSGROUP, LPGENT( "Hot text"), CLCDEFAULT_MODERN_HOTTEXTCOLOUR },
- { "CLC", "SelTextColour", CLCCOLOURSGROUP, LPGENT( "Selected text"), CLCDEFAULT_MODERN_SELTEXTCOLOUR },
- { "CLC", "QuickSearchColour", CLCCOLOURSGROUP, LPGENT( "Quick search text"), CLCDEFAULT_MODERN_QUICKSEARCHCOLOUR},
+ { "CLC", "HotTextColour", CLCCOLOURSGROUP, LPGENT("Hot text"), CLCDEFAULT_MODERN_HOTTEXTCOLOUR },
+ { "CLC", "SelTextColour", CLCCOLOURSGROUP, LPGENT("Selected text"), CLCDEFAULT_MODERN_SELTEXTCOLOUR },
+ { "CLC", "QuickSearchColour", CLCCOLOURSGROUP, LPGENT("Quick search text"), CLCDEFAULT_MODERN_QUICKSEARCHCOLOUR},
- { "Menu", "TextColour", CLCCOLOURSGROUP, LPGENT( "Menu text"), CLCDEFAULT_TEXTCOLOUR},
- { "Menu", "SelTextColour", CLCCOLOURSGROUP, LPGENT( "Selected menu text"), CLCDEFAULT_MODERN_SELTEXTCOLOUR},
- { "FrameTitleBar", "TextColour", CLCCOLOURSGROUP, LPGENT( "Frame title text"), CLCDEFAULT_TEXTCOLOUR },
- { "StatusBar", "TextColour", CLCCOLOURSGROUP, LPGENT( "Statusbar text"), CLCDEFAULT_TEXTCOLOUR},
- { "ModernSettings", "KeyColor", CLCCOLOURSGROUP, LPGENT( "3rd party frames transparent back colour"), SETTING_KEYCOLOR_DEFAULT},
+ { "Menu", "TextColour", CLCCOLOURSGROUP, LPGENT("Menu text"), CLCDEFAULT_TEXTCOLOUR},
+ { "Menu", "SelTextColour", CLCCOLOURSGROUP, LPGENT("Selected menu text"), CLCDEFAULT_MODERN_SELTEXTCOLOUR},
+ { "FrameTitleBar", "TextColour", CLCCOLOURSGROUP, LPGENT("Frame title text"), CLCDEFAULT_TEXTCOLOUR },
+ { "StatusBar", "TextColour", CLCCOLOURSGROUP, LPGENT("Statusbar text"), CLCDEFAULT_TEXTCOLOUR},
+ { "ModernSettings", "KeyColor", CLCCOLOURSGROUP, LPGENT("3rd party frames transparent back colour"), SETTING_KEYCOLOR_DEFAULT},
};
diff --git a/plugins/Clist_modern/src/modern_clcpaint.cpp b/plugins/Clist_modern/src/modern_clcpaint.cpp
index ef494d5e06..578cfce328 100644
--- a/plugins/Clist_modern/src/modern_clcpaint.cpp
+++ b/plugins/Clist_modern/src/modern_clcpaint.cpp
@@ -449,12 +449,12 @@ void CLCPaint::_DrawTextSmiley( HDC hdcMem, RECT *free_rc, SIZE * text_size, TC
i=0;
// Get real height of the line
- row_height = ske_DrawText( hdcMem, _T( "A" ), 1, &tmp_rc, DT_CALCRECT | uTextFormat );
+ row_height = ske_DrawText( hdcMem, _T("A"), 1, &tmp_rc, DT_CALCRECT | uTextFormat );
// Just draw ellipsis
if ( free_rc->right <= free_rc->left )
{
- if ( gl_TrimText ) ske_DrawText( hdcMem, _T( "..." ), 3, free_rc, uTextFormat & ~DT_END_ELLIPSIS );
+ if ( gl_TrimText ) ske_DrawText( hdcMem, _T("..."), 3, free_rc, uTextFormat & ~DT_END_ELLIPSIS );
}
else
{
@@ -519,7 +519,7 @@ void CLCPaint::_DrawTextSmiley( HDC hdcMem, RECT *free_rc, SIZE * text_size, TC
}
else
{
- ske_DrawText( hdcMem, _T( "..." ), 3, &text_rc, uTextFormat );
+ ske_DrawText( hdcMem, _T("..."), 3, &text_rc, uTextFormat );
}
pos_x += fac_width;
@@ -599,7 +599,7 @@ MODERNMASK *CLCPaint::_GetCLCContactRowBackModernMask( ClcGroup *group, ClcConta
_AddParamShort( mpModernMask, hi_RootGroup, ( group && group->parent == NULL )?hi_True:hi_False );
switch( GetContactCachedStatus( Drawing->hContact ))
{
- // case ID_STATUS_CONNECTING: AppendChar( buf, BUFSIZE, "CONNECTING" ); break;
+ // case ID_STATUS_CONNECTING: AppendChar( buf, BUFSIZE, "CONNECTING"); break;
case ID_STATUS_ONLINE: _AddParamShort( mpModernMask, hi_Status, hi_ONLINE ); break;
case ID_STATUS_AWAY: _AddParamShort( mpModernMask, hi_Status, hi_AWAY ); break;
case ID_STATUS_DND: _AddParamShort( mpModernMask, hi_Status, hi_DND ); break;
@@ -853,7 +853,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
{
// calc width and height
ChangeToFont( hdcMem, dat, Drawing->group->expanded?FONTID_OPENGROUPCOUNTS:FONTID_CLOSEDGROUPCOUNTS, NULL );
- ske_DrawText( hdcMem, _T( " " ), 1, &count_rc, DT_CALCRECT | DT_NOPREFIX );
+ ske_DrawText( hdcMem, _T(" "), 1, &count_rc, DT_CALCRECT | DT_NOPREFIX );
count_size.cx = count_rc.right-count_rc.left;
space_width = count_size.cx;
count_rc.right = 0;
@@ -951,7 +951,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
SIZE counts_size = {0};
// Get widths
counts_rc = fr_rc;
- DrawText( hdcMem, _T( " " ), 1, &space_rc, DT_CALCRECT | DT_NOPREFIX );
+ DrawText( hdcMem, _T(" "), 1, &space_rc, DT_CALCRECT | DT_NOPREFIX );
space_size.cx = space_rc.right - space_rc.left;
space_size.cy = min( space_rc.bottom - space_rc.top, fr_rc.bottom-fr_rc.top );
@@ -1120,7 +1120,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
// calc width and height
ChangeToFont( hdcMem, dat, Drawing->group->expanded?FONTID_OPENGROUPCOUNTS:FONTID_CLOSEDGROUPCOUNTS, NULL );
- ske_DrawText( hdcMem, _T( " " ), 1, &count_rc, DT_CALCRECT | DT_NOPREFIX );
+ ske_DrawText( hdcMem, _T(" "), 1, &count_rc, DT_CALCRECT | DT_NOPREFIX );
count_size.cx = count_rc.right-count_rc.left;
space_width = count_size.cx;
count_rc.right = 0;
@@ -1860,7 +1860,7 @@ void CLCPaint::_DrawBackground( HWND hWnd, ClcData *dat, HDC hdc, int paintMode,
DeleteObject( hBrush );
ske_SetRectOpaque( pc.hdcMem, rcPaint );
if ( !( paintMode & DM_GREYALTERNATE))
- SkinDrawGlyph( pc.hdcMem, &clRect, rcPaint, "CL,ID=Background,Type=Control" );
+ SkinDrawGlyph( pc.hdcMem, &clRect, rcPaint, "CL,ID=Background,Type=Control");
}
else if ( paintMode&DM_CLASSIC) {
if ( !_DrawNonEnginedBackground( hWnd, pc.hdcMem, rcPaint, clRect, dat )) {
@@ -1982,7 +1982,7 @@ void CLCPaint::_DrawLines( HWND hWnd, ClcData *dat, HDC hdc, int paintMode, RECT
FillRect( pc.hdcMem, &row_rc, pc.hBrushAlternateGrey );
}
else
- SkinDrawGlyph( pc.hdcMem, &row_rc, rcPaint, "CL,ID=GreyAlternate" );
+ SkinDrawGlyph( pc.hdcMem, &row_rc, rcPaint, "CL,ID=GreyAlternate");
}
if ( ! (paintMode&(DM_CLASSIC|DM_CONTROL)))
{
@@ -2015,16 +2015,16 @@ void CLCPaint::_DrawLines( HWND hWnd, ClcData *dat, HDC hdc, int paintMode, RECT
if ( dat->HiLightMode == 1 ) // Full or default
{
if ( selected )
- SkinDrawGlyph( pc.hdcMem, &mrc, rcPaint, "CL,ID=Selection" );
+ SkinDrawGlyph( pc.hdcMem, &mrc, rcPaint, "CL,ID=Selection");
if ( hottrack )
- SkinDrawGlyph( pc.hdcMem, &mrc, rcPaint, "CL,ID=HotTracking" );
+ SkinDrawGlyph( pc.hdcMem, &mrc, rcPaint, "CL,ID=HotTracking");
}
else if ( dat->HiLightMode == 2 ) // Less
{
if ( selected )
- SkinDrawGlyph( pc.hdcMem, &mrc, rcPaint, "CL,ID=Selection" ); //instead of free_row_rc
+ SkinDrawGlyph( pc.hdcMem, &mrc, rcPaint, "CL,ID=Selection"); //instead of free_row_rc
if ( hottrack )
- SkinDrawGlyph( pc.hdcMem, &mrc, rcPaint, "CL,ID=HotTracking" );
+ SkinDrawGlyph( pc.hdcMem, &mrc, rcPaint, "CL,ID=HotTracking");
}
}
@@ -2102,8 +2102,8 @@ void CLCPaint::_DrawLines( HWND hWnd, ClcData *dat, HDC hdc, int paintMode, RECT
{
if ( mpRequest->pl_Params[1].szValue )
free( mpRequest->pl_Params[1].szValue );
- mpRequest->pl_Params[1].szValue = strdupn( "Ovl", 3 );
- mpRequest->pl_Params[1].dwValueHash = mod_CalcHash( "Ovl" );
+ mpRequest->pl_Params[1].szValue = strdupn("Ovl", 3 );
+ mpRequest->pl_Params[1].dwValueHash = mod_CalcHash("Ovl");
{
RECT mrc = row_rc;
if ( Drawing->type == CLCIT_GROUP &&
@@ -2551,7 +2551,7 @@ void CLCPaint::_CalcItemsPos( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact *D
SIZE third_line_text_size = {0};
SIZE space_size = {0};
SIZE counts_size = {0};
- char *szCounts = NULL;//mir_tstrdup( _T( "" ));
+ char *szCounts = NULL;//mir_tstrdup( _T(""));
int free_width;
int free_height;
int max_bottom_selection_border = SELECTION_BORDER;
@@ -2599,7 +2599,7 @@ void CLCPaint::_CalcItemsPos( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact *D
free_height = free_row_rc.bottom - free_row_rc.top;
// Get widths
- ske_DrawText( hdcMem, _T( " " ), 1, &space_rc, DT_CALCRECT | DT_NOPREFIX );
+ ske_DrawText( hdcMem, _T(" "), 1, &space_rc, DT_CALCRECT | DT_NOPREFIX );
space_size.cx = space_rc.right - space_rc.left;
space_size.cy = min( space_rc.bottom - space_rc.top, free_height );
@@ -3208,9 +3208,9 @@ void CLCPaint::_DrawContactSelection( HDC hdcMem, ClcData *dat, ClcContact *Draw
// Selection background
if (( selected || hottrack ) && dat->HiLightMode == 0) {
if ( selected )
- SkinDrawGlyph( hdcMem, prcItem, rcPaint, "Contact List/Selection" );
+ SkinDrawGlyph( hdcMem, prcItem, rcPaint, "Contact List/Selection");
else if ( hottrack )
- SkinDrawGlyph( hdcMem, prcItem, rcPaint, "Contact List/HotTracking" );
+ SkinDrawGlyph( hdcMem, prcItem, rcPaint, "Contact List/HotTracking");
}
}
diff --git a/plugins/Clist_modern/src/modern_clistmenus.cpp b/plugins/Clist_modern/src/modern_clistmenus.cpp
index 3d25cc2911..388dd7e91c 100644
--- a/plugins/Clist_modern/src/modern_clistmenus.cpp
+++ b/plugins/Clist_modern/src/modern_clistmenus.cpp
@@ -38,18 +38,17 @@ INT_PTR CloseAction(WPARAM wParam,LPARAM lParam)
do
{ k = CallService(MS_SYSTEM_OKTOEXIT,0,0);
}
- while (!k);
+ while (!k);
- if ( k ) {
+ if (k)
DestroyWindow(pcli->hwndContactList);
- }
return 0;
}
int InitCustomMenus(void)
{
- CreateServiceFunction( "CloseAction", CloseAction );
+ CreateServiceFunction("CloseAction", CloseAction );
LoadFavoriteContactMenu();
return 0;
}
@@ -68,104 +67,91 @@ void UninitCustomMenus(void)
#define CLUI_FAVSETRATE "CLUI/SetContactRate" //LParam is rate, Wparam is contact handle
#define CLUI_FAVTOGGLESHOWOFFLINE "CLUI/ToggleContactShowOffline"
-static HANDLE hFavoriteContactMenu = NULL;
+static HGENMENU hFavoriteContactMenu = NULL;
static HANDLE *hFavoriteContactMenuItems = NULL;
static HANDLE hShowIfOflineItem = NULL;
static HANDLE hOnContactMenuBuild_FAV = NULL;
-static int FAV_OnContactMenuBuild(WPARAM wParam,LPARAM lParam)
-{
- BOOL NeedFree = FALSE;
- BYTE bContactRate = db_get_b((HANDLE)wParam, "CList", "Rate",0);
- //if (hFavoriteContactMenu)
-
- static TCHAR * FAVMENUROOTNAME = _T("&Contact rate");
+static TCHAR * FAVMENUROOTNAME = _T("&Contact rate");
- TCHAR *rates[] = {
- _T( "None" ),
- _T( "Low" ),
- _T( "Medium" ),
- _T( "High" )
- };
+static TCHAR *rates[] = {
+ _T("None"),
+ _T("Low"),
+ _T("Medium"),
+ _T("High")
+};
- char* iconsName[] = {
- LPGEN( "Contact rate None" ),
- LPGEN( "Contact rate Low" ),
- LPGEN( "Contact rate Medium" ),
- LPGEN( "Contact rate High" )
- };
+static IconItem iconList[] =
+{
+ { LPGEN("Contact rate None"), "Rate1", IDI_FAVORITE_0 },
+ { LPGEN("Contact rate Low"), "Rate2", IDI_FAVORITE_1 },
+ { LPGEN("Contact rate Medium"), "Rate3", IDI_FAVORITE_2 },
+ { LPGEN("Contact rate High"), "Rate4", IDI_FAVORITE_3 }
+};
- if ( bContactRate >SIZEOF( rates ) - 1 )
- bContactRate = SIZEOF( rates ) - 1;
+static int FAV_OnContactMenuBuild(WPARAM wParam,LPARAM lParam)
+{
+ BYTE bContactRate = db_get_b((HANDLE)wParam, "CList", "Rate",0);
+ if ( bContactRate > SIZEOF(rates)-1)
+ bContactRate = SIZEOF(rates)-1;
BOOL bModifyMenu = FALSE;
- int i;
- TCHAR * name = NULL;
CLISTMENUITEM mi = { sizeof(mi) };
- mi.hIcon = CLUI_LoadIconFromExternalFile("clisticons.dll",8,TRUE,TRUE,iconsName[bContactRate],"Contact List",Translate(iconsName[bContactRate]),-IDI_FAVORITE_0 - bContactRate, &NeedFree);
+ mi.icolibItem = iconList[bContactRate].hIcolib;
mi.pszPopupName = (char *)-1;
mi.position = 0;
if ( !bContactRate)
mi.ptszName = FAVMENUROOTNAME;
- else
- {
+ else {
int bufsize = (lstrlen(FAVMENUROOTNAME)+lstrlen(rates[bContactRate])+15)*sizeof(TCHAR);
- name = (TCHAR*)_alloca(bufsize);
- mir_sntprintf(name,bufsize/sizeof(TCHAR),_T("%s (%s)"),FAVMENUROOTNAME,rates[bContactRate]);
+ TCHAR *name = (TCHAR*)_alloca(bufsize);
+ mir_sntprintf(name, bufsize/sizeof(TCHAR), _T("%s (%s)"),FAVMENUROOTNAME,rates[bContactRate]);
mi.ptszName = name;
}
- mi.flags = CMIF_ROOTPOPUP | CMIF_TCHAR;
+ mi.flags = CMIF_ROOTPOPUP | CMIF_TCHAR | CMIF_ICONFROMICOLIB;
if ( !hFavoriteContactMenu)
hFavoriteContactMenu = Menu_AddContactMenuItem(&mi);
- else
- {
- mi.flags |= CMIM_FLAGS|CMIM_ICON|CMIM_NAME;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) hFavoriteContactMenu, (LPARAM)&mi);
+ else {
+ mi.flags |= CMIM_FLAGS | CMIM_NAME;
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hFavoriteContactMenu, (LPARAM)&mi);
bModifyMenu = TRUE;
}
- {
- OptParam op;
- op.Handle = hFavoriteContactMenu;
- op.Setting = OPT_MENUITEMSETUNIQNAME;
- op.Value = (INT_PTR)"ModernClistMenu_ContactRate";
- CallService(MO_SETOPTIONSMENUITEM,0,(LPARAM)&op);
- }
- Skin_ReleaseIcon(mi.hIcon);
- if (mi.hIcon && NeedFree)
- DestroyIcon(mi.hIcon);
+ OptParam op;
+ op.Handle = hFavoriteContactMenu;
+ op.Setting = OPT_MENUITEMSETUNIQNAME;
+ op.Value = (INT_PTR)"ModernClistMenu_ContactRate";
+ CallService(MO_SETOPTIONSMENUITEM, 0, (LPARAM)&op);
- mi.pszPopupName = (char*)hFavoriteContactMenu;
+ mi.hParentMenu = hFavoriteContactMenu;
if ( !hFavoriteContactMenuItems) {
hFavoriteContactMenuItems = (HANDLE*)malloc(sizeof(HANDLE)*SIZEOF(rates));
- memset(hFavoriteContactMenuItems,0,sizeof(HANDLE)*SIZEOF(rates));
+ memset(hFavoriteContactMenuItems, 0, sizeof(HANDLE)*SIZEOF(rates));
}
+ int i;
for (i=0; i < SIZEOF(rates); i++) {
- mi.hIcon = CLUI_LoadIconFromExternalFile("clisticons.dll",8+i,TRUE,TRUE,iconsName[i],"Contact List",Translate(iconsName[i]),-IDI_FAVORITE_0 - i, &NeedFree);
+ mi.icolibItem = iconList[i].hIcolib;
mi.ptszName = rates[i];
- mi.flags = CMIF_CHILDPOPUP|CMIF_TCHAR|((bContactRate == i)?CMIF_CHECKED:0);
+ mi.flags = CMIF_CHILDPOPUP | CMIF_TCHAR | ((bContactRate == i)?CMIF_CHECKED:0) | CMIF_ICONFROMICOLIB;
mi.pszService = CLUI_FAVSETRATE;
mi.popupPosition = i;
if (bModifyMenu && hFavoriteContactMenuItems[i]) {
- mi.flags |= CMIM_FLAGS|CMIM_ICON;
+ mi.flags |= CMIM_FLAGS | CMIM_ICON;
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) hFavoriteContactMenuItems[i], (LPARAM)&mi);
}
else hFavoriteContactMenuItems[i] = Menu_AddContactMenuItem(&mi);
- Skin_ReleaseIcon(mi.hIcon);
- if (mi.hIcon && NeedFree)
- DestroyIcon(mi.hIcon);
}
-
+
mi.hIcon = NULL;
mi.ptszName = LPGENT("Show even if offline");
- mi.flags = CMIF_CHILDPOPUP|CMIF_TCHAR|(db_get_b((HANDLE)wParam,"CList","noOffline",0)?CMIF_CHECKED:0);
+ mi.flags = CMIF_CHILDPOPUP | CMIF_TCHAR | (db_get_b((HANDLE)wParam,"CList","noOffline",0)?CMIF_CHECKED:0);
mi.pszService = CLUI_FAVTOGGLESHOWOFFLINE;
mi.popupPosition = i+100000000;
mi.position = -100000000;
if (bModifyMenu && hShowIfOflineItem) {
- mi.flags |= CMIM_FLAGS|CMIM_ICON;
+ mi.flags |= CMIM_FLAGS | CMIM_ICON;
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) hShowIfOflineItem, (LPARAM)&mi);
}
else hShowIfOflineItem = Menu_AddContactMenuItem(&mi);
@@ -176,27 +162,26 @@ static int FAV_OnContactMenuBuild(WPARAM wParam,LPARAM lParam)
INT_PTR FAV_SetRate(WPARAM hContact, LPARAM nRate)
{
if (hContact)
- {
db_set_b((HANDLE)hContact, "CList", "Rate",(BYTE)nRate);
- }
+
return 0;
}
INT_PTR FAV_ToggleShowOffline(WPARAM hContact,LPARAM lParam)
{
if (hContact)
- {
- db_set_b((HANDLE)hContact,"CList","noOffline",
- db_get_b((HANDLE)hContact,"CList","noOffline",0)?0:1);
- }
+ db_set_b((HANDLE)hContact,"CList","noOffline", !db_get_b((HANDLE)hContact, "CList", "noOffline", 0));
+
return 0;
}
int LoadFavoriteContactMenu()
{
+ Icon_Register(g_hInst, "Contact List", iconList, SIZEOF(iconList));
+
CreateServiceFunction(CLUI_FAVSETRATE,FAV_SetRate);
CreateServiceFunction(CLUI_FAVTOGGLESHOWOFFLINE,FAV_ToggleShowOffline);
- hOnContactMenuBuild_FAV = HookEvent(ME_CLIST_PREBUILDCONTACTMENU,FAV_OnContactMenuBuild);
+ hOnContactMenuBuild_FAV = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, FAV_OnContactMenuBuild);
return 0;
}
diff --git a/plugins/Clist_modern/src/modern_clistmod.cpp b/plugins/Clist_modern/src/modern_clistmod.cpp
index 2adc55d19e..6862b89981 100644
--- a/plugins/Clist_modern/src/modern_clistmod.cpp
+++ b/plugins/Clist_modern/src/modern_clistmod.cpp
@@ -261,8 +261,8 @@ HRESULT CluiLoadModule()
InitTray();
HINSTANCE hUser = GetModuleHandleA("USER32");
- MyMonitorFromPoint = ( pfnMyMonitorFromPoint )GetProcAddress( hUser,"MonitorFromPoint" );
- MyMonitorFromWindow = ( pfnMyMonitorFromWindow )GetProcAddress( hUser, "MonitorFromWindow" );
+ MyMonitorFromPoint = ( pfnMyMonitorFromPoint )GetProcAddress( hUser,"MonitorFromPoint");
+ MyMonitorFromWindow = ( pfnMyMonitorFromWindow )GetProcAddress( hUser, "MonitorFromWindow");
MyGetMonitorInfo = ( pfnMyGetMonitorInfo )GetProcAddress( hUser, "GetMonitorInfoW");
CLUI::InitClui();
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp
index 1d113d2437..2cf58a92ce 100644
--- a/plugins/Clist_modern/src/modern_clui.cpp
+++ b/plugins/Clist_modern/src/modern_clui.cpp
@@ -1017,7 +1017,7 @@ static HICON CLUI_GetConnectingIconForProto(char *szAccoName, int b)
}
// third try global
- mir_snprintf( szFullPath, SIZEOF(szFullPath), "proto_conn.dll" );
+ mir_snprintf( szFullPath, SIZEOF(szFullPath), "proto_conn.dll");
hIcon = CLUI_LoadIconFromExternalFile(szFullPath,b+1,FALSE,FALSE,NULL,NULL,NULL,0,&needFree);
if ( hIcon ) return hIcon;
@@ -2723,7 +2723,7 @@ LRESULT CLUI::OnMeasureItem( UINT msg, WPARAM wParam, LPARAM lParam )
HDC hdc;
SIZE textSize;
hdc = GetDC( m_hWnd );
- GetTextExtentPoint32A( hdc, Translate("Status"), lstrlenA( Translate( "Status" )), &textSize );
+ GetTextExtentPoint32A( hdc, Translate("Status"), lstrlenA( Translate("Status")), &textSize );
pmis->itemWidth = textSize.cx;
pmis->itemHeight = 0;
ReleaseDC( m_hWnd, hdc );
diff --git a/plugins/Clist_modern/src/modern_groupmenu.cpp b/plugins/Clist_modern/src/modern_groupmenu.cpp
index e9c5d5791d..454459ff0b 100644
--- a/plugins/Clist_modern/src/modern_groupmenu.cpp
+++ b/plugins/Clist_modern/src/modern_groupmenu.cpp
@@ -44,10 +44,12 @@ int NewGroupIconidx;
void InitSubGroupMenus(void);
//Groupmenu exec param(ownerdata)
-typedef struct{
-char *szServiceName;
-int Param1,Param2;
-}GroupMenuExecParam,*lpGroupMenuExecParam;
+typedef struct
+{
+ char *szServiceName;
+ int Param1,Param2;
+}
+ GroupMenuExecParam,*lpGroupMenuExecParam;
/*
wparam = handle to the menu item returned by MS_CLIST_ADDCONTACTMENUITEM
@@ -118,55 +120,46 @@ int GroupMenuCheckService(WPARAM wParam,LPARAM lParam) {
INT_PTR GroupMenuonAddService(WPARAM wParam,LPARAM lParam) {
MENUITEMINFO *mii = (MENUITEMINFO* )wParam;
- if (mii == NULL) return 0;
+ if (mii == NULL)
+ return 0;
- if (hHideShowMainMenuItem == (HANDLE)lParam)
- {
+ 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;
+ 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;
+ mii->hSubMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS,0,0);
}
-
- return(TRUE);
-};
+ return TRUE;
+}
//called with:
//wparam - ownerdata
//lparam - lparam from winproc
-INT_PTR GroupMenuExecService(WPARAM wParam,LPARAM lParam) {
- if (wParam != 0)
- {
+INT_PTR GroupMenuExecService(WPARAM wParam,LPARAM lParam)
+{
+ if (wParam != 0) {
lpGroupMenuExecParam mmep = (lpGroupMenuExecParam)wParam;
- if ( !mir_strcmp(mmep->szServiceName,"Help/AboutCommand"))
- {
+ if ( !mir_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);
}
-
- };
- return(1);
-};
+ else CallService(mmep->szServiceName,mmep->Param1,mmep->Param2);
+ }
+ return 1;
+}
+
INT_PTR FreeOwnerDataGroupMenu (WPARAM wParam,LPARAM lParam)
{
-
lpGroupMenuExecParam mmep;
mmep = (lpGroupMenuExecParam)lParam;
if (mmep != NULL){
@@ -174,8 +167,8 @@ INT_PTR FreeOwnerDataGroupMenu (WPARAM wParam,LPARAM lParam)
FreeAndNil((void **)&mmep);
}
-return 0;
-};
+ return 0;
+}
INT_PTR HideGroupsHelper(WPARAM wParam,LPARAM lParam)
{
@@ -195,20 +188,19 @@ INT_PTR UseGroupsHelper(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),
- 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;
-};
+}
INT_PTR CreateGroupHelper(WPARAM wParam,LPARAM lParam)
{
SendMessage((HWND)CallService(MS_CLUI_GETHWNDTREE,0,0), CLM_SETHIDEEMPTYGROUPS, 0, 0);
SendMessage((HWND)CallService(MS_CLUI_GETHWNDTREE,0,0), CLM_SETUSEGROUPS, 1, 0);
CallService(MS_CLIST_GROUPCREATE, 0, 0);
-
return 0;
};
@@ -220,32 +212,26 @@ static int OnBuildGroupMenu(WPARAM wParam,LPARAM lParam)
mi.flags = CMIM_FLAGS | (db_get_b(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT)?CMIF_CHECKED:0);
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hHideOfflineUsersMenuItem, (LPARAM)&mi);
- ZeroMemory(&mi,sizeof(mi));
- mi.cbSize = sizeof(mi);
mi.flags = CMIM_FLAGS | (SendMessage(pcli->hwndContactTree,CLM_GETHIDEOFFLINEROOT,0,0)?CMIF_CHECKED:0);
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hHideOfflineUsersOutHereMenuItem, (LPARAM)&mi);
- ZeroMemory(&mi,sizeof(mi));
- mi.cbSize = sizeof(mi);
mi.flags = CMIM_FLAGS | (GetWindowLongPtr(pcli->hwndContactTree,GWL_STYLE)&CLS_HIDEEMPTYGROUPS?CMIF_CHECKED:0);
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hHideEmptyGroupsMenuItem, (LPARAM)&mi);
- ZeroMemory(&mi,sizeof(mi));
- mi.cbSize = sizeof(mi);
mi.flags = CMIM_FLAGS | (GetWindowLongPtr(pcli->hwndContactTree,GWL_STYLE)&CLS_USEGROUPS?0:CMIF_CHECKED);
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hDisableGroupsMenuItem, (LPARAM)&mi);
-
return 0;
}
+static IconItem iconItem = { "New Group", "NewGroup", IDI_NEWGROUP2 };
+
int static OnIconLibIconChanged(WPARAM wParam,LPARAM lParam)
{
if (MirandaExiting()) return 0;
- BOOL needFree;
- HICON hicon = CLUI_LoadIconFromExternalFile("clisticons.dll",2,TRUE,FALSE,"NewGroup","Contact List","New Group",-IDI_NEWGROUP2,&needFree);
- NewGroupIconidx = ImageList_ReplaceIcon(hCListImages,NewGroupIconidx,hicon);
- if (needFree) DestroyIcon_protect(hicon);
+ HICON hIcon = Skin_GetIconByHandle(iconItem.hIcolib);
+ NewGroupIconidx = ImageList_ReplaceIcon(hCListImages, NewGroupIconidx, hIcon);
+ Skin_ReleaseIcon(hIcon);
CLISTMENUITEM clmi = { sizeof(clmi) };
clmi.flags = CMIM_ICON;
@@ -257,13 +243,12 @@ int static OnIconLibIconChanged(WPARAM wParam,LPARAM lParam)
void GroupMenus_Init(void)
{
- TMenuParam tmp;
- OptParam op;
- HICON hicon;
- BOOL needFree;
- hicon = CLUI_LoadIconFromExternalFile("clisticons.dll",2,TRUE,TRUE,"NewGroup","Contact List","New Group",-IDI_NEWGROUP2,&needFree);
- NewGroupIconidx = hicon?ImageList_AddIcon(hCListImages,hicon ):-1;
- if (needFree) DestroyIcon_protect(hicon);
+ Icon_Register(g_hInst, "Contact List", &iconItem, 1);
+
+ HICON hIcon = Skin_GetIconByHandle(iconItem.hIcolib);
+ NewGroupIconidx = hIcon ? ImageList_AddIcon(hCListImages, hIcon) : -1;
+ Skin_ReleaseIcon(hIcon);
+
CreateServiceFunction("CLISTMENUSGroup/ExecService",GroupMenuExecService);
CreateServiceFunction("CLISTMENUSGroup/FreeOwnerDataGroupMenu",FreeOwnerDataGroupMenu);
CreateServiceFunction("CLISTMENUSGroup/GroupMenuonAddService",GroupMenuonAddService);
@@ -281,14 +266,13 @@ void GroupMenus_Init(void)
InitSubGroupMenus();
//Group menu
- memset(&tmp,0,sizeof(tmp));
- tmp.cbSize = sizeof(tmp);
+ TMenuParam tmp = { sizeof(tmp) };
tmp.CheckService = NULL;
tmp.ExecService = "CLISTMENUSGroup/ExecService";
tmp.name = LPGEN("GroupMenu");
hGroupMenuObject = (HANDLE)CallService(MO_CREATENEWMENUOBJECT,0,(LPARAM)&tmp);
-
+ OptParam op;
op.Handle = hGroupMenuObject;
op.Setting = OPT_USERDEFINEDITEMS;
op.Value = TRUE;
@@ -423,9 +407,6 @@ void GroupMenus_Init(void)
//////////////////////////////END Group MENU/////////////////////////
-
-
-
//////////////////////////////SubGroup MENU/////////////////////////
HANDLE hSubGroupMenuObject;
@@ -450,7 +431,6 @@ static INT_PTR RemoveSubGroupMenuItem(WPARAM wParam,LPARAM lParam)
return 0;
}
-
static int OnBuildSubGroupMenu(WPARAM wParam,LPARAM lParam)
{
BOOL gray1 = FALSE;
@@ -503,6 +483,7 @@ HMENU cliBuildGroupPopupMenu(ClcGroup *group)
//HWND wnd = GetForegroundWindow();
return (HMENU)CallService(MS_CLIST_MENUBUILDSUBGROUP,(WPARAM)group,0);
}
+
static INT_PTR AddSubGroupMenuItem(WPARAM wParam,LPARAM lParam)
{
TMO_MenuItem tmi;
@@ -535,95 +516,62 @@ static INT_PTR AddSubGroupMenuItem(WPARAM wParam,LPARAM lParam)
return (INT_PTR)op.Handle;
}
-INT_PTR SubGroupMenuCheckService(WPARAM wParam,LPARAM lParam) {
-//not used
- //TODO ADD
- lpSubGroupMenuExecParam mmep;
- TCheckProcParam * CParam = (TCheckProcParam*)wParam;
- if (CParam)
- {
-
- mmep = (lpSubGroupMenuExecParam)(CParam->MenuItemOwnerData);
- if (mmep)
- {
- mmep->Param2 = CParam->lParam;
- }
-
- }
- return(1);
-};
-
-INT_PTR SubGroupMenuonAddService(WPARAM wParam,LPARAM lParam) {
-
- MENUITEMINFO *mii = (MENUITEMINFO* )wParam;
-
- if (mii == NULL) return 0;
-
-/*
- 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);
+INT_PTR SubGroupMenuCheckService(WPARAM wParam,LPARAM lParam)
+{
+ TCheckProcParam * CParam = (TCheckProcParam*)wParam;
+ if (CParam) {
+ lpSubGroupMenuExecParam mmep = (lpSubGroupMenuExecParam)(CParam->MenuItemOwnerData);
+ if (mmep)
+ mmep->Param2 = CParam->lParam;
}
+ return 1;
+}
- if (hSubGroupStatusMenuItemProxy == (HANDLE)lParam)
- {
- mii->fMask |= MIIM_SUBMENU;
- //mi.fType = MFT_STRING;
- mii->hSubMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS,0,0);
- }
-*/
- return(TRUE);
-};
+INT_PTR SubGroupMenuonAddService(WPARAM wParam,LPARAM lParam)
+{
+ MENUITEMINFO *mii = (MENUITEMINFO* )wParam;
+ if (mii == NULL)
+ return 0;
+ return TRUE;
+}
//called with:
//wparam - ownerdata
//lparam - lparam from winproc
-INT_PTR SubGroupMenuExecService(WPARAM wParam,LPARAM lParam) {
- if (wParam != 0)
- {
+INT_PTR SubGroupMenuExecService(WPARAM wParam,LPARAM lParam)
+{
+ if (wParam != 0) {
lpSubGroupMenuExecParam mmep = (lpSubGroupMenuExecParam)wParam;
if ( !mir_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,lParam);
}
-
- };
- return(1);
-};
+ else CallService(mmep->szServiceName,mmep->Param1,lParam);
+ }
+ return 1;
+}
+
INT_PTR FreeOwnerDataSubGroupMenu (WPARAM wParam,LPARAM lParam)
{
-
- lpSubGroupMenuExecParam mmep;
- mmep = (lpSubGroupMenuExecParam)lParam;
+ lpSubGroupMenuExecParam mmep = (lpSubGroupMenuExecParam)lParam;
if (mmep != NULL){
FreeAndNil((void **)&mmep->szServiceName);
FreeAndNil((void **)&mmep);
}
-return 0;
-};
+ return 0;
+}
//wparam menu handle to pass to clc.c
//lparam WM_COMMAND HWND
INT_PTR GroupMenuExecProxy(WPARAM wParam,LPARAM lParam)
{
- SendMessage(lParam?(HWND)lParam:(HWND)pcli->hwndContactTree,WM_COMMAND,wParam,0);
+ SendMessage(lParam?(HWND)lParam:(HWND)pcli->hwndContactTree,WM_COMMAND,wParam,0);
return 0;
-};
+}
void InitSubGroupMenus(void)
{
diff --git a/plugins/Clist_modern/src/modern_skinengine.cpp b/plugins/Clist_modern/src/modern_skinengine.cpp
index c1656b3f26..8972752fe5 100644
--- a/plugins/Clist_modern/src/modern_skinengine.cpp
+++ b/plugins/Clist_modern/src/modern_skinengine.cpp
@@ -470,10 +470,10 @@ HRESULT SkinEngineLoadModule()
{
char* p = strrchr( tDllPath, '\\' );
if ( p != NULL )
- strcpy( p+1, "ImgDecoder.dll" );
+ strcpy( p+1, "ImgDecoder.dll");
else
{
- strcpy( tDllPath, "ImgDecoder.dll" );
+ strcpy( tDllPath, "ImgDecoder.dll");
}
}
@@ -1959,7 +1959,7 @@ HBITMAP ske_LoadGlyphImage_Png2Dib(char * szFilename)
BYTE* pDibBits;
if ( !ServiceExists( MS_PNG2DIB )) {
- MessageBox( NULL, TranslateT( "You need an image services plugin to process PNG images." ), TranslateT( "Error" ), MB_OK );
+ MessageBox( NULL, TranslateT("You need an image services plugin to process PNG images."), TranslateT("Error"), MB_OK );
return (HBITMAP)NULL;
}
diff --git a/plugins/Clist_modern/src/modern_skinopt.cpp b/plugins/Clist_modern/src/modern_skinopt.cpp
index a814462aa9..20d6db4cfb 100644
--- a/plugins/Clist_modern/src/modern_skinopt.cpp
+++ b/plugins/Clist_modern/src/modern_skinopt.cpp
@@ -61,16 +61,16 @@ int SkinOptInit( WPARAM wParam, LPARAM lParam )
odp.hInstance = g_hInst;
odp.pfnDlgProc = DlgSkinOpts;
odp.pszTemplate = MAKEINTRESOURCEA( IDD_OPT_SKIN );
- odp.pszGroup = LPGEN( "Skins" );
- odp.pszTitle = LPGEN( "Contact List" );
+ odp.pszGroup = LPGEN("Skins");
+ odp.pszTitle = LPGEN("Contact List");
odp.flags = ODPF_BOLDGROUPS;
- odp.pszTab = LPGEN( "Load/Save" );
+ odp.pszTab = LPGEN("Load/Save");
Options_AddPage(wParam, &odp);
if ( db_get_b( NULL, "ModernData", "EnableSkinEditor", SETTING_ENABLESKINEDITOR_DEFAULT )) {
odp.pfnDlgProc = DlgSkinEditorOpts;
odp.pszTemplate = MAKEINTRESOURCEA( IDD_OPT_SKINEDITOR );
- odp.pszTab = LPGEN( "Object Editor" );
+ odp.pszTab = LPGEN("Object Editor");
Options_AddPage(wParam, &odp);
}
}
@@ -143,24 +143,24 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
if ( !sd ) return 0;
if ( sd->File && !_tcschr( sd->File, _T('%')))
{
- GetPrivateProfileString( _T( "Skin_Description_Section" ), _T( "Author" ), TranslateT( "( unknown )" ), Author, SIZEOF( Author ), sd->File );
- GetPrivateProfileString( _T( "Skin_Description_Section" ), _T( "URL" ), _T( "" ), URL, SIZEOF( URL ), sd->File );
- GetPrivateProfileString( _T( "Skin_Description_Section" ), _T( "Contact" ), _T( "" ), Contact, SIZEOF( Contact ), sd->File );
- GetPrivateProfileString( _T( "Skin_Description_Section" ), _T( "Description" ), _T( "" ), Description, SIZEOF( Description ), sd->File );
- _sntprintf( text, SIZEOF( text ), TranslateT( "%s\n\n%s\n\nAuthor(s):\t %s\nContact:\t %s\nWeb:\t %s\n\nFile:\t %s" ),
+ GetPrivateProfileString( _T("Skin_Description_Section"), _T("Author"), TranslateT("( unknown )"), Author, SIZEOF( Author ), sd->File );
+ GetPrivateProfileString( _T("Skin_Description_Section"), _T("URL"), _T(""), URL, SIZEOF( URL ), sd->File );
+ GetPrivateProfileString( _T("Skin_Description_Section"), _T("Contact"), _T(""), Contact, SIZEOF( Contact ), sd->File );
+ GetPrivateProfileString( _T("Skin_Description_Section"), _T("Description"), _T(""), Description, SIZEOF( Description ), sd->File );
+ _sntprintf( text, SIZEOF( text ), TranslateT("%s\n\n%s\n\nAuthor(s):\t %s\nContact:\t %s\nWeb:\t %s\n\nFile:\t %s"),
sd->Name, Description, Author, Contact, URL, sd->File );
}
else
{
- _sntprintf( text, SIZEOF( text ), TranslateT( "%s\n\n%s\n\nAuthor(s): %s\nContact:\t %s\nWeb:\t %s\n\nFile:\t %s" ),
- TranslateT( "reVista for Modern v0.5" ),
- TranslateT( "This is second default Modern Contact list skin in Vista Aero style" ),
- TranslateT( "Angeli-Ka (graphics), FYR (template)" ),
- _T( "JID: fyr@jabber.ru" ),
+ _sntprintf( text, SIZEOF( text ), TranslateT("%s\n\n%s\n\nAuthor(s): %s\nContact:\t %s\nWeb:\t %s\n\nFile:\t %s"),
+ TranslateT("reVista for Modern v0.5"),
+ TranslateT("This is second default Modern Contact list skin in Vista Aero style"),
+ TranslateT("Angeli-Ka (graphics), FYR (template)"),
+ _T("JID: fyr@jabber.ru"),
_T("fyr.mirandaim.ru"),
- TranslateT( "Inside library" ));
+ TranslateT("Inside library"));
}
- MessageBox( hwndDlg, text, TranslateT( "Skin Information" ), MB_OK|MB_ICONINFORMATION );
+ MessageBox( hwndDlg, text, TranslateT("Skin Information"), MB_OK|MB_ICONINFORMATION );
}
break;
case IDC_BUTTON_APPLY_SKIN:
@@ -181,9 +181,9 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
{
int res = 0;
if ( glSkinWasModified == 1 )
- res = MessageBox( hwndDlg, TranslateT( "Skin editor contains not stored changes.\n\nAll changes will be lost.\n\n Continue to load new skin?" ), TranslateT( "Warning!" ), MB_OKCANCEL|MB_ICONWARNING|MB_DEFBUTTON2|MB_TOPMOST );
+ res = MessageBox( hwndDlg, TranslateT("Skin editor contains not stored changes.\n\nAll changes will be lost.\n\n Continue to load new skin?"), TranslateT("Warning!"), MB_OKCANCEL|MB_ICONWARNING|MB_DEFBUTTON2|MB_TOPMOST );
else
- res = MessageBox( hwndDlg, TranslateT( "Current skin was not saved to file.\n\nAll changes will be lost.\n\n Continue to load new skin?" ), TranslateT( "Warning!" ), MB_OKCANCEL|MB_ICONWARNING|MB_DEFBUTTON2|MB_TOPMOST );
+ res = MessageBox( hwndDlg, TranslateT("Current skin was not saved to file.\n\nAll changes will be lost.\n\n Continue to load new skin?"), TranslateT("Warning!"), MB_OKCANCEL|MB_ICONWARNING|MB_DEFBUTTON2|MB_TOPMOST );
if ( res != IDOK ) return 0;
}
ske_LoadSkinFromIniFile( sd->File, FALSE );
@@ -227,7 +227,7 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
ofn.Flags = isLoad?( OFN_FILEMUSTEXIST | OFN_HIDEREADONLY ) : ( OFN_OVERWRITEPROMPT|OFN_HIDEREADONLY ) | OFN_DONTADDTORECENT;
ofn.nMaxFile = sizeof( str );
ofn.nMaxFileTitle = MAX_PATH;
- ofn.lpstrDefExt = _T( "msf" );
+ ofn.lpstrDefExt = _T("msf");
{
DWORD tick = GetTickCount( );
@@ -342,7 +342,7 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
TCHAR prfn[MAX_PATH] = {0};
TCHAR imfn[MAX_PATH] = {0};
TCHAR skinfolder[MAX_PATH] = {0};
- GetPrivateProfileString( _T( "Skin_Description_Section" ), _T( "Preview" ), _T( "" ), imfn, SIZEOF( imfn ), sd->File );
+ GetPrivateProfileString( _T("Skin_Description_Section"), _T("Preview"), _T(""), imfn, SIZEOF( imfn ), sd->File );
IniParser::GetSkinFolder( sd->File, skinfolder );
_sntprintf( prfn, SIZEOF( prfn ), _T("%s\\%s"), skinfolder, imfn );
CallService( MS_UTILS_PATHTOABSOLUTET, (WPARAM)prfn, (LPARAM) imfn );
@@ -375,19 +375,19 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
if ( sd->File && !_tcschr( sd->File, _T('%')))
{
- GetPrivateProfileString( _T( "Skin_Description_Section" ), _T( "Author" ), TranslateT( "( unknown )" ), Author, SIZEOF( Author ), sd->File );
- GetPrivateProfileString( _T( "Skin_Description_Section" ), _T( "URL" ), _T( "" ), URL, SIZEOF( URL ), sd->File );
- GetPrivateProfileString( _T( "Skin_Description_Section" ), _T( "Contact" ), _T( "" ), Contact, SIZEOF( Contact ), sd->File );
- GetPrivateProfileString( _T( "Skin_Description_Section" ), _T( "Description" ), _T( "" ), Description, SIZEOF( Description ), sd->File );
- _sntprintf( text, SIZEOF( text ), TranslateT( "Preview is not available\n\n%s\n----------------------\n\n%s\n\nAUTHOR(S):\n%s\n\nCONTACT:\n%s\n\nHOMEPAGE:\n%s" ),
+ GetPrivateProfileString( _T("Skin_Description_Section"), _T("Author"), TranslateT("( unknown )"), Author, SIZEOF( Author ), sd->File );
+ GetPrivateProfileString( _T("Skin_Description_Section"), _T("URL"), _T(""), URL, SIZEOF( URL ), sd->File );
+ GetPrivateProfileString( _T("Skin_Description_Section"), _T("Contact"), _T(""), Contact, SIZEOF( Contact ), sd->File );
+ GetPrivateProfileString( _T("Skin_Description_Section"), _T("Description"), _T(""), Description, SIZEOF( Description ), sd->File );
+ _sntprintf( text, SIZEOF( text ), TranslateT("Preview is not available\n\n%s\n----------------------\n\n%s\n\nAUTHOR(S):\n%s\n\nCONTACT:\n%s\n\nHOMEPAGE:\n%s"),
sd->Name, Description, Author, Contact, URL );
}
else
{
- _sntprintf( text, SIZEOF( text ), TranslateT( "%s\n\n%s\n\nAUTHORS:\n%s\n\nCONTACT:\n%s\n\nWEB:\n%s\n\n\n" ),
- TranslateT( "reVista for Modern v0.5" ),
- TranslateT( "This is second default Modern Contact list skin in Vista Aero style" ),
- TranslateT( "graphics by Angeli-Ka\ntemplate by FYR" ),
+ _sntprintf( text, SIZEOF( text ), TranslateT("%s\n\n%s\n\nAUTHORS:\n%s\n\nCONTACT:\n%s\n\nWEB:\n%s\n\n\n"),
+ TranslateT("reVista for Modern v0.5"),
+ TranslateT("This is second default Modern Contact list skin in Vista Aero style"),
+ TranslateT("graphics by Angeli-Ka\ntemplate by FYR"),
_T("JID: fyr@jabber.ru"),
_T("fyr.mirandaim.ru"));
}
@@ -399,10 +399,10 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
else
{
//no selected
- SendDlgItemMessage( hwndDlg, IDC_EDIT_SKIN_FILENAME, WM_SETTEXT, 0, (LPARAM)TranslateT( "Select skin from list" ));
+ SendDlgItemMessage( hwndDlg, IDC_EDIT_SKIN_FILENAME, WM_SETTEXT, 0, (LPARAM)TranslateT("Select skin from list"));
EnableWindow( GetDlgItem( hwndDlg, IDC_BUTTON_APPLY_SKIN ), FALSE );
EnableWindow( GetDlgItem( hwndDlg, IDC_BUTTON_INFO ), FALSE );
- SendDlgItemMessage( hwndDlg, IDC_STATIC_INFO, WM_SETTEXT, 0, (LPARAM)TranslateT( "Please select skin to apply" ));
+ SendDlgItemMessage( hwndDlg, IDC_STATIC_INFO, WM_SETTEXT, 0, (LPARAM)TranslateT("Please select skin to apply"));
ShowWindow( GetDlgItem( hwndDlg, IDC_PREVIEW ), SW_HIDE );
}
ShowWindow( GetDlgItem( hwndDlg, IDC_PREVIEW ), hPreviewBitmap?SW_SHOW:SW_HIDE );
@@ -474,20 +474,20 @@ HTREEITEM FillAvailableSkinList( HWND hwndDlg )
HTREEITEM res = (HTREEITEM)-1;
TCHAR path[MAX_PATH];//, mask[MAX_PATH];
int attrib;
- TCHAR *SkinsFolder = DBGetStringT( NULL, "ModernData", "SkinsFolder" );
+ TCHAR *SkinsFolder = DBGetStringT( NULL, "ModernData", "SkinsFolder");
if ( !SkinsFolder ) SkinsFolder = mir_tstrdup( _T("Skins"));
CallService( MS_UTILS_PATHTOABSOLUTET, (WPARAM)SkinsFolder, (LPARAM)path );
mir_free_and_nil( SkinsFolder );
- AddSkinToList( hwndDlg, TranslateT( "Default Skin" ), _T("%Default Skin%"));
+ AddSkinToList( hwndDlg, TranslateT("Default Skin"), _T("%Default Skin%"));
attrib = GetFileAttributes( path );
if ( attrib != INVALID_FILE_ATTRIBUTES && ( attrib & FILE_ATTRIBUTE_DIRECTORY ))
SearchSkinFiles( hwndDlg, path );
{
TCHAR * skinfile;
TCHAR skinfull[MAX_PATH];
- skinfile = DBGetStringT( NULL, SKIN, "SkinFile" );
+ skinfile = DBGetStringT( NULL, SKIN, "SkinFile");
if ( skinfile )
{
CallService( MS_UTILS_PATHTOABSOLUTET, (WPARAM)skinfile, (LPARAM)skinfull );
@@ -540,8 +540,8 @@ HTREEITEM AddSkinToList( HWND hwndDlg, TCHAR * path, TCHAR* file )
{
//sd->File = "%Default Skin%";
_sntprintf( sd->File, MAX_PATH, _T("%%Default Skin%%"));
- _sntprintf( sd->Name, 100, TranslateT( "%Default Skin%" ));
- return AddItemToTree( GetDlgItem( hwndDlg, IDC_TREE1 ), TranslateT( "Default Skin" ), sd->Name, sd );
+ _sntprintf( sd->Name, 100, TranslateT("%Default Skin%"));
+ return AddItemToTree( GetDlgItem( hwndDlg, IDC_TREE1 ), TranslateT("Default Skin"), sd->Name, sd );
}
else
{
@@ -666,7 +666,7 @@ INT_PTR SvcActiveSkin(WPARAM wParam, LPARAM lParam)
{
TCHAR *skinfile;
TCHAR skinfull[MAX_PATH];
- skinfile = DBGetStringT( NULL, SKIN, "SkinFile" );
+ skinfile = DBGetStringT( NULL, SKIN, "SkinFile");
if ( skinfile ) {
CallService( MS_UTILS_PATHTOABSOLUTET, (WPARAM)skinfile, (LPARAM)skinfull );
mir_free(skinfile);
@@ -719,7 +719,7 @@ INT_PTR SvcPreviewSkin(WPARAM wParam, LPARAM lParam)
TCHAR prfn[MAX_PATH] = {0};
TCHAR imfn[MAX_PATH] = {0};
TCHAR skinfolder[MAX_PATH] = {0};
- GetPrivateProfileString( _T( "Skin_Description_Section" ), _T( "Preview" ), _T( "" ), imfn, SIZEOF( imfn ), (LPCTSTR)lParam );
+ GetPrivateProfileString( _T("Skin_Description_Section"), _T("Preview"), _T(""), imfn, SIZEOF( imfn ), (LPCTSTR)lParam );
IniParser::GetSkinFolder((LPCTSTR)lParam, skinfolder );
_sntprintf( prfn, SIZEOF( prfn ), _T("%s\\%s"), skinfolder, imfn );
CallService( MS_UTILS_PATHTOABSOLUTET, (WPARAM)prfn, (LPARAM) imfn );
diff --git a/plugins/Clist_modern/src/modern_skinselector.cpp b/plugins/Clist_modern/src/modern_skinselector.cpp
index be074163ae..8497361179 100644
--- a/plugins/Clist_modern/src/modern_skinselector.cpp
+++ b/plugins/Clist_modern/src/modern_skinselector.cpp
@@ -435,7 +435,7 @@ int ParseToModernMask(MODERNMASK *mm, char * szText)
}
else //ParamName = 'Module'
{
- param.szName = _strdup( "Module");
+ param.szName = _strdup("Module");
param.dwId = mod_CalcHash( param.szName );
}
diff --git a/plugins/Clist_modern/src/modern_statusbar.cpp b/plugins/Clist_modern/src/modern_statusbar.cpp
index dc0c5f0932..086b979ca8 100644
--- a/plugins/Clist_modern/src/modern_statusbar.cpp
+++ b/plugins/Clist_modern/src/modern_statusbar.cpp
@@ -627,7 +627,7 @@ static BOOL _ModernStatus_OnExtraIconClick(int protoIndex)
return TRUE;
}
- if ( !mir_strcmpi( ProtosData[protoIndex].ProtoName, "JABBER" )) {
+ if ( !mir_strcmpi( ProtosData[protoIndex].ProtoName, "JABBER")) {
if ( ProtosData[protoIndex].ProtoStatus < ID_STATUS_ONLINE )
return FALSE;
@@ -857,7 +857,7 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam
memmove( pos, pos + len, strlen( pos + len ) + 1 );
if ( strlen( g_CluiData.protoFilter ) == 0 )
- ApplyViewMode( "" );
+ ApplyViewMode("");
else
g_CluiData.bFilterEffective = CLVM_FILTER_PROTOS;
}
@@ -937,7 +937,7 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam
GetClientRect(hwnd, &rc);
if ( PtInRect( &rc, pt ) && msg == WM_LBUTTONDOWN && g_CluiData.bFilterEffective == CLVM_FILTER_PROTOS) {
- ApplyViewMode( "" );
+ ApplyViewMode("");
CLUI__cliInvalidateRect( hwnd, NULL, FALSE );
SetCapture( NULL );
return 0;
diff --git a/plugins/Clist_modern/src/modern_statusbar_options.cpp b/plugins/Clist_modern/src/modern_statusbar_options.cpp
index 82a4cac6eb..b0e5bd091b 100644
--- a/plugins/Clist_modern/src/modern_statusbar_options.cpp
+++ b/plugins/Clist_modern/src/modern_statusbar_options.cpp
@@ -179,7 +179,7 @@ INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
dat = (StatusBarProtocolOptions*)mir_alloc(sizeof(StatusBarProtocolOptions)*count);
SetWindowLongPtr(GetDlgItem(hwndDlg,IDC_STATUSBAR_PROTO_LIST),GWLP_USERDATA,(LONG_PTR)dat);
- SendMessage(hwndComboBox, CB_ADDSTRING, 0, (LPARAM)TranslateT( " << Global>>" ));
+ SendMessage(hwndComboBox, CB_ADDSTRING, 0, (LPARAM)TranslateT(" << Global>>"));
SendMessage(hwndComboBox, CB_SETITEMDATA, 0, 0);
for (int i=0; i < count; i++ ) {
diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp
index f1a7d13b88..68f5ca0aca 100644
--- a/plugins/Clist_modern/src/modern_viewmodebar.cpp
+++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp
@@ -706,28 +706,25 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP
switch(msg) {
case WM_INITDIALOG:
+ xpt_EnableThemeDialogTexture(hwndDlg, ETDT_ENABLETAB);
+ himlViewModes = ImageList_Create(16, 16, ILC_MASK | (IsWinVerXPPlus() ? ILC_COLOR32 : ILC_COLOR16), 12, 0);
{
- int i=0;
- TCITEM tci;
- RECT rcClient;
- CLCINFOITEM cii = {0};
- HICON hIcon;
-
- xpt_EnableThemeDialogTexture(hwndDlg, ETDT_ENABLETAB);
-
- himlViewModes = ImageList_Create(16, 16, ILC_MASK | (IsWinVerXPPlus() ? ILC_COLOR32 : ILC_COLOR16), 12, 0);
+ int i;
for (i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++) {
- hIcon = LoadSkinnedProtoIcon(NULL, i);
+ HICON hIcon = LoadSkinnedProtoIcon(NULL, i);
ImageList_AddIcon(himlViewModes, hIcon);
Skin_ReleaseIcon(hIcon);
}
- hIcon = (HICON)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_SMALLDOT), IMAGE_ICON, 16, 16, 0);
+ HICON hIcon = (HICON)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_SMALLDOT), IMAGE_ICON, 16, 16, 0);
nullImage = ImageList_AddIcon(himlViewModes, hIcon);
DestroyIcon(hIcon);
+
+ RECT rcClient;
GetClientRect(hwndDlg, &rcClient);
- tci.mask = TCIF_PARAM|TCIF_TEXT;
+ TCITEM tci;
+ tci.mask = TCIF_PARAM | TCIF_TEXT;
tci.lParam = 0;
tci.pszText = TranslateT("Sticky contacts");
SendMessage(GetDlgItem(hwndDlg, IDC_TAB), TCM_INSERTITEM, 0, (LPARAM)&tci);
@@ -754,7 +751,8 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETINDENT,10,0);
for (i=0;i <= FONTID_MAX;i++)
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETTEXTCOLOR,i,GetSysColor(COLOR_WINDOWTEXT));
- cii.cbSize = sizeof(cii);
+
+ CLCINFOITEM cii = { sizeof(cii) };
cii.hParentGroup = 0;
cii.pszText = TranslateT("*** All contacts ***");
hInfoItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_ADDINFOITEM, 0, (LPARAM)&cii);
@@ -762,10 +760,8 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP
int index = 0;
- if ( g_CluiData.current_viewmode[0] != '\0' )
- {
- TCHAR * temp = mir_utf8decodeW( g_CluiData.current_viewmode );
-
+ if (g_CluiData.current_viewmode[0] != '\0') {
+ TCHAR *temp = mir_utf8decodeW( g_CluiData.current_viewmode );
if (temp) {
index = SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_FINDSTRING, -1, (LPARAM)temp );
mir_free(temp);
@@ -774,8 +770,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP
index = 0;
}
- if (SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_SETCURSEL, index, 0) != LB_ERR)
- {
+ if (SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_SETCURSEL, index, 0) != LB_ERR) {
clvm_curItem = index;
UpdateFilters();
}
@@ -791,8 +786,9 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP
//EnableWindow(GetDlgItem(hwndDlg, IDC_VARIABLES), ServiceExists(MS_VARS_FORMATSTRING));
SendDlgItemMessage(hwndDlg, IDC_AUTOCLEARSPIN, UDM_SETRANGE, 0, MAKELONG(1000, 0));
SetWindowText(hwndDlg, TranslateT("Configure view modes"));
- return TRUE;
}
+ return TRUE;
+
case WM_COMMAND:
switch(LOWORD(wParam)) {
case IDC_PROTOGROUPOP:
@@ -802,12 +798,15 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP
if (HIWORD(wParam) == CBN_SELCHANGE)
EnableWindow(GetDlgItem(hwndDlg, IDC_APPLY), TRUE);
break;
+
case IDC_USEGROUPS:
EnableWindow(GetDlgItem(hwndDlg, IDC_APPLY), TRUE);
break;
+
case IDC_AUTOCLEAR:
EnableWindow(GetDlgItem(hwndDlg, IDC_APPLY), TRUE);
break;
+
case IDC_LASTMSG:
{
int bUseLastMsg = IsDlgButtonChecked(hwndDlg, IDC_LASTMSG);
@@ -815,48 +814,43 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP
EnableWindow(GetDlgItem(hwndDlg, IDC_LASTMESSAGEUNIT), bUseLastMsg);
EnableWindow(GetDlgItem(hwndDlg, IDC_LASTMSGVALUE), bUseLastMsg);
EnableWindow(GetDlgItem(hwndDlg, IDC_APPLY), TRUE);
- break;
}
+ break;
+
case IDC_AUTOCLEARVAL:
case IDC_LASTMSGVALUE:
if (HIWORD(wParam) == EN_CHANGE && GetFocus() == (HWND)lParam)
EnableWindow(GetDlgItem(hwndDlg, IDC_APPLY), TRUE);
break;
- case IDC_DELETEVIEWMODE:
- {
- if (MessageBox(0, TranslateT("Really delete this view mode? This cannot be undone"), TranslateT("Delete a view mode"), MB_YESNO | MB_ICONQUESTION) == IDYES)
- {
- int iLen = SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_GETTEXTLEN, SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_GETCURSEL, 0, 0), 0);
- if (iLen)
- {
- //TODO: UNICODE
- TCHAR *szTempBuf = ( TCHAR* )malloc((iLen + 1)*sizeof(TCHAR));
- char *szBuf = NULL;
- if (szTempBuf)
- {
- SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_GETTEXT, SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_GETCURSEL, 0, 0), (LPARAM)szTempBuf);
- szBuf = mir_utf8encodeT(szTempBuf);
- DeleteViewMode( szBuf );
-
- SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_DELETESTRING, SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_GETCURSEL, 0, 0), 0);
- if (SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_SETCURSEL, 0, 0) != LB_ERR)
- {
- clvm_curItem = 0;
- UpdateFilters();
- }
- else
- clvm_curItem = -1;
-
- if (szBuf && szBuf != (char*)szTempBuf) mir_free(szBuf);
- if (szTempBuf) free(szTempBuf);
- szTempBuf = NULL;
- szBuf = NULL;
+ case IDC_DELETEVIEWMODE:
+ if (MessageBox(0, TranslateT("Really delete this view mode? This cannot be undone"), TranslateT("Delete a view mode"), MB_YESNO | MB_ICONQUESTION) == IDYES) {
+ int iLen = SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_GETTEXTLEN, SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_GETCURSEL, 0, 0), 0);
+ if (iLen) {
+ //TODO: UNICODE
+ TCHAR *szTempBuf = ( TCHAR* )malloc((iLen + 1)*sizeof(TCHAR));
+ char *szBuf = NULL;
+ if (szTempBuf) {
+ SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_GETTEXT, SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_GETCURSEL, 0, 0), (LPARAM)szTempBuf);
+ szBuf = mir_utf8encodeT(szTempBuf);
+ DeleteViewMode( szBuf );
+
+ SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_DELETESTRING, SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_GETCURSEL, 0, 0), 0);
+ if (SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_SETCURSEL, 0, 0) != LB_ERR) {
+ clvm_curItem = 0;
+ UpdateFilters();
}
+ else clvm_curItem = -1;
+
+ if (szBuf && szBuf != (char*)szTempBuf) mir_free(szBuf);
+ if (szTempBuf) free(szTempBuf);
+ szTempBuf = NULL;
+ szBuf = NULL;
}
}
- break;
}
+ break;
+
case IDC_ADDVIEWMODE:
{
TCHAR szBuf[256];
@@ -864,17 +858,14 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP
GetDlgItemText(hwndDlg, IDC_NEWVIEMODE, szBuf, 256);
szBuf[255] = 0;
- if (lstrlen(szBuf) > 0)
- {
+ if (lstrlen(szBuf) > 0) {
char *szUTF8Buf = mir_utf8encodeT(szBuf);
if (db_get_dw(NULL, CLVM_MODULE, szUTF8Buf, -1) != -1)
MessageBox(0, TranslateT("A view mode with this name does alredy exist"), TranslateT("Duplicate name"), MB_OK);
- else
- {
+ else {
int iNewItem = SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_INSERTSTRING, -1, (LPARAM)szBuf);
- if (iNewItem != LB_ERR)
- {
+ if (iNewItem != LB_ERR) {
SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_SETCURSEL, (WPARAM)iNewItem, 0);
SaveViewMode(szUTF8Buf, _T(""), "", 0, -1, 0, 0, 0, 0);
clvm_curItem = iNewItem;
@@ -892,12 +883,9 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP
}
case IDC_CLEARALL:
{
- HANDLE hItem;
HANDLE hContact = db_find_first();
-
- while(hContact)
- {
- hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
+ while(hContact) {
+ HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if (hItem)
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItem, 0);
hContact = db_find_next(hContact);
@@ -915,10 +903,11 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP
DestroyWindow(hwndDlg);
break;
}
+
if (LOWORD(wParam) == IDC_NEWVIEMODE && HIWORD(wParam) == EN_CHANGE)
EnableWindow(GetDlgItem(hwndDlg, IDC_ADDVIEWMODE), TRUE);
- if (LOWORD(wParam) == IDC_VIEWMODES && HIWORD(wParam) == LBN_SELCHANGE)
- {
+
+ if (LOWORD(wParam) == IDC_VIEWMODES && HIWORD(wParam) == LBN_SELCHANGE) {
SaveState();
clvm_curItem = SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_GETCURSEL, 0, 0);
UpdateFilters();
@@ -926,56 +915,50 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP
//SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
break;
+
case WM_NOTIFY:
- {
- switch (((LPNMHDR) lParam)->idFrom) {
- case IDC_GROUPS:
- case IDC_STATUSMODES:
- case IDC_PROTOCOLS:
- case IDC_CLIST:
- if (((LPNMHDR) lParam)->code == NM_CLICK || ((LPNMHDR) lParam)->code == CLN_CHECKCHANGED)
- EnableWindow(GetDlgItem(hwndDlg, IDC_APPLY), TRUE);
-
- switch (((LPNMHDR)lParam)->code) {
- case NM_CLICK:
- {
- HANDLE hItem;
- NMCLISTCONTROL *nm = (NMCLISTCONTROL*)lParam;
- DWORD hitFlags;
- int iImage;
-
- if (nm->iColumn == -1)
- break;
- hItem = (HANDLE)SendDlgItemMessage(hwndDlg,IDC_CLIST,CLM_HITTEST,(WPARAM)&hitFlags,MAKELPARAM(nm->pt.x,nm->pt.y));
- if (hItem == NULL) break;
-
- if ( !(hitFlags&CLCHT_ONITEMEXTRA))
- break;
- iImage = SendDlgItemMessage(hwndDlg,IDC_CLIST,CLM_GETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(nm->iColumn,0));
- if (iImage == nullImage)
- iImage = nm->iColumn;
- else if (iImage != EMPTY_EXTRA_ICON)
- iImage = nullImage;
- SetIconsForColumn(GetDlgItem(hwndDlg,IDC_CLIST),hItem,hInfoItem,nm->iColumn,iImage);
- //SetListGroupIcons(GetDlgItem(hwndDlg,IDC_CLIST),(HANDLE)SendDlgItemMessage(hwndDlg,IDC_LIST,CLM_GETNEXTITEM,CLGN_ROOT,0),hInfoItem,NULL);
- break;
- }
- }
- break;
+ switch (((LPNMHDR) lParam)->idFrom) {
+ case IDC_GROUPS:
+ case IDC_STATUSMODES:
+ case IDC_PROTOCOLS:
+ case IDC_CLIST:
+ if (((LPNMHDR) lParam)->code == NM_CLICK || ((LPNMHDR) lParam)->code == CLN_CHECKCHANGED)
+ EnableWindow(GetDlgItem(hwndDlg, IDC_APPLY), TRUE);
- case IDC_TAB:
- if (((LPNMHDR) lParam)->code == TCN_SELCHANGE) {
- int id = TabCtrl_GetCurSel(GetDlgItem(hwndDlg, IDC_TAB));
- if (id == 0)
- ShowPage(hwndDlg, 0);
- else
- ShowPage(hwndDlg, 1);
+ if (((LPNMHDR)lParam)->code == NM_CLICK) {
+ NMCLISTCONTROL *nm = (NMCLISTCONTROL*)lParam;
+ if (nm->iColumn == -1)
+ break;
+
+ DWORD hitFlags;
+ HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg,IDC_CLIST,CLM_HITTEST,(WPARAM)&hitFlags,MAKELPARAM(nm->pt.x,nm->pt.y));
+ if (hItem == NULL)
break;
- }
+ if ( !(hitFlags & CLCHT_ONITEMEXTRA))
+ break;
+
+ int iImage = SendDlgItemMessage(hwndDlg,IDC_CLIST,CLM_GETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(nm->iColumn,0));
+ if (iImage == nullImage)
+ iImage = nm->iColumn;
+ else if (iImage != EMPTY_EXTRA_ICON)
+ iImage = nullImage;
+ SetIconsForColumn(GetDlgItem(hwndDlg,IDC_CLIST),hItem,hInfoItem,nm->iColumn,iImage);
}
break;
+
+ case IDC_TAB:
+ if (((LPNMHDR) lParam)->code == TCN_SELCHANGE) {
+ int id = TabCtrl_GetCurSel(GetDlgItem(hwndDlg, IDC_TAB));
+ if (id == 0)
+ ShowPage(hwndDlg, 0);
+ else
+ ShowPage(hwndDlg, 1);
+ break;
+ }
}
+ break;
+
case WM_DESTROY:
ImageList_RemoveAll(himlViewModes);
ImageList_Destroy(himlViewModes);
@@ -994,8 +977,7 @@ static int FillMenuCallback(char *szSetting)
if (szSetting[0] == (char)13)
return 1;
- TCHAR * temp;
- mir_utf8decode(szSetting,&temp);
+ TCHAR *temp = mir_utf8decodeT(szSetting);
if (temp) {
AppendMenu(hViewModeMenu, MFT_STRING, menuCounter++, temp);
mir_free(temp);
@@ -1033,7 +1015,7 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
MakeButtonSkinned(hwndSelector);
SendMessage(hwndSelector, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Select a view mode"), BATF_TCHAR);
SendMessage(hwndSelector, BUTTONSETMARGINS,0 ,(LPARAM) &rcMargins);
- SendMessage(hwndSelector, BUTTONSETID,0 ,(LPARAM) "ViewMode.Select" );
+ SendMessage(hwndSelector, BUTTONSETID,0 ,(LPARAM) "ViewMode.Select");
SendMessage(hwndSelector, WM_SETFONT,0 ,(LPARAM) FONTID_VIEMODES+1 );
SendMessage(hwndSelector, BUTTONSETASFLATBTN, TRUE, 0 );
SendMessage(hwndSelector, MBM_UPDATETRANSPARENTFLAG, 0, 2);
@@ -1044,7 +1026,7 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
hwnd, (HMENU) IDC_CONFIGUREMODES, g_hInst, NULL);
MakeButtonSkinned(hwndButton);
SendMessage(hwndButton, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Setup view modes"), BATF_TCHAR);
- SendMessage(hwndButton, BUTTONSETID,0 ,(LPARAM) "ViewMode.Setup" );
+ SendMessage(hwndButton, BUTTONSETID,0 ,(LPARAM) "ViewMode.Setup");
SendMessage(hwndButton, BUTTONSETASFLATBTN, TRUE, 0 );
SendMessage(hwndButton, MBM_UPDATETRANSPARENTFLAG, 0, 2);
@@ -1052,14 +1034,16 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
hwnd, (HMENU) IDC_RESETMODES, g_hInst, NULL);
MakeButtonSkinned(hwndButton);
SendMessage(hwndButton, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Clear view mode and return to default display"), BATF_TCHAR);
- SendMessage(hwndButton, BUTTONSETID,0 ,(LPARAM) "ViewMode.Clear" );
+ SendMessage(hwndButton, BUTTONSETID,0 ,(LPARAM) "ViewMode.Clear");
SendMessage(hwnd, WM_USER + 100, 0, 0);
SendMessage(hwndButton, BUTTONSETASFLATBTN, TRUE, 0 );
SendMessage(hwndButton, MBM_UPDATETRANSPARENTFLAG, 0, 2);
- return FALSE;
}
+ return FALSE;
+
case WM_NCCALCSIZE:
return 18;// FrameNCCalcSize(hwnd, DefWindowProc, wParam, lParam, hasTitleBar);
+
case WM_SIZE:
{
RECT rcCLVMFrame;
@@ -1083,7 +1067,6 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
(LPARAM) RegisterIcolibIconHandle("CLN_CLVM_set", "Contact List",Translate("Setup view modes"), NULL, 0, g_hInst, IDI_SETVIEW ));
{
- // int bSkinned = db_get_b(NULL, "CLCExt", "bskinned", 0);
for (int i=0; _buttons[i] != 0; i++) {
SendDlgItemMessage(hwnd, _buttons[i], BUTTONSETASFLATBTN, TRUE, 0);
SendDlgItemMessage(hwnd, _buttons[i], BUTTONSETASFLATBTN + 10, 0, 0);
@@ -1222,7 +1205,7 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
}
case IDC_RESETMODES:
clvm_reset_command:
- ApplyViewMode( "" );
+ ApplyViewMode("");
break;
case IDC_CONFIGUREMODES: