summaryrefslogtreecommitdiff
path: root/plugins/Console
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-12-02 18:19:49 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-12-02 18:19:49 +0000
commitc4582dd65b444e5dae29ada7cc3f6c9a9c20edf3 (patch)
tree17a8627550b202d62df8e1df76d2585d3d0cdeaa /plugins/Console
parent5ea5feb7e052ca45af7bc9ed76e4a252bd71950d (diff)
new easy standard way of registering icons: Icon_Register
git-svn-id: http://svn.miranda-ng.org/main/trunk@2601 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Console')
-rw-r--r--plugins/Console/src/Console.cpp28
1 files changed, 10 insertions, 18 deletions
diff --git a/plugins/Console/src/Console.cpp b/plugins/Console/src/Console.cpp
index 74f0f731c4..3305a4de82 100644
--- a/plugins/Console/src/Console.cpp
+++ b/plugins/Console/src/Console.cpp
@@ -114,6 +114,12 @@ static int Openfile(TCHAR *outputFile, int selection);
static HANDLE hTTBButt = 0;
+static IconItem iconList[] =
+{
+ { "Show", "Console_Up", IDI_BTN_UP },
+ { "Hide", "Console_Down", IDI_BTN_DN },
+};
+
static int OnTTBLoaded(WPARAM wParam,LPARAM lParam)
{
if ( !IsWindow(hwndConsole))
@@ -121,26 +127,12 @@ static int OnTTBLoaded(WPARAM wParam,LPARAM lParam)
int state = IsWindowVisible(hwndConsole);
+ Icon_Register(hInst, "Console", iconList, SIZEOF(iconList));
+
TTBButton ttbb = { 0 };
ttbb.cbSize = sizeof(ttbb);
-
- TCHAR szModuleFileName[MAX_PATH];
- GetModuleFileName(hInst, szModuleFileName, SIZEOF(szModuleFileName));
-
- SKINICONDESC sid = { sizeof(sid) };
- sid.pszSection = "Console";
- sid.ptszDefaultFile = szModuleFileName;
- sid.flags = SIDF_PATH_TCHAR;
- sid.pszDescription = "Show";
- sid.pszName = "Console_Up";
- sid.iDefaultIndex = -IDI_BTN_UP;
- ttbb.hIconHandleUp = Skin_AddIcon(&sid);
-
- sid.pszDescription = "Hide";
- sid.pszName = "Console_Down";
- sid.iDefaultIndex = -IDI_BTN_DN;
- ttbb.hIconHandleDn = Skin_AddIcon(&sid);
-
+ ttbb.hIconHandleUp = iconList[0].hIcolib;
+ ttbb.hIconHandleDn = iconList[1].hIcolib;
ttbb.dwFlags = (state ? TTBBF_PUSHED : 0) | TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
ttbb.pszService = MS_CONSOLE_SHOW_HIDE;
ttbb.name = LPGEN("Show/Hide Console");