From bb08cc53238ad5f17a28235cb6017fc1f1ba1c8d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 25 Oct 2023 16:46:29 +0300 Subject: SmileyAdd: fix for click on categories' list in options --- plugins/SmileyAdd/src/options.cpp | 41 +++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 19 deletions(-) (limited to 'plugins') diff --git a/plugins/SmileyAdd/src/options.cpp b/plugins/SmileyAdd/src/options.cpp index 76c73a2569..d1be183ddf 100644 --- a/plugins/SmileyAdd/src/options.cpp +++ b/plugins/SmileyAdd/src/options.cpp @@ -331,24 +331,7 @@ class CGategoriesOptions : public COptionsBaseDialog it->SetVisible(visible); } } - - void UserAction(HTREEITEM hItem) - { - if (categories.GetCheckState(hItem)) { - if (!BrowseForSmileyPacks(GetSelProto(hItem))) - categories.SetCheckState(hItem, TRUE); - } - else tmpsmcat.GetSmileyCategory(GetSelProto(hItem))->ClearFilename(); - - if (hItem == categories.GetSelection()) - UpdateControls(); - else - categories.SelectItem(hItem); - - NotifyChange(); - PopulateSmPackList(); - } - + CCtrlEdit edtFilename; CCtrlCheck chkStdPack, chkUsePhys; CCtrlButton btnBrowse, btnPreview; @@ -369,9 +352,10 @@ public: chkStdPack.OnChange = Callback(this, &CGategoriesOptions::onChange_StdPack); chkUsePhys.OnChange = Callback(this, &CGategoriesOptions::onChange_UsePhys); + edtFilename.OnChange = Callback(this, &CGategoriesOptions::onChange_Filename); categories.OnSelChanged = Callback(this, &CGategoriesOptions::onSelectChange_Tree); - categories.OnItemChanged = Callback(this, &CGategoriesOptions::onChange_Filename); + categories.OnItemChanged = Callback(this, &CGategoriesOptions::onItemChange_Tree); } bool OnInitDialog() override @@ -489,6 +473,25 @@ public: NotifyChange(); } + void onItemChange_Tree(CCtrlTreeView::TEventInfo *ev) + { + HTREEITEM hItem = ev->hItem; + + if (!categories.GetCheckState(hItem)) { + if (!BrowseForSmileyPacks(GetSelProto(hItem))) + categories.SetCheckState(hItem, TRUE); + } + else tmpsmcat.GetSmileyCategory(GetSelProto(hItem))->ClearFilename(); + + if (hItem == categories.GetSelection()) + UpdateControls(); + else + categories.SelectItem(hItem); + + NotifyChange(); + PopulateSmPackList(); + } + void onSelectChange_Tree(CCtrlTreeView::TEventInfo *ev) { if (ev->nmtv->itemNew.state & TVIS_SELECTED) -- cgit v1.2.3