diff options
author | George Hazan <ghazan@miranda.im> | 2020-04-11 18:38:48 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-04-11 18:38:48 +0300 |
commit | 5734da61d0629d96297140fb6c1bfdca9d1e7269 (patch) | |
tree | ae7074fd7f29737884752e979a6fa897aad92d42 /plugins/NewStory | |
parent | 467ebabf29c13a6f20ea5f7a1ec6d59c615e453c (diff) |
NewStory: added skeleton of log viewer class
Diffstat (limited to 'plugins/NewStory')
-rw-r--r-- | plugins/NewStory/src/history.h | 2 | ||||
-rw-r--r-- | plugins/NewStory/src/history_log.cpp | 73 | ||||
-rw-r--r-- | plugins/NewStory/src/main.cpp | 3 | ||||
-rw-r--r-- | plugins/NewStory/src/msglog.cpp | 2 | ||||
-rw-r--r-- | plugins/NewStory/src/stdafx.h | 2 |
5 files changed, 81 insertions, 1 deletions
diff --git a/plugins/NewStory/src/history.h b/plugins/NewStory/src/history.h index 00e9ccfded..ba34befa21 100644 --- a/plugins/NewStory/src/history.h +++ b/plugins/NewStory/src/history.h @@ -34,4 +34,6 @@ void InitHistory(); INT_PTR svcShowNewstory(WPARAM wParam, LPARAM lParam); INT_PTR svcShowSystemNewstory(WPARAM wParam, LPARAM lParam); +CSrmmLogWindow* __cdecl NewStory_Stub(CMsgDialog &pDlg); + #endif // __history_h__
\ No newline at end of file diff --git a/plugins/NewStory/src/history_log.cpp b/plugins/NewStory/src/history_log.cpp new file mode 100644 index 0000000000..779ef66ade --- /dev/null +++ b/plugins/NewStory/src/history_log.cpp @@ -0,0 +1,73 @@ +#include "stdafx.h" + +class CNewStoryLogWindow : public CSrmmLogWindow +{ + HWND m_hwnd = nullptr; + +public: + CNewStoryLogWindow(CMsgDialog &pDlg) : + CSrmmLogWindow(pDlg) + { + } + + void Attach() override + { + m_hwnd = ::CreateWindowW(_T(NEWSTORYLIST_CLASS), L"", WS_TABSTOP, 0, 0, 300, 150, m_pDlg.GetHwnd(), (HMENU)IDC_SRMM_LOG, m_pDlg.GetInst(), 0); + } + + void Detach() override + { + ::DestroyWindow(m_hwnd); + } + + ////////////////////////////////////////////////////////////////////////////////////// + + bool AtBottom() override + { + return false; + } + + void Clear() override + { + } + + HWND GetHwnd() override + { + return m_hwnd; + } + + wchar_t* GetSelection() override + { + return nullptr; + } + + int GetType() override + { + return 1; + } + + void LogEvents(MEVENT hDbEventFirst, int count, bool bAppend) override + { + } + + void LogEvents(DBEVENTINFO *dbei_s, bool bAppend) + { + } + + void LogEvents(LOGINFO *pLog, bool) override + { + } + + void Resize() override + { + } + + void ScrollToBottom() override + { + } +}; + +CSrmmLogWindow* __cdecl NewStory_Stub(CMsgDialog &pDlg) +{ + return new CNewStoryLogWindow(pDlg); +} diff --git a/plugins/NewStory/src/main.cpp b/plugins/NewStory/src/main.cpp index 085a613fb0..c0612b7629 100644 --- a/plugins/NewStory/src/main.cpp +++ b/plugins/NewStory/src/main.cpp @@ -98,6 +98,8 @@ int CMPlugin::Load() { g_plugin.registerIcon(MODULETITLE, icons); + m_log = RegisterSrmmLog(MODULETITLE, _T(MODULENAME), NewStory_Stub); + CreateServiceFunction(MS_HISTORY_SHOWCONTACTHISTORY, svcShowNewstory); CreateServiceFunction("Newstory/System", svcShowSystemNewstory); @@ -108,6 +110,7 @@ int CMPlugin::Load() int CMPlugin::Unload() { + UnregisterSrmmLog(m_log); UnregisterClass(_T(NEWSTORYLIST_CLASS), g_plugin.getInst()); DestroyFonts(); diff --git a/plugins/NewStory/src/msglog.cpp b/plugins/NewStory/src/msglog.cpp index fb93264d00..f818dd4b2b 100644 --- a/plugins/NewStory/src/msglog.cpp +++ b/plugins/NewStory/src/msglog.cpp @@ -217,4 +217,4 @@ public: CSrmmLogWindow *logBuilder(CMsgDialog &pDlg) { return new CNewStoryLogWindow(pDlg); -}
\ No newline at end of file +} diff --git a/plugins/NewStory/src/stdafx.h b/plugins/NewStory/src/stdafx.h index b58cadab99..6646640da4 100644 --- a/plugins/NewStory/src/stdafx.h +++ b/plugins/NewStory/src/stdafx.h @@ -73,6 +73,8 @@ int OptionsInitialize(WPARAM, LPARAM); struct CMPlugin : public PLUGIN<CMPlugin> { + HANDLE m_log; + CMPlugin(); int Load() override; |