More wxWindow work
authorDavid Webster <Dave.Webster@bhmi.com>
Tue, 16 Nov 1999 05:52:04 +0000 (05:52 +0000)
committerDavid Webster <Dave.Webster@bhmi.com>
Tue, 16 Nov 1999 05:52:04 +0000 (05:52 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4587 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/os2/window.cpp

index fb16810ccc1c0c9a823e9dfb72e730b4164fd4fd..3ae47914ad49e177b8dd8eb7fa1265b5ed7ff00d 100644 (file)
@@ -309,41 +309,80 @@ bool wxWindow::Create(
 
 void wxWindow::SetFocus()
 {
-    // TODO:
+    HWND                            hWnd = GetHwnd();
+
+    if (hWnd)
+        ::WinSetFocus(HWND_DESKTOP, hWnd);
 }
 
 wxWindow* wxWindowBase::FindFocus()
 {
-    wxWindow*                       window = NULL;
-    // TODO:
-    return(window);
+    HWND                            hWnd = ::WinQueryFocus(HWND_DESKTOP);
+
+    if (hWnd)
+    {
+        return wxFindWinFromHandle((WXHWND)hWnd);
+    }
+    return NULL;
 }
 
-bool wxWindow::Enable(bool enable) // check if base implementation is OK
+bool wxWindow::Enable(
+  bool                              bEnable
+)
 {
-    // TODO:
+    if (!wxWindowBase::Enable(bEnable))
+        return(FALSE);
+
+    HWND                            hWnd = GetHwnd();
+
+    if ( hWnd )
+        ::WinEnableWindow(hWnd, (BOOL)bEnable);
+
+    wxWindowList::Node*             pNode = GetChildren().GetFirst();
+
+    while (pNode)
+    {
+        wxWindow*                   pChild = pNode->GetData();
+
+        pChild->Enable(bEnable);
+        pNode = pNode->GetNext();
+    }
     return(TRUE);
 }
 
-bool wxWindow::Show(bool show) // check if base implementation is OK
+bool wxWindow::Show(
+  bool                              bShow
+)
 {
-    // TODO:
+    if (!wxWindowBase::Show(bShow))
+        return(FALSE);
+
+    HWND                            hWnd = GetHwnd();
+
+    ::WinShowWindow(hWnd, bShow);
+
+    if (bShow)
+    {
+        ::WinSetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0, SWP_ACTIVATE);
+    }
     return(TRUE);
 }
 
 void wxWindow::Raise()
 {
-    // TODO:
+    ::WinSetWindowPos(GetHwnd(), HWND_BOTTOM, 0, 0, 0, 0, SWP_ACTIVATE);
 }
 
 void wxWindow::Lower()
 {
-    // TODO:
+    ::WinSetWindowPos(GetHwnd(), HWND_BOTTOM, 0, 0, 0, 0, SWP_DEACTIVATE);
 }
 
-void wxWindow::SetTitle( const wxString& title)
+void wxWindow::SetTitle(
+  const wxString&                   rTitle
+)
 {
-// TODO:    SetWindowText(GetHwnd(), title.c_str());
+    ::WinSetWindowText(GetHwnd(), title.c_str());
 }
 
 wxString wxWindow::GetTitle() const