X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f6bcfd974ef26faf6f91a62cac09827e09463fd1..0e980f91092ded629a7b014ff0d2238b1c8940c5:/wxPython/src/msw/windows.py diff --git a/wxPython/src/msw/windows.py b/wxPython/src/msw/windows.py index f9db9758b1..a047792862 100644 --- a/wxPython/src/msw/windows.py +++ b/wxPython/src/msw/windows.py @@ -20,7 +20,7 @@ def wxDLG_SZE(win, size_width, height=None): else: return win.ConvertDialogSizeToPixels(wxSize(size_width, height)) -class wxEvtHandlerPtr : +class wxEvtHandlerPtr(wxObjectPtr): def __init__(self,this): self.this = this self.thisown = 0 @@ -38,11 +38,9 @@ class wxEvtHandlerPtr : return val def GetNextHandler(self, *_args, **_kwargs): val = apply(windowsc.wxEvtHandler_GetNextHandler,(self,) + _args, _kwargs) - if val: val = wxEvtHandlerPtr(val) return val def GetPreviousHandler(self, *_args, **_kwargs): val = apply(windowsc.wxEvtHandler_GetPreviousHandler,(self,) + _args, _kwargs) - if val: val = wxEvtHandlerPtr(val) return val def SetNextHandler(self, *_args, **_kwargs): val = apply(windowsc.wxEvtHandler_SetNextHandler,(self,) + _args, _kwargs) @@ -58,12 +56,10 @@ class wxEvtHandlerPtr : return val def __repr__(self): return "" % (self.this,) - - _prop_list_ = {} - class wxEvtHandler(wxEvtHandlerPtr): - def __init__(self,this): - self.this = this + def __init__(self,*_args,**_kwargs): + self.this = apply(windowsc.new_wxEvtHandler,_args,_kwargs) + self.thisown = 1 @@ -74,23 +70,15 @@ class wxValidatorPtr(wxEvtHandlerPtr): self.thisown = 0 def Clone(self, *_args, **_kwargs): val = apply(windowsc.wxValidator_Clone,(self,) + _args, _kwargs) - if val: val = wxValidatorPtr(val) return val def GetWindow(self, *_args, **_kwargs): val = apply(windowsc.wxValidator_GetWindow,(self,) + _args, _kwargs) - if val: val = wxWindowPtr(val) return val def SetWindow(self, *_args, **_kwargs): val = apply(windowsc.wxValidator_SetWindow,(self,) + _args, _kwargs) return val def __repr__(self): return "" % (self.this,) - - _prop_list_ = { - 'window' : ('GetWindow', 'SetWindow'), - } - _prop_list_.update(wxEvtHandler._prop_list_) - class wxValidator(wxValidatorPtr): def __init__(self,*_args,**_kwargs): self.this = apply(windowsc.new_wxValidator,_args,_kwargs) @@ -103,9 +91,6 @@ class wxPyValidatorPtr(wxValidatorPtr): def __init__(self,this): self.this = this self.thisown = 0 - def Destroy(self, *_args, **_kwargs): - val = apply(windowsc.wxPyValidator_Destroy,(self,) + _args, _kwargs) - return val def _setSelf(self, *_args, **_kwargs): val = apply(windowsc.wxPyValidator__setSelf,(self,) + _args, _kwargs) return val @@ -115,7 +100,7 @@ class wxPyValidator(wxPyValidatorPtr): def __init__(self,*_args,**_kwargs): self.this = apply(windowsc.new_wxPyValidator,_args,_kwargs) self.thisown = 1 - self._setSelf(self, wxPyValidator, 0) + self._setSelf(self, wxPyValidator, 1) @@ -139,6 +124,15 @@ class wxWindowPtr(wxEvtHandlerPtr): def CenterOnParent(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_CenterOnParent,(self,) + _args, _kwargs) return val + def CentreOnScreen(self, *_args, **_kwargs): + val = apply(windowsc.wxWindow_CentreOnScreen,(self,) + _args, _kwargs) + return val + def CenterOnScreen(self, *_args, **_kwargs): + val = apply(windowsc.wxWindow_CenterOnScreen,(self,) + _args, _kwargs) + return val + def Clear(self, *_args, **_kwargs): + val = apply(windowsc.wxWindow_Clear,(self,) + _args, _kwargs) + return val def ClientToScreenXY(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_ClientToScreenXY,(self,) + _args, _kwargs) return val @@ -155,6 +149,9 @@ class wxWindowPtr(wxEvtHandlerPtr): def DestroyChildren(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_DestroyChildren,(self,) + _args, _kwargs) return val + def IsBeingDeleted(self, *_args, **_kwargs): + val = apply(windowsc.wxWindow_IsBeingDeleted,(self,) + _args, _kwargs) + return val def DragAcceptFiles(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_DragAcceptFiles,(self,) + _args, _kwargs) return val @@ -163,11 +160,9 @@ class wxWindowPtr(wxEvtHandlerPtr): return val def FindWindowById(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_FindWindowById,(self,) + _args, _kwargs) - if val: val = wxWindowPtr(val) return val def FindWindowByName(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_FindWindowByName,(self,) + _args, _kwargs) - if val: val = wxWindowPtr(val) return val def Fit(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_Fit,(self,) + _args, _kwargs) @@ -198,7 +193,6 @@ class wxWindowPtr(wxEvtHandlerPtr): return val def GetEventHandler(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_GetEventHandler,(self,) + _args, _kwargs) - if val: val = wxEvtHandlerPtr(val) return val def GetFont(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_GetFont,(self,) + _args, _kwargs) @@ -210,7 +204,6 @@ class wxWindowPtr(wxEvtHandlerPtr): return val def GetGrandParent(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_GetGrandParent,(self,) + _args, _kwargs) - if val: val = wxWindowPtr(val) return val def GetHandle(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_GetHandle,(self,) + _args, _kwargs) @@ -229,7 +222,6 @@ class wxWindowPtr(wxEvtHandlerPtr): return val def GetParent(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_GetParent,(self,) + _args, _kwargs) - if val: val = wxWindowPtr(val) return val def GetPositionTuple(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_GetPositionTuple,(self,) + _args, _kwargs) @@ -327,7 +319,6 @@ class wxWindowPtr(wxEvtHandlerPtr): return val def PopEventHandler(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_PopEventHandler,(self,) + _args, _kwargs) - if val: val = wxEvtHandlerPtr(val) return val def PushEventHandler(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_PushEventHandler,(self,) + _args, _kwargs) @@ -414,6 +405,9 @@ class wxWindowPtr(wxEvtHandlerPtr): def SetPosition(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_SetPosition,(self,) + _args, _kwargs) return val + def SetRect(self, *_args, **_kwargs): + val = apply(windowsc.wxWindow_SetRect,(self,) + _args, _kwargs) + return val def SetSizeHints(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_SetSizeHints,(self,) + _args, _kwargs) return val @@ -429,6 +423,9 @@ class wxWindowPtr(wxEvtHandlerPtr): def SetEventHandler(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_SetEventHandler,(self,) + _args, _kwargs) return val + def SetExtraStyle(self, *_args, **_kwargs): + val = apply(windowsc.wxWindow_SetExtraStyle,(self,) + _args, _kwargs) + return val def SetTitle(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_SetTitle,(self,) + _args, _kwargs) return val @@ -479,18 +476,15 @@ class wxWindowPtr(wxEvtHandlerPtr): return val def GetToolTip(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_GetToolTip,(self,) + _args, _kwargs) - if val: val = wxToolTipPtr(val) return val def SetSizer(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_SetSizer,(self,) + _args, _kwargs) return val def GetSizer(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_GetSizer,(self,) + _args, _kwargs) - if val: val = wxSizerPtr(val) return val def GetValidator(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_GetValidator,(self,) + _args, _kwargs) - if val: val = wxValidatorPtr(val) return val def SetValidator(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_SetValidator,(self,) + _args, _kwargs) @@ -523,37 +517,6 @@ class wxWindowPtr(wxEvtHandlerPtr): if val: val = wxCaretPtr(val) return val - - _prop_list_ = { - 'size' : ('GetSize', 'SetSize'), - 'enabled' : ('IsEnabled', 'Enable'), - 'background' : ('GetBackgroundColour', 'SetBackgroundColour'), - 'foreground' : ('GetForegroundColour', 'SetForegroundColour'), - 'children' : ('GetChildren', None), - 'charHeight' : ('GetCharHeight', None), - 'charWidth' : ('GetCharWidth', None), - 'clientSize' : ('GetClientSize', 'SetClientSize'), - 'font' : ('GetFont', 'SetFont'), - 'grandParent' : ('GetGrandParent', None), - 'handle' : ('GetHandle', None), - 'label' : ('GetLabel', 'SetLabel'), - 'name' : ('GetName', 'SetName'), - 'parent' : ('GetParent', None), - 'position' : ('GetPosition', 'SetPosition'), - 'title' : ('GetTitle', 'SetTitle'), - 'style' : ('GetWindowStyleFlag', 'SetWindowStyleFlag'), - 'visible' : ('IsShown', 'Show'), - 'toolTip' : ('GetToolTip', 'SetToolTip'), - 'sizer' : ('GetSizer', 'SetSizer'), - 'validator' : ('GetValidator', 'SetValidator'), - 'dropTarget' : ('GetDropTarget', 'SetDropTarget'), - 'caret' : ('GetCaret', 'SetCaret'), - 'autoLayout' : ('GetAutoLayout', 'SetAutoLayout'), - 'constraints' : ('GetConstraints', 'SetConstraints'), - - } - _prop_list_.update(wxEvtHandler._prop_list_) - class wxWindow(wxWindowPtr): def __init__(self,*_args,**_kwargs): self.this = apply(windowsc.new_wxWindow,_args,_kwargs) @@ -572,20 +535,12 @@ class wxPanelPtr(wxWindowPtr): return val def GetDefaultItem(self, *_args, **_kwargs): val = apply(windowsc.wxPanel_GetDefaultItem,(self,) + _args, _kwargs) - if val: val = wxButtonPtr(val) return val def SetDefaultItem(self, *_args, **_kwargs): val = apply(windowsc.wxPanel_SetDefaultItem,(self,) + _args, _kwargs) return val def __repr__(self): return "" % (self.this,) - - def GetDefaultItem(self): - import controls - val = windowsc.wxPanel_GetDefaultItem(self.this) - val = controls.wxButtonPtr(val) - return val - class wxPanel(wxPanelPtr): def __init__(self,*_args,**_kwargs): self.this = apply(windowsc.new_wxPanel,_args,_kwargs) @@ -635,6 +590,12 @@ class wxDialogPtr(wxPanelPtr): def SetReturnCode(self, *_args, **_kwargs): val = apply(windowsc.wxDialog_SetReturnCode,(self,) + _args, _kwargs) return val + def CreateTextSizer(self, *_args, **_kwargs): + val = apply(windowsc.wxDialog_CreateTextSizer,(self,) + _args, _kwargs) + return val + def CreateButtonSizer(self, *_args, **_kwargs): + val = apply(windowsc.wxDialog_CreateButtonSizer,(self,) + _args, _kwargs) + return val def __repr__(self): return "" % (self.this,) class wxDialog(wxDialogPtr): @@ -661,7 +622,6 @@ class wxScrolledWindowPtr(wxPanelPtr): return val def GetTargetWindow(self, *_args, **_kwargs): val = apply(windowsc.wxScrolledWindow_GetTargetWindow,(self,) + _args, _kwargs) - if val: val = wxWindowPtr(val) return val def GetVirtualSize(self, *_args, **_kwargs): val = apply(windowsc.wxScrolledWindow_GetVirtualSize,(self,) + _args, _kwargs) @@ -687,17 +647,27 @@ class wxScrolledWindowPtr(wxPanelPtr): def GetViewStart(self, *_args, **_kwargs): val = apply(windowsc.wxScrolledWindow_GetViewStart,(self,) + _args, _kwargs) return val - def ViewStart(self, *_args, **_kwargs): - val = apply(windowsc.wxScrolledWindow_ViewStart,(self,) + _args, _kwargs) - return val def CalcScrolledPosition(self, *_args, **_kwargs): val = apply(windowsc.wxScrolledWindow_CalcScrolledPosition,(self,) + _args, _kwargs) return val def CalcUnscrolledPosition(self, *_args, **_kwargs): val = apply(windowsc.wxScrolledWindow_CalcUnscrolledPosition,(self,) + _args, _kwargs) return val + def SetScale(self, *_args, **_kwargs): + val = apply(windowsc.wxScrolledWindow_SetScale,(self,) + _args, _kwargs) + return val + def GetScaleX(self, *_args, **_kwargs): + val = apply(windowsc.wxScrolledWindow_GetScaleX,(self,) + _args, _kwargs) + return val + def GetScaleY(self, *_args, **_kwargs): + val = apply(windowsc.wxScrolledWindow_GetScaleY,(self,) + _args, _kwargs) + return val + def AdjustScrollbars(self, *_args, **_kwargs): + val = apply(windowsc.wxScrolledWindow_AdjustScrollbars,(self,) + _args, _kwargs) + return val def __repr__(self): return "" % (self.this,) + ViewStart = GetViewStart class wxScrolledWindow(wxScrolledWindowPtr): def __init__(self,*_args,**_kwargs): self.this = apply(windowsc.new_wxScrolledWindow,_args,_kwargs) @@ -744,7 +714,6 @@ class wxMenuPtr(wxEvtHandlerPtr): return val def FindItemById(self, *_args, **_kwargs): val = apply(windowsc.wxMenu_FindItemById,(self,) + _args, _kwargs) - if val: val = wxMenuItemPtr(val) return val def GetTitle(self, *_args, **_kwargs): val = apply(windowsc.wxMenu_GetTitle,(self,) + _args, _kwargs) @@ -778,11 +747,9 @@ class wxMenuPtr(wxEvtHandlerPtr): return val def Remove(self, *_args, **_kwargs): val = apply(windowsc.wxMenu_Remove,(self,) + _args, _kwargs) - if val: val = wxMenuItemPtr(val) return val def RemoveItem(self, *_args, **_kwargs): val = apply(windowsc.wxMenu_RemoveItem,(self,) + _args, _kwargs) - if val: val = wxMenuItemPtr(val) return val def Destroy(self, *_args, **_kwargs): val = apply(windowsc.wxMenu_Destroy,(self,) + _args, _kwargs) @@ -804,14 +771,12 @@ class wxMenuPtr(wxEvtHandlerPtr): return val def GetEventHandler(self, *_args, **_kwargs): val = apply(windowsc.wxMenu_GetEventHandler,(self,) + _args, _kwargs) - if val: val = wxEvtHandlerPtr(val) return val def SetInvokingWindow(self, *_args, **_kwargs): val = apply(windowsc.wxMenu_SetInvokingWindow,(self,) + _args, _kwargs) return val def GetInvokingWindow(self, *_args, **_kwargs): val = apply(windowsc.wxMenu_GetInvokingWindow,(self,) + _args, _kwargs) - if val: val = wxWindowPtr(val) return val def GetStyle(self, *_args, **_kwargs): val = apply(windowsc.wxMenu_GetStyle,(self,) + _args, _kwargs) @@ -824,7 +789,6 @@ class wxMenuPtr(wxEvtHandlerPtr): return val def GetParent(self, *_args, **_kwargs): val = apply(windowsc.wxMenu_GetParent,(self,) + _args, _kwargs) - if val: val = wxMenuPtr(val) return val def __repr__(self): return "" % (self.this,) @@ -851,15 +815,12 @@ class wxMenuBarPtr(wxWindowPtr): return val def GetMenu(self, *_args, **_kwargs): val = apply(windowsc.wxMenuBar_GetMenu,(self,) + _args, _kwargs) - if val: val = wxMenuPtr(val) return val def Replace(self, *_args, **_kwargs): val = apply(windowsc.wxMenuBar_Replace,(self,) + _args, _kwargs) - if val: val = wxMenuPtr(val) return val def Remove(self, *_args, **_kwargs): val = apply(windowsc.wxMenuBar_Remove,(self,) + _args, _kwargs) - if val: val = wxMenuPtr(val) return val def EnableTop(self, *_args, **_kwargs): val = apply(windowsc.wxMenuBar_EnableTop,(self,) + _args, _kwargs) @@ -875,7 +836,6 @@ class wxMenuBarPtr(wxWindowPtr): return val def FindItemById(self, *_args, **_kwargs): val = apply(windowsc.wxMenuBar_FindItemById,(self,) + _args, _kwargs) - if val: val = wxMenuItemPtr(val) return val def Enable(self, *_args, **_kwargs): val = apply(windowsc.wxMenuBar_Enable,(self,) + _args, _kwargs) @@ -911,13 +871,12 @@ class wxMenuBar(wxMenuBarPtr): -class wxMenuItemPtr : +class wxMenuItemPtr(wxObjectPtr): def __init__(self,this): self.this = this self.thisown = 0 def GetMenu(self, *_args, **_kwargs): val = apply(windowsc.wxMenuItem_GetMenu,(self,) + _args, _kwargs) - if val: val = wxMenuPtr(val) return val def SetId(self, *_args, **_kwargs): val = apply(windowsc.wxMenuItem_SetId,(self,) + _args, _kwargs) @@ -951,7 +910,6 @@ class wxMenuItemPtr : return val def GetSubMenu(self, *_args, **_kwargs): val = apply(windowsc.wxMenuItem_GetSubMenu,(self,) + _args, _kwargs) - if val: val = wxMenuPtr(val) return val def Enable(self, *_args, **_kwargs): val = apply(windowsc.wxMenuItem_Enable,(self,) + _args, _kwargs) @@ -981,6 +939,49 @@ class wxMenuItemPtr : def SetAccel(self, *_args, **_kwargs): val = apply(windowsc.wxMenuItem_SetAccel,(self,) + _args, _kwargs) return val + def SetFont(self, *_args, **_kwargs): + val = apply(windowsc.wxMenuItem_SetFont,(self,) + _args, _kwargs) + return val + def GetFont(self, *_args, **_kwargs): + val = apply(windowsc.wxMenuItem_GetFont,(self,) + _args, _kwargs) + if val: val = wxFontPtr(val) + return val + def SetTextColour(self, *_args, **_kwargs): + val = apply(windowsc.wxMenuItem_SetTextColour,(self,) + _args, _kwargs) + return val + def GetTextColour(self, *_args, **_kwargs): + val = apply(windowsc.wxMenuItem_GetTextColour,(self,) + _args, _kwargs) + if val: val = wxColourPtr(val) ; val.thisown = 1 + return val + def SetBackgroundColour(self, *_args, **_kwargs): + val = apply(windowsc.wxMenuItem_SetBackgroundColour,(self,) + _args, _kwargs) + return val + def GetBackgroundColour(self, *_args, **_kwargs): + val = apply(windowsc.wxMenuItem_GetBackgroundColour,(self,) + _args, _kwargs) + if val: val = wxColourPtr(val) ; val.thisown = 1 + return val + def SetBitmaps(self, *_args, **_kwargs): + val = apply(windowsc.wxMenuItem_SetBitmaps,(self,) + _args, _kwargs) + return val + def SetBitmap(self, *_args, **_kwargs): + val = apply(windowsc.wxMenuItem_SetBitmap,(self,) + _args, _kwargs) + return val + def GetBitmap(self, *_args, **_kwargs): + val = apply(windowsc.wxMenuItem_GetBitmap,(self,) + _args, _kwargs) + if val: val = wxBitmapPtr(val) + return val + def SetMarginWidth(self, *_args, **_kwargs): + val = apply(windowsc.wxMenuItem_SetMarginWidth,(self,) + _args, _kwargs) + return val + def GetMarginWidth(self, *_args, **_kwargs): + val = apply(windowsc.wxMenuItem_GetMarginWidth,(self,) + _args, _kwargs) + return val + def IsOwnerDrawn(self, *_args, **_kwargs): + val = apply(windowsc.wxMenuItem_IsOwnerDrawn,(self,) + _args, _kwargs) + return val + def ResetOwnerDrawn(self, *_args, **_kwargs): + val = apply(windowsc.wxMenuItem_ResetOwnerDrawn,(self,) + _args, _kwargs) + return val def __repr__(self): return "" % (self.this,) class wxMenuItem(wxMenuItemPtr): @@ -995,18 +996,12 @@ class wxMenuItem(wxMenuItemPtr): #-------------- FUNCTION WRAPPERS ------------------ -wxValidator_IsSilent = windowsc.wxValidator_IsSilent - -wxValidator_SetBellOnError = windowsc.wxValidator_SetBellOnError - def wxWindow_FindFocus(*_args, **_kwargs): val = apply(windowsc.wxWindow_FindFocus,_args,_kwargs) - if val: val = wxWindowPtr(val) return val def wxWindow_FromHWND(*_args, **_kwargs): val = apply(windowsc.wxWindow_FromHWND,_args,_kwargs) - if val: val = wxWindowPtr(val) return val wxWindow_NewControlId = windowsc.wxWindow_NewControlId @@ -1015,6 +1010,14 @@ wxWindow_NextControlId = windowsc.wxWindow_NextControlId wxWindow_PrevControlId = windowsc.wxWindow_PrevControlId +wxValidator_IsSilent = windowsc.wxValidator_IsSilent + +wxValidator_SetBellOnError = windowsc.wxValidator_SetBellOnError + +wxMenuItem_GetLabelFromText = windowsc.wxMenuItem_GetLabelFromText + +wxMenuItem_GetDefaultMarginWidth = windowsc.wxMenuItem_GetDefaultMarginWidth + #-------------- VARIABLE WRAPPERS ------------------