diff options
-rw-r--r-- | plugins/SmileyAdd/res/resource.rc | 4 | ||||
-rw-r--r-- | plugins/SmileyAdd/src/options.cpp | 44 |
2 files changed, 9 insertions, 39 deletions
diff --git a/plugins/SmileyAdd/res/resource.rc b/plugins/SmileyAdd/res/resource.rc index bc5b1f156f..3910fbd3d3 100644 --- a/plugins/SmileyAdd/res/resource.rc +++ b/plugins/SmileyAdd/res/resource.rc @@ -64,7 +64,7 @@ BEGIN CONTROL "",IDC_CATEGORYLIST,"SysTreeView32",TVS_DISABLEDRAGDROP | TVS_SHOWSELALWAYS | TVS_CHECKBOXES | WS_BORDER | WS_HSCROLL | WS_TABSTOP,7,35,295,129
CONTROL "Specify smiley pack for each category",IDC_USESTDPACK,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,7,277,11
- EDITTEXT IDC_FILENAME,8,216,245,12,ES_AUTOHSCROLL,WS_EX_ACCEPTFILES
+ EDITTEXT IDC_FILENAME,9,216,292,12,ES_AUTOHSCROLL,WS_EX_ACCEPTFILES
PUSHBUTTON "...",IDC_BROWSE,289,8,13,11
LTEXT "Name:",IDC_STATIC,9,172,34,8
LTEXT "",IDC_LIBNAME,47,170,254,11,SS_SUNKEN | SS_PATHELLIPSIS
@@ -73,8 +73,6 @@ BEGIN LTEXT "Version:",IDC_STATIC,9,201,34,8
LTEXT "",IDC_LIBVERSION,47,199,183,11,SS_SUNKEN | SS_PATHELLIPSIS
PUSHBUTTON "Preview",IDC_SMLOPTBUTTON,236,184,65,25
- PUSHBUTTON "+",IDC_ADDCATEGORY,261,215,17,15
- PUSHBUTTON "-",IDC_DELETECATEGORY,284,215,17,15
CONTROL "Use per protocol global smiley packs",IDC_USEPHYSPROTO,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,20,290,11
END
diff --git a/plugins/SmileyAdd/src/options.cpp b/plugins/SmileyAdd/src/options.cpp index 92e3e8676c..f4f5299ed6 100644 --- a/plugins/SmileyAdd/src/options.cpp +++ b/plugins/SmileyAdd/src/options.cpp @@ -144,11 +144,14 @@ protected: class CGeneralOptions : public COptionsBaseDialog
{
+ CCtrlSpin spinMax, spinMin;
CCtrlHyperlink linkGetMore;
public:
CGeneralOptions() :
COptionsBaseDialog(IDD_OPT_GENERAL),
+ spinMin(this, IDC_MINSPIN, 99),
+ spinMax(this, IDC_MAXCUSTSPIN, 99),
linkGetMore(this, IDC_GETMORE, "https://miranda-ng.org/tags/smileyadd/")
{}
@@ -166,13 +169,8 @@ public: CheckDlgButton(m_hwnd, IDC_HQSCALING, opt.HQScaling ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(m_hwnd, IDC_SORTING_HORIZONTAL, opt.HorizontalSorting ? BST_CHECKED : BST_UNCHECKED);
- SendDlgItemMessage(m_hwnd, IDC_MAXCUSTSPIN, UDM_SETRANGE32, 0, 99);
- SendDlgItemMessage(m_hwnd, IDC_MAXCUSTSPIN, UDM_SETPOS, 0, opt.MaxCustomSmileySize);
- SendDlgItemMessage(m_hwnd, IDC_MAXCUSTSMSZ, EM_LIMITTEXT, 2, 0);
-
- SendDlgItemMessage(m_hwnd, IDC_MINSPIN, UDM_SETRANGE32, 0, 99);
- SendDlgItemMessage(m_hwnd, IDC_MINSPIN, UDM_SETPOS, 0, opt.MinSmileySize);
- SendDlgItemMessage(m_hwnd, IDC_MINSMSZ, EM_LIMITTEXT, 2, 0);
+ spinMin.SetPosition(opt.MinSmileySize);
+ spinMax.SetPosition(opt.MaxCustomSmileySize);
return true;
}
@@ -190,8 +188,8 @@ public: opt.HQScaling = IsDlgButtonChecked(m_hwnd, IDC_HQSCALING) == BST_CHECKED;
opt.HorizontalSorting = IsDlgButtonChecked(m_hwnd, IDC_SORTING_HORIZONTAL) == BST_CHECKED;
- opt.MaxCustomSmileySize = GetDlgItemInt(m_hwnd, IDC_MAXCUSTSMSZ, nullptr, FALSE);
- opt.MinSmileySize = GetDlgItemInt(m_hwnd, IDC_MINSMSZ, nullptr, FALSE);
+ opt.MinSmileySize = spinMin.GetPosition();
+ opt.MaxCustomSmileySize = spinMax.GetPosition();
return true;
}
};
@@ -355,24 +353,20 @@ class CGategoriesOptions : public COptionsBaseDialog CCtrlEdit edtFilename;
CCtrlCheck chkStdPack, chkUsePhys;
- CCtrlButton btnAdd, btnBrowse, btnDelete, btnPreview;
+ CCtrlButton btnBrowse, btnPreview;
CCtrlTreeView categories;
public:
CGategoriesOptions() :
COptionsBaseDialog(IDD_OPT_CATEGORIES),
- btnAdd(this, IDC_ADDCATEGORY),
btnBrowse(this, IDC_BROWSE),
- btnDelete(this, IDC_DELETECATEGORY),
btnPreview(this, IDC_SMLOPTBUTTON),
chkStdPack(this, IDC_USESTDPACK),
chkUsePhys(this, IDC_USEPHYSPROTO),
categories(this, IDC_CATEGORYLIST),
edtFilename(this, IDC_FILENAME)
{
- btnAdd.OnClick = Callback(this, &CGategoriesOptions::onClick_Add);
btnBrowse.OnClick = Callback(this, &CGategoriesOptions::onClick_Browse);
- btnDelete.OnClick = Callback(this, &CGategoriesOptions::onClick_Delete);
btnPreview.OnClick = Callback(this, &CGategoriesOptions::onClick_Preview);
chkStdPack.OnChange = Callback(this, &CGategoriesOptions::onChange_StdPack);
@@ -449,20 +443,6 @@ public: return COptionsBaseDialog::DlgProc(uMsg, wParam, lParam);
}
- void onClick_Add(CCtrlButton*)
- {
- wchar_t cat[30];
- GetDlgItemText(m_hwnd, IDC_NEWCATEGORY, cat, _countof(cat));
- CMStringW catd = cat;
-
- if (!catd.IsEmpty()) {
- tmpsmcat.AddCategory(cat, catd, smcCustom);
-
- PopulateSmPackList();
- NotifyChange();
- }
- }
-
void onClick_Browse(CCtrlButton*)
{
if (BrowseForSmileyPacks(GetSelProto())) {
@@ -471,14 +451,6 @@ public: }
}
- void onClick_Delete(CCtrlButton*)
- {
- if (tmpsmcat.DeleteCustomCategory(GetSelProto())) {
- PopulateSmPackList();
- NotifyChange();
- }
- }
-
void onClick_Preview(CCtrlButton*)
{
RECT rect;
|