summaryrefslogtreecommitdiff
path: root/plugins/Clist_mw
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Clist_mw')
-rw-r--r--plugins/Clist_mw/src/BkgrCfg.cpp2
-rw-r--r--plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp24
-rw-r--r--plugins/Clist_mw/src/CLUIFrames/statusbar.cpp480
-rw-r--r--plugins/Clist_mw/src/clc.cpp8
-rw-r--r--plugins/Clist_mw/src/clcitems.cpp6
-rw-r--r--plugins/Clist_mw/src/clcopts.cpp22
-rw-r--r--plugins/Clist_mw/src/clcpaint.cpp2
-rw-r--r--plugins/Clist_mw/src/clcutils.cpp2
-rw-r--r--plugins/Clist_mw/src/clistmod.cpp6
-rw-r--r--plugins/Clist_mw/src/clistopts.cpp42
-rw-r--r--plugins/Clist_mw/src/clistsettings.cpp12
-rw-r--r--plugins/Clist_mw/src/clui.cpp126
-rw-r--r--plugins/Clist_mw/src/cluiopts.cpp54
-rw-r--r--plugins/Clist_mw/src/cluiservices.cpp6
-rw-r--r--plugins/Clist_mw/src/contact.cpp12
-rw-r--r--plugins/Clist_mw/src/groupmenu.cpp2
16 files changed, 337 insertions, 469 deletions
diff --git a/plugins/Clist_mw/src/BkgrCfg.cpp b/plugins/Clist_mw/src/BkgrCfg.cpp
index 8753b852d6..dba17a1ca4 100644
--- a/plugins/Clist_mw/src/BkgrCfg.cpp
+++ b/plugins/Clist_mw/src/BkgrCfg.cpp
@@ -64,7 +64,7 @@ static INT_PTR CALLBACK DlgProcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
int jndx;
dat->item[indx].changed = FALSE;
- dat->item[indx].useBitmap = DBGetContactSettingByte(NULL,module, "UseBitmap", DEFAULT_USEBITMAP);
+ dat->item[indx].useBitmap = db_get_b(NULL,module, "UseBitmap", DEFAULT_USEBITMAP);
dat->item[indx].bkColor = DBGetContactSettingDword(NULL,module, "BkColour", DEFAULT_BKCOLOUR);
dat->item[indx].selColor = DBGetContactSettingDword(NULL,module, "SelBkColour", DEFAULT_SELBKCOLOUR);
{
diff --git a/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp
index 9e32704f03..2226988142 100644
--- a/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp
+++ b/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp
@@ -486,11 +486,11 @@ int DBLoadFrameSettingsAtPos(int pos,int Frameid)
_itoa(pos,sadd,10);
//boolean
- Frames[Frameid].collapsed = DBGetContactSettingByte(0,CLUIFrameModule,AS(buf,"Collapse",sadd),Frames[Frameid].collapsed);
+ Frames[Frameid].collapsed = db_get_b(0,CLUIFrameModule,AS(buf,"Collapse",sadd),Frames[Frameid].collapsed);
- Frames[Frameid].Locked = DBGetContactSettingByte(0,CLUIFrameModule,AS(buf,"Locked",sadd),Frames[Frameid].Locked);
- Frames[Frameid].visible = DBGetContactSettingByte(0,CLUIFrameModule,AS(buf,"Visible",sadd),Frames[Frameid].visible);
- Frames[Frameid].TitleBar.ShowTitleBar = DBGetContactSettingByte(0,CLUIFrameModule,AS(buf,"TBVisile",sadd),Frames[Frameid].TitleBar.ShowTitleBar);
+ Frames[Frameid].Locked = db_get_b(0,CLUIFrameModule,AS(buf,"Locked",sadd),Frames[Frameid].Locked);
+ Frames[Frameid].visible = db_get_b(0,CLUIFrameModule,AS(buf,"Visible",sadd),Frames[Frameid].visible);
+ Frames[Frameid].TitleBar.ShowTitleBar = db_get_b(0,CLUIFrameModule,AS(buf,"TBVisile",sadd),Frames[Frameid].TitleBar.ShowTitleBar);
Frames[Frameid].height = DBGetContactSettingWord(0,CLUIFrameModule,AS(buf,"Height",sadd),Frames[Frameid].height);
Frames[Frameid].HeightWhenCollapsed = DBGetContactSettingWord(0,CLUIFrameModule,AS(buf,"HeightCollapsed",sadd),0);
@@ -501,10 +501,10 @@ int DBLoadFrameSettingsAtPos(int pos,int Frameid)
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 = DBGetContactSettingByte(0,CLUIFrameModule,AS(buf,"Floating",sadd),0);
+ Frames[Frameid].floating = db_get_b(0,CLUIFrameModule,AS(buf,"Floating",sadd),0);
Frames[Frameid].order = DBGetContactSettingWord(0,CLUIFrameModule,AS(buf,"Order",sadd),0);
- Frames[Frameid].UseBorder = DBGetContactSettingByte(0,CLUIFrameModule,AS(buf,"UseBorder",sadd),Frames[Frameid].UseBorder);
+ Frames[Frameid].UseBorder = db_get_b(0,CLUIFrameModule,AS(buf,"UseBorder",sadd),Frames[Frameid].UseBorder);
return 0;
}
@@ -1310,7 +1310,7 @@ INT_PTR CLUIFramesCollapseUnCollapseFrame(WPARAM wParam,LPARAM lParam)
ulockfrm();
return 0;
}
- if (DBGetContactSettingByte(NULL,"CLUI","AutoSize",0)) {
+ if ( db_get_b(NULL,"CLUI","AutoSize",0)) {
ulockfrm();
return 0;
}
@@ -1567,7 +1567,7 @@ INT_PTR CLUIFramesAddFrame(WPARAM wParam,LPARAM lParam)
//override tbbtip
//clfrm->Flags != F_SHOWTBTIP;
//
- if (DBGetContactSettingByte(0,CLUIFrameModule,"RemoveAllBorders",0) == 1)
+ if ( db_get_b(0,CLUIFrameModule,"RemoveAllBorders",0) == 1)
clfrm->Flags |= F_NOBORDER;
Frames[nFramescount].dwFlags = clfrm->Flags;
@@ -1595,7 +1595,7 @@ INT_PTR CLUIFramesAddFrame(WPARAM wParam,LPARAM lParam)
// create frame
Frames[nFramescount].TitleBar.hwnd = CreateWindow(CLUIFrameTitleBarClassName,Frames[nFramescount].name,
- (DBGetContactSettingByte(0,CLUIFrameModule,"RemoveAllTitleBarBorders",0)?0:WS_BORDER) |WS_CHILD|WS_CLIPCHILDREN|
+ ( db_get_b(0,CLUIFrameModule,"RemoveAllTitleBarBorders",0)?0:WS_BORDER) |WS_CHILD|WS_CLIPCHILDREN|
(Frames[nFramescount].TitleBar.ShowTitleBar?WS_VISIBLE:0)| WS_CLIPCHILDREN,
0,0,0,0,pcli->hwndContactList,NULL,g_hInst,NULL);
SetWindowLongPtr(Frames[nFramescount].TitleBar.hwnd,GWLP_USERDATA,Frames[nFramescount].id);
@@ -1984,13 +1984,13 @@ int OnFrameTitleBarBackgroundChange(WPARAM wParam,LPARAM lParam)
{
DBVARIANT dbv;
- AlignCOLLIconToLeft = DBGetContactSettingByte(NULL,"FrameTitleBar","AlignCOLLIconToLeft",0);
+ AlignCOLLIconToLeft = db_get_b(NULL,"FrameTitleBar","AlignCOLLIconToLeft",0);
bkColour = DBGetContactSettingDword(NULL,"FrameTitleBar","BkColour",CLCDEFAULT_BKCOLOUR);
//SelBkColour = DBGetContactSettingDword(NULL,"FrameTitleBar","SelBkColour",0);
if (hBmpBackground) {DeleteObject(hBmpBackground); hBmpBackground = NULL;}
- if (DBGetContactSettingByte(NULL,"FrameTitleBar","UseBitmap",CLCDEFAULT_USEBITMAP)) {
+ if ( db_get_b(NULL,"FrameTitleBar","UseBitmap",CLCDEFAULT_USEBITMAP)) {
if (!DBGetContactSetting(NULL,"FrameTitleBar","BkBitmap",&dbv)) {
hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP,0,(LPARAM)dbv.pszVal);
mir_free(dbv.pszVal);
@@ -2320,7 +2320,7 @@ LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
}
if (( !(wParam & MK_CONTROL)) && Frames[framepos].Locked && (!(Frames[framepos].floating))) {
- if (DBGetContactSettingByte(NULL,"CLUI","ClientAreaDrag",0)) {
+ if ( db_get_b(NULL,"CLUI","ClientAreaDrag",0)) {
POINT pt;
//pt = nm->pt;
GetCursorPos(&pt);
diff --git a/plugins/Clist_mw/src/CLUIFrames/statusbar.cpp b/plugins/Clist_mw/src/CLUIFrames/statusbar.cpp
index ba6c8e4304..c8c62c1bd4 100644
--- a/plugins/Clist_mw/src/CLUIFrames/statusbar.cpp
+++ b/plugins/Clist_mw/src/CLUIFrames/statusbar.cpp
@@ -29,21 +29,22 @@ int extraspace;
int OnStatusBarBackgroundChange()
{
- {
+ showOpts = db_get_b(NULL,"CLUI","SBarShow",1);
+ bkColour = DBGetContactSettingDword(NULL,"StatusBar","BkColour",CLCDEFAULT_BKCOLOUR);
+ if (hBmpBackground)
+ DeleteObject(hBmpBackground), hBmpBackground = NULL;
+
+ if ( db_get_b(NULL,"StatusBar","UseBitmap",CLCDEFAULT_USEBITMAP)) {
DBVARIANT dbv;
- showOpts = DBGetContactSettingByte(NULL,"CLUI","SBarShow",1);
- bkColour = DBGetContactSettingDword(NULL,"StatusBar","BkColour",CLCDEFAULT_BKCOLOUR);
- if (hBmpBackground) {DeleteObject(hBmpBackground); hBmpBackground = NULL;}
- if (DBGetContactSettingByte(NULL,"StatusBar","UseBitmap",CLCDEFAULT_USEBITMAP)) {
- if (!DBGetContactSettingString(NULL,"StatusBar","BkBitmap",&dbv)) {
- hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP,0,(LPARAM)dbv.pszVal);
- mir_free(dbv.pszVal);
- }
+ if ( !DBGetContactSettingTString(NULL, "StatusBar", "BkBitmap", &dbv)) {
+ hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAPT, 0, (LPARAM)dbv.ptszVal);
+ db_free(&dbv);
}
- backgroundBmpUse = DBGetContactSettingWord(NULL,"StatusBar","BkBmpUse",CLCDEFAULT_BKBMPUSE);
- extraspace = DBGetContactSettingDword(NULL,"StatusBar","BkExtraSpace",0);
}
+ backgroundBmpUse = DBGetContactSettingWord(NULL,"StatusBar","BkBmpUse",CLCDEFAULT_BKBMPUSE);
+ extraspace = DBGetContactSettingDword(NULL,"StatusBar","BkExtraSpace",0);
+
RecreateStatusBar(pcli->hwndContactList);
if (pcli->hwndStatus) InvalidateRect(pcli->hwndStatus,NULL,TRUE);
return 0;
@@ -52,27 +53,18 @@ int OnStatusBarBackgroundChange()
void DrawDataForStatusBar(LPDRAWITEMSTRUCT dis)
{
- //LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam;
ProtocolData *PD = (ProtocolData *)dis->itemData;
- char *szProto = (char*)dis->itemData;
- int status,x;
SIZE textSize;
boolean NeedDestroy = FALSE;
- HICON hIcon;
- HRGN hrgn;
-
- if (PD == NULL){return;}
- if (dis->hDC == NULL) {return;}
+ if (PD == NULL || dis->hDC == NULL)
+ return;
//clip it
-
- hrgn = CreateRectRgn(dis->rcItem.left, dis->rcItem.top,
- dis->rcItem.right, dis->rcItem.bottom);
-
+ HRGN hrgn = CreateRectRgn(dis->rcItem.left, dis->rcItem.top, dis->rcItem.right, dis->rcItem.bottom);
SelectClipRgn(dis->hDC, hrgn);
- szProto = PD->RealName;
+ char *szProto = PD->RealName;
#ifdef _DEBUG
{
//char buf[512];
@@ -81,44 +73,38 @@ void DrawDataForStatusBar(LPDRAWITEMSTRUCT dis)
}
#endif
- status = CallProtoService(szProto,PS_GETSTATUS,0,0);
+ int status = CallProtoService(szProto,PS_GETSTATUS,0,0);
SetBkMode(dis->hDC,TRANSPARENT);
- x = dis->rcItem.left+extraspace;
-
- if (showOpts&1)
- {
- if ((DBGetContactSettingByte(NULL,"CLUI","UseConnectingIcon",1) == 1) && status < ID_STATUS_OFFLINE)
- {
- hIcon = (HICON)GetConnectingIconService((WPARAM)szProto,0);
+ int x = dis->rcItem.left+extraspace;
+ if (showOpts & 1) {
+ HICON hIcon;
+ if ( db_get_b(NULL, "CLUI", "UseConnectingIcon", 1) == 1 && status < ID_STATUS_OFFLINE) {
+ hIcon = (HICON)GetConnectingIconService((WPARAM)szProto, 0);
if (hIcon)
- {
NeedDestroy = TRUE;
- }else
- {
+ else
hIcon = LoadSkinnedProtoIcon(szProto,status);
- }
-
- }else
- {
- hIcon = LoadSkinnedProtoIcon(szProto,status);
}
+ else hIcon = LoadSkinnedProtoIcon(szProto,status);
+
DrawIconEx(dis->hDC,x,(dis->rcItem.top+dis->rcItem.bottom-GetSystemMetrics(SM_CYSMICON))>>1,hIcon,GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),0,NULL,DI_NORMAL);
if (NeedDestroy) DestroyIcon(hIcon);
x += GetSystemMetrics(SM_CXSMICON)+2;
}
else x += 2;
- if (showOpts&2) {
- TCHAR szName[64];
+ if (showOpts & 2) {
PROTOACCOUNT* pa = ProtoGetAccount(szProto);
+ TCHAR szName[64];
mir_sntprintf(szName, SIZEOF(szName), _T("%s%s"), pa->tszAccountName, showOpts&4 ? _T(" ") : _T(""));
GetTextExtentPoint32(dis->hDC, szName, (int)_tcslen(szName), &textSize);
TextOut(dis->hDC,x,(dis->rcItem.top+dis->rcItem.bottom-textSize.cy)>>1,szName,lstrlen(szName));
x += textSize.cx;
}
- if (showOpts&4) {
+
+ if (showOpts & 4) {
TCHAR *szStatus = pcli->pfnGetStatusModeDescription(status, 0);
if (!szStatus)
szStatus = _T("");
@@ -143,18 +129,12 @@ void DrawBackGround(HWND hwnd,HDC mhdc)
HFONT oFont;
HBRUSH hBrushAlternateGrey = NULL;
- HFONT hFont;
-
- //InvalidateRect(hwnd,0,FALSE);
-
- hFont = (HFONT)SendMessage(hwnd,WM_GETFONT,0,0);
-
- if (mhdc)
- {
+ HFONT hFont = (HFONT)SendMessage(hwnd,WM_GETFONT,0,0);
+ if (mhdc) {
hdc = mhdc;
rcPaint = NULL;
- }else
- {
+ }
+ else {
hdc = BeginPaint(hwnd,&paintst);
rcPaint = &(paintst.rcPaint);
}
@@ -168,110 +148,103 @@ void DrawBackGround(HWND hwnd,HDC mhdc)
holdbmp = (HBITMAP)SelectObject(hdcMem,hBmpOsb);
oFont = (HFONT)SelectObject(hdcMem,hFont);
SetBkMode(hdcMem,TRANSPARENT);
- { HBRUSH hBrush,hoBrush;
-
- hBrush = CreateSolidBrush(bkColour);
- hoBrush = (HBRUSH)SelectObject(hdcMem,hBrush);
- FillRect(hdcMem,rcPaint,hBrush);
- SelectObject(hdcMem,hoBrush);
- DeleteObject(hBrush);
- if (hBmpBackground) {
- BITMAP bmp;
- int x,y;
- int maxx,maxy;
- int destw,desth;
-
- GetObject(hBmpBackground,sizeof(bmp),&bmp);
- HDC hdcBmp = CreateCompatibleDC(hdcMem);
- HDC holdbackbmp = (HDC)SelectObject(hdcBmp,hBmpBackground);
- y = backgroundBmpUse&CLBF_SCROLL?-yScroll:0;
- maxx = backgroundBmpUse&CLBF_TILEH?clRect.right:1;
- maxy = backgroundBmpUse&CLBF_TILEV?maxy = rcPaint->bottom:y+1;
- switch(backgroundBmpUse&CLBM_TYPE) {
- case CLB_STRETCH:
- if (backgroundBmpUse&CLBF_PROPORTIONAL) {
- if (clRect.right*bmp.bmHeight<clRect.bottom*bmp.bmWidth) {
- desth = clRect.bottom;
- destw = desth*bmp.bmWidth/bmp.bmHeight;
+ {
+ HBRUSH hBrush = CreateSolidBrush(bkColour);
+ HBRUSH hoBrush = (HBRUSH)SelectObject(hdcMem,hBrush);
+ FillRect(hdcMem,rcPaint,hBrush);
+ SelectObject(hdcMem,hoBrush);
+ DeleteObject(hBrush);
+ if (hBmpBackground) {
+ BITMAP bmp;
+ int x,y;
+ int maxx,maxy;
+ int destw,desth;
+
+ GetObject(hBmpBackground,sizeof(bmp),&bmp);
+ HDC hdcBmp = CreateCompatibleDC(hdcMem);
+ HDC holdbackbmp = (HDC)SelectObject(hdcBmp,hBmpBackground);
+ y = backgroundBmpUse&CLBF_SCROLL?-yScroll:0;
+ maxx = backgroundBmpUse&CLBF_TILEH?clRect.right:1;
+ maxy = backgroundBmpUse&CLBF_TILEV?maxy = rcPaint->bottom:y+1;
+ switch(backgroundBmpUse&CLBM_TYPE) {
+ case CLB_STRETCH:
+ if (backgroundBmpUse&CLBF_PROPORTIONAL) {
+ if (clRect.right*bmp.bmHeight<clRect.bottom*bmp.bmWidth) {
+ desth = clRect.bottom;
+ destw = desth*bmp.bmWidth/bmp.bmHeight;
+ }
+ else {
+ destw = clRect.right;
+ desth = destw*bmp.bmHeight/bmp.bmWidth;
+ }
}
else {
destw = clRect.right;
+ desth = clRect.bottom;
+ }
+ break;
+
+ case CLB_STRETCHH:
+ if (backgroundBmpUse&CLBF_PROPORTIONAL) {
+ destw = clRect.right;
desth = destw*bmp.bmHeight/bmp.bmWidth;
}
- }
- else {
- destw = clRect.right;
- desth = clRect.bottom;
- }
- break;
- case CLB_STRETCHH:
- if (backgroundBmpUse&CLBF_PROPORTIONAL) {
- destw = clRect.right;
- desth = destw*bmp.bmHeight/bmp.bmWidth;
- }
- else {
- destw = clRect.right;
+ else {
+ destw = clRect.right;
+ desth = bmp.bmHeight;
+ }
+ break;
+
+ case CLB_STRETCHV:
+ if (backgroundBmpUse&CLBF_PROPORTIONAL) {
+ desth = clRect.bottom;
+ destw = desth*bmp.bmWidth/bmp.bmHeight;
+ }
+ else {
+ destw = bmp.bmWidth;
+ desth = clRect.bottom;
+ }
+ break;
+
+ default: //clb_topleft
+ destw = bmp.bmWidth;
desth = bmp.bmHeight;
+ break;
}
- break;
- case CLB_STRETCHV:
- if (backgroundBmpUse&CLBF_PROPORTIONAL) {
- desth = clRect.bottom;
- destw = desth*bmp.bmWidth/bmp.bmHeight;
- }
- else {
- destw = bmp.bmWidth;
- desth = clRect.bottom;
+ desth = clRect.bottom -clRect.top;
+ for (;y<maxy;y += desth) {
+ if (y<rcPaint->top-desth) continue;
+ for (x = 0;x<maxx;x += destw)
+ StretchBlt(hdcMem,x,y,destw,desth,hdcBmp,0,0,bmp.bmWidth,bmp.bmHeight,SRCCOPY);
}
- break;
- default: //clb_topleft
- destw = bmp.bmWidth;
- desth = bmp.bmHeight;
- break;
+ SelectObject(hdcBmp,holdbackbmp);
+ DeleteDC(hdcBmp);
}
- desth = clRect.bottom -clRect.top;
- for (;y<maxy;y += desth) {
- if (y<rcPaint->top-desth) continue;
- for (x = 0;x<maxx;x += destw)
- StretchBlt(hdcMem,x,y,destw,desth,hdcBmp,0,0,bmp.bmWidth,bmp.bmHeight,SRCCOPY);
- }
- SelectObject(hdcBmp,holdbackbmp);
- DeleteDC(hdcBmp);
- }
}
//call to draw icons
{
- DRAWITEMSTRUCT ds;
- int nParts,nPanel;
- ProtocolData *PD;
- RECT rc,clrc;
- int startoffset,sectwidth;
-
- memset(&ds,0,sizeof(ds));
+ DRAWITEMSTRUCT ds = { 0 };
ds.hwndItem = hwnd;
ds.hDC = hdcMem;
+ int startoffset = DBGetContactSettingDword(NULL,"StatusBar","FirstIconOffset",0);
+ int extraspace = DBGetContactSettingDword(NULL,"StatusBar","BkExtraSpace",0);
+ int nParts = SendMessage(hwnd,SB_GETPARTS,0,0);
- startoffset = DBGetContactSettingDword(NULL,"StatusBar","FirstIconOffset",0);
- extraspace = DBGetContactSettingDword(NULL,"StatusBar","BkExtraSpace",0);
-
- nParts = SendMessage(hwnd,SB_GETPARTS,0,0);
- memset(&rc,0,sizeof(RECT));
+ RECT rc = { 0 }, clrc;
GetClientRect(hwnd,&clrc);
clrc.right -= clrc.left;
clrc.right -= startoffset;
- sectwidth = clrc.right/nParts;
+ int sectwidth = clrc.right/nParts;
- for (nPanel = 0;nPanel<nParts;nPanel++)
- {
- PD = (ProtocolData *)SendMessage(pcli->hwndStatus,SB_GETTEXT,(WPARAM)nPanel,0);
- if (PD == NULL){
+ for (int nPanel = 0; nPanel < nParts; nPanel++) {
+ ProtocolData *PD = (ProtocolData *)SendMessage(pcli->hwndStatus,SB_GETTEXT,(WPARAM)nPanel,0);
+ if (PD == NULL)
continue;
- }
+
SendMessage(hwnd,SB_GETRECT,(WPARAM)nPanel,(LPARAM)&rc);
- //rc.left += startoffset;
- //if (rc.left>=rc.right) rc.left = rc.right-1;
+
rc.top = 0;
rc.left = nPanel*sectwidth+startoffset;
rc.right = rc.left+sectwidth-1;
@@ -289,183 +262,123 @@ void DrawBackGround(HWND hwnd,HDC mhdc)
DeleteObject(hBmpOsb);
DeleteDC(hdcMem);
paintst.fErase = FALSE;
- //DeleteObject(hFont);
if (!mhdc)
EndPaint(hwnd,&paintst);
}
-LRESULT CALLBACK StatusBarOwnerDrawProc( HWND hwnd,
- UINT uMsg,
- WPARAM wParam,
- LPARAM lParam
-)
-{
-if (UseOwnerDrawStatusBar)
+LRESULT CALLBACK StatusBarOwnerDrawProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
- switch(uMsg)
- {
- case WM_ERASEBKGND:
- {
-
- //DrawBackGround(hwnd);
+ if (UseOwnerDrawStatusBar) {
+ switch(uMsg) {
+ case WM_ERASEBKGND:
return 0;
- }
- case WM_PRINT:
- {
+
+ case WM_PRINT:
DrawBackGround(hwnd,(HDC)wParam);
return 0;
- }
- case WM_PAINT:
- {
+
+ case WM_PAINT:
DrawBackGround(hwnd,0);
return 0;
}
}
-
-}
-return (CallWindowProc(OldWindowProc,hwnd,uMsg,wParam,lParam)
- );
+ return CallWindowProc(OldWindowProc, hwnd, uMsg, wParam, lParam);
}
LRESULT CALLBACK StatusHelperProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch(msg)
- {
+ switch(msg) {
case WM_CREATE:
- {
- {
- tooltipshoing = FALSE;
- //HWND label;
- //label = CreateWindow("static","Top window",WS_VISIBLE|WS_CHILD ,2,2,120,60,hwnd,NULL,g_hInst,0);
- //SendMessage(label,WM_SETFONT,(WPARAM)TitleBarFont,0);
- }
- return(FALSE);
+ tooltipshoing = FALSE;
+ return FALSE;
- }
- case WM_GETMINMAXINFO:{
+ case WM_GETMINMAXINFO:
+ if (pcli->hwndStatus) {
RECT rct;
- if (pcli->hwndStatus == 0){break;}
GetWindowRect(pcli->hwndStatus,&rct);
- memset((LPMINMAXINFO)lParam,0,sizeof(MINMAXINFO));
+ memset((LPMINMAXINFO)lParam, 0, sizeof(MINMAXINFO));
((LPMINMAXINFO)lParam)->ptMinTrackSize.x = 5;
((LPMINMAXINFO)lParam)->ptMinTrackSize.y = rct.bottom-rct.top;
((LPMINMAXINFO)lParam)->ptMaxTrackSize.x = 1600;
((LPMINMAXINFO)lParam)->ptMaxTrackSize.y = rct.bottom-rct.top;
return 0;
- }
+ }
+ break;
case WM_NCHITTEST:
- {
-
- }
case WM_SHOWWINDOW:
- {
- {
- int res;
- if (hFrameHelperStatusBar)
- {
- res = CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS, MAKEWPARAM(FO_FLAGS,hFrameHelperStatusBar),0);
- DBWriteContactSettingByte(0,"CLUI","ShowSBar",(BYTE)((res&F_VISIBLE)?1:0));
- }
- }
-
+ if (hFrameHelperStatusBar) {
+ int res = CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS, MAKEWPARAM(FO_FLAGS,hFrameHelperStatusBar),0);
+ DBWriteContactSettingByte(0, "CLUI", "ShowSBar", (res & F_VISIBLE) != 0);
+ }
- if (tooltipshoing){
- NotifyEventHooks(hStatusBarHideToolTipEvent,0,0);
- tooltipshoing = FALSE;
- }
- return 0;
- //
+ if (tooltipshoing){
+ NotifyEventHooks(hStatusBarHideToolTipEvent, 0, 0);
+ tooltipshoing = FALSE;
}
+ return 0;
+
case WM_TIMER:
- {
- if (wParam == TM_STATUSBARHIDE)
- {
- KillTimer(hwnd,TM_STATUSBARHIDE);
-
- if (tooltipshoing){
- NotifyEventHooks(hStatusBarHideToolTipEvent,0,0);
- tooltipshoing = FALSE;
- }
-
+ if (wParam == TM_STATUSBARHIDE) {
+ KillTimer(hwnd,TM_STATUSBARHIDE);
+ if (tooltipshoing){
+ NotifyEventHooks(hStatusBarHideToolTipEvent,0,0);
+ tooltipshoing = FALSE;
}
+ }
- if (wParam == TM_STATUSBAR)
- {
- POINT pt;
- KillTimer(hwnd,TM_STATUSBAR);
-
- GetCursorPos(&pt);
- if (pt.x == lastpnt.x&&pt.y == lastpnt.y)
- {
- {
- int i,nParts;
- ProtocolData *PD;
- RECT rc;
- ScreenToClient(pcli->hwndStatus,&pt);
- nParts = SendMessage(pcli->hwndStatus,SB_GETPARTS,0,0);
- for (i = 0;i<nParts;i++) {
- SendMessage(pcli->hwndStatus,SB_GETRECT,i,(LPARAM)&rc);
- if (PtInRect(&rc,pt)) {
- PD = (ProtocolData *)SendMessage(pcli->hwndStatus,SB_GETTEXT,i,0);
- if (PD == NULL){return 0;}
-
- NotifyEventHooks(hStatusBarShowToolTipEvent,(WPARAM)PD->RealName,0);
- SetTimer(hwnd,TM_STATUSBARHIDE,DBGetContactSettingWord(NULL,"CLUIFrames","HideToolTipTime",5000),0);
- tooltipshoing = TRUE;
-
- break;
- }
- }
-
-
-
+ if (wParam == TM_STATUSBAR) {
+ KillTimer(hwnd,TM_STATUSBAR);
+
+ POINT pt;
+ GetCursorPos(&pt);
+ if (pt.x == lastpnt.x&&pt.y == lastpnt.y) {
+ RECT rc;
+ ScreenToClient(pcli->hwndStatus, &pt);
+ int nParts = SendMessage(pcli->hwndStatus,SB_GETPARTS,0,0);
+ for (int i = 0;i<nParts;i++) {
+ SendMessage(pcli->hwndStatus,SB_GETRECT,i,(LPARAM)&rc);
+ if (PtInRect(&rc,pt)) {
+ ProtocolData *PD = (ProtocolData *)SendMessage(pcli->hwndStatus,SB_GETTEXT,i,0);
+ if (PD == NULL)
+ return 0;
+
+ NotifyEventHooks(hStatusBarShowToolTipEvent,(WPARAM)PD->RealName,0);
+ SetTimer(hwnd,TM_STATUSBARHIDE,DBGetContactSettingWord(NULL,"CLUIFrames","HideToolTipTime",5000),0);
+ tooltipshoing = TRUE;
+ break;
}
-
-
-
}
-
}
-
- return 0;
}
+ return 0;
case WM_SETCURSOR:
- {
+ {
+ POINT pt;
+ GetCursorPos(&pt);
+ if (pt.x == lastpnt.x&&pt.y == lastpnt.y)
+ return 0;
- {
- POINT pt;
- GetCursorPos(&pt);
- if (pt.x == lastpnt.x&&pt.y == lastpnt.y)
- {
- return 0;
- }
- lastpnt = pt;
- if (tooltipshoing){
- KillTimer(hwnd,TM_STATUSBARHIDE);
- NotifyEventHooks(hStatusBarHideToolTipEvent,0,0);
- tooltipshoing = FALSE;
- }
- KillTimer(hwnd,TM_STATUSBAR);
- SetTimer(hwnd,TM_STATUSBAR,DBGetContactSettingWord(NULL,"CLC","InfoTipHoverTime",750),0);
- return 0;
- }
+ lastpnt = pt;
+ if (tooltipshoing){
+ KillTimer(hwnd,TM_STATUSBARHIDE);
+ NotifyEventHooks(hStatusBarHideToolTipEvent,0,0);
+ tooltipshoing = FALSE;
+ }
+ KillTimer(hwnd,TM_STATUSBAR);
+ SetTimer(hwnd,TM_STATUSBAR,DBGetContactSettingWord(NULL,"CLC","InfoTipHoverTime",750),0);
+ }
+ return 0;
- }
case WM_NOTIFY:
- {
- if (lParam == 0){return 0;}
- if (((LPNMHDR)lParam)->hwndFrom == pcli->hwndStatus)
- {
-
- if (((LPNMHDR)lParam)->code == WM_NCHITTEST)
- {
- LPNMMOUSE lpnmmouse = (LPNMMOUSE) lParam;
- } ;
- }
- }
+ if (lParam == 0)
+ return 0;
+
+ if (((LPNMHDR)lParam)->hwndFrom == pcli->hwndStatus)
+ if (((LPNMHDR)lParam)->code == WM_NCHITTEST)
+ LPNMMOUSE lpnmmouse = (LPNMMOUSE) lParam;
case WM_CONTEXTMENU:
KillTimer(hwnd,TM_STATUSBARHIDE);
@@ -494,7 +407,7 @@ LRESULT CALLBACK StatusHelperProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
if (b != 0&&(rc.right-rc.left) != (OldRc.right-OldRc.left)) {
OldRc = rc;
if (canloadstatusbar)
- if (DBGetContactSettingByte(NULL,"CLUI","UseOwnerDrawStatusBar",0)||DBGetContactSettingByte(NULL,"CLUI","EqualSections",1))
+ if ( db_get_b(NULL,"CLUI","UseOwnerDrawStatusBar",0)||db_get_b(NULL,"CLUI","EqualSections",1))
CluiProtocolStatusChanged(0,0);
}
if (msg == WM_SIZE) PostMessage(pcli->hwndStatus,WM_SIZE,wParam,lParam);
@@ -536,26 +449,21 @@ HWND CreateStatusHelper(HWND parent)
HANDLE CreateStatusBarFrame()
{
- CLISTFrame Frame;
- int h;
RECT rc;
+ GetWindowRect(helperhwnd,&rc);
+ int h = rc.bottom-rc.top;
- memset(&Frame,0,sizeof(Frame));
+ CLISTFrame Frame = { 0 };
Frame.cbSize = sizeof(CLISTFrame);
Frame.hWnd = helperhwnd;
Frame.align = alBottom;
Frame.hIcon = LoadSkinnedIcon (SKINICON_OTHER_MIRANDA);
- Frame.Flags = (DBGetContactSettingByte(NULL,"CLUI","ShowSBar",1)?F_VISIBLE:0)|F_LOCKED|F_NOBORDER|F_TCHAR;
- GetWindowRect(helperhwnd,&rc);
- h = rc.bottom-rc.top;
- Frame.height = (h == 0)?20:h;
-
-
+ Frame.Flags = ( db_get_b(NULL,"CLUI","ShowSBar",1)?F_VISIBLE:0)|F_LOCKED|F_NOBORDER|F_TCHAR;
+ Frame.height = (h == 0) ? 20 : h;
Frame.tname = _T("Status");
Frame.TBtname = TranslateT("Status Bar");
hFrameHelperStatusBar = (HANDLE)CallService(MS_CLIST_FRAMES_ADDFRAME,(WPARAM)&Frame,0);
-
return hFrameHelperStatusBar;
}
@@ -569,22 +477,20 @@ int RecreateStatusBar(HWND parent)
if (hFrameHelperStatusBar) CallService(MS_CLIST_FRAMES_REMOVEFRAME,(WPARAM)hFrameHelperStatusBar,0);
helperhwnd = CreateStatusHelper(parent);
- UseOwnerDrawStatusBar = DBGetContactSettingByte(NULL,"CLUI","UseOwnerDrawStatusBar",0);
+ UseOwnerDrawStatusBar = db_get_b(NULL,"CLUI","UseOwnerDrawStatusBar",0);
//create the status wnd
pcli->hwndStatus = CreateStatusWindow(
- ( DBGetContactSettingByte(0,"CLUI","SBarUseSizeGrip",TRUE) && (!UseOwnerDrawStatusBar)?SBARS_SIZEGRIP:0)|
- WS_CHILD | (DBGetContactSettingByte(NULL,"CLUI","ShowSBar",1)?WS_VISIBLE:0), _T(""), helperhwnd, 0);
+ ( db_get_b(0,"CLUI","SBarUseSizeGrip",TRUE) && (!UseOwnerDrawStatusBar)?SBARS_SIZEGRIP:0)|
+ WS_CHILD | ( db_get_b(NULL,"CLUI","ShowSBar",1)?WS_VISIBLE:0), _T(""), helperhwnd, 0);
OldWindowProc = (WNDPROC)GetWindowLongPtr(pcli->hwndStatus,GWLP_WNDPROC);
SetWindowLongPtr(pcli->hwndStatus,GWLP_WNDPROC,(LONG_PTR)&StatusBarOwnerDrawProc);
CreateStatusBarFrame();
- {
- SetWindowPos(helperhwnd,NULL,1,1,1,1,SWP_NOZORDER);
- CluiProtocolStatusChanged(0,0);
- CallService(MS_CLIST_FRAMES_UPDATEFRAME,-1,0);
- }
+ SetWindowPos(helperhwnd,NULL,1,1,1,1,SWP_NOZORDER);
+ CluiProtocolStatusChanged(0,0);
+ CallService(MS_CLIST_FRAMES_UPDATEFRAME,-1,0);
return 0;
}
diff --git a/plugins/Clist_mw/src/clc.cpp b/plugins/Clist_mw/src/clc.cpp
index 9a52b8b4cc..0dfd111c39 100644
--- a/plugins/Clist_mw/src/clc.cpp
+++ b/plugins/Clist_mw/src/clc.cpp
@@ -52,13 +52,13 @@ void StatusUpdaterThread(void*)
SetThreadPriority(GetCurrentThread(),THREAD_PRIORITY_LOWEST);
while (!stopStatusUpdater) {
- curdelay = DBGetContactSettingByte(hContact,"CList","StatusMsgAutoDelay",15000);
+ curdelay = db_get_b(hContact,"CList","StatusMsgAutoDelay",15000);
if (curdelay<5000) curdelay = 5000;
if ((int)(GetTickCount()-lastcheck)>curdelay)
{
lastcheck = GetTickCount();
- if (DBGetContactSettingByte(hContact,"CList","StatusMsgAuto",0)) {
+ if ( db_get_b(hContact,"CList","StatusMsgAuto",0)) {
for (i = 0; i<5; i++) {
if (hContact != NULL) {
pClcCacheEntry pdnce = (pClcCacheEntry)pcli->pfnGetCacheEntry((HANDLE)hContact);
@@ -76,7 +76,7 @@ void StatusUpdaterThread(void*)
}
}
}
- //Sleep(DBGetContactSettingByte(hContact,"CList","StatusMsgAutoDelay",100));
+ //Sleep( db_get_b(hContact,"CList","StatusMsgAutoDelay",100));
Sleep(200);
}
}
@@ -89,7 +89,7 @@ HMENU BuildGroupPopupMenu( ClcGroup* group )
void SortClcByTimer (HWND hwnd)
{
KillTimer(hwnd,TIMERID_DELAYEDRESORTCLC);
- SetTimer(hwnd,TIMERID_DELAYEDRESORTCLC,DBGetContactSettingByte(NULL,"CLUI","DELAYEDTIMER",200),NULL);
+ SetTimer(hwnd,TIMERID_DELAYEDRESORTCLC,db_get_b(NULL,"CLUI","DELAYEDTIMER",200),NULL);
}
static int ClcSettingChanged(WPARAM wParam, LPARAM lParam)
diff --git a/plugins/Clist_mw/src/clcitems.cpp b/plugins/Clist_mw/src/clcitems.cpp
index 5eb8a8c9d6..40d048d601 100644
--- a/plugins/Clist_mw/src/clcitems.cpp
+++ b/plugins/Clist_mw/src/clcitems.cpp
@@ -45,7 +45,7 @@ void AddSubcontacts(struct ClcContact * cont)
cacheEntry = GetContactFullCacheEntry(cont->hContact);
OutputDebugStringA("Proceed AddSubcontacts\r\n");
subcount = (int)CallService(MS_MC_GETNUMCONTACTS,(WPARAM)cont->hContact,0);
- cont->SubExpanded = DBGetContactSettingByte(cont->hContact,"CList","Expanded",0);
+ cont->SubExpanded = db_get_b(cont->hContact,"CList","Expanded",0);
cont->isSubcontact = 0;
cont->subcontacts = (struct ClcContact *) mir_realloc(cont->subcontacts, sizeof(struct ClcContact)*subcount);
cont->SubAllocated = subcount;
@@ -54,7 +54,7 @@ void AddSubcontacts(struct ClcContact * cont)
{
hsub = (HANDLE)CallService(MS_MC_GETSUBCONTACT,(WPARAM)cont->hContact,j);
cacheEntry = GetContactFullCacheEntry(hsub);
- if (!(DBGetContactSettingByte(NULL,"CLC","MetaHideOfflineSub",1) && DBGetContactSettingByte(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT))||
+ if (!( db_get_b(NULL,"CLC","MetaHideOfflineSub",1) && db_get_b(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT))||
cacheEntry->status != ID_STATUS_OFFLINE )
{
cont->subcontacts[i].hContact = cacheEntry->hContact;
@@ -335,7 +335,7 @@ void RebuildEntireList(HWND hwnd,struct ClcData *dat)
ClearClcContactCache(dat,INVALID_HANDLE_VALUE);
dat->list.expanded = 1;
- dat->list.hideOffline = DBGetContactSettingByte(NULL,"CLC","HideOfflineRoot",0);
+ dat->list.hideOffline = db_get_b(NULL,"CLC","HideOfflineRoot",0);
memset( &dat->list.cl, 0, sizeof( dat->list.cl ));
dat->list.cl.increment = 30;
dat->needsResort = 1;
diff --git a/plugins/Clist_mw/src/clcopts.cpp b/plugins/Clist_mw/src/clcopts.cpp
index 4bd5d53b1b..6ef5e61634 100644
--- a/plugins/Clist_mw/src/clcopts.cpp
+++ b/plugins/Clist_mw/src/clcopts.cpp
@@ -176,11 +176,11 @@ static INT_PTR CALLBACK DlgProcClcMetaOpts(HWND hwndDlg, UINT msg, WPARAM wParam
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg, IDC_META, DBGetContactSettingByte(NULL,"CLC","Meta",0) ? BST_CHECKED : BST_UNCHECKED); /// by FYR
- CheckDlgButton(hwndDlg, IDC_METADBLCLK, DBGetContactSettingByte(NULL,"CLC","MetaDoubleClick",0) ? BST_CHECKED : BST_UNCHECKED); /// by FYR
- CheckDlgButton(hwndDlg, IDC_METASUBEXTRA, DBGetContactSettingByte(NULL,"CLC","MetaHideExtra",0) ? BST_CHECKED : BST_UNCHECKED); /// by FYR
- CheckDlgButton(hwndDlg, IDC_METASUBEXTRA_IGN, DBGetContactSettingByte(NULL,"CLC","MetaIgnoreEmptyExtra",1) ? BST_CHECKED : BST_UNCHECKED); /// by FYR
- CheckDlgButton(hwndDlg, IDC_METASUB_HIDEOFFLINE, DBGetContactSettingByte(NULL,"CLC","MetaHideOfflineSub",1) ? BST_CHECKED : BST_UNCHECKED); /// by FYR
+ CheckDlgButton(hwndDlg, IDC_META, db_get_b(NULL,"CLC","Meta",0) ? BST_CHECKED : BST_UNCHECKED); /// by FYR
+ CheckDlgButton(hwndDlg, IDC_METADBLCLK, db_get_b(NULL,"CLC","MetaDoubleClick",0) ? BST_CHECKED : BST_UNCHECKED); /// by FYR
+ CheckDlgButton(hwndDlg, IDC_METASUBEXTRA, db_get_b(NULL,"CLC","MetaHideExtra",0) ? BST_CHECKED : BST_UNCHECKED); /// by FYR
+ CheckDlgButton(hwndDlg, IDC_METASUBEXTRA_IGN, db_get_b(NULL,"CLC","MetaIgnoreEmptyExtra",1) ? BST_CHECKED : BST_UNCHECKED); /// by FYR
+ CheckDlgButton(hwndDlg, IDC_METASUB_HIDEOFFLINE, db_get_b(NULL,"CLC","MetaHideOfflineSub",1) ? BST_CHECKED : BST_UNCHECKED); /// by FYR
return TRUE;
case WM_COMMAND:
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
@@ -225,12 +225,12 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam
SendDlgItemMessage(hwndDlg,IDC_SMOOTHTIMESPIN,UDM_SETACCEL,SIZEOF(accel), (LPARAM)&accel );
SendDlgItemMessage(hwndDlg,IDC_SMOOTHTIMESPIN,UDM_SETPOS,0,MAKELONG(DBGetContactSettingWord(NULL,"CLC","ScrollTime",CLCDEFAULT_SCROLLTIME),0));
}
- CheckDlgButton(hwndDlg,IDC_IDLE,DBGetContactSettingByte(NULL,"CLC","ShowIdle",CLCDEFAULT_SHOWIDLE)?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg,IDC_IDLE,db_get_b(NULL,"CLC","ShowIdle",CLCDEFAULT_SHOWIDLE)?BST_CHECKED:BST_UNCHECKED);
SendDlgItemMessage(hwndDlg,IDC_LEFTMARGINSPIN,UDM_SETRANGE,0,MAKELONG(64,0));
- SendDlgItemMessage(hwndDlg,IDC_LEFTMARGINSPIN,UDM_SETPOS,0,MAKELONG(DBGetContactSettingByte(NULL,"CLC","LeftMargin",CLCDEFAULT_LEFTMARGIN),0));
+ SendDlgItemMessage(hwndDlg,IDC_LEFTMARGINSPIN,UDM_SETPOS,0,MAKELONG( db_get_b(NULL,"CLC","LeftMargin",CLCDEFAULT_LEFTMARGIN),0));
SendDlgItemMessage(hwndDlg,IDC_GROUPINDENTSPIN,UDM_SETRANGE,0,MAKELONG(50,0));
- SendDlgItemMessage(hwndDlg,IDC_GROUPINDENTSPIN,UDM_SETPOS,0,MAKELONG(DBGetContactSettingByte(NULL,"CLC","GroupIndent",CLCDEFAULT_GROUPINDENT),0));
+ SendDlgItemMessage(hwndDlg,IDC_GROUPINDENTSPIN,UDM_SETPOS,0,MAKELONG( db_get_b(NULL,"CLC","GroupIndent",CLCDEFAULT_GROUPINDENT),0));
CheckDlgButton(hwndDlg,IDC_GREYOUT,DBGetContactSettingDword(NULL,"CLC","GreyoutFlags",CLCDEFAULT_GREYOUTFLAGS)?BST_CHECKED:BST_UNCHECKED);
@@ -238,7 +238,7 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam
EnableWindow(GetDlgItem(hwndDlg,IDC_GREYOUTOPTS),IsDlgButtonChecked(hwndDlg,IDC_GREYOUT));
FillCheckBoxTree(GetDlgItem(hwndDlg,IDC_GREYOUTOPTS),greyoutValues,SIZEOF(greyoutValues),DBGetContactSettingDword(NULL,"CLC","FullGreyoutFlags",CLCDEFAULT_FULLGREYOUTFLAGS));
FillCheckBoxTree(GetDlgItem(hwndDlg,IDC_HIDEOFFLINEOPTS),offlineValues,SIZEOF(offlineValues),DBGetContactSettingDword(NULL,"CLC","OfflineModes",CLCDEFAULT_OFFLINEMODES));
- CheckDlgButton(hwndDlg,IDC_NOSCROLLBAR,DBGetContactSettingByte(NULL,"CLC","NoVScrollBar",0)?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg,IDC_NOSCROLLBAR,db_get_b(NULL,"CLC","NoVScrollBar",0)?BST_CHECKED:BST_UNCHECKED);
return TRUE;
case WM_VSCROLL:
@@ -317,7 +317,7 @@ static INT_PTR CALLBACK DlgProcStatusBarBkgOpts(HWND hwndDlg, UINT msg, WPARAM w
switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg,IDC_BITMAP,DBGetContactSettingByte(NULL,"StatusBar","UseBitmap",CLCDEFAULT_USEBITMAP)?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg,IDC_BITMAP,db_get_b(NULL,"StatusBar","UseBitmap",CLCDEFAULT_USEBITMAP)?BST_CHECKED:BST_UNCHECKED);
SendMessage(hwndDlg,WM_USER+10,0,0);
SendDlgItemMessage(hwndDlg,IDC_BKGCOLOUR,CPM_SETDEFAULTCOLOUR,0,CLCDEFAULT_BKCOLOUR);
SendDlgItemMessage(hwndDlg,IDC_BKGCOLOUR,CPM_SETCOLOUR,0,DBGetContactSettingDword(NULL,"StatusBar","BkColour",CLCDEFAULT_BKCOLOUR));
@@ -443,7 +443,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg,IDC_BITMAP,DBGetContactSettingByte(NULL,"CLC","UseBitmap",CLCDEFAULT_USEBITMAP)?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg,IDC_BITMAP,db_get_b(NULL,"CLC","UseBitmap",CLCDEFAULT_USEBITMAP)?BST_CHECKED:BST_UNCHECKED);
SendMessage(hwndDlg,WM_USER+10,0,0);
SendDlgItemMessage(hwndDlg,IDC_BKGCOLOUR,CPM_SETDEFAULTCOLOUR,0,CLCDEFAULT_BKCOLOUR);
SendDlgItemMessage(hwndDlg,IDC_BKGCOLOUR,CPM_SETCOLOUR,0,DBGetContactSettingDword(NULL,"CLC","BkColour",CLCDEFAULT_BKCOLOUR));
diff --git a/plugins/Clist_mw/src/clcpaint.cpp b/plugins/Clist_mw/src/clcpaint.cpp
index ea339a5975..ae5e78ec02 100644
--- a/plugins/Clist_mw/src/clcpaint.cpp
+++ b/plugins/Clist_mw/src/clcpaint.cpp
@@ -534,7 +534,7 @@ void InternalPaintClc(HWND hwnd,struct ClcData *dat,HDC hdc,RECT *rcPaint)
}
}
- if (!Drawing->isSubcontact || (DBGetContactSettingByte(NULL,"CLC","MetaHideExtra",0) == 0)) {
+ if (!Drawing->isSubcontact || ( db_get_b(NULL,"CLC","MetaHideExtra",0) == 0)) {
//extra icons
if ( !(style & CLS_EX_MULTICOLUMNALIGNLEFT)) {
diff --git a/plugins/Clist_mw/src/clcutils.cpp b/plugins/Clist_mw/src/clcutils.cpp
index c7d467e889..21188e3ddf 100644
--- a/plugins/Clist_mw/src/clcutils.cpp
+++ b/plugins/Clist_mw/src/clcutils.cpp
@@ -279,7 +279,7 @@ void LoadClcOptions(HWND hwnd,struct ClcData *dat)
int i;
dat->style = GetWindowLongPtr(hwnd,GWL_STYLE);
- dat->MetaIgnoreEmptyExtra = DBGetContactSettingByte(NULL,"CLC","MetaIgnoreEmptyExtra",1);
+ dat->MetaIgnoreEmptyExtra = db_get_b(NULL,"CLC","MetaIgnoreEmptyExtra",1);
saveLoadClcOptions( hwnd, dat );
for (i = 0; i <= FONTID_MAX; i++)
diff --git a/plugins/Clist_mw/src/clistmod.cpp b/plugins/Clist_mw/src/clistmod.cpp
index 35653a6553..c03e073457 100644
--- a/plugins/Clist_mw/src/clistmod.cpp
+++ b/plugins/Clist_mw/src/clistmod.cpp
@@ -48,7 +48,7 @@ int cli_IconFromStatusMode(const char *szProto,int nStatus, HANDLE hContact)
char AdvancedService[255] = {0};
int nActStatus = nStatus;
HANDLE hActContact = hContact;
- if (!DBGetContactSettingByte(NULL,"CLC","Meta",0) && !strcmp(szActProto,"MetaContacts")) {
+ if (!db_get_b(NULL,"CLC","Meta",0) && !strcmp(szActProto,"MetaContacts")) {
// substitute params by mostonline contact datas
HANDLE hMostOnlineContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT,(WPARAM)hActContact,0);
if (hMostOnlineContact && hMostOnlineContact != (HANDLE)CALLSERVICE_NOTFOUND) {
@@ -78,7 +78,7 @@ int cli_IconFromStatusMode(const char *szProto,int nStatus, HANDLE hContact)
////////// By FYR/////////////
int ExtIconFromStatusMode(HANDLE hContact, const char *szProto,int status)
{
-/* if ( DBGetContactSettingByte( NULL, "CLC", "Meta", 0 ) == 1 )
+/* if ( db_get_b( NULL, "CLC", "Meta", 0 ) == 1 )
return pcli->pfnIconFromStatusMode(szProto,status,hContact);
if ( szProto != NULL ) {
@@ -108,7 +108,7 @@ static int ProtocolAck(WPARAM wParam,LPARAM lParam)
}
DBFreeVariant(&dbv);
}
- if ( DBGetContactSettingByte(NULL,"CList","ShowStatusMsg",0) || DBGetContactSettingByte(ack->hContact,"CList","StatusMsgAuto",0))
+ if ( db_get_b(NULL,"CList","ShowStatusMsg",0) || db_get_b(ack->hContact,"CList","StatusMsgAuto",0))
DBWriteContactSettingTString(ack->hContact, "CList", "StatusMsg", (TCHAR *)ack->lParam);
}
diff --git a/plugins/Clist_mw/src/clistopts.cpp b/plugins/Clist_mw/src/clistopts.cpp
index 91c8cc155c..0ce16ec41b 100644
--- a/plugins/Clist_mw/src/clistopts.cpp
+++ b/plugins/Clist_mw/src/clistopts.cpp
@@ -73,26 +73,26 @@ static INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
TranslateDialogDefault(hwndDlg);
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)HookEventMessage(ME_DB_CONTACT_SETTINGCHANGED,hwndDlg,WM_USER+1));
- CheckDlgButton(hwndDlg,IDC_GAMMACORRECT,DBGetContactSettingByte(NULL,"CLC","GammaCorrect",CLCDEFAULT_GAMMACORRECT)?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg,IDC_GAMMACORRECT,db_get_b(NULL,"CLC","GammaCorrect",CLCDEFAULT_GAMMACORRECT)?BST_CHECKED:BST_UNCHECKED);
SendDlgItemMessage(hwndDlg,IDC_ROWHEIGHTSPIN,UDM_SETBUDDY,(WPARAM)GetDlgItem(hwndDlg,IDC_ROWHEIGHT),0);
SendDlgItemMessage(hwndDlg,IDC_ROWHEIGHTSPIN,UDM_SETRANGE,0,MAKELONG(255,0));
- SendDlgItemMessage(hwndDlg,IDC_ROWHEIGHTSPIN,UDM_SETPOS,0,MAKELONG(DBGetContactSettingByte(NULL,"CLC","RowHeight",CLCDEFAULT_ROWHEIGHT),0));
+ SendDlgItemMessage(hwndDlg,IDC_ROWHEIGHTSPIN,UDM_SETPOS,0,MAKELONG( db_get_b(NULL,"CLC","RowHeight",CLCDEFAULT_ROWHEIGHT),0));
- CheckDlgButton(hwndDlg, IDC_ONTOP, DBGetContactSettingByte(NULL,"CList","OnTop",SETTING_ONTOP_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_HIDEOFFLINE, DBGetContactSettingByte(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_HIDEEMPTYGROUPS, DBGetContactSettingByte(NULL,"CList","HideEmptyGroups",SETTING_HIDEEMPTYGROUPS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_DISABLEGROUPS, DBGetContactSettingByte(NULL,"CList","UseGroups",SETTING_USEGROUPS_DEFAULT) ? BST_UNCHECKED : BST_CHECKED);
+ CheckDlgButton(hwndDlg, IDC_ONTOP, db_get_b(NULL,"CList","OnTop",SETTING_ONTOP_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_HIDEOFFLINE, db_get_b(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_HIDEEMPTYGROUPS, db_get_b(NULL,"CList","HideEmptyGroups",SETTING_HIDEEMPTYGROUPS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_DISABLEGROUPS, db_get_b(NULL,"CList","UseGroups",SETTING_USEGROUPS_DEFAULT) ? BST_UNCHECKED : BST_CHECKED);
CheckDlgButton(hwndDlg, IDC_SORTBYNAME,
- !DBGetContactSettingByte(NULL,"CList","SortByStatus",SETTING_SORTBYSTATUS_DEFAULT) &&
- !DBGetContactSettingByte(NULL,"CList","SortByProto",SETTING_SORTBYPROTO_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ !db_get_b(NULL,"CList","SortByStatus",SETTING_SORTBYSTATUS_DEFAULT) &&
+ !db_get_b(NULL,"CList","SortByProto",SETTING_SORTBYPROTO_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SORTBYSTATUS, DBGetContactSettingByte(NULL,"CList","SortByStatus",SETTING_SORTBYSTATUS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOOFFLINEMOVE, DBGetContactSettingByte(NULL,"CList","NoOfflineBottom",SETTING_NOOFFLINEBOTTOM_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SORTBYSTATUS, db_get_b(NULL,"CList","SortByStatus",SETTING_SORTBYSTATUS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOOFFLINEMOVE, db_get_b(NULL,"CList","NoOfflineBottom",SETTING_NOOFFLINEBOTTOM_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SORTBYPROTO, DBGetContactSettingByte(NULL,"CList","SortByProto",SETTING_SORTBYPROTO_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CONFIRMDELETE, DBGetContactSettingByte(NULL,"CList","ConfirmDelete",SETTING_CONFIRMDELETE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_AUTOHIDE, DBGetContactSettingByte(NULL,"CList","AutoHide",SETTING_AUTOHIDE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SORTBYPROTO, db_get_b(NULL,"CList","SortByProto",SETTING_SORTBYPROTO_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CONFIRMDELETE, db_get_b(NULL,"CList","ConfirmDelete",SETTING_CONFIRMDELETE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_AUTOHIDE, db_get_b(NULL,"CList","AutoHide",SETTING_AUTOHIDE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
EnableWindow(GetDlgItem(hwndDlg,IDC_HIDETIME),IsDlgButtonChecked(hwndDlg,IDC_AUTOHIDE));
EnableWindow(GetDlgItem(hwndDlg,IDC_HIDETIMESPIN),IsDlgButtonChecked(hwndDlg,IDC_AUTOHIDE));
{
@@ -109,14 +109,14 @@ static INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
}
SendDlgItemMessage(hwndDlg,IDC_HIDETIMESPIN,UDM_SETRANGE,0,MAKELONG(900,1));
SendDlgItemMessage(hwndDlg,IDC_HIDETIMESPIN,UDM_SETPOS,0,MAKELONG(DBGetContactSettingWord(NULL,"CList","HideTime",SETTING_HIDETIME_DEFAULT),0));
- CheckDlgButton(hwndDlg, IDC_ONECLK, DBGetContactSettingByte(NULL,"CList","Tray1Click",SETTING_TRAY1CLICK_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_ALWAYSSTATUS, DBGetContactSettingByte(NULL,"CList","AlwaysStatus",SETTING_ALWAYSSTATUS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_ALWAYSMULTI, !DBGetContactSettingByte(NULL,"CList","AlwaysMulti",SETTING_ALWAYSMULTI_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_DONTCYCLE, DBGetContactSettingByte(NULL,"CList","TrayIcon",SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_SINGLE ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CYCLE, DBGetContactSettingByte(NULL,"CList","TrayIcon",SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_CYCLE ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_MULTITRAY, DBGetContactSettingByte(NULL,"CList","TrayIcon",SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_MULTI ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_DISABLEBLINK, DBGetContactSettingByte(NULL,"CList","DisableTrayFlash",0) == 1 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_ICONBLINK, DBGetContactSettingByte(NULL,"CList","NoIconBlink",0) == 1 ? BST_CHECKED : BST_UNCHECKED );
+ CheckDlgButton(hwndDlg, IDC_ONECLK, db_get_b(NULL,"CList","Tray1Click",SETTING_TRAY1CLICK_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ALWAYSSTATUS, db_get_b(NULL,"CList","AlwaysStatus",SETTING_ALWAYSSTATUS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ALWAYSMULTI, !db_get_b(NULL,"CList","AlwaysMulti",SETTING_ALWAYSMULTI_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_DONTCYCLE, db_get_b(NULL,"CList","TrayIcon",SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_SINGLE ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CYCLE, db_get_b(NULL,"CList","TrayIcon",SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_CYCLE ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_MULTITRAY, db_get_b(NULL,"CList","TrayIcon",SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_MULTI ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_DISABLEBLINK, db_get_b(NULL,"CList","DisableTrayFlash",0) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ICONBLINK, db_get_b(NULL,"CList","NoIconBlink",0) == 1 ? BST_CHECKED : BST_UNCHECKED );
if (IsDlgButtonChecked(hwndDlg,IDC_DONTCYCLE)) {
EnableWindow(GetDlgItem(hwndDlg,IDC_CYCLETIMESPIN),FALSE);
diff --git a/plugins/Clist_mw/src/clistsettings.cpp b/plugins/Clist_mw/src/clistsettings.cpp
index fc843229ee..90154389a1 100644
--- a/plugins/Clist_mw/src/clistsettings.cpp
+++ b/plugins/Clist_mw/src/clistsettings.cpp
@@ -129,10 +129,10 @@ void CheckPDNCE(ClcCacheEntry *_pdnce)
}
if (pdnce->bIsHidden == -1)
- pdnce->bIsHidden = DBGetContactSettingByte(pdnce->hContact,"CList","bIsHidden",0);
+ pdnce->bIsHidden = db_get_b(pdnce->hContact,"CList","bIsHidden",0);
if (pdnce->noHiddenOffline == -1)
- pdnce->noHiddenOffline = DBGetContactSettingByte(pdnce->hContact,"CList","noOffline",0);
+ pdnce->noHiddenOffline = db_get_b(pdnce->hContact,"CList","noOffline",0);
if ( pdnce->IdleTS == -1 )
pdnce->IdleTS = DBGetContactSettingDword(pdnce->hContact,pdnce->szProto,"IdleTS",0);
@@ -141,10 +141,10 @@ void CheckPDNCE(ClcCacheEntry *_pdnce)
pdnce->ApparentMode = DBGetContactSettingWord(pdnce->hContact,pdnce->szProto,"ApparentMode",0);
if (pdnce->NotOnList == -1)
- pdnce->NotOnList = DBGetContactSettingByte(pdnce->hContact,"CList","NotOnList",0);
+ pdnce->NotOnList = db_get_b(pdnce->hContact,"CList","NotOnList",0);
if (pdnce->IsExpanded == -1)
- pdnce->IsExpanded = DBGetContactSettingByte(pdnce->hContact,"CList","Expanded",0);
+ pdnce->IsExpanded = db_get_b(pdnce->hContact,"CList","Expanded",0);
}
void InvalidateDisplayNameCacheEntryByPDNE(HANDLE hContact,pClcCacheEntry pdnce,int SettingType)
@@ -299,10 +299,10 @@ int ContactSettingChanged(WPARAM wParam,LPARAM lParam)
if (cws->value.type == DBVT_WORD&&!strcmp(cws->szSetting, "Status")) {
if (!(pdnce->bIsHidden == 1)) {
- if (DBGetContactSettingByte((HANDLE)NULL,"CList","ShowStatusMsg",0)||DBGetContactSettingByte((HANDLE)wParam,"CList","StatusMsgAuto",0))
+ if ( db_get_b((HANDLE)NULL,"CList","ShowStatusMsg",0)||db_get_b((HANDLE)wParam,"CList","StatusMsgAuto",0))
DBWriteContactSettingString((HANDLE)wParam, "CList", "StatusMsg", "");
- if (DBGetContactSettingByte(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT)) {
+ if ( db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT)) {
// User's state is changing, and we are hideOffline-ing
if (cws->value.wVal == ID_STATUS_OFFLINE) {
diff --git a/plugins/Clist_mw/src/clui.cpp b/plugins/Clist_mw/src/clui.cpp
index 8e53dedda5..08fb0b97db 100644
--- a/plugins/Clist_mw/src/clui.cpp
+++ b/plugins/Clist_mw/src/clui.cpp
@@ -219,7 +219,7 @@ HICON LoadIconFromExternalFile(char *filename,int i,boolean UseLibrary,boolean r
void RegisterProtoIcons (char *protoname)
{
- if ( DBGetContactSettingByte(NULL,"CList","UseProtoIconFromIcoLib",1))
+ if ( db_get_b(NULL,"CList","UseProtoIconFromIcoLib",1))
{
int i;
char buf[256];
@@ -282,7 +282,7 @@ HICON GetConnectingIconForProto_DLL(char *szProto,int b)
HICON GetConnectingIconForProto(char *szProto,int b)
{
- if ( DBGetContactSettingByte(NULL,"CList","UseProtoIconFromIcoLib",1)) {
+ if ( db_get_b(NULL,"CList","UseProtoIconFromIcoLib",1)) {
HICON hIcon = 0;
char buf[256];
sprintf(buf,"%s #%d",szProto,b);
@@ -324,7 +324,7 @@ int CreateTimerForConnectingIcon(WPARAM wParam,LPARAM lParam)
if (!szProto) return 0;
if (!status) return 0;
- if (( DBGetContactSettingByte(NULL,"CLUI","UseConnectingIcon",1) == 1) && status >= ID_STATUS_CONNECTING && status <= ID_STATUS_CONNECTING + MAX_CONNECT_RETRIES) {
+ if (( db_get_b(NULL,"CLUI","UseConnectingIcon",1) == 1) && status >= ID_STATUS_CONNECTING && status <= ID_STATUS_CONNECTING + MAX_CONNECT_RETRIES) {
ProtoTicks *pt = NULL;
int cnt;
@@ -333,7 +333,7 @@ int CreateTimerForConnectingIcon(WPARAM wParam,LPARAM lParam)
if (pt->CycleStartTick == 0) {
KillTimer(pcli->hwndContactList,TM_STATUSBARUPDATE+pt->n);
cnt = GetConnectingIconForProtoCount(szProto);
- if ( DBGetContactSettingByte(NULL,"Clist","UseProtoIconFromIcoLib",1))
+ if ( db_get_b(NULL,"Clist","UseProtoIconFromIcoLib",1))
cnt = 8;
if (cnt != 0) {
@@ -370,13 +370,13 @@ HWND PreCreateCLC(HWND parent)
{
pcli->hwndContactTree = CreateWindow(CLISTCONTROL_CLASS,_T(""),
WS_CHILD|WS_CLIPCHILDREN|CLS_CONTACTLIST
- |(DBGetContactSettingByte(NULL,"CList","UseGroups",SETTING_USEGROUPS_DEFAULT)?CLS_USEGROUPS:0)
+ |( db_get_b(NULL,"CList","UseGroups",SETTING_USEGROUPS_DEFAULT)?CLS_USEGROUPS:0)
|CLS_HIDEOFFLINE
- //|(DBGetContactSettingByte(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT)?CLS_HIDEOFFLINE:0)
- |(DBGetContactSettingByte(NULL,"CList","HideEmptyGroups",SETTING_HIDEEMPTYGROUPS_DEFAULT)?CLS_HIDEEMPTYGROUPS:0)
- |(DBGetContactSettingByte(NULL,"CList","ShowStatusMessages",1)?CLS_SHOWSTATUSMESSAGES:0)
+ //|( db_get_b(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT)?CLS_HIDEOFFLINE:0)
+ |( db_get_b(NULL,"CList","HideEmptyGroups",SETTING_HIDEEMPTYGROUPS_DEFAULT)?CLS_HIDEEMPTYGROUPS:0)
+ |( db_get_b(NULL,"CList","ShowStatusMessages",1)?CLS_SHOWSTATUSMESSAGES:0)
|CLS_MULTICOLUMN
- //|DBGetContactSettingByte(NULL,"CLUI","ExtraIconsAlignToLeft",1)?CLS_EX_MULTICOLUMNALIGNLEFT:0
+ //|db_get_b(NULL,"CLUI","ExtraIconsAlignToLeft",1)?CLS_EX_MULTICOLUMNALIGNLEFT:0
,0,0,0,0,parent,NULL,g_hInst,NULL);
return pcli->hwndContactTree;
@@ -405,7 +405,7 @@ int CreateCLC(HWND parent)
lastreqh = 0;
CallService(MS_CLIST_SETHIDEOFFLINE,(WPARAM)oldhideoffline,0);
- int state = DBGetContactSettingByte(NULL,"CList","State",SETTING_STATE_NORMAL);
+ int state = db_get_b(NULL,"CList","State",SETTING_STATE_NORMAL);
if (state == SETTING_STATE_NORMAL) ShowWindow(pcli->hwndContactList, SW_SHOW);
else if (state == SETTING_STATE_MINIMIZED) ShowWindow(pcli->hwndContactList, SW_SHOWMINIMIZED);
@@ -482,18 +482,18 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
case WM_CREATE:
TranslateMenu(GetMenu(hwnd));
DrawMenuBar(hwnd);
- showOpts = DBGetContactSettingByte(NULL,"CLUI","SBarShow",1);
+ showOpts = db_get_b(NULL,"CLUI","SBarShow",1);
//create the status wnd
- //pcli->hwndStatus == CreateStatusWindow(WS_CHILD | (DBGetContactSettingByte(NULL,"CLUI","ShowSBar",1)?WS_VISIBLE:0), "", hwnd, 0);
+ //pcli->hwndStatus == CreateStatusWindow(WS_CHILD | ( db_get_b(NULL,"CLUI","ShowSBar",1)?WS_VISIBLE:0), "", hwnd, 0);
CluiProtocolStatusChanged(0,0);
hMsgGetProfile = RegisterWindowMessageA( "Miranda::GetProfile" ); // don't localise
- if ( DBGetContactSettingByte( NULL, "CList", "Transparent", 0 )) {
+ if ( db_get_b( NULL, "CList", "Transparent", 0 )) {
SetWindowLongPtr(hwnd, GWL_EXSTYLE, GetWindowLongPtr(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED);
if ( MySetLayeredWindowAttributes )
- MySetLayeredWindowAttributes(hwnd, RGB(0,0,0), (BYTE)DBGetContactSettingByte(NULL,"CList","Alpha",SETTING_ALPHA_DEFAULT), LWA_ALPHA);
+ MySetLayeredWindowAttributes(hwnd, RGB(0,0,0), (BYTE)db_get_b(NULL,"CList","Alpha",SETTING_ALPHA_DEFAULT), LWA_ALPHA);
}
transparentFocus = 1;
return FALSE;
@@ -522,7 +522,7 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
DBWriteContactSettingDword(NULL,"CList","Width",(DWORD)(rc.right - rc.left));
}
if ( wParam == SIZE_MINIMIZED ) {
- if ( DBGetContactSettingByte(NULL,"CList","Min2Tray",SETTING_MIN2TRAY_DEFAULT )) {
+ if ( db_get_b(NULL,"CList","Min2Tray",SETTING_MIN2TRAY_DEFAULT )) {
ShowWindow(hwnd, SW_HIDE);
DBWriteContactSettingByte(NULL,"CList","State",SETTING_STATE_HIDDEN);
}
@@ -607,9 +607,9 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
int maxHeight,newHeight;
int winstyle;
- if ( !disableautoupd && DBGetContactSettingByte( NULL, "CLUI", "AutoSize", 0 )) {
+ if ( !disableautoupd && db_get_b( NULL, "CLUI", "AutoSize", 0 )) {
if ( !CallService(MS_CLIST_DOCKINGISDOCKED,0,0) && hFrameContactTree != 0 ) {
- maxHeight = DBGetContactSettingByte(NULL,"CLUI","MaxSizeHeight",75);
+ maxHeight = db_get_b(NULL,"CLUI","MaxSizeHeight",75);
GetWindowRect(hwnd,&rcWindow);
GetWindowRect(pcli->hwndContactTree,&rcTree);
winstyle = GetWindowLongPtr(pcli->hwndContactTree,GWL_STYLE);
@@ -620,7 +620,7 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
if (newHeight != rcWindow.bottom - rcWindow.top ) {
if (newHeight>(rcWorkArea.bottom-rcWorkArea.top)*maxHeight/100)
newHeight = (rcWorkArea.bottom-rcWorkArea.top)*maxHeight/100;
- if (DBGetContactSettingByte(NULL,"CLUI","AutoSizeUpward",0)) {
+ if ( db_get_b(NULL,"CLUI","AutoSizeUpward",0)) {
rcWindow.top = rcWindow.bottom-newHeight;
if (rcWindow.top<rcWorkArea.top) rcWindow.top = rcWorkArea.top;
}
@@ -637,29 +637,6 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
} } } }
return TRUE;
}
- case NM_CLICK:
- {
- NMCLISTCONTROL *nm = (NMCLISTCONTROL*)lParam;
- DWORD hitFlags;
- HANDLE hItem = (HANDLE)SendMessage(pcli->hwndContactTree,CLM_HITTEST,(WPARAM)&hitFlags,MAKELPARAM(nm->pt.x,nm->pt.y));
-
- if (hitFlags & CLCHT_ONITEMEXTRA)
- if (!IsHContactGroup(hItem) && !IsHContactInfo(hItem)) {
- pClcCacheEntry pdnce = (pClcCacheEntry)pcli->pfnGetCacheEntry(nm->hItem);
-// if (pdnce)
-// NotifyEventHooks(hExtraImageClick, (WPARAM)nm->hItem, nm->iColumn+1);
- }
-
- if (hItem) break;
- if ((hitFlags&(CLCHT_NOWHERE|CLCHT_INLEFTMARGIN|CLCHT_BELOWITEMS)) == 0) break;
- if (DBGetContactSettingByte(NULL,"CLUI","ClientAreaDrag",SETTING_CLIENTDRAG_DEFAULT)) {
- POINT pt;
- pt = nm->pt;
- ClientToScreen(pcli->hwndContactTree,&pt);
- return SendMessage(hwnd, WM_SYSCOMMAND, SC_MOVE|HTCAPTION,MAKELPARAM(pt.x,pt.y));
- }
- return TRUE;
- }
}
}
else if (((LPNMHDR)lParam)->hwndFrom == pcli->hwndStatus) {
@@ -674,7 +651,7 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
int menuid;
int startoffset = DBGetContactSettingDword(NULL,"StatusBar","FirstIconOffset",0);
int extraspace = DBGetContactSettingDword(NULL,"StatusBar","BkExtraSpace",0);
- boolean UseOwnerDrawStatusBar = DBGetContactSettingByte(NULL,"CLUI","UseOwnerDrawStatusBar",0);
+ boolean UseOwnerDrawStatusBar = db_get_b(NULL,"CLUI","UseOwnerDrawStatusBar",0);
hMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS,0,0);
nParts = SendMessage(pcli->hwndStatus,SB_GETPARTS,0,0);
@@ -685,20 +662,16 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
if (nm->pt.x < rc.left) return FALSE;
}
else {
- if (!((startoffset) != 0&&UseOwnerDrawStatusBar))
- {
+ if ( !((startoffset) != 0 && UseOwnerDrawStatusBar)) {
nPanel = nm->dwItemSpec;
SendMessage(pcli->hwndStatus,SB_GETRECT,nPanel,(LPARAM)&rc);
}
else {
- RECT clrc;
- int sectwidth;
-
- memset(&rc,0,sizeof(RECT));
+ RECT clrc = { 0 };
GetClientRect(pcli->hwndStatus,&clrc);
clrc.right -= clrc.left;
clrc.right -= startoffset;
- sectwidth = clrc.right/nParts;
+ int sectwidth = clrc.right/nParts;
for (nPanel = 0;nPanel<nParts;nPanel++) {
PD = (ProtocolData *)SendMessage(pcli->hwndStatus,SB_GETTEXT,(WPARAM)nPanel,0);
@@ -722,10 +695,9 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
if (menuid<0){break;}
hMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS,0,0);
{
- int i;
unsigned int cpnl = 0;
int mcnt = GetMenuItemCount(hMenu);
- for (i = 0; i<mcnt; ++i) {
+ for (int i = 0; i<mcnt; ++i) {
HMENU hMenus = GetSubMenu(hMenu, i);
if (hMenus && cpnl++ == menuid) {
hMenu = hMenus;
@@ -733,37 +705,31 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
}
}
}
- {
- char buf[256];
- sprintf(buf,"nPanel: %d, PD->protopos: %d,PD->RealName %s\r\n",nPanel,PD->protopos,PD->RealName);
- OutputDebugStringA(buf);
- }
if (hMenu != NULL) {
GetCursorPos(&pt);
TrackPopupMenu(hMenu,TPM_BOTTOMALIGN|TPM_LEFTALIGN,pt.x,pt.y,0,hwnd,NULL);
- } }
+ }
+ }
return TRUE;
}
break;
case WM_DESTROY:
- {
- //saving state
- int state = DBGetContactSettingByte(NULL,"CList","State",SETTING_STATE_NORMAL);
+ //saving state
+ int state = db_get_b(NULL,"CList","State",SETTING_STATE_NORMAL);
- FreeProtocolData();
- if ( state == SETTING_STATE_NORMAL )
- ShowWindow(hwnd,SW_HIDE);
+ FreeProtocolData();
+ if (state == SETTING_STATE_NORMAL)
+ ShowWindow(hwnd,SW_HIDE);
- CallService(MS_CLIST_FRAMES_REMOVEFRAME,(WPARAM)hFrameContactTree,0);
- DestroyWindow(pcli->hwndContactTree);
- pcli->hwndContactList = NULL;
+ CallService(MS_CLIST_FRAMES_REMOVEFRAME,(WPARAM)hFrameContactTree,0);
+ DestroyWindow(pcli->hwndContactTree);
+ pcli->hwndContactList = NULL;
- UnLoadCLUIFramesModule();
- DBWriteContactSettingByte(NULL,"CList","State",(BYTE)state);
- PostQuitMessage(0);
- }
+ UnLoadCLUIFramesModule();
+ DBWriteContactSettingByte(NULL, "CList", "State", (BYTE)state);
+ PostQuitMessage(0);
break;
}
@@ -774,7 +740,6 @@ int LoadCLUIModule(void)
{
DBVARIANT dbv;
TCHAR titleText[256];
- int laster;
canloadstatusbar = FALSE;
hFrameContactTree = 0;
@@ -799,19 +764,18 @@ int LoadCLUIModule(void)
DBFreeVariant(&dbv);
}
- oldhideoffline = DBGetContactSettingByte(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT);
+ oldhideoffline = db_get_b(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT);
- laster = GetLastError();
+ int laster = GetLastError();
PreCreateCLC(pcli->hwndContactList);
// create status bar frame
CreateStatusBarhWnd(pcli->hwndContactList);
- { //int state = DBGetContactSettingByte(NULL,"CList","State",SETTING_STATE_NORMAL);
- hMenuMain = GetMenu(pcli->hwndContactList);
- if (!DBGetContactSettingByte(NULL,"CLUI","ShowMainMenu",SETTING_SHOWMAINMENU_DEFAULT)) SetMenu(pcli->hwndContactList,NULL);
- SetWindowPos(pcli->hwndContactList, DBGetContactSettingByte(NULL,"CList","OnTop",SETTING_ONTOP_DEFAULT) ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
- }
+ hMenuMain = GetMenu(pcli->hwndContactList);
+ if ( !db_get_b(NULL, "CLUI", "ShowMainMenu", SETTING_SHOWMAINMENU_DEFAULT))
+ SetMenu(pcli->hwndContactList, NULL);
+ SetWindowPos(pcli->hwndContactList, db_get_b(NULL,"CList","OnTop",SETTING_ONTOP_DEFAULT) ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
lastreqh = 0;
return 0;
@@ -819,9 +783,7 @@ int LoadCLUIModule(void)
void UnloadCLUIModule()
{
- int i;
-
- for ( i = 0; i < SIZEOF(CycleStartTick); i++ )
- if ( CycleStartTick[i].szProto != NULL )
+ for (int i = 0; i < SIZEOF(CycleStartTick); i++)
+ if ( CycleStartTick[i].szProto != NULL)
mir_free(CycleStartTick[i].szProto);
} \ No newline at end of file
diff --git a/plugins/Clist_mw/src/cluiopts.cpp b/plugins/Clist_mw/src/cluiopts.cpp
index 07b12743f7..ac5faa798b 100644
--- a/plugins/Clist_mw/src/cluiopts.cpp
+++ b/plugins/Clist_mw/src/cluiopts.cpp
@@ -57,27 +57,27 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg, IDC_BRINGTOFRONT, DBGetContactSettingByte(NULL,"CList","BringToFront",SETTING_BRINGTOFRONT_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_ONTOP, DBGetContactSettingByte(NULL,"CList","OnTop",SETTING_ONTOP_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_TOOLWND, DBGetContactSettingByte(NULL,"CList","ToolWindow",SETTING_TOOLWINDOW_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_MIN2TRAY, DBGetContactSettingByte(NULL,"CList","Min2Tray",SETTING_MIN2TRAY_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_BRINGTOFRONT, db_get_b(NULL,"CList","BringToFront",SETTING_BRINGTOFRONT_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ONTOP, db_get_b(NULL,"CList","OnTop",SETTING_ONTOP_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_TOOLWND, db_get_b(NULL,"CList","ToolWindow",SETTING_TOOLWINDOW_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_MIN2TRAY, db_get_b(NULL,"CList","Min2Tray",SETTING_MIN2TRAY_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
if (IsDlgButtonChecked(hwndDlg,IDC_TOOLWND)) EnableWindow(GetDlgItem(hwndDlg,IDC_MIN2TRAY),FALSE);
- CheckDlgButton(hwndDlg, IDC_SHOWCAPTION, DBGetContactSettingByte(NULL,"CLUI","ShowCaption",SETTING_SHOWCAPTION_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SHOWMAINMENU, DBGetContactSettingByte(NULL,"CLUI","ShowMainMenu",SETTING_SHOWMAINMENU_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CLIENTDRAG, DBGetContactSettingByte(NULL,"CLUI","ClientAreaDrag",SETTING_CLIENTDRAG_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SHOWCAPTION, db_get_b(NULL,"CLUI","ShowCaption",SETTING_SHOWCAPTION_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SHOWMAINMENU, db_get_b(NULL,"CLUI","ShowMainMenu",SETTING_SHOWMAINMENU_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CLIENTDRAG, db_get_b(NULL,"CLUI","ClientAreaDrag",SETTING_CLIENTDRAG_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
if (!IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION)) {
EnableWindow(GetDlgItem(hwndDlg,IDC_MIN2TRAY),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_TOOLWND),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_TITLETEXT),FALSE);
}
- CheckDlgButton(hwndDlg, IDC_FADEINOUT, DBGetContactSettingByte(NULL,"CLUI","FadeInOut",0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_AUTOSIZE, DBGetContactSettingByte(NULL,"CLUI","AutoSize",0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_DROPSHADOW, DBGetContactSettingByte(NULL,"CList","WindowShadow",0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_ONDESKTOP, DBGetContactSettingByte(NULL,"CList","OnDesktop", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_FADEINOUT, db_get_b(NULL,"CLUI","FadeInOut",0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_AUTOSIZE, db_get_b(NULL,"CLUI","AutoSize",0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_DROPSHADOW, db_get_b(NULL,"CList","WindowShadow",0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ONDESKTOP, db_get_b(NULL,"CList","OnDesktop", 0) ? BST_CHECKED : BST_UNCHECKED);
SendDlgItemMessage(hwndDlg,IDC_MAXSIZESPIN,UDM_SETRANGE,0,MAKELONG(100,0));
- SendDlgItemMessage(hwndDlg,IDC_MAXSIZESPIN,UDM_SETPOS,0,DBGetContactSettingByte(NULL,"CLUI","MaxSizeHeight",75));
- CheckDlgButton(hwndDlg, IDC_AUTOSIZEUPWARD, DBGetContactSettingByte(NULL,"CLUI","AutoSizeUpward",0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_AUTOHIDE, DBGetContactSettingByte(NULL,"CList","AutoHide",SETTING_AUTOHIDE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ SendDlgItemMessage(hwndDlg,IDC_MAXSIZESPIN,UDM_SETPOS,0,db_get_b(NULL,"CLUI","MaxSizeHeight",75));
+ CheckDlgButton(hwndDlg, IDC_AUTOSIZEUPWARD, db_get_b(NULL,"CLUI","AutoSizeUpward",0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_AUTOHIDE, db_get_b(NULL,"CList","AutoHide",SETTING_AUTOHIDE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
SendDlgItemMessage(hwndDlg,IDC_HIDETIMESPIN,UDM_SETRANGE,0,MAKELONG(900,1));
SendDlgItemMessage(hwndDlg,IDC_HIDETIMESPIN,UDM_SETPOS,0,MAKELONG(DBGetContactSettingWord(NULL,"CList","HideTime",SETTING_HIDETIME_DEFAULT),0));
EnableWindow(GetDlgItem(hwndDlg,IDC_HIDETIME),IsDlgButtonChecked(hwndDlg,IDC_AUTOHIDE));
@@ -136,7 +136,7 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
EnableWindow(GetDlgItem(hwndDlg,IDC_TRANSPARENT),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_DROPSHADOW),FALSE);
}
- else CheckDlgButton(hwndDlg,IDC_TRANSPARENT,DBGetContactSettingByte(NULL,"CList","Transparent",SETTING_TRANSPARENT_DEFAULT)?BST_CHECKED:BST_UNCHECKED);
+ else CheckDlgButton(hwndDlg,IDC_TRANSPARENT,db_get_b(NULL,"CList","Transparent",SETTING_TRANSPARENT_DEFAULT)?BST_CHECKED:BST_UNCHECKED);
if (!IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENT)) {
EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC11),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC12),FALSE);
@@ -147,8 +147,8 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
}
SendDlgItemMessage(hwndDlg,IDC_TRANSACTIVE,TBM_SETRANGE,FALSE,MAKELONG(1,255));
SendDlgItemMessage(hwndDlg,IDC_TRANSINACTIVE,TBM_SETRANGE,FALSE,MAKELONG(1,255));
- SendDlgItemMessage(hwndDlg,IDC_TRANSACTIVE,TBM_SETPOS,TRUE,DBGetContactSettingByte(NULL,"CList","Alpha",SETTING_ALPHA_DEFAULT));
- SendDlgItemMessage(hwndDlg,IDC_TRANSINACTIVE,TBM_SETPOS,TRUE,DBGetContactSettingByte(NULL,"CList","AutoAlpha",SETTING_AUTOALPHA_DEFAULT));
+ SendDlgItemMessage(hwndDlg,IDC_TRANSACTIVE,TBM_SETPOS,TRUE,db_get_b(NULL,"CList","Alpha",SETTING_ALPHA_DEFAULT));
+ SendDlgItemMessage(hwndDlg,IDC_TRANSINACTIVE,TBM_SETPOS,TRUE,db_get_b(NULL,"CList","AutoAlpha",SETTING_AUTOALPHA_DEFAULT));
SendMessage(hwndDlg,WM_HSCROLL,0x12345678,0);
return TRUE;
@@ -266,7 +266,7 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
DBWriteContactSettingByte(NULL,"CList","OnDesktop",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_ONDESKTOP));
if (IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENT)) {
SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED);
- if (MySetLayeredWindowAttributes) MySetLayeredWindowAttributes(pcli->hwndContactList, RGB(0,0,0), (BYTE)DBGetContactSettingByte(NULL,"CList","AutoAlpha",SETTING_AUTOALPHA_DEFAULT), LWA_ALPHA);
+ if (MySetLayeredWindowAttributes) MySetLayeredWindowAttributes(pcli->hwndContactList, RGB(0,0,0), (BYTE)db_get_b(NULL,"CList","AutoAlpha",SETTING_AUTOALPHA_DEFAULT), LWA_ALPHA);
}
else SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) & ~WS_EX_LAYERED);
@@ -283,20 +283,20 @@ static INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg, IDC_SHOWSBAR, DBGetContactSettingByte(NULL,"CLUI","ShowSBar",1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_USECONNECTINGICON, DBGetContactSettingByte(NULL,"CLUI","UseConnectingIcon",1) ? BST_CHECKED : BST_UNCHECKED);
- { BYTE showOpts = DBGetContactSettingByte(NULL,"CLUI","SBarShow",1);
+ CheckDlgButton(hwndDlg, IDC_SHOWSBAR, db_get_b(NULL,"CLUI","ShowSBar",1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_USECONNECTINGICON, db_get_b(NULL,"CLUI","UseConnectingIcon",1) ? BST_CHECKED : BST_UNCHECKED);
+ { BYTE showOpts = db_get_b(NULL,"CLUI","SBarShow",1);
CheckDlgButton(hwndDlg, IDC_SHOWICON, showOpts&1 ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_SHOWPROTO, showOpts&2 ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_SHOWSTATUS, showOpts&4 ? BST_CHECKED : BST_UNCHECKED);
}
- CheckDlgButton(hwndDlg, IDC_RIGHTSTATUS, DBGetContactSettingByte(NULL,"CLUI","SBarRightClk",0) ? BST_UNCHECKED : BST_CHECKED);
+ CheckDlgButton(hwndDlg, IDC_RIGHTSTATUS, db_get_b(NULL,"CLUI","SBarRightClk",0) ? BST_UNCHECKED : BST_CHECKED);
CheckDlgButton(hwndDlg, IDC_RIGHTMIRANDA, !IsDlgButtonChecked(hwndDlg,IDC_RIGHTSTATUS) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_EQUALSECTIONS, DBGetContactSettingByte(NULL,"CLUI","EqualSections",0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SBPANELBEVEL, DBGetContactSettingByte(NULL,"CLUI","SBarBevel",1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SHOWSIZEGRIP, DBGetContactSettingByte(NULL,"CLUI","SBarUseSizeGrip",1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_EQUALSECTIONS, db_get_b(NULL,"CLUI","EqualSections",0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SBPANELBEVEL, db_get_b(NULL,"CLUI","SBarBevel",1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SHOWSIZEGRIP, db_get_b(NULL,"CLUI","SBarUseSizeGrip",1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_USEOWNERDRAW, DBGetContactSettingByte(NULL,"CLUI","UseOwnerDrawStatusBar",1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_USEOWNERDRAW, db_get_b(NULL,"CLUI","UseOwnerDrawStatusBar",1) ? BST_CHECKED : BST_UNCHECKED);
SendDlgItemMessage(hwndDlg,IDC_BKGCOLOUR,CPM_SETCOLOUR,0,DBGetContactSettingDword(NULL,"CLUI","SBarBKColor",CLR_DEFAULT));
@@ -352,7 +352,7 @@ static INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
DBWriteContactSettingByte(NULL,"CLUI","UseConnectingIcon",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_USECONNECTINGICON));
DBWriteContactSettingByte(NULL,"CLUI","UseOwnerDrawStatusBar",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_USEOWNERDRAW));
- UseOwnerDrawStatusBar = DBGetContactSettingByte(NULL,"CLUI","UseOwnerDrawStatusBar",0);
+ UseOwnerDrawStatusBar = db_get_b(NULL,"CLUI","UseOwnerDrawStatusBar",0);
int frameopt = CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS,MAKEWPARAM(FO_FLAGS,hFrameHelperStatusBar),0);
frameopt &= ~F_VISIBLE;
diff --git a/plugins/Clist_mw/src/cluiservices.cpp b/plugins/Clist_mw/src/cluiservices.cpp
index 38e19ee46d..dadea72c01 100644
--- a/plugins/Clist_mw/src/cluiservices.cpp
+++ b/plugins/Clist_mw/src/cluiservices.cpp
@@ -68,7 +68,7 @@ void CluiProtocolStatusChanged(int parStatus, const char* szProto)
SendMessage(pcli->hwndStatus,SB_SETBKCOLOR,0,DBGetContactSettingDword(0,"CLUI","SBarBKColor",CLR_DEFAULT));
partWidths = (int*)alloca((protoCount+1)*sizeof(int));
//partWidths[0] = FirstIconOffset;
- if (DBGetContactSettingByte(NULL,"CLUI","UseOwnerDrawStatusBar",0)||DBGetContactSettingByte(NULL,"CLUI","EqualSections",1))
+ if ( db_get_b(NULL,"CLUI","UseOwnerDrawStatusBar",0)||db_get_b(NULL,"CLUI","EqualSections",1))
{
RECT rc;
int toshow, part;
@@ -104,7 +104,7 @@ void CluiProtocolStatusChanged(int parStatus, const char* szProto)
else {
HDC hdc;
SIZE textSize;
- BYTE showOpts = DBGetContactSettingByte(NULL,"CLUI","SBarShow",5);
+ BYTE showOpts = db_get_b(NULL,"CLUI","SBarShow",5);
DWORD extraspace = DBGetContactSettingDword(NULL,"StatusBar","BkExtraSpace",0);
DWORD startoffset = DBGetContactSettingDword(NULL,"StatusBar","FirstIconOffset",0);
int x;
@@ -153,7 +153,7 @@ void CluiProtocolStatusChanged(int parStatus, const char* szProto)
SendMessage(pcli->hwndStatus,SB_SETPARTS,partCount,(LPARAM)partWidths);
flags = SBT_OWNERDRAW;
- if ( !DBGetContactSettingByte(NULL, "CLUI", "SBarBevel", 1))
+ if ( !db_get_b(NULL, "CLUI", "SBarBevel", 1))
flags |= SBT_NOBORDERS;
for (partCount = 0, i = 0; i<protoCount; i++) { //count down since built in ones tend to go at the end
diff --git a/plugins/Clist_mw/src/contact.cpp b/plugins/Clist_mw/src/contact.cpp
index 2f95d98421..6899374b7b 100644
--- a/plugins/Clist_mw/src/contact.cpp
+++ b/plugins/Clist_mw/src/contact.cpp
@@ -88,7 +88,7 @@ void LoadContactTree(void)
CallService(MS_CLUI_GROUPADDED,i,0);
}
- hideOffline = DBGetContactSettingByte(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT);
+ hideOffline = db_get_b(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT);
hContact = db_find_first();
while(hContact != NULL) {
@@ -103,9 +103,9 @@ void LoadContactTree(void)
ChangeContactIcon(hContact,ExtIconFromStatusMode(hContact,(char*)cacheEntry->szProto,status),1);
hContact = db_find_next(hContact);
}
- sortByStatus = DBGetContactSettingByte(NULL,"CList","SortByStatus",SETTING_SORTBYSTATUS_DEFAULT);
- sortByProto = DBGetContactSettingByte(NULL,"CList","SortByProto",SETTING_SORTBYPROTO_DEFAULT);
- sortNoOfflineBottom = DBGetContactSettingByte(NULL,"CList","NoOfflineBottom",SETTING_NOOFFLINEBOTTOM_DEFAULT);
+ sortByStatus = db_get_b(NULL,"CList","SortByStatus",SETTING_SORTBYSTATUS_DEFAULT);
+ sortByProto = db_get_b(NULL,"CList","SortByProto",SETTING_SORTBYPROTO_DEFAULT);
+ sortNoOfflineBottom = db_get_b(NULL,"CList","NoOfflineBottom",SETTING_NOOFFLINEBOTTOM_DEFAULT);
CallService(MS_CLUI_SORTLIST,0,0);
CallService(MS_CLUI_LISTENDREBUILD,0,0);
@@ -179,8 +179,8 @@ static VOID CALLBACK SortContactsTimer(HWND hwnd,UINT message,UINT_PTR idEvent,D
void SortContacts(void)
{
//avoid doing lots of resorts in quick succession
- sortByStatus = DBGetContactSettingByte(NULL,"CList","SortByStatus",SETTING_SORTBYSTATUS_DEFAULT);
- sortByProto = DBGetContactSettingByte(NULL,"CList","SortByProto",SETTING_SORTBYPROTO_DEFAULT);
+ sortByStatus = db_get_b(NULL,"CList","SortByStatus",SETTING_SORTBYSTATUS_DEFAULT);
+ sortByProto = db_get_b(NULL,"CList","SortByProto",SETTING_SORTBYPROTO_DEFAULT);
if (resortTimerId) KillTimer(NULL,resortTimerId);
resortTimerId = SetTimer(NULL,0,50,SortContactsTimer);
}
diff --git a/plugins/Clist_mw/src/groupmenu.cpp b/plugins/Clist_mw/src/groupmenu.cpp
index 7053207a65..9f5f5846ae 100644
--- a/plugins/Clist_mw/src/groupmenu.cpp
+++ b/plugins/Clist_mw/src/groupmenu.cpp
@@ -214,7 +214,7 @@ static int OnBuildGroupMenu(WPARAM wParam,LPARAM lParam)
ZeroMemory(&mi,sizeof(mi));
mi.cbSize = sizeof(mi);
- mi.flags = CMIM_FLAGS | (DBGetContactSettingByte(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT)?CMIF_CHECKED:0);
+ 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));