diff options
author | George Hazan <ghazan@miranda.im> | 2016-12-06 14:22:46 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2016-12-06 14:23:55 +0300 |
commit | c8e8e884a6a632c5766eddab2d84c6a6b2216d6c (patch) | |
tree | db983f5c371bd7f3c5190dcd6f6f3171947ad105 /plugins | |
parent | 8271ae317370f9c27de576075a2d779ccaf9a560 (diff) |
StdMsg & Scriver:
- switched to the toolbar buttons instead of the fixed button set;
- switched to the shared windows list
Diffstat (limited to 'plugins')
28 files changed, 453 insertions, 676 deletions
diff --git a/plugins/ExternalAPI/delphi/m_msg_buttonsbar.inc b/plugins/ExternalAPI/delphi/m_msg_buttonsbar.inc index 2db75cc7e5..593773019a 100644 --- a/plugins/ExternalAPI/delphi/m_msg_buttonsbar.inc +++ b/plugins/ExternalAPI/delphi/m_msg_buttonsbar.inc @@ -62,7 +62,6 @@ type szTooltip :PWideChar; // button's tooltip
dwDefPos :dword; // default order pos of button, counted from window edge (left or right)
// use value >100, because internal buttons using 10,20,30... 80, etc
- iButtonWidth :int; // must be 0
bbbFlags :dword; // combine of BBBF_ flags above
hIcon :HICON; // Handle to icolib registered icon, it's better to register with pszSection = "TabSRMM/Toolbar"
end;
diff --git a/plugins/Scriver/res/resource.rc b/plugins/Scriver/res/resource.rc index 6d0b45a9f1..59e03ef0ee 100644 --- a/plugins/Scriver/res/resource.rc +++ b/plugins/Scriver/res/resource.rc @@ -204,13 +204,7 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN
CONTROL "",IDC_LOG,"RichEdit50W",WS_CLIPSIBLINGS | WS_VSCROLL | WS_TABSTOP | 0x844,1,41,181,28,WS_EX_STATICEDGE
CONTROL "",IDC_MESSAGE,"RichEdit50W",WS_VSCROLL | WS_TABSTOP | 0x1144,0,87,181,13,WS_EX_ACCEPTFILES | WS_EX_STATICEDGE
- CONTROL "&User menu",IDC_USERMENU,"MButtonClass",0x0,1,71,16,14,WS_EX_NOACTIVATE | 0x10000000L
- CONTROL "User &details",IDC_DETAILS,"MButtonClass",0x0,17,71,16,14,WS_EX_NOACTIVATE | 0x10000000L
- CONTROL "&Add",IDC_ADD,"MButtonClass",0x0,110,71,16,14,WS_EX_NOACTIVATE | 0x10000000L
- CONTROL "&History",IDC_HISTORY,"MButtonClass",0x0,130,71,16,14,WS_EX_NOACTIVATE | 0x10000000L
- CONTROL "&Quote",IDC_QUOTE,"MButtonClass",0x0,130,71,16,14,WS_EX_NOACTIVATE | 0x10000000L
- CONTROL "&OK",IDOK,"MButtonClass",0x0,162,71,20,14,WS_EX_NOACTIVATE | 0x10000000L
- CONTROL "",IDC_SPLITTER,"Static",SS_ENHMETAFILE | WS_CLIPSIBLINGS,0,85,183,2
+ CONTROL "",IDC_SPLITTERY,"Static",SS_ENHMETAFILE | WS_CLIPSIBLINGS,0,85,183,2
CONTROL "",IDC_AVATAR,"Static",SS_OWNERDRAW,180,80,0,0
END
@@ -232,20 +226,9 @@ STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
CONTROL "",IDC_CHAT_MESSAGE,"RichEdit50W",WS_VSCROLL | WS_TABSTOP | 0x1144,0,128,127,12,WS_EX_STATICEDGE
- CONTROL "&Bold",IDC_CHAT_BOLD,"MButtonClass",WS_DISABLED | WS_TABSTOP,24,108,15,13,WS_EX_NOACTIVATE | 0x10000000L
- CONTROL "&Italic",IDC_CHAT_ITALICS,"MButtonClass",WS_DISABLED | WS_TABSTOP,36,108,15,13,WS_EX_NOACTIVATE | 0x10000000L
- CONTROL "&Underline",IDC_CHAT_UNDERLINE,"MButtonClass",WS_DISABLED | WS_TABSTOP,52,108,15,13,WS_EX_NOACTIVATE | 0x10000000L
- CONTROL "&Color",IDC_CHAT_COLOR,"MButtonClass",WS_DISABLED | WS_TABSTOP,80,108,15,13,WS_EX_NOACTIVATE | 0x10000000L
- CONTROL "&Background color",IDC_CHAT_BKGCOLOR,"MButtonClass",WS_DISABLED | WS_TABSTOP,96,108,15,13,WS_EX_NOACTIVATE | 0x10000000L
- CONTROL "&History",IDC_CHAT_HISTORY,"MButtonClass",WS_TABSTOP,188,108,15,13,WS_EX_NOACTIVATE | 0x10000000L
- CONTROL "&OK",IDOK,"MButtonClass",0x0,162,71,20,14,WS_EX_NOACTIVATE | 0x10000000L
- CONTROL "&Filter",IDC_CHAT_FILTER,"MButtonClass",WS_TABSTOP,220,108,15,13,WS_EX_NOACTIVATE | 0x10000000L
- CONTROL "&Room settings",IDC_CHAT_CHANMGR,"MButtonClass",WS_DISABLED | WS_TABSTOP,204,108,15,13,WS_EX_NOACTIVATE | 0x10000000L
- CONTROL "&Show/hide nick list",IDC_CHAT_SHOWNICKLIST,
- "MButtonClass",WS_TABSTOP,236,108,15,13,WS_EX_NOACTIVATE | 0x10000000L
CONTROL "",IDC_CHAT_LOG,"RichEdit50W",WS_VSCROLL | WS_TABSTOP | 0x844,8,23,164,73,WS_EX_STATICEDGE
- CONTROL "",IDC_CHAT_SPLITTERX,"Static",SS_ENHMETAFILE,172,23,10,73
- CONTROL "",IDC_CHAT_SPLITTERY,"Static",SS_ENHMETAFILE,0,102,251,6
+ CONTROL "",IDC_SPLITTERX,"Static",SS_ENHMETAFILE,172,23,10,73
+ CONTROL "",IDC_SPLITTERY,"Static",SS_ENHMETAFILE,0,102,251,6
LISTBOX IDC_CHAT_LIST,182,23,69,73,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | NOT WS_BORDER | WS_VSCROLL | WS_TABSTOP,WS_EX_STATICEDGE
END
diff --git a/plugins/Scriver/src/chat/chat.h b/plugins/Scriver/src/chat/chat.h index e1d2c3a693..adb495934c 100644 --- a/plugins/Scriver/src/chat/chat.h +++ b/plugins/Scriver/src/chat/chat.h @@ -81,9 +81,6 @@ void FreeMsgLogBitmaps(void); // window.c
int GetTextPixelSize( wchar_t* pszText, HFONT hFont, BOOL bWidth);
-// options.c
-int OptionsInit(void);
-
// services.c
void ShowRoom(SESSION_INFO *si, WPARAM wp, BOOL bSetForeground);
diff --git a/plugins/Scriver/src/chat/main.cpp b/plugins/Scriver/src/chat/main.cpp index 06b0235d2b..b0379b0743 100644 --- a/plugins/Scriver/src/chat/main.cpp +++ b/plugins/Scriver/src/chat/main.cpp @@ -193,9 +193,3 @@ int Chat_Unload(void) DestroyMenu(g_hMenu);
return 0;
}
-
-int Chat_ModulesLoaded(WPARAM, LPARAM)
-{
- OptionsInit();
- return 0;
-}
diff --git a/plugins/Scriver/src/chat/options.cpp b/plugins/Scriver/src/chat/options.cpp index 3108e26592..a9b59f3005 100644 --- a/plugins/Scriver/src/chat/options.cpp +++ b/plugins/Scriver/src/chat/options.cpp @@ -50,8 +50,8 @@ static struct branch_t branch1[] = { static struct branch_t branch2[] = {
{ LPGENW("Show icons"), "IconFlags", GC_EVENT_TOPIC | GC_EVENT_JOIN | GC_EVENT_QUIT |
- GC_EVENT_MESSAGE | GC_EVENT_ACTION | GC_EVENT_HIGHLIGHT | GC_EVENT_PART |
- GC_EVENT_KICK | GC_EVENT_NOTICE | GC_EVENT_NICK | GC_EVENT_INFORMATION | GC_EVENT_ADDSTATUS, 0, NULL },
+ GC_EVENT_MESSAGE | GC_EVENT_ACTION | GC_EVENT_HIGHLIGHT | GC_EVENT_PART |
+ GC_EVENT_KICK | GC_EVENT_NOTICE | GC_EVENT_NICK | GC_EVENT_INFORMATION | GC_EVENT_ADDSTATUS, 0, NULL },
{ LPGENW("Prefix all events with a timestamp"), "ShowTimeStamp", 0, 1, NULL },
{ LPGENW("Only prefix with timestamp if it has changed"), "ShowTimeStampIfChanged", 0, 0, NULL },
{ LPGENW("Timestamp has same color as event"), "TimeStampEventColour", 0, 0, NULL },
@@ -225,7 +225,7 @@ static INT CALLBACK BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lp, LPARAM p static void InitSetting(wchar_t **ppPointer, char *pszSetting, wchar_t *pszDefault)
{
DBVARIANT dbv;
- if ( !db_get_ws(NULL, CHAT_MODULE, pszSetting, &dbv )) {
+ if (!db_get_ws(NULL, CHAT_MODULE, pszSetting, &dbv)) {
replaceStrW(*ppPointer, dbv.ptszVal);
db_free(&dbv);
}
@@ -234,18 +234,18 @@ static void InitSetting(wchar_t **ppPointer, char *pszSetting, wchar_t *pszDefau #define OPT_FIXHEADINGS (WM_USER+1)
-INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam)
+INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
static HTREEITEM hListHeading1 = 0;
- static HTREEITEM hListHeading4= 0;
+ static HTREEITEM hListHeading4 = 0;
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);
- SendDlgItemMessage(hwndDlg,IDC_CHAT_SPIN2,UDM_SETRANGE,0,MAKELONG(255,10));
- SendDlgItemMessage(hwndDlg,IDC_CHAT_SPIN2,UDM_SETPOS,0,MAKELONG(db_get_b(NULL,CHAT_MODULE,"NicklistRowDist",12),0));
- hListHeading1 = InsertBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), TranslateT("Appearance and functionality of chat windows"), db_get_b(NULL, CHAT_MODULE, "Branch1Exp", 0)?TRUE:FALSE);
- hListHeading4 = InsertBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), TranslateT("Icons to display in the tray"), db_get_b(NULL, CHAT_MODULE, "Branch5Exp", 0)?TRUE:FALSE);
+ 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(255, 10));
+ SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN2, UDM_SETPOS, 0, MAKELONG(db_get_b(NULL, CHAT_MODULE, "NicklistRowDist", 12), 0));
+ hListHeading1 = InsertBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), TranslateT("Appearance and functionality of chat windows"), db_get_b(NULL, CHAT_MODULE, "Branch1Exp", 0) ? TRUE : FALSE);
+ hListHeading4 = InsertBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), TranslateT("Icons to display in the tray"), db_get_b(NULL, CHAT_MODULE, "Branch5Exp", 0) ? TRUE : FALSE);
FillBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), hListHeading1, branch1, _countof(branch1), 0);
FillBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), hListHeading4, branch4, _countof(branch4), 0x1000);
SendMessage(hwndDlg, OPT_FIXHEADINGS, 0, 0);
@@ -263,7 +263,7 @@ 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()))
+ if ((LOWORD(wParam) == IDC_CHAT_NICKROW || LOWORD(wParam) == IDC_CHAT_GROUP) && (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()))
return 0;
if (lParam != 0)
@@ -272,10 +272,10 @@ INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa case UM_CHECKSTATECHANGE:
{
- TVITEM tvi = {0};
- tvi.mask=TVIF_HANDLE|TVIF_STATE;
- tvi.hItem=(HTREEITEM) lParam;
- TreeView_GetItem((HWND)wParam,&tvi);
+ TVITEM tvi = { 0 };
+ tvi.mask = TVIF_HANDLE | TVIF_STATE;
+ tvi.hItem = (HTREEITEM)lParam;
+ TreeView_GetItem((HWND)wParam, &tvi);
if (tvi.hItem == hListHeading1)
CheckBranches(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), hListHeading1);
else if (tvi.hItem == hListHeading4)
@@ -287,23 +287,23 @@ INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa break;
case WM_NOTIFY:
- switch(((LPNMHDR)lParam)->idFrom) {
+ switch (((LPNMHDR)lParam)->idFrom) {
case IDC_CHAT_CHECKBOXES:
- if (((LPNMHDR)lParam)->code==NM_CLICK) {
+ 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))
+ 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)
+ if (((LPNMTVKEYDOWN)lParam)->wVKey == VK_SPACE)
SendMessage(hwndDlg, UM_CHECKSTATECHANGE, (WPARAM)((LPNMHDR)lParam)->hwndFrom,
- (LPARAM)TreeView_GetSelection(((LPNMHDR)lParam)->hwndFrom));
+ (LPARAM)TreeView_GetSelection(((LPNMHDR)lParam)->hwndFrom));
}
break;
@@ -334,34 +334,34 @@ INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa break;
case WM_DESTROY:
- BYTE b = TreeView_GetItemState(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), hListHeading1, TVIS_EXPANDED)&TVIS_EXPANDED?1:0;
+ BYTE b = TreeView_GetItemState(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), hListHeading1, TVIS_EXPANDED)&TVIS_EXPANDED ? 1 : 0;
db_set_b(NULL, CHAT_MODULE, "Branch1Exp", b);
- b = TreeView_GetItemState(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), hListHeading4, TVIS_EXPANDED)&TVIS_EXPANDED?1:0;
+ b = TreeView_GetItemState(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), hListHeading4, TVIS_EXPANDED)&TVIS_EXPANDED ? 1 : 0;
db_set_b(NULL, CHAT_MODULE, "Branch5Exp", b);
break;
}
return FALSE;
}
-INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam)
+INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
- static HTREEITEM hListHeading2= 0;
- static HTREEITEM hListHeading3= 0;
+ static HTREEITEM hListHeading2 = 0;
+ static HTREEITEM hListHeading3 = 0;
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);
- SendDlgItemMessage(hwndDlg,IDC_CHAT_SPIN2,UDM_SETRANGE,0,MAKELONG(5000,0));
- SendDlgItemMessage(hwndDlg,IDC_CHAT_SPIN2,UDM_SETPOS,0,MAKELONG(db_get_w(NULL,CHAT_MODULE,"LogLimit",100),0));
- SendDlgItemMessage(hwndDlg,IDC_CHAT_SPIN3,UDM_SETRANGE,0,MAKELONG(10000,0));
- SendDlgItemMessage(hwndDlg,IDC_CHAT_SPIN3,UDM_SETPOS,0,MAKELONG(db_get_w(NULL,CHAT_MODULE,"LoggingLimit",100),0));
+ 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(db_get_w(NULL, CHAT_MODULE, "LogLimit", 100), 0));
+ SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN3, UDM_SETRANGE, 0, MAKELONG(10000, 0));
+ SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN3, UDM_SETPOS, 0, MAKELONG(db_get_w(NULL, CHAT_MODULE, "LoggingLimit", 100), 0));
{
wchar_t tszTemp[MAX_PATH];
PathToRelativeW(g_Settings.pszLogDir, tszTemp);
SetDlgItemText(hwndDlg, IDC_CHAT_LOGDIRECTORY, tszTemp);
}
-
+
wchar_t tszTooltipText[2048];
RECT rect;
@@ -427,22 +427,22 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa break;
case WM_COMMAND:
- if ( (LOWORD(wParam) == IDC_CHAT_INSTAMP
- || LOWORD(wParam) == IDC_CHAT_OUTSTAMP
- || LOWORD(wParam) == IDC_CHAT_TIMESTAMP
- || LOWORD(wParam) == IDC_CHAT_LOGLIMIT
- || LOWORD(wParam) == IDC_CHAT_HIGHLIGHTWORDS
- || LOWORD(wParam) == IDC_CHAT_LOGDIRECTORY
- || LOWORD(wParam) == IDC_CHAT_LOGTIMESTAMP
- || LOWORD(wParam) == IDC_CHAT_LIMIT)
- && (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus())) return 0;
+ if ((LOWORD(wParam) == IDC_CHAT_INSTAMP
+ || LOWORD(wParam) == IDC_CHAT_OUTSTAMP
+ || LOWORD(wParam) == IDC_CHAT_TIMESTAMP
+ || LOWORD(wParam) == IDC_CHAT_LOGLIMIT
+ || LOWORD(wParam) == IDC_CHAT_HIGHLIGHTWORDS
+ || LOWORD(wParam) == IDC_CHAT_LOGDIRECTORY
+ || LOWORD(wParam) == IDC_CHAT_LOGTIMESTAMP
+ || LOWORD(wParam) == IDC_CHAT_LIMIT)
+ && (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus())) return 0;
switch (LOWORD(wParam)) {
case IDC_CHAT_LOGGING:
- EnableWindow(GetDlgItem(hwndDlg, IDC_CHAT_LOGDIRECTORY), IsDlgButtonChecked(hwndDlg, IDC_CHAT_LOGGING) == BST_CHECKED?TRUE:FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_CHAT_LOGDIRCHOOSE), IsDlgButtonChecked(hwndDlg, IDC_CHAT_LOGGING) == BST_CHECKED?TRUE:FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_CHAT_LIMIT), IsDlgButtonChecked(hwndDlg, IDC_CHAT_LOGGING) == BST_CHECKED?TRUE:FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_CHAT_LIMITTEXT2), IsDlgButtonChecked(hwndDlg, IDC_CHAT_LOGGING) == BST_CHECKED?TRUE:FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHAT_LOGDIRECTORY), IsDlgButtonChecked(hwndDlg, IDC_CHAT_LOGGING) == BST_CHECKED ? TRUE : FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHAT_LOGDIRCHOOSE), IsDlgButtonChecked(hwndDlg, IDC_CHAT_LOGGING) == BST_CHECKED ? TRUE : FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHAT_LIMIT), IsDlgButtonChecked(hwndDlg, IDC_CHAT_LOGGING) == BST_CHECKED ? TRUE : FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHAT_LIMITTEXT2), IsDlgButtonChecked(hwndDlg, IDC_CHAT_LOGGING) == BST_CHECKED ? TRUE : FALSE);
break;
case IDC_CHAT_HIGHLIGHT:
@@ -480,10 +480,10 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa case UM_CHECKSTATECHANGE:
{
- TVITEM tvi = {0};
- tvi.mask=TVIF_HANDLE|TVIF_STATE;
- tvi.hItem=(HTREEITEM) lParam;
- TreeView_GetItem((HWND)wParam,&tvi);
+ TVITEM tvi = { 0 };
+ tvi.mask = TVIF_HANDLE | TVIF_STATE;
+ tvi.hItem = (HTREEITEM)lParam;
+ TreeView_GetItem((HWND)wParam, &tvi);
if (tvi.hItem == hListHeading2)
CheckBranches(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), hListHeading2);
else if (tvi.hItem == hListHeading3)
@@ -496,18 +496,18 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa case WM_NOTIFY:
if (((LPNMHDR)lParam)->idFrom == IDC_CHAT_CHECKBOXES) {
- if (((LPNMHDR)lParam)->code==NM_CLICK) {
+ 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))
+ 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) {
+ 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));
}
@@ -537,7 +537,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_CHAT_LOGDIRECTORY));
if (iLen > 0) {
- wchar_t *pszText1 = (wchar_t*)malloc(iLen*sizeof(wchar_t)+2);
+ wchar_t *pszText1 = (wchar_t*)malloc(iLen*sizeof(wchar_t) + 2);
GetDlgItemText(hwndDlg, IDC_CHAT_LOGDIRECTORY, pszText1, iLen + 1);
db_set_ws(NULL, CHAT_MODULE, "LogDirectory", pszText1);
free(pszText1);
@@ -623,16 +623,16 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa hPathTip = 0;
}
- BYTE b = TreeView_GetItemState(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), hListHeading2, TVIS_EXPANDED)&TVIS_EXPANDED?1:0;
+ BYTE b = TreeView_GetItemState(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), hListHeading2, TVIS_EXPANDED)&TVIS_EXPANDED ? 1 : 0;
db_set_b(NULL, CHAT_MODULE, "Branch2Exp", b);
- b = TreeView_GetItemState(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), hListHeading3, TVIS_EXPANDED)&TVIS_EXPANDED?1:0;
+ b = TreeView_GetItemState(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), hListHeading3, TVIS_EXPANDED)&TVIS_EXPANDED ? 1 : 0;
db_set_b(NULL, CHAT_MODULE, "Branch3Exp", b);
break;
}
return FALSE;
}
-static INT_PTR CALLBACK DlgProcOptionsPopup(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam)
+INT_PTR CALLBACK DlgProcOptionsPopup(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg) {
case WM_INITDIALOG:
@@ -688,7 +688,7 @@ static INT_PTR CALLBACK DlgProcOptionsPopup(HWND hwndDlg,UINT uMsg,WPARAM wParam 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));
+ (LPARAM)TreeView_GetSelection(((LPNMHDR)lParam)->hwndFrom));
}
break;
@@ -727,26 +727,3 @@ static INT_PTR CALLBACK DlgProcOptionsPopup(HWND hwndDlg,UINT uMsg,WPARAM wParam }
return FALSE;
}
-
-static int OptionsInitialize(WPARAM wParam, LPARAM)
-{
- if (g_dat.popupInstalled) {
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.position = 910000002;
- odp.hInstance = g_hInst;
- odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONSPOPUP);
- odp.szTitle.a = LPGEN("Messaging");
- odp.szGroup.a = LPGEN("Popups");
- odp.pfnDlgProc = DlgProcOptionsPopup;
- odp.flags = ODPF_BOLDGROUPS;
- Options_AddPage(wParam, &odp);
- }
-
- return 0;
-}
-
-int OptionsInit(void)
-{
- HookEvent(ME_OPT_INITIALISE, OptionsInitialize);
- return 0;
-}
diff --git a/plugins/Scriver/src/chat/window.cpp b/plugins/Scriver/src/chat/window.cpp index c895b9e179..81e1b92c12 100644 --- a/plugins/Scriver/src/chat/window.cpp +++ b/plugins/Scriver/src/chat/window.cpp @@ -21,19 +21,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "../stdafx.h"
-static ToolbarButton toolbarButtons[] = {
- { LPGENW("Bold"), IDC_CHAT_BOLD, 0, 4, 24 },
- { LPGENW("Italic"), IDC_CHAT_ITALICS, 0, 0, 24 },
- { LPGENW("Underline"), IDC_CHAT_UNDERLINE, 0, 0, 24 },
- { LPGENW("Text color"), IDC_CHAT_COLOR, 0, 0, 24 },
- { LPGENW("Background color"), IDC_CHAT_BKGCOLOR, 0, 0, 24 },
- { LPGENW("History"), IDC_CHAT_HISTORY, 1, 0, 24 },
- { LPGENW("Filter"), IDC_CHAT_FILTER, 1, 0, 24 },
- { LPGENW("Manager"), IDC_CHAT_CHANMGR, 1, 0, 24 },
- { LPGENW("Nick list"), IDC_CHAT_SHOWNICKLIST, 1, 0, 24 },
- { LPGENW("Send"), IDOK, 1, 0, 38 },
-};
-
struct MESSAGESUBDATA
{
time_t lastEnterTime;
@@ -76,44 +63,8 @@ static LRESULT CALLBACK SplitterSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, static void InitButtons(HWND hwndDlg, SESSION_INFO *si)
{
- SendDlgItemMessage(hwndDlg, IDC_CHAT_BOLD, BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetCachedIcon("chat_bold"));
- SendDlgItemMessage(hwndDlg, IDC_CHAT_ITALICS, BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetCachedIcon("chat_italics"));
- SendDlgItemMessage(hwndDlg, IDC_CHAT_UNDERLINE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetCachedIcon("chat_underline"));
- SendDlgItemMessage(hwndDlg, IDC_CHAT_COLOR, BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetCachedIcon("chat_fgcol"));
- SendDlgItemMessage(hwndDlg, IDC_CHAT_BKGCOLOR, BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetCachedIcon("chat_bkgcol"));
- SendDlgItemMessage(hwndDlg, IDC_CHAT_HISTORY, BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetCachedIcon("chat_history"));
- SendDlgItemMessage(hwndDlg, IDC_CHAT_CHANMGR, BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetCachedIcon("chat_settings"));
SendDlgItemMessage(hwndDlg, IDC_CHAT_SHOWNICKLIST, BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetCachedIcon(si->bNicklistEnabled ? "chat_nicklist" : "chat_nicklist2"));
SendDlgItemMessage(hwndDlg, IDC_CHAT_FILTER, BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetCachedIcon(si->bFilterEnabled ? "chat_filter" : "chat_filter2"));
- SendDlgItemMessage(hwndDlg, IDOK, BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetCachedIcon("scriver_SEND"));
-
- SendDlgItemMessage(hwndDlg, IDC_CHAT_BOLD, BUTTONSETASFLATBTN, TRUE, 0);
- SendDlgItemMessage(hwndDlg, IDC_CHAT_ITALICS, BUTTONSETASFLATBTN, TRUE, 0);
- SendDlgItemMessage(hwndDlg, IDC_CHAT_UNDERLINE, BUTTONSETASFLATBTN, TRUE, 0);
- SendDlgItemMessage(hwndDlg, IDC_CHAT_BKGCOLOR, BUTTONSETASFLATBTN, TRUE, 0);
- SendDlgItemMessage(hwndDlg, IDC_CHAT_COLOR, BUTTONSETASFLATBTN, TRUE, 0);
- SendDlgItemMessage(hwndDlg, IDC_CHAT_HISTORY, BUTTONSETASFLATBTN, TRUE, 0);
- SendDlgItemMessage(hwndDlg, IDC_CHAT_SHOWNICKLIST, BUTTONSETASFLATBTN, TRUE, 0);
- SendDlgItemMessage(hwndDlg, IDC_CHAT_CHANMGR, BUTTONSETASFLATBTN, TRUE, 0);
- SendDlgItemMessage(hwndDlg, IDC_CHAT_FILTER, BUTTONSETASFLATBTN, TRUE, 0);
- SendDlgItemMessage(hwndDlg, IDOK, BUTTONSETASFLATBTN, TRUE, 0);
-
- SendDlgItemMessage(hwndDlg, IDC_CHAT_BOLD, BUTTONADDTOOLTIP, (WPARAM)LPGEN("Make the text bold (CTRL+B)"), 0);
- SendDlgItemMessage(hwndDlg, IDC_CHAT_ITALICS, BUTTONADDTOOLTIP, (WPARAM)LPGEN("Make the text italicized (CTRL+I)"), 0);
- SendDlgItemMessage(hwndDlg, IDC_CHAT_UNDERLINE, BUTTONADDTOOLTIP, (WPARAM)LPGEN("Make the text underlined (CTRL+U)"), 0);
- SendDlgItemMessage(hwndDlg, IDC_CHAT_BKGCOLOR, BUTTONADDTOOLTIP, (WPARAM)LPGEN("Select a background color for the text (CTRL+L)"), 0);
- SendDlgItemMessage(hwndDlg, IDC_CHAT_COLOR, BUTTONADDTOOLTIP, (WPARAM)LPGEN("Select a foreground color for the text (CTRL+K)"), 0);
- SendDlgItemMessage(hwndDlg, IDC_CHAT_HISTORY, BUTTONADDTOOLTIP, (WPARAM)LPGEN("Show the history (CTRL+H)"), 0);
- SendDlgItemMessage(hwndDlg, IDC_CHAT_SHOWNICKLIST, BUTTONADDTOOLTIP, (WPARAM)LPGEN("Show/hide the nick list (CTRL+N)"), 0);
- SendDlgItemMessage(hwndDlg, IDC_CHAT_CHANMGR, BUTTONADDTOOLTIP, (WPARAM)LPGEN("Control this room (CTRL+O)"), 0);
- SendDlgItemMessage(hwndDlg, IDC_CHAT_FILTER, BUTTONADDTOOLTIP, (WPARAM)LPGEN("Enable/disable the event filter (CTRL+F)"), 0);
- SendDlgItemMessage(hwndDlg, IDOK, BUTTONADDTOOLTIP, (WPARAM)LPGEN("Send message"), 0);
-
- SendDlgItemMessage(hwndDlg, IDC_CHAT_BOLD, BUTTONSETASPUSHBTN, TRUE, 0);
- SendDlgItemMessage(hwndDlg, IDC_CHAT_ITALICS, BUTTONSETASPUSHBTN, TRUE, 0);
- SendDlgItemMessage(hwndDlg, IDC_CHAT_UNDERLINE, BUTTONSETASPUSHBTN, TRUE, 0);
- SendDlgItemMessage(hwndDlg, IDC_CHAT_COLOR, BUTTONSETASPUSHBTN, TRUE, 0);
- SendDlgItemMessage(hwndDlg, IDC_CHAT_BKGCOLOR, BUTTONSETASPUSHBTN, TRUE, 0);
MODULEINFO *pInfo = pci->MM_FindModule(si->pszModule);
if (pInfo) {
@@ -132,9 +83,8 @@ static void MessageDialogResize(HWND hwndDlg, SESSION_INFO *si, int w, int h) int logBottom, toolbarTopY;
BOOL bNick = si->iType != GCW_SERVER && si->bNicklistEnabled;
BOOL bToolbar = SendMessage(GetParent(hwndDlg), CM_GETTOOLBARSTATUS, 0, 0);
- int buttonVisibility = bToolbar ? g_dat.chatBbuttonVisibility : 0;
int hSplitterMinTop = TOOLBAR_HEIGHT + si->minLogBoxHeight, hSplitterMinBottom = si->minEditBoxHeight;
- int toolbarHeight = bToolbar ? IsToolbarVisible(_countof(toolbarButtons), g_dat.chatBbuttonVisibility) ? TOOLBAR_HEIGHT : TOOLBAR_HEIGHT / 3 : 0;
+ int toolbarHeight = TOOLBAR_HEIGHT;
si->iSplitterY = si->desiredInputAreaHeight + SPLITTER_HEIGHT + 3;
@@ -143,8 +93,7 @@ static void MessageDialogResize(HWND hwndDlg, SESSION_INFO *si, int w, int h) if (si->iSplitterY < hSplitterMinBottom)
si->iSplitterY = hSplitterMinBottom;
- ShowToolbarControls(hwndDlg, _countof(toolbarButtons), toolbarButtons, buttonVisibility, SW_SHOW);
- ShowWindow(GetDlgItem(hwndDlg, IDC_CHAT_SPLITTERX), bNick ? SW_SHOW : SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg, IDC_SPLITTERX), bNick ? SW_SHOW : SW_HIDE);
if (si->iType != GCW_SERVER)
ShowWindow(GetDlgItem(hwndDlg, IDC_CHAT_LIST), si->bNicklistEnabled ? SW_SHOW : SW_HIDE);
else
@@ -162,7 +111,7 @@ static void MessageDialogResize(HWND hwndDlg, SESSION_INFO *si, int w, int h) EnableWindow(GetDlgItem(hwndDlg, IDC_CHAT_CHANMGR), pci->MM_FindModule(si->pszModule)->bChanMgr);
}
- HDWP hdwp = BeginDeferWindowPos(20);
+ HDWP hdwp = BeginDeferWindowPos(5);
toolbarTopY = bToolbar ? h - si->iSplitterY - toolbarHeight : h - si->iSplitterY;
if (si->hwndLog != NULL)
logBottom = toolbarTopY / 2;
@@ -171,11 +120,13 @@ static void MessageDialogResize(HWND hwndDlg, SESSION_INFO *si, int w, int h) hdwp = DeferWindowPos(hdwp, GetDlgItem(hwndDlg, IDC_CHAT_LOG), 0, 1, 0, bNick ? w - si->iSplitterX - 1 : w - 2, logBottom, SWP_NOZORDER);
hdwp = DeferWindowPos(hdwp, GetDlgItem(hwndDlg, IDC_CHAT_LIST), 0, w - si->iSplitterX + 2, 0, si->iSplitterX - 3, toolbarTopY, SWP_NOZORDER);
- hdwp = DeferWindowPos(hdwp, GetDlgItem(hwndDlg, IDC_CHAT_SPLITTERX), 0, w - si->iSplitterX, 1, 2, toolbarTopY - 1, SWP_NOZORDER);
- hdwp = DeferWindowPos(hdwp, GetDlgItem(hwndDlg, IDC_CHAT_SPLITTERY), 0, 0, h - si->iSplitterY, w, SPLITTER_HEIGHT, SWP_NOZORDER);
+ hdwp = DeferWindowPos(hdwp, GetDlgItem(hwndDlg, IDC_SPLITTERX), 0, w - si->iSplitterX, 1, 2, toolbarTopY - 1, SWP_NOZORDER);
+ hdwp = DeferWindowPos(hdwp, GetDlgItem(hwndDlg, IDC_SPLITTERY), 0, 0, h - si->iSplitterY, w, SPLITTER_HEIGHT, SWP_NOZORDER);
hdwp = DeferWindowPos(hdwp, GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE), 0, 1, h - si->iSplitterY + SPLITTER_HEIGHT, w - 2, si->iSplitterY - SPLITTER_HEIGHT - 1, SWP_NOZORDER);
- hdwp = ResizeToolbar(hwndDlg, hdwp, w, toolbarTopY + 1, toolbarHeight - 1, _countof(toolbarButtons), toolbarButtons, buttonVisibility);
EndDeferWindowPos(hdwp);
+
+ SetButtonsPos(hwndDlg);
+
if (si->hwndLog != NULL) {
IEVIEWWINDOW ieWindow;
ieWindow.cbSize = sizeof(IEVIEWWINDOW);
@@ -986,7 +937,7 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR RichUtil_SubClass(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE));
RichUtil_SubClass(GetDlgItem(hwndDlg, IDC_CHAT_LOG));
RichUtil_SubClass(GetDlgItem(hwndDlg, IDC_CHAT_LIST));
- mir_subclassWindow(GetDlgItem(hwndDlg, IDC_CHAT_SPLITTERX), SplitterSubclassProc);
+ mir_subclassWindow(GetDlgItem(hwndDlg, IDC_SPLITTERX), SplitterSubclassProc);
mir_subclassWindow(GetDlgItem(hwndDlg, IDC_CHAT_LIST), NicklistSubclassProc);
mir_subclassWindow(GetDlgItem(hwndDlg, IDC_CHAT_LOG), LogSubclassProc);
mir_subclassWindow(GetDlgItem(hwndDlg, IDC_CHAT_FILTER), ButtonSubclassProc);
@@ -994,6 +945,20 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR mir_subclassWindow(GetDlgItem(hwndDlg, IDC_CHAT_BKGCOLOR), ButtonSubclassProc);
mir_subclassWindow(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE), MessageSubclassProc);
+ CustomButtonData *cbd;
+ for (int i = 0; cbd = Srmm_GetNthButton(i); i++) {
+ if (!cbd->m_bChatButton)
+ continue;
+
+ int width = (cbd->m_dwArrowCID) ? 34 : 22;
+ HWND hwndButton = CreateWindowEx(0, L"MButtonClass", L"", WS_CHILD | WS_VISIBLE | WS_TABSTOP, 0, 0, width, 22, hwndDlg, (HMENU)cbd->m_dwButtonCID, g_hInst, NULL);
+ SendMessage(hwndButton, BUTTONSETASFLATBTN, TRUE, 0);
+ if (cbd->m_pwszTooltip)
+ SendMessage(hwndButton, BUTTONADDTOOLTIP, LPARAM(cbd->m_pwszTooltip), BATF_UNICODE);
+ if (cbd->m_hIcon)
+ SendMessage(hwndButton, BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIconByHandle(cbd->m_hIcon));
+ }
+
RECT minEditInit;
GetWindowRect(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE), &minEditInit);
si->minEditBoxHeight = minEditInit.bottom - minEditInit.top;
@@ -1406,7 +1371,7 @@ LABEL_SHOWWINDOW: break;
case GC_SPLITTERMOVED:
- if ((HWND)lParam == GetDlgItem(hwndDlg, IDC_CHAT_SPLITTERX)) {
+ if ((HWND)lParam == GetDlgItem(hwndDlg, IDC_SPLITTERX)) {
GetClientRect(hwndDlg, &rc);
pt.x = wParam; pt.y = 0;
ScreenToClient(hwndDlg, &pt);
@@ -1418,7 +1383,7 @@ LABEL_SHOWWINDOW: si->iSplitterX = rc.right - rc.left - 35;
g_Settings.iSplitterX = si->iSplitterX;
}
- else if ((HWND)lParam == GetDlgItem(hwndDlg, IDC_CHAT_SPLITTERY)) {
+ else if ((HWND)lParam == GetDlgItem(hwndDlg, IDC_SPLITTERY)) {
GetClientRect(hwndDlg, &rc);
pt.x = 0; pt.y = wParam;
ScreenToClient(hwndDlg, &pt);
@@ -1807,34 +1772,6 @@ LABEL_SHOWWINDOW: SendMessage(GetParent(hwndDlg), WM_LBUTTONDOWN, wParam, lParam);
return TRUE;
- case WM_RBUTTONUP:
- hToolbarMenu = CreatePopupMenu();
- for (int i = 0; i < _countof(toolbarButtons); i++) {
- MENUITEMINFO mii = { 0 };
- mii.cbSize = sizeof(mii);
- mii.fMask = MIIM_ID | MIIM_STRING | MIIM_STATE | MIIM_DATA | MIIM_BITMAP;
- mii.fType = MFT_STRING;
- mii.fState = (g_dat.chatBbuttonVisibility & (1 << i)) ? MFS_CHECKED : MFS_UNCHECKED;
- mii.wID = i + 1;
- mii.dwItemData = (ULONG_PTR)g_dat.hChatButtonIconList;
- mii.hbmpItem = HBMMENU_CALLBACK;
- mii.dwTypeData = TranslateW((toolbarButtons[i].name));
- InsertMenuItem(hToolbarMenu, i, TRUE, &mii);
- }
-
- pt.x = (short)LOWORD(GetMessagePos());
- pt.y = (short)HIWORD(GetMessagePos());
- {
- int res = TrackPopupMenu(hToolbarMenu, TPM_RETURNCMD, pt.x, pt.y, 0, hwndDlg, NULL);
- if (res > 0) {
- g_dat.chatBbuttonVisibility ^= (1 << (res - 1));
- db_set_dw(NULL, SRMMMOD, SRMSGSET_CHATBUTTONVISIBILITY, g_dat.chatBbuttonVisibility);
- pci->SM_BroadcastMessage(NULL, GC_SETWNDPROPS, 0, 0, TRUE);
- }
- }
- DestroyMenu(hToolbarMenu);
- return TRUE;
-
case DM_GETCONTEXTMENU:
SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, (LPARAM)Menu_BuildContactMenu(si->hContact));
return TRUE;
diff --git a/plugins/Scriver/src/globals.cpp b/plugins/Scriver/src/globals.cpp index cf50d1ad42..ea52bcf287 100644 --- a/plugins/Scriver/src/globals.cpp +++ b/plugins/Scriver/src/globals.cpp @@ -25,8 +25,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. GlobalMessageData g_dat;
-int Chat_ModulesLoaded(WPARAM wParam,LPARAM lParam);
-
static const char *buttonIcons[] =
{
"scriver_CLOSEX", "scriver_QUOTE", "scriver_ADD", NULL,
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index 70156a8b2b..d2aa4d42f0 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -32,16 +32,6 @@ extern HANDLE hHookWinEvt; static void UpdateReadChars(HWND hwndDlg, SrmmWindowData * dat);
-static ToolbarButton toolbarButtons[] =
-{
- { LPGENW("Quote"), IDC_QUOTE, 0, 4, 24 },
- { LPGENW("Add contact"), IDC_ADD, 0, 10, 24 },
- { LPGENW("User menu"), IDC_USERMENU, 1, 0, 24 },
- { LPGENW("User details"), IDC_DETAILS, 1, 0, 24 },
- { LPGENW("History"), IDC_HISTORY, 1, 0, 24 },
- { LPGENW("Send"), IDOK, 1, 0, 38 }
-};
-
static wchar_t* GetIEViewSelection(SrmmWindowData *dat)
{
IEVIEWEVENT evt = { sizeof(evt) };
@@ -189,12 +179,20 @@ static void SetDialogToType(HWND hwndDlg) else
ShowWindow(dat->infobarData->hWnd, SW_HIDE);
- if (dat->hContact) {
- ShowToolbarControls(hwndDlg, _countof(toolbarButtons), toolbarButtons, g_dat.buttonVisibility, showToolbar ? SW_SHOW : SW_HIDE);
- if (!db_get_b(dat->hContact, "CList", "NotOnList", 0))
- ShowWindow(GetDlgItem(hwndDlg, IDC_ADD), SW_HIDE);
+ CustomButtonData *cbd;
+ for (int i = 0; cbd = Srmm_GetNthButton(i); i++) {
+ HWND hwndButton = GetDlgItem(hwndDlg, cbd->m_dwButtonCID);
+ if (hwndButton == NULL)
+ continue;
+
+ if (dat->hContact) {
+ if (cbd->m_dwButtonCID == IDC_ADD && !db_get_b(dat->hContact, "CList", "NotOnList", 0))
+ ShowWindow(hwndButton, SW_HIDE);
+ else
+ ShowWindow(hwndButton, showToolbar ? SW_SHOW : SW_HIDE);
+ }
+ else ShowWindow(hwndButton, SW_HIDE);
}
- else ShowToolbarControls(hwndDlg, _countof(toolbarButtons), toolbarButtons, g_dat.buttonVisibility, SW_HIDE);
ShowWindow(GetDlgItem(hwndDlg, IDC_MESSAGE), SW_SHOW);
if (dat->hwndLog != NULL)
@@ -202,7 +200,7 @@ static void SetDialogToType(HWND hwndDlg) else
ShowWindow(GetDlgItem(hwndDlg, IDC_LOG), SW_SHOW);
- ShowWindow(GetDlgItem(hwndDlg, IDC_SPLITTER), SW_SHOW);
+ ShowWindow(GetDlgItem(hwndDlg, IDC_SPLITTERY), SW_SHOW);
UpdateReadChars(hwndDlg, dat);
EnableWindow(GetDlgItem(hwndDlg, IDOK), GetRichTextLength(GetDlgItem(hwndDlg, IDC_MESSAGE), 1200, FALSE) ? TRUE : FALSE);
SendMessage(hwndDlg, DM_CLISTSETTINGSCHANGED, 0, 0);
@@ -453,7 +451,7 @@ static void SubclassLogEdit(HWND hwnd) static void MessageDialogResize(HWND hwndDlg, SrmmWindowData *dat, int w, int h)
{
ParentWindowData *pdat = dat->parent;
- int hSplitterPos = dat->splitterPos, toolbarHeight = (pdat->flags2 & SMF2_SHOWTOOLBAR) ? IsToolbarVisible(_countof(toolbarButtons), g_dat.buttonVisibility) ? dat->toolbarSize.cy : dat->toolbarSize.cy / 3 : 0;
+ int hSplitterPos = dat->splitterPos, toolbarHeight = dat->toolbarSize.cy;
int hSplitterMinTop = toolbarHeight + dat->minLogBoxHeight, hSplitterMinBottom = dat->minEditBoxHeight;
int infobarInnerHeight = INFO_BAR_INNER_HEIGHT;
int infobarHeight = INFO_BAR_HEIGHT;
@@ -484,7 +482,7 @@ static void MessageDialogResize(HWND hwndDlg, SrmmWindowData *dat, int w, int h) hSplitterPos = hSplitterMinBottom;
if (!(pdat->flags2 & SMF2_SHOWINFOBAR)) {
- if (dat->avatarPic && (g_dat.flags&SMF_AVATAR)) {
+ if (dat->avatarPic && (g_dat.flags & SMF_AVATAR)) {
avatarWidth = BOTTOM_RIGHT_AVATAR_HEIGHT;
avatarHeight = toolbarHeight + hSplitterPos - 2;
if (avatarHeight < BOTTOM_RIGHT_AVATAR_HEIGHT) {
@@ -510,17 +508,16 @@ static void MessageDialogResize(HWND hwndDlg, SrmmWindowData *dat, int w, int h) logY = infobarInnerHeight;
logH = h - hSplitterPos - toolbarHeight - infobarInnerHeight;
- HDWP hdwp = BeginDeferWindowPos(15);
- if (NULL != dat->infobarData->hWnd) /* Wine fix. */
- hdwp = DeferWindowPos(hdwp, dat->infobarData->hWnd, 0, 1, 0, w - 2, infobarInnerHeight - 2, SWP_NOZORDER);
+ HDWP hdwp = BeginDeferWindowPos(5);
+ hdwp = DeferWindowPos(hdwp, dat->infobarData->hWnd, 0, 1, 0, w - 2, infobarInnerHeight - 2, SWP_NOZORDER);
hdwp = DeferWindowPos(hdwp, GetDlgItem(hwndDlg, IDC_LOG), 0, 1, logY, w - 2, logH, SWP_NOZORDER);
hdwp = DeferWindowPos(hdwp, GetDlgItem(hwndDlg, IDC_MESSAGE), 0, 1, h - hSplitterPos + SPLITTER_HEIGHT, messageEditWidth, hSplitterPos - SPLITTER_HEIGHT - 1, SWP_NOZORDER);
hdwp = DeferWindowPos(hdwp, GetDlgItem(hwndDlg, IDC_AVATAR), 0, w - avatarWidth - 1, h - (avatarHeight + avatarWidth) / 2 - 1, avatarWidth, avatarWidth, SWP_NOZORDER);
-
- hdwp = DeferWindowPos(hdwp, GetDlgItem(hwndDlg, IDC_SPLITTER), 0, 0, h - hSplitterPos - 1, toolbarWidth, SPLITTER_HEIGHT, SWP_NOZORDER);
- hdwp = ResizeToolbar(hwndDlg, hdwp, toolbarWidth, h - hSplitterPos - toolbarHeight + 1, toolbarHeight, _countof(toolbarButtons), toolbarButtons, g_dat.buttonVisibility);
+ hdwp = DeferWindowPos(hdwp, GetDlgItem(hwndDlg, IDC_SPLITTERY), 0, 0, h - hSplitterPos - 1, toolbarWidth, SPLITTER_HEIGHT, SWP_NOZORDER);
EndDeferWindowPos(hdwp);
+ SetButtonsPos(hwndDlg);
+
if (dat->hwndLog != NULL) {
IEVIEWWINDOW ieWindow = { sizeof(ieWindow) };
ieWindow.iType = IEW_SETPOS;
@@ -664,8 +661,6 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP LPNMHDR pNmhdr;
HCURSOR hCur;
- static HMENU hToolbarMenu;
-
SrmmWindowData *dat = (SrmmWindowData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
if (!dat && msg != WM_INITDIALOG)
return FALSE;
@@ -748,7 +743,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP dat->minEditBoxHeight = minEditInit.bottom - minEditInit.top;
dat->minLogBoxHeight = dat->minEditBoxHeight;
dat->toolbarSize.cy = TOOLBAR_HEIGHT;
- dat->toolbarSize.cx = GetToolbarWidth(_countof(toolbarButtons), toolbarButtons);
+ dat->toolbarSize.cx = 0;
if (dat->splitterPos == -1)
dat->splitterPos = dat->minEditBoxHeight;
@@ -765,18 +760,19 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP PostMessage(GetDlgItem(hwndDlg, IDC_MESSAGE), EM_SETSEL, len, len);
}
- SendMessage(hwndDlg, DM_CHANGEICONS, 0, 0);
- // Make them flat buttons
- for (int i = 0; i < _countof(toolbarButtons); i++)
- SendDlgItemMessage(hwndDlg, toolbarButtons[i].controlId, BUTTONSETASFLATBTN, TRUE, 0);
-
- SendDlgItemMessage(hwndDlg, IDC_ADD, BUTTONADDTOOLTIP, (WPARAM)LPGEN("Add contact permanently to list"), 0);
- SendDlgItemMessage(hwndDlg, IDC_USERMENU, BUTTONADDTOOLTIP, (WPARAM)LPGEN("User menu"), 0);
- SendDlgItemMessage(hwndDlg, IDC_DETAILS, BUTTONADDTOOLTIP, (WPARAM)LPGEN("View user's details"), 0);
- SendDlgItemMessage(hwndDlg, IDC_HISTORY, BUTTONADDTOOLTIP, (WPARAM)LPGEN("View user's history"), 0);
-
- SendDlgItemMessage(hwndDlg, IDC_QUOTE, BUTTONADDTOOLTIP, (WPARAM)LPGEN("Quote text"), 0);
- SendDlgItemMessage(hwndDlg, IDOK, BUTTONADDTOOLTIP, (WPARAM)LPGEN("Send message"), 0);
+ CustomButtonData *cbd;
+ for (int i = 0; cbd = Srmm_GetNthButton(i); i++) {
+ if (!cbd->m_bIMButton)
+ continue;
+
+ int width = (cbd->m_dwArrowCID) ? 34 : 22;
+ HWND hwndButton = CreateWindowEx(0, L"MButtonClass", L"", WS_CHILD | WS_VISIBLE | WS_TABSTOP, 0, 0, width, 22, hwndDlg, (HMENU)cbd->m_dwButtonCID, g_hInst, NULL);
+ SendMessage(hwndButton, BUTTONSETASFLATBTN, TRUE, 0);
+ if (cbd->m_pwszTooltip)
+ SendMessage(hwndButton, BUTTONADDTOOLTIP, LPARAM(cbd->m_pwszTooltip), BATF_UNICODE);
+ if (cbd->m_hIcon)
+ SendMessage(hwndButton, BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIconByHandle(cbd->m_hIcon));
+ }
SendDlgItemMessage(hwndDlg, IDC_LOG, EM_SETOLECALLBACK, 0, (LPARAM)&reOleCallback);
SendDlgItemMessage(hwndDlg, IDC_LOG, EM_SETEVENTMASK, 0, ENM_MOUSEEVENTS | ENM_LINK | ENM_KEYEVENTS);
@@ -784,7 +780,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP SendDlgItemMessage(hwndDlg, IDC_LOG, EM_SETLANGOPTIONS, 0, (LPARAM)SendDlgItemMessage(hwndDlg, IDC_LOG, EM_GETLANGOPTIONS, 0, 0) & ~(IMF_AUTOKEYBOARD | IMF_AUTOFONTSIZEADJUST));
SendDlgItemMessage(hwndDlg, IDC_LOG, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(0, 0));
/* duh, how come we didnt use this from the start? */
- SendDlgItemMessage(hwndDlg, IDC_LOG, EM_AUTOURLDETECT, (WPARAM)TRUE, 0);
+ SendDlgItemMessage(hwndDlg, IDC_LOG, EM_AUTOURLDETECT, TRUE, 0);
SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_SETLANGOPTIONS, 0, (LPARAM)SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_GETLANGOPTIONS, 0, 0) & ~IMF_AUTOKEYBOARD);
SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_SETOLECALLBACK, 0, (LPARAM)&reOleCallback2);
@@ -920,32 +916,6 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP SendMessage(dat->hwndParent, WM_SYSCOMMAND, SC_MINIMIZE, 0);
break;
- case WM_RBUTTONUP:
- hToolbarMenu = CreatePopupMenu();
- for (int i = 0; i < _countof(toolbarButtons); i++) {
- MENUITEMINFO mii = { 0 };
- mii.cbSize = sizeof(mii);
- mii.fMask = MIIM_ID | MIIM_STRING | MIIM_STATE | MIIM_DATA | MIIM_BITMAP;
- mii.fType = MFT_STRING;
- mii.fState = (g_dat.buttonVisibility & (1 << i)) ? MFS_CHECKED : MFS_UNCHECKED;
- mii.wID = i + 1;
- mii.dwItemData = (ULONG_PTR)g_dat.hButtonIconList;
- mii.hbmpItem = HBMMENU_CALLBACK;
- mii.dwTypeData = TranslateW((toolbarButtons[i].name));
- InsertMenuItem(hToolbarMenu, i, TRUE, &mii);
- }
- {
- POINT pt = { (short)LOWORD(GetMessagePos()), (short)HIWORD(GetMessagePos()) };
- int i = TrackPopupMenu(hToolbarMenu, TPM_RETURNCMD, pt.x, pt.y, 0, hwndDlg, NULL);
- if (i > 0) {
- g_dat.buttonVisibility ^= (1 << (i - 1));
- db_set_dw(NULL, SRMMMOD, SRMSGSET_BUTTONVISIBILITY, g_dat.buttonVisibility);
- WindowList_Broadcast(g_dat.hMessageWindowList, DM_OPTIONSAPPLIED, 0, 0);
- }
- }
- DestroyMenu(hToolbarMenu);
- return TRUE;
-
case WM_DROPFILES:
if (dat->szProto == NULL) break;
if (!(CallProtoService(dat->szProto, PS_GETCAPS, PFLAGNUM_1, 0)&PF1_FILESEND)) break;
@@ -983,11 +953,6 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP break;
case DM_CHANGEICONS:
- SendDlgItemMessage(hwndDlg, IDC_ADD, BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetCachedIcon("scriver_ADD"));
- SendDlgItemMessage(hwndDlg, IDC_DETAILS, BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetCachedIcon("scriver_USERDETAILS"));
- SendDlgItemMessage(hwndDlg, IDC_HISTORY, BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetCachedIcon("scriver_HISTORY"));
- SendDlgItemMessage(hwndDlg, IDC_QUOTE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetCachedIcon("scriver_QUOTE"));
- SendDlgItemMessage(hwndDlg, IDOK, BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetCachedIcon("scriver_SEND"));
SendMessage(hwndDlg, DM_UPDATESTATUSBAR, 0, 0);
SetStatusIcon(dat);
@@ -1255,7 +1220,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP return TRUE;
case DM_SPLITTERMOVED:
- if ((HWND)lParam == GetDlgItem(hwndDlg, IDC_SPLITTER)) {
+ if ((HWND)lParam == GetDlgItem(hwndDlg, IDC_SPLITTERY)) {
RECT rc, rcLog;
GetWindowRect(GetDlgItem(hwndDlg, IDC_LOG), &rcLog);
GetClientRect(hwndDlg, &rc);
diff --git a/plugins/Scriver/src/msgoptions.cpp b/plugins/Scriver/src/msgoptions.cpp index 6beeab12ce..0dfdb2d36a 100644 --- a/plugins/Scriver/src/msgoptions.cpp +++ b/plugins/Scriver/src/msgoptions.cpp @@ -23,28 +23,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
-static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-static INT_PTR CALLBACK DlgProcTabsOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-static INT_PTR CALLBACK DlgProcLayoutOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-
-struct TabDef
-{
- DLGPROC dlgProc;
- DWORD dlgId;
- const char *tabName;
-};
-
-static const TabDef tabPages[] = {
- { DlgProcOptions, IDD_OPT_MSGDLG, LPGEN("General") },
- { DlgProcTabsOptions, IDD_OPT_MSGTABS, LPGEN("Tabs") },
- { DlgProcLayoutOptions, IDD_OPT_LAYOUT, LPGEN("Layout") },
- { DlgProcLogOptions, IDD_OPT_MSGLOG, LPGEN("Event log") },
- { DlgProcOptions1, IDD_OPTIONS1, LPGEN("Group chat") },
- { DlgProcOptions2, IDD_OPTIONS2, LPGEN("Group chat log") }
-};
+INT_PTR CALLBACK DlgProcOptionsPopup(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
#define FONTF_BOLD 1
#define FONTF_ITALIC 2
@@ -946,6 +927,8 @@ static INT_PTR CALLBACK DlgProcTypeOptions(HWND hwndDlg, UINT msg, WPARAM wParam return FALSE;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
int OptInitialise(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
@@ -953,12 +936,36 @@ int OptInitialise(WPARAM wParam, LPARAM) odp.hInstance = g_hInst;
odp.szTitle.a = LPGEN("Message sessions");
odp.flags = ODPF_BOLDGROUPS;
- for (int i = 0; i < _countof(tabPages); i++) {
- odp.pszTemplate = MAKEINTRESOURCEA(tabPages[i].dlgId);
- odp.pfnDlgProc = tabPages[i].dlgProc;
- odp.szTab.a = (char *)tabPages[i].tabName;
- Options_AddPage(wParam, &odp);
- }
+
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_MSGDLG);
+ odp.pfnDlgProc = DlgProcOptions;
+ odp.szTab.a = LPGEN("General");
+ Options_AddPage(wParam, &odp);
+
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_MSGTABS);
+ odp.pfnDlgProc = DlgProcTabsOptions;
+ odp.szTab.a = LPGEN("Tabs");
+ Options_AddPage(wParam, &odp);
+
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_LAYOUT);
+ odp.pfnDlgProc = DlgProcLayoutOptions;
+ odp.szTab.a = LPGEN("Layout");
+ Options_AddPage(wParam, &odp);
+
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_MSGLOG);
+ odp.pfnDlgProc = DlgProcLogOptions;
+ odp.szTab.a = LPGEN("Event log");
+ Options_AddPage(wParam, &odp);
+
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS1);
+ odp.pfnDlgProc = DlgProcOptions1;
+ odp.szTab.a = LPGEN("Group chat");
+ Options_AddPage(wParam, &odp);
+
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS2);
+ odp.pfnDlgProc = DlgProcOptions2;
+ odp.szTab.a = LPGEN("Group chat log");
+ Options_AddPage(wParam, &odp);
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_MSGTYPE);
odp.szGroup.a = LPGEN("Message sessions");
@@ -966,5 +973,17 @@ int OptInitialise(WPARAM wParam, LPARAM) odp.pfnDlgProc = DlgProcTypeOptions;
odp.szTab.a = NULL;
Options_AddPage(wParam, &odp);
+
+ if (g_dat.popupInstalled) {
+ OPTIONSDIALOGPAGE odp = { 0 };
+ odp.position = 910000002;
+ odp.hInstance = g_hInst;
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONSPOPUP);
+ odp.szTitle.a = LPGEN("Messaging");
+ odp.szGroup.a = LPGEN("Popups");
+ odp.pfnDlgProc = DlgProcOptionsPopup;
+ odp.flags = ODPF_BOLDGROUPS;
+ Options_AddPage(wParam, &odp);
+ }
return 0;
}
diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp index 49310e20e8..3f286a8fea 100644 --- a/plugins/Scriver/src/msgs.cpp +++ b/plugins/Scriver/src/msgs.cpp @@ -382,6 +382,9 @@ static int AvatarChanged(WPARAM wParam, LPARAM lParam) return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+// status icons processing
+
static void RegisterStatusIcons()
{
StatusIconData sid = { sizeof(sid) };
@@ -419,6 +422,108 @@ int StatusIconPressed(WPARAM wParam, LPARAM lParam) return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+// toolbar icons processing
+
+int RegisterToolbarIcons(WPARAM, LPARAM)
+{
+ BBButton bbd = {};
+ bbd.pszModuleName = "SRMM";
+ bbd.bbbFlags = BBBF_ISCHATBUTTON | BBBF_ISIMBUTTON | BBBF_CREATEBYID | BBBF_ISRSIDEBUTTON;
+ bbd.dwButtonID = IDOK;
+ bbd.dwDefPos = 5;
+ bbd.hIcon = IcoLib_GetIconHandle("scriver_SEND");
+ bbd.pwszTooltip = LPGENW("Send message");
+ Srmm_AddButton(&bbd);
+
+ bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_CREATEBYID;
+ bbd.dwButtonID = IDC_QUOTE;
+ bbd.dwDefPos = 10;
+ bbd.hIcon = IcoLib_GetIconHandle("scriver_QUOTE");
+ bbd.pwszTooltip = LPGENW("Quote");
+ Srmm_AddButton(&bbd);
+
+ bbd.bbbFlags |= BBBF_ISRSIDEBUTTON;
+ bbd.dwButtonID = IDC_ADD;
+ bbd.dwDefPos = 20;
+ bbd.hIcon = IcoLib_GetIconHandle("scriver_ADD");
+ bbd.pwszTooltip = LPGENW("Add contact permanently to list");
+ Srmm_AddButton(&bbd);
+
+ bbd.dwButtonID = IDC_USERMENU;
+ bbd.dwDefPos = 30;
+ bbd.hIcon = Skin_GetIconHandle(SKINICON_OTHER_DOWNARROW);
+ bbd.pwszTooltip = LPGENW("User menu");
+ Srmm_AddButton(&bbd);
+
+ bbd.dwButtonID = IDC_DETAILS;
+ bbd.dwDefPos = 40;
+ bbd.hIcon = IcoLib_GetIconHandle("scriver_USERDETAILS");
+ bbd.pwszTooltip = LPGENW("View user's details");
+ Srmm_AddButton(&bbd);
+
+ bbd.bbbFlags |= BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON;
+ bbd.dwButtonID = IDC_HISTORY;
+ bbd.dwDefPos = 50;
+ bbd.hIcon = IcoLib_GetIconHandle("scriver_HISTORY");
+ bbd.pwszTooltip = LPGENW("View user's history");
+ Srmm_AddButton(&bbd);
+
+ // chat buttons
+ bbd.bbbFlags = BBBF_ISPUSHBUTTON | BBBF_ISCHATBUTTON | BBBF_CREATEBYID;
+ bbd.dwButtonID = IDC_CHAT_BOLD;
+ bbd.dwDefPos = 10;
+ bbd.hIcon = IcoLib_GetIconHandle("chat_bold");
+ bbd.pwszTooltip = LPGENW("Make the text bold(CTRL+B)");
+ Srmm_AddButton(&bbd);
+
+ bbd.dwButtonID = IDC_CHAT_ITALICS;
+ bbd.dwDefPos = 15;
+ bbd.hIcon = IcoLib_GetIconHandle("chat_italics");
+ bbd.pwszTooltip = LPGENW("Make the text italicized (CTRL+I)");
+ Srmm_AddButton(&bbd);
+
+ bbd.dwButtonID = IDC_CHAT_UNDERLINE;
+ bbd.dwDefPos = 20;
+ bbd.hIcon = IcoLib_GetIconHandle("chat_underline");
+ bbd.pwszTooltip = LPGENW("Make the text underlined (CTRL+U)");
+ Srmm_AddButton(&bbd);
+
+ bbd.dwButtonID = IDC_CHAT_COLOR;
+ bbd.dwDefPos = 25;
+ bbd.hIcon = IcoLib_GetIconHandle("chat_fgcol");
+ bbd.pwszTooltip = LPGENW("Select a foreground color for the text (CTRL+K)");
+ Srmm_AddButton(&bbd);
+
+ bbd.dwButtonID = IDC_CHAT_BKGCOLOR;
+ bbd.dwDefPos = 30;
+ bbd.hIcon = IcoLib_GetIconHandle("chat_bkgcol");
+ bbd.pwszTooltip = LPGENW("Select a background color for the text");
+ Srmm_AddButton(&bbd);
+
+ bbd.bbbFlags = BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID;
+ bbd.dwButtonID = IDC_CHAT_CHANMGR;
+ bbd.dwDefPos = 30;
+ bbd.hIcon = IcoLib_GetIconHandle("chat_settings");
+ bbd.pwszTooltip = LPGENW("Control this room (CTRL+O)");
+ Srmm_AddButton(&bbd);
+
+ bbd.dwButtonID = IDC_CHAT_SHOWNICKLIST;
+ bbd.dwDefPos = 20;
+ bbd.hIcon = IcoLib_GetIconHandle("chat_nicklist");
+ bbd.pwszTooltip = LPGENW("Show/hide the nick list (CTRL+N)");
+ Srmm_AddButton(&bbd);
+
+ bbd.dwButtonID = IDC_CHAT_FILTER;
+ bbd.dwDefPos = 10;
+ bbd.hIcon = IcoLib_GetIconHandle("chat_filter");
+ bbd.pwszTooltip = LPGENW("Enable/disable the event filter (CTRL+F)");
+ Srmm_AddButton(&bbd);
+ return 0;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
static int ModuleLoad(WPARAM, LPARAM)
{
g_dat.smileyAddInstalled = ServiceExists(MS_SMILEYADD_SHOWSELECTION) && ServiceExists(MS_SMILEYADD_REPLACESMILEYS);
@@ -459,10 +564,10 @@ static int OnModulesLoaded(WPARAM, LPARAM) HookEvent(ME_AV_AVATARCHANGED, AvatarChanged);
HookEvent(ME_FONT_RELOAD, FontServiceFontsChanged);
HookEvent(ME_MSG_ICONPRESSED, StatusIconPressed);
+ HookEvent(ME_MSG_TOOLBARLOADED, RegisterToolbarIcons);
HookEvent(ME_MC_DEFAULTTCHANGED, MetaContactChanged);
RestoreUnreadMessageAlerts();
- OptionsInit();
RegisterStatusIcons();
return 0;
}
diff --git a/plugins/Scriver/src/resource.h b/plugins/Scriver/src/resource.h index bfe983a996..6cd0df7ca7 100644 --- a/plugins/Scriver/src/resource.h +++ b/plugins/Scriver/src/resource.h @@ -88,7 +88,6 @@ #define IDC_LIMITCHATSTABS 1013
#define IDC_LIMITCHATSTABSNUM 1014
#define IDC_LIMITCHATSTABSNUMSPIN 1015
-#define IDC_SPLITTER 1017
#define IDC_SHOWNAMES 1020
#define IDC_USETABS 1022
#define IDC_SHOWSECONDS 1023
@@ -171,8 +170,8 @@ #define IDC_INPUTLINES 1647
#define IDC_INPUTLINESSPIN 1648
#define IDC_CHAT_LOG 5005
-#define IDC_CHAT_SPLITTERX 5006
-#define IDC_CHAT_SPLITTERY 5008
+#define IDC_SPLITTERX 5006
+#define IDC_SPLITTERY 5008
#define IDC_CHAT_MESSAGE 5009
#define IDC_CHAT_BOLD 5010
#define IDC_CHAT_ITALICS 5011
diff --git a/plugins/Scriver/src/stdafx.h b/plugins/Scriver/src/stdafx.h index f97876c4ab..b46f88eadb 100644 --- a/plugins/Scriver/src/stdafx.h +++ b/plugins/Scriver/src/stdafx.h @@ -121,7 +121,6 @@ extern CREOleCallback2 reOleCallback2; int Chat_Load();
int Chat_Unload();
-int Chat_ModulesLoaded(WPARAM wParam,LPARAM lParam);
int OptInitialise(WPARAM wParam, LPARAM lParam);
int FontServiceFontsChanged(WPARAM wParam, LPARAM lParam);
int StatusIconPressed(WPARAM wParam, LPARAM lParam);
diff --git a/plugins/Scriver/src/utils.cpp b/plugins/Scriver/src/utils.cpp index e52f9db5cc..2bf9c3c699 100644 --- a/plugins/Scriver/src/utils.cpp +++ b/plugins/Scriver/src/utils.cpp @@ -434,54 +434,36 @@ void SetToolTipRect(HWND hwndParent, HWND hwndTT, RECT *rect) SendMessage(hwndTT, TTM_NEWTOOLRECT, 0, (LPARAM)&ti);
}
-/* toolbar-related stuff, to be moved to a separate file */
-
-HDWP ResizeToolbar(HWND hwnd, HDWP hdwp, int width, int vPos, int height, int cControls, const ToolbarButton *buttons, int controlVisibility)
+void SetButtonsPos(HWND hwndDlg)
{
- HWND hCtrl;
- int i;
- int lPos = 0;
- int rPos = width;
- for (i = 0; i < cControls; i++) {
- if (!buttons[i].alignment && (controlVisibility & (1 << i))) {
- lPos += buttons[i].spacing;
- hCtrl = GetDlgItem(hwnd, buttons[i].controlId);
- if (NULL != hCtrl) /* Wine fix. */
- hdwp = DeferWindowPos(hdwp, hCtrl, 0, lPos, vPos, buttons[i].width, height, SWP_NOZORDER);
- lPos += buttons[i].width;
+ HDWP hdwp = BeginDeferWindowPos(Srmm_GetButtonCount());
+
+ RECT rc;
+ GetWindowRect(GetDlgItem(hwndDlg, IDC_SPLITTERY), &rc);
+ POINT pt = { 0, rc.top };
+ ScreenToClient(hwndDlg, &pt);
+ pt.y -= 20;
+
+ GetClientRect(hwndDlg, &rc);
+ int iLeftX = 2, iRightX = rc.right - 2;
+ int iGap = db_get_b(NULL, SRMMMOD, "ButtonsBarGap", 1);
+
+ CustomButtonData *cbd;
+ for (int i = 0; cbd = Srmm_GetNthButton(i); i++) {
+ HWND hwndButton = GetDlgItem(hwndDlg, cbd->m_dwButtonCID);
+ if (hwndButton == NULL)
+ continue;
+
+ int width = iGap + ((cbd->m_dwArrowCID) ? 34 : 22);
+ if (cbd->m_bRSided) {
+ iRightX -= width;
+ hdwp = DeferWindowPos(hdwp, hwndButton, NULL, iRightX, pt.y, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
}
- }
- for (i = cControls - 1; i >= 0; i--) {
- if (buttons[i].alignment && (controlVisibility & (1 << i))) {
- rPos -= buttons[i].spacing + buttons[i].width;
- hCtrl = GetDlgItem(hwnd, buttons[i].controlId);
- if (NULL != hCtrl) /* Wine fix. */
- hdwp = DeferWindowPos(hdwp, hCtrl, 0, rPos, vPos, buttons[i].width, height, SWP_NOZORDER);
+ else {
+ hdwp = DeferWindowPos(hdwp, hwndButton, NULL, iLeftX, pt.y, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
+ iLeftX += width;
}
}
- return hdwp;
-}
-
-void ShowToolbarControls(HWND hwndDlg, int cControls, const ToolbarButton* buttons, int controlVisibility, int state)
-{
- for (int i = 0; i < cControls; i++)
- ShowWindow(GetDlgItem(hwndDlg, buttons[i].controlId), (controlVisibility & (1 << i)) ? state : SW_HIDE);
-}
-
-int GetToolbarWidth(int cControls, const ToolbarButton *buttons)
-{
- int w = 0;
- for (int i = 0; i < cControls; i++)
- w += buttons[i].width + buttons[i].spacing;
-
- return w;
-}
-
-BOOL IsToolbarVisible(int cControls, int visibilityFlags)
-{
- for (int i = 0; i < cControls; i++)
- if (visibilityFlags & (1 << i))
- return TRUE;
- return FALSE;
+ EndDeferWindowPos(hdwp);
}
diff --git a/plugins/Scriver/src/utils.h b/plugins/Scriver/src/utils.h index de18f2d2b5..66db731f03 100644 --- a/plugins/Scriver/src/utils.h +++ b/plugins/Scriver/src/utils.h @@ -44,8 +44,6 @@ wchar_t *GetRichTextWord(HWND hwnd, POINTL *pt); int SetRichText(HWND hwnd, const wchar_t *text);
int SetRichTextRTF(HWND hwnd, const char *text);
void SearchWord(wchar_t * word, int engine);
-HDWP ResizeToolbar(HWND hwnd, HDWP hdwp, int width, int vPos, int height, int cControls, const ToolbarButton * buttons, int controlVisibility);
-void ShowToolbarControls(HWND hwndDlg, int cControls, const ToolbarButton * buttons, int controlVisibility, int state);
void AppendToBuffer(char *&buffer, size_t &cbBufferEnd, size_t &cbBufferAlloced, const char *fmt, ...);
int MeasureMenuItem(WPARAM wParam, LPARAM lParam);
int DrawMenuItem(WPARAM wParam, LPARAM lParam);
@@ -54,6 +52,5 @@ void GetContactUniqueId(SrmmWindowData *dat, char *buf, int maxlen); HWND CreateToolTip(HWND hwndParent, LPTSTR ptszText, LPTSTR ptszTitle, RECT *rect);
void SetToolTipText(HWND hwndParent, HWND hwndTT, LPTSTR ptszText, LPTSTR ptszTitle);
void SetToolTipRect(HWND hwndParent, HWND hwndTT, RECT* rect);
-int GetToolbarWidth(int cControls, const ToolbarButton * buttons);
-BOOL IsToolbarVisible(int cControls, int visibilityFlags);
+void SetButtonsPos(HWND hwndDlg);
#endif
diff --git a/plugins/SmileyAdd/src/dlgboxsubclass.cpp b/plugins/SmileyAdd/src/dlgboxsubclass.cpp index 70f5082737..5fddca1ebe 100644 --- a/plugins/SmileyAdd/src/dlgboxsubclass.cpp +++ b/plugins/SmileyAdd/src/dlgboxsubclass.cpp @@ -23,72 +23,13 @@ static mir_cs csWndList; // type definitions
-class MsgWndData : public MZeroedObject
+struct MsgWndData : public MZeroedObject
{
-public:
- HWND hwnd;
- char ProtocolName[52];
- HWND REdit;
- HWND MEdit;
- HWND LButton;
- mutable HWND hSmlButton;
- mutable HBITMAP hSmlBmp;
- mutable HICON hSmlIco;
- int idxLastChar;
+ HWND hwnd, hwndLog, hwndInput;
+ int idxLastChar;
+ bool doSmileyReplace, doSmileyButton;
MCONTACT hContact;
- bool doSmileyReplace;
- bool doSmileyButton;
- bool isSplit;
- bool isSend;
-
- MsgWndData()
- {
- }
-
- ~MsgWndData()
- {
- clear();
- }
-
- void clear(void)
- {
- if (hSmlBmp != NULL) {
- DeleteObject(hSmlBmp);
- hSmlBmp = NULL;
- }
- if (hSmlIco != NULL) {
- DestroyIcon(hSmlIco);
- hSmlIco = NULL;
- }
- if (hSmlButton != NULL) {
- DestroyWindow(hSmlButton);
- hSmlButton = NULL;
- }
- }
-
- RECT CalcSmileyButtonPos(void)
- {
- RECT rect;
- GetWindowRect(LButton, &rect);
-
- POINT pt;
- pt.y = rect.top;
-
- MUUID muidScriver = { 0x84636f78, 0x2057, 0x4302, { 0x8a, 0x65, 0x23, 0xa1, 0x6d, 0x46, 0x84, 0x4c } };
- int iShift = (IsPluginLoaded(muidScriver)) ? 28 : -28;
-
- if ((GetWindowLongPtr(LButton, GWL_STYLE) & WS_VISIBLE) != 0)
- pt.x = rect.left + iShift;
- else
- pt.x = rect.left;
-
- ScreenToClient(GetParent(LButton), &pt);
- rect.bottom += pt.y - rect.top;
- rect.right += pt.x - rect.left;
- rect.top = pt.y;
- rect.left = pt.x;
- return rect;
- }
+ char ProtocolName[52];
void CreateSmileyButton(void)
{
@@ -98,7 +39,6 @@ public: doSmileyButton &= SmileyPack != NULL && SmileyPack->VisibleSmileyCount() != 0;
doSmileyReplace = true;
- doSmileyButton &= db_get_b(NULL, "SRMM", "ShowButtonLine", TRUE) != 0;
if (ProtocolName[0] != 0) {
INT_PTR cap = CallProtoService(ProtocolName, PS_GETCAPS, PFLAGNUM_1, 0);
@@ -106,37 +46,13 @@ public: doSmileyReplace &= ((cap & (PF1_IMRECV | PF1_CHAT)) != 0);
}
- if (doSmileyButton && opt.PluginSupportEnabled) {
- // create smiley button
- RECT rect = CalcSmileyButtonPos();
-
- hSmlButton = CreateWindowEx(
- WS_EX_LEFT | WS_EX_NOPARENTNOTIFY | WS_EX_TOPMOST,
- MIRANDABUTTONCLASS,
- L"S",
- WS_CHILD | WS_VISIBLE | WS_TABSTOP,
- rect.left,
- rect.top,
- rect.bottom - rect.top + 1,
- rect.bottom - rect.top + 1,
- GetParent(LButton),
- (HMENU)IDC_SMLBUTTON,
- NULL, NULL);
-
- // Conversion to bitmap done to prevent Miranda from scaling the image
- SmileyType *sml = FindButtonSmiley(SmileyPack);
- if (sml != NULL) {
- hSmlBmp = sml->GetBitmap(GetSysColor(COLOR_BTNFACE), 0, 0);
- SendMessage(hSmlButton, BM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hSmlBmp);
- }
- else {
- hSmlIco = GetDefaultIcon();
- SendMessage(hSmlButton, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hSmlIco);
- }
-
- SendMessage(hSmlButton, BUTTONADDTOOLTIP, (WPARAM)LPGEN("Show smiley selection window"), 0);
- SendMessage(hSmlButton, BUTTONSETASFLATBTN, TRUE, 0);
- }
+ BBButton bbd = {};
+ bbd.pszModuleName = MODULENAME;
+ if (!doSmileyButton)
+ bbd.bbbFlags = BBBF_DISABLED;
+ else if (!opt.PluginSupportEnabled)
+ bbd.bbbFlags = BBBF_HIDDEN;
+ Srmm_SetButtonState(hContact, &bbd);
}
};
@@ -172,7 +88,6 @@ static LRESULT CALLBACK MessageDlgSubclass(HWND hwnd, UINT uMsg, WPARAM wParam, switch (uMsg) {
case DM_OPTIONSAPPLIED:
- dat->clear();
dat->CreateSmileyButton();
break;
@@ -182,7 +97,7 @@ static LRESULT CALLBACK MessageDlgSubclass(HWND hwnd, UINT uMsg, WPARAM wParam, GETTEXTLENGTHEX gtl;
gtl.codepage = 1200;
gtl.flags = GTL_PRECISE | GTL_NUMCHARS;
- dat->idxLastChar = (int)SendMessage(dat->REdit, EM_GETTEXTLENGTHEX, (WPARAM)>l, 0);
+ dat->idxLastChar = (int)SendMessage(dat->hwndLog, EM_GETTEXTLENGTHEX, (WPARAM)>l, 0);
}
break;
}
@@ -203,20 +118,13 @@ static LRESULT CALLBACK MessageDlgSubclass(HWND hwnd, UINT uMsg, WPARAM wParam, }
break;
- case WM_SIZE:
- if (dat->doSmileyButton) {
- RECT rect = dat->CalcSmileyButtonPos();
- SetWindowPos(dat->hSmlButton, NULL, rect.left, rect.top, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);
- }
- break;
-
case DM_APPENDTOLOG:
if (dat->doSmileyReplace) {
SmileyPackCType *smcp;
SmileyPackType *SmileyPack = GetSmileyPack(dat->ProtocolName, dat->hContact, &smcp);
if (SmileyPack != NULL) {
const CHARRANGE sel = { dat->idxLastChar, LONG_MAX };
- ReplaceSmileys(dat->REdit, SmileyPack, smcp, sel, false, false, false);
+ ReplaceSmileys(dat->hwndLog, SmileyPack, smcp, sel, false, false, false);
}
}
break;
@@ -227,38 +135,56 @@ static LRESULT CALLBACK MessageDlgSubclass(HWND hwnd, UINT uMsg, WPARAM wParam, SmileyPackType *SmileyPack = GetSmileyPack(dat->ProtocolName, dat->hContact, &smcp);
if (SmileyPack != NULL) {
static const CHARRANGE sel = { 0, LONG_MAX };
- ReplaceSmileys(dat->REdit, SmileyPack, smcp, sel, false, false, false);
+ ReplaceSmileys(dat->hwndLog, SmileyPack, smcp, sel, false, false, false);
}
}
break;
-
- case WM_COMMAND:
- if (LOWORD(wParam) == IDC_SMLBUTTON && HIWORD(wParam) == BN_CLICKED) {
- RECT rect;
- GetWindowRect(dat->hSmlButton, &rect);
-
- SmileyToolWindowParam *stwp = new SmileyToolWindowParam;
- stwp->pSmileyPack = GetSmileyPack(dat->ProtocolName, dat->hContact);
- stwp->hWndParent = hwnd;
- stwp->hWndTarget = dat->MEdit;
- stwp->targetMessage = EM_REPLACESEL;
- stwp->targetWParam = TRUE;
- stwp->direction = 0;
- stwp->xPosition = rect.left;
- stwp->yPosition = rect.top + 24;
- mir_forkthread(SmileyToolThread, stwp);
- }
-
- if (LOWORD(wParam) == MI_IDC_ADD && HIWORD(wParam) == BN_CLICKED && dat->doSmileyButton) {
- RECT rect = dat->CalcSmileyButtonPos();
- SetWindowPos(dat->hSmlButton, NULL, rect.left, rect.top, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);
- }
- break;
}
return result;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+// toolbar button processing
+
+int SmileyButtonCreate(WPARAM, LPARAM)
+{
+ BBButton bbd = {};
+ bbd.pszModuleName = MODULENAME;
+ bbd.pwszTooltip = LPGENW("Show smiley selection window");
+ bbd.dwDefPos = 31;
+ bbd.hIcon = IcoLib_GetIconHandle("SmileyAdd_ButtonSmiley");
+ bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON;
+ Srmm_AddButton(&bbd);
+ return 0;
+}
+
+int SmileyButtonPressed(WPARAM, LPARAM lParam)
+{
+ CustomButtonClickData *pcbc = (CustomButtonClickData*)lParam;
+ if (mir_strcmp(pcbc->pszModule, MODULENAME))
+ return 0;
+
+ MsgWndData *dat = IsMsgWnd(pcbc->hwndFrom);
+ if (dat == NULL)
+ return 0;
+
+ SmileyToolWindowParam *stwp = new SmileyToolWindowParam;
+ stwp->pSmileyPack = GetSmileyPack(dat->ProtocolName, dat->hContact);
+ stwp->hWndParent = pcbc->hwndFrom;
+ stwp->hWndTarget = dat->hwndInput;
+ stwp->targetMessage = EM_REPLACESEL;
+ stwp->targetWParam = TRUE;
+ stwp->direction = 0;
+ stwp->xPosition = pcbc->pt.x;
+ stwp->yPosition = pcbc->pt.y;
+ mir_forkthread(SmileyToolThread, stwp);
+ return 0;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// window hook
+
static int MsgDlgHook(WPARAM, LPARAM lParam)
{
const MessageWindowEventData *wndEvtData = (MessageWindowEventData*)lParam;
@@ -268,11 +194,8 @@ static int MsgDlgHook(WPARAM, LPARAM lParam) MsgWndData *msgwnd = new MsgWndData();
msgwnd->hwnd = wndEvtData->hwndWindow;
msgwnd->hContact = wndEvtData->hContact;
- msgwnd->REdit = wndEvtData->hwndLog;
- msgwnd->MEdit = wndEvtData->hwndInput;
- msgwnd->LButton = GetDlgItem(wndEvtData->hwndWindow, MI_IDC_ADD);
- if (msgwnd->LButton == NULL)
- msgwnd->LButton = GetDlgItem(wndEvtData->hwndWindow, 5019);
+ msgwnd->hwndLog = wndEvtData->hwndLog;
+ msgwnd->hwndInput = wndEvtData->hwndInput;
// Get the protocol for this contact to display correct smileys.
char *protonam = GetContactProto(DecodeMetaContact(msgwnd->hContact));
diff --git a/plugins/SmileyAdd/src/download.cpp b/plugins/SmileyAdd/src/download.cpp index fe117a0b9e..1a68a8c86b 100644 --- a/plugins/SmileyAdd/src/download.cpp +++ b/plugins/SmileyAdd/src/download.cpp @@ -220,7 +220,7 @@ void DownloadInit(void) {
NETLIBUSER nlu = { sizeof(nlu) };
nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_NOHTTPSOPTION | NUF_UNICODE;
- nlu.szSettingsModule = "SmileyAdd";
+ nlu.szSettingsModule = MODULENAME;
nlu.ptszDescriptiveName = TranslateT("SmileyAdd HTTP connections");
hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
diff --git a/plugins/SmileyAdd/src/main.cpp b/plugins/SmileyAdd/src/main.cpp index 112f3face5..a2d6c704df 100644 --- a/plugins/SmileyAdd/src/main.cpp +++ b/plugins/SmileyAdd/src/main.cpp @@ -61,14 +61,14 @@ static int ModulesLoaded(WPARAM, LPARAM) DownloadInit();
- //install hooks if enabled
+ // install hooks if enabled
InstallDialogBoxHook();
g_SmileyCategories.AddAllProtocolsAsCategory();
g_SmileyCategories.ClearAndLoadAll();
ColourID cid = { sizeof(cid) };
- strcpy_s(cid.dbSettingsGroup, "SmileyAdd");
+ strcpy_s(cid.dbSettingsGroup, MODULENAME);
strcpy_s(cid.group, LPGEN("SmileyAdd"));
strcpy_s(cid.name, LPGEN("Background color"));
strcpy_s(cid.setting, "SelWndBkgClr");
@@ -114,6 +114,9 @@ extern "C" __declspec(dllexport) int Load(void) HookEvent(ME_DB_CONTACT_SETTINGCHANGED, DbSettingChanged);
HookEvent(ME_COLOUR_RELOAD, ReloadColour);
+ HookEvent(ME_MSG_BUTTONPRESSED, SmileyButtonPressed);
+ HookEvent(ME_MSG_TOOLBARLOADED, SmileyButtonCreate);
+
//create the smiley services
CreateServiceFunction(MS_SMILEYADD_REPLACESMILEYS, ReplaceSmileysCommand);
CreateServiceFunction(MS_SMILEYADD_SHOWSELECTION, ShowSmileySelectionCommand);
diff --git a/plugins/SmileyAdd/src/options.cpp b/plugins/SmileyAdd/src/options.cpp index b5570be9ed..f7341b561d 100644 --- a/plugins/SmileyAdd/src/options.cpp +++ b/plugins/SmileyAdd/src/options.cpp @@ -543,68 +543,67 @@ void OptionsDialogType::ShowSmileyPreview(void) void OptionsType::Save(void)
{
- db_set_b(NULL, "SmileyAdd", "PluginSupportEnabled", PluginSupportEnabled);
- db_set_b(NULL, "SmileyAdd", "EnforceSpaces", EnforceSpaces);
- db_set_b(NULL, "SmileyAdd", "ScaleToTextheight", ScaleToTextheight);
- db_set_b(NULL, "SmileyAdd", "UseOneForAll", UseOneForAll);
- db_set_b(NULL, "SmileyAdd", "UsePhysProto", UsePhysProto);
- db_set_b(NULL, "SmileyAdd", "SurroundSmileyWithSpaces", SurroundSmileyWithSpaces);
- db_set_b(NULL, "SmileyAdd", "ScaleAllSmileys", ScaleAllSmileys);
- db_set_b(NULL, "SmileyAdd", "IEViewStyle", IEViewStyle);
- db_set_b(NULL, "SmileyAdd", "AnimateSel", AnimateSel);
- db_set_b(NULL, "SmileyAdd", "AnimateDlg", AnimateDlg);
- db_set_b(NULL, "SmileyAdd", "InputSmileys", InputSmileys);
- db_set_b(NULL, "SmileyAdd", "DCursorSmiley", DCursorSmiley);
- db_set_b(NULL, "SmileyAdd", "DisableCustom", DisableCustom);
- db_set_b(NULL, "SmileyAdd", "HQScaling", HQScaling);
- db_set_b(NULL, "SmileyAdd", "ButtonStatus", (BYTE)ButtonStatus);
- db_set_dw(NULL, "SmileyAdd", "MaxCustomSmileySize", MaxCustomSmileySize);
- db_set_dw(NULL, "SmileyAdd", "MinSmileySize", MinSmileySize);
- db_set_b(NULL, "SmileyAdd", "HorizontalSorting", HorizontalSorting);
+ db_set_b(NULL, MODULENAME, "PluginSupportEnabled", PluginSupportEnabled);
+ db_set_b(NULL, MODULENAME, "EnforceSpaces", EnforceSpaces);
+ db_set_b(NULL, MODULENAME, "ScaleToTextheight", ScaleToTextheight);
+ db_set_b(NULL, MODULENAME, "UseOneForAll", UseOneForAll);
+ db_set_b(NULL, MODULENAME, "UsePhysProto", UsePhysProto);
+ db_set_b(NULL, MODULENAME, "SurroundSmileyWithSpaces", SurroundSmileyWithSpaces);
+ db_set_b(NULL, MODULENAME, "ScaleAllSmileys", ScaleAllSmileys);
+ db_set_b(NULL, MODULENAME, "IEViewStyle", IEViewStyle);
+ db_set_b(NULL, MODULENAME, "AnimateSel", AnimateSel);
+ db_set_b(NULL, MODULENAME, "AnimateDlg", AnimateDlg);
+ db_set_b(NULL, MODULENAME, "InputSmileys", InputSmileys);
+ db_set_b(NULL, MODULENAME, "DCursorSmiley", DCursorSmiley);
+ db_set_b(NULL, MODULENAME, "DisableCustom", DisableCustom);
+ db_set_b(NULL, MODULENAME, "HQScaling", HQScaling);
+ db_set_b(NULL, MODULENAME, "ButtonStatus", (BYTE)ButtonStatus);
+ db_set_dw(NULL, MODULENAME, "MaxCustomSmileySize", MaxCustomSmileySize);
+ db_set_dw(NULL, MODULENAME, "MinSmileySize", MinSmileySize);
+ db_set_b(NULL, MODULENAME, "HorizontalSorting", HorizontalSorting);
}
void OptionsType::Load(void)
{
- PluginSupportEnabled = db_get_b(NULL, "SmileyAdd", "PluginSupportEnabled", TRUE) != 0;
- EnforceSpaces = db_get_b(NULL, "SmileyAdd", "EnforceSpaces", FALSE) != 0;
- ScaleToTextheight = db_get_b(NULL, "SmileyAdd", "ScaleToTextheight", FALSE) != 0;
- UseOneForAll = db_get_b(NULL, "SmileyAdd", "UseOneForAll", TRUE) != 0;
- UsePhysProto = db_get_b(NULL, "SmileyAdd", "UsePhysProto", FALSE) != 0;
- SurroundSmileyWithSpaces =
- db_get_b(NULL, "SmileyAdd", "SurroundSmileyWithSpaces", FALSE) != 0;
- ScaleAllSmileys = db_get_b(NULL, "SmileyAdd", "ScaleAllSmileys", FALSE) != 0;
- IEViewStyle = db_get_b(NULL, "SmileyAdd", "IEViewStyle", FALSE) != 0;
- AnimateSel = db_get_b(NULL, "SmileyAdd", "AnimateSel", TRUE) != 0;
- AnimateDlg = db_get_b(NULL, "SmileyAdd", "AnimateDlg", TRUE) != 0;
- InputSmileys = db_get_b(NULL, "SmileyAdd", "InputSmileys", TRUE) != 0;
- DCursorSmiley = db_get_b(NULL, "SmileyAdd", "DCursorSmiley", FALSE) != 0;
- DisableCustom = db_get_b(NULL, "SmileyAdd", "DisableCustom", FALSE) != 0;
- HQScaling = db_get_b(NULL, "SmileyAdd", "HQScaling", FALSE) != 0;
-
- ButtonStatus = db_get_b(NULL, "SmileyAdd", "ButtonStatus", 1);
- SelWndBkgClr = db_get_dw(NULL, "SmileyAdd", "SelWndBkgClr", GetSysColor(COLOR_WINDOW));
- MaxCustomSmileySize = db_get_dw(NULL, "SmileyAdd", "MaxCustomSmileySize", 0);
- MinSmileySize = db_get_dw(NULL, "SmileyAdd", "MinSmileySize", 0);
- HorizontalSorting = db_get_b(NULL, "SmileyAdd", "HorizontalSorting", 1) != 0;
+ PluginSupportEnabled = db_get_b(NULL, MODULENAME, "PluginSupportEnabled", TRUE) != 0;
+ EnforceSpaces = db_get_b(NULL, MODULENAME, "EnforceSpaces", FALSE) != 0;
+ ScaleToTextheight = db_get_b(NULL, MODULENAME, "ScaleToTextheight", FALSE) != 0;
+ UseOneForAll = db_get_b(NULL, MODULENAME, "UseOneForAll", TRUE) != 0;
+ UsePhysProto = db_get_b(NULL, MODULENAME, "UsePhysProto", FALSE) != 0;
+ SurroundSmileyWithSpaces = db_get_b(NULL, MODULENAME, "SurroundSmileyWithSpaces", FALSE) != 0;
+ ScaleAllSmileys = db_get_b(NULL, MODULENAME, "ScaleAllSmileys", FALSE) != 0;
+ IEViewStyle = db_get_b(NULL, MODULENAME, "IEViewStyle", FALSE) != 0;
+ AnimateSel = db_get_b(NULL, MODULENAME, "AnimateSel", TRUE) != 0;
+ AnimateDlg = db_get_b(NULL, MODULENAME, "AnimateDlg", TRUE) != 0;
+ InputSmileys = db_get_b(NULL, MODULENAME, "InputSmileys", TRUE) != 0;
+ DCursorSmiley = db_get_b(NULL, MODULENAME, "DCursorSmiley", FALSE) != 0;
+ DisableCustom = db_get_b(NULL, MODULENAME, "DisableCustom", FALSE) != 0;
+ HQScaling = db_get_b(NULL, MODULENAME, "HQScaling", FALSE) != 0;
+
+ ButtonStatus = db_get_b(NULL, MODULENAME, "ButtonStatus", 1);
+ SelWndBkgClr = db_get_dw(NULL, MODULENAME, "SelWndBkgClr", GetSysColor(COLOR_WINDOW));
+ MaxCustomSmileySize = db_get_dw(NULL, MODULENAME, "MaxCustomSmileySize", 0);
+ MinSmileySize = db_get_dw(NULL, MODULENAME, "MinSmileySize", 0);
+ HorizontalSorting = db_get_b(NULL, MODULENAME, "HorizontalSorting", 1) != 0;
}
void OptionsType::ReadPackFileName(CMStringW &filename, const CMStringW &name, const CMStringW &defaultFilename)
{
CMStringW settingKey = name + L"-filename";
- ptrW tszValue(db_get_wsa(NULL, "SmileyAdd", _T2A(settingKey.c_str())));
+ ptrW tszValue(db_get_wsa(NULL, MODULENAME, _T2A(settingKey.c_str())));
filename = (tszValue != NULL) ? (wchar_t*)tszValue : defaultFilename;
}
void OptionsType::WritePackFileName(const CMStringW &filename, const CMStringW &name)
{
CMStringW settingKey = name + L"-filename";
- db_set_ws(NULL, "SmileyAdd", _T2A(settingKey.c_str()), filename.c_str());
+ db_set_ws(NULL, MODULENAME, _T2A(settingKey.c_str()), filename.c_str());
}
void OptionsType::ReadCustomCategories(CMStringW &cats)
{
- ptrW tszValue(db_get_wsa(NULL, "SmileyAdd", "CustomCategories"));
+ ptrW tszValue(db_get_wsa(NULL, MODULENAME, "CustomCategories"));
if (tszValue != NULL)
cats = tszValue;
}
@@ -612,14 +611,14 @@ void OptionsType::ReadCustomCategories(CMStringW &cats) void OptionsType::WriteCustomCategories(const CMStringW &cats)
{
if (cats.IsEmpty())
- db_unset(NULL, "SmileyAdd", "CustomCategories");
+ db_unset(NULL, MODULENAME, "CustomCategories");
else
- db_set_ws(NULL, "SmileyAdd", "CustomCategories", cats.c_str());
+ db_set_ws(NULL, MODULENAME, "CustomCategories", cats.c_str());
}
void OptionsType::ReadContactCategory(MCONTACT hContact, CMStringW &cats)
{
- ptrW tszValue(db_get_wsa(hContact, "SmileyAdd", "CustomCategory"));
+ ptrW tszValue(db_get_wsa(hContact, MODULENAME, "CustomCategory"));
if (tszValue != NULL)
cats = tszValue;
}
@@ -627,9 +626,9 @@ void OptionsType::ReadContactCategory(MCONTACT hContact, CMStringW &cats) void OptionsType::WriteContactCategory(MCONTACT hContact, const CMStringW &cats)
{
if (cats.IsEmpty())
- db_unset(hContact, "SmileyAdd", "CustomCategory");
+ db_unset(hContact, MODULENAME, "CustomCategory");
else
- db_set_ws(hContact, "SmileyAdd", "CustomCategory", cats.c_str());
+ db_set_ws(hContact, MODULENAME, "CustomCategory", cats.c_str());
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/SmileyAdd/src/stdafx.h b/plugins/SmileyAdd/src/stdafx.h index bd91bfe5a5..f467be8697 100644 --- a/plugins/SmileyAdd/src/stdafx.h +++ b/plugins/SmileyAdd/src/stdafx.h @@ -99,9 +99,7 @@ extern SmileyCategoryListType g_SmileyCategories; extern SmileyPackListType g_SmileyPacks;
extern LIST<void> menuHandleArray;
-#define IDC_SMLBUTTON (WM_USER + 33)
-
-#define MI_IDC_ADD 1070 // Add button
+#define MODULENAME "SmileyAdd"
#define DM_REMAKELOG (WM_USER + 11)
#define DM_OPTIONSAPPLIED (WM_USER + 14)
@@ -116,9 +114,12 @@ extern LIST<void> menuHandleArray; // init functions
void InstallDialogBoxHook(void);
void RemoveDialogBoxHook(void);
-int UpdateSrmmDlg(WPARAM wParam, LPARAM lParam);
-//functions for general use (defined in general.cpp)
+int UpdateSrmmDlg(WPARAM, LPARAM);
+int SmileyButtonCreate(WPARAM, LPARAM);
+int SmileyButtonPressed(WPARAM, LPARAM);
+
+// functions for general use (defined in general.cpp)
int CalculateTextHeight(HDC hdc, CHARFORMAT2 *chf);
const wchar_t* GetImageExt(CMStringW &fname);
diff --git a/plugins/TabSRMM/src/buttonsbar.cpp b/plugins/TabSRMM/src/buttonsbar.cpp index 7c39d01b8c..6d08d323cb 100644 --- a/plugins/TabSRMM/src/buttonsbar.cpp +++ b/plugins/TabSRMM/src/buttonsbar.cpp @@ -21,16 +21,6 @@ static int CB_InitDefaultButtons(WPARAM, LPARAM) bbd.pwszTooltip = LPGENW("Info button"); Srmm_AddButton(&bbd); - if (PluginConfig.g_SmileyAddAvail) { - bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_CREATEBYID; - bbd.dwButtonID = IDC_SMILEYBTN; - bbd.iButtonWidth = 0; - bbd.dwDefPos = 30; - bbd.hIcon = PluginConfig.g_buttonBarIconHandles[9]; - bbd.pwszTooltip = LPGENW("Insert emoticon"); - Srmm_AddButton(&bbd); - } - bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISPUSHBUTTON | BBBF_CANBEHIDDEN | BBBF_CREATEBYID; bbd.dwButtonID = IDC_FONTBOLD; bbd.dwDefPos = 40; @@ -62,7 +52,6 @@ static int CB_InitDefaultButtons(WPARAM, LPARAM) bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_ISARROWBUTTON | BBBF_CREATEBYID; bbd.dwButtonID = IDOK; bbd.dwDefPos = 10; - bbd.iButtonWidth = 51; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[6]; bbd.pwszTooltip = LPGENW("Send message\nClick dropdown arrow for sending options"); Srmm_AddButton(&bbd); @@ -70,7 +59,6 @@ static int CB_InitDefaultButtons(WPARAM, LPARAM) bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; bbd.dwButtonID = IDC_SAVE; bbd.dwDefPos = 20; - bbd.iButtonWidth = 0; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[8]; bbd.pwszTooltip = LPGENW("Close session"); Srmm_AddButton(&bbd); @@ -78,7 +66,6 @@ static int CB_InitDefaultButtons(WPARAM, LPARAM) bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; bbd.dwButtonID = IDC_QUOTE; bbd.dwDefPos = 30; - bbd.iButtonWidth = 0; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[4]; bbd.pwszTooltip = LPGENW("Quote last message OR selected text"); Srmm_AddButton(&bbd); @@ -86,7 +73,6 @@ static int CB_InitDefaultButtons(WPARAM, LPARAM) bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; bbd.dwButtonID = IDC_TIME; bbd.dwDefPos = 40; - bbd.iButtonWidth = 0; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[2]; bbd.pwszTooltip = LPGENW("Message log options"); Srmm_AddButton(&bbd); @@ -94,7 +80,6 @@ static int CB_InitDefaultButtons(WPARAM, LPARAM) bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; bbd.dwButtonID = IDC_HISTORY; bbd.dwDefPos = 50; - bbd.iButtonWidth = 0; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[0]; bbd.pwszTooltip = LPGENW("View user's history"); Srmm_AddButton(&bbd); @@ -102,7 +87,6 @@ static int CB_InitDefaultButtons(WPARAM, LPARAM) bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; bbd.dwButtonID = IDC_PIC; bbd.dwDefPos = 60; - bbd.iButtonWidth = 0; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[7]; bbd.pwszTooltip = LPGENW("Edit user notes"); Srmm_AddButton(&bbd); @@ -112,7 +96,6 @@ static int CB_InitDefaultButtons(WPARAM, LPARAM) bbd.dwButtonID = 1; bbd.pszModuleName = "tb_splitter"; bbd.dwDefPos = 31; - bbd.iButtonWidth = 22; bbd.hIcon = 0; bbd.pwszTooltip = 0; Srmm_AddButton(&bbd); @@ -138,7 +121,6 @@ static int CB_InitDefaultButtons(WPARAM, LPARAM) bbd.bbbFlags = BBBF_ISCHATBUTTON | BBBF_ISPUSHBUTTON | BBBF_CREATEBYID; bbd.dwButtonID = IDC_BKGCOLOR; bbd.dwDefPos = 81; - bbd.iButtonWidth = 22; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[16]; bbd.pwszTooltip = LPGENW("Change background color"); Srmm_AddButton(&bbd); @@ -146,7 +128,6 @@ static int CB_InitDefaultButtons(WPARAM, LPARAM) bbd.bbbFlags = BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; bbd.dwButtonID = IDC_SHOWNICKLIST; bbd.dwDefPos = 22; - bbd.iButtonWidth = 22; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[19]; bbd.pwszTooltip = LPGENW("Toggle nick list"); Srmm_AddButton(&bbd); @@ -154,7 +135,6 @@ static int CB_InitDefaultButtons(WPARAM, LPARAM) bbd.bbbFlags = BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; bbd.dwButtonID = IDC_FILTER; bbd.dwDefPos = 24; - bbd.iButtonWidth = 22; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[18]; bbd.pwszTooltip = LPGENW("Event filter - right click to setup, left click to activate/deactivate"); Srmm_AddButton(&bbd); @@ -162,7 +142,6 @@ static int CB_InitDefaultButtons(WPARAM, LPARAM) bbd.bbbFlags = BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; bbd.dwButtonID = IDC_CHANMGR; bbd.dwDefPos = 33; - bbd.iButtonWidth = 22; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[17]; bbd.pwszTooltip = LPGENW("Channel manager"); Srmm_AddButton(&bbd); diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp index 423320a909..67d25d9174 100644 --- a/plugins/TabSRMM/src/chat/window.cpp +++ b/plugins/TabSRMM/src/chat/window.cpp @@ -1647,7 +1647,6 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(3, 3)); SendDlgItemMessage(hwndDlg, IDC_CHAT_LOG, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(3, 3)); dat->Panel->loadHeight(); - Utils::enableDlgControl(hwndDlg, IDC_SMILEYBTN, true); if (PluginConfig.g_hMenuTrayUnread != 0 && dat->hContact != 0 && dat->szProto != NULL) UpdateTrayMenu(0, dat->wStatus, dat->szProto, dat->szStatus, dat->hContact, FALSE); @@ -1712,7 +1711,6 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar case GC_SETWNDPROPS: InitButtons(hwndDlg, si); - ConfigureSmileyButton(dat); SendDlgItemMessage(hwndDlg, IDC_CHAT_LOG, EM_SETBKGNDCOLOR, 0, M.GetDword(FONTMODULE, SRMSGSET_BKGCOLOUR, SRMSGDEFSET_BKGCOLOUR)); DM_InitRichEdit(dat); @@ -2740,28 +2738,6 @@ LABEL_SHOWWINDOW: } break; - case IDC_SMILEY: - case IDC_SMILEYBTN: - if (lParam == 0) - GetWindowRect(GetDlgItem(hwndDlg, IDC_SMILEYBTN), &rc); - else - GetWindowRect((HWND)lParam, &rc); - { - SMADD_SHOWSEL3 smaddInfo = { sizeof(smaddInfo) }; - smaddInfo.hwndTarget = GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE); - smaddInfo.targetMessage = EM_REPLACESEL; - smaddInfo.targetWParam = TRUE; - smaddInfo.Protocolname = si->pszModule; - smaddInfo.Direction = 0; - smaddInfo.xPosition = rc.left; - smaddInfo.yPosition = rc.top + 24; - smaddInfo.hContact = si->hContact; - smaddInfo.hwndParent = dat->pContainer->hwnd; - if (PluginConfig.g_SmileyAddAvail) - CallService(MS_SMILEYADD_SHOWSELECTION, 0, (LPARAM)&smaddInfo); - } - break; - case IDC_CHAT_HISTORY: if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_CHAT_HISTORY))) { MODULEINFO *pInfo = pci->MM_FindModule(si->pszModule); @@ -3217,7 +3193,6 @@ LABEL_SHOWWINDOW: break; case DM_SMILEYOPTIONSCHANGED: - ConfigureSmileyButton(dat); SendMessage(hwndDlg, GC_REDRAWLOG, 0, 1); break; diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index d4d0ee5983..8aeb9d5bcb 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -171,9 +171,6 @@ LRESULT TSAPI DM_GenericHotkeysCheck(MSG *message, TWindowData *dat) dat->Panel->setActive(!dat->Panel->isActive()); dat->Panel->showHide(); return 1; - case TABSRMM_HK_EMOTICONS: - SendMessage(hwndDlg, WM_COMMAND, IDC_SMILEYBTN, 0); - return 1; case TABSRMM_HK_TOGGLETOOLBAR: SendMessage(hwndDlg, WM_COMMAND, IDC_TOGGLETOOLBAR, 0); return 1; @@ -267,31 +264,6 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *pContainer, T CallService(MS_HISTORY_SHOWCONTACTHISTORY, dat->hContact, 0); break; - case IDC_SMILEYBTN: - if (dat->bShowSmileys && PluginConfig.g_SmileyAddAvail) { - MCONTACT hContact = dat->cache->getActiveContact(); - if (CheckValidSmileyPack(dat->cache->getProto(), hContact) != 0) { - if (lParam == 0) - GetWindowRect(GetDlgItem(hwndDlg, IDC_SMILEYBTN), &rc); - else - GetWindowRect((HWND)lParam, &rc); - - SMADD_SHOWSEL3 smaddInfo = { 0 }; - smaddInfo.cbSize = sizeof(SMADD_SHOWSEL3); - smaddInfo.hwndTarget = GetDlgItem(hwndDlg, IDC_MESSAGE); - smaddInfo.targetMessage = EM_REPLACESEL; - smaddInfo.targetWParam = TRUE; - smaddInfo.Protocolname = const_cast<char *>(dat->cache->getProto()); - smaddInfo.Direction = 0; - smaddInfo.xPosition = rc.left; - smaddInfo.yPosition = rc.top + 24; - smaddInfo.hwndParent = hwndContainer; - smaddInfo.hContact = hContact; - CallService(MS_SMILEYADD_SHOWSELECTION, (WPARAM)hwndContainer, (LPARAM)&smaddInfo); - } - } - break; - case IDC_TIME: submenu = GetSubMenu(PluginConfig.g_hMenuContext, 2); MsgWindowUpdateMenu(dat, submenu, MENU_LOGMENU); diff --git a/plugins/TabSRMM/src/hotkeyhandler.cpp b/plugins/TabSRMM/src/hotkeyhandler.cpp index 35233489fd..9425bcb192 100644 --- a/plugins/TabSRMM/src/hotkeyhandler.cpp +++ b/plugins/TabSRMM/src/hotkeyhandler.cpp @@ -50,7 +50,6 @@ static HOTKEYDESC _hotkeydescs[] = { { 0, "tabsrmm_sendlater", LPGEN("Toggle send later"), TABSRMM_HK_SECTION_IM, 0, HOTKEYCODE(HOTKEYF_CONTROL | HOTKEYF_SHIFT, 'S'), TABSRMM_HK_TOGGLESENDLATER },
{ 0, "tabsrmm_send", LPGEN("Send message"), TABSRMM_HK_SECTION_GENERIC, 0, 0, TABSRMM_HK_SEND },
- { 0, "tabsrmm_emot", LPGEN("Smiley selector"), TABSRMM_HK_SECTION_GENERIC, 0, HOTKEYCODE(HOTKEYF_ALT, 'E'), TABSRMM_HK_EMOTICONS },
{ 0, "tabsrmm_hist", LPGEN("Show message history"), TABSRMM_HK_SECTION_GENERIC, 0, HOTKEYCODE(HOTKEYF_ALT, 'H'), TABSRMM_HK_HISTORY },
{ 0, "tabsrmm_sendmenu", LPGEN("Show send menu"), TABSRMM_HK_SECTION_IM, 0, HOTKEYCODE(HOTKEYF_CONTROL, 'S'), TABSRMM_HK_SENDMENU },
{ 0, "tabsrmm_protomenu", LPGEN("Show protocol menu"), TABSRMM_HK_SECTION_IM, 0, HOTKEYCODE(HOTKEYF_CONTROL, 'P'), TABSRMM_HK_PROTOMENU },
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index cb92cdf4e0..8a7660a4c1 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -413,8 +413,6 @@ void TSAPI SetDialogToType(HWND hwndDlg) if (!dat->SendFormat)
ShowMultipleControls(hwndDlg, formatControls, _countof(formatControls), SW_HIDE);
- ConfigureSmileyButton(dat);
-
if (dat->pContainer->hwndActive == hwndDlg)
UpdateReadChars(dat);
@@ -2940,7 +2938,6 @@ quote_from_last: break;
case DM_SMILEYOPTIONSCHANGED:
- ConfigureSmileyButton(dat);
SendMessage(hwndDlg, DM_REMAKELOG, 0, 0);
break;
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index d07dc77e1b..cbda23fd94 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -1652,25 +1652,6 @@ void TSAPI LoadOverrideTheme(TContainerData *pContainer) LoadThemeDefaults(pContainer);
}
-void TSAPI ConfigureSmileyButton(TWindowData *dat)
-{
- HWND hwndDlg = dat->hwnd;
- int nrSmileys = 0;
- int showToolbar = dat->pContainer->dwFlags & CNT_HIDETOOLBAR ? 0 : 1;
- int iItemID = IDC_SMILEYBTN;
-
- if (PluginConfig.g_SmileyAddAvail) {
- nrSmileys = CheckValidSmileyPack(dat->cache->getActiveProto(), dat->cache->getActiveContact());
- dat->bShowSmileys = true;
- }
-
- if (nrSmileys == 0 || dat->hContact == 0)
- dat->bShowSmileys = false;
-
- Utils::showDlgControl(hwndDlg, iItemID, (dat->bShowSmileys && showToolbar) ? SW_SHOW : SW_HIDE);
- Utils::enableDlgControl(hwndDlg, iItemID, dat->bShowSmileys);
-}
-
HICON TSAPI GetXStatusIcon(const TWindowData *dat)
{
BYTE xStatus = dat->cache->getXStatusId();
diff --git a/plugins/TabSRMM/src/msgdlgutils.h b/plugins/TabSRMM/src/msgdlgutils.h index 0563e33832..1b2e94beb8 100644 --- a/plugins/TabSRMM/src/msgdlgutils.h +++ b/plugins/TabSRMM/src/msgdlgutils.h @@ -63,7 +63,6 @@ void TSAPI HandlePasteAndSend(const TWindowData *dat); int TSAPI MsgWindowDrawHandler(WPARAM wParam, LPARAM lParam, TWindowData *dat);
void TSAPI LoadOverrideTheme(TContainerData *pContainer);
void TSAPI LoadThemeDefaults(TContainerData *pContainer);
-void TSAPI ConfigureSmileyButton(TWindowData *dat);
int TSAPI CutContactName(const wchar_t *szold, wchar_t *sznew, size_t size);
void TSAPI SendNudge(const TWindowData *dat);
void TSAPI EnableSendButton(const TWindowData *dat, int iMode);
diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h index 38911e1741..0f05fc04e6 100644 --- a/plugins/TabSRMM/src/msgs.h +++ b/plugins/TabSRMM/src/msgs.h @@ -914,35 +914,34 @@ struct TABSRMM_SessionInfo { * core hotkey service ids
*/
-#define TABSRMM_HK_LASTUNREAD 2
-#define TABSRMM_HK_LASTRECENT 4
-#define TABSRMM_HK_PASTEANDSEND 8
-#define TABSRMM_HK_SETUSERPREFS 9
-#define TABSRMM_HK_CONTAINEROPTIONS 10
-#define TABSRMM_HK_NUDGE 11
-#define TABSRMM_HK_SENDFILE 12
-#define TABSRMM_HK_QUOTEMSG 13
-#define TABSRMM_HK_SEND 14
-#define TABSRMM_HK_EMOTICONS 15
-#define TABARMM_HK_TOGGLEINFOPANEL 16
-#define TABSRMM_HK_HISTORY 17
-#define TABSRMM_HK_TOGGLETOOLBAR 18
-#define TABSRMM_HK_TOGGLEMULTISEND 19
-#define TABSRMM_HK_TOGGLERTL 20
-#define TABSRMM_HK_USERMENU 21
-#define TABSRMM_HK_USERDETAILS 22
-#define TABSRMM_HK_TOGGLEINFOPANEL 23
-#define TABSRMM_HK_CLEARLOG 24
-#define TABSRMM_HK_EDITNOTES 25
-#define TABSRMM_HK_TOGGLESENDLATER 26
-#define TABSRMM_HK_TOGGLESIDEBAR 27
-#define TABSRMM_HK_CHANNELMGR 28
-#define TABSRMM_HK_FILTERTOGGLE 29
-#define TABSRMM_HK_LISTTOGGLE 30
-#define TABSRMM_HK_MUC_SHOWSERVER 31
-#define TABSRMM_HK_CLOSE_OTHER 32
-#define TABSRMM_HK_SENDMENU 33
-#define TABSRMM_HK_PROTOMENU 34
+#define TABSRMM_HK_LASTUNREAD 2
+#define TABSRMM_HK_LASTRECENT 4
+#define TABSRMM_HK_PASTEANDSEND 8
+#define TABSRMM_HK_SETUSERPREFS 9
+#define TABSRMM_HK_CONTAINEROPTIONS 10
+#define TABSRMM_HK_NUDGE 11
+#define TABSRMM_HK_SENDFILE 12
+#define TABSRMM_HK_QUOTEMSG 13
+#define TABSRMM_HK_SEND 14
+#define TABARMM_HK_TOGGLEINFOPANEL 16
+#define TABSRMM_HK_HISTORY 17
+#define TABSRMM_HK_TOGGLETOOLBAR 18
+#define TABSRMM_HK_TOGGLEMULTISEND 19
+#define TABSRMM_HK_TOGGLERTL 20
+#define TABSRMM_HK_USERMENU 21
+#define TABSRMM_HK_USERDETAILS 22
+#define TABSRMM_HK_TOGGLEINFOPANEL 23
+#define TABSRMM_HK_CLEARLOG 24
+#define TABSRMM_HK_EDITNOTES 25
+#define TABSRMM_HK_TOGGLESENDLATER 26
+#define TABSRMM_HK_TOGGLESIDEBAR 27
+#define TABSRMM_HK_CHANNELMGR 28
+#define TABSRMM_HK_FILTERTOGGLE 29
+#define TABSRMM_HK_LISTTOGGLE 30
+#define TABSRMM_HK_MUC_SHOWSERVER 31
+#define TABSRMM_HK_CLOSE_OTHER 32
+#define TABSRMM_HK_SENDMENU 33
+#define TABSRMM_HK_PROTOMENU 34
#define TABSRMM_HK_SECTION_IM LPGEN("Message windows - IM")
#define TABSRMM_HK_SECTION_GENERIC LPGEN("Message windows - all")
diff --git a/plugins/TabSRMM/src/resource.h b/plugins/TabSRMM/src/resource.h index 029ae6c4d9..610daca35e 100644 --- a/plugins/TabSRMM/src/resource.h +++ b/plugins/TabSRMM/src/resource.h @@ -179,7 +179,6 @@ #define IDC_DELAY_ERR 1102
#define IDC_RTL 1103
#define IDC_PIC 1104
-#define IDC_SMILEYBTN 1105
#define IDC_FONTBOLD 1106
#define IDC_FONTITALIC 1107
#define IDC_FONTUNDERLINE 1108
|