aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/vst/src/EditorWin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'externals/grill/vst/src/EditorWin.cpp')
-rw-r--r--externals/grill/vst/src/EditorWin.cpp39
1 files changed, 33 insertions, 6 deletions
diff --git a/externals/grill/vst/src/EditorWin.cpp b/externals/grill/vst/src/EditorWin.cpp
index c41f02e3..5418ba80 100644
--- a/externals/grill/vst/src/EditorWin.cpp
+++ b/externals/grill/vst/src/EditorWin.cpp
@@ -39,7 +39,7 @@ static LRESULT CALLBACK wndproc(HWND hwnd,UINT msg,WPARAM wp,LPARAM lp)
// case WM_NCREATE: res = TRUE; break;
case WM_CREATE:
// Initialize the window.
- plug->SetEditWindow(hwnd);
+ plug->StartEditing(hwnd);
break;
case WM_CLOSE:
plug->StopEditing();
@@ -54,13 +54,21 @@ static LRESULT CALLBACK wndproc(HWND hwnd,UINT msg,WPARAM wp,LPARAM lp)
case WM_ENTERIDLE:
plug->EditorIdle();
break;
- case WM_MOVE:
- plug->setPos(LOWORD(lp),HIWORD(lp));
+ case WM_MOVE: {
+ WORD x = LOWORD(lp),y = HIWORD(lp);
+ plug->SetPos(reinterpret_cast<short &>(x),reinterpret_cast<short &>(y),false);
break;
+ }
/*
- case WM_PAINT:
+ case WM_PAINT: {
// Paint the window's client area.
+ RECT rect;
+ GetUpdateRect(hwnd,rect,FALSE);
+ plug->Paint(rect);
break;
+ }
+*/
+/*
case WM_SIZE:
// Set the size and position of the window.
break;
@@ -112,8 +120,11 @@ static void threadfun(flext::thr_params *p)
SetTimer(wnd,0,25,NULL);
- RECT r = plug->GetEditorRect();
- SetWindowPos(wnd,HWND_TOPMOST,plug->getX(),plug->getY(),(r.right - r.left) + 6 , r.bottom - r.top + 26 , SWP_SHOWWINDOW);
+ ERect r;
+ plug->GetEditorRect(r);
+// SetWindowPos(wnd,HWND_TOP,plug->getX(),plug->getY(),(r.right - r.left) + 6 , r.bottom - r.top + 26 , SWP_SHOWWINDOW);
+ SetWindowPos(wnd,HWND_TOP,r.left,r.top,(r.right - r.left) + 6 , r.bottom - r.top + 26 , SWP_SHOWWINDOW);
+
// ShowWindow( SW_SHOW );
// BringWindowToTop(wnd);
// SetFocus();
@@ -177,4 +188,20 @@ void ShowEditor(VSTPlugin *p,bool show)
ShowWindow(p->EditorHandle(),show);
}
+void MoveEditor(VSTPlugin *p,int x,int y)
+{
+ // the client region must be taken into account
+// SetWindowPos(p->EditorHandle(),NULL,x,y,0,0,SWP_NOSIZE|SWP_NOZORDER);
+}
+
+void SizeEditor(VSTPlugin *p,int x,int y)
+{
+ SetWindowPos(p->EditorHandle(),NULL,0,0,x,y,SWP_NOMOVE|SWP_NOZORDER);
+}
+
+bool IsEditorShown(const VSTPlugin *p)
+{
+ return IsWindowVisible(p->EditorHandle()) != FALSE;
+}
+
#endif // FLEXT_OS_WIN