diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/ExternalAPI/m_text.h | 3 | ||||
-rw-r--r-- | plugins/NewStory/src/history_array.cpp | 8 | ||||
-rw-r--r-- | plugins/NewStory/src/history_array.h | 1 |
3 files changed, 11 insertions, 1 deletions
diff --git a/plugins/ExternalAPI/m_text.h b/plugins/ExternalAPI/m_text.h index 9bb349d8a8..d6e948b673 100644 --- a/plugins/ExternalAPI/m_text.h +++ b/plugins/ExternalAPI/m_text.h @@ -66,6 +66,9 @@ MTEXTCONTROL_DLL(HText) MTextCreateW(HANDLE userHandle, const char *szProto, con // allocate text object (advanced)
MTEXTCONTROL_DLL(HText) MTextCreateEx(HANDLE userHandle, const void *text, uint32_t flags);
+// allocate text object (advanced)
+MTEXTCONTROL_DLL(HText) MTextCreateEx2(HWND hwnd, HANDLE userHandle, const void *text, uint32_t flags);
+
// destroys text object
MTEXTCONTROL_DLL(int) MTextDestroy(HText text);
diff --git a/plugins/NewStory/src/history_array.cpp b/plugins/NewStory/src/history_array.cpp index 3eb986cd88..cbffbb1f1d 100644 --- a/plugins/NewStory/src/history_array.cpp +++ b/plugins/NewStory/src/history_array.cpp @@ -190,7 +190,7 @@ ItemData* ItemData::checkPrevGC(ItemData *pPrev) void ItemData::checkCreate(HWND hwnd) { if (data == nullptr) { - setText(); + setTextAndHwnd(hwnd); MTextSetParent(data, hwnd); MTextActivate(data, true); } @@ -479,6 +479,12 @@ void ItemData::setText() savedHeight = -1; } +void ItemData::setTextAndHwnd(HWND hwnd) +{ + data = MTextCreateEx2(hwnd, htuLog, formatRtf().GetBuffer(), MTEXT_FLG_RTF); + savedHeight = -1; +} + // Array HistoryArray::HistoryArray() : pages(50), diff --git a/plugins/NewStory/src/history_array.h b/plugins/NewStory/src/history_array.h index 81ca3df4af..a893a634da 100644 --- a/plugins/NewStory/src/history_array.h +++ b/plugins/NewStory/src/history_array.h @@ -37,6 +37,7 @@ struct ItemData void checkCreate(HWND hwnd); void markRead(); void setText(); + void setTextAndHwnd(HWND hwnd); bool fetch(void); void fill(int tmpl); |