diff options
-rw-r--r-- | plugins/Scriver/chat/clist.cpp | 8 | ||||
-rw-r--r-- | plugins/Scriver/chat/colorchooser.cpp | 2 | ||||
-rw-r--r-- | plugins/Scriver/chat/options.cpp | 360 | ||||
-rw-r--r-- | plugins/Scriver/chat/window.cpp | 4 | ||||
-rw-r--r-- | plugins/Scriver/msgdialog.cpp | 12 | ||||
-rw-r--r-- | plugins/Scriver/msglog.cpp | 10 | ||||
-rw-r--r-- | plugins/Scriver/msgwindow.cpp | 20 | ||||
-rw-r--r-- | plugins/Scriver/statusicon.cpp | 24 | ||||
-rw-r--r-- | plugins/Scriver/utils.cpp | 2 |
9 files changed, 210 insertions, 232 deletions
diff --git a/plugins/Scriver/chat/clist.cpp b/plugins/Scriver/chat/clist.cpp index 6ccf34c252..2c32bc7169 100644 --- a/plugins/Scriver/chat/clist.cpp +++ b/plugins/Scriver/chat/clist.cpp @@ -69,7 +69,7 @@ HANDLE CList_AddRoom(const char* pszModule, const TCHAR* pszRoom, const TCHAR* p END_GROUPLOOP:
DBWriteContactSettingWord(hContact, pszModule, "Status", ID_STATUS_OFFLINE);
DBWriteContactSettingTString(hContact, pszModule, "Nick", pszDisplayName );
-/* if(iType != GCW_SERVER)
+/* if (iType != GCW_SERVER)
DBWriteContactSettingByte(hContact, "CList", "Hidden", 1);*/
return hContact;
}
@@ -87,7 +87,7 @@ END_GROUPLOOP: DBWriteContactSettingTString( hContact, pszModule, "ChatRoomID", pszRoom );
DBWriteContactSettingByte(hContact, pszModule, "ChatRoom", (BYTE)iType);
DBWriteContactSettingWord(hContact, pszModule, "Status", ID_STATUS_OFFLINE);
-// if(iType == GCW_SERVER)
+// if (iType == GCW_SERVER)
// DBWriteContactSettingByte(hContact, "CList", "Hidden", 1);
return hContact;
}
@@ -143,7 +143,7 @@ int CList_RoomDoubleclicked(WPARAM wParam,LPARAM lParam) szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
if ( MM_FindModule(szProto)) {
- if(DBGetContactSettingByte(hContact, szProto, "ChatRoom", 0) == 0)
+ if (DBGetContactSettingByte(hContact, szProto, "ChatRoom", 0) == 0)
return 0;
if ( !DBGetContactSettingTString( hContact, szProto, "ChatRoomID", &dbv )) {
@@ -298,7 +298,7 @@ BOOL CList_AddEvent(HANDLE hContact, HICON Icon, HANDLE event, int type, TCHAR* if (!CallService(MS_CLIST_GETEVENT, (WPARAM)hContact, (LPARAM)0))
CallService(MS_CLIST_ADDEVENT,(WPARAM) hContact,(LPARAM) &cle);
} else {
- if(CallService(MS_CLIST_GETEVENT, (WPARAM)hContact, (LPARAM)0))
+ if (CallService(MS_CLIST_GETEVENT, (WPARAM)hContact, (LPARAM)0))
CallService(MS_CLIST_REMOVEEVENT, (WPARAM)hContact, (LPARAM)event);
CallService(MS_CLIST_ADDEVENT,(WPARAM) hContact,(LPARAM) &cle);
}
diff --git a/plugins/Scriver/chat/colorchooser.cpp b/plugins/Scriver/chat/colorchooser.cpp index ad95d4cc89..67dc78a90d 100644 --- a/plugins/Scriver/chat/colorchooser.cpp +++ b/plugins/Scriver/chat/colorchooser.cpp @@ -149,7 +149,7 @@ INT_PTR CALLBACK DlgProcColorToolWindow(HWND hwndDlg, UINT msg, WPARAM wParam, L else {
pCC->si->bBGSet = TRUE;
pCC->si->iBG = iCurrentHotTrack;
- if(IsDlgButtonChecked(hWindow, IDC_CHAT_BKGCOLOR)) {
+ if (IsDlgButtonChecked(hWindow, IDC_CHAT_BKGCOLOR)) {
cf.dwMask = CFM_BACKCOLOR;
cf.crBackColor = pCC->pModule->crColors[iCurrentHotTrack];
if (pCC->pModule->bSingleFormat) {
diff --git a/plugins/Scriver/chat/options.cpp b/plugins/Scriver/chat/options.cpp index a54a1734af..62ee3310fa 100644 --- a/plugins/Scriver/chat/options.cpp +++ b/plugins/Scriver/chat/options.cpp @@ -158,7 +158,7 @@ static void SaveBranch(HWND hwndTree, struct branch_t *branch, int nValues) tvi.hItem = branch[i].hItem;
TreeView_GetItem(hwndTree,&tvi);
bChecked = ((tvi.state&TVIS_STATEIMAGEMASK)>>12==1)?0:1;
- if(branch[i].iMode)
+ if (branch[i].iMode)
{
if (bChecked)
iState |= branch[i].iMode;
@@ -174,13 +174,13 @@ static void CheckHeading(HWND hwndTree, HTREEITEM hHeading) BOOL bChecked = TRUE;
TVITEM tvi;
- if(hHeading == 0)
+ if (hHeading == 0)
return;
tvi.mask=TVIF_HANDLE|TVIF_STATE;
tvi.hItem=TreeView_GetNextItem(hwndTree, hHeading, TVGN_CHILD);
while(tvi.hItem && bChecked) {
- if(tvi.hItem != branch1[0].hItem && tvi.hItem != branch1[1].hItem )
+ if (tvi.hItem != branch1[0].hItem && tvi.hItem != branch1[1].hItem )
{
TreeView_GetItem(hwndTree,&tvi);
if (((tvi.state&TVIS_STATEIMAGEMASK)>>12==1))
@@ -198,7 +198,7 @@ static void CheckBranches(HWND hwndTree, HTREEITEM hHeading) BOOL bChecked = TRUE;
TVITEM tvi;
- if(hHeading == 0)
+ if (hHeading == 0)
return;
tvi.mask=TVIF_HANDLE|TVIF_STATE;
@@ -210,7 +210,7 @@ static void CheckBranches(HWND hwndTree, HTREEITEM hHeading) tvi.stateMask = TVIS_STATEIMAGEMASK;
while(tvi.hItem) {
tvi.state=INDEXTOSTATEIMAGEMASK(bChecked?2:1);
- if(tvi.hItem != branch1[0].hItem && tvi.hItem != branch1[1].hItem )
+ if (tvi.hItem != branch1[0].hItem && tvi.hItem != branch1[1].hItem )
TreeView_SetItem(hwndTree,&tvi);
tvi.hItem=TreeView_GetNextSibling(hwndTree,tvi.hItem);
}
@@ -256,8 +256,7 @@ INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa {
static HTREEITEM hListHeading1 = 0;
static HTREEITEM hListHeading4= 0;
- switch (uMsg)
- {
+ switch (uMsg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
SetWindowLongPtr(GetDlgItem(hwndDlg,IDC_CHAT_CHECKBOXES),GWL_STYLE,GetWindowLongPtr(GetDlgItem(hwndDlg,IDC_CHAT_CHECKBOXES),GWL_STYLE)|TVS_NOHSCROLL|TVS_CHECKBOXES);
@@ -282,13 +281,13 @@ INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa break;
case WM_COMMAND:
- if ( (LOWORD(wParam) == IDC_CHAT_NICKROW
- || LOWORD(wParam) == IDC_CHAT_GROUP)
- && (HIWORD(wParam)!=EN_CHANGE || (HWND)lParam!=GetFocus())) return 0;
+ if ((LOWORD(wParam) == IDC_CHAT_NICKROW || LOWORD(wParam) == IDC_CHAT_GROUP) && (HIWORD(wParam)!=EN_CHANGE || (HWND)lParam!=GetFocus()))
+ return 0;
- if(lParam != (LPARAM)NULL)
+ if (lParam != (LPARAM)NULL)
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
+
case UM_CHECKSTATECHANGE:
{
TVITEM tvi = {0};
@@ -302,21 +301,19 @@ INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa else
PostMessage(hwndDlg, OPT_FIXHEADINGS, 0, 0);
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
}
+ break;
case WM_NOTIFY:
- {
- switch(((LPNMHDR)lParam)->idFrom)
- {
+ switch(((LPNMHDR)lParam)->idFrom) {
case IDC_CHAT_CHECKBOXES:
if (((LPNMHDR)lParam)->code==NM_CLICK) {
TVHITTESTINFO hti;
hti.pt.x=(short)LOWORD(GetMessagePos());
hti.pt.y=(short)HIWORD(GetMessagePos());
ScreenToClient(((LPNMHDR)lParam)->hwndFrom,&hti.pt);
- if(TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom,&hti))
- if(hti.flags&TVHT_ONITEMSTATEICON) {
+ if (TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom,&hti))
+ if (hti.flags&TVHT_ONITEMSTATEICON) {
SendMessage(hwndDlg, UM_CHECKSTATECHANGE, (WPARAM)((LPNMHDR)lParam)->hwndFrom, (LPARAM)hti.hItem);
}
@@ -328,47 +325,47 @@ INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa }
break;
- case 0:
- switch (((LPNMHDR)lParam)->code)
+ case 0:
+ switch (((LPNMHDR)lParam)->code)
+ {
+ case PSN_APPLY:
{
- case PSN_APPLY:
+ int iLen;
+ char * pszText = NULL;
+
+ iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_CHAT_GROUP));
+ if (iLen > 0)
{
- int iLen;
- char * pszText = NULL;
-
- iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_CHAT_GROUP));
- if(iLen > 0)
- {
- pszText = (char *)mir_realloc(pszText, iLen+1);
- GetDlgItemTextA(hwndDlg, IDC_CHAT_GROUP, pszText,iLen+1);
- DBWriteContactSettingString(NULL, "Chat", "AddToGroup", pszText);
- }
- else DBWriteContactSettingString(NULL, "Chat", "AddToGroup", "");
- mir_free(pszText);
-
- iLen = SendDlgItemMessage(hwndDlg,IDC_CHAT_SPIN2,UDM_GETPOS,0,0);
- if(iLen > 0)
- DBWriteContactSettingByte(NULL, "Chat", "NicklistRowDist", (BYTE)iLen);
- else
- DBDeleteContactSetting(NULL, "Chat", "NicklistRowDist");
- SaveBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), branch1, SIZEOF(branch1));
- SaveBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), branch4, SIZEOF(branch4));
-
- SM_BroadcastMessage(NULL, GC_SETWNDPROPS, 0, 0, TRUE);
+ pszText = (char *)mir_realloc(pszText, iLen+1);
+ GetDlgItemTextA(hwndDlg, IDC_CHAT_GROUP, pszText,iLen+1);
+ DBWriteContactSettingString(NULL, "Chat", "AddToGroup", pszText);
}
- return TRUE;
+ else DBWriteContactSettingString(NULL, "Chat", "AddToGroup", "");
+ mir_free(pszText);
+
+ iLen = SendDlgItemMessage(hwndDlg,IDC_CHAT_SPIN2,UDM_GETPOS,0,0);
+ if (iLen > 0)
+ DBWriteContactSettingByte(NULL, "Chat", "NicklistRowDist", (BYTE)iLen);
+ else
+ DBDeleteContactSetting(NULL, "Chat", "NicklistRowDist");
+ SaveBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), branch1, SIZEOF(branch1));
+ SaveBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), branch4, SIZEOF(branch4));
+
+ SM_BroadcastMessage(NULL, GC_SETWNDPROPS, 0, 0, TRUE);
}
+ return TRUE;
+ }
}
- }break;
+ break;
+
case WM_DESTROY:
{
- BYTE b = TreeView_GetItemState(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), hListHeading1, TVIS_EXPANDED)&TVIS_EXPANDED?1:0;
- DBWriteContactSettingByte(NULL, "Chat", "Branch1Exp", b);
- b = TreeView_GetItemState(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), hListHeading4, TVIS_EXPANDED)&TVIS_EXPANDED?1:0;
- DBWriteContactSettingByte(NULL, "Chat", "Branch5Exp", b);
- }break;
-
- default:break;
+ BYTE b = TreeView_GetItemState(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), hListHeading1, TVIS_EXPANDED)&TVIS_EXPANDED?1:0;
+ DBWriteContactSettingByte(NULL, "Chat", "Branch1Exp", b);
+ b = TreeView_GetItemState(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), hListHeading4, TVIS_EXPANDED)&TVIS_EXPANDED?1:0;
+ DBWriteContactSettingByte(NULL, "Chat", "Branch5Exp", b);
+ }
+ break;
}
return FALSE;
}
@@ -377,20 +374,20 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa {
static HTREEITEM hListHeading2= 0;
static HTREEITEM hListHeading3= 0;
+
switch (uMsg) {
case WM_INITDIALOG:
- {
- TCHAR tszTemp[MAX_PATH];
-
TranslateDialogDefault(hwndDlg);
SetWindowLongPtr(GetDlgItem(hwndDlg,IDC_CHAT_CHECKBOXES),GWL_STYLE,GetWindowLongPtr(GetDlgItem(hwndDlg,IDC_CHAT_CHECKBOXES),GWL_STYLE)|TVS_NOHSCROLL|TVS_CHECKBOXES);
SendDlgItemMessage(hwndDlg,IDC_CHAT_SPIN2,UDM_SETRANGE,0,MAKELONG(5000,0));
SendDlgItemMessage(hwndDlg,IDC_CHAT_SPIN2,UDM_SETPOS,0,MAKELONG(DBGetContactSettingWord(NULL,"Chat","LogLimit",100),0));
SendDlgItemMessage(hwndDlg,IDC_CHAT_SPIN3,UDM_SETRANGE,0,MAKELONG(10000,0));
SendDlgItemMessage(hwndDlg,IDC_CHAT_SPIN3,UDM_SETPOS,0,MAKELONG(DBGetContactSettingWord(NULL,"Chat","LoggingLimit",100),0));
- CallService(MS_UTILS_PATHTORELATIVET, (WPARAM)g_Settings.pszLogDir, (LPARAM)tszTemp );
- SetDlgItemText(hwndDlg, IDC_CHAT_LOGDIRECTORY, tszTemp);
-
+ {
+ TCHAR tszTemp[MAX_PATH];
+ CallService(MS_UTILS_PATHTORELATIVET, (WPARAM)g_Settings.pszLogDir, (LPARAM)tszTemp );
+ SetDlgItemText(hwndDlg, IDC_CHAT_LOGDIRECTORY, tszTemp);
+ }
if (ServiceExists(MS_UTILS_REPLACEVARS)) {
TCHAR tszTooltipText[2048];
RECT rect;
@@ -430,7 +427,6 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa SetTimer(hwndDlg, 0, 3000, NULL);
}
-
SetDlgItemText(hwndDlg, IDC_CHAT_HIGHLIGHTWORDS, g_Settings.pszHighlightWords);
SetDlgItemText(hwndDlg, IDC_CHAT_LOGTIMESTAMP, g_Settings.pszTimeStampLog);
SetDlgItemText(hwndDlg, IDC_CHAT_TIMESTAMP, g_Settings.pszTimeStamp);
@@ -449,13 +445,13 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa FillBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), hListHeading2, branch2, SIZEOF(branch2), 0x0);
FillBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), hListHeading3, branch3, SIZEOF(branch3), 0x03E0);
SendMessage(hwndDlg, OPT_FIXHEADINGS, 0, 0);
-
break;
- }
+
case OPT_FIXHEADINGS:
CheckHeading(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), hListHeading2);
CheckHeading(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), hListHeading3);
break;
+
case WM_COMMAND:
if ( (LOWORD(wParam) == IDC_CHAT_INSTAMP
|| LOWORD(wParam) == IDC_CHAT_OUTSTAMP
@@ -476,27 +472,23 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa break;
case IDC_CHAT_LOGDIRCHOOSE:
{
- TCHAR tszDirectory[MAX_PATH];
- LPITEMIDLIST idList;
LPMALLOC psMalloc;
- BROWSEINFO bi = {0};
-
- if(SUCCEEDED(CoGetMalloc(1,&psMalloc)))
- {
- TCHAR tszTemp[MAX_PATH];
- bi.hwndOwner=hwndDlg;
- bi.pszDisplayName=tszDirectory;
- bi.lpszTitle=TranslateT("Select Folder");
- bi.ulFlags=BIF_NEWDIALOGSTYLE|BIF_EDITBOX|BIF_RETURNONLYFSDIRS;
- bi.lpfn=BrowseCallbackProc;
- bi.lParam=(LPARAM)tszDirectory;
-
- idList=SHBrowseForFolder(&bi);
- if(idList) {
- SHGetPathFromIDList(idList,tszDirectory);
- lstrcat(tszDirectory, _T("\\"));
- CallService(MS_UTILS_PATHTORELATIVET, (WPARAM)tszDirectory, (LPARAM)tszTemp );
- SetWindowText(GetDlgItem(hwndDlg, IDC_CHAT_LOGDIRECTORY), lstrlen(tszTemp) > 1?tszTemp:DEFLOGFILENAME);
+ if ( SUCCEEDED(CoGetMalloc(1, &psMalloc))) {
+ TCHAR tszDirectory[MAX_PATH], tszTemp[MAX_PATH];
+ BROWSEINFO bi = {0};
+ bi.hwndOwner = hwndDlg;
+ bi.pszDisplayName = tszDirectory;
+ bi.lpszTitle = TranslateT("Select Folder");
+ bi.ulFlags = BIF_NEWDIALOGSTYLE|BIF_EDITBOX|BIF_RETURNONLYFSDIRS;
+ bi.lpfn = BrowseCallbackProc;
+ bi.lParam = (LPARAM)tszDirectory;
+
+ LPITEMIDLIST idList = SHBrowseForFolder(&bi);
+ if (idList) {
+ SHGetPathFromIDList(idList,tszDirectory);
+ lstrcat(tszDirectory, _T("\\"));
+ CallService(MS_UTILS_PATHTORELATIVET, (WPARAM)tszDirectory, (LPARAM)tszTemp );
+ SetWindowText(GetDlgItem(hwndDlg, IDC_CHAT_LOGDIRECTORY), lstrlen(tszTemp) > 1?tszTemp:DEFLOGFILENAME);
}
psMalloc->Free(idList);
psMalloc->Release();
@@ -508,7 +500,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa break;
}
- if(lParam != (LPARAM)NULL)
+ if (lParam != (LPARAM)NULL)
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
@@ -535,18 +527,19 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa hti.pt.x=(short)LOWORD(GetMessagePos());
hti.pt.y=(short)HIWORD(GetMessagePos());
ScreenToClient(((LPNMHDR)lParam)->hwndFrom,&hti.pt);
- if(TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom,&hti))
- if(hti.flags&TVHT_ONITEMSTATEICON) {
+ if (TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom,&hti))
+ if (hti.flags&TVHT_ONITEMSTATEICON) {
SendMessage(hwndDlg, UM_CHECKSTATECHANGE, (WPARAM)((LPNMHDR)lParam)->hwndFrom, (LPARAM)hti.hItem);
}
-
- } else if (((LPNMHDR) lParam)->code == TVN_KEYDOWN) {
+ }
+ else if (((LPNMHDR) lParam)->code == TVN_KEYDOWN) {
if (((LPNMTVKEYDOWN) lParam)->wVKey == VK_SPACE) {
SendMessage(hwndDlg, UM_CHECKSTATECHANGE, (WPARAM)((LPNMHDR)lParam)->hwndFrom,
(LPARAM)TreeView_GetSelection(((LPNMHDR)lParam)->hwndFrom));
}
}
- } else if (((LPNMHDR)lParam)->idFrom == 0 && ((LPNMHDR)lParam)->code == PSN_APPLY ) {
+ }
+ else if (((LPNMHDR)lParam)->idFrom == 0 && ((LPNMHDR)lParam)->code == PSN_APPLY ) {
char *pszText = NULL;
int iLen;
@@ -555,7 +548,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa TCHAR *ptszText = (TCHAR *)mir_alloc((iLen+2) * sizeof(TCHAR));
TCHAR *p2 = NULL;
- if(ptszText) {
+ if (ptszText) {
GetDlgItemText(hwndDlg, IDC_CHAT_HIGHLIGHTWORDS, ptszText, iLen + 1);
p2 = _tcschr(ptszText, (TCHAR)',');
while ( p2 ) {
@@ -642,13 +635,14 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa return TRUE;
}
break;
+
case WM_TIMER:
- if(IsWindow(hPathTip))
+ if (IsWindow(hPathTip))
KillTimer(hPathTip, 4); // It will prevent tooltip autoclosing
break;
+
case WM_DESTROY:
- if (hPathTip)
- {
+ if (hPathTip) {
KillTimer(hwndDlg, 0);
DestroyWindow(hPathTip);
hPathTip = 0;
@@ -666,113 +660,101 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa static INT_PTR CALLBACK DlgProcOptionsPopup(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam)
{
- switch (uMsg)
- {
+ switch (uMsg) {
case WM_INITDIALOG:
- {
- TranslateDialogDefault(hwndDlg);
+ TranslateDialogDefault(hwndDlg);
- SetWindowLongPtr(GetDlgItem(hwndDlg,IDC_CHAT_CHECKBOXES),GWL_STYLE,GetWindowLongPtr(GetDlgItem(hwndDlg,IDC_CHAT_CHECKBOXES),GWL_STYLE)|TVS_NOHSCROLL|TVS_CHECKBOXES);
- SendDlgItemMessage(hwndDlg, IDC_CHAT_BKG, CPM_SETCOLOUR,0,g_Settings.crPUBkgColour);
- SendDlgItemMessage(hwndDlg, IDC_CHAT_TEXT, CPM_SETCOLOUR,0,g_Settings.crPUTextColour);
+ SetWindowLongPtr(GetDlgItem(hwndDlg,IDC_CHAT_CHECKBOXES),GWL_STYLE,GetWindowLongPtr(GetDlgItem(hwndDlg,IDC_CHAT_CHECKBOXES),GWL_STYLE)|TVS_NOHSCROLL|TVS_CHECKBOXES);
+ SendDlgItemMessage(hwndDlg, IDC_CHAT_BKG, CPM_SETCOLOUR,0,g_Settings.crPUBkgColour);
+ SendDlgItemMessage(hwndDlg, IDC_CHAT_TEXT, CPM_SETCOLOUR,0,g_Settings.crPUTextColour);
- if(g_Settings.iPopupStyle ==2)
- CheckDlgButton(hwndDlg, IDC_CHAT_RADIO2, BST_CHECKED);
- else if(g_Settings.iPopupStyle ==3)
- CheckDlgButton(hwndDlg, IDC_CHAT_RADIO3, BST_CHECKED);
- else
- CheckDlgButton(hwndDlg, IDC_CHAT_RADIO1, BST_CHECKED);
+ if (g_Settings.iPopupStyle ==2)
+ CheckDlgButton(hwndDlg, IDC_CHAT_RADIO2, BST_CHECKED);
+ else if (g_Settings.iPopupStyle ==3)
+ CheckDlgButton(hwndDlg, IDC_CHAT_RADIO3, BST_CHECKED);
+ else
+ CheckDlgButton(hwndDlg, IDC_CHAT_RADIO1, BST_CHECKED);
- EnableWindow(GetDlgItem(hwndDlg, IDC_CHAT_BKG), IsDlgButtonChecked(hwndDlg, IDC_CHAT_RADIO3) ==BST_CHECKED?TRUE:FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_CHAT_TEXT), IsDlgButtonChecked(hwndDlg, IDC_CHAT_RADIO3) ==BST_CHECKED?TRUE:FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHAT_BKG), IsDlgButtonChecked(hwndDlg, IDC_CHAT_RADIO3) ==BST_CHECKED?TRUE:FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHAT_TEXT), IsDlgButtonChecked(hwndDlg, IDC_CHAT_RADIO3) ==BST_CHECKED?TRUE:FALSE);
- SendDlgItemMessage(hwndDlg,IDC_CHAT_SPIN1,UDM_SETRANGE,0,MAKELONG(100,-1));
- SendDlgItemMessage(hwndDlg,IDC_CHAT_SPIN1,UDM_SETPOS,0,MAKELONG(g_Settings.iPopupTimeout,0));
- //hListHeading6 = InsertBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), TranslateT("Pop-ups to display"), TRUE);
- FillBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), NULL, branch6, SIZEOF(branch6), 0x0000);
- }break;
+ SendDlgItemMessage(hwndDlg,IDC_CHAT_SPIN1,UDM_SETRANGE,0,MAKELONG(100,-1));
+ SendDlgItemMessage(hwndDlg,IDC_CHAT_SPIN1,UDM_SETPOS,0,MAKELONG(g_Settings.iPopupTimeout,0));
+ FillBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), NULL, branch6, SIZEOF(branch6), 0x0000);
+ break;
case WM_COMMAND:
- if ( (LOWORD(wParam) == IDC_CHAT_TIMEOUT)
- && (HIWORD(wParam)!=EN_CHANGE || (HWND)lParam!=GetFocus())) return 0;
+ if ((LOWORD(wParam) == IDC_CHAT_TIMEOUT) && (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()))
+ return 0;
- if(lParam != (LPARAM)NULL)
+ if (lParam)
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- switch (LOWORD(wParam)) {
+ switch (LOWORD(wParam)) {
case IDC_CHAT_RADIO1:
case IDC_CHAT_RADIO2:
case IDC_CHAT_RADIO3:
EnableWindow(GetDlgItem(hwndDlg, IDC_CHAT_BKG), IsDlgButtonChecked(hwndDlg, IDC_CHAT_RADIO3) ==BST_CHECKED?TRUE:FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_CHAT_TEXT), IsDlgButtonChecked(hwndDlg, IDC_CHAT_RADIO3) ==BST_CHECKED?TRUE:FALSE);
- break;
-
- default:break;
}
-
break;
case WM_NOTIFY:
- {
- switch(((LPNMHDR)lParam)->idFrom)
- {
- case IDC_CHAT_CHECKBOXES:
- if (((LPNMHDR)lParam)->code==NM_CLICK) {
- TVHITTESTINFO hti;
- hti.pt.x=(short)LOWORD(GetMessagePos());
- hti.pt.y=(short)HIWORD(GetMessagePos());
- ScreenToClient(((LPNMHDR)lParam)->hwndFrom,&hti.pt);
- if(TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom,&hti))
- if(hti.flags&TVHT_ONITEMSTATEICON) {
- SendMessage(hwndDlg, UM_CHECKSTATECHANGE, (WPARAM)((LPNMHDR)lParam)->hwndFrom, (LPARAM)hti.hItem);
- }
-
- } else if (((LPNMHDR) lParam)->code == TVN_KEYDOWN) {
- if (((LPNMTVKEYDOWN) lParam)->wVKey == VK_SPACE) {
- SendMessage(hwndDlg, UM_CHECKSTATECHANGE, (WPARAM)((LPNMHDR)lParam)->hwndFrom,
- (LPARAM)TreeView_GetSelection(((LPNMHDR)lParam)->hwndFrom));
+ switch(((LPNMHDR)lParam)->idFrom) {
+ case IDC_CHAT_CHECKBOXES:
+ if (((LPNMHDR)lParam)->code==NM_CLICK) {
+ TVHITTESTINFO hti;
+ hti.pt.x=(short)LOWORD(GetMessagePos());
+ hti.pt.y=(short)HIWORD(GetMessagePos());
+ ScreenToClient(((LPNMHDR)lParam)->hwndFrom,&hti.pt);
+ if (TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom,&hti))
+ if (hti.flags&TVHT_ONITEMSTATEICON) {
+ SendMessage(hwndDlg, UM_CHECKSTATECHANGE, (WPARAM)((LPNMHDR)lParam)->hwndFrom, (LPARAM)hti.hItem);
}
+ }
+ else if (((LPNMHDR) lParam)->code == TVN_KEYDOWN) {
+ if (((LPNMTVKEYDOWN) lParam)->wVKey == VK_SPACE) {
+ SendMessage(hwndDlg, UM_CHECKSTATECHANGE, (WPARAM)((LPNMHDR)lParam)->hwndFrom,
+ (LPARAM)TreeView_GetSelection(((LPNMHDR)lParam)->hwndFrom));
}
+ }
break;
- case 0:
- switch (((LPNMHDR)lParam)->code)
+
+ case 0:
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_APPLY:
{
- case PSN_APPLY:
- {
- int iLen;
-
- if(IsDlgButtonChecked(hwndDlg, IDC_CHAT_RADIO2) == BST_CHECKED)
- iLen = 2;
- else if(IsDlgButtonChecked(hwndDlg, IDC_CHAT_RADIO3) == BST_CHECKED)
- iLen = 3;
- else
- iLen = 1;
-
- g_Settings.iPopupStyle = iLen;
- DBWriteContactSettingByte(NULL, "Chat", "PopupStyle", (BYTE)iLen);
-
- iLen = SendDlgItemMessage(hwndDlg,IDC_CHAT_SPIN1,UDM_GETPOS,0,0);
- g_Settings.iPopupTimeout = iLen;
- DBWriteContactSettingWord(NULL, "Chat", "PopupTimeout", (WORD)iLen);
-
- g_Settings.crPUBkgColour = SendDlgItemMessage(hwndDlg,IDC_CHAT_BKG,CPM_GETCOLOUR,0,0);
- DBWriteContactSettingDword(NULL, "Chat", "PopupColorBG", (DWORD)SendDlgItemMessage(hwndDlg,IDC_CHAT_BKG,CPM_GETCOLOUR,0,0));
- g_Settings.crPUTextColour = SendDlgItemMessage(hwndDlg,IDC_CHAT_TEXT,CPM_GETCOLOUR,0,0);
- DBWriteContactSettingDword(NULL, "Chat", "PopupColorText", (DWORD)SendDlgItemMessage(hwndDlg,IDC_CHAT_TEXT,CPM_GETCOLOUR,0,0));
- SaveBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), branch6, SIZEOF(branch6));
- }
- return TRUE;
+ int iLen;
+
+ if (IsDlgButtonChecked(hwndDlg, IDC_CHAT_RADIO2) == BST_CHECKED)
+ iLen = 2;
+ else if (IsDlgButtonChecked(hwndDlg, IDC_CHAT_RADIO3) == BST_CHECKED)
+ iLen = 3;
+ else
+ iLen = 1;
+
+ g_Settings.iPopupStyle = iLen;
+ DBWriteContactSettingByte(NULL, "Chat", "PopupStyle", (BYTE)iLen);
+
+ iLen = SendDlgItemMessage(hwndDlg,IDC_CHAT_SPIN1,UDM_GETPOS,0,0);
+ g_Settings.iPopupTimeout = iLen;
+ DBWriteContactSettingWord(NULL, "Chat", "PopupTimeout", (WORD)iLen);
+
+ g_Settings.crPUBkgColour = SendDlgItemMessage(hwndDlg,IDC_CHAT_BKG,CPM_GETCOLOUR,0,0);
+ DBWriteContactSettingDword(NULL, "Chat", "PopupColorBG", (DWORD)SendDlgItemMessage(hwndDlg,IDC_CHAT_BKG,CPM_GETCOLOUR,0,0));
+ g_Settings.crPUTextColour = SendDlgItemMessage(hwndDlg,IDC_CHAT_TEXT,CPM_GETCOLOUR,0,0);
+ DBWriteContactSettingDword(NULL, "Chat", "PopupColorText", (DWORD)SendDlgItemMessage(hwndDlg,IDC_CHAT_TEXT,CPM_GETCOLOUR,0,0));
+ SaveBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), branch6, SIZEOF(branch6));
}
+ return TRUE;
+ }
}
- }break;
- case UM_CHECKSTATECHANGE:
- {
- PostMessage(hwndDlg, OPT_FIXHEADINGS, 0, 0);
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
- }
+ break;
- default:break;
+ case UM_CHECKSTATECHANGE:
+ PostMessage(hwndDlg, OPT_FIXHEADINGS, 0, 0);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
}
return FALSE;
}
@@ -835,38 +817,37 @@ void LoadGlobalSettings(void) InitSetting( &g_Settings.pszOutgoingNick, "HeaderOutgoing", _T("%n:"));
InitSetting( &g_Settings.pszHighlightWords, "HighlightWords", _T("%m"));
- {
DBVARIANT dbv;
- g_Settings.pszLogDir = (TCHAR *)mir_realloc(g_Settings.pszLogDir, MAX_PATH*sizeof(TCHAR));
- if (!DBGetContactSettingTString(NULL, "Chat", "LogDirectory", &dbv)) {
- lstrcpyn(g_Settings.pszLogDir, dbv.ptszVal, MAX_PATH);
- DBFreeVariant(&dbv);
- } else lstrcpyn(g_Settings.pszLogDir, DEFLOGFILENAME, MAX_PATH);
+ g_Settings.pszLogDir = (TCHAR *)mir_realloc(g_Settings.pszLogDir, MAX_PATH*sizeof(TCHAR));
+ if ( !DBGetContactSettingTString(NULL, "Chat", "LogDirectory", &dbv)) {
+ lstrcpyn(g_Settings.pszLogDir, dbv.ptszVal, MAX_PATH);
+ DBFreeVariant(&dbv);
}
+ else lstrcpyn(g_Settings.pszLogDir, DEFLOGFILENAME, MAX_PATH);
g_Settings.LogIndentEnabled = (DBGetContactSettingByte(NULL, "Chat", "LogIndentEnabled", 1) != 0)?TRUE:FALSE;
- if(g_Settings.MessageBoxFont)
+ if (g_Settings.MessageBoxFont)
DeleteObject(g_Settings.MessageBoxFont);
LoadMsgDlgFont(MSGFONTID_MESSAGEAREA, &lf, NULL, FALSE);
g_Settings.MessageBoxFont = CreateFontIndirect(&lf);
- if(g_Settings.UserListFont)
+ if (g_Settings.UserListFont)
DeleteObject(g_Settings.UserListFont);
LoadMsgDlgFont(18, &lf, NULL, TRUE);
g_Settings.UserListFont = CreateFontIndirect(&lf);
- if(g_Settings.UserListHeadingsFont)
+ if (g_Settings.UserListHeadingsFont)
DeleteObject(g_Settings.UserListHeadingsFont);
LoadMsgDlgFont(19, &lf, NULL, TRUE);
g_Settings.UserListHeadingsFont = CreateFontIndirect(&lf);
- if (hListBkgBrush != NULL) {
+
+ if (hListBkgBrush != NULL)
DeleteObject(hListBkgBrush);
- }
hListBkgBrush = CreateSolidBrush(DBGetContactSettingDword(NULL, "Chat", "ColorNicklistBG", GetSysColor(COLOR_WINDOW)));
- if (hListSelectedBkgBrush != NULL) {
+
+ if (hListSelectedBkgBrush != NULL)
DeleteObject(hListSelectedBkgBrush);
- }
hListSelectedBkgBrush = CreateSolidBrush(DBGetContactSettingDword(NULL, "Chat", "ColorNicklistSelectedBG", GetSysColor(COLOR_HIGHLIGHT)));
}
@@ -878,11 +859,11 @@ static void FreeGlobalSettings(void) mir_free(g_Settings.pszOutgoingNick);
mir_free(g_Settings.pszHighlightWords);
mir_free(g_Settings.pszLogDir);
- if(g_Settings.MessageBoxFont)
+ if (g_Settings.MessageBoxFont)
DeleteObject(g_Settings.MessageBoxFont);
- if(g_Settings.UserListFont)
+ if (g_Settings.UserListFont)
DeleteObject(g_Settings.UserListFont);
- if(g_Settings.UserListHeadingsFont)
+ if (g_Settings.UserListHeadingsFont)
DeleteObject(g_Settings.UserListHeadingsFont);
}
@@ -898,10 +879,8 @@ void SetIndentSize() iText = GetTextPixelSize(MakeTimeStamp(g_Settings.pszTimeStamp, time(NULL)),hFont, TRUE);
DeleteObject(hFont);
g_Settings.LogTextIndent = iText*12/10;
- } else {
- g_Settings.LogTextIndent = 0;
}
-
+ else g_Settings.LogTextIndent = 0;
}
int OptionsInit(void)
@@ -938,7 +917,6 @@ int OptionsInit(void) return 0;
}
-
int OptionsUnInit(void)
{
FreeGlobalSettings();
diff --git a/plugins/Scriver/chat/window.cpp b/plugins/Scriver/chat/window.cpp index 0962503cd3..bf637ccb2b 100644 --- a/plugins/Scriver/chat/window.cpp +++ b/plugins/Scriver/chat/window.cpp @@ -345,7 +345,7 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, gt.flags = GT_DEFAULT;
SendMessage(hwnd, EM_GETTEXTEX, (WPARAM)>, (LPARAM)pszText);
- if(start > 1 && pszText[start-1] == ' ' && pszText[start-2] == ':') {
+ if (start > 1 && pszText[start-1] == ' ' && pszText[start-2] == ':') {
start--;
}
while ( start >0 && pszText[start-1] != ' ' && pszText[start-1] != 13 && pszText[start-1] != VK_TAB)
@@ -842,7 +842,7 @@ static void ProcessNickListHovering(HWND hwnd, int hoveredItem, POINT * pt, SESS ti.lpszText=NULL;
ui1 = SM_GetUserFromIndex(parentdat->ptszID, parentdat->pszModule, currentHovered);
- if(ui1) {
+ if (ui1) {
// /GetChatToolTipText
// wParam = roomID parentdat->ptszID
// lParam = userID ui1->pszUID
diff --git a/plugins/Scriver/msgdialog.cpp b/plugins/Scriver/msgdialog.cpp index a2939826da..a5bb8d92dd 100644 --- a/plugins/Scriver/msgdialog.cpp +++ b/plugins/Scriver/msgdialog.cpp @@ -179,13 +179,13 @@ int RTL_Detect(WCHAR *pszwText) infoTypeC2 = (WORD *)mir_alloc(sizeof(WORD) * (iLen + 2));
- if(infoTypeC2) {
+ if (infoTypeC2) {
ZeroMemory(infoTypeC2, sizeof(WORD) * (iLen + 2));
GetStringTypeW(CT_CTYPE2, pszwText, iLen, infoTypeC2);
for(i = 0; i < iLen; i++) {
- if(infoTypeC2[i] == C2_RIGHTTOLEFT) {
+ if (infoTypeC2[i] == C2_RIGHTTOLEFT) {
mir_free(infoTypeC2);
return 1;
}
@@ -827,7 +827,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP WindowList_Add(g_dat->hMessageWindowList, hwndDlg, dat->windowData.hContact);
if (newData->szInitialText) {
- if(newData->isWchar)
+ if (newData->isWchar)
SetDlgItemText(hwndDlg, IDC_MESSAGE, (TCHAR *)newData->szInitialText);
else
SetDlgItemTextA(hwndDlg, IDC_MESSAGE, newData->szInitialText);
@@ -1270,7 +1270,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP char buf[128];
HGLOBAL hData;
- if(dat->windowData.hContact) {
+ if (dat->windowData.hContact) {
GetContactUniqueId(dat, buf, sizeof(buf));
if (!OpenClipboard(hwndDlg) || !lstrlenA(buf)) break;
EmptyClipboard();
@@ -1780,7 +1780,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP //this is a 'send' button
if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDOK)))
break;
- //if(GetKeyState(VK_CTRL) & 0x8000) { // copy user name
+ //if (GetKeyState(VK_CTRL) & 0x8000) { // copy user name
//SendMessage(hwndDlg, DM_USERNAMETOCLIP, 0, 0);
//}
if (dat->windowData.hContact != NULL) {
@@ -1850,7 +1850,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP return TRUE;
case IDC_USERMENU:
{
- if(GetKeyState(VK_SHIFT) & 0x8000) { // copy user name
+ if (GetKeyState(VK_SHIFT) & 0x8000) { // copy user name
SendMessage(hwndDlg, DM_USERNAMETOCLIP, 0, 0);
} else {
RECT rc;
diff --git a/plugins/Scriver/msglog.cpp b/plugins/Scriver/msglog.cpp index ae04d5e11e..eaf139ce02 100644 --- a/plugins/Scriver/msglog.cpp +++ b/plugins/Scriver/msglog.cpp @@ -91,14 +91,14 @@ TCHAR *GetNickname(HANDLE hContact, const char* szProto) { ci.hContact = hContact;
ci.szProto = (char *)szProto;
ci.dwFlag = CNF_DISPLAY;
- if(IsUnicodeMIM()) {
+ if (IsUnicodeMIM()) {
ci.dwFlag |= CNF_UNICODE;
}
if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM) & ci)) {
if (ci.type == CNFT_ASCIIZ) {
if (ci.pszVal) {
- if(IsUnicodeMIM()) {
+ if (IsUnicodeMIM()) {
if (!_tcscmp((TCHAR *)ci.pszVal, TranslateW(_T("'(Unknown Contact)'")))) {
ci.dwFlag &= ~CNF_UNICODE;
if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM) & ci)) {
@@ -456,18 +456,18 @@ TCHAR *TimestampToString(DWORD dwFlags, time_t check, int mode) tm_today.tm_hour = tm_today.tm_min = tm_today.tm_sec = 0;
today = mktime(&tm_today);
- if(dwFlags & SMF_RELATIVEDATE && check >= today) {
+ if (dwFlags & SMF_RELATIVEDATE && check >= today) {
lstrcpy(szResult, TranslateT("Today"));
if (mode == 0) {
lstrcat(szResult, _T(","));
}
- } else if(dwFlags & SMF_RELATIVEDATE && check > (today - 86400)) {
+ } else if (dwFlags & SMF_RELATIVEDATE && check > (today - 86400)) {
lstrcpy(szResult, TranslateT("Yesterday"));
if (mode == 0) {
lstrcat(szResult, _T(","));
}
} else {
- if(dwFlags & SMF_LONGDATE)
+ if (dwFlags & SMF_LONGDATE)
lstrcpy(format, _T("D"));
else
lstrcpy(format, _T("d"));
diff --git a/plugins/Scriver/msgwindow.cpp b/plugins/Scriver/msgwindow.cpp index 37a1bd6c3d..a59e0482e8 100644 --- a/plugins/Scriver/msgwindow.cpp +++ b/plugins/Scriver/msgwindow.cpp @@ -328,7 +328,7 @@ static void ActivateChild(ParentWindowData *dat, HWND child) { return;
dat->hContact = mwtd->hContact;
- if(child != dat->hwndActive) {
+ if (child != dat->hwndActive) {
HWND prev = dat->hwndActive;
dat->hwndActive = child;
SetupStatusBar(dat);
@@ -571,7 +571,7 @@ INT_PTR CALLBACK DlgProcParentWindow(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR mmi->ptMaxSize.x = wp.rcNormalPosition.right - wp.rcNormalPosition.left;
mmi->ptMaxSize.y = rcDesktop.bottom - rcDesktop.top;
mmi->ptMaxPosition.x = wp.rcNormalPosition.left;
- if(IsIconic(hwndDlg)) {
+ if (IsIconic(hwndDlg)) {
mmi->ptMaxPosition.y = rcDesktop.top;
} else {
mmi->ptMaxPosition.y = 0;
@@ -764,7 +764,7 @@ INT_PTR CALLBACK DlgProcParentWindow(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR ScreenToClient(dat->hwndStatus, &pt);
SendMessage(dat->hwndStatus, SB_GETRECT, SendMessage(dat->hwndStatus, SB_GETPARTS, 0, 0) - 2, (LPARAM)&rc);
- if(pt.x >= rc.left) {
+ if (pt.x >= rc.left) {
MessageWindowTabData *mwtd = GetChildFromHWND(dat, dat->hwndActive);
if (mwtd != NULL) {
CheckStatusIconClick(mwtd->hContact, dat->hwndStatus, pt, rc, 2, MBCF_RIGHTBUTTON);
@@ -832,19 +832,19 @@ INT_PTR CALLBACK DlgProcParentWindow(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR pRect->top = pt.y-dat->mouseLBDownPos.y;
pRect->right = pRect->left+szSize.cx;
pRect->bottom = pRect->top+szSize.cy;
- if(pRect->top < rcDesktop.top+snapPixels && pRect->top > rcDesktop.top-snapPixels) {
+ if (pRect->top < rcDesktop.top+snapPixels && pRect->top > rcDesktop.top-snapPixels) {
pRect->top = rcDesktop.top;
pRect->bottom = rcDesktop.top + szSize.cy;
}
- if(pRect->left < rcDesktop.left+snapPixels && pRect->left > rcDesktop.left-snapPixels) {
+ if (pRect->left < rcDesktop.left+snapPixels && pRect->left > rcDesktop.left-snapPixels) {
pRect->left = rcDesktop.left;
pRect->right = rcDesktop.left + szSize.cx;
}
- if(pRect->right < rcDesktop.right+snapPixels && pRect->right > rcDesktop.right-snapPixels) {
+ if (pRect->right < rcDesktop.right+snapPixels && pRect->right > rcDesktop.right-snapPixels) {
pRect->right = rcDesktop.right;
pRect->left = rcDesktop.right - szSize.cx;
}
- if(pRect->bottom < rcDesktop.bottom+snapPixels && pRect->bottom > rcDesktop.bottom-snapPixels) {
+ if (pRect->bottom < rcDesktop.bottom+snapPixels && pRect->bottom > rcDesktop.bottom-snapPixels) {
pRect->bottom = rcDesktop.bottom;
pRect->top = rcDesktop.bottom - szSize.cy;
}
@@ -1218,7 +1218,7 @@ static void DrawTab(ParentWindowData *dat, HWND hwnd, WPARAM wParam, LPARAM lPar InflateRect(&rectTab, 1, 1);
hTheme = MyOpenThemeData(hwnd, L"TAB");
- if(MyIsThemeBackgroundPartiallyTransparent(hTheme, TABP_TABITEM, tstate))
+ if (MyIsThemeBackgroundPartiallyTransparent(hTheme, TABP_TABITEM, tstate))
MyDrawThemeParentBackground(hwnd, lpDIS->hDC, &rectTab);
MyDrawThemeBackground(hTheme, lpDIS->hDC, TABP_TABITEM, tstate, &rectTab, NULL);
}
@@ -1602,8 +1602,8 @@ int ScriverRestoreWindowPosition(HWND hwnd,HANDLE hContact,const char *szModule, x=DBGetContactSettingDword(hContact,szModule,szSettingName,-1);
wsprintfA(szSettingName,"%sy",szNamePrefix);
y=(int)DBGetContactSettingDword(hContact,szModule,szSettingName,-1);
- if(x==-1) return 1;
- if(flags&RWPF_NOSIZE) {
+ if (x==-1) return 1;
+ if (flags&RWPF_NOSIZE) {
OffsetRect(&wp.rcNormalPosition,x-wp.rcNormalPosition.left,y-wp.rcNormalPosition.top);
} else {
wp.rcNormalPosition.left=x;
diff --git a/plugins/Scriver/statusicon.cpp b/plugins/Scriver/statusicon.cpp index 2b77d099c8..6b053b8adc 100644 --- a/plugins/Scriver/statusicon.cpp +++ b/plugins/Scriver/statusicon.cpp @@ -42,7 +42,7 @@ static INT_PTR AddStatusIcon(WPARAM wParam, LPARAM lParam) { siln->sid.hIcon = sid->hIcon;
siln->sid.hIconDisabled = sid->hIconDisabled;
siln->sid.flags = sid->flags;
- if(sid->szTooltip) siln->sid.szTooltip = mir_strdup(sid->szTooltip);
+ if (sid->szTooltip) siln->sid.szTooltip = mir_strdup(sid->szTooltip);
else siln->sid.szTooltip = 0;
siln->next = status_icon_list;
@@ -64,7 +64,7 @@ INT_PTR AddStickyStatusIcon(WPARAM wParam, LPARAM lParam) { siln->sid.hIcon = sid->hIcon;
siln->sid.hIconDisabled = sid->hIconDisabled;
siln->sid.flags = sid->flags;
- if(sid->szTooltip) siln->sid.szTooltip = mir_strdup(sid->szTooltip);
+ if (sid->szTooltip) siln->sid.szTooltip = mir_strdup(sid->szTooltip);
else siln->sid.szTooltip = 0;
siln->next = NULL;
@@ -88,8 +88,8 @@ static INT_PTR RemoveStatusIcon(WPARAM wParam, LPARAM lParam) { struct StatusIconListNode *current = status_icon_list, *prev = 0;
while(current) {
- if(strcmp(current->sid.szModule, sid->szModule) == 0 && current->sid.dwId == sid->dwId) {
- if(prev) prev->next = current->next;
+ if (strcmp(current->sid.szModule, sid->szModule) == 0 && current->sid.dwId == sid->dwId) {
+ if (prev) prev->next = current->next;
else status_icon_list = current->next;
status_icon_list_size--;
@@ -120,8 +120,8 @@ static void RemoveAllStatusIcons(void) { mir_free(current->sid.szModule);
DestroyIcon(current->sid.hIcon);
- if(current->sid.hIconDisabled) DestroyIcon(current->sid.hIconDisabled);
- if(current->sid.szTooltip) mir_free(current->sid.szTooltip);
+ if (current->sid.hIconDisabled) DestroyIcon(current->sid.hIconDisabled);
+ if (current->sid.szTooltip) mir_free(current->sid.szTooltip);
mir_free(current);
}
@@ -135,19 +135,19 @@ INT_PTR ModifyStatusIcon(WPARAM wParam, LPARAM lParam) { struct StatusIconListNode *current = status_icon_list;
while(current) {
- if(strcmp(current->sid.szModule, sid->szModule) == 0 && current->sid.dwId == sid->dwId) {
+ if (strcmp(current->sid.szModule, sid->szModule) == 0 && current->sid.dwId == sid->dwId) {
if (!hContact) {
current->sid.flags = sid->flags;
- if(sid->hIcon) {
+ if (sid->hIcon) {
ReleaseIconSmart(current->sid.hIcon);
current->sid.hIcon = sid->hIcon;
}
- if(sid->hIconDisabled) {
+ if (sid->hIconDisabled) {
ReleaseIconSmart(current->sid.hIconDisabled);
current->sid.hIconDisabled = sid->hIconDisabled;
}
- if(sid->szTooltip) {
- if(current->sid.szTooltip) mir_free(current->sid.szTooltip);
+ if (sid->szTooltip) {
+ if (current->sid.szTooltip) mir_free(current->sid.szTooltip);
current->sid.szTooltip = mir_strdup(sid->szTooltip);
}
@@ -211,7 +211,7 @@ void CheckStatusIconClick(HANDLE hContact, HWND hwndFrom, POINT pt, RECT r, int current = current->next;
}
- if(current) {
+ if (current) {
ClientToScreen(hwndFrom, &pt);
sicd.cbSize = sizeof(StatusIconClickData);
sicd.clickLocation = pt;
diff --git a/plugins/Scriver/utils.cpp b/plugins/Scriver/utils.cpp index c2227ec745..e9a9dacad2 100644 --- a/plugins/Scriver/utils.cpp +++ b/plugins/Scriver/utils.cpp @@ -152,7 +152,7 @@ int IsUnicodeMIM() { char str[512];
mimFlags = MIM_CHECKED;
CallService(MS_SYSTEM_GETVERSIONTEXT, (WPARAM)500, (LPARAM)(char*)str);
- if(strstr(str, "Unicode")) {
+ if (strstr(str, "Unicode")) {
mimFlags |= MIM_UNICODE;
}
}
|