diff options
author | George Hazan <george.hazan@gmail.com> | 2014-01-16 18:15:36 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-01-16 18:15:36 +0000 |
commit | 41ba18e9cb1c340cb80c637817231b487c54562e (patch) | |
tree | 9d58a0dde3a9d1b10c1d5d4fc939c7f34f3f3a37 /plugins/Scriver/src/chat | |
parent | ce83acf4dd133fdd736695d566d7db59937104f2 (diff) |
Scriver nicklist icons
git-svn-id: http://svn.miranda-ng.org/main/trunk@7683 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Scriver/src/chat')
-rw-r--r-- | plugins/Scriver/src/chat/chat.h | 2 | ||||
-rw-r--r-- | plugins/Scriver/src/chat/main.cpp | 26 | ||||
-rw-r--r-- | plugins/Scriver/src/chat/window.cpp | 38 |
3 files changed, 44 insertions, 22 deletions
diff --git a/plugins/Scriver/src/chat/chat.h b/plugins/Scriver/src/chat/chat.h index a14407e314..ffe9f804bb 100644 --- a/plugins/Scriver/src/chat/chat.h +++ b/plugins/Scriver/src/chat/chat.h @@ -82,7 +82,7 @@ typedef struct{ COLORCHOOSER;
//main.c
-void LoadIcons(void);
+void LoadChatIcons(void);
void UpgradeCheck(void);
//colorchooser.c
diff --git a/plugins/Scriver/src/chat/main.cpp b/plugins/Scriver/src/chat/main.cpp index 5a2cb0854c..d37559ea20 100644 --- a/plugins/Scriver/src/chat/main.cpp +++ b/plugins/Scriver/src/chat/main.cpp @@ -118,6 +118,30 @@ static void OnCreateModule(MODULEINFO *mi) mi->hOfflineIconBig = LoadSkinnedProtoIconBig(mi->pszModule, ID_STATUS_OFFLINE);
}
+void LoadChatIcons(void)
+{
+ pci->hIcons[ICON_ACTION] = GetCachedIcon("chat_log_action");
+ pci->hIcons[ICON_ADDSTATUS] = GetCachedIcon("chat_log_addstatus");
+ pci->hIcons[ICON_HIGHLIGHT] = GetCachedIcon("chat_log_highlight");
+ pci->hIcons[ICON_INFO] = GetCachedIcon("chat_log_info");
+ pci->hIcons[ICON_JOIN] = GetCachedIcon("chat_log_join");
+ pci->hIcons[ICON_KICK] = GetCachedIcon("chat_log_kick");
+ pci->hIcons[ICON_MESSAGE] = GetCachedIcon("chat_log_message_in");
+ pci->hIcons[ICON_MESSAGEOUT] = GetCachedIcon("chat_log_message_out");
+ pci->hIcons[ICON_NICK] = GetCachedIcon("chat_log_nick");
+ pci->hIcons[ICON_NOTICE] = GetCachedIcon("chat_log_notice");
+ pci->hIcons[ICON_PART] = GetCachedIcon("chat_log_part");
+ pci->hIcons[ICON_QUIT] = GetCachedIcon("chat_log_quit");
+ pci->hIcons[ICON_REMSTATUS] = GetCachedIcon("chat_log_removestatus");
+ pci->hIcons[ICON_TOPIC] = GetCachedIcon("chat_log_topic");
+ pci->hIcons[ICON_STATUS1] = GetCachedIcon("chat_status1");
+ pci->hIcons[ICON_STATUS2] = GetCachedIcon("chat_status2");
+ pci->hIcons[ICON_STATUS3] = GetCachedIcon("chat_status3");
+ pci->hIcons[ICON_STATUS4] = GetCachedIcon("chat_status4");
+ pci->hIcons[ICON_STATUS0] = GetCachedIcon("chat_status0");
+ pci->hIcons[ICON_STATUS5] = GetCachedIcon("chat_status5");
+}
+
int Chat_Load()
{
mir_getCI(&g_Settings);
@@ -140,6 +164,8 @@ int Chat_Load() pci->OnFlashWindow = OnFlashWindow;
pci->ShowRoom = ShowRoom;
+ LoadChatIcons();
+
g_hMenu = LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_MENU));
TranslateMenu(g_hMenu);
return 0;
diff --git a/plugins/Scriver/src/chat/window.cpp b/plugins/Scriver/src/chat/window.cpp index 4d0159739d..091bab7cbd 100644 --- a/plugins/Scriver/src/chat/window.cpp +++ b/plugins/Scriver/src/chat/window.cpp @@ -555,17 +555,17 @@ static INT_PTR CALLBACK FilterWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP switch (uMsg) {
case WM_INITDIALOG:
si = (SESSION_INFO *)lParam;
- CheckDlgButton(hwndDlg, IDC_CHAT_1, si->iLogFilterFlags&GC_EVENT_ACTION);
- CheckDlgButton(hwndDlg, IDC_CHAT_2, si->iLogFilterFlags&GC_EVENT_MESSAGE);
- CheckDlgButton(hwndDlg, IDC_CHAT_3, si->iLogFilterFlags&GC_EVENT_NICK);
- CheckDlgButton(hwndDlg, IDC_CHAT_4, si->iLogFilterFlags&GC_EVENT_JOIN);
- CheckDlgButton(hwndDlg, IDC_CHAT_5, si->iLogFilterFlags&GC_EVENT_PART);
- CheckDlgButton(hwndDlg, IDC_CHAT_6, si->iLogFilterFlags&GC_EVENT_TOPIC);
- CheckDlgButton(hwndDlg, IDC_CHAT_7, si->iLogFilterFlags&GC_EVENT_ADDSTATUS);
- CheckDlgButton(hwndDlg, IDC_CHAT_8, si->iLogFilterFlags&GC_EVENT_INFORMATION);
- CheckDlgButton(hwndDlg, IDC_CHAT_9, si->iLogFilterFlags&GC_EVENT_QUIT);
- CheckDlgButton(hwndDlg, IDC_CHAT_10, si->iLogFilterFlags&GC_EVENT_KICK);
- CheckDlgButton(hwndDlg, IDC_CHAT_11, si->iLogFilterFlags&GC_EVENT_NOTICE);
+ CheckDlgButton(hwndDlg, IDC_CHAT_1, si->iLogFilterFlags & GC_EVENT_ACTION);
+ CheckDlgButton(hwndDlg, IDC_CHAT_2, si->iLogFilterFlags & GC_EVENT_MESSAGE);
+ CheckDlgButton(hwndDlg, IDC_CHAT_3, si->iLogFilterFlags & GC_EVENT_NICK);
+ CheckDlgButton(hwndDlg, IDC_CHAT_4, si->iLogFilterFlags & GC_EVENT_JOIN);
+ CheckDlgButton(hwndDlg, IDC_CHAT_5, si->iLogFilterFlags & GC_EVENT_PART);
+ CheckDlgButton(hwndDlg, IDC_CHAT_6, si->iLogFilterFlags & GC_EVENT_TOPIC);
+ CheckDlgButton(hwndDlg, IDC_CHAT_7, si->iLogFilterFlags & GC_EVENT_ADDSTATUS);
+ CheckDlgButton(hwndDlg, IDC_CHAT_8, si->iLogFilterFlags & GC_EVENT_INFORMATION);
+ CheckDlgButton(hwndDlg, IDC_CHAT_9, si->iLogFilterFlags & GC_EVENT_QUIT);
+ CheckDlgButton(hwndDlg, IDC_CHAT_10, si->iLogFilterFlags & GC_EVENT_KICK);
+ CheckDlgButton(hwndDlg, IDC_CHAT_11, si->iLogFilterFlags & GC_EVENT_NOTICE);
break;
case WM_CTLCOLOREDIT:
@@ -601,7 +601,7 @@ static INT_PTR CALLBACK FilterWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP if (IsDlgButtonChecked(hwndDlg, IDC_CHAT_11) == BST_CHECKED)
iFlags |= GC_EVENT_NOTICE;
- if (iFlags&GC_EVENT_ADDSTATUS)
+ if (iFlags & GC_EVENT_ADDSTATUS)
iFlags |= GC_EVENT_REMOVESTATUS;
SendMessage(si->hWnd, GC_CHANGEFILTERFLAG, 0, (LPARAM)iFlags);
@@ -623,16 +623,12 @@ static LRESULT CALLBACK ButtonSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, L {
switch (msg) {
case WM_RBUTTONUP:
- HWND hFilter = GetDlgItem(GetParent(hwnd), IDC_CHAT_FILTER);
- HWND hColor = GetDlgItem(GetParent(hwnd), IDC_CHAT_COLOR);
- HWND hBGColor = GetDlgItem(GetParent(hwnd), IDC_CHAT_BKGCOLOR);
-
if (db_get_b(NULL, "Chat", "RightClickFilter", 0) != 0) {
- if (hFilter == hwnd)
+ if (GetDlgItem(GetParent(hwnd), IDC_CHAT_FILTER) == hwnd)
SendMessage(GetParent(hwnd), GC_SHOWFILTERMENU, 0, 0);
- if (hColor == hwnd)
+ if (GetDlgItem(GetParent(hwnd), IDC_CHAT_COLOR) == hwnd)
SendMessage(GetParent(hwnd), GC_SHOWCOLORCHOOSER, 0, (LPARAM)IDC_CHAT_COLOR);
- if (hBGColor == hwnd)
+ if (GetDlgItem(GetParent(hwnd), IDC_CHAT_BKGCOLOR) == hwnd)
SendMessage(GetParent(hwnd), GC_SHOWCOLORCHOOSER, 0, (LPARAM)IDC_CHAT_BKGCOLOR);
}
break;
@@ -1463,11 +1459,11 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar case GC_UPDATENICKLIST:
SendDlgItemMessage(hwndDlg, IDC_CHAT_LIST, WM_SETREDRAW, FALSE, 0);
SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_LIST), LB_RESETCONTENT, 0, 0);
- for (int index = 0; index<si->nUsersInNicklist; index++) {
+ for (int index = 0; index < si->nUsersInNicklist; index++) {
USERINFO *ui = pci->SM_GetUserFromIndex(si->ptszID, si->pszModule, index);
if (ui) {
char szIndicator = SM_GetStatusIndicator(si, ui);
- if (szIndicator>'\0') {
+ if (szIndicator > '\0') {
static TCHAR ptszBuf[128];
mir_sntprintf(ptszBuf, SIZEOF(ptszBuf), _T("%c%s"), szIndicator, ui->pszNick);
SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_LIST), LB_ADDSTRING, 0, (LPARAM)ptszBuf);
|