X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/70551f4702bfdd1796be68bc4c24503d229a05c5..d12e353663f9a2fc28b26e6468716f6a01b85595:/utils/wxPython/src/gtk/windows2.py diff --git a/utils/wxPython/src/gtk/windows2.py b/utils/wxPython/src/gtk/windows2.py index 87c42d4b90..021802e12c 100644 --- a/utils/wxPython/src/gtk/windows2.py +++ b/utils/wxPython/src/gtk/windows2.py @@ -10,10 +10,14 @@ from windows import * from controls import * from events import * +import wx class wxGridCellPtr : def __init__(self,this): self.this = this self.thisown = 0 + def __del__(self): + if self.thisown == 1 : + windows2c.delete_wxGridCell(self.this) def GetTextValue(self): val = windows2c.wxGridCell_GetTextValue(self.this) return val @@ -61,8 +65,9 @@ class wxGridCellPtr : def __repr__(self): return "" class wxGridCell(wxGridCellPtr): - def __init__(self,this): - self.this = this + def __init__(self) : + self.this = windows2c.new_wxGridCell() + self.thisown = 1 @@ -211,6 +216,9 @@ class wxGridPtr(wxPanelPtr): def InsertRows(self,*args): val = apply(windows2c.wxGrid_InsertRows,(self.this,)+args) return val + def OnActivate(self,arg0): + val = windows2c.wxGrid_OnActivate(self.this,arg0) + return val def SetCellAlignment(self,arg0,arg1,arg2): val = windows2c.wxGrid_SetCellAlignment(self.this,arg0,arg1,arg2) return val @@ -286,6 +294,68 @@ class wxGrid(wxGridPtr): args = tuple(argl) self.this = apply(windows2c.new_wxGrid,(arg0.this,arg1,)+args) self.thisown = 1 + wx._StdWindowCallbacks(self) + wx._checkForCallback(self, 'OnSelectCell', wxEVT_GRID_SELECT_CELL) + wx._checkForCallback(self, 'OnCreateCell', wxEVT_GRID_CREATE_CELL) + wx._checkForCallback(self, 'OnChangeLabels', wxEVT_GRID_CHANGE_LABELS) + wx._checkForCallback(self, 'OnChangeSelectionLabel', wxEVT_GRID_CHANGE_SEL_LABEL) + wx._checkForCallback(self, 'OnCellChange', wxEVT_GRID_CELL_CHANGE) + wx._checkForCallback(self, 'OnCellLeftClick', wxEVT_GRID_CELL_LCLICK) + wx._checkForCallback(self, 'OnCellRightClick', wxEVT_GRID_CELL_RCLICK) + wx._checkForCallback(self, 'OnLabelLeftClick', wxEVT_GRID_LABEL_LCLICK) + wx._checkForCallback(self, 'OnLabelRightClick', wxEVT_GRID_LABEL_RCLICK) + + + + +class wxGridEventPtr(wxEventPtr): + def __init__(self,this): + self.this = this + self.thisown = 0 + def __setattr__(self,name,value): + if name == "m_row" : + windows2c.wxGridEvent_m_row_set(self.this,value) + return + if name == "m_col" : + windows2c.wxGridEvent_m_col_set(self.this,value) + return + if name == "m_x" : + windows2c.wxGridEvent_m_x_set(self.this,value) + return + if name == "m_y" : + windows2c.wxGridEvent_m_y_set(self.this,value) + return + if name == "m_control" : + windows2c.wxGridEvent_m_control_set(self.this,value) + return + if name == "m_shift" : + windows2c.wxGridEvent_m_shift_set(self.this,value) + return + if name == "m_cell" : + windows2c.wxGridEvent_m_cell_set(self.this,value.this) + return + self.__dict__[name] = value + def __getattr__(self,name): + if name == "m_row" : + return windows2c.wxGridEvent_m_row_get(self.this) + if name == "m_col" : + return windows2c.wxGridEvent_m_col_get(self.this) + if name == "m_x" : + return windows2c.wxGridEvent_m_x_get(self.this) + if name == "m_y" : + return windows2c.wxGridEvent_m_y_get(self.this) + if name == "m_control" : + return windows2c.wxGridEvent_m_control_get(self.this) + if name == "m_shift" : + return windows2c.wxGridEvent_m_shift_get(self.this) + if name == "m_cell" : + return wxGridCellPtr(windows2c.wxGridEvent_m_cell_get(self.this)) + raise AttributeError,name + def __repr__(self): + return "" +class wxGridEvent(wxGridEventPtr): + def __init__(self,this): + self.this = this @@ -332,10 +402,11 @@ class wxNotebookPtr(wxControlPtr): val = windows2c.wxNotebook_GetPageText(self.this,arg0) return val def SetImageList(self,arg0): - val = windows2c.wxNotebook_SetImageList(self.this,arg0) + val = windows2c.wxNotebook_SetImageList(self.this,arg0.this) return val def GetImageList(self): val = windows2c.wxNotebook_GetImageList(self.this) + val = wxImageListPtr(val) return val def GetPageImage(self,arg0): val = windows2c.wxNotebook_GetPageImage(self.this,arg0) @@ -370,6 +441,85 @@ class wxNotebook(wxNotebookPtr): args = tuple(argl) self.this = apply(windows2c.new_wxNotebook,(arg0.this,arg1,)+args) self.thisown = 1 + wx._StdWindowCallbacks(self) + + + + +class wxSplitterWindowPtr(wxWindowPtr): + def __init__(self,this): + self.this = this + self.thisown = 0 + def GetBorderSize(self): + val = windows2c.wxSplitterWindow_GetBorderSize(self.this) + return val + def GetMinimumPaneSize(self): + val = windows2c.wxSplitterWindow_GetMinimumPaneSize(self.this) + return val + def GetSashPosition(self): + val = windows2c.wxSplitterWindow_GetSashPosition(self.this) + return val + def GetSashSize(self): + val = windows2c.wxSplitterWindow_GetSashSize(self.this) + return val + def GetSplitMode(self): + val = windows2c.wxSplitterWindow_GetSplitMode(self.this) + return val + def GetWindow1(self): + val = windows2c.wxSplitterWindow_GetWindow1(self.this) + val = wxWindowPtr(val) + return val + def GetWindow2(self): + val = windows2c.wxSplitterWindow_GetWindow2(self.this) + val = wxWindowPtr(val) + return val + def Initialize(self,arg0): + val = windows2c.wxSplitterWindow_Initialize(self.this,arg0.this) + return val + def IsSplit(self): + val = windows2c.wxSplitterWindow_IsSplit(self.this) + return val + def SetBorderSize(self,arg0): + val = windows2c.wxSplitterWindow_SetBorderSize(self.this,arg0) + return val + def SetSashPosition(self,arg0,*args): + val = apply(windows2c.wxSplitterWindow_SetSashPosition,(self.this,arg0,)+args) + return val + def SetSashSize(self,arg0): + val = windows2c.wxSplitterWindow_SetSashSize(self.this,arg0) + return val + def SetMinimumPaneSize(self,arg0): + val = windows2c.wxSplitterWindow_SetMinimumPaneSize(self.this,arg0) + return val + def SetSplitMode(self,arg0): + val = windows2c.wxSplitterWindow_SetSplitMode(self.this,arg0) + return val + def SplitHorizontally(self,arg0,arg1,*args): + val = apply(windows2c.wxSplitterWindow_SplitHorizontally,(self.this,arg0.this,arg1.this,)+args) + return val + def SplitVertically(self,arg0,arg1,*args): + val = apply(windows2c.wxSplitterWindow_SplitVertically,(self.this,arg0.this,arg1.this,)+args) + return val + def Unsplit(self,*args): + argl = map(None,args) + try: argl[0] = argl[0].this + except: pass + args = tuple(argl) + val = apply(windows2c.wxSplitterWindow_Unsplit,(self.this,)+args) + return val + def __repr__(self): + return "" +class wxSplitterWindow(wxSplitterWindowPtr): + 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(windows2c.new_wxSplitterWindow,(arg0.this,arg1,)+args) + self.thisown = 1 + wx._StdWindowCallbacks(self) @@ -385,3 +535,12 @@ class wxNotebook(wxNotebookPtr): wxGRID_TEXT_CTRL = windows2c.wxGRID_TEXT_CTRL wxGRID_HSCROLL = windows2c.wxGRID_HSCROLL wxGRID_VSCROLL = windows2c.wxGRID_VSCROLL +wxEVT_GRID_SELECT_CELL = windows2c.wxEVT_GRID_SELECT_CELL +wxEVT_GRID_CREATE_CELL = windows2c.wxEVT_GRID_CREATE_CELL +wxEVT_GRID_CHANGE_LABELS = windows2c.wxEVT_GRID_CHANGE_LABELS +wxEVT_GRID_CHANGE_SEL_LABEL = windows2c.wxEVT_GRID_CHANGE_SEL_LABEL +wxEVT_GRID_CELL_CHANGE = windows2c.wxEVT_GRID_CELL_CHANGE +wxEVT_GRID_CELL_LCLICK = windows2c.wxEVT_GRID_CELL_LCLICK +wxEVT_GRID_CELL_RCLICK = windows2c.wxEVT_GRID_CELL_RCLICK +wxEVT_GRID_LABEL_LCLICK = windows2c.wxEVT_GRID_LABEL_LCLICK +wxEVT_GRID_LABEL_RCLICK = windows2c.wxEVT_GRID_LABEL_RCLICK