]> git.saurik.com Git - wxWidgets.git/blobdiff - src/palmos/window.cpp
don't assume there's always an active wxEventLoop instance
[wxWidgets.git] / src / palmos / window.cpp
index b46aad8784b9bbe46bda232e9d739475b51642ff..f2f25a01099c3433e94a3c641fad420f803384e1 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        src/palmos/windows.cpp
+// Name:        src/palmos/window.cpp
 // Purpose:     wxWindow
 // Author:      William Osborne - minimal working wxPalmOS port
 // Modified by: Wlodzimierz ABX Skiba - more than minimal functionality
 // headers
 // ---------------------------------------------------------------------------
 
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-    #pragma implementation "window.h"
-#endif
-
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
     #pragma hdrstop
 #endif
 
+#include "wx/window.h"
+
 #ifndef WX_PRECOMP
-    #include "wx/window.h"
     #include "wx/accel.h"
-    #include "wx/setup.h"
     #include "wx/menu.h"
     #include "wx/dc.h"
     #include "wx/dcclient.h"
     #include "wx/msgdlg.h"
     #include "wx/settings.h"
     #include "wx/statbox.h"
+    #include "wx/intl.h"
+    #include "wx/log.h"
+    #include "wx/textctrl.h"
+    #include "wx/menuitem.h"
+    #include "wx/module.h"
 #endif
 
 #if wxUSE_OWNER_DRAWN && !defined(__WXUNIVERSAL__)
     #include "wx/ownerdrw.h"
 #endif
 
-#include "wx/module.h"
-
 #if wxUSE_DRAG_AND_DROP
     #include "wx/dnd.h"
 #endif
@@ -62,9 +61,6 @@
     #include "wx/access.h"
 #endif
 
-#include "wx/menuitem.h"
-#include "wx/log.h"
-
 #if wxUSE_TOOLTIPS
     #include "wx/tooltip.h"
 #endif
     #include "wx/spinctrl.h"
 #endif // wxUSE_SPINCTRL
 
-#include "wx/intl.h"
-#include "wx/log.h"
-
-#include "wx/textctrl.h"
 #include "wx/notebook.h"
 #include "wx/listctrl.h"
-#include "wx/window.h"
+
+#include <Window.h>
 
 // ---------------------------------------------------------------------------
 // global variables
@@ -238,6 +231,16 @@ wxWindow *wxWindowPalm::FindItemByWinHandle(WXWINHANDLE handle, bool controlOnly
     return NULL;
 }
 
+bool wxGetKeyState(wxKeyCode key)
+{
+    wxASSERT_MSG(key != WXK_LBUTTON && key != WXK_RBUTTON && key !=
+        WXK_MBUTTON, wxT("can't use wxGetKeyState() for mouse buttons"));
+
+    // TODO
+
+    return false;
+}
+
 // ----------------------------------------------------------------------------
 // constructors and such
 // ----------------------------------------------------------------------------
@@ -272,13 +275,13 @@ bool wxWindowPalm::Create(wxWindow *parent,
     return true;
 }
 
-FormType *wxWindowPalm::GetFormPtr()
+WXFORMPTR wxWindowPalm::GetFormPtr()
 {
     return FrameForm;
 }
-void wxWindowPalm::SetFormPtr(FormType *FormPtr)
+void wxWindowPalm::SetFormPtr(WXFORMPTR FormPtr)
 {
-    FrameForm=FormPtr;
+    FrameForm = FormPtr;
 }
 
 // ---------------------------------------------------------------------------
@@ -319,11 +322,11 @@ void wxWindowPalm::Lower()
 {
 }
 
-void wxWindowPalm::SetTitle( const wxString& title)
+void wxWindowPalm::SetLabel( const wxString& WXUNUSED(label))
 {
 }
 
-wxString wxWindowPalm::GetTitle() const
+wxString wxWindowPalm::GetLabel() const
 {
     return wxEmptyString;
 }
@@ -442,16 +445,16 @@ void wxWindowPalm::Thaw()
 
 void wxWindowPalm::Refresh(bool eraseBack, const wxRect *rect)
 {
-    WinHandle handle = GetWinHandle();
+    WinHandle handle = (WinHandle)GetWinHandle();
     if(handle)
     {
         if(rect)
         {
             RectangleType dirtyRect;
-            dirtyRect.topLeft.x = rect->GetX();
-            dirtyRect.topLeft.y = rect->GetY();
-            dirtyRect.extent.x = rect->GetWidth();
-            dirtyRect.extent.y = rect->GetHeight();
+            dirtyRect.topLeft.x = rect->GetX() - 1;
+            dirtyRect.topLeft.y = rect->GetY() - 1;
+            dirtyRect.extent.x = rect->GetWidth() + 1;
+            dirtyRect.extent.y = rect->GetHeight() + 1;
             WinInvalidateRect(handle, &dirtyRect);
         }
         else
@@ -510,6 +513,10 @@ void wxWindowPalm::DoGetClientSize(int *x, int *y) const
 
 void wxWindowPalm::DoGetPosition(int *x, int *y) const
 {
+    if(x)
+        *x = 0;
+    if(y)
+        *y = 0;
 }
 
 void wxWindowPalm::DoScreenToClient(int *x, int *y) const
@@ -749,5 +756,3 @@ bool wxWindowPalm::UnregisterHotKey(int hotkeyId)
 }
 
 #endif // wxUSE_HOTKEY
-
-