From eaba7e578572237c2f84dd27814478f325bc70ef Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Sat, 26 Sep 2015 11:30:55 +0000 Subject: SmileyAdd: option for horisontal sorting git-svn-id: http://svn.miranda-ng.org/main/trunk@15446 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/SmileyAdd/src/options.cpp | 4 ++++ plugins/SmileyAdd/src/options.h | 1 + plugins/SmileyAdd/src/resource.h | 9 +++++---- plugins/SmileyAdd/src/smltool.cpp | 6 +++--- 4 files changed, 13 insertions(+), 7 deletions(-) (limited to 'plugins/SmileyAdd/src') diff --git a/plugins/SmileyAdd/src/options.cpp b/plugins/SmileyAdd/src/options.cpp index c57af0a88a..b11a1a3c02 100644 --- a/plugins/SmileyAdd/src/options.cpp +++ b/plugins/SmileyAdd/src/options.cpp @@ -177,6 +177,7 @@ BOOL OptionsDialogType::DialogProcedure(UINT msg, WPARAM wParam, LPARAM lParam) case IDC_DCURSORSMILEY: case IDC_DISABLECUSTOM: case IDC_HQSCALING: + case IDC_SORTING_HORISONTAL: if (HIWORD(wParam) == BN_CLICKED) SetChanged(); break; @@ -484,6 +485,7 @@ void OptionsDialogType::ApplyChanges(void) opt.DCursorSmiley = IsDlgButtonChecked(m_hwndDialog, IDC_DCURSORSMILEY) == BST_CHECKED; opt.DisableCustom = IsDlgButtonChecked(m_hwndDialog, IDC_DISABLECUSTOM) == BST_CHECKED; opt.HQScaling = IsDlgButtonChecked(m_hwndDialog, IDC_HQSCALING) == BST_CHECKED; + opt.HorisontalSorting = IsDlgButtonChecked(m_hwndDialog, IDC_SORTING_HORISONTAL) == BST_CHECKED; opt.ButtonStatus = (unsigned)SendDlgItemMessage(m_hwndDialog, IDC_SMLBUT, CB_GETCURSEL, 0, 0); opt.SelWndBkgClr = (unsigned)SendDlgItemMessage(m_hwndDialog, IDC_SELCLR, CPM_GETCOLOUR, 0, 0); @@ -613,6 +615,7 @@ void OptionsType::Save(void) db_set_dw(NULL, "SmileyAdd", "SelWndBkgClr", SelWndBkgClr); db_set_dw(NULL, "SmileyAdd", "MaxCustomSmileySize", MaxCustomSmileySize); db_set_dw(NULL, "SmileyAdd", "MinSmileySize", MinSmileySize); + db_set_dw(NULL, "SmileyAdd", "HorisontalSorting", HorisontalSorting); } void OptionsType::Load(void) @@ -637,6 +640,7 @@ void OptionsType::Load(void) 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); + HorisontalSorting = db_get_dw(NULL, "SmileyAdd", "HorisontalSorting"); } diff --git a/plugins/SmileyAdd/src/options.h b/plugins/SmileyAdd/src/options.h index f5d10d659d..da6d53a897 100644 --- a/plugins/SmileyAdd/src/options.h +++ b/plugins/SmileyAdd/src/options.h @@ -40,6 +40,7 @@ public: bool DCursorSmiley; bool DisableCustom; bool HQScaling; + bool HorisontalSorting; unsigned ButtonStatus; unsigned SelWndBkgClr; unsigned MaxCustomSmileySize; diff --git a/plugins/SmileyAdd/src/resource.h b/plugins/SmileyAdd/src/resource.h index dcc3d859e7..ed280b1142 100644 --- a/plugins/SmileyAdd/src/resource.h +++ b/plugins/SmileyAdd/src/resource.h @@ -1,6 +1,6 @@ //{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by resource.rc +// Включаемый файл, созданный в Microsoft Visual C++. +// Используется D:\Others\SVN\MirandaNG\trunk\plugins\SmileyAdd\res\resource.rc // #define IDI_SMILINGICON 124 #define IDD_OPT_SMILEYS 245 @@ -33,9 +33,10 @@ #define IDC_MAXCUSTSPIN 1063 #define IDC_MINSMSZ 1064 #define IDC_MINSPIN 1065 +#define IDC_CHECK1 1066 +#define IDC_SORTING_HORISONTAL 1066 #define IDC_BROWSE 1184 #define IDC_FILENAME 1271 -#define IDC_STATIC -1 // Next default values for new objects // @@ -44,7 +45,7 @@ #define _APS_NO_MFC 1 #define _APS_NEXT_RESOURCE_VALUE 127 #define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1064 +#define _APS_NEXT_CONTROL_VALUE 1067 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif diff --git a/plugins/SmileyAdd/src/smltool.cpp b/plugins/SmileyAdd/src/smltool.cpp index f4b6c9ba5d..55e52dc7a0 100644 --- a/plugins/SmileyAdd/src/smltool.cpp +++ b/plugins/SmileyAdd/src/smltool.cpp @@ -639,7 +639,7 @@ void SmileyToolWindowType::CreateSmileyWinDim(void) const int colsz = m_ButtonSize.cy + m_ButtonSpace; int wndsz = min((int)m_BitmapWidth.cy, GetSystemMetrics(SM_CYSCREEN) / 2); - if (opt.IEViewStyle) wndsz = min(wndsz, 250); + if (opt.IEViewStyle) wndsz = min(wndsz, 400); if (m_pSmileyPack->win.x != 0 && m_pSmileyPack->win.y != 0) wndsz = min(wndsz, m_pSmileyPack->win.y * (m_ButtonSize.cy + (int)m_ButtonSpace) + (int)m_ButtonSpace); @@ -688,7 +688,7 @@ RECT SmileyToolWindowType::CalculateButtonToCoordinates(int buttonPosition, int { int row, rowpos; - if (opt.IEViewStyle) + if (opt.HorisontalSorting) { row = buttonPosition / m_NumberOfHorizontalButtons; rowpos = buttonPosition % m_NumberOfHorizontalButtons; @@ -715,7 +715,7 @@ int SmileyToolWindowType::CalculateCoordinatesToButton(POINT pt, int scroll) const int row = (pt.y - m_ButtonSpace) / (m_ButtonSize.cy + m_ButtonSpace) + scroll; int pos; - if (opt.IEViewStyle) + if (opt.HorisontalSorting) pos = m_NumberOfHorizontalButtons * row + rowpos; else pos = m_NumberOfVerticalButtons * rowpos + row; -- cgit v1.2.3