diff options
author | George Hazan <george.hazan@gmail.com> | 2024-03-24 13:37:06 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-03-24 13:37:06 +0300 |
commit | fc1ccf076ac6239ddceb2075d81da9fe20584e40 (patch) | |
tree | 139c19f6fa6aa7bced2ae8280b1102d01ab7a82e | |
parent | c96467dceeea7932190117e6a574e519420d3812 (diff) |
fixes #4293 (NewStory: кнопка "Сбросить" не отключается)
-rw-r--r-- | plugins/NewStory/src/options.cpp | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/plugins/NewStory/src/options.cpp b/plugins/NewStory/src/options.cpp index 1310285089..e8a0bae954 100644 --- a/plugins/NewStory/src/options.cpp +++ b/plugins/NewStory/src/options.cpp @@ -287,25 +287,21 @@ public: tvi.mask = TVIF_PARAM;
m_tree.GetItem(&tvi);
- if (tvi.lParam == 0) {
- m_edit.Disable();
- preview.Disable();
- gpreview.Disable();
- btnDiscard.Disable();
- bthVarHelp.Disable();
-
+ bool bEnabled = tvi.lParam != 0;
+ m_edit.Enable(bEnabled);
+ preview.Enable(bEnabled);
+ gpreview.Enable(bEnabled);
+ btnReset.Enable(bEnabled);
+ btnDiscard.Enable(bEnabled);
+ bthVarHelp.Enable(bEnabled);
+
+ if (!bEnabled) {
HTREEITEM hItem = m_tree.GetChild(tvi.hItem);
if (hItem)
m_tree.Expand(tvi.hItem, TVE_EXPAND);
return;
}
- m_edit.Enable();
- preview.Enable();
- gpreview.Enable();
- btnDiscard.Enable();
- bthVarHelp.Enable();
-
if (m_curr != nullptr)
replaceStrW(m_curr->tmpValue, m_edit.GetText());
|