]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/wxPython/src/gtk/windows.py
Minor improvement.
[wxWidgets.git] / utils / wxPython / src / gtk / windows.py
index e334d328671b8c960338dbe5ba050c0d93ac5a22..85ae8f4dd0d5d96f7066239e03190738eab3bb51 100644 (file)
@@ -4,10 +4,27 @@ import windowsc
 from misc import *
 
 from gdi import *
+import wx
+
+def wxDLG_PNT(win, point_or_x, y=None):
+    if y is None:
+        return win.ConvertDialogPointToPixels(point_or_x)
+    else:
+        return win.ConvertDialogPointToPixels(wxPoint(point_or_x, y))
+
+def wxDLG_SZE(win, size_width, height=None):
+    if height is None:
+        return win.ConvertDialogSizeToPixels(size_width)
+    else:
+        return win.ConvertDialogSizeToPixels(wxSize(size_width, height))
+
 class wxEvtHandlerPtr :
     def __init__(self,this):
         self.this = this
         self.thisown = 0
+    def ProcessEvent(self,arg0):
+        val = windowsc.wxEvtHandler_ProcessEvent(self.this,arg0.this)
+        return val
     def Connect(self,arg0,arg1,arg2,arg3):
         val = windowsc.wxEvtHandler_Connect(self.this,arg0,arg1,arg2,arg3)
         return val
@@ -33,8 +50,19 @@ class wxWindowPtr(wxEvtHandlerPtr):
     def Centre(self,*args):
         val = apply(windowsc.wxWindow_Centre,(self.this,)+args)
         return val
-    def ClientToScreen(self,arg0,arg1):
-        val = windowsc.wxWindow_ClientToScreen(self.this,arg0,arg1)
+    def CentreOnParent(self,*args):
+        val = apply(windowsc.wxWindow_CentreOnParent,(self.this,)+args)
+        return val
+    def CenterOnParent(self,*args):
+        val = apply(windowsc.wxWindow_CenterOnParent,(self.this,)+args)
+        return val
+    def ClientToScreenXY(self,arg0,arg1):
+        val = windowsc.wxWindow_ClientToScreenXY(self.this,arg0,arg1)
+        return val
+    def ClientToScreen(self,arg0):
+        val = windowsc.wxWindow_ClientToScreen(self.this,arg0.this)
+        val = wxPointPtr(val)
+        val.thisown = 1
         return val
     def Close(self,*args):
         val = apply(windowsc.wxWindow_Close,(self.this,)+args)
@@ -48,8 +76,8 @@ class wxWindowPtr(wxEvtHandlerPtr):
     def Enable(self,arg0):
         val = windowsc.wxWindow_Enable(self.this,arg0)
         return val
-    def FindWindowByID(self,arg0):
-        val = windowsc.wxWindow_FindWindowByID(self.this,arg0)
+    def FindWindowById(self,arg0):
+        val = windowsc.wxWindow_FindWindowById(self.this,arg0)
         val = wxWindowPtr(val)
         return val
     def FindWindowByName(self,arg0):
@@ -70,8 +98,13 @@ class wxWindowPtr(wxEvtHandlerPtr):
     def GetCharWidth(self):
         val = windowsc.wxWindow_GetCharWidth(self.this)
         return val
+    def GetClientSizeTuple(self):
+        val = windowsc.wxWindow_GetClientSizeTuple(self.this)
+        return val
     def GetClientSize(self):
         val = windowsc.wxWindow_GetClientSize(self.this)
+        val = wxSizePtr(val)
+        val.thisown = 1
         return val
     def GetConstraints(self):
         val = windowsc.wxWindow_GetConstraints(self.this)
@@ -93,12 +126,12 @@ class wxWindowPtr(wxEvtHandlerPtr):
     def GetId(self):
         val = windowsc.wxWindow_GetId(self.this)
         return val
-    def GetPosition(self):
-        val = windowsc.wxWindow_GetPosition(self.this)
-        return val
     def GetLabel(self):
         val = windowsc.wxWindow_GetLabel(self.this)
         return val
