added grid sizers

changed some build configurations


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7385 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2000-05-11 19:30:19 +00:00
parent 08392f16cc
commit 44faee407c
11 changed files with 1241 additions and 69 deletions

View File

@@ -4,7 +4,7 @@
// //
// Author: Robin Dunn // Author: Robin Dunn
// //
// Created: 6/2/98 // Created: 17-March-2000
// RCS-ID: $Id$ // RCS-ID: $Id$
// Copyright: (c) 1998 by Total Control Software // Copyright: (c) 1998 by Total Control Software
// Licence: wxWindows license // Licence: wxWindows license
@@ -783,15 +783,30 @@ public:
wxGridCellBoolEditor(); wxGridCellBoolEditor();
}; };
class wxGridCellChoiceEditor : public wxGridCellEditor class wxGridCellChoiceEditor : public wxGridCellEditor
{ {
public: public:
wxGridCellChoiceEditor(int LCOUNT = 0, wxGridCellChoiceEditor(int LCOUNT = 0,
const wxString* choices = NULL, const wxString* choices = NULL,
bool allowOthers = FALSE); bool allowOthers = FALSE);
}; #ifdef PRE2115
%addmethods {
wxGridCellChoiceEditor(PyObject* choices,
bool allowOthers = FALSE) {
const char** temp = string_LIST_helper(choices);
if (temp) {
int count = PyList_Size(choices);
wxGridCellChoiceEditor* ret;
ret = new wxGridCellChoiceEditor(count, temp, allowOthers);
delete [] temp;
return ret;
}
return NULL;
}
}
#endif
};
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
@@ -1345,6 +1360,7 @@ public:
void DisableCellEditControl(); void DisableCellEditControl();
bool CanEnableCellControl() const; bool CanEnableCellControl() const;
bool IsCellEditControlEnabled() const; bool IsCellEditControlEnabled() const;
bool IsCellEditControlShown() const;
bool IsCurrentCellReadOnly() const; bool IsCurrentCellReadOnly() const;
@@ -1419,6 +1435,7 @@ public:
wxString GetRowLabelValue( int row ); wxString GetRowLabelValue( int row );
wxString GetColLabelValue( int col ); wxString GetColLabelValue( int col );
wxColour GetGridLineColour(); wxColour GetGridLineColour();
wxColour GetCellHighlightColour();
void SetRowLabelSize( int width ); void SetRowLabelSize( int width );
void SetColLabelSize( int height ); void SetColLabelSize( int height );
@@ -1430,6 +1447,7 @@ public:
void SetRowLabelValue( int row, const wxString& ); void SetRowLabelValue( int row, const wxString& );
void SetColLabelValue( int col, const wxString& ); void SetColLabelValue( int col, const wxString& );
void SetGridLineColour( const wxColour& ); void SetGridLineColour( const wxColour& );
void SetCellHighlightColour( const wxColour& );
void EnableDragRowSize( bool enable = TRUE ); void EnableDragRowSize( bool enable = TRUE );
void DisableDragRowSize(); void DisableDragRowSize();

View File

@@ -492,6 +492,7 @@ private:
void OnSysColourChanged(wxSysColourChangedEvent& evt); void OnSysColourChanged(wxSysColourChangedEvent& evt);
void OnEraseBackground(wxEraseEvent& evt); void OnEraseBackground(wxEraseEvent& evt);
void OnMenu(wxCommandEvent& evt); void OnMenu(wxCommandEvent& evt);
void OnListBox(wxCommandEvent& evt);
// Turn notifications from Scintilla into events // Turn notifications from Scintilla into events
@@ -612,7 +613,7 @@ typedef void (wxEvtHandler::*wxStyledTextEventFunction)(wxStyledTextEvent&);
#define EVT_STC_ROMODIFYATTEMPT(id, fn) { wxEVT_STC_ROMODIFYATTEMPT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL }, #define EVT_STC_ROMODIFYATTEMPT(id, fn) { wxEVT_STC_ROMODIFYATTEMPT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL },
#define EVT_STC_DOUBLECLICK(id, fn) { wxEVT_STC_DOUBLECLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL }, #define EVT_STC_DOUBLECLICK(id, fn) { wxEVT_STC_DOUBLECLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL },
#define EVT_STC_MODIFIED(id, fn) { wxEVT_STC_MODIFIED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL }, #define EVT_STC_MODIFIED(id, fn) { wxEVT_STC_MODIFIED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL },
#define EVT_STC_CMDKEY(id, fn) { wxEVT_STC_CMDKEY, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL }, #define EVT_STC_KEY(id, fn) { wxEVT_STC_KEY, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL },
#define EVT_STC_MACRORECORD(id, fn) { wxEVT_STC_MACRORECORD, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL }, #define EVT_STC_MACRORECORD(id, fn) { wxEVT_STC_MACRORECORD, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL },
#define EVT_STC_MARGINCLICK(id, fn) { wxEVT_STC_MARGINCLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL }, #define EVT_STC_MARGINCLICK(id, fn) { wxEVT_STC_MARGINCLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL },
#define EVT_STC_NEEDSHOWN(id, fn) { wxEVT_STC_NEEDSHOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL }, #define EVT_STC_NEEDSHOWN(id, fn) { wxEVT_STC_NEEDSHOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL },

