X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b8b8dda73001819104b83776e4c014369c013ce8..d24a34bb5d3f17472179b38bcb0be253551fce65:/utils/wxPython/src/msw/wx.py diff --git a/utils/wxPython/src/msw/wx.py b/utils/wxPython/src/msw/wx.py index f01ea55ea0..578ea9c6a7 100644 --- a/utils/wxPython/src/msw/wx.py +++ b/utils/wxPython/src/msw/wx.py @@ -3,6 +3,8 @@ import wxc from misc import * +from misc2 import * + from windows import * from gdi import * @@ -23,7 +25,11 @@ from windows2 import * from cmndlgs import * -from utils import * +from windows3 import * + +from image import * + +from printfw import * class wxPyAppPtr(wxEvtHandlerPtr): def __init__(self,this): self.this = this @@ -114,7 +120,7 @@ _wxSetDictionary = wxc._wxSetDictionary wxMAJOR_VERSION = wxc.wxMAJOR_VERSION wxMINOR_VERSION = wxc.wxMINOR_VERSION wxRELEASE_NUMBER = wxc.wxRELEASE_NUMBER -NOT_FOUND = wxc.NOT_FOUND +wxNOT_FOUND = wxc.wxNOT_FOUND wxVSCROLL = wxc.wxVSCROLL wxHSCROLL = wxc.wxHSCROLL wxCAPTION = wxc.wxCAPTION @@ -150,6 +156,8 @@ wxDIALOG_MODELESS = wxc.wxDIALOG_MODELESS wxDEFAULT_FRAME_STYLE = wxc.wxDEFAULT_FRAME_STYLE wxDEFAULT_DIALOG_STYLE = wxc.wxDEFAULT_DIALOG_STYLE wxFRAME_TOOL_WINDOW = wxc.wxFRAME_TOOL_WINDOW +wxFRAME_FLOAT_ON_PARENT = wxc.wxFRAME_FLOAT_ON_PARENT +wxCLIP_CHILDREN = wxc.wxCLIP_CHILDREN wxRETAINED = wxc.wxRETAINED wxBACKINGSTORE = wxc.wxBACKINGSTORE wxTB_3DBUTTONS = wxc.wxTB_3DBUTTONS @@ -182,10 +190,13 @@ wxCB_SORT = wxc.wxCB_SORT wxCB_READONLY = wxc.wxCB_READONLY wxRA_HORIZONTAL = wxc.wxRA_HORIZONTAL wxRA_VERTICAL = wxc.wxRA_VERTICAL +wxRA_SPECIFY_ROWS = wxc.wxRA_SPECIFY_ROWS +wxRA_SPECIFY_COLS = wxc.wxRA_SPECIFY_COLS wxRB_GROUP = wxc.wxRB_GROUP wxGA_PROGRESSBAR = wxc.wxGA_PROGRESSBAR wxGA_HORIZONTAL = wxc.wxGA_HORIZONTAL wxGA_VERTICAL = wxc.wxGA_VERTICAL +wxGA_SMOOTH = wxc.wxGA_SMOOTH wxSL_HORIZONTAL = wxc.wxSL_HORIZONTAL wxSL_VERTICAL = wxc.wxSL_VERTICAL wxSL_AUTOTICKS = wxc.wxSL_AUTOTICKS @@ -198,6 +209,7 @@ wxSL_BOTH = wxc.wxSL_BOTH wxSL_SELRANGE = wxc.wxSL_SELRANGE wxSB_HORIZONTAL = wxc.wxSB_HORIZONTAL wxSB_VERTICAL = wxc.wxSB_VERTICAL +wxST_SIZEGRIP = wxc.wxST_SIZEGRIP wxBU_AUTODRAW = wxc.wxBU_AUTODRAW wxBU_NOAUTODRAW = wxc.wxBU_NOAUTODRAW wxTR_HAS_BUTTONS = wxc.wxTR_HAS_BUTTONS @@ -227,10 +239,6 @@ wxSP_WRAP = wxc.wxSP_WRAP wxSP_NOBORDER = wxc.wxSP_NOBORDER wxSP_3D = wxc.wxSP_3D wxSP_BORDER = wxc.wxSP_BORDER -wxTAB_MULTILINE = wxc.wxTAB_MULTILINE -wxTAB_RIGHTJUSTIFY = wxc.wxTAB_RIGHTJUSTIFY -wxTAB_FIXEDWIDTH = wxc.wxTAB_FIXEDWIDTH -wxTAB_OWNERDRAW = wxc.wxTAB_OWNERDRAW wxFLOOD_SURFACE = wxc.wxFLOOD_SURFACE wxFLOOD_BORDER = wxc.wxFLOOD_BORDER wxODDEVEN_RULE = wxc.wxODDEVEN_RULE @@ -266,6 +274,10 @@ wxDF_OEMTEXT = wxc.wxDF_OEMTEXT wxDF_FILENAME = wxc.wxDF_FILENAME wxPORTRAIT = wxc.wxPORTRAIT wxLANDSCAPE = wxc.wxLANDSCAPE +wxPRINT_QUALITY_HIGH = wxc.wxPRINT_QUALITY_HIGH +wxPRINT_QUALITY_MEDIUM = wxc.wxPRINT_QUALITY_MEDIUM +wxPRINT_QUALITY_LOW = wxc.wxPRINT_QUALITY_LOW +wxPRINT_QUALITY_DRAFT = wxc.wxPRINT_QUALITY_DRAFT wxID_OPEN = wxc.wxID_OPEN wxID_CLOSE = wxc.wxID_CLOSE wxID_NEW = wxc.wxID_NEW @@ -303,6 +315,7 @@ wxID_CANCEL = wxc.wxID_CANCEL wxID_APPLY = wxc.wxID_APPLY wxID_YES = wxc.wxID_YES wxID_NO = wxc.wxID_NO +wxID_STATIC = wxc.wxID_STATIC wxBITMAP_TYPE_BMP = wxc.wxBITMAP_TYPE_BMP wxBITMAP_TYPE_BMP_RESOURCE = wxc.wxBITMAP_TYPE_BMP_RESOURCE wxBITMAP_TYPE_ICO = wxc.wxBITMAP_TYPE_ICO @@ -321,6 +334,7 @@ wxBITMAP_TYPE_PNG = wxc.wxBITMAP_TYPE_PNG wxBITMAP_TYPE_PNG_RESOURCE = wxc.wxBITMAP_TYPE_PNG_RESOURCE wxBITMAP_TYPE_ANY = wxc.wxBITMAP_TYPE_ANY wxBITMAP_TYPE_RESOURCE = wxc.wxBITMAP_TYPE_RESOURCE +wxBITMAP_TYPE_JPEG = wxc.wxBITMAP_TYPE_JPEG wxOPEN = wxc.wxOPEN wxSAVE = wxc.wxSAVE wxHIDE_READONLY = wxc.wxHIDE_READONLY @@ -328,10 +342,10 @@ wxOVERWRITE_PROMPT = wxc.wxOVERWRITE_PROMPT wxACCEL_ALT = wxc.wxACCEL_ALT wxACCEL_CTRL = wxc.wxACCEL_CTRL wxACCEL_SHIFT = wxc.wxACCEL_SHIFT -ERR_PARAM = wxc.ERR_PARAM -ERR_NODATA = wxc.ERR_NODATA -ERR_CANCEL = wxc.ERR_CANCEL -ERR_SUCCESS = wxc.ERR_SUCCESS +wxPD_AUTO_HIDE = wxc.wxPD_AUTO_HIDE +wxPD_APP_MODAL = wxc.wxPD_APP_MODAL +wxPD_CAN_ABORT = wxc.wxPD_CAN_ABORT +wxNO_DEFAULT = wxc.wxNO_DEFAULT wxDEFAULT = wxc.wxDEFAULT wxDECORATIVE = wxc.wxDECORATIVE wxROMAN = wxc.wxROMAN @@ -485,10 +499,81 @@ wxCURSOR_SPRAYCAN = wxc.wxCURSOR_SPRAYCAN wxCURSOR_WAIT = wxc.wxCURSOR_WAIT wxCURSOR_WATCH = wxc.wxCURSOR_WATCH wxCURSOR_BLANK = wxc.wxCURSOR_BLANK +wxPAPER_NONE = wxc.wxPAPER_NONE +wxPAPER_LETTER = wxc.wxPAPER_LETTER +wxPAPER_LEGAL = wxc.wxPAPER_LEGAL +wxPAPER_A4 = wxc.wxPAPER_A4 +wxPAPER_CSHEET = wxc.wxPAPER_CSHEET +wxPAPER_DSHEET = wxc.wxPAPER_DSHEET +wxPAPER_ESHEET = wxc.wxPAPER_ESHEET +wxPAPER_LETTERSMALL = wxc.wxPAPER_LETTERSMALL +wxPAPER_TABLOID = wxc.wxPAPER_TABLOID +wxPAPER_LEDGER = wxc.wxPAPER_LEDGER +wxPAPER_STATEMENT = wxc.wxPAPER_STATEMENT +wxPAPER_EXECUTIVE = wxc.wxPAPER_EXECUTIVE +wxPAPER_A3 = wxc.wxPAPER_A3 +wxPAPER_A4SMALL = wxc.wxPAPER_A4SMALL +wxPAPER_A5 = wxc.wxPAPER_A5 +wxPAPER_B4 = wxc.wxPAPER_B4 +wxPAPER_B5 = wxc.wxPAPER_B5 +wxPAPER_FOLIO = wxc.wxPAPER_FOLIO +wxPAPER_QUARTO = wxc.wxPAPER_QUARTO +wxPAPER_10X14 = wxc.wxPAPER_10X14 +wxPAPER_11X17 = wxc.wxPAPER_11X17 +wxPAPER_NOTE = wxc.wxPAPER_NOTE +wxPAPER_ENV_9 = wxc.wxPAPER_ENV_9 +wxPAPER_ENV_10 = wxc.wxPAPER_ENV_10 +wxPAPER_ENV_11 = wxc.wxPAPER_ENV_11 +wxPAPER_ENV_12 = wxc.wxPAPER_ENV_12 +wxPAPER_ENV_14 = wxc.wxPAPER_ENV_14 +wxPAPER_ENV_DL = wxc.wxPAPER_ENV_DL +wxPAPER_ENV_C5 = wxc.wxPAPER_ENV_C5 +wxPAPER_ENV_C3 = wxc.wxPAPER_ENV_C3 +wxPAPER_ENV_C4 = wxc.wxPAPER_ENV_C4 +wxPAPER_ENV_C6 = wxc.wxPAPER_ENV_C6 +wxPAPER_ENV_C65 = wxc.wxPAPER_ENV_C65 +wxPAPER_ENV_B4 = wxc.wxPAPER_ENV_B4 +wxPAPER_ENV_B5 = wxc.wxPAPER_ENV_B5 +wxPAPER_ENV_B6 = wxc.wxPAPER_ENV_B6 +wxPAPER_ENV_ITALY = wxc.wxPAPER_ENV_ITALY +wxPAPER_ENV_MONARCH = wxc.wxPAPER_ENV_MONARCH +wxPAPER_ENV_PERSONAL = wxc.wxPAPER_ENV_PERSONAL +wxPAPER_FANFOLD_US = wxc.wxPAPER_FANFOLD_US +wxPAPER_FANFOLD_STD_GERMAN = wxc.wxPAPER_FANFOLD_STD_GERMAN +wxPAPER_FANFOLD_LGL_GERMAN = wxc.wxPAPER_FANFOLD_LGL_GERMAN +wxPAPER_ISO_B4 = wxc.wxPAPER_ISO_B4 +wxPAPER_JAPANESE_POSTCARD = wxc.wxPAPER_JAPANESE_POSTCARD +wxPAPER_9X11 = wxc.wxPAPER_9X11 +wxPAPER_10X11 = wxc.wxPAPER_10X11 +wxPAPER_15X11 = wxc.wxPAPER_15X11 +wxPAPER_ENV_INVITE = wxc.wxPAPER_ENV_INVITE +wxPAPER_LETTER_EXTRA = wxc.wxPAPER_LETTER_EXTRA +wxPAPER_LEGAL_EXTRA = wxc.wxPAPER_LEGAL_EXTRA +wxPAPER_TABLOID_EXTRA = wxc.wxPAPER_TABLOID_EXTRA +wxPAPER_A4_EXTRA = wxc.wxPAPER_A4_EXTRA +wxPAPER_LETTER_TRANSVERSE = wxc.wxPAPER_LETTER_TRANSVERSE +wxPAPER_A4_TRANSVERSE = wxc.wxPAPER_A4_TRANSVERSE +wxPAPER_LETTER_EXTRA_TRANSVERSE = wxc.wxPAPER_LETTER_EXTRA_TRANSVERSE +wxPAPER_A_PLUS = wxc.wxPAPER_A_PLUS +wxPAPER_B_PLUS = wxc.wxPAPER_B_PLUS +wxPAPER_LETTER_PLUS = wxc.wxPAPER_LETTER_PLUS +wxPAPER_A4_PLUS = wxc.wxPAPER_A4_PLUS +wxPAPER_A5_TRANSVERSE = wxc.wxPAPER_A5_TRANSVERSE +wxPAPER_B5_TRANSVERSE = wxc.wxPAPER_B5_TRANSVERSE +wxPAPER_A3_EXTRA = wxc.wxPAPER_A3_EXTRA +wxPAPER_A5_EXTRA = wxc.wxPAPER_A5_EXTRA +wxPAPER_B5_EXTRA = wxc.wxPAPER_B5_EXTRA +wxPAPER_A2 = wxc.wxPAPER_A2 +wxPAPER_A3_TRANSVERSE = wxc.wxPAPER_A3_TRANSVERSE +wxPAPER_A3_EXTRA_TRANSVERSE = wxc.wxPAPER_A3_EXTRA_TRANSVERSE +wxDUPLEX_SIMPLEX = wxc.wxDUPLEX_SIMPLEX +wxDUPLEX_HORIZONTAL = wxc.wxDUPLEX_HORIZONTAL +wxDUPLEX_VERTICAL = wxc.wxDUPLEX_VERTICAL FALSE = wxc.FALSE false = wxc.false TRUE = wxc.TRUE true = wxc.true +wxVERSION_STRING = wxc.wxVERSION_STRING wxEVT_NULL = wxc.wxEVT_NULL wxEVT_FIRST = wxc.wxEVT_FIRST wxEVT_COMMAND_BUTTON_CLICKED = wxc.wxEVT_COMMAND_BUTTON_CLICKED @@ -543,6 +628,13 @@ wxEVT_SCROLL_LINEDOWN = wxc.wxEVT_SCROLL_LINEDOWN wxEVT_SCROLL_PAGEUP = wxc.wxEVT_SCROLL_PAGEUP wxEVT_SCROLL_PAGEDOWN = wxc.wxEVT_SCROLL_PAGEDOWN wxEVT_SCROLL_THUMBTRACK = wxc.wxEVT_SCROLL_THUMBTRACK +wxEVT_SCROLLWIN_TOP = wxc.wxEVT_SCROLLWIN_TOP +wxEVT_SCROLLWIN_BOTTOM = wxc.wxEVT_SCROLLWIN_BOTTOM +wxEVT_SCROLLWIN_LINEUP = wxc.wxEVT_SCROLLWIN_LINEUP +wxEVT_SCROLLWIN_LINEDOWN = wxc.wxEVT_SCROLLWIN_LINEDOWN +wxEVT_SCROLLWIN_PAGEUP = wxc.wxEVT_SCROLLWIN_PAGEUP +wxEVT_SCROLLWIN_PAGEDOWN = wxc.wxEVT_SCROLLWIN_PAGEDOWN +wxEVT_SCROLLWIN_THUMBTRACK = wxc.wxEVT_SCROLLWIN_THUMBTRACK wxEVT_SIZE = wxc.wxEVT_SIZE wxEVT_MOVE = wxc.wxEVT_MOVE wxEVT_CLOSE_WINDOW = wxc.wxEVT_CLOSE_WINDOW @@ -617,10 +709,15 @@ wxEVT_COMMAND_LIST_ITEM_DESELECTED = wxc.wxEVT_COMMAND_LIST_ITEM_DESELECTED wxEVT_COMMAND_LIST_KEY_DOWN = wxc.wxEVT_COMMAND_LIST_KEY_DOWN wxEVT_COMMAND_LIST_INSERT_ITEM = wxc.wxEVT_COMMAND_LIST_INSERT_ITEM wxEVT_COMMAND_LIST_COL_CLICK = wxc.wxEVT_COMMAND_LIST_COL_CLICK +wxEVT_COMMAND_LIST_ITEM_ACTIVATED = wxc.wxEVT_COMMAND_LIST_ITEM_ACTIVATED wxEVT_COMMAND_TAB_SEL_CHANGED = wxc.wxEVT_COMMAND_TAB_SEL_CHANGED wxEVT_COMMAND_TAB_SEL_CHANGING = wxc.wxEVT_COMMAND_TAB_SEL_CHANGING wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED = wxc.wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING = wxc.wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING +wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING = wxc.wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING +wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED = wxc.wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED +wxEVT_COMMAND_SPLITTER_UNSPLIT = wxc.wxEVT_COMMAND_SPLITTER_UNSPLIT +wxEVT_COMMAND_SPLITTER_DOUBLECLICKED = wxc.wxEVT_COMMAND_SPLITTER_DOUBLECLICKED __version__ = wxc.__version__ cvar = wxc.cvar wxPyDefaultPosition = wxPointPtr(wxc.cvar.wxPyDefaultPosition) @@ -660,14 +757,21 @@ def _checkForCallback(obj, name, event, theID=-1): except: pass else: obj.Connect(theID, -1, event, cb) +## def _checkClassCallback(obj, name): +## try: cb = getattr(obj, name) +## except: pass +## else: obj._addCallback(name, cb) + + def _StdWindowCallbacks(win): _checkForCallback(win, "OnChar", wxEVT_CHAR) _checkForCallback(win, "OnSize", wxEVT_SIZE) _checkForCallback(win, "OnEraseBackground", wxEVT_ERASE_BACKGROUND) _checkForCallback(win, "OnSysColourChanged", wxEVT_SYS_COLOUR_CHANGED) _checkForCallback(win, "OnInitDialog", wxEVT_INIT_DIALOG) - _checkForCallback(win, "OnIdle", wxEVT_IDLE) _checkForCallback(win, "OnPaint", wxEVT_PAINT) + _checkForCallback(win, "OnIdle", wxEVT_IDLE) + def _StdFrameCallbacks(win): _StdWindowCallbacks(win) @@ -685,7 +789,7 @@ def _StdDialogCallbacks(win): _checkForCallback(win, "OnCharHook", wxEVT_CHAR_HOOK) -def _StdOnScrollCallback(win): +def _StdOnScrollCallbacks(win): try: cb = getattr(win, "OnScroll") except: pass else: EVT_SCROLL(win, cb) @@ -764,6 +868,12 @@ def EVT_ICONIZE(win, func): def EVT_NAVIGATION_KEY(win, func): win.Connect(-1, -1, wxEVT_NAVIGATION_KEY, func) +def EVT_IDLE(win, func): + win.Connect(-1, -1, wxEVT_IDLE, func) + +def EVT_UPDATE_UI(win, id, func): + win.Connect(id, -1, wxEVT_UPDATE_UI, func) + # Mouse Events def EVT_LEFT_DOWN(win, func): @@ -1093,6 +1203,75 @@ def EVT_GRID_LABEL_RCLICK(win, fn): win.Connect(-1, -1, wxEVT_GRID_LABEL_RCLICK, fn) +# wxSashWindow +def EVT_SASH_DRAGGED(win, id, func): + win.Connect(id, -1, wxEVT_SASH_DRAGGED, func) + +def EVT_SASH_DRAGGED_RANGE(win, id1, id2, func): + win.Connect(id1, id2, wxEVT_SASH_DRAGGED, func) + +def EVT_QUERY_LAYOUT_INFO(win, func): + win.Connect(-1, -1, wxEVT_EVT_QUERY_LAYOUT_INFO, func) + +def EVT_CALCULATE_LAYOUT(win, func): + win.Connect(-1, -1, wxEVT_EVT_CALCULATE_LAYOUT, func) + + +# wxListCtrl +def EVT_LIST_BEGIN_DRAG(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_BEGIN_DRAG, func) + +def EVT_LIST_BEGIN_RDRAG(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_BEGIN_RDRAG, func) + +def EVT_LIST_BEGIN_LABEL_EDIT(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT, func) + +def EVT_LIST_END_LABEL_EDIT(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_END_LABEL_EDIT, func) + +def EVT_LIST_DELETE_ITEM(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_DELETE_ITEM, func) + +def EVT_LIST_DELETE_ALL_ITEMS(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS, func) + +def EVT_LIST_GET_INFO(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_GET_INFO, func) + +def EVT_LIST_SET_INFO(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_SET_INFO, func) + +def EVT_LIST_ITEM_SELECTED(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_ITEM_SELECTED, func) + +def EVT_LIST_ITEM_ACTIVATED(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_ITEM_ACTIVATED, func) + +def EVT_LIST_ITEM_DESELECTED(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_ITEM_DESELECTED, func) + +def EVT_LIST_KEY_DOWN(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_KEY_DOWN, func) + +def EVT_LIST_INSERT_ITEM(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_INSERT_ITEM, func) + +def EVT_LIST_COL_CLICK(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_COL_CLICK, func) + +#wxSplitterWindow +def EVT_SPLITTER_SASH_POS_CHANGING(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING, func) + +def EVT_SPLITTER_SASH_POS_CHANGED(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED, func) + +def EVT_SPLITTER_UNSPLIT(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_SPLITTER_UNSPLIT, func) + +def EVT_SPLITTER_DOUBLECLICKED(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_SPLITTER_DOUBLECLICKED, func) #---------------------------------------------------------------------- @@ -1122,29 +1301,47 @@ wxNamedColor = wxNamedColour wxPyDefaultPosition.Set(-1,-1) wxPyDefaultSize.Set(-1,-1) +# aliases so that C++ documentation applies: +wxDefaultPosition = wxPyDefaultPosition +wxDefaultSize = wxPyDefaultSize + + +# This is to cover up a bug in SWIG. We are redefining +# the shadow class that is generated for wxAcceleratorTable +# because SWIG incorrectly uses "arg0.this" +class wxAcceleratorTable(wxAcceleratorTablePtr): + def __init__(self,arg0) : + self.this = miscc.new_wxAcceleratorTable(arg0) + self.thisown = 1 + #---------------------------------------------------------------------- -## class wxPyStdOutWindow(wxFrame): -## def __init__(self, title = "wxPython: stdout/stderr"): -## wxFrame.__init__(self, NULL, title) -## self.title = title -## self.text = wxTextWindow(self) -## self.text.SetFont(wxFont(10, wxMODERN, wxNORMAL, wxBOLD)) -## self.SetSize(-1,-1,400,200) -## self.Show(false) -## self.isShown = false +## class wxPyStdOutWindow: +## def __init__(self, title = "wxPython: stdout/stderr"): +## self.frame = None +## self.title = title -## def write(self, str): # with this method, -## if not self.isShown: -## self.Show(true) -## self.isShown = true -## self.text.WriteText(str) +## def write(self, str): +## if not self.frame: +## self.frame = wxFrame(NULL, -1, self.title) +## self.text = wxTextCtrl(self.frame, -1, "", wxPoint(0,0), wxDefaultSize, +## wxTE_MULTILINE|wxTE_READONLY) +## self.frame.SetSize(wxSize(450, 300)) +## self.frame.Show(true) +## EVT_CLOSE(self.frame, self.OnCloseWindow) +## self.text.AppendText(str) -## def OnCloseWindow(self, event): # doesn't allow the window to close, just hides it -## self.Show(false) -## self.isShown = false +## def OnCloseWindow(self, event): +## wxBell() +## self.frame.Destroy() +## self.frame = None +## self.text = None +## def close(self): +## if self.frame: +## self.frame.Close(true) + _defRedirect = (wxPlatform == '__WXMSW__') #---------------------------------------------------------------------- @@ -1175,67 +1372,13 @@ class wxApp(wxPyApp): if filename: sys.stdout = sys.stderr = open(filename, 'a') else: - raise self.error, 'wxPyStdOutWindow not yet implemented.' - #self.stdioWin = sys.stdout = sys.stderr = wxPyStdOutWindow() + #raise self.error, 'wxPyStdOutWindow not yet implemented.' + self.stdioWin = sys.stdout = sys.stderr = wxPyStdOutWindow() def RestoreStdio(self): sys.stdout, sys.stderr = self.saveStdio if self.stdioWin != None: - self.stdioWin.Show(false) - self.stdioWin.Destroy() - self.stdioWin = None + self.stdioWin.close() #---------------------------------------------------------------------------- -# -# $Log$ -# Revision 1.1 1998/12/15 20:44:04 RD -# Changed the import semantics from "from wxPython import *" to "from -# wxPython.wx import *" This is for people who are worried about -# namespace pollution, they can use "from wxPython import wx" and then -# prefix all the wxPython identifiers with "wx." -# -# Added wxTaskbarIcon for wxMSW. -# -# Made the events work for wxGrid. -# -# Added wxConfig. -# -# Added wxMiniFrame for wxGTK, (untested.) -# -# Changed many of the args and return values that were pointers to gdi -# objects to references to reflect changes in the wxWindows API. -# -# Other assorted fixes and additions. -# -# Revision 1.7 1998/11/25 08:45:21 RD -# -# Added wxPalette, wxRegion, wxRegionIterator, wxTaskbarIcon -# Added events for wxGrid -# Other various fixes and additions -# -# Revision 1.6 1998/11/16 00:00:52 RD -# Generic treectrl for wxPython/GTK compiles... -# -# Revision 1.5 1998/10/20 07:38:02 RD -# bug fix -# -# Revision 1.4 1998/10/20 06:43:54 RD -# New wxTreeCtrl wrappers (untested) -# some changes in helpers -# etc. -# -# Revision 1.3 1998/10/02 06:40:33 RD -# -# Version 0.4 of wxPython for MSW. -# -# Revision 1.2 1998/08/18 19:48:12 RD -# more wxGTK compatibility things. -# -# It builds now but there are serious runtime problems... -# -# Revision 1.1 1998/08/09 08:25:49 RD -# Initial version -# -# -