+    def SetLabel(self,arg0):
+        val = windowsc.wxWindow_SetLabel(self.this,arg0)
+        return val
     def GetName(self):
         val = windowsc.wxWindow_GetName(self.this)
         return val
@@ -106,8 +139,18 @@ class wxWindowPtr(wxEvtHandlerPtr):
         val = windowsc.wxWindow_GetParent(self.this)
         val = wxWindowPtr(val)
         return val
-    def GetReturnCode(self):
-        val = windowsc.wxWindow_GetReturnCode(self.this)
+    def GetPositionTuple(self):
+        val = windowsc.wxWindow_GetPositionTuple(self.this)
+        return val
+    def GetPosition(self):
+        val = windowsc.wxWindow_GetPosition(self.this)
+        val = wxPointPtr(val)
+        val.thisown = 1
+        return val
+    def GetRect(self):
+        val = windowsc.wxWindow_GetRect(self.this)
+        val = wxRectPtr(val)
+        val.thisown = 1
         return val
     def GetScrollThumb(self,arg0):
         val = windowsc.wxWindow_GetScrollThumb(self.this,arg0)
@@ -118,18 +161,33 @@ class wxWindowPtr(wxEvtHandlerPtr):
     def GetScrollRange(self,arg0):
         val = windowsc.wxWindow_GetScrollRange(self.this,arg0)
         return val
+    def GetSizeTuple(self):
+        val = windowsc.wxWindow_GetSizeTuple(self.this)
+        return val
     def GetSize(self):
         val = windowsc.wxWindow_GetSize(self.this)
+        val = wxSizePtr(val)
+        val.thisown = 1
         return val
     def GetTextExtent(self,arg0):
         val = windowsc.wxWindow_GetTextExtent(self.this,arg0)
         return val
+    def GetFullTextExtent(self,arg0,*args):
+        argl = map(None,args)
+        try: argl[0] = argl[0].this
+        except: pass
+        args = tuple(argl)
+        val = apply(windowsc.wxWindow_GetFullTextExtent,(self.this,arg0,)+args)
+        return val
     def GetTitle(self):
         val = windowsc.wxWindow_GetTitle(self.this)
         return val
     def GetWindowStyleFlag(self):
         val = windowsc.wxWindow_GetWindowStyleFlag(self.this)
         return val
+    def Hide(self):
+        val = windowsc.wxWindow_Hide(self.this)
+        return val
     def InitDialog(self):
         val = windowsc.wxWindow_InitDialog(self.this)
         return val
@@ -142,6 +200,9 @@ class wxWindowPtr(wxEvtHandlerPtr):
     def IsShown(self):
         val = windowsc.wxWindow_IsShown(self.this)
         return val
+    def IsTopLevel(self):
+        val = windowsc.wxWindow_IsTopLevel(self.this)
+        return val
     def Layout(self):
         val = windowsc.wxWindow_Layout(self.this)
         return val
@@ -154,8 +215,11 @@ class wxWindowPtr(wxEvtHandlerPtr):
     def MakeModal(self,arg0):
         val = windowsc.wxWindow_MakeModal(self.this,arg0)
         return val
-    def Move(self,arg0,arg1):
-        val = windowsc.wxWindow_Move(self.this,arg0,arg1)
+    def MoveXY(self,arg0,arg1):
+        val = windowsc.wxWindow_MoveXY(self.this,arg0,arg1)
+        return val
+    def Move(self,arg0):
+        val = windowsc.wxWindow_Move(self.this,arg0.this)
         return val
     def PopupMenu(self,arg0,arg1,arg2):
         val = windowsc.wxWindow_PopupMenu(self.this,arg0.this,arg1,arg2)
@@ -173,8 +237,16 @@ class wxWindowPtr(wxEvtHandlerPtr):
     def ReleaseMouse(self):
         val = windowsc.wxWindow_ReleaseMouse(self.this)
         return val