View File

@@ -115,6 +115,10 @@ class TestWindow(wxShapeCanvas):
def __init__(self, parent, log, frame): def __init__(self, parent, log, frame):
wxShapeCanvas.__init__(self, parent) wxShapeCanvas.__init__(self, parent)
maxWidth = 1000
maxHeight = 1000
self.SetScrollbars(20, 20, maxWidth/20, maxHeight/20)
self.log = log self.log = log
self.frame = frame self.frame = frame
self.SetBackgroundColour(wxWHITE) self.SetBackgroundColour(wxWHITE)

View File

@@ -72,7 +72,7 @@ def main():
os.chdir(WXDIR + '/src/msw') os.chdir(WXDIR + '/src/msw')
do('make dll pch FINAL=1') do('make dll pch FINAL=1')
validateFile(WXDIR + '/lib/wx'+dllVer+'.dll') validateFile(WXDIR + '/lib/wx'+dllVer+'.dll')
do("upx -9 " + WXDIR + '/lib/wx'+dllVer+'.dll') ## do("upx -9 " + WXDIR + '/lib/wx'+dllVer+'.dll')
do('makeaddons FINAL=1') do('makeaddons FINAL=1')
validateFile(WXDIR + '/contrib/lib/ogl.lib') validateFile(WXDIR + '/contrib/lib/ogl.lib')
@@ -117,8 +117,8 @@ FINAL=1
validateFile(WXDIR+'\\utils\\wxPython\\oglc.pyd') validateFile(WXDIR+'\\utils\\wxPython\\oglc.pyd')
validateFile(WXDIR+'\\utils\\wxPython\\stc_c.pyd') validateFile(WXDIR+'\\utils\\wxPython\\stc_c.pyd')
os.chdir(WXDIR+'\\utils\\wxPython') ## os.chdir(WXDIR+'\\utils\\wxPython')
do("upx -9 *.pyd") ## do("upx -9 *.pyd")
logSeparator("Building installer executable...") logSeparator("Building installer executable...")
os.chdir(WXDIR+'\\utils\\wxPython\\distrib') os.chdir(WXDIR+'\\utils\\wxPython\\distrib')
@@ -162,7 +162,7 @@ FINAL=1
# #*#*#*#*#* Comment this out to allow upload... # #*#*#*#*#* Comment this out to allow upload...
##return return
logSeparator("Uploading to website...") logSeparator("Uploading to website...")
do('python c:\\utils\\sendwxp.py %s' % destName) do('python c:\\utils\\sendwxp.py %s' % destName)

View File

