From 30d2e707d653c7f31461587198dd57ff2e69af08 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 13 Jun 2012 16:11:53 +0000 Subject: - unneeded structure removed - version resource added git-svn-id: http://svn.miranda-ng.org/main/trunk@394 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/TopToolBar/TopToolBar.vcxproj | 1 + plugins/TopToolBar/TopToolBar.vcxproj.filters | 3 ++ plugins/TopToolBar/main.cpp | 13 +++--- plugins/TopToolBar/main.rc | 58 ------------------------ plugins/TopToolBar/resource.h | 2 - plugins/TopToolBar/ttbopt.cpp | 64 +++++++++++---------------- plugins/TopToolBar/version.h | 38 ++++++++++++++++ plugins/TopToolBar/version.rc | 61 +++++++++++++++++++++++++ 8 files changed, 135 insertions(+), 105 deletions(-) create mode 100644 plugins/TopToolBar/version.h create mode 100644 plugins/TopToolBar/version.rc (limited to 'plugins') diff --git a/plugins/TopToolBar/TopToolBar.vcxproj b/plugins/TopToolBar/TopToolBar.vcxproj index e6813542f5..2a86528e9e 100644 --- a/plugins/TopToolBar/TopToolBar.vcxproj +++ b/plugins/TopToolBar/TopToolBar.vcxproj @@ -264,6 +264,7 @@ %(PreprocessorDefinitions) %(PreprocessorDefinitions) + diff --git a/plugins/TopToolBar/TopToolBar.vcxproj.filters b/plugins/TopToolBar/TopToolBar.vcxproj.filters index ab04955ff5..fc8f42824a 100644 --- a/plugins/TopToolBar/TopToolBar.vcxproj.filters +++ b/plugins/TopToolBar/TopToolBar.vcxproj.filters @@ -85,6 +85,9 @@ Resource Files + + Resource Files + diff --git a/plugins/TopToolBar/main.cpp b/plugins/TopToolBar/main.cpp index a00460132c..c29cba78cf 100644 --- a/plugins/TopToolBar/main.cpp +++ b/plugins/TopToolBar/main.cpp @@ -1,5 +1,6 @@ #include "common.h" +#include "version.h" #pragma hdrstop HINSTANCE hInst; @@ -33,12 +34,12 @@ extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void) PLUGININFOEX pluginInfo = { sizeof(PLUGININFOEX), - "TopToolbar", - PLUGIN_MAKE_VERSION(0, 7, 3, 1), - "ToptoolBar adds buttons in top frame for fast access.This plugin uses MultiWindow or CList_MW plugin.("__DATE__" "__TIME__")", - "Bethoven", - "Bethoven@mailgate.ru", - "© 2003-2008 Bethoven", + __PLUGIN_NAME, + __VERSION_DWORD, + __PLUGIN_DESC, + __PLUGIN_AUTHOR, + __PLUGIN_EMAIL, + __PLUGIN_RIGHTS, "http://www.miranda-im.org/", UNICODE_AWARE, 0, //doesn't replace anything built-in diff --git a/plugins/TopToolBar/main.rc b/plugins/TopToolBar/main.rc index 5c805d63ea..3427ac369b 100644 --- a/plugins/TopToolBar/main.rc +++ b/plugins/TopToolBar/main.rc @@ -172,67 +172,9 @@ IDI_FINDADDDN ICON "icos\\Find_Add Contacts_DN.ico" IDI_MIRANDAUP ICON "icos\\Show Main Menu_UP.ico" IDI_MIRANDADN ICON "icos\\Show Main Menu_DN.ico" -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,7,3,1 - PRODUCTVERSION 0,7,3,1 - FILEFLAGSMASK 0x17L -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "041904b0" - BEGIN - VALUE "FileDescription", "ToptoolBar adds buttons in top frame for fast access." - VALUE "FileVersion", "0.7.3.1" - VALUE "InternalName", "TopToolBar" - VALUE "LegalCopyright", "© 2003-2008 Bethoven" - VALUE "OriginalFilename", "TopToolbar.dll" - VALUE "ProductName", "TopToolBar" - VALUE "ProductVersion", "0.7.3.1" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x419, 1200 - END -END - #endif // Russian (Russia) resources ///////////////////////////////////////////////////////////////////////////// - -///////////////////////////////////////////////////////////////////////////// -// English (United Kingdom) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG) -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK -#pragma code_page(1252) - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_NOTICK ICON "icos\\notick.ico" -IDI_TICK ICON "icos\\notick1.ico" -#endif // English (United Kingdom) resources -///////////////////////////////////////////////////////////////////////////// - - ///////////////////////////////////////////////////////////////////////////// // English (Canada) resources diff --git a/plugins/TopToolBar/resource.h b/plugins/TopToolBar/resource.h index e87c3f88fb..230adf88f0 100644 --- a/plugins/TopToolBar/resource.h +++ b/plugins/TopToolBar/resource.h @@ -19,8 +19,6 @@ #define IDI_ICON1 138 #define IDI_MIRANDADN 139 #define IDI_RUN 140 -#define IDI_NOTICK 205 -#define IDI_TICK 206 #define IDD_OPT_TTBBKG 230 #define IDD_OPT_INTERNALORDER 262 #define IDD_OPT_BUTORDER 262 diff --git a/plugins/TopToolBar/ttbopt.cpp b/plugins/TopToolBar/ttbopt.cpp index a9b8402060..a3d0e98a67 100644 --- a/plugins/TopToolBar/ttbopt.cpp +++ b/plugins/TopToolBar/ttbopt.cpp @@ -13,11 +13,6 @@ extern SortData arrangedbuts[MAX_BUTTONS]; bool OptionsOpened = false; HWND OptionshWnd = 0; -struct ButtonOptData -{ - int pos; -}; - struct OrderData { int dragging; @@ -43,8 +38,7 @@ int BuildTree(HWND hwndDlg) tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_STATE | TVIF_IMAGE | TVIF_SELECTEDIMAGE; for (int i = 0; i < nButtonsCount; i++) { - ButtonOptData *PD = (ButtonOptData*)malloc(sizeof(ButtonOptData)); - TopButtonInt &b = Buttons[PD->pos = arrangedbuts[i].oldpos]; + TopButtonInt &b = Buttons[arrangedbuts[i].oldpos]; int index; if (b.dwFlags & TTBBF_ICONBYHANDLE) { @@ -54,11 +48,12 @@ int BuildTree(HWND hwndDlg) } else index = ImageList_AddIcon(dat->himlButtonIcons, b.hIconUp); - tvis.item.lParam = (LPARAM)PD; - tvis.item.pszText = TranslateTS( mir_a2t( b.name )); + TCHAR* tmp = mir_a2t( b.name ); + tvis.item.lParam = (LPARAM)&b; + tvis.item.pszText = TranslateTS(tmp); tvis.item.iImage = tvis.item.iSelectedImage = index; HTREEITEM hti = TreeView_InsertItem(hTree, &tvis); - mir_free( tvis.item.pszText ); + mir_free(tmp); TreeView_SetCheckState(hTree, hti, (b.dwFlags & TTBBF_VISIBLE) ? TRUE : FALSE); } @@ -90,13 +85,13 @@ int SaveTree(HWND hwndDlg) tvi.mask = TVIF_PARAM | TVIF_HANDLE | TVIF_STATE; TreeView_GetItem(hTree, &tvi); - int pos = ((ButtonOptData *)tvi.lParam)->pos; - if (pos >= 0 && pos < nButtonsCount) { + TopButtonInt* btn = (TopButtonInt*)tvi.lParam; + if (btn->arrangedpos >= 0 && btn->arrangedpos) { if ((tvi.state >> 12 ) == 0x2) - Buttons[pos].dwFlags |= TTBBF_VISIBLE; + btn->dwFlags |= TTBBF_VISIBLE; else - Buttons[pos].dwFlags &= ~TTBBF_VISIBLE; - Buttons[pos].arrangedpos = count; + btn->dwFlags &= ~TTBBF_VISIBLE; + btn->arrangedpos = count; } tvi.hItem = TreeView_GetNextSibling(hTree, tvi.hItem); @@ -113,6 +108,7 @@ int SaveTree(HWND hwndDlg) static INT_PTR CALLBACK ButOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { + TopButtonInt* btn; struct OrderData *dat = (struct OrderData*)GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_BUTTONORDERTREE), GWLP_USERDATA); switch (msg) { @@ -123,13 +119,6 @@ static INT_PTR CALLBACK ButOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR dat->dragging = 0; SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_BUTTONORDERTREE), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_BUTTONORDERTREE), GWL_STYLE)|TVS_NOHSCROLL); - { - HIMAGELIST himlCheckBoxes; - himlCheckBoxes = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR4|ILC_MASK, 2, 2); - ImageList_AddIcon(himlCheckBoxes, LoadIcon(hInst, MAKEINTRESOURCE(IDI_NOTICK))); - ImageList_AddIcon(himlCheckBoxes, LoadIcon(hInst, MAKEINTRESOURCE(IDI_TICK))); - TreeView_SetImageList(GetDlgItem(hwndDlg, IDC_BUTTONORDERTREE), himlCheckBoxes, TVSIL_NORMAL); - } SetDlgItemInt(hwndDlg, IDC_BUTTHEIGHT, DBGetContactSettingByte(0, TTB_OPTDIR, "BUTTHEIGHT", 16), FALSE); SetDlgItemInt(hwndDlg, IDC_BUTTWIDTH, DBGetContactSettingByte(0, TTB_OPTDIR, "BUTTWIDTH", 20), FALSE); @@ -165,8 +154,8 @@ static INT_PTR CALLBACK ButOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR tvi.mask = TVIF_PARAM; TreeView_GetItem(GetDlgItem(hwndDlg, IDC_BUTTONORDERTREE), &tvi); - curselect = ((ButtonOptData *)tvi.lParam)->pos; - if (Buttons[curselect].dwFlags & TTBBF_ISLBUTTON) { + btn = (TopButtonInt*)tvi.lParam; + if (btn->dwFlags & TTBBF_ISLBUTTON) { LBUTOPT lbo = { 0 }; TCHAR buf[256]; GetDlgItemText(hwndDlg, IDC_ENAME, buf, 255); @@ -175,7 +164,7 @@ static INT_PTR CALLBACK ButOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR GetDlgItemText(hwndDlg, IDC_EPATH, buf, 255); lbo.lpath = _tcsdup(buf); - CallService(TTB_MODIFYLBUTTON, Buttons[curselect].lParamDown, (LPARAM)&lbo); + CallService(TTB_MODIFYLBUTTON, btn->lParamDown, (LPARAM)&lbo); free(lbo.name); free(lbo.lpath); } @@ -199,10 +188,10 @@ static INT_PTR CALLBACK ButOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR tvi.mask = TVIF_PARAM; TreeView_GetItem(GetDlgItem(hwndDlg, IDC_BUTTONORDERTREE), &tvi); + btn = (TopButtonInt*)tvi.lParam; - curselect = ((ButtonOptData *)tvi.lParam)->pos; - if (Buttons[curselect].dwFlags & TTBBF_ISLBUTTON) { - CallService(TTB_REMOVELBUTTON, Buttons[curselect].lParamDown, 0); + if (btn->dwFlags & TTBBF_ISLBUTTON) { + CallService(TTB_REMOVELBUTTON, btn->lParamDown, 0); EnableWindow(GetDlgItem(hwndDlg, IDC_ENAME), FALSE); EnableWindow(GetDlgItem(hwndDlg, IDC_EPATH), FALSE); BuildTree(hwndDlg); @@ -227,7 +216,6 @@ static INT_PTR CALLBACK ButOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR tvi.mask = TVIF_PARAM; TreeView_GetItem(GetDlgItem(hwndDlg, IDC_BUTTONORDERTREE), &tvi); - if (tvi.lParam == 0) break; @@ -236,12 +224,10 @@ static INT_PTR CALLBACK ButOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR break; } - int curselect = ((ButtonOptData *)tvi.lParam)->pos; - if ( curselect >= 0 && curselect < nButtonsCount ) { - if (Buttons[curselect].dwFlags & TTBBF_ISSEPARATOR) { - SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); - CallService(TTB_REMOVESEPARATOR, Buttons[curselect].lParamDown, 0); - } + btn = (TopButtonInt*)tvi.lParam; + if (btn->dwFlags & TTBBF_ISSEPARATOR) { + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); + CallService(TTB_REMOVESEPARATOR, btn->lParamDown, 0); } break; } @@ -298,10 +284,10 @@ static INT_PTR CALLBACK ButOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR tvi.hItem = hti; TreeView_GetItem(GetDlgItem(hwndDlg, IDC_BUTTONORDERTREE), &tvi); - TopButtonInt &b = Buttons[((ButtonOptData *)tvi.lParam)->pos]; + TopButtonInt *btn = (TopButtonInt*)tvi.lParam; lockbut(); EnableWindow(GetDlgItem(hwndDlg, IDC_REMOVESEP), FALSE); - if (b.dwFlags & TTBBF_ISSEPARATOR) + if (btn->dwFlags & TTBBF_ISSEPARATOR) EnableWindow(GetDlgItem(hwndDlg, IDC_REMOVESEP), TRUE); EnableWindow(GetDlgItem(hwndDlg, IDC_ENAME), FALSE); @@ -311,9 +297,9 @@ static INT_PTR CALLBACK ButOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR SetDlgItemTextA(hwndDlg, IDC_ENAME, ""); SetDlgItemTextA(hwndDlg, IDC_EPATH, ""); - if (b.dwFlags & TTBBF_ISLBUTTON) { + if (btn->dwFlags & TTBBF_ISLBUTTON) { LBUTOPT lbo = { 0 }; - CallService(TTB_GETLBUTTON, b.lParamDown, (LPARAM)&lbo); + CallService(TTB_GETLBUTTON, btn->lParamDown, (LPARAM)&lbo); if (lbo.hframe != 0) { EnableWindow(GetDlgItem(hwndDlg, IDC_ENAME), TRUE); EnableWindow(GetDlgItem(hwndDlg, IDC_EPATH), TRUE); diff --git a/plugins/TopToolBar/version.h b/plugins/TopToolBar/version.h new file mode 100644 index 0000000000..6873336024 --- /dev/null +++ b/plugins/TopToolBar/version.h @@ -0,0 +1,38 @@ +/* + +Miranda IM: the free IM client for Microsoft* Windows* + +Copyright 2000-2008 Miranda ICQ/IM project, +all portions of this codebase are copyrighted to the people +listed in contributors.txt. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + + +#define __FILEVERSION_STRING 0,8,0,1 +#define __VERSION_STRING "0.8.0.1" +#define __VERSION_DWORD 0x00080001 + + +#define __PLUGIN_DESC "ToptoolBar adds buttons in top frame for fast access." +#define __PLUGIN_LONGDESC __PLUGIN_DESC +#define __PLUGIN_AUTHOR "Bethoven" +#define __PLUGIN_EMAIL "Bethoven@mailgate.ru" +#define __PLUGIN_RIGHTS "© 2003-2008 Bethoven" +#define __PLUGIN_FILE "TopToolbar.dll" +#define __PLUGIN_SHORTNAME "TopToolBar" + +#define __PLUGIN_NAME __PLUGIN_SHORTNAME diff --git a/plugins/TopToolBar/version.rc b/plugins/TopToolBar/version.rc new file mode 100644 index 0000000000..7a4dcbb314 --- /dev/null +++ b/plugins/TopToolBar/version.rc @@ -0,0 +1,61 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include +#include +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION __FILEVERSION_STRING + PRODUCTVERSION __FILEVERSION_STRING + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "000004b0" + BEGIN + VALUE "FileDescription", __PLUGIN_DESC + VALUE "FileVersion", __VERSION_STRING + VALUE "InternalName", __PLUGIN_SHORTNAME + VALUE "LegalCopyright", __PLUGIN_RIGHTS + VALUE "OriginalFilename", __PLUGIN_FILE + VALUE "ProductName", __PLUGIN_SHORTNAME + VALUE "ProductVersion", __VERSION_STRING + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0, 1200 + END +END + +#endif -- cgit v1.2.3