-    def ScreenToClient(self,arg0,arg1):
-        val = windowsc.wxWindow_ScreenToClient(self.this,arg0,arg1)
+    def Reparent(self,arg0):
+        val = windowsc.wxWindow_Reparent(self.this,arg0.this)
+        return val
+    def ScreenToClientXY(self,arg0,arg1):
+        val = windowsc.wxWindow_ScreenToClientXY(self.this,arg0,arg1)
+        return val
+    def ScreenToClient(self,arg0):
+        val = windowsc.wxWindow_ScreenToClient(self.this,arg0.this)
+        val = wxPointPtr(val)
+        val.thisown = 1
         return val
     def ScrollWindow(self,arg0,arg1,*args):
         argl = map(None,args)
@@ -183,6 +255,9 @@ class wxWindowPtr(wxEvtHandlerPtr):
         args = tuple(argl)
         val = apply(windowsc.wxWindow_ScrollWindow,(self.this,arg0,arg1,)+args)
         return val
+    def SetAcceleratorTable(self,arg0):
+        val = windowsc.wxWindow_SetAcceleratorTable(self.this,arg0.this)
+        return val
     def SetAutoLayout(self,arg0):
         val = windowsc.wxWindow_SetAutoLayout(self.this,arg0)
         return val
@@ -192,9 +267,6 @@ class wxWindowPtr(wxEvtHandlerPtr):
     def SetConstraints(self,arg0):
         val = windowsc.wxWindow_SetConstraints(self.this,arg0.this)
         return val
-    def SetDoubleClick(self,arg0):
-        val = windowsc.wxWindow_SetDoubleClick(self.this,arg0)
-        return val
     def SetFocus(self):
         val = windowsc.wxWindow_SetFocus(self.this)
         return val
@@ -210,9 +282,6 @@ class wxWindowPtr(wxEvtHandlerPtr):
     def SetName(self,arg0):
         val = windowsc.wxWindow_SetName(self.this,arg0)
         return val
-    def SetReturnCode(self,arg0):
-        val = windowsc.wxWindow_SetReturnCode(self.this,arg0)
-        return val
     def SetScrollbar(self,arg0,arg1,arg2,arg3,*args):
         val = apply(windowsc.wxWindow_SetScrollbar,(self.this,arg0,arg1,arg2,arg3,)+args)
         return val
@@ -231,8 +300,11 @@ class wxWindowPtr(wxEvtHandlerPtr):
     def SetSizeHints(self,*args):
         val = apply(windowsc.wxWindow_SetSizeHints,(self.this,)+args)
         return val
-    def SetClientSize(self,arg0,arg1):
-        val = windowsc.wxWindow_SetClientSize(self.this,arg0,arg1)
+    def SetClientSizeWH(self,arg0,arg1):
+        val = windowsc.wxWindow_SetClientSizeWH(self.this,arg0,arg1)
+        return val
+    def SetClientSize(self,arg0):
+        val = windowsc.wxWindow_SetClientSize(self.this,arg0.this)
         return val
     def SetCursor(self,arg0):
         val = windowsc.wxWindow_SetCursor(self.this,arg0.this)
@@ -252,78 +324,62 @@ class wxWindowPtr(wxEvtHandlerPtr):
     def Validate(self):
         val = windowsc.wxWindow_Validate(self.this)
         return val
-    def __repr__(self):
-        return "<C wxWindow instance>"
-class wxWindow(wxWindowPtr):
-    def __init__(self,arg0,arg1,*args) :
-        argl = map(None,args)
-        try: argl[0] = argl[0].this
-        except: pass
-        try: argl[1] = argl[1].this
-        except: pass
-        args = tuple(argl)
-        self.this = apply(windowsc.new_wxWindow,(arg0.this,arg1,)+args)
-        self.thisown = 1
-
-
-
-
-class wxFramePtr(wxWindowPtr):
-    def __init__(self,this):
-        self.this = this
-        self.thisown = 0
-    def Centre(self,*args):
-        val = apply(windowsc.wxFrame_Centre,(self.this,)+args)
-        return val
-    def CreateStatusBar(self,*args):
-        val = apply(windowsc.wxFrame_CreateStatusBar,(self.this,)+args)
-        return val
-    def GetMenuBar(self):
-        val = windowsc.wxFrame_GetMenuBar(self.this)
-        val = wxMenuBarPtr(val)
+    def WarpPointer(self,arg0,arg1):
+        val = windowsc.wxWindow_WarpPointer(self.this,arg0,arg1)
         return val
-    def GetStatusBar(self):
-        val = windowsc.wxFrame_GetStatusBar(self.this)
-        return val
-    def GetTitle(self):
-        val = windowsc.wxFrame_GetTitle(self.this)
+    def ConvertDialogPointToPixels(self,arg0):
+        val = windowsc.wxWindow_ConvertDialogPointToPixels(self.this,arg0.this)
+        val = wxPointPtr(val)
+        val.thisown = 1
         return val
-    def Iconize(self,arg0):
-        val = windowsc.wxFrame_Iconize(self.this,arg0)
+    def ConvertDialogSizeToPixels(self,arg0):
+        val = windowsc.wxWindow_ConvertDialogSizeToPixels(self.this,arg0.this)
+        val = wxSizePtr(val)
+        val.thisown = 1
         return val
-    def IsIconized(self):
-        val = windowsc.wxFrame_IsIconized(self.this)
+    def DLG_PNT(self,arg0):
+        val = windowsc.wxWindow_DLG_PNT(self.this,arg0.this)
+        val = wxPointPtr(val)
+        val.thisown = 1
         return val
-    def Maximize(self,arg0):
-        val = windowsc.wxFrame_Maximize(self.this,arg0)
+    def DLG_SZE(self,arg0):
+        val = windowsc.wxWindow_DLG_SZE(self.this,arg0.this)
+        val = wxSizePtr(val)
+        val.thisown = 1
         return val
-    def SetIcon(self,arg0):
-        val = windowsc.wxFrame_SetIcon(self.this,arg0.this)
+    def ConvertPixelPointToDialog(self,arg0):
+        val = windowsc.wxWindow_ConvertPixelPointToDialog(self.this,arg0.this)
+        val = wxPointPtr(val)
+        val.thisown = 1
         return val
-    def SetMenuBar(self,arg0):
-        val = windowsc.wxFrame_SetMenuBar(self.this,arg0.this)
+    def ConvertPixelSizeToDialog(self,arg0):
+        val = windowsc.wxWindow_ConvertPixelSizeToDialog(self.this,arg0.this)
+        val = wxSizePtr(val)
+        val.thisown = 1
         return val
-    def SetStatusText(self,arg0,*args):
-        val = apply(windowsc.wxFrame_SetStatusText,(self.this,arg0,)+args)
+    def SetToolTipString(self,arg0):
+        val = windowsc.wxWindow_SetToolTipString(self.this,arg0)
         return val
-    def SetStatusWidths(self,arg0,*args):
-        val = apply(windowsc.wxFrame_SetStatusWidths,(self.this,arg0,)+args)
+    def SetToolTip(self,arg0):
+        val = windowsc.wxWindow_SetToolTip(self.this,arg0.this)
         return val
-    def SetTitle(self,arg0):
-        val = windowsc.wxFrame_SetTitle(self.this,arg0)
+    def GetToolTip(self):
+        val = windowsc.wxWindow_GetToolTip(self.this)
+        val = wxToolTipPtr(val)
         return val
     def __repr__(self):
-        return "<C wxFrame instance>"
-class wxFrame(wxFramePtr):
-    def __init__(self,arg0,arg1,arg2,*args) :
+        return "<C wxWindow instance>"
+class wxWindow(wxWindowPtr):
+    def __init__(self,arg0,arg1,*args) :
         argl = map(None,args)
         try: argl[0] = argl[0].this
         except: pass
         try: argl[1] = argl[1].this
         except: pass
         args = tuple(argl)
-        self.this = apply(windowsc.new_wxFrame,(arg0.this,arg1,arg2,)+args)
+        self.this = apply(windowsc.new_wxWindow,(arg0.this,arg1,)+args)
         self.thisown = 1
+        wx._StdWindowCallbacks(self)
 
 
 
