summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-09-06 16:08:01 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-09-06 16:08:01 +0300
commit5a6d2b4e7fa4f69e3b65718495386ac6c6efc3fe (patch)
tree532da68b5e6a86091df94940bc04636248891739 /plugins
parent446419e28c8ce362b75902618253e5dc41f07671 (diff)
NewStory:
- we don't select text entering the editing mode; - double click doesn't create read-only control anymore
Diffstat (limited to 'plugins')
-rw-r--r--plugins/NewStory/src/history_control.cpp11
-rw-r--r--plugins/NewStory/src/history_control.h2
-rw-r--r--plugins/NewStory/src/history_menus.cpp2
3 files changed, 5 insertions, 10 deletions
diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp
index bc48e35777..78ce23b523 100644
--- a/plugins/NewStory/src/history_control.cpp
+++ b/plugins/NewStory/src/history_control.cpp
@@ -190,7 +190,7 @@ static LRESULT CALLBACK HistoryEditWndProc(HWND hwnd, UINT msg, WPARAM wParam, L
return mir_callNextSubclass(hwnd, HistoryEditWndProc, msg, wParam, lParam);
}
-void NewstoryListData::BeginEditItem(bool bReadOnly)
+void NewstoryListData::BeginEditItem()
{
if (hwndEditBox)
EndEditItem(false);
@@ -221,15 +221,10 @@ void NewstoryListData::BeginEditItem(bool bReadOnly)
item->getFontColor(fontid, colorid);
uint32_t dwStyle = WS_CHILD | WS_BORDER | ES_MULTILINE | ES_AUTOVSCROLL;
- if (bReadOnly)
- dwStyle |= ES_READONLY;
-
hwndEditBox = CreateWindow(L"EDIT", item->getWBuf(), dwStyle, 0, top, rc.right - rc.left, itemHeight, m_hwnd, NULL, g_plugin.getInst(), NULL);
- SetWindowLongPtrW(hwndEditBox, GWLP_USERDATA, (LPARAM)item);
mir_subclassWindow(hwndEditBox, HistoryEditWndProc);
SendMessage(hwndEditBox, WM_SETFONT, (WPARAM)g_fontTable[fontid].hfnt, 0);
SendMessage(hwndEditBox, EM_SETMARGINS, EC_RIGHTMARGIN, 100);
- SendMessage(hwndEditBox, EM_SETSEL, 0, (LPARAM)(-1));
ShowWindow(hwndEditBox, SW_SHOW);
SetFocus(hwndEditBox);
}
@@ -976,7 +971,7 @@ LRESULT CALLBACK NewstoryListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
break;
case VK_F2:
- data->BeginEditItem(false);
+ data->BeginEditItem();
break;
case VK_ESCAPE:
@@ -1059,7 +1054,7 @@ LRESULT CALLBACK NewstoryListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
}
if (data->caret == idx) {
- data->BeginEditItem(true);
+ data->BeginEditItem();
return 0;
}
}
diff --git a/plugins/NewStory/src/history_control.h b/plugins/NewStory/src/history_control.h
index 7b8551b404..e87af1a1bd 100644
--- a/plugins/NewStory/src/history_control.h
+++ b/plugins/NewStory/src/history_control.h
@@ -59,7 +59,7 @@ struct NewstoryListData : public MZeroedObject
void AddSelection(int iFirst, int iLast);
bool AtBottom(void) const;
bool AtTop(void) const;
- void BeginEditItem(bool bReadOnly);
+ void BeginEditItem();
void Clear();
void ClearSelection(int iFirst, int iLast);
void Copy(bool bTextOnly = false);
diff --git a/plugins/NewStory/src/history_menus.cpp b/plugins/NewStory/src/history_menus.cpp
index 1d1a6e3e3d..fe5d4714dc 100644
--- a/plugins/NewStory/src/history_menus.cpp
+++ b/plugins/NewStory/src/history_menus.cpp
@@ -65,7 +65,7 @@ static INT_PTR NSMenuHelper(WPARAM wParam, LPARAM lParam)
break;
case MENU_EDIT:
- pData->BeginEditItem(false);
+ pData->BeginEditItem();
break;
case MENU_DELETE: