reapack

Package manager for REAPER
Log | Files | Refs | Submodules | README | LICENSE

commit 6904837921b0d34a10ba150f8441fc85e6525479
parent 01228feb3cbd7e8ade9f358cd595abb83ee4b87f
Author: cfillion <cfillion@users.noreply.github.com>
Date:   Sun,  6 Dec 2015 02:24:48 -0500

add comments for future me

Diffstat:
Msrc/dialog.cpp | 8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/dialog.cpp b/src/dialog.cpp @@ -14,12 +14,19 @@ WDL_DLGRET Dialog::Proc(HWND handle, UINT msg, WPARAM wParam, LPARAM lParam) case WM_INITDIALOG: dlg = (Dialog *)lParam; dlg->m_handle = handle; + + // necessary if something in onInit triggers another event + // otherwhise dlg would be null then Dialog::s_instances[handle] = dlg; dlg->onInit(); break; case WM_SHOWWINDOW: if(wParam) { + // this makes possible to call onHide when destroying the window + // but only if was visible before the destruction request + // (destruction might be caused by the application exiting, + // in which case IsWindowVisible would be false but m_isVisible == true) dlg->m_isVisible = true; dlg->onShow(); } @@ -45,6 +52,7 @@ WDL_DLGRET Dialog::Proc(HWND handle, UINT msg, WPARAM wParam, LPARAM lParam) Dialog::Dialog(const int templateId) : m_template(templateId), m_parent(0), m_handle(0), m_isVisible(false) { + // can't call reimplemented virtual methods here during object construction } void Dialog::init(REAPER_PLUGIN_HINSTANCE instance, HWND parent)