@@ -335,8 +391,22 @@ class wxPanelPtr(wxWindowPtr):
     def InitDialog(self):
         val = windowsc.wxPanel_InitDialog(self.this)
         return val
+    def GetDefaultItem(self):
+        val = windowsc.wxPanel_GetDefaultItem(self.this)
+        val = wxButtonPtr(val)
+        return val
+    def SetDefaultItem(self,arg0):
+        val = windowsc.wxPanel_SetDefaultItem(self.this,arg0.this)
+        return val
     def __repr__(self):
         return "<C wxPanel instance>"
+    
+    def GetDefaultItem(self):
+        import controls
+        val = windowsc.wxPanel_GetDefaultItem(self.this)
+        val = controls.wxButtonPtr(val)
+        return val
+
 class wxPanel(wxPanelPtr):
     def __init__(self,arg0,arg1,*args) :
         argl = map(None,args)
@@ -347,6 +417,7 @@ class wxPanel(wxPanelPtr):
         args = tuple(argl)
         self.this = apply(windowsc.new_wxPanel,(arg0.this,arg1,)+args)
         self.thisown = 1
+        wx._StdWindowCallbacks(self)
 
 
 
@@ -385,6 +456,12 @@ class wxDialogPtr(wxPanelPtr):
     def ShowModal(self):
         val = windowsc.wxDialog_ShowModal(self.this)
         return val
+    def GetReturnCode(self):
+        val = windowsc.wxDialog_GetReturnCode(self.this)
+        return val
+    def SetReturnCode(self,arg0):
+        val = windowsc.wxDialog_SetReturnCode(self.this,arg0)
+        return val
     def __repr__(self):
         return "<C wxDialog instance>"
 class wxDialog(wxDialogPtr):
@@ -397,11 +474,12 @@ class wxDialog(wxDialogPtr):
         args = tuple(argl)
         self.this = apply(windowsc.new_wxDialog,(arg0.this,arg1,arg2,)+args)
         self.thisown = 1
+        wx._StdDialogCallbacks(self)
 
 
 
 
-class wxScrolledWindowPtr(wxWindowPtr):
+class wxScrolledWindowPtr(wxPanelPtr):
     def __init__(self,this):
         self.this = this
         self.thisown = 0
@@ -441,6 +519,8 @@ class wxScrolledWindow(wxScrolledWindowPtr):
         args = tuple(argl)
         self.this = apply(windowsc.new_wxScrolledWindow,(arg0.this,)+args)
         self.thisown = 1
+        wx._StdWindowCallbacks(self)
+        wx._StdOnScrollCallbacks(self)
 
 
 
@@ -470,6 +550,12 @@ class wxMenuPtr(wxEvtHandlerPtr):
     def FindItem(self,arg0):
         val = windowsc.wxMenu_FindItem(self.this,arg0)
         return val
+    def GetTitle(self):
+        val = windowsc.wxMenu_GetTitle(self.this)
+        return val
+    def SetTitle(self,arg0):
+        val = windowsc.wxMenu_SetTitle(self.this,arg0)
+        return val
     def FindItemForId(self,arg0):
         val = windowsc.wxMenu_FindItemForId(self.this,arg0)
         val = wxMenuItemPtr(val)
@@ -585,6 +671,12 @@ class wxMenuItemPtr :
         val = windowsc.wxMenuItem_GetSubMenu(self.this)
         val = wxMenuPtr(val)
         return val
+    def SetName(self,arg0):
+        val = windowsc.wxMenuItem_SetName(self.this,arg0)
+        return val
+    def GetName(self):
+        val = windowsc.wxMenuItem_GetName(self.this)
+        return val
     def GetHelp(self):
         val = windowsc.wxMenuItem_GetHelp(self.this)
         return val
@@ -600,8 +692,9 @@ class wxMenuItemPtr :
     def __repr__(self):
         return "<C wxMenuItem instance>"
 class wxMenuItem(wxMenuItemPtr):
-    def __init__(self,this):
-        self.this = this
+    def __init__(self) :
+        self.this = windowsc.new_wxMenuItem()
+        self.thisown = 1