From d625e19cdc79ec54d882aad95d05d7f24577bb6b Mon Sep 17 00:00:00 2001 From: Ian C Date: Tue, 5 Apr 2005 00:20:27 +0000 Subject: Added Move and MoveBase to Window --- src/window.cpp | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) (limited to 'src/window.cpp') diff --git a/src/window.cpp b/src/window.cpp index 1646d70..e64bd30 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -82,7 +82,39 @@ HMENU Window::GetHMENU() // bool Window::SetHMENU(HMENU menu) { - return SetMenu(m_wnd,menu) ? true:false; + return SetMenu(m_wnd,menu)!=0; +} + + +// ------------------------------------------------------------ +// +bool Window::Move(int x, int y, int width, int height, bool repaint) +{ + return MoveWindow(m_wnd,x,y,width,height,repaint ? TRUE:FALSE)!=0; +} + + +// ------------------------------------------------------------ +// +bool Window::MoveBase(Window *w, int x, int y, int width, int height, + bool repaint) +{ + RECT r; + + r.left=x; + r.top=y; + r.right=width; + r.bottom=height; + + if (MapDialogRect(w->m_wnd,&r)) + { + return MoveWindow(m_wnd,r.left,r.top, + r.right,r.bottom,repaint ? TRUE:FALSE)!=0; + } + else + { + return false; + } } -- cgit v1.2.3