diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/FTPFileYM/src/manager.cpp | 8 | ||||
-rw-r--r-- | plugins/HistorySweeperLight/src/options.cpp | 7 | ||||
-rw-r--r-- | plugins/IEView/src/Options.cpp | 6 | ||||
-rw-r--r-- | plugins/KeyboardNotify/src/ignore.cpp | 14 | ||||
-rw-r--r-- | plugins/KeyboardNotify/src/stdafx.h | 1 | ||||
-rw-r--r-- | plugins/NewXstatusNotify/src/indsnd.cpp | 4 | ||||
-rw-r--r-- | plugins/NoHistory/src/options.cpp | 5 | ||||
-rw-r--r-- | plugins/Popup/src/opt_contacts.cpp | 10 | ||||
-rw-r--r-- | plugins/Scriver/src/chat_main.cpp | 3 | ||||
-rw-r--r-- | plugins/Scriver/src/globals.cpp | 10 | ||||
-rw-r--r-- | plugins/Scriver/src/msglog.cpp | 6 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp | 270 |
12 files changed, 163 insertions, 181 deletions
diff --git a/plugins/FTPFileYM/src/manager.cpp b/plugins/FTPFileYM/src/manager.cpp index c4ea35a8f3..98f6818a23 100644 --- a/plugins/FTPFileYM/src/manager.cpp +++ b/plugins/FTPFileYM/src/manager.cpp @@ -66,10 +66,10 @@ void Manager::initImageList() char buff[256];
m_himlStates = ImageList_Create(16, 16, ILC_COLOR32 | ILC_MASK, ServerList::FTP_COUNT + 4, 0);
- ImageList_AddIcon(m_himlStates, Skin_LoadIcon(SKINICON_OTHER_DELETE)); // image index 0 is useless for INDEXTOSTATEIMAGEMASK
- ImageList_AddIcon(m_himlStates, Skin_LoadIcon(SKINICON_OTHER_DELETE));
- ImageList_AddIcon(m_himlStates, Skin_LoadIcon(SKINICON_OTHER_NOTICK));
- ImageList_AddIcon(m_himlStates, Skin_LoadIcon(SKINICON_OTHER_TICK));
+ ImageList_AddSkinIcon(m_himlStates, SKINICON_OTHER_DELETE); // image index 0 is useless for INDEXTOSTATEIMAGEMASK
+ ImageList_AddSkinIcon(m_himlStates, SKINICON_OTHER_DELETE);
+ ImageList_AddSkinIcon(m_himlStates, SKINICON_OTHER_NOTICK);
+ ImageList_AddSkinIcon(m_himlStates, SKINICON_OTHER_TICK);
for (int i = 0; i < ServerList::FTP_COUNT; i++) {
mir_snprintf(buff, "ftp%d", i);
diff --git a/plugins/HistorySweeperLight/src/options.cpp b/plugins/HistorySweeperLight/src/options.cpp index dc032a06b4..50db5990f5 100644 --- a/plugins/HistorySweeperLight/src/options.cpp +++ b/plugins/HistorySweeperLight/src/options.cpp @@ -163,12 +163,9 @@ INT_PTR CALLBACK DlgProcHSOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM lParam) TranslateDialogDefault(hwndDlg);
{
HIMAGELIST hIml = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_MASK | ILC_COLOR32, 2, 2);
+ ImageList_AddSkinIcon(hIml, SKINICON_OTHER_SMALLDOT);
- HICON hIcon = Skin_LoadIcon(SKINICON_OTHER_SMALLDOT);
- ImageList_AddIcon(hIml, hIcon);
- IcoLib_ReleaseIcon(hIcon);
-
- hIcon = g_plugin.getIcon(IDI_ACT1);
+ HICON hIcon = g_plugin.getIcon(IDI_ACT1);
ImageList_AddIcon(hIml, hIcon);
SendDlgItemMessage(hwndDlg, IDC_ACT1, STM_SETICON, (WPARAM)hIcon, 0);
diff --git a/plugins/IEView/src/Options.cpp b/plugins/IEView/src/Options.cpp index b4dc6a1f85..e5bcbb89f8 100644 --- a/plugins/IEView/src/Options.cpp +++ b/plugins/IEView/src/Options.cpp @@ -287,11 +287,7 @@ static void RefreshProtoIcons() ImageList_AddIcon(hProtocolImageList, hIcon);
DestroyIcon(hIcon);
}
- else {
- hIcon = (HICON)Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
- ImageList_AddIcon(hProtocolImageList, hIcon);
- IcoLib_ReleaseIcon(hIcon);
- }
+ else ImageList_AddSkinIcon(hProtocolImageList, SKINICON_OTHER_MIRANDA);
}
}
diff --git a/plugins/KeyboardNotify/src/ignore.cpp b/plugins/KeyboardNotify/src/ignore.cpp index bf8f81bdcf..fd9808108c 100644 --- a/plugins/KeyboardNotify/src/ignore.cpp +++ b/plugins/KeyboardNotify/src/ignore.cpp @@ -195,13 +195,13 @@ INT_PTR CALLBACK DlgProcIgnoreOptions(HWND hwndDlg, UINT msg, WPARAM, LPARAM lPa TranslateDialogDefault(hwndDlg);
{
HIMAGELIST hIml=ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 3+IGNOREEVENT_MAX, 3+IGNOREEVENT_MAX);
- ImageList_AddIcon(hIml, Skin_LoadIcon(SKINICON_OTHER_SMALLDOT));
- ImageList_AddIcon(hIml, Skin_LoadIcon(SKINICON_OTHER_FILLEDBLOB));
- ImageList_AddIcon(hIml, Skin_LoadIcon(SKINICON_OTHER_EMPTYBLOB));
- ImageList_AddIcon(hIml, Skin_LoadIcon(SKINICON_EVENT_MESSAGE));
- ImageList_AddIcon(hIml, Skin_LoadIcon(SKINICON_EVENT_URL));
- ImageList_AddIcon(hIml, Skin_LoadIcon(SKINICON_EVENT_FILE));
- ImageList_AddIcon(hIml, Skin_LoadIcon(SKINICON_OTHER_MIRANDA));
+ ImageList_AddSkinIcon(hIml, SKINICON_OTHER_SMALLDOT);
+ ImageList_AddSkinIcon(hIml, SKINICON_OTHER_FILLEDBLOB);
+ ImageList_AddSkinIcon(hIml, SKINICON_OTHER_EMPTYBLOB);
+ ImageList_AddSkinIcon(hIml, SKINICON_EVENT_MESSAGE);
+ ImageList_AddSkinIcon(hIml, SKINICON_EVENT_URL);
+ ImageList_AddSkinIcon(hIml, SKINICON_EVENT_FILE);
+ ImageList_AddSkinIcon(hIml, SKINICON_OTHER_MIRANDA);
SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_SETEXTRAIMAGELIST, 0, (LPARAM)hIml);
for (int i=0; i < _countof(hIcons); i++)
hIcons[i] = ImageList_GetIcon(hIml, 1+i, ILD_NORMAL);
diff --git a/plugins/KeyboardNotify/src/stdafx.h b/plugins/KeyboardNotify/src/stdafx.h index 3b01954284..cce961e02f 100644 --- a/plugins/KeyboardNotify/src/stdafx.h +++ b/plugins/KeyboardNotify/src/stdafx.h @@ -31,6 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <newpluginapi.h>
#include <m_database.h>
#include <m_options.h>
+#include <m_icolib.h>
#include <m_clistint.h>
#include <m_langpack.h>
#include <m_protosvc.h>
diff --git a/plugins/NewXstatusNotify/src/indsnd.cpp b/plugins/NewXstatusNotify/src/indsnd.cpp index fc5b01d5e7..1dbbf99795 100644 --- a/plugins/NewXstatusNotify/src/indsnd.cpp +++ b/plugins/NewXstatusNotify/src/indsnd.cpp @@ -95,7 +95,7 @@ HIMAGELIST GetStatusIconsImgList(char *szProto) if (hList != nullptr) {
for (int i = ID_STATUS_MIN; i <= ID_STATUS_MAX; i++)
ImageList_AddIcon(hList, Skin_LoadProtoIcon(szProto, i));
- ImageList_AddIcon(hList, Skin_LoadIcon(SKINICON_OTHER_USERONLINE));
+ ImageList_AddSkinIcon(hList, SKINICON_OTHER_USERONLINE);
}
}
@@ -439,7 +439,7 @@ INT_PTR CALLBACK DlgProcFiltering(HWND hwndDlg, UINT msg, WPARAM, LPARAM lParam) ImageList_AddIcon(hImageList, IcoLib_GetIconByHandle(iconList[ICO_ENABLEALL].hIcolib));
SendDlgItemMessage(hwndDlg, IDC_ENABLEALLICON, STM_SETICON, (WPARAM)ImageList_GetIcon(hImageList, EXTRA_IMAGE_ENABLEALL, ILD_NORMAL), 0);
- ImageList_AddIcon(hImageList, Skin_LoadIcon(SKINICON_OTHER_SMALLDOT));
+ ImageList_AddSkinIcon(hImageList, SKINICON_OTHER_SMALLDOT);
SendDlgItemMessage(hwndDlg, IDC_INDSNDLIST, CLM_SETEXTRAIMAGELIST, 0, (LPARAM)hImageList);
SendDlgItemMessage(hwndDlg, IDC_INDSNDLIST, CLM_SETEXTRACOLUMNS, 8, 0);
diff --git a/plugins/NoHistory/src/options.cpp b/plugins/NoHistory/src/options.cpp index 3e754678fa..3107787b21 100644 --- a/plugins/NoHistory/src/options.cpp +++ b/plugins/NoHistory/src/options.cpp @@ -102,9 +102,10 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA hwndList = GetDlgItem(hwndDlg, IDC_LIST);
{
HIMAGELIST hIml = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 2, 2);
- ImageList_AddIcon(hIml, g_plugin.getIcon(IDI_HKEEP));
- ImageList_AddIcon(hIml, g_plugin.getIcon(IDI_HREMOVE));
+ g_plugin.addImgListIcon(hIml, IDI_HKEEP);
+ g_plugin.addImgListIcon(hIml, IDI_HREMOVE);
SendMessage(hwndList, CLM_SETEXTRAIMAGELIST, 0, (LPARAM)hIml);
+
SendDlgItemMessage(hwndDlg, IDC_PIC_KEEP, STM_SETICON, (WPARAM)g_plugin.getIcon(IDI_HKEEP), 0);
SendDlgItemMessage(hwndDlg, IDC_PIC_REMOVE, STM_SETICON, (WPARAM)g_plugin.getIcon(IDI_HREMOVE), 0);
}
diff --git a/plugins/Popup/src/opt_contacts.cpp b/plugins/Popup/src/opt_contacts.cpp index 1ce1529047..55b17d1655 100644 --- a/plugins/Popup/src/opt_contacts.cpp +++ b/plugins/Popup/src/opt_contacts.cpp @@ -52,11 +52,11 @@ INT_PTR CALLBACK DlgProcContactOpts(HWND hwnd, UINT msg, WPARAM, LPARAM lParam) SendDlgItemMessage(hwnd, IDC_ICO_BLOCK, STM_SETICON, (WPARAM)g_plugin.getIcon(IDI_OPT_BLOCK), 0);
{
HIMAGELIST hIml = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 5, 5);
- ImageList_AddIcon(hIml, Skin_LoadIcon(SKINICON_OTHER_SMALLDOT));
- ImageList_AddIcon(hIml, g_plugin.getIcon(IDI_ACT_OK));
- ImageList_AddIcon(hIml, g_plugin.getIcon(IDI_OPT_FAVORITE));
- ImageList_AddIcon(hIml, g_plugin.getIcon(IDI_OPT_FULLSCREEN));
- ImageList_AddIcon(hIml, g_plugin.getIcon(IDI_OPT_BLOCK));
+ ImageList_AddSkinIcon(hIml, SKINICON_OTHER_SMALLDOT);
+ g_plugin.addImgListIcon(hIml, IDI_ACT_OK);
+ g_plugin.addImgListIcon(hIml, IDI_OPT_FAVORITE);
+ g_plugin.addImgListIcon(hIml, IDI_OPT_FULLSCREEN);
+ g_plugin.addImgListIcon(hIml, IDI_OPT_BLOCK);
SendDlgItemMessage(hwnd, IDC_LIST, CLM_SETEXTRAIMAGELIST, 0, (LPARAM)hIml);
SendDlgItemMessage(hwnd, IDC_LIST, CLM_SETEXTRACOLUMNS, 4 /*_countof(sttIcons)*/, 0);
sttResetListOptions(GetDlgItem(hwnd, IDC_LIST));
diff --git a/plugins/Scriver/src/chat_main.cpp b/plugins/Scriver/src/chat_main.cpp index 397ac4ae75..6fdf6ac8bc 100644 --- a/plugins/Scriver/src/chat_main.cpp +++ b/plugins/Scriver/src/chat_main.cpp @@ -88,8 +88,7 @@ static MODULEINFO* MM_CreateModule() static void OnCreateModule(MODULEINFO *mi)
{
HIMAGELIST hList = ImageList_Create(16, 16, ILC_COLOR32 | ILC_MASK, 0, 0);
-
- int overlayIcon = ImageList_AddIcon(hList, g_plugin.getIcon(IDI_OVERLAY));
+ int overlayIcon = g_plugin.addImgListIcon(hList, IDI_OVERLAY);
ImageList_SetOverlayImage(hList, overlayIcon, 1);
int index = ImageList_AddIcon(hList, Skin_LoadProtoIcon(mi->pszModule, ID_STATUS_ONLINE));
diff --git a/plugins/Scriver/src/globals.cpp b/plugins/Scriver/src/globals.cpp index bed9a909e6..0e4ba89823 100644 --- a/plugins/Scriver/src/globals.cpp +++ b/plugins/Scriver/src/globals.cpp @@ -230,15 +230,17 @@ void LoadGlobalIcons() if (it == 0)
ImageList_AddIcon_ProtoEx(g_dat.hButtonIconList, nullptr, ID_STATUS_OFFLINE);
else
- ImageList_AddIcon(g_dat.hButtonIconList, g_plugin.getIcon(it));
+ g_plugin.addImgListIcon(g_dat.hButtonIconList, it);
}
for (auto &it : chatButtonIcons)
- ImageList_AddIcon(g_dat.hChatButtonIconList, g_plugin.getIcon(it));
+ g_plugin.addImgListIcon(g_dat.hChatButtonIconList, it);
- ImageList_AddIcon(g_dat.hHelperIconList, g_plugin.getIcon(IDI_OVERLAY));
- int overlayIcon = ImageList_AddIcon(g_dat.hHelperIconList, g_plugin.getIcon(IDI_OVERLAY));
+ g_plugin.addImgListIcon(g_dat.hHelperIconList, IDI_OVERLAY);
+
+ int overlayIcon = g_plugin.addImgListIcon(g_dat.hHelperIconList, IDI_OVERLAY);
ImageList_SetOverlayImage(g_dat.hHelperIconList, overlayIcon, 1);
+
for (int i = IDI_GOOGLE; i < IDI_LASTICON; i++) {
HICON hIcon = (HICON)LoadImage(g_plugin.getInst(), MAKEINTRESOURCE(i), IMAGE_ICON, 0, 0, 0);
ImageList_AddIcon(g_dat.hSearchEngineIconList, hIcon);
diff --git a/plugins/Scriver/src/msglog.cpp b/plugins/Scriver/src/msglog.cpp index 2d1e397d61..67de067e91 100644 --- a/plugins/Scriver/src/msglog.cpp +++ b/plugins/Scriver/src/msglog.cpp @@ -793,17 +793,17 @@ void LoadMsgLogIcons(void) for (int i = 0; i < _countof(pLogIconBmpBits); i++) {
switch (i) {
case LOGICON_MSG_IN:
- ImageList_AddIcon(g_hImageList, g_plugin.getIcon(IDI_INCOMING));
+ g_plugin.addImgListIcon(g_hImageList, IDI_INCOMING);
hIcon = ImageList_GetIcon(g_hImageList, LOGICON_MSG_IN, ILD_NORMAL);
hBrush = hInBkgBrush;
break;
case LOGICON_MSG_OUT:
- ImageList_AddIcon(g_hImageList, g_plugin.getIcon(IDI_OUTGOING));
+ g_plugin.addImgListIcon(g_hImageList, IDI_OUTGOING);
hIcon = ImageList_GetIcon(g_hImageList, LOGICON_MSG_OUT, ILD_NORMAL);
hBrush = hOutBkgBrush;
break;
case LOGICON_MSG_NOTICE:
- ImageList_AddIcon(g_hImageList, g_plugin.getIcon(IDI_NOTICE));
+ g_plugin.addImgListIcon(g_hImageList, IDI_NOTICE);
hIcon = ImageList_GetIcon(g_hImageList, LOGICON_MSG_NOTICE, ILD_NORMAL);
hBrush = hBkgBrush;
break;
diff --git a/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp b/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp index 9ef607b19c..9a8e0f11d9 100644 --- a/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp +++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp @@ -25,7 +25,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * typedefs
***********************************************************************************************************/
-typedef struct {
+typedef struct
+{
lpExImParam ExImContact;
DB::CEnumList* pModules;
} EXPORTDATA, *LPEXPORTDATA;
@@ -34,14 +35,14 @@ typedef struct { * modules stuff
***********************************************************************************************************/
-/**
- * name: ExportTree_AppendModuleList
- * desc: according to the checked list items create the module list for exporting
- * param: hTree - handle to the window of the treeview
- * hParent - parent tree item for the item to add
- * pModules - module list to fill
- * return: nothing
- **/
+ /**
+ * name: ExportTree_AppendModuleList
+ * desc: according to the checked list items create the module list for exporting
+ * param: hTree - handle to the window of the treeview
+ * hParent - parent tree item for the item to add
+ * pModules - module list to fill
+ * return: nothing
+ **/
void ExportTree_AppendModuleList(HWND hTree, HTREEITEM hParent, DB::CEnumList* pModules)
{
TVITEMA tvi;
@@ -51,7 +52,7 @@ void ExportTree_AppendModuleList(HWND hTree, HTREEITEM hParent, DB::CEnumList* p CHAR szModule[MAXSETTING];
// add optional items
- tvi.mask = TVIF_STATE|TVIF_TEXT;
+ tvi.mask = TVIF_STATE | TVIF_TEXT;
tvi.stateMask = TVIS_STATEIMAGEMASK;
tvi.pszText = szModule;
tvi.cchTextMax = _countof(szModule);
@@ -62,9 +63,8 @@ void ExportTree_AppendModuleList(HWND hTree, HTREEITEM hParent, DB::CEnumList* p (
tvi.state == INDEXTOSTATEIMAGEMASK(0) ||
tvi.state == INDEXTOSTATEIMAGEMASK(2)
- )
- )
- {
+ )
+ ) {
pModules->Insert(tvi.pszText);
}
}
@@ -93,8 +93,7 @@ HTREEITEM ExportTree_FindItem(HWND hTree, HTREEITEM hParent, LPSTR pszText) for (tvi.hItem = TreeView_GetChild(hTree, hParent);
tvi.hItem != nullptr;
- tvi.hItem = TreeView_GetNextSibling(hTree, tvi.hItem))
- {
+ tvi.hItem = TreeView_GetNextSibling(hTree, tvi.hItem)) {
if (SendMessageA(hTree, TVM_GETITEMA, NULL, (LPARAM)&tvi) && !mir_strcmpi(tvi.pszText, pszText))
return tvi.hItem;
}
@@ -109,7 +108,7 @@ HTREEITEM ExportTree_FindItem(HWND hTree, HTREEITEM hParent, LPSTR pszText) * pszDesc - item label
* bUseImages - icons are loaded
* bState - 0-hide checkbox/1-unchecked/2-checked
- * return: return handle to added treeitem
+ * return: return handle to added treeitem
**/
HTREEITEM ExportTree_AddItem(HWND hTree, HTREEITEM hParent, LPSTR pszDesc, BYTE bUseImages, BYTE bState)
{
@@ -120,7 +119,7 @@ HTREEITEM ExportTree_AddItem(HWND hTree, HTREEITEM hParent, LPSTR pszDesc, BYTE tvii.hInsertAfter = TVI_SORT;
tvii.itemex.mask = TVIF_TEXT;
if (bUseImages) {
- tvii.itemex.mask |= TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+ tvii.itemex.mask |= TVIF_IMAGE | TVIF_SELECTEDIMAGE;
tvii.itemex.iImage = tvii.itemex.iSelectedImage = 1;
}
tvii.itemex.pszText = pszDesc;
@@ -143,7 +142,7 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar LPEXPORTDATA pDat = (LPEXPORTDATA)GetUserData(hDlg);
switch (uMsg) {
- case WM_INITDIALOG:
+ case WM_INITDIALOG:
{
BYTE bImagesLoaded = 0;
@@ -155,8 +154,8 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar // init the datastructure
if (!(pDat = (LPEXPORTDATA)mir_alloc(sizeof(EXPORTDATA))))
return FALSE;
- pDat->ExImContact = ((LPEXPORTDATA)lParam)->ExImContact;
- pDat->pModules = ((LPEXPORTDATA)lParam)->pModules;
+ pDat->ExImContact = ((LPEXPORTDATA)lParam)->ExImContact;
+ pDat->pModules = ((LPEXPORTDATA)lParam)->pModules;
SetUserData(hDlg, pDat);
// set icons
@@ -174,15 +173,13 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar OSVERSIONINFO osvi;
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
if (GetVersionEx(&osvi)) {
- HIMAGELIST hImages = ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),
- ((osvi.dwPlatformId == VER_PLATFORM_WIN32_NT && osvi.dwMajorVersion >= 5 && osvi.dwMinorVersion >= 1) ? ILC_COLOR32 : ILC_COLOR16)|ILC_MASK,0, 1);
- if (hImages != nullptr)
- {
+ HIMAGELIST hImages = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON),
+ ((osvi.dwPlatformId == VER_PLATFORM_WIN32_NT && osvi.dwMajorVersion >= 5 && osvi.dwMinorVersion >= 1) ? ILC_COLOR32 : ILC_COLOR16) | ILC_MASK, 0, 1);
+ if (hImages != nullptr) {
SendMessage(hTree, TVM_SETIMAGELIST, TVSIL_NORMAL, (LPARAM)hImages);
-
- HICON hIcon;
- bImagesLoaded = ((((hIcon = g_plugin.getIcon(IDI_LST_MODULES)) != nullptr) && 0 == ImageList_AddIcon(hImages, hIcon))
- && (((hIcon = g_plugin.getIcon(IDI_LST_FOLDER)) != nullptr) && 1 == ImageList_AddIcon(hImages, hIcon)));
+ g_plugin.addImgListIcon(hImages, IDI_LST_MODULES);
+ g_plugin.addImgListIcon(hImages, IDI_LST_FOLDER);
+ bImagesLoaded = true;
}
}
}
@@ -195,29 +192,29 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar }
// Set the Window Title and description
{
- LPCTSTR name = nullptr;
- wchar_t oldTitle[MAXDATASIZE],
- newTitle[MAXDATASIZE];
+ LPCTSTR name = nullptr;
+ wchar_t oldTitle[MAXDATASIZE],
+ newTitle[MAXDATASIZE];
switch (pDat->ExImContact->Typ) {
- case EXIM_ALL:
- case EXIM_GROUP:
- name = TranslateT("All Contacts");
- break;
- case EXIM_CONTACT:
- if (pDat->ExImContact->hContact == NULL) {
- name = TranslateT("Owner");
- }
- else {
- name = Clist_GetContactDisplayName(pDat->ExImContact->hContact);
- }
- break;
- case EXIM_SUBGROUP:
- name = (LPCTSTR) pDat->ExImContact->ptszName;
- break;
- case EXIM_ACCOUNT:
- PROTOACCOUNT* acc = Proto_GetAccount(pDat->ExImContact->pszName);
- name = (LPCTSTR) acc->tszAccountName;
- break;
+ case EXIM_ALL:
+ case EXIM_GROUP:
+ name = TranslateT("All Contacts");
+ break;
+ case EXIM_CONTACT:
+ if (pDat->ExImContact->hContact == NULL) {
+ name = TranslateT("Owner");
+ }
+ else {
+ name = Clist_GetContactDisplayName(pDat->ExImContact->hContact);
+ }
+ break;
+ case EXIM_SUBGROUP:
+ name = (LPCTSTR)pDat->ExImContact->ptszName;
+ break;
+ case EXIM_ACCOUNT:
+ PROTOACCOUNT* acc = Proto_GetAccount(pDat->ExImContact->pszName);
+ name = (LPCTSTR)acc->tszAccountName;
+ break;
}
TranslateDialogDefault(hDlg); //to translate oldTitle
GetWindowText(hDlg, oldTitle, _countof(oldTitle));
@@ -241,11 +238,11 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar // add items that are always exported
tviiT.hParent = TVI_ROOT;
tviiT.hInsertAfter = TVI_FIRST;
- tviiT.itemex.mask = TVIF_TEXT|TVIF_STATE;
+ tviiT.itemex.mask = TVIF_TEXT | TVIF_STATE;
tviiT.itemex.pszText = TranslateT("Required modules");
tviiT.itemex.state = tviiT.itemex.stateMask = TVIS_EXPANDED;
if (bImagesLoaded) {
- tviiT.itemex.mask |= TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+ tviiT.itemex.mask |= TVIF_IMAGE | TVIF_SELECTEDIMAGE;
tviiT.itemex.iImage = tviiT.itemex.iSelectedImage = 0;
}
if (hItemEssential = TreeView_InsertItem(hTree, &tviiT)) {
@@ -275,8 +272,7 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar if (!Modules.EnumModules()) // init Modul list
{
- for (auto &p : Modules)
- {
+ for (auto &p : Modules) {
/*Filter/
if (!DB::Module::IsMeta(p))/end Filter*/
{
@@ -284,44 +280,38 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar if (pDat->ExImContact->Typ != EXIM_CONTACT) // TRUE = All Contacts
{
MCONTACT hContact;
-
- for (hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact))
- {
+
+ for (hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact)) {
// ignore empty modules
if (!DB::Module::IsEmpty(hContact, p)) {
pszProto = Proto_GetBaseAccountName(hContact);
// Filter by mode
- switch (pDat->ExImContact->Typ)
- {
- case EXIM_ALL:
- case EXIM_GROUP:
- break;
- case EXIM_SUBGROUP:
- if (mir_wstrncmp(pDat->ExImContact->ptszName, DB::Setting::GetTString(hContact, "CList", "Group"), mir_wstrlen(pDat->ExImContact->ptszName))) {
- continue;
- }
- break;
- case EXIM_ACCOUNT:
- if (mir_strcmp(pDat->ExImContact->pszName, pszProto)) {
- continue;
- }
- break;
+ switch (pDat->ExImContact->Typ) {
+ case EXIM_ALL:
+ case EXIM_GROUP:
+ break;
+ case EXIM_SUBGROUP:
+ if (mir_wstrncmp(pDat->ExImContact->ptszName, DB::Setting::GetTString(hContact, "CList", "Group"), mir_wstrlen(pDat->ExImContact->ptszName))) {
+ continue;
+ }
+ break;
+ case EXIM_ACCOUNT:
+ if (mir_strcmp(pDat->ExImContact->pszName, pszProto)) {
+ continue;
+ }
+ break;
}
// contact's base protocol is to be added to the treeview uniquely
- if (!mir_strcmpi(p, pszProto))
- {
+ if (!mir_strcmpi(p, pszProto)) {
if (!ExportTree_FindItem(hTree, hItemEssential, p))
- {
ExportTree_AddItem(hTree, hItemEssential, p, bImagesLoaded, 0);
- }
break;
}
// add optional module, which is valid for at least one contact
/*/Filter/*/
- if (mir_strcmpi(p, USERINFO) && mir_strcmpi(p, MOD_MBIRTHDAY) && mir_strcmpi(p, META_PROTO))
- {
+ if (mir_strcmpi(p, USERINFO) && mir_strcmpi(p, MOD_MBIRTHDAY) && mir_strcmpi(p, META_PROTO)) {
ExportTree_AddItem(hTree, hItemOptional, p, bImagesLoaded, 1);
break;
}
@@ -336,8 +326,7 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar (!pDat->ExImContact->hContact || mir_strcmpi(p, pszProto)) &&
//mir_strcmpi(p, "Protocol") &&
mir_strcmpi(p, USERINFO) &&
- mir_strcmpi(p, MOD_MBIRTHDAY))
- {
+ mir_strcmpi(p, MOD_MBIRTHDAY)) {
ExportTree_AddItem(hTree, hItemOptional, (LPSTR)p, bImagesLoaded, 1);
}
} // end
@@ -346,74 +335,72 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar }
}
TranslateDialogDefault(hDlg);
- return TRUE;
}
- case WM_CTLCOLORSTATIC:
- if (GetDlgItem(hDlg, STATIC_WHITERECT) == (HWND)lParam || GetDlgItem(hDlg, ICO_DLGLOGO) == (HWND)lParam) {
- SetBkColor((HDC)wParam, RGB(255, 255, 255));
- return (INT_PTR)GetStockObject(WHITE_BRUSH);
- }
- SetBkMode((HDC)wParam, TRANSPARENT);
- return (INT_PTR)GetStockObject(NULL_BRUSH);
-
- case WM_COMMAND:
- switch (LOWORD(wParam)) {
- case IDOK:
- {
- HWND hTree = GetDlgItem(hDlg, IDC_TREE);
- HTREEITEM hParent;
-
- // search the tree item of optional items
- for (hParent = TreeView_GetRoot(hTree);
- hParent != nullptr;
- hParent = TreeView_GetNextSibling(hTree, hParent))
- {
- ExportTree_AppendModuleList(hTree, hParent, pDat->pModules);
- }
- return EndDialog(hDlg, IDOK);
+ return TRUE;
+
+ case WM_CTLCOLORSTATIC:
+ if (GetDlgItem(hDlg, STATIC_WHITERECT) == (HWND)lParam || GetDlgItem(hDlg, ICO_DLGLOGO) == (HWND)lParam) {
+ SetBkColor((HDC)wParam, RGB(255, 255, 255));
+ return (INT_PTR)GetStockObject(WHITE_BRUSH);
+ }
+ SetBkMode((HDC)wParam, TRANSPARENT);
+ return (INT_PTR)GetStockObject(NULL_BRUSH);
+
+ case WM_COMMAND:
+ switch (LOWORD(wParam)) {
+ case IDOK:
+ {
+ HWND hTree = GetDlgItem(hDlg, IDC_TREE);
+ HTREEITEM hParent;
+
+ // search the tree item of optional items
+ for (hParent = TreeView_GetRoot(hTree);
+ hParent != nullptr;
+ hParent = TreeView_GetNextSibling(hTree, hParent)) {
+ ExportTree_AppendModuleList(hTree, hParent, pDat->pModules);
}
- case IDCANCEL:
- return EndDialog(hDlg, IDCANCEL);
-
- case BTN_CHECK:
- case BTN_UNCHECK:
- {
- HWND hTree = GetDlgItem(hDlg, IDC_TREE);
- LPCSTR pszRoot = Translate("Optional modules");
- TVITEMA tvi;
- CHAR szText[128];
-
- tvi.mask = TVIF_TEXT;
- tvi.pszText = szText;
- tvi.cchTextMax = _countof(szText);
-
- // search the tree item of optional items
- for (tvi.hItem = (HTREEITEM)SendMessageA(hTree, TVM_GETNEXTITEM, TVGN_ROOT, NULL);
- tvi.hItem != nullptr && SendMessageA(hTree, TVM_GETITEMA, 0, (LPARAM)&tvi);
- tvi.hItem = (HTREEITEM)SendMessageA(hTree, TVM_GETNEXTITEM, TVGN_NEXT, (LPARAM)tvi.hItem))
- {
- if (!mir_strcmpi(tvi.pszText, pszRoot)) {
- tvi.mask = TVIF_STATE;
- tvi.state = INDEXTOSTATEIMAGEMASK(LOWORD(wParam) == BTN_UNCHECK ? 1 : 2);
- tvi.stateMask = TVIS_STATEIMAGEMASK;
-
- for (tvi.hItem = (HTREEITEM)SendMessageA(hTree, TVM_GETNEXTITEM, TVGN_CHILD, (LPARAM)tvi.hItem);
- tvi.hItem != nullptr;
- tvi.hItem = (HTREEITEM)SendMessageA(hTree, TVM_GETNEXTITEM, TVGN_NEXT, (LPARAM)tvi.hItem))
- {
- SendMessageA(hTree, TVM_SETITEMA, NULL, (LPARAM)&tvi);
- }
- break;
+ return EndDialog(hDlg, IDOK);
+ }
+ case IDCANCEL:
+ return EndDialog(hDlg, IDCANCEL);
+
+ case BTN_CHECK:
+ case BTN_UNCHECK:
+ {
+ HWND hTree = GetDlgItem(hDlg, IDC_TREE);
+ LPCSTR pszRoot = Translate("Optional modules");
+ TVITEMA tvi;
+ CHAR szText[128];
+
+ tvi.mask = TVIF_TEXT;
+ tvi.pszText = szText;
+ tvi.cchTextMax = _countof(szText);
+
+ // search the tree item of optional items
+ for (tvi.hItem = (HTREEITEM)SendMessageA(hTree, TVM_GETNEXTITEM, TVGN_ROOT, NULL);
+ tvi.hItem != nullptr && SendMessageA(hTree, TVM_GETITEMA, 0, (LPARAM)&tvi);
+ tvi.hItem = (HTREEITEM)SendMessageA(hTree, TVM_GETNEXTITEM, TVGN_NEXT, (LPARAM)tvi.hItem)) {
+ if (!mir_strcmpi(tvi.pszText, pszRoot)) {
+ tvi.mask = TVIF_STATE;
+ tvi.state = INDEXTOSTATEIMAGEMASK(LOWORD(wParam) == BTN_UNCHECK ? 1 : 2);
+ tvi.stateMask = TVIS_STATEIMAGEMASK;
+
+ for (tvi.hItem = (HTREEITEM)SendMessageA(hTree, TVM_GETNEXTITEM, TVGN_CHILD, (LPARAM)tvi.hItem);
+ tvi.hItem != nullptr;
+ tvi.hItem = (HTREEITEM)SendMessageA(hTree, TVM_GETNEXTITEM, TVGN_NEXT, (LPARAM)tvi.hItem)) {
+ SendMessageA(hTree, TVM_SETITEMA, NULL, (LPARAM)&tvi);
}
+ break;
}
- break;
}
+ break;
}
- break;
+ }
+ break;
- case WM_DESTROY:
- mir_free(pDat);
- break;
+ case WM_DESTROY:
+ mir_free(pDat);
+ break;
}
return 0;
}
@@ -434,4 +421,3 @@ int DlgExImModules_SelectModulesToExport(lpExImParam ExImContact, DB::CEnumList* dat.pModules = pModules;
return (IDOK != DialogBoxParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_EXPORT), hParent, SelectModulesToExport_DlgProc, (LPARAM)&dat));
}
-
|