@@ -92,6 +92,7 @@ Configuration Options
OTHERTARGETS Other targets to be placed on the default rule line OTHERTARGETS Other targets to be placed on the default rule line
OTHERINSTALLTARGETS OTHERINSTALLTARGETS
Other targets to be placed on the install rule line Other targets to be placed on the install rule line
OTHERDEFS Text to place near the begining of the Makefile
OTHERRULES This text is placed at the end of the makefile and OTHERRULES This text is placed at the end of the makefile and
will typically be used for adding rules and such will typically be used for adding rules and such
DEFAULTRULE Text to be used for the default rule in the makefile DEFAULTRULE Text to be used for the default rule in the makefile
@@ -245,6 +246,7 @@ class BuildConfig:
self.WXPSRCDIR = '$(WXDIR)/utils/wxPython/src' self.WXPSRCDIR = '$(WXDIR)/utils/wxPython/src'
self.SWIGDEPS = '' self.SWIGDEPS = ''
self.OTHERDEPS = '' self.OTHERDEPS = ''
self.OTHERDEFS = ''
if sys.platform == 'win32': if sys.platform == 'win32':
@@ -504,6 +506,7 @@ WXUSINGDLL = %(WXUSINGDLL)s
GENCODEDIR = %(GENCODEDIR)s GENCODEDIR = %(GENCODEDIR)s
RESFILE = %(RESFILE)s RESFILE = %(RESFILE)s
WXPSRCDIR = %(WXPSRCDIR)s WXPSRCDIR = %(WXPSRCDIR)s
%(OTHERDEFS)s
TARGETDIR = %(TARGETDIR)s TARGETDIR = %(TARGETDIR)s
@@ -682,6 +685,7 @@ HELPERLIB = %(HELPERLIB)s
HELPERLIBDIR = %(HELPERLIBDIR)s HELPERLIBDIR = %(HELPERLIBDIR)s
WXCONFIG=%(WXCONFIG)s WXCONFIG=%(WXCONFIG)s
TARGETDIR = %(TARGETDIR)s TARGETDIR = %(TARGETDIR)s
%(OTHERDEFS)s
CCC = %(CCC)s CCC = %(CCC)s

View File

@@ -927,6 +927,12 @@ item: Install File
Description=Demos Description=Demos
Flags=0000000010000010 Flags=0000000010000010
end end
item: Install File
Source=C:\PROJECTS\wx\utils\wxPython\demo\data\tips.txt
Destination=%MAINDIR%\wxPython\demo\data\tips.txt
Description=Demos
Flags=0000000010000010
end
item: Remark item: Remark
end end
item: Install File item: Install File

View File

@@ -6,30 +6,33 @@ SWIGFILES = ['ogl.i', 'oglbasic.i', 'oglshapes.i', 'oglshapes2.i', 'oglcanvas.i'
SOURCES = ['oglhelpers.cpp'] SOURCES = ['oglhelpers.cpp']
OTHERCFLAGS = '-I$(WXWIN)/contrib/include' OTHERCFLAGS = '-I$(STCLOC)/contrib/include'
SOURCES = SOURCES + [
'$(STCLOC)/contrib/src/ogl/basic.cpp',
'$(STCLOC)/contrib/src/ogl/bmpshape.cpp',
'$(STCLOC)/contrib/src/ogl/composit.cpp',
'$(STCLOC)/contrib/src/ogl/divided.cpp',
'$(STCLOC)/contrib/src/ogl/lines.cpp',
'$(STCLOC)/contrib/src/ogl/misc.cpp',
'$(STCLOC)/contrib/src/ogl/basic2.cpp',
'$(STCLOC)/contrib/src/ogl/canvas.cpp',
'$(STCLOC)/contrib/src/ogl/constrnt.cpp',
'$(STCLOC)/contrib/src/ogl/drawn.cpp',
'$(STCLOC)/contrib/src/ogl/mfutils.cpp',
'$(STCLOC)/contrib/src/ogl/ogldiag.cpp',
]
if sys.platform == 'win32': if sys.platform == 'win32':
OTHERCFLAGS = '-I$(WXWIN)/contrib/include' OTHERDEFS = 'STCLOC = $(WXWIN)'
OTHERLIBS = '$(WXWIN)/contrib/lib/ogl$(LIBEXT).lib' OTHERRULES = '''
{$(WXWIN)/contrib/src/ogl}.cpp{}.obj:
$(cc) @<<
$(CPPFLAGS) /c /Tp $<
<<
'''
else: else:
OTHERCFLAGS = '-Icontrib/include' OTHERCFLAGS = '-Icontrib/include'
SOURCES = SOURCES + [
'contrib/src/ogl/basic.cpp',
'contrib/src/ogl/bmpshape.cpp',
'contrib/src/ogl/composit.cpp',
'contrib/src/ogl/divided.cpp',
'contrib/src/ogl/lines.cpp',
'contrib/src/ogl/misc.cpp',
'contrib/src/ogl/basic2.cpp',
'contrib/src/ogl/canvas.cpp',
'contrib/src/ogl/constrnt.cpp',
'contrib/src/ogl/drawn.cpp',
'contrib/src/ogl/mfutils.cpp',
'contrib/src/ogl/ogldiag.cpp',
]
DEFAULTRULE = 'default: contrib $(GENCODEDIR) $(TARGET)' DEFAULTRULE = 'default: contrib $(GENCODEDIR) $(TARGET)'
OTHERRULES = """ OTHERRULES = """
%.o : contrib/src/ogl/%.cpp %.o : contrib/src/ogl/%.cpp
$(CCC) $(CCSHARED) $(CFLAGS) $(OTHERCFLAGS) -c $< $(CCC) $(CCSHARED) $(CFLAGS) $(OTHERCFLAGS) -c $<

View File

@@ -7,49 +7,63 @@ SOURCES = []
PYFILES = ['stc.py'] PYFILES = ['stc.py']
OTHERSWIGFLAGS = '-I$(WXWIN)/contrib/include/wx/stc' OTHERSWIGFLAGS = '-I$(STCLOC)/contrib/include/wx/stc'
SWIGDEPS = '$(STCLOC)/contrib/include/wx/stc/stc.h'
SOURCES = SOURCES + [
'$(STCLOC)/contrib/src/stc/scintilla/src/AutoComplete.cxx',
'$(STCLOC)/contrib/src/stc/scintilla/src/CallTip.cxx',
'$(STCLOC)/contrib/src/stc/scintilla/src/CellBuffer.cxx',
'$(STCLOC)/contrib/src/stc/scintilla/src/ContractionState.cxx',
'$(STCLOC)/contrib/src/stc/scintilla/src/Document.cxx',
'$(STCLOC)/contrib/src/stc/scintilla/src/Editor.cxx',
'$(STCLOC)/contrib/src/stc/scintilla/src/Indicator.cxx',
'$(STCLOC)/contrib/src/stc/scintilla/src/KeyMap.cxx',
'$(STCLOC)/contrib/src/stc/scintilla/src/KeyWords.cxx',
'$(STCLOC)/contrib/src/stc/scintilla/src/LineMarker.cxx',
'$(STCLOC)/contrib/src/stc/scintilla/src/PropSet.cxx',
'$(STCLOC)/contrib/src/stc/scintilla/src/ScintillaBase.cxx',
'$(STCLOC)/contrib/src/stc/scintilla/src/Style.cxx',
'$(STCLOC)/contrib/src/stc/scintilla/src/ViewStyle.cxx',
'$(STCLOC)/contrib/src/stc/scintilla/src/LexCPP.cxx',
'$(STCLOC)/contrib/src/stc/scintilla/src/LexHTML.cxx',
'$(STCLOC)/contrib/src/stc/scintilla/src/LexOthers.cxx',
'$(STCLOC)/contrib/src/stc/scintilla/src/LexPerl.cxx',
'$(STCLOC)/contrib/src/stc/scintilla/src/LexPython.cxx',
'$(STCLOC)/contrib/src/stc/scintilla/src/LexSQL.cxx',
'$(STCLOC)/contrib/src/stc/scintilla/src/LexVB.cxx',
'$(STCLOC)/contrib/src/stc/scintilla/src/DocumentAccessor.cxx',
'$(STCLOC)/contrib/src/stc/scintilla/src/UniConversion.cxx',
'$(STCLOC)/contrib/src/stc/scintilla/src/WindowAccessor.cxx',
'$(STCLOC)/contrib/src/stc/PlatWX.cpp',
'$(STCLOC)/contrib/src/stc/ScintillaWX.cpp',
'$(STCLOC)/contrib/src/stc/stc.cpp',
]
OTHERCFLAGS = '-D__WX__ -DSCI_LEXER ' + \
'-I$(STCLOC)/contrib/src/stc/scintilla/include ' + \
'-I$(STCLOC)/contrib/include ' + \
'-I$(STCLOC)/contrib/src/stc/scintilla/src'
SWIGDEPS = '$(WXWIN)/contrib/include/wx/stc/stc.h'
if sys.platform == 'win32': if sys.platform == 'win32':
OTHERCFLAGS = '-I$(WXWIN)/contrib/include' OTHERDEFS = 'STCLOC = $(WXWIN)'
OTHERLIBS = '$(WXWIN)/contrib/lib/stc$(LIBEXT).lib' OTHERRULES = '''
{$(WXWIN)/contrib/src/stc}.cpp{}.obj:
$(cc) @<<
$(CPPFLAGS) /c /Tp $<
<<
{$(WXWIN)/contrib/src/stc/scintilla/src}.cxx{}.obj:
$(cc) @<<
$(CPPFLAGS) /c /Tp $<
<<
'''
else: else:
OTHERCFLAGS = '-D__WX__ -DSCI_LEXER ' + \
'-Icontrib/src/stc/scintilla/include -Icontrib/include ' + \
'-Icontrib/src/stc/scintilla/src'
SOURCES = SOURCES + [
'contrib/src/stc/scintilla/src/AutoComplete.cxx',
'contrib/src/stc/scintilla/src/CallTip.cxx',
'contrib/src/stc/scintilla/src/CellBuffer.cxx',
'contrib/src/stc/scintilla/src/ContractionState.cxx',
'contrib/src/stc/scintilla/src/Document.cxx',
'contrib/src/stc/scintilla/src/Editor.cxx',
'contrib/src/stc/scintilla/src/Indicator.cxx',
'contrib/src/stc/scintilla/src/KeyMap.cxx',
'contrib/src/stc/scintilla/src/KeyWords.cxx',
'contrib/src/stc/scintilla/src/LineMarker.cxx',
'contrib/src/stc/scintilla/src/PropSet.cxx',
'contrib/src/stc/scintilla/src/ScintillaBase.cxx',
'contrib/src/stc/scintilla/src/Style.cxx',
'contrib/src/stc/scintilla/src/ViewStyle.cxx',
'contrib/src/stc/scintilla/src/LexCPP.cxx',
'contrib/src/stc/scintilla/src/LexHTML.cxx',
'contrib/src/stc/scintilla/src/LexOthers.cxx',
'contrib/src/stc/scintilla/src/LexPerl.cxx',
'contrib/src/stc/scintilla/src/LexPython.cxx',
'contrib/src/stc/scintilla/src/LexSQL.cxx',
'contrib/src/stc/scintilla/src/LexVB.cxx',
'contrib/src/stc/scintilla/src/DocumentAccessor.cxx',
'contrib/src/stc/scintilla/src/UniConversion.cxx',
'contrib/src/stc/scintilla/src/WindowAccessor.cxx',
'contrib/src/stc/PlatWX.cpp',
'contrib/src/stc/ScintillaWX.cpp',
'contrib/src/stc/stc.cpp',
]
DEFAULTRULE = 'default: contrib $(GENCODEDIR) $(TARGET)' DEFAULTRULE = 'default: contrib $(GENCODEDIR) $(TARGET)'
OTHERDEFS = 'STCLOC = .'
OTHERRULES = """ OTHERRULES = """
%.o : contrib/src/stc/%.cpp %.o : contrib/src/stc/%.cpp
$(CCC) $(CCSHARED) $(CFLAGS) $(OTHERCFLAGS) -c $< $(CCC) $(CCSHARED) $(CFLAGS) $(OTHERCFLAGS) -c $<

File diff suppressed because it is too large Load Diff

View File

@@ -54,10 +54,16 @@ class wxSizerItemPtr :
val = apply(sizersc.wxSizerItem_GetWindow,(self,) + _args, _kwargs) val = apply(sizersc.wxSizerItem_GetWindow,(self,) + _args, _kwargs)
if val: val = wxWindowPtr(val) if val: val = wxWindowPtr(val)
return val return val
def SetWindow(self, *_args, **_kwargs):
val = apply(sizersc.wxSizerItem_SetWindow,(self,) + _args, _kwargs)
return val
def GetSizer(self, *_args, **_kwargs): def GetSizer(self, *_args, **_kwargs):
val = apply(sizersc.wxSizerItem_GetSizer,(self,) + _args, _kwargs) val = apply(sizersc.wxSizerItem_GetSizer,(self,) + _args, _kwargs)
if val: val = wxSizerPtr(val) if val: val = wxSizerPtr(val)
return val return val
def SetSizer(self, *_args, **_kwargs):
val = apply(sizersc.wxSizerItem_SetSizer,(self,) + _args, _kwargs)
return val
def GetOption(self, *_args, **_kwargs): def GetOption(self, *_args, **_kwargs):
val = apply(sizersc.wxSizerItem_GetOption,(self,) + _args, _kwargs) val = apply(sizersc.wxSizerItem_GetOption,(self,) + _args, _kwargs)
return val return val
@@ -107,6 +113,15 @@ class wxSizerPtr :
def AddSpacer(self, *_args, **_kwargs): def AddSpacer(self, *_args, **_kwargs):
val = apply(sizersc.wxSizer_AddSpacer,(self,) + _args, _kwargs) val = apply(sizersc.wxSizer_AddSpacer,(self,) + _args, _kwargs)
return val return val
def InsertWindow(self, *_args, **_kwargs):
val = apply(sizersc.wxSizer_InsertWindow,(self,) + _args, _kwargs)
return val
def InsertSizer(self, *_args, **_kwargs):
val = apply(sizersc.wxSizer_InsertSizer,(self,) + _args, _kwargs)
return val
def InsertSpacer(self, *_args, **_kwargs):
val = apply(sizersc.wxSizer_InsertSpacer,(self,) + _args, _kwargs)
return val
def PrependWindow(self, *_args, **_kwargs): def PrependWindow(self, *_args, **_kwargs):
val = apply(sizersc.wxSizer_PrependWindow,(self,) + _args, _kwargs) val = apply(sizersc.wxSizer_PrependWindow,(self,) + _args, _kwargs)
return val return val
@@ -128,6 +143,18 @@ class wxSizerPtr :
def SetDimension(self, *_args, **_kwargs): def SetDimension(self, *_args, **_kwargs):
val = apply(sizersc.wxSizer_SetDimension,(self,) + _args, _kwargs) val = apply(sizersc.wxSizer_SetDimension,(self,) + _args, _kwargs)
return val return val
def SetMinSize(self, *_args, **_kwargs):
val = apply(sizersc.wxSizer_SetMinSize,(self,) + _args, _kwargs)
return val
def SetItemMinSizeWindow(self, *_args, **_kwargs):
val = apply(sizersc.wxSizer_SetItemMinSizeWindow,(self,) + _args, _kwargs)
return val
def SetItemMinSizeSizer(self, *_args, **_kwargs):
val = apply(sizersc.wxSizer_SetItemMinSizeSizer,(self,) + _args, _kwargs)
return val
def SetItemMinSizePos(self, *_args, **_kwargs):
val = apply(sizersc.wxSizer_SetItemMinSizePos,(self,) + _args, _kwargs)
return val
def GetSize(self, *_args, **_kwargs): def GetSize(self, *_args, **_kwargs):
val = apply(sizersc.wxSizer_GetSize,(self,) + _args, _kwargs) val = apply(sizersc.wxSizer_GetSize,(self,) + _args, _kwargs)
if val: val = wxSizePtr(val) ; val.thisown = 1 if val: val = wxSizePtr(val) ; val.thisown = 1
@@ -163,6 +190,14 @@ class wxSizerPtr :
else: else:
apply(self.AddWindow, args) apply(self.AddWindow, args)
def Insert(self, *args):
if type(args[0]) == type(1):
apply(self.InsertSpacer, args)
elif string.find(args[0].this, 'Sizer') != -1:
apply(self.InsertSizer, args)
else:
apply(self.InsertWindow, args)
def Prepend(self, *args): def Prepend(self, *args):
if type(args[0]) == type(1): if type(args[0]) == type(1):
apply(self.PrependSpacer, args) apply(self.PrependSpacer, args)
@@ -185,6 +220,15 @@ class wxSizerPtr :
childinfo = (childinfo, ) childinfo = (childinfo, )
apply(self.Add, childinfo) apply(self.Add, childinfo)
def SetItemMinSize(self, *args):
if type(args[0]) == type(1):
apply(self.SetItemMinSizePos, args)
elif string.find(args[0].this, 'Sizer') != -1:
apply(self.SetItemMinSizeSizer, args)
else:
apply(self.SetItemMinSizeWindow, args)
class wxSizer(wxSizerPtr): class wxSizer(wxSizerPtr):
def __init__(self,this): def __init__(self,this):
self.this = this self.this = this
@@ -284,6 +328,84 @@ class wxNotebookSizer(wxNotebookSizerPtr):
class wxGridSizerPtr(wxSizerPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
def RecalcSizes(self, *_args, **_kwargs):
val = apply(sizersc.wxGridSizer_RecalcSizes,(self,) + _args, _kwargs)
return val
def CalcMin(self, *_args, **_kwargs):
val = apply(sizersc.wxGridSizer_CalcMin,(self,) + _args, _kwargs)
if val: val = wxSizePtr(val) ; val.thisown = 1
return val
def SetCols(self, *_args, **_kwargs):
val = apply(sizersc.wxGridSizer_SetCols,(self,) + _args, _kwargs)
return val
def SetRows(self, *_args, **_kwargs):
val = apply(sizersc.wxGridSizer_SetRows,(self,) + _args, _kwargs)
return val
def SetVGap(self, *_args, **_kwargs):
val = apply(sizersc.wxGridSizer_SetVGap,(self,) + _args, _kwargs)
return val
def SetHGap(self, *_args, **_kwargs):
val = apply(sizersc.wxGridSizer_SetHGap,(self,) + _args, _kwargs)
return val
def GetCols(self, *_args, **_kwargs):
val = apply(sizersc.wxGridSizer_GetCols,(self,) + _args, _kwargs)
return val
def GetRows(self, *_args, **_kwargs):
val = apply(sizersc.wxGridSizer_GetRows,(self,) + _args, _kwargs)
return val
def GetVGap(self, *_args, **_kwargs):
val = apply(sizersc.wxGridSizer_GetVGap,(self,) + _args, _kwargs)
return val
def GetHGap(self, *_args, **_kwargs):
val = apply(sizersc.wxGridSizer_GetHGap,(self,) + _args, _kwargs)
return val
def __repr__(self):
return "<C wxGridSizer instance at %s>" % (self.this,)
class wxGridSizer(wxGridSizerPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(sizersc.new_wxGridSizer,_args,_kwargs)
self.thisown = 1
class wxFlexGridSizerPtr(wxGridSizerPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
def RecalcSizes(self, *_args, **_kwargs):
val = apply(sizersc.wxFlexGridSizer_RecalcSizes,(self,) + _args, _kwargs)
return val
def CalcMin(self, *_args, **_kwargs):
val = apply(sizersc.wxFlexGridSizer_CalcMin,(self,) + _args, _kwargs)
if val: val = wxSizePtr(val) ; val.thisown = 1
return val
def AddGrowableRow(self, *_args, **_kwargs):
val = apply(sizersc.wxFlexGridSizer_AddGrowableRow,(self,) + _args, _kwargs)
return val
def RemoveGrowableRow(self, *_args, **_kwargs):
val = apply(sizersc.wxFlexGridSizer_RemoveGrowableRow,(self,) + _args, _kwargs)
return val
def AddGrowableCol(self, *_args, **_kwargs):
val = apply(sizersc.wxFlexGridSizer_AddGrowableCol,(self,) + _args, _kwargs)
return val
def RemoveGrowableCol(self, *_args, **_kwargs):
val = apply(sizersc.wxFlexGridSizer_RemoveGrowableCol,(self,) + _args, _kwargs)
return val
def __repr__(self):
return "<C wxFlexGridSizer instance at %s>" % (self.this,)
class wxFlexGridSizer(wxFlexGridSizerPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(sizersc.new_wxFlexGridSizer,_args,_kwargs)
self.thisown = 1
#-------------- FUNCTION WRAPPERS ------------------ #-------------- FUNCTION WRAPPERS ------------------

View File

@@ -54,7 +54,9 @@ public:
bool IsSpacer(); bool IsSpacer();
wxWindow *GetWindow(); wxWindow *GetWindow();
void SetWindow( wxWindow *window );
wxSizer *GetSizer(); wxSizer *GetSizer();
void SetSizer( wxSizer *sizer );
int GetOption(); int GetOption();
int GetFlag(); int GetFlag();
int GetBorder(); int GetBorder();
@@ -97,14 +99,12 @@ public:
if (userData) data = new wxPyUserData(userData); if (userData) data = new wxPyUserData(userData);
self->Add(window, option, flag, border, data); self->Add(window, option, flag, border, data);
} }
void AddSizer(wxSizer *sizer, int option=0, int flag=0, int border=0, void AddSizer(wxSizer *sizer, int option=0, int flag=0, int border=0,
PyObject* userData=NULL) { PyObject* userData=NULL) {
wxPyUserData* data = NULL; wxPyUserData* data = NULL;
if (userData) data = new wxPyUserData(userData); if (userData) data = new wxPyUserData(userData);
self->Add(sizer, option, flag, border, data); self->Add(sizer, option, flag, border, data);
} }
void AddSpacer(int width, int height, int option=0, int flag=0, void AddSpacer(int width, int height, int option=0, int flag=0,
int border=0, PyObject* userData=NULL) { int border=0, PyObject* userData=NULL) {
wxPyUserData* data = NULL; wxPyUserData* data = NULL;
@@ -113,20 +113,38 @@ public:
} }
void InsertWindow(int before, wxWindow *window, int option=0, int flag=0,
int border=0, PyObject* userData=NULL) {
wxPyUserData* data = NULL;
if (userData) data = new wxPyUserData(userData);
self->Insert(before, window, option, flag, border, data);
}
void InsertSizer(int before, wxSizer *sizer, int option=0, int flag=0,
int border=0, PyObject* userData=NULL) {
wxPyUserData* data = NULL;
if (userData) data = new wxPyUserData(userData);
self->Insert(before, sizer, option, flag, border, data);
}
void InsertSpacer(int before, int width, int height, int option=0, int flag=0,
int border=0, PyObject* userData=NULL) {
wxPyUserData* data = NULL;
if (userData) data = new wxPyUserData(userData);
self->Insert(before, width, height, option, flag, border, data);
}
void PrependWindow(wxWindow *window, int option=0, int flag=0, int border=0, void PrependWindow(wxWindow *window, int option=0, int flag=0, int border=0,
PyObject* userData=NULL) { PyObject* userData=NULL) {
wxPyUserData* data = NULL; wxPyUserData* data = NULL;
if (userData) data = new wxPyUserData(userData); if (userData) data = new wxPyUserData(userData);
self->Prepend(window, option, flag, border, data); self->Prepend(window, option, flag, border, data);
} }
void PrependSizer(wxSizer *sizer, int option=0, int flag=0, int border=0, void PrependSizer(wxSizer *sizer, int option=0, int flag=0, int border=0,
PyObject* userData=NULL) { PyObject* userData=NULL) {
wxPyUserData* data = NULL; wxPyUserData* data = NULL;
if (userData) data = new wxPyUserData(userData); if (userData) data = new wxPyUserData(userData);
self->Prepend(sizer, option, flag, border, data); self->Prepend(sizer, option, flag, border, data);
} }
void PrependSpacer(int width, int height, int option=0, int flag=0, void PrependSpacer(int width, int height, int option=0, int flag=0,
int border=0, PyObject* userData=NULL) { int border=0, PyObject* userData=NULL) {
wxPyUserData* data = NULL; wxPyUserData* data = NULL;
@@ -149,6 +167,14 @@ public:
else: else:
apply(self.AddWindow, args) apply(self.AddWindow, args)
def Insert(self, *args):
if type(args[0]) == type(1):
apply(self.InsertSpacer, args)
elif string.find(args[0].this, 'Sizer') != -1:
apply(self.InsertSizer, args)
else:
apply(self.InsertWindow, args)
def Prepend(self, *args): def Prepend(self, *args):
if type(args[0]) == type(1): if type(args[0]) == type(1):
apply(self.PrependSpacer, args) apply(self.PrependSpacer, args)
@@ -174,6 +200,21 @@ public:
void SetDimension( int x, int y, int width, int height ); void SetDimension( int x, int y, int width, int height );
void SetMinSize(wxSize size);
%name(SetItemMinSizeWindow) void SetItemMinSize(wxWindow* window, int width, int height);
%name(SetItemMinSizeSizer) void SetItemMinSize(wxSizer* sizer, int width, int height);
%name(SetItemMinSizePos) void SetItemMinSize(int pos, int width, int height);
%pragma(python) addtoclass = "
def SetItemMinSize(self, *args):
if type(args[0]) == type(1):
apply(self.SetItemMinSizePos, args)
elif string.find(args[0].this, 'Sizer') != -1:
apply(self.SetItemMinSizeSizer, args)
else:
apply(self.SetItemMinSizeWindow, args)
"
wxSize GetSize(); wxSize GetSize();
wxPoint GetPosition(); wxPoint GetPosition();
@@ -259,7 +300,41 @@ public:
wxNotebook *GetNotebook(); wxNotebook *GetNotebook();
}; };
//---------------------------------------------------------------------------
class wxGridSizer: public wxSizer
{
public:
wxGridSizer( int rows=1, int cols=0, int vgap=0, int hgap=0 );
void RecalcSizes();
wxSize CalcMin();
void SetCols( int cols );
void SetRows( int rows );
void SetVGap( int gap );
void SetHGap( int gap );
int GetCols();
int GetRows();
int GetVGap();
int GetHGap();
};
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
class wxFlexGridSizer: public wxGridSizer
{
public:
wxFlexGridSizer( int rows=1, int cols=0, int vgap=0, int hgap=0 );
void RecalcSizes();
wxSize CalcMin();
void AddGrowableRow( size_t idx );
void RemoveGrowableRow( size_t idx );
void AddGrowableCol( size_t idx );
void RemoveGrowableCol( size_t idx );
};
//---------------------------------------------------------------------------