rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
EVT_BUTTON(self.okBtn, wxID_STCSTYLEEDITDLGOKBTN, self.OnOkbtnButton) self.cancelBtn = wxButton(id=wxID_STCSTYLEEDITDLGCANCELBTN, label='Cancel', name='cancelBtn', parent=self, pos=wxPoint(366, 423), size=wxSize(75, 23), style=0)
self.okBtn.Bind(wx.EVT_BUTTON, self.OnOkbtnButton, id=wxID_STCSTYLEEDITDLGOKBTN) self.cancelBtn = wx.Button(id=wxID_STCSTYLEEDITDLGCANCELBTN, label='Cancel', name='cancelBtn', parent=self, pos=wx.Point(400, 423), size=wx.Size(75, 23), style=0)
def _init_ctrls(self, prnt): # generated method, don't edit wxDialog.__init__(self, id=wxID_STCSTYLEEDITDLG, name='STCStyleEditDlg', parent=prnt, pos=wxPoint(583, 291), size=wxSize(459, 482), style=wxWANTS_CHARS | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER, title=self.stc_title) self._init_utils() self.SetClientSize(wxSize(451, 455)) self.SetAutoLayout(True) self.SetSizeHints(425, 400, -1, -1) self.Center(wxBOTH) EVT_SIZE(self, self.OnStcstyleeditdlgSize)
EVT_BUTTON(self.cancelBtn, wxID_STCSTYLEEDITDLGCANCELBTN, self.OnCancelbtnButton) self.staticText4 = wxStaticText(id=wxID_STCSTYLEEDITDLGSTATICTEXT4,
self.cancelBtn.Bind(wx.EVT_BUTTON, self.OnCancelbtnButton, id=wxID_STCSTYLEEDITDLGCANCELBTN) self.staticText4 = wx.StaticText(id=wxID_STCSTYLEEDITDLGSTATICTEXT4,
def _init_ctrls(self, prnt): # generated method, don't edit wxDialog.__init__(self, id=wxID_STCSTYLEEDITDLG, name='STCStyleEditDlg', parent=prnt, pos=wxPoint(583, 291), size=wxSize(459, 482), style=wxWANTS_CHARS | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER, title=self.stc_title) self._init_utils() self.SetClientSize(wxSize(451, 455)) self.SetAutoLayout(True) self.SetSizeHints(425, 400, -1, -1) self.Center(wxBOTH) EVT_SIZE(self, self.OnStcstyleeditdlgSize)
pos=wxPoint(0, 0), size=wxSize(48, 13), style=0) self.fixedWidthChk = wxCheckBox(id=wxID_STCSTYLEEDITDLGFIXEDWIDTHCHK, label='', name='fixedWidthChk', parent=self.panel1, pos=wxPoint(0, 23), size=wxSize(13, 19), style=0)
pos=wx.Point(0, 0), size=wx.Size(48, 13), style=0) self.fixedWidthChk = wx.CheckBox(id=wxID_STCSTYLEEDITDLGFIXEDWIDTHCHK, label='', name='fixedWidthChk', parent=self.panel1, pos=wx.Point(0, 23), size=wx.Size(16, 19), style=0)
def _init_ctrls(self, prnt): # generated method, don't edit wxDialog.__init__(self, id=wxID_STCSTYLEEDITDLG, name='STCStyleEditDlg', parent=prnt, pos=wxPoint(583, 291), size=wxSize(459, 482), style=wxWANTS_CHARS | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER, title=self.stc_title) self._init_utils() self.SetClientSize(wxSize(451, 455)) self.SetAutoLayout(True) self.SetSizeHints(425, 400, -1, -1) self.Center(wxBOTH) EVT_SIZE(self, self.OnStcstyleeditdlgSize)
EVT_CHECKBOX(self.fixedWidthChk, wxID_STCSTYLEEDITDLGFIXEDWIDTHCHK, self.OnFixedwidthchkCheckbox) self.faceCb = wxComboBox(choices=[], id=wxID_STCSTYLEEDITDLGFACECB, name='faceCb', parent=self.panel1, pos=wxPoint(17, 18), size=wxSize(105, 21), style=0, validator=wxDefaultValidator, value='') self.staticText7 = wxStaticText(id=wxID_STCSTYLEEDITDLGSTATICTEXT7,
self.fixedWidthChk.Bind(wx.EVT_CHECKBOX, self.OnFixedwidthchkCheckbox, id=wxID_STCSTYLEEDITDLGFIXEDWIDTHCHK) self.faceCb = wx.ComboBox(choices=[], id=wxID_STCSTYLEEDITDLGFACECB, name='faceCb', parent=self.panel1, pos=wx.Point(17, 18), size=wx.Size(101, 21), style=0, value='') self.staticText7 = wx.StaticText(id=wxID_STCSTYLEEDITDLGSTATICTEXT7,
def _init_ctrls(self, prnt): # generated method, don't edit wxDialog.__init__(self, id=wxID_STCSTYLEEDITDLG, name='STCStyleEditDlg', parent=prnt, pos=wxPoint(583, 291), size=wxSize(459, 482), style=wxWANTS_CHARS | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER, title=self.stc_title) self._init_utils() self.SetClientSize(wxSize(451, 455)) self.SetAutoLayout(True) self.SetSizeHints(425, 400, -1, -1) self.Center(wxBOTH) EVT_SIZE(self, self.OnStcstyleeditdlgSize)
pos=wxPoint(0, 0), size=wxSize(40, 13), style=0) self.sizeCb = wxComboBox(choices=[], id=wxID_STCSTYLEEDITDLGSIZECB, name='sizeCb', parent=self.panel2, pos=wxPoint(0, 17), size=wxSize(91, 21), style=0, validator=wxDefaultValidator, value='') self.sizeOkBtn = wxButton(id=wxID_STCSTYLEEDITDLGSIZEOKBTN, label='ok', name='sizeOkBtn', parent=self.panel2, pos=wxPoint(90, 17), size=wxSize(21, 21), style=0) self.faceOkBtn = wxButton(id=wxID_STCSTYLEEDITDLGFACEOKBTN, label='ok', name='faceOkBtn', parent=self.panel1, pos=wxPoint(122, 18), size=wxSize(21, 21), style=0) self.fgColBtn = wxButton(id=wxID_STCSTYLEEDITDLGFGCOLBTN,
pos=wx.Point(0, 0), size=wx.Size(40, 13), style=0) self.sizeCb = wx.ComboBox(choices=[], id=wxID_STCSTYLEEDITDLGSIZECB, name='sizeCb', parent=self.panel2, pos=wx.Point(0, 17), size=wx.Size(80, 21), style=0, value='') self.sizeOkBtn = wx.Button(id=wxID_STCSTYLEEDITDLGSIZEOKBTN, label='ok', name='sizeOkBtn', parent=self.panel2, pos=wx.Point(80, 17), size=wx.Size(32, 21), style=0) self.faceOkBtn = wx.Button(id=wxID_STCSTYLEEDITDLGFACEOKBTN, label='ok', name='faceOkBtn', parent=self.panel1, pos=wx.Point(117, 18), size=wx.Size(32, 21), style=0) self.fgColBtn = wx.Button(id=wxID_STCSTYLEEDITDLGFGCOLBTN,
def _init_ctrls(self, prnt): # generated method, don't edit wxDialog.__init__(self, id=wxID_STCSTYLEEDITDLG, name='STCStyleEditDlg', parent=prnt, pos=wxPoint(583, 291), size=wxSize(459, 482), style=wxWANTS_CHARS | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER, title=self.stc_title) self._init_utils() self.SetClientSize(wxSize(451, 455)) self.SetAutoLayout(True) self.SetSizeHints(425, 400, -1, -1) self.Center(wxBOTH) EVT_SIZE(self, self.OnStcstyleeditdlgSize)
pos=wxPoint(8, 16), size=wxSize(72, 16), style=0) EVT_BUTTON(self.fgColBtn, wxID_STCSTYLEEDITDLGFGCOLBTN, self.OnFgcolbtnButton) self.fgColCb = wxComboBox(choices=[], id=wxID_STCSTYLEEDITDLGFGCOLCB, name='fgColCb', parent=self.panel3, pos=wxPoint(8, 32), size=wxSize(89, 21), style=0, validator=wxDefaultValidator, value='') self.fgColOkBtn = wxButton(id=wxID_STCSTYLEEDITDLGFGCOLOKBTN, label='ok', name='fgColOkBtn', parent=self.panel3, pos=wxPoint(96, 32), size=wxSize(21, 21), style=0) self.staticText3 = wxStaticText(id=wxID_STCSTYLEEDITDLGSTATICTEXT3,
pos=wx.Point(8, 16), size=wx.Size(96, 16), style=0) self.fgColBtn.Bind(wx.EVT_BUTTON, self.OnFgcolbtnButton, id=wxID_STCSTYLEEDITDLGFGCOLBTN) self.fgColCb = wx.ComboBox(choices=[], id=wxID_STCSTYLEEDITDLGFGCOLCB, name='fgColCb', parent=self.panel3, pos=wx.Point(8, 32), size=wx.Size(96, 21), style=0, value='') self.fgColOkBtn = wx.Button(id=wxID_STCSTYLEEDITDLGFGCOLOKBTN, label='ok', name='fgColOkBtn', parent=self.panel3, pos=wx.Point(104, 32), size=wx.Size(32, 21), style=0) self.staticText3 = wx.StaticText(id=wxID_STCSTYLEEDITDLGSTATICTEXT3,
def _init_ctrls(self, prnt): # generated method, don't edit wxDialog.__init__(self, id=wxID_STCSTYLEEDITDLG, name='STCStyleEditDlg', parent=prnt, pos=wxPoint(583, 291), size=wxSize(459, 482), style=wxWANTS_CHARS | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER, title=self.stc_title) self._init_utils() self.SetClientSize(wxSize(451, 455)) self.SetAutoLayout(True) self.SetSizeHints(425, 400, -1, -1) self.Center(wxBOTH) EVT_SIZE(self, self.OnStcstyleeditdlgSize)
pos=wxPoint(100, 16), size=wxSize(37, 16), style=0) self.fgColDefCb = wxCheckBox(id=wxID_STCSTYLEEDITDLGFGCOLDEFCB,
pos=wx.Point(112, 15), size=wx.Size(38, 16), style=0) self.fgColDefCb = wx.CheckBox(id=wxID_STCSTYLEEDITDLGFGCOLDEFCB,
def _init_ctrls(self, prnt): # generated method, don't edit wxDialog.__init__(self, id=wxID_STCSTYLEEDITDLG, name='STCStyleEditDlg', parent=prnt, pos=wxPoint(583, 291), size=wxSize(459, 482), style=wxWANTS_CHARS | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER, title=self.stc_title) self._init_utils() self.SetClientSize(wxSize(451, 455)) self.SetAutoLayout(True) self.SetSizeHints(425, 400, -1, -1) self.Center(wxBOTH) EVT_SIZE(self, self.OnStcstyleeditdlgSize)
pos=wxPoint(120, 31), size=wxSize(16, 16), style=0) self.bgColBtn = wxButton(id=wxID_STCSTYLEEDITDLGBGCOLBTN,
pos=wx.Point(136, 31), size=wx.Size(16, 16), style=0) self.bgColBtn = wx.Button(id=wxID_STCSTYLEEDITDLGBGCOLBTN,
def _init_ctrls(self, prnt): # generated method, don't edit wxDialog.__init__(self, id=wxID_STCSTYLEEDITDLG, name='STCStyleEditDlg', parent=prnt, pos=wxPoint(583, 291), size=wxSize(459, 482), style=wxWANTS_CHARS | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER, title=self.stc_title) self._init_utils() self.SetClientSize(wxSize(451, 455)) self.SetAutoLayout(True) self.SetSizeHints(425, 400, -1, -1) self.Center(wxBOTH) EVT_SIZE(self, self.OnStcstyleeditdlgSize)
pos=wxPoint(8, 56), size=wxSize(72, 16), style=0) EVT_BUTTON(self.bgColBtn, wxID_STCSTYLEEDITDLGBGCOLBTN, self.OnBgcolbtnButton) self.bgColCb = wxComboBox(choices=[], id=wxID_STCSTYLEEDITDLGBGCOLCB, name='bgColCb', parent=self.panel3, pos=wxPoint(8, 72), size=wxSize(89, 21), style=0, validator=wxDefaultValidator, value='') self.bgColOkBtn = wxButton(id=wxID_STCSTYLEEDITDLGBGCOLOKBTN, label='ok', name='bgColOkBtn', parent=self.panel3, pos=wxPoint(96, 72), size=wxSize(21, 21), style=0) self.staticBox2 = wxStaticBox(id=wxID_STCSTYLEEDITDLGSTATICBOX2,
pos=wx.Point(8, 64), size=wx.Size(96, 16), style=0) self.bgColBtn.Bind(wx.EVT_BUTTON, self.OnBgcolbtnButton, id=wxID_STCSTYLEEDITDLGBGCOLBTN) self.bgColCb = wx.ComboBox(choices=[], id=wxID_STCSTYLEEDITDLGBGCOLCB, name='bgColCb', parent=self.panel3, pos=wx.Point(8, 80), size=wx.Size(96, 21), style=0, value='') self.bgColOkBtn = wx.Button(id=wxID_STCSTYLEEDITDLGBGCOLOKBTN, label='ok', name='bgColOkBtn', parent=self.panel3, pos=wx.Point(104, 80), size=wx.Size(32, 21), style=0) self.staticBox2 = wx.StaticBox(id=wxID_STCSTYLEEDITDLGSTATICBOX2,
def _init_ctrls(self, prnt): # generated method, don't edit wxDialog.__init__(self, id=wxID_STCSTYLEEDITDLG, name='STCStyleEditDlg', parent=prnt, pos=wxPoint(583, 291), size=wxSize(459, 482), style=wxWANTS_CHARS | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER, title=self.stc_title) self._init_utils() self.SetClientSize(wxSize(451, 455)) self.SetAutoLayout(True) self.SetSizeHints(425, 400, -1, -1) self.Center(wxBOTH) EVT_SIZE(self, self.OnStcstyleeditdlgSize)
pos=wxPoint(0, 0), size=wxSize(112, 99), style=0)
pos=wx.Point(0, 0), size=wx.Size(112, 112), style=0)
def _init_ctrls(self, prnt): # generated method, don't edit wxDialog.__init__(self, id=wxID_STCSTYLEEDITDLG, name='STCStyleEditDlg', parent=prnt, pos=wxPoint(583, 291), size=wxSize(459, 482), style=wxWANTS_CHARS | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER, title=self.stc_title) self._init_utils() self.SetClientSize(wxSize(451, 455)) self.SetAutoLayout(True) self.SetSizeHints(425, 400, -1, -1) self.Center(wxBOTH) EVT_SIZE(self, self.OnStcstyleeditdlgSize)
self.staticText2 = wxStaticText(id=wxID_STCSTYLEEDITDLGSTATICTEXT2,
self.staticText2 = wx.StaticText(id=wxID_STCSTYLEEDITDLGSTATICTEXT2,
def _init_ctrls(self, prnt): # generated method, don't edit wxDialog.__init__(self, id=wxID_STCSTYLEEDITDLG, name='STCStyleEditDlg', parent=prnt, pos=wxPoint(583, 291), size=wxSize(459, 482), style=wxWANTS_CHARS | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER, title=self.stc_title) self._init_utils() self.SetClientSize(wxSize(451, 455)) self.SetAutoLayout(True) self.SetSizeHints(425, 400, -1, -1) self.Center(wxBOTH) EVT_SIZE(self, self.OnStcstyleeditdlgSize)
pos=wxPoint(68, 11), size=wxSize(37, 16), style=0) self.taBoldDefCb = wxCheckBox(id=wxID_STCSTYLEEDITDLGTABOLDDEFCB,
pos=wx.Point(64, 12), size=wx.Size(40, 16), style=0) self.taBoldDefCb = wx.CheckBox(id=wxID_STCSTYLEEDITDLGTABOLDDEFCB,
def _init_ctrls(self, prnt): # generated method, don't edit wxDialog.__init__(self, id=wxID_STCSTYLEEDITDLG, name='STCStyleEditDlg', parent=prnt, pos=wxPoint(583, 291), size=wxSize(459, 482), style=wxWANTS_CHARS | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER, title=self.stc_title) self._init_utils() self.SetClientSize(wxSize(451, 455)) self.SetAutoLayout(True) self.SetSizeHints(425, 400, -1, -1) self.Center(wxBOTH) EVT_SIZE(self, self.OnStcstyleeditdlgSize)
pos=wxPoint(88, 27), size=wxSize(16, 16), style=0) self.taItalicDefCb = wxCheckBox(id=wxID_STCSTYLEEDITDLGTAITALICDEFCB,
pos=wx.Point(88, 27), size=wx.Size(16, 16), style=0) self.taItalicDefCb = wx.CheckBox(id=wxID_STCSTYLEEDITDLGTAITALICDEFCB,
def _init_ctrls(self, prnt): # generated method, don't edit wxDialog.__init__(self, id=wxID_STCSTYLEEDITDLG, name='STCStyleEditDlg', parent=prnt, pos=wxPoint(583, 291), size=wxSize(459, 482), style=wxWANTS_CHARS | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER, title=self.stc_title) self._init_utils() self.SetClientSize(wxSize(451, 455)) self.SetAutoLayout(True) self.SetSizeHints(425, 400, -1, -1) self.Center(wxBOTH) EVT_SIZE(self, self.OnStcstyleeditdlgSize)
pos=wxPoint(88, 43), size=wxSize(16, 16), style=0) self.taUnderlinedDefCb = wxCheckBox(id=wxID_STCSTYLEEDITDLGTAUNDERLINEDDEFCB,
pos=wx.Point(88, 48), size=wx.Size(16, 16), style=0) self.taUnderlinedDefCb = wx.CheckBox(id=wxID_STCSTYLEEDITDLGTAUNDERLINEDDEFCB,
def _init_ctrls(self, prnt): # generated method, don't edit wxDialog.__init__(self, id=wxID_STCSTYLEEDITDLG, name='STCStyleEditDlg', parent=prnt, pos=wxPoint(583, 291), size=wxSize(459, 482), style=wxWANTS_CHARS | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER, title=self.stc_title) self._init_utils() self.SetClientSize(wxSize(451, 455)) self.SetAutoLayout(True) self.SetSizeHints(425, 400, -1, -1) self.Center(wxBOTH) EVT_SIZE(self, self.OnStcstyleeditdlgSize)
pos=wxPoint(88, 59), size=wxSize(16, 16), style=0) self.taEOLfilledDefCb = wxCheckBox(id=wxID_STCSTYLEEDITDLGTAEOLFILLEDDEFCB,
pos=wx.Point(88, 70), size=wx.Size(16, 16), style=0) self.taEOLfilledDefCb = wx.CheckBox(id=wxID_STCSTYLEEDITDLGTAEOLFILLEDDEFCB,
def _init_ctrls(self, prnt): # generated method, don't edit wxDialog.__init__(self, id=wxID_STCSTYLEEDITDLG, name='STCStyleEditDlg', parent=prnt, pos=wxPoint(583, 291), size=wxSize(459, 482), style=wxWANTS_CHARS | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER, title=self.stc_title) self._init_utils() self.SetClientSize(wxSize(451, 455)) self.SetAutoLayout(True) self.SetSizeHints(425, 400, -1, -1) self.Center(wxBOTH) EVT_SIZE(self, self.OnStcstyleeditdlgSize)
pos=wxPoint(88, 75), size=wxSize(16, 16), style=0) self.taEOLfilledCb = wxCheckBox(id=wxID_STCSTYLEEDITDLGTAEOLFILLEDCB,
pos=wx.Point(88, 92), size=wx.Size(16, 16), style=0) self.taEOLfilledCb = wx.CheckBox(id=wxID_STCSTYLEEDITDLGTAEOLFILLEDCB,
def _init_ctrls(self, prnt): # generated method, don't edit wxDialog.__init__(self, id=wxID_STCSTYLEEDITDLG, name='STCStyleEditDlg', parent=prnt, pos=wxPoint(583, 291), size=wxSize(459, 482), style=wxWANTS_CHARS | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER, title=self.stc_title) self._init_utils() self.SetClientSize(wxSize(451, 455)) self.SetAutoLayout(True) self.SetSizeHints(425, 400, -1, -1) self.Center(wxBOTH) EVT_SIZE(self, self.OnStcstyleeditdlgSize)
pos=wxPoint(8, 75), size=wxSize(72, 16), style=0) EVT_CHECKBOX(self.taEOLfilledCb, wxID_STCSTYLEEDITDLGTAEOLFILLEDCB, self.OnTaeoffilledcbCheckbox) self.taUnderlinedCb = wxCheckBox(id=wxID_STCSTYLEEDITDLGTAUNDERLINEDCB,
pos=wx.Point(8, 92), size=wx.Size(80, 16), style=0) self.taEOLfilledCb.Bind(wx.EVT_CHECKBOX, self.OnTaeoffilledcbCheckbox, id=wxID_STCSTYLEEDITDLGTAEOLFILLEDCB) self.taUnderlinedCb = wx.CheckBox(id=wxID_STCSTYLEEDITDLGTAUNDERLINEDCB,
def _init_ctrls(self, prnt): # generated method, don't edit wxDialog.__init__(self, id=wxID_STCSTYLEEDITDLG, name='STCStyleEditDlg', parent=prnt, pos=wxPoint(583, 291), size=wxSize(459, 482), style=wxWANTS_CHARS | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER, title=self.stc_title) self._init_utils() self.SetClientSize(wxSize(451, 455)) self.SetAutoLayout(True) self.SetSizeHints(425, 400, -1, -1) self.Center(wxBOTH) EVT_SIZE(self, self.OnStcstyleeditdlgSize)
pos=wxPoint(8, 59), size=wxSize(72, 16), style=0) EVT_CHECKBOX(self.taUnderlinedCb, wxID_STCSTYLEEDITDLGTAUNDERLINEDCB, self.OnTaunderlinedcbCheckbox) self.taItalicCb = wxCheckBox(id=wxID_STCSTYLEEDITDLGTAITALICCB,
pos=wx.Point(8, 70), size=wx.Size(80, 16), style=0) self.taUnderlinedCb.Bind(wx.EVT_CHECKBOX, self.OnTaunderlinedcbCheckbox, id=wxID_STCSTYLEEDITDLGTAUNDERLINEDCB) self.taItalicCb = wx.CheckBox(id=wxID_STCSTYLEEDITDLGTAITALICCB,
def _init_ctrls(self, prnt): # generated method, don't edit wxDialog.__init__(self, id=wxID_STCSTYLEEDITDLG, name='STCStyleEditDlg', parent=prnt, pos=wxPoint(583, 291), size=wxSize(459, 482), style=wxWANTS_CHARS | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER, title=self.stc_title) self._init_utils() self.SetClientSize(wxSize(451, 455)) self.SetAutoLayout(True) self.SetSizeHints(425, 400, -1, -1) self.Center(wxBOTH) EVT_SIZE(self, self.OnStcstyleeditdlgSize)
pos=wxPoint(8, 43), size=wxSize(72, 16), style=0) EVT_CHECKBOX(self.taItalicCb, wxID_STCSTYLEEDITDLGTAITALICCB, self.OnTaitaliccbCheckbox) self.taBoldCb = wxCheckBox(id=wxID_STCSTYLEEDITDLGTABOLDCB, label='Bold', name='taBoldCb', parent=self.panel4, pos=wxPoint(8, 27), size=wxSize(72, 16), style=0) EVT_CHECKBOX(self.taBoldCb, wxID_STCSTYLEEDITDLGTABOLDCB, self.OnTaboldcbCheckbox) self.bgColDefCb = wxCheckBox(id=wxID_STCSTYLEEDITDLGBGCOLDEFCB,
pos=wx.Point(8, 48), size=wx.Size(80, 16), style=0) self.taItalicCb.Bind(wx.EVT_CHECKBOX, self.OnTaitaliccbCheckbox, id=wxID_STCSTYLEEDITDLGTAITALICCB) self.taBoldCb = wx.CheckBox(id=wxID_STCSTYLEEDITDLGTABOLDCB, label='Bold', name='taBoldCb', parent=self.panel4, pos=wx.Point(8, 27), size=wx.Size(80, 16), style=0) self.taBoldCb.Bind(wx.EVT_CHECKBOX, self.OnTaboldcbCheckbox, id=wxID_STCSTYLEEDITDLGTABOLDCB) self.bgColDefCb = wx.CheckBox(id=wxID_STCSTYLEEDITDLGBGCOLDEFCB,
def _init_ctrls(self, prnt): # generated method, don't edit wxDialog.__init__(self, id=wxID_STCSTYLEEDITDLG, name='STCStyleEditDlg', parent=prnt, pos=wxPoint(583, 291), size=wxSize(459, 482), style=wxWANTS_CHARS | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER, title=self.stc_title) self._init_utils() self.SetClientSize(wxSize(451, 455)) self.SetAutoLayout(True) self.SetSizeHints(425, 400, -1, -1) self.Center(wxBOTH) EVT_SIZE(self, self.OnStcstyleeditdlgSize)
pos=wxPoint(120, 71), size=wxSize(16, 16), style=0) self.staticBox1 = wxStaticBox(id=wxID_STCSTYLEEDITDLGSTATICBOX1,
pos=wx.Point(136, 79), size=wx.Size(16, 16), style=0) self.staticBox1 = wx.StaticBox(id=wxID_STCSTYLEEDITDLGSTATICBOX1,
def _init_ctrls(self, prnt): # generated method, don't edit wxDialog.__init__(self, id=wxID_STCSTYLEEDITDLG, name='STCStyleEditDlg', parent=prnt, pos=wxPoint(583, 291), size=wxSize(459, 482), style=wxWANTS_CHARS | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER, title=self.stc_title) self._init_utils() self.SetClientSize(wxSize(451, 455)) self.SetAutoLayout(True) self.SetSizeHints(425, 400, -1, -1) self.Center(wxBOTH) EVT_SIZE(self, self.OnStcstyleeditdlgSize)
pos=wxPoint(0, 0), size=wxSize(142, 99), style=0)
pos=wx.Point(0, 0), size=wx.Size(157, 112), style=0)
def _init_ctrls(self, prnt): # generated method, don't edit wxDialog.__init__(self, id=wxID_STCSTYLEEDITDLG, name='STCStyleEditDlg', parent=prnt, pos=wxPoint(583, 291), size=wxSize(459, 482), style=wxWANTS_CHARS | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER, title=self.stc_title) self._init_utils() self.SetClientSize(wxSize(451, 455)) self.SetAutoLayout(True) self.SetSizeHints(425, 400, -1, -1) self.Center(wxBOTH) EVT_SIZE(self, self.OnStcstyleeditdlgSize)
self.faceDefCb = wxCheckBox(id=wxID_STCSTYLEEDITDLGFACEDEFCB,
self.faceDefCb = wx.CheckBox(id=wxID_STCSTYLEEDITDLGFACEDEFCB,
def _init_ctrls(self, prnt): # generated method, don't edit wxDialog.__init__(self, id=wxID_STCSTYLEEDITDLG, name='STCStyleEditDlg', parent=prnt, pos=wxPoint(583, 291), size=wxSize(459, 482), style=wxWANTS_CHARS | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER, title=self.stc_title) self._init_utils() self.SetClientSize(wxSize(451, 455)) self.SetAutoLayout(True) self.SetSizeHints(425, 400, -1, -1) self.Center(wxBOTH) EVT_SIZE(self, self.OnStcstyleeditdlgSize)
pos=wxPoint(120, 0), size=wxSize(16, 16), style=0) self.taSizeDefCb = wxCheckBox(id=wxID_STCSTYLEEDITDLGTASIZEDEFCB,
pos=wx.Point(117, 0), size=wx.Size(16, 16), style=0) self.taSizeDefCb = wx.CheckBox(id=wxID_STCSTYLEEDITDLGTASIZEDEFCB,
def _init_ctrls(self, prnt): # generated method, don't edit wxDialog.__init__(self, id=wxID_STCSTYLEEDITDLG, name='STCStyleEditDlg', parent=prnt, pos=wxPoint(583, 291), size=wxSize(459, 482), style=wxWANTS_CHARS | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER, title=self.stc_title) self._init_utils() self.SetClientSize(wxSize(451, 455)) self.SetAutoLayout(True) self.SetSizeHints(425, 400, -1, -1) self.Center(wxBOTH) EVT_SIZE(self, self.OnStcstyleeditdlgSize)
pos=wxPoint(88, 0), size=wxSize(16, 16), style=0)
pos=wx.Point(80, 0), size=wx.Size(16, 16), style=0)
def _init_ctrls(self, prnt): # generated method, don't edit wxDialog.__init__(self, id=wxID_STCSTYLEEDITDLG, name='STCStyleEditDlg', parent=prnt, pos=wxPoint(583, 291), size=wxSize(459, 482), style=wxWANTS_CHARS | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER, title=self.stc_title) self._init_utils() self.SetClientSize(wxSize(451, 455)) self.SetAutoLayout(True) self.SetSizeHints(425, 400, -1, -1) self.Center(wxBOTH) EVT_SIZE(self, self.OnStcstyleeditdlgSize)
global commonPropDefs commonPropDefs = {'fore': ' 'size': 8, 'face': wxSystemSettings_GetSystemFont(wxSYS_DEFAULT_GUI_FONT).GetFaceName()}
def __init__(self, parent, langTitle, lang, configFile, STCsToUpdate=()): global commonPropDefs commonPropDefs = {'fore': '#888888', 'size': 8, 'face': wxSystemSettings_GetSystemFont(wxSYS_DEFAULT_GUI_FONT).GetFaceName()}
if wxPlatform == '__WXMSW__': self.style_font_size = 8 else: self.style_font_size = 10
self.style_font_size = 8 self.style_font_size = platformSettings[wx.Platform][1]
def __init__(self, parent, langTitle, lang, configFile, STCsToUpdate=()): global commonPropDefs commonPropDefs = {'fore': '#888888', 'size': 8, 'face': wxSystemSettings_GetSystemFont(wxSYS_DEFAULT_GUI_FONT).GetFaceName()}
global commonPropDefs commonPropDefs = {'fore': ' 'face': wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT).GetFaceName()}
def __init__(self, parent, langTitle, lang, configFile, STCsToUpdate=()): global commonPropDefs commonPropDefs = {'fore': '#888888', 'size': 8, 'face': wxSystemSettings_GetSystemFont(wxSYS_DEFAULT_GUI_FONT).GetFaceName()}
self.stc.SetMarginType(margin, wxSTC_MARGIN_NUMBER)
self.stc.SetMarginType(margin, wx.stc.STC_MARGIN_NUMBER)
def __init__(self, parent, langTitle, lang, configFile, STCsToUpdate=()): global commonPropDefs commonPropDefs = {'fore': '#888888', 'size': 8, 'face': wxSystemSettings_GetSystemFont(wxSYS_DEFAULT_GUI_FONT).GetFaceName()}
EVT_STC_MARGINCLICK(self.stc, wxID_STCSTYLEEDITDLGSTC, self.OnMarginClick)
self.stc.Bind(wx.stc.EVT_STC_MARGINCLICK, self.OnMarginClick, id=wxID_STCSTYLEEDITDLGSTC)
def __init__(self, parent, langTitle, lang, configFile, STCsToUpdate=()): global commonPropDefs commonPropDefs = {'fore': '#888888', 'size': 8, 'face': wxSystemSettings_GetSystemFont(wxSYS_DEFAULT_GUI_FONT).GetFaceName()}
self.stc.SetEdgeMode(wxSTC_EDGE_BACKGROUND)
self.stc.SetEdgeMode(wx.stc.STC_EDGE_BACKGROUND)
def __init__(self, parent, langTitle, lang, configFile, STCsToUpdate=()): global commonPropDefs commonPropDefs = {'fore': '#888888', 'size': 8, 'face': wxSystemSettings_GetSystemFont(wxSYS_DEFAULT_GUI_FONT).GetFaceName()}
self.styleDict.get(wxSTC_STYLE_DEFAULT, ''))
self.styleDict.get(wx.stc.STC_STYLE_DEFAULT, ''))
def __init__(self, parent, langTitle, lang, configFile, STCsToUpdate=()): global commonPropDefs commonPropDefs = {'fore': '#888888', 'size': 8, 'face': wxSystemSettings_GetSystemFont(wxSYS_DEFAULT_GUI_FONT).GetFaceName()}
EVT_CHECKBOX(chb, wid, self.OnDefaultCheckBox)
chb.Bind(wx.EVT_CHECKBOX, self.OnDefaultCheckBox, id=wid)
def __init__(self, parent, langTitle, lang, configFile, STCsToUpdate=()): global commonPropDefs commonPropDefs = {'fore': '#888888', 'size': 8, 'face': wxSystemSettings_GetSystemFont(wxSYS_DEFAULT_GUI_FONT).GetFaceName()}
self.Center(wxBOTH)
self.Center(wx.BOTH)
def __init__(self, parent, langTitle, lang, configFile, STCsToUpdate=()): global commonPropDefs commonPropDefs = {'fore': '#888888', 'size': 8, 'face': wxSystemSettings_GetSystemFont(wxSYS_DEFAULT_GUI_FONT).GetFaceName()}
wxLogError('Name not found in Common definition, '\
wx.LogError('Name not found in Common definition, '\
def editProp(self, on, prop, val=''): oldstyle = self.rememberStyles() if on: if not self.names.count(prop): self.names.append(prop) self.values[prop] = val else: try: self.names.remove(prop) except ValueError: pass try: del self.values[prop] except KeyError: pass
if string.find(style, txt) != -1:
if style.find(txt) != -1:
def findInStyles(self, txt, styles): for style in styles: if string.find(style, txt) != -1: return True return False
wxSystemSettings_GetSystemColour(wxSYS_COLOUR_BTNFACE)) cbtn.SetForegroundColour(wxColour(255, 255, 255))
wx.SystemSettings.GetColour(wx.SYS_COLOUR_BTNFACE)) cbtn.SetForegroundColour(wx.Colour(255, 255, 255))
def clearCtrls(self, isDefault=False, disableDefs=False): self._blockUpdate = True try: for ctrl, chb, prop, wid in self.allCtrls: if prop in ('fore', 'back'): cbtn, txt, btn = ctrl cbtn.SetBackgroundColour(\ wxSystemSettings_GetSystemColour(wxSYS_COLOUR_BTNFACE)) cbtn.SetForegroundColour(wxColour(255, 255, 255)) cbtn.Enable(isDefault) txt.SetValue('') txt.Enable(isDefault) btn.Enable(isDefault) elif prop == 'size': cmb, btn = ctrl cmb.SetValue('') cmb.Enable(isDefault) btn.Enable(isDefault) elif prop == 'face': cmb, btn, chk = ctrl cmb.SetValue('') cmb.Enable(isDefault) btn.Enable(isDefault) chk.Enable(isDefault) chk.SetValue(False) elif prop in ('bold', 'italic', 'underline', 'eolfilled'): ctrl.SetValue(False) ctrl.Enable(isDefault)
cbtn.SetForegroundColour(wxColour(0, 0, 0))
cbtn.SetForegroundColour(wx.Colour(0, 0, 0))
def populateProp(self, items, default, forceDisable=False): self._blockUpdate = True try: for name, val in items: if name: ctrl, chb = self.getCtrlForProp(name)
self.clearCtrls(self.styleNum == wxSTC_STYLE_DEFAULT,
self.clearCtrls(self.styleNum == wx.stc.STC_STYLE_DEFAULT,
def populateCtrls(self): self.clearCtrls(self.styleNum == wxSTC_STYLE_DEFAULT, disableDefs=self.styleNum < 0)
self.styleNum != wxSTC_STYLE_DEFAULT)
self.styleNum != wx.stc.STC_STYLE_DEFAULT)
def populateCtrls(self): self.clearCtrls(self.styleNum == wxSTC_STYLE_DEFAULT, disableDefs=self.styleNum < 0)
EVT_COMBOBOX(combo, combo.GetId(), comboEvtMeth) EVT_BUTTON(btn, btn.GetId(), btnEvtMeth) EVT_RIGHT_DCLICK(combo, rdclickEvtMeth)
combo.Bind(wx.EVT_COMBOBOX, comboEvtMeth, id=combo.GetId()) btn.Bind(wx.EVT_BUTTON, btnEvtMeth, id=btn.GetId()) combo.Bind(wx.EVT_RIGHT_DCLICK, rdclickEvtMeth)
def bindComboEvts(self, combo, btn, btnEvtMeth, comboEvtMeth, rdclickEvtMeth): EVT_COMBOBOX(combo, combo.GetId(), comboEvtMeth) EVT_BUTTON(btn, btn.GetId(), btnEvtMeth) EVT_RIGHT_DCLICK(combo, rdclickEvtMeth) combo.SetToolTipString('Select from list or click "ok" button on the right to change a manual entry, right double-click \n'\ 'the drop down button to select Common definition in the Style Editor (if applicable)') btn.SetToolTipString('Accept value')
fontEnum = wxFontEnumerator()
fontEnum = wx.FontEnumerator()
def populateCombosWithCommonDefs(self, fixedWidthOnly=None): self._blockUpdate = True try: commonDefs = {'fore': [], 'face': [], 'size': []}
for colCommonDef in ['']+fontNameList+commonDefs['face']:
for colCommonDef in fontNameList+commonDefs['face']:
def populateCombosWithCommonDefs(self, fixedWidthOnly=None): self._blockUpdate = True try: commonDefs = {'fore': [], 'face': [], 'size': []}
if num == wxSTC_STYLE_DEFAULT:
if num == wx.stc.STC_STYLE_DEFAULT:
def populateStyleSelector(self): numStyles = self.styleIdNames.items() numStyles.sort() self.styleNumLookup = {} stdStart = -1 stdOffset = 0 extrOffset = 0 # add styles for num, name in numStyles: if num == wxSTC_STYLE_DEFAULT: self.elementLb.InsertItems([name, '----Language----'], 0) self.elementLb.Append('----Standard----') stdStart = stdPos = self.elementLb.GetCount() else: # std styles if num >= 33 and num < 40: self.elementLb.InsertItems([name], stdStart + stdOffset) stdOffset = stdOffset + 1 # extra styles elif num >= 40: self.elementLb.InsertItems([name], stdStart + extrOffset -1) extrOffset = extrOffset + 1 # normal lang styles else: self.elementLb.Append(name) self.styleNumLookup[name] = num
data = wxColourData()
data = wx.ColourData()
def getColourDlg(self, colour, title=''): data = wxColourData() data.SetColour(colour) data.SetChooseFull(True) dlg = wxColourDialog(self, data) try: dlg.SetTitle(title) if dlg.ShowModal() == wxID_OK: data = dlg.GetColourData() return data.GetColour() finally: dlg.Destroy() return None
dlg = wxColourDialog(self, data)
dlg = wx.ColourDialog(self, data)
def getColourDlg(self, colour, title=''): data = wxColourData() data.SetColour(colour) data.SetChooseFull(True) dlg = wxColourDialog(self, data) try: dlg.SetTitle(title) if dlg.ShowModal() == wxID_OK: data = dlg.GetColourData() return data.GetColour() finally: dlg.Destroy() return None
if dlg.ShowModal() == wxID_OK:
if dlg.ShowModal() == wx.ID_OK:
def getColourDlg(self, colour, title=''): data = wxColourData() data.SetColour(colour) data.SetChooseFull(True) dlg = wxColourDialog(self, data) try: dlg.SetTitle(title) if dlg.ShowModal() == wxID_OK: data = dlg.GetColourData() return data.GetColour() finally: dlg.Destroy() return None
colBtn.SetForegroundColour(wxColour(0, 0, 0))
colBtn.SetForegroundColour(wx.Colour(0, 0, 0))
def editColProp(self, colBtn, colCb, prop): col = self.getColourDlg(colBtn.GetBackgroundColour(), self.colDlgTitles[prop]+ ' colour') if col: colBtn.SetForegroundColour(wxColour(0, 0, 0)) colBtn.SetBackgroundColour(col) colStr = colToStr(col) colCb.SetValue(colStr) self.editProp(True, prop, colStr)
colBtn.SetForegroundColour(wxColour(0, 0, 0))
colBtn.SetForegroundColour(wx.Colour(0, 0, 0))
def editColTCProp(self, colCb, colBtn, prop, val=None): if val is None: colStr = colCb.GetValue() else: colStr = val if colStr: col = strToCol(colStr%self.commonDefs) if self.editProp(colStr!='', prop, colStr): if colStr: colBtn.SetForegroundColour(wxColour(0, 0, 0)) colBtn.SetBackgroundColour(col) else: colBtn.SetForegroundColour(wxColour(255, 255, 255)) colBtn.SetBackgroundColour(\ wxSystemSettings_GetSystemColour(wxSYS_COLOUR_BTNFACE))
colBtn.SetForegroundColour(wxColour(255, 255, 255))
colBtn.SetForegroundColour(wx.Colour(255, 255, 255))
def editColTCProp(self, colCb, colBtn, prop, val=None): if val is None: colStr = colCb.GetValue() else: colStr = val if colStr: col = strToCol(colStr%self.commonDefs) if self.editProp(colStr!='', prop, colStr): if colStr: colBtn.SetForegroundColour(wxColour(0, 0, 0)) colBtn.SetBackgroundColour(col) else: colBtn.SetForegroundColour(wxColour(255, 255, 255)) colBtn.SetBackgroundColour(\ wxSystemSettings_GetSystemColour(wxSYS_COLOUR_BTNFACE))
wxSystemSettings_GetSystemColour(wxSYS_COLOUR_BTNFACE))
wxSystemSettings.GetColour(wx.SYS_COLOUR_BTNFACE))
def editColTCProp(self, colCb, colBtn, prop, val=None): if val is None: colStr = colCb.GetValue() else: colStr = val if colStr: col = strToCol(colStr%self.commonDefs) if self.editProp(colStr!='', prop, colStr): if colStr: colBtn.SetForegroundColour(wxColour(0, 0, 0)) colBtn.SetBackgroundColour(col) else: colBtn.SetForegroundColour(wxColour(255, 255, 255)) colBtn.SetBackgroundColour(\ wxSystemSettings_GetSystemColour(wxSYS_COLOUR_BTNFACE))
except AssertionError: wxLogError('Not a valid colour value')
except AssertionError: wx.LogError('Not a valid colour value')
def OnfgColRet(self, event): try: self.editColTCProp(self.fgColCb, self.fgColBtn, 'fore') except AssertionError: wxLogError('Not a valid colour value')
except AssertionError: wxLogError('Not a valid colour value')
except AssertionError: wx.LogError('Not a valid colour value')
def OnfgColCombobox(self, event): if self._blockUpdate: return try: self.editColTCProp(self.fgColCb, self.fgColBtn, 'fore', event.GetString()) except AssertionError: wxLogError('Not a valid colour value')
except AssertionError: wxLogError('Not a valid colour value')
except AssertionError: wx.LogError('Not a valid colour value')
def OnbgColRet(self, event): try: self.editColTCProp(self.bgColCb, self.bgColBtn, 'back') except AssertionError: wxLogError('Not a valid colour value')
except AssertionError: wxLogError('Not a valid colour value')
except AssertionError: wx.LogError('Not a valid colour value')
def OnbgColCombobox(self, event): if self._blockUpdate: return try: self.editColTCProp(self.bgColCb, self.bgColBtn, 'back', event.GetString()) except AssertionError: wxLogError('Not a valid colour value')
except KeyError: wxLogError('Invalid common definition')
except KeyError: wx.LogError('Invalid common definition')
def setFace(self, val): try: val%self.commonDefs except KeyError: wxLogError('Invalid common definition') else: self.editProp(val!='', 'face', val)
except ValueError: wxLogError('Not a valid integer size value') except KeyError: wxLogError('Invalid common definition')
except ValueError: wx.LogError('Not a valid integer size value') except KeyError: wx.LogError('Invalid common definition')
def setSize(self, val): try: int(val%self.commonDefs) except ValueError: wxLogError('Not a valid integer size value') except KeyError: wxLogError('Invalid common definition') else: self.editProp(val!='', 'size', val)
if self.styleNum == wxSTC_STYLE_DEFAULT:
if self.styleNum == wx.stc.STC_STYLE_DEFAULT:
def OnElementlbListbox(self, event): isCommon = self.elementLb.GetSelection() >= self.commonDefsStartIdx self.removeCommonItemBtn.Enable(isCommon)
wxBeginBusyCursor()
wx.BeginBusyCursor()
def OnOkbtnButton(self, event): # write styles and common defs to the config wxBeginBusyCursor() try: writeStylesToConfig(self.config, 'style.%s'%self.lang, self.styles) self.config.SetPath('') self.config.Write(commonDefsFile, `self.commonDefs`) self.config.Flush()
wxEndBusyCursor() self.EndModal(wxID_OK)
wx.EndBusyCursor() self.EndModal(wx.ID_OK)
def OnOkbtnButton(self, event): # write styles and common defs to the config wxBeginBusyCursor() try: writeStylesToConfig(self.config, 'style.%s'%self.lang, self.styles) self.config.SetPath('') self.config.Write(commonDefsFile, `self.commonDefs`) self.config.Flush()
self.EndModal(wxID_CANCEL)
self.EndModal(wx.ID_CANCEL)
def OnCancelbtnButton(self, event): self.EndModal(wxID_CANCEL)
dlg = wxTextEntryDialog(self, 'Edit common definitions dictionary',
dlg = wx.TextEntryDialog(self, 'Edit common definitions dictionary',
def OnCommondefsbtnButton(self, event): dlg = wxTextEntryDialog(self, 'Edit common definitions dictionary', 'Common definitions', pprint.pformat(self.commonDefs), style=wxTE_MULTILINE | wxOK | wxCANCEL | wxCENTRE) try: if dlg.ShowModal() == wxID_OK: answer = eval(dlg.GetValue()) assert type(answer) is type({}), 'Not a valid dictionary' oldDefs = self.commonDefs self.commonDefs = answer try: self.setStyles() except KeyError, badkey: wxLogError(str(badkey)+' not defined but required, \n'\ 'reverting to previous common definition') self.commonDefs = oldDefs self.setStyles() self.populateCombosWithCommonDefs()
style=wxTE_MULTILINE | wxOK | wxCANCEL | wxCENTRE)
style=wx.TE_MULTILINE | wx.OK | wx.CANCEL | wx.CENTRE)
def OnCommondefsbtnButton(self, event): dlg = wxTextEntryDialog(self, 'Edit common definitions dictionary', 'Common definitions', pprint.pformat(self.commonDefs), style=wxTE_MULTILINE | wxOK | wxCANCEL | wxCENTRE) try: if dlg.ShowModal() == wxID_OK: answer = eval(dlg.GetValue()) assert type(answer) is type({}), 'Not a valid dictionary' oldDefs = self.commonDefs self.commonDefs = answer try: self.setStyles() except KeyError, badkey: wxLogError(str(badkey)+' not defined but required, \n'\ 'reverting to previous common definition') self.commonDefs = oldDefs self.setStyles() self.populateCombosWithCommonDefs()
if dlg.ShowModal() == wxID_OK: answer = eval(dlg.GetValue())
if dlg.ShowModal() == wx.ID_OK: answer = eval(dlg.GetValue(), stc.__dict__)
def OnCommondefsbtnButton(self, event): dlg = wxTextEntryDialog(self, 'Edit common definitions dictionary', 'Common definitions', pprint.pformat(self.commonDefs), style=wxTE_MULTILINE | wxOK | wxCANCEL | wxCENTRE) try: if dlg.ShowModal() == wxID_OK: answer = eval(dlg.GetValue()) assert type(answer) is type({}), 'Not a valid dictionary' oldDefs = self.commonDefs self.commonDefs = answer try: self.setStyles() except KeyError, badkey: wxLogError(str(badkey)+' not defined but required, \n'\ 'reverting to previous common definition') self.commonDefs = oldDefs self.setStyles() self.populateCombosWithCommonDefs()
wxLogError(str(badkey)+' not defined but required, \n'\
wx.LogError(str(badkey)+' not defined but required, \n'\
def OnCommondefsbtnButton(self, event): dlg = wxTextEntryDialog(self, 'Edit common definitions dictionary', 'Common definitions', pprint.pformat(self.commonDefs), style=wxTE_MULTILINE | wxOK | wxCANCEL | wxCENTRE) try: if dlg.ShowModal() == wxID_OK: answer = eval(dlg.GetValue()) assert type(answer) is type({}), 'Not a valid dictionary' oldDefs = self.commonDefs self.commonDefs = answer try: self.setStyles() except KeyError, badkey: wxLogError(str(badkey)+' not defined but required, \n'\ 'reverting to previous common definition') self.commonDefs = oldDefs self.setStyles() self.populateCombosWithCommonDefs()
self.styleDict.get(wxSTC_STYLE_DEFAULT, ''))
self.styleDict.get(wx.stc.STC_STYLE_DEFAULT, ''))
def OnSpeedsettingchChoice(self, event): group = event.GetString() if group: userStyles = 'style.%s'%self.lang if self.currSpeedSetting == userStyles: self.predefStyleGroups[userStyles] = self.styles self.styles = self.predefStyleGroups[group] self.setStyles() self.defNames, self.defValues = parseProp(\ self.styleDict.get(wxSTC_STYLE_DEFAULT, '')) self.OnElementlbListbox(None) self.currSpeedSetting = group
self.populateCombosWithCommonDefs(event.Checked())
self.populateCombosWithCommonDefs(event.IsChecked())
def OnFixedwidthchkCheckbox(self, event): self.populateCombosWithCommonDefs(event.Checked())
if dlg.ShowModal() == wxID_OK:
if dlg.ShowModal() == wx.ID_OK:
def OnAddsharebtnButton(self, event): dlg = CommonDefDlg(self) try: if dlg.ShowModal() == wxID_OK: prop, name = dlg.result if not self.commonDefs.has_key(name): self.commonDefs[name] = commonPropDefs[prop] self.elementLb.Append('%('+name+')'+\ (type(commonPropDefs[prop]) is type('') and 's' or 'd')) self.elementLb.SetSelection(self.elementLb.GetCount()-1, True) self.populateCombosWithCommonDefs() self.OnElementlbListbox(None) finally: dlg.Destroy()
wxLogError('Aborted: '+comDef+' is still used in the styles of the \n'\
wx.LogError('Aborted: '+comDef+' is still used in the styles of the \n'\
def OnRemovesharebtnButton(self, event): ownGroup = 'style.%s'%self.lang comDef = self.elementLb.GetStringSelection()
string.join(matchList, '\n'))
'\n'.join(matchList))
def OnRemovesharebtnButton(self, event): ownGroup = 'style.%s'%self.lang comDef = self.elementLb.GetStringSelection()
if style == wxSTC_STYLE_BRACELIGHT and self.braceInfo.has_key('good'):
if style == wx.stc.STC_STYLE_BRACELIGHT and self.braceInfo.has_key('good'):
def checkBraces(self, style): if style == wxSTC_STYLE_BRACELIGHT and self.braceInfo.has_key('good'): line, col = self.braceInfo['good'] pos = self.stc.PositionFromLine(line-1) + col braceOpposite = self.stc.BraceMatch(pos) if braceOpposite != -1: self.stc.BraceHighlight(pos, braceOpposite) elif style == wxSTC_STYLE_BRACEBAD and self.braceInfo.has_key('bad'): line, col = self.braceInfo['bad'] pos = self.stc.PositionFromLine(line-1) + col self.stc.BraceBadLight(pos) else: self.stc.BraceBadLight(-1) return
elif style == wxSTC_STYLE_BRACEBAD and self.braceInfo.has_key('bad'):
elif style == wx.stc.STC_STYLE_BRACEBAD and self.braceInfo.has_key('bad'):
def checkBraces(self, style): if style == wxSTC_STYLE_BRACELIGHT and self.braceInfo.has_key('good'): line, col = self.braceInfo['good'] pos = self.stc.PositionFromLine(line-1) + col braceOpposite = self.stc.BraceMatch(pos) if braceOpposite != -1: self.stc.BraceHighlight(pos, braceOpposite) elif style == wxSTC_STYLE_BRACEBAD and self.braceInfo.has_key('bad'): line, col = self.braceInfo['bad'] pos = self.stc.PositionFromLine(line-1) + col self.stc.BraceBadLight(pos) else: self.stc.BraceBadLight(-1) return
[wxID_COMMONDEFDLG, wxID_COMMONDEFDLGCANCELBTN, wxID_COMMONDEFDLGCOMDEFNAMETC, wxID_COMMONDEFDLGOKBTN, wxID_COMMONDEFDLGPROPTYPERBX, wxID_COMMONDEFDLGSTATICBOX1] = map(lambda _init_ctrls: wxNewId(), range(6)) class CommonDefDlg(wxDialog):
[wxID_COMMONDEFDLG, wxID_COMMONDEFDLGCANCELBTN, wxID_COMMONDEFDLGCOMDEFNAMETC, wxID_COMMONDEFDLGOKBTN, wxID_COMMONDEFDLGPROPTYPERBX, wxID_COMMONDEFDLGSTATICBOX1] = [wx.NewId() for _init_ctrls in range(6)] class CommonDefDlg(wx.Dialog):
def OnMarginClick(self, event): self.elementLb.SetStringSelection('Line numbers', True) self.OnElementlbListbox(None)
wxDialog.__init__(self, id = wxID_COMMONDEFDLG, name = 'CommonDefDlg', parent = prnt, pos = wxPoint(398, 249), size = wxSize(192, 220), style = wxDEFAULT_DIALOG_STYLE, title = 'Common definition') self.SetClientSize(wxSize(184, 200)) self.propTypeRBx = wxRadioBox(choices = ['Colour value', 'Font face', 'Size value'], id = wxID_COMMONDEFDLGPROPTYPERBX, label = 'Property type', majorDimension = 1, name = 'propTypeRBx', parent = self, point = wxPoint(8, 8), size = wxSize(168, 92), style = wxRA_SPECIFY_COLS, validator = wxDefaultValidator)
wx.Dialog.__init__(self, id = wxID_COMMONDEFDLG, name = 'CommonDefDlg', parent = prnt, pos = wx.Point(398, 249), size = wx.Size(192, 220), style= wx.DEFAULT_DIALOG_STYLE, title = 'Common definition') self.SetClientSize(wx.Size(184, 200)) self.propTypeRBx = wx.RadioBox(choices = ['Colour value', 'Font face', 'Size value'], id = wxID_COMMONDEFDLGPROPTYPERBX, label = 'Property type', majorDimension = 1, name = 'propTypeRBx', parent = self, point = wx.Point(8, 8), size = wx.Size(168, 92), style= wx.RA_SPECIFY_COLS)
def _init_ctrls(self, prnt): wxDialog.__init__(self, id = wxID_COMMONDEFDLG, name = 'CommonDefDlg', parent = prnt, pos = wxPoint(398, 249), size = wxSize(192, 220), style = wxDEFAULT_DIALOG_STYLE, title = 'Common definition') self.SetClientSize(wxSize(184, 200))
self.staticBox1 = wxStaticBox(id = wxID_COMMONDEFDLGSTATICBOX1, label = 'Name', name = 'staticBox1', parent = self, pos = wxPoint(8, 108), size = wxSize(168, 46), style = 0) self.comDefNameTC = wxTextCtrl(id = wxID_COMMONDEFDLGCOMDEFNAMETC, name = 'comDefNameTC', parent = self, pos = wxPoint(16, 124), size = wxSize(152, 21), style = 0, value = '')
self.staticBox1 = wx.StaticBox(id = wxID_COMMONDEFDLGSTATICBOX1, label = 'Name', name = 'staticBox1', parent = self, pos = wx.Point(8, 108), size = wx.Size(168, 46), style = 0) self.comDefNameTC = wx.TextCtrl(id = wxID_COMMONDEFDLGCOMDEFNAMETC, name = 'comDefNameTC', parent = self, pos = wx.Point(16, 124), size = wx.Size(152, 21), style = 0, value = '')
def _init_ctrls(self, prnt): wxDialog.__init__(self, id = wxID_COMMONDEFDLG, name = 'CommonDefDlg', parent = prnt, pos = wxPoint(398, 249), size = wxSize(192, 220), style = wxDEFAULT_DIALOG_STYLE, title = 'Common definition') self.SetClientSize(wxSize(184, 200))
self.okBtn = wxButton(id = wxID_COMMONDEFDLGOKBTN, label = 'OK', name = 'okBtn', parent = self, pos = wxPoint(8, 164), size = wxSize(80, 23), style = 0) EVT_BUTTON(self.okBtn, wxID_COMMONDEFDLGOKBTN, self.OnOkbtnButton) self.cancelBtn = wxButton(id = wxID_COMMONDEFDLGCANCELBTN, label = 'Cancel', name = 'cancelBtn', parent = self, pos = wxPoint(96, 164), size = wxSize(80, 23), style = 0) EVT_BUTTON(self.cancelBtn, wxID_COMMONDEFDLGCANCELBTN, self.OnCancelbtnButton)
self.okBtn = wx.Button(id = wxID_COMMONDEFDLGOKBTN, label = 'OK', name = 'okBtn', parent = self, pos = wx.Point(8, 164), size = wx.Size(80, 23), style = 0) self.okBtn.Bind(wx.EVT_BUTTON, self.OnOkbtnButton, id=wxID_COMMONDEFDLGOKBTN) self.cancelBtn = wx.Button(id = wxID_COMMONDEFDLGCANCELBTN, label = 'Cancel', name = 'cancelBtn', parent = self, pos = wx.Point(96, 164), size = wx.Size(80, 23), style = 0) self.cancelBtn.Bind(wx.EVT_BUTTON, self.OnCancelbtnButton, id=wxID_COMMONDEFDLGCANCELBTN)
def _init_ctrls(self, prnt): wxDialog.__init__(self, id = wxID_COMMONDEFDLG, name = 'CommonDefDlg', parent = prnt, pos = wxPoint(398, 249), size = wxSize(192, 220), style = wxDEFAULT_DIALOG_STYLE, title = 'Common definition') self.SetClientSize(wxSize(184, 200))
self.Center(wxBOTH)
self.Center(wx.BOTH)
def __init__(self, parent, name='', propIdx=0): self._comDefName = '' self._comDefName = name self._propTypeIdx = 0 self._propTypeIdx = propIdx self._init_ctrls(parent)
self.EndModal(wxID_OK)
self.EndModal(wx.ID_OK)
def OnOkbtnButton(self, event): self.result = ( self.propMap[self.propTypeRBx.GetSelection()], self.comDefNameTC.GetValue() ) self.EndModal(wxID_OK)
self.EndModal(wxID_CANCEL)
self.EndModal(wx.ID_CANCEL)
def OnCancelbtnButton(self, event): self.result = ( '', '' ) self.EndModal(wxID_CANCEL)
assert len(strCol) == 7 and strCol[0] == ' return wxColour(string.atoi('0x'+strCol[1:3], 16),
assert len(strCol) == 7 and strCol[0] == ' return wx.Colour(string.atoi('0x'+strCol[1:3], 16),
def strToCol(strCol): assert len(strCol) == 7 and strCol[0] == '#', 'Not a valid colour string' return wxColour(string.atoi('0x'+strCol[1:3], 16), string.atoi('0x'+strCol[3:5], 16), string.atoi('0x'+strCol[5:7], 16))
return string.join(res, ',')
return ','.join(res)
def writePropVal(names, values): res = [] for name in names: if name: res.append(values[name] and name+':'+values[name] or name) return string.join(res, ',')
items = string.split(prop, ',')
items = prop.split(',')
def parseProp(prop): items = string.split(prop, ',') names = [] values = {} for item in items: nameVal = string.split(item, ':') names.append(string.strip(nameVal[0])) if len(nameVal) == 1: values[nameVal[0]] = '' else: values[nameVal[0]] = string.strip(nameVal[1]) return names, values
nameVal = string.split(item, ':') names.append(string.strip(nameVal[0]))
nameVal = item.split(':') names.append(nameVal[0].strip())
def parseProp(prop): items = string.split(prop, ',') names = [] values = {} for item in items: nameVal = string.split(item, ':') names.append(string.strip(nameVal[0])) if len(nameVal) == 1: values[nameVal[0]] = '' else: values[nameVal[0]] = string.strip(nameVal[1]) return names, values
values[nameVal[0]] = string.strip(nameVal[1])
values[nameVal[0]] = nameVal[1].strip()
def parseProp(prop): items = string.split(prop, ',') names = [] values = {} for item in items: nameVal = string.split(item, ':') names.append(string.strip(nameVal[0])) if len(nameVal) == 1: values[nameVal[0]] = '' else: values[nameVal[0]] = string.strip(nameVal[1]) return names, values
name, value = string.split(prop, '=') return int(string.split(name, '.')[-1]), value
name, value = prop.split('=') return int(name.split('.')[-1]), value
def parsePropLine(prop): name, value = string.split(prop, '=') return int(string.split(name, '.')[-1]), value
else: prop = styleDict[wxSTC_STYLE_DEFAULT]
else: prop = styleDict[wx.stc.STC_STYLE_DEFAULT]
def setSTCStyles(stc, styles, styleIdNames, commonDefs, lang, lexer, keywords): #wxLogMessage('Set style') styleDict = {} styleNumIdxMap = {} # build style dict based on given styles for numStyle in styles: num, style = parsePropLine(numStyle) styleDict[num] = style # Add blank style entries for undefined styles newStyles = [] styleItems = styleIdNames.items() + settingsIdNames.items() styleItems.sort() idx = 0 for num, name in styleItems: styleNumIdxMap[num] = idx if not styleDict.has_key(num): styleDict[num] = '' newStyles.append(writeProp(num, styleDict[num], lang)) idx = idx + 1 # Set background colour to reduce flashing effect on refresh or page switch bkCol = None if styleDict.has_key(0): prop = styleDict[0] else: prop = styleDict[wxSTC_STYLE_DEFAULT] names, vals = parseProp(prop) if 'back' in names: bkCol = strToCol(vals['back']) if bkCol is None: bkCol = wxWHITE stc.SetBackgroundColour(bkCol) # Set the styles on the wxSTC
bkCol = strToCol(vals['back'])
bkCol = strToCol(vals['back']%commonDefs)
def setSTCStyles(stc, styles, styleIdNames, commonDefs, lang, lexer, keywords): #wxLogMessage('Set style') styleDict = {} styleNumIdxMap = {} # build style dict based on given styles for numStyle in styles: num, style = parsePropLine(numStyle) styleDict[num] = style # Add blank style entries for undefined styles newStyles = [] styleItems = styleIdNames.items() + settingsIdNames.items() styleItems.sort() idx = 0 for num, name in styleItems: styleNumIdxMap[num] = idx if not styleDict.has_key(num): styleDict[num] = '' newStyles.append(writeProp(num, styleDict[num], lang)) idx = idx + 1 # Set background colour to reduce flashing effect on refresh or page switch bkCol = None if styleDict.has_key(0): prop = styleDict[0] else: prop = styleDict[wxSTC_STYLE_DEFAULT] names, vals = parseProp(prop) if 'back' in names: bkCol = strToCol(vals['back']) if bkCol is None: bkCol = wxWHITE stc.SetBackgroundColour(bkCol) # Set the styles on the wxSTC
bkCol = wxWHITE
bkCol = wx.WHITE
def setSTCStyles(stc, styles, styleIdNames, commonDefs, lang, lexer, keywords): #wxLogMessage('Set style') styleDict = {} styleNumIdxMap = {} # build style dict based on given styles for numStyle in styles: num, style = parsePropLine(numStyle) styleDict[num] = style # Add blank style entries for undefined styles newStyles = [] styleItems = styleIdNames.items() + settingsIdNames.items() styleItems.sort() idx = 0 for num, name in styleItems: styleNumIdxMap[num] = idx if not styleDict.has_key(num): styleDict[num] = '' newStyles.append(writeProp(num, styleDict[num], lang)) idx = idx + 1 # Set background colour to reduce flashing effect on refresh or page switch bkCol = None if styleDict.has_key(0): prop = styleDict[0] else: prop = styleDict[wxSTC_STYLE_DEFAULT] names, vals = parseProp(prop) if 'back' in names: bkCol = strToCol(vals['back']) if bkCol is None: bkCol = wxWHITE stc.SetBackgroundColour(bkCol) # Set the styles on the wxSTC
stc.StyleSetSpec(wxSTC_STYLE_DEFAULT, styleDict[wxSTC_STYLE_DEFAULT] % commonDefs)
stc.StyleSetSpec(wx.stc.STC_STYLE_DEFAULT, styleDict[wx.stc.STC_STYLE_DEFAULT] % commonDefs)
def setSTCStyles(stc, styles, styleIdNames, commonDefs, lang, lexer, keywords): #wxLogMessage('Set style') styleDict = {} styleNumIdxMap = {} # build style dict based on given styles for numStyle in styles: num, style = parsePropLine(numStyle) styleDict[num] = style # Add blank style entries for undefined styles newStyles = [] styleItems = styleIdNames.items() + settingsIdNames.items() styleItems.sort() idx = 0 for num, name in styleItems: styleNumIdxMap[num] = idx if not styleDict.has_key(num): styleDict[num] = '' newStyles.append(writeProp(num, styleDict[num], lang)) idx = idx + 1 # Set background colour to reduce flashing effect on refresh or page switch bkCol = None if styleDict.has_key(0): prop = styleDict[0] else: prop = styleDict[wxSTC_STYLE_DEFAULT] names, vals = parseProp(prop) if 'back' in names: bkCol = strToCol(vals['back']) if bkCol is None: bkCol = wxWHITE stc.SetBackgroundColour(bkCol) # Set the styles on the wxSTC
commonDefsFile = 'common.defs.%s'%(wxPlatform == '__WXMSW__' and 'msw' or 'gtk')
commonDefsFile = 'common.defs.%s'%(platformSettings[wx.Platform][0])
def setSTCStyles(stc, styles, styleIdNames, commonDefs, lang, lexer, keywords): #wxLogMessage('Set style') styleDict = {} styleNumIdxMap = {} # build style dict based on given styles for numStyle in styles: num, style = parsePropLine(numStyle) styleDict[num] = style # Add blank style entries for undefined styles newStyles = [] styleItems = styleIdNames.items() + settingsIdNames.items() styleItems.sort() idx = 0 for num, name in styleItems: styleNumIdxMap[num] = idx if not styleDict.has_key(num): styleDict[num] = '' newStyles.append(writeProp(num, styleDict[num], lang)) idx = idx + 1 # Set background colour to reduce flashing effect on refresh or page switch bkCol = None if styleDict.has_key(0): prop = styleDict[0] else: prop = styleDict[wxSTC_STYLE_DEFAULT] names, vals = parseProp(prop) if 'back' in names: bkCol = strToCol(vals['back']) if bkCol is None: bkCol = wxWHITE stc.SetBackgroundColour(bkCol) # Set the styles on the wxSTC
return eval(string.replace(conf.Read(name), '\r\n', '\n')+'\n')
ns = {} ns.update(wxPython.stc.__dict__) ns['wx'] = wx value = conf.Read(name).replace('\r\n', '\n')+'\n' try: return eval(value, ns) except: print value raise
def readPyValFromConfig(conf, name): return eval(string.replace(conf.Read(name), '\r\n', '\n')+'\n')
cfg = wxFileConfig(localFilename=configFile, style=wxCONFIG_USE_LOCAL_FILE)
if not os.path.exists(configFile): raise Exception, 'Config file %s not found'%configFile cfg = wx.FileConfig(localFilename=configFile, style= wx.CONFIG_USE_LOCAL_FILE)
def initFromConfig(configFile, lang): cfg = wxFileConfig(localFilename=configFile, style=wxCONFIG_USE_LOCAL_FILE) cfg.SetExpandEnvVars(False) # read in all group names for this language groupPrefix = 'style.%s'%lang gpLen = len(groupPrefix) predefStyleGroupNames, otherLangStyleGroupNames = [], [] cont, val, idx = cfg.GetFirstGroup() while cont: if val != groupPrefix and len(val) >= 5 and val[:5] == 'style': if len(val) > gpLen and val[:gpLen] == groupPrefix: predefStyleGroupNames.append(val) else: otherLangStyleGroupNames.append(val) cont, val, idx = cfg.GetNextGroup(idx) # read in common elements commonDefs = readPyValFromConfig(cfg, commonDefsFile) assert type(commonDefs) is type({}), \ 'Common definitions (%s) not a valid dict'%commonDefsFile commonStyleIdNames = readPyValFromConfig(cfg, 'common.styleidnames') assert type(commonStyleIdNames) is type({}), \ 'Common definitions (%s) not a valid dict'%'common.styleidnames' # Lang spesific settings cfg.SetPath(lang) styleIdNames = readPyValFromConfig(cfg, 'styleidnames') assert type(commonStyleIdNames) is type({}), \ 'Not a valid dict [%s] styleidnames)'%lang styleIdNames.update(commonStyleIdNames) braceInfo = readPyValFromConfig(cfg, 'braces') assert type(commonStyleIdNames) is type({}), \ 'Not a valid dict [%s] braces)'%lang displaySrc = cfg.Read('displaysrc') lexer = readPyValFromConfig(cfg, 'lexer') keywords = cfg.Read('keywords') cfg.SetPath('') # read in current styles styles = readStylesFromConfig(cfg, groupPrefix) # read in predefined styles predefStyleGroups = {} for group in predefStyleGroupNames: predefStyleGroups[group] = readStylesFromConfig(cfg, group) # read in all other style sections otherLangStyleGroups = {} for group in otherLangStyleGroupNames: otherLangStyleGroups[group] = readStylesFromConfig(cfg, group) return (cfg, commonDefs, styleIdNames, styles, predefStyleGroupNames, predefStyleGroups, otherLangStyleGroupNames, otherLangStyleGroups, displaySrc, lexer, keywords, braceInfo)
name, value = string.split(style, '=') config.Write(name, string.strip(value))
name, value = style.split('=') config.Write(name, value.strip())
def writeStylesToConfig(config, group, styles): config.SetPath('') config.DeleteGroup(group) config.SetPath(group) for style in styles: name, value = string.split(style, '=') config.Write(name, string.strip(value)) config.SetPath('')
from wxPython.help import * app = wxPySimpleApp() provider = wxSimpleHelpProvider() wxHelpProvider_Set(provider) base = os.path.split(__file__)[0] config = os.path.abspath(os.path.join(base, 'stc-styles.rc.cfg'))
app = wx.PySimpleApp() provider = wx.SimpleHelpProvider() wx.HelpProvider.Set(provider) home = os.environ.get('HOME') if home: home = os.path.join(home, '.boa-constructor') if not os.path.exists(home): home = '.' else: home = '.' config = os.path.abspath(os.path.join(home, 'stc-styles.rc.cfg'))
def initSTC(stc, config, lang): """ Main module entry point. Initialise a wxSTC from given config file.""" (cfg, commonDefs, styleIdNames, styles, predefStyleGroupNames, predefStyleGroups, otherLangStyleGroupNames, otherLangStyleGroups, displaySrc, lexer, keywords, braceInfo) = initFromConfig(config, lang) setSTCStyles(stc, styles, styleIdNames, commonDefs, lang, lexer, keywords)
f = wxFrame(None, -1, 'Test frame (double click for editor)') stc = wxStyledTextCtrl(f, -1)
f = wx.Frame(None, -1, 'Test frame (double click for editor)') stc = wx.stc.StyledTextCtrl(f, -1)
def initSTC(stc, config, lang): """ Main module entry point. Initialise a wxSTC from given config file.""" (cfg, commonDefs, styleIdNames, styles, predefStyleGroupNames, predefStyleGroups, otherLangStyleGroupNames, otherLangStyleGroups, displaySrc, lexer, keywords, braceInfo) = initFromConfig(config, lang) setSTCStyles(stc, styles, styleIdNames, commonDefs, lang, lexer, keywords)
EVT_LEFT_DCLICK(stc, OnDblClick)
stc.Bind(wx.EVT_LEFT_DCLICK, OnDblClick)
def OnDblClick(evt, stc=stc): dlg = STCStyleEditDlg(None, 'Python', 'python', config, (stc,)) try: dlg.ShowModal() finally: dlg.Destroy()
self.stdioWin = sys.stdout = sys.stderr = wxPyStdOutWindow()
raise self.error, 'wxPyStdOutWindow not yet implemented.'
def RedirectStdio(self, filename): if filename: sys.stdout = sys.stderr = open(filename, 'a') else: #raise self.error, 'wxPyStdOutWindow not yet implemented.' self.stdioWin = sys.stdout = sys.stderr = wxPyStdOutWindow()
dirflags = '-DWXTOPDIR=%s../' % prefix
topdirflags = '-DWXTOPDIR=%s../' % prefix srcdirflags = ''
def onSubmakefile(type, dirname, names): bakes = [x for x in names if x.endswith('.bkl')] if len(bakes) == 0: return bakes.sort() dirname = dirname.replace(os.sep, '/') depth = dirname.count('/') - 2 if depth <= 0: return if type==SAMPLES_DIR: prefix = ''.join(['../' for i in range(0,depth)]) dirflags = '-DWXTOPDIR=%s../' % prefix cfgbase = '%s../build/msw/config.' % prefix elif type==CONTRIB_DIR: dirflags = '-DSRCDIR=../../src/%s' % dirname.split('/')[-1] dirflags += ' -DWXTOPDIR=../../../' cfgbase = '../../../build/msw/config.' args = { 'all':dirflags, 'autoconf':'-DAUTOCONF_MACROS_FILE=../../autoconf_inc.m4', 'msvc':'-DOPTIONS_FILE='+cfgbase+'vc -DWRITE_OPTIONS_FILE=0', 'mingw':'-DOPTIONS_FILE='+cfgbase+'gcc -DWRITE_OPTIONS_FILE=0', 'borland':'-DOPTIONS_FILE='+cfgbase+'bcc -DWRITE_OPTIONS_FILE=0', 'watcom':'-DOPTIONS_FILE='+cfgbase+'wat -DWRITE_OPTIONS_FILE=0', 'msvc6prj':'$(DSWFLAGS)', } for bake in bakes: if type==CONTRIB_DIR: acdir = '../../contrib/src/%s' % dirname.split('/')[-1] ruledep = '$(CDEPS)' else: acdir = dirname ruledep = '$(SDEPS)' addMakefile('%s/%s' % (dirname, bake), {'all':dirname,'autoconf':acdir}, deps=[ruledep], args=args)
dirflags = '-DSRCDIR=../../src/%s' % dirname.split('/')[-1] dirflags += ' -DWXTOPDIR=../../../'
srcdirflags = '-DSRCDIR=../../src/%s' % dirname.split('/')[-1] topdirflags = ' -DWXTOPDIR=../../../'
def onSubmakefile(type, dirname, names): bakes = [x for x in names if x.endswith('.bkl')] if len(bakes) == 0: return bakes.sort() dirname = dirname.replace(os.sep, '/') depth = dirname.count('/') - 2 if depth <= 0: return if type==SAMPLES_DIR: prefix = ''.join(['../' for i in range(0,depth)]) dirflags = '-DWXTOPDIR=%s../' % prefix cfgbase = '%s../build/msw/config.' % prefix elif type==CONTRIB_DIR: dirflags = '-DSRCDIR=../../src/%s' % dirname.split('/')[-1] dirflags += ' -DWXTOPDIR=../../../' cfgbase = '../../../build/msw/config.' args = { 'all':dirflags, 'autoconf':'-DAUTOCONF_MACROS_FILE=../../autoconf_inc.m4', 'msvc':'-DOPTIONS_FILE='+cfgbase+'vc -DWRITE_OPTIONS_FILE=0', 'mingw':'-DOPTIONS_FILE='+cfgbase+'gcc -DWRITE_OPTIONS_FILE=0', 'borland':'-DOPTIONS_FILE='+cfgbase+'bcc -DWRITE_OPTIONS_FILE=0', 'watcom':'-DOPTIONS_FILE='+cfgbase+'wat -DWRITE_OPTIONS_FILE=0', 'msvc6prj':'$(DSWFLAGS)', } for bake in bakes: if type==CONTRIB_DIR: acdir = '../../contrib/src/%s' % dirname.split('/')[-1] ruledep = '$(CDEPS)' else: acdir = dirname ruledep = '$(SDEPS)' addMakefile('%s/%s' % (dirname, bake), {'all':dirname,'autoconf':acdir}, deps=[ruledep], args=args)
'all':dirflags,
'all':topdirflags, 'not_autoconf':srcdirflags,
def onSubmakefile(type, dirname, names): bakes = [x for x in names if x.endswith('.bkl')] if len(bakes) == 0: return bakes.sort() dirname = dirname.replace(os.sep, '/') depth = dirname.count('/') - 2 if depth <= 0: return if type==SAMPLES_DIR: prefix = ''.join(['../' for i in range(0,depth)]) dirflags = '-DWXTOPDIR=%s../' % prefix cfgbase = '%s../build/msw/config.' % prefix elif type==CONTRIB_DIR: dirflags = '-DSRCDIR=../../src/%s' % dirname.split('/')[-1] dirflags += ' -DWXTOPDIR=../../../' cfgbase = '../../../build/msw/config.' args = { 'all':dirflags, 'autoconf':'-DAUTOCONF_MACROS_FILE=../../autoconf_inc.m4', 'msvc':'-DOPTIONS_FILE='+cfgbase+'vc -DWRITE_OPTIONS_FILE=0', 'mingw':'-DOPTIONS_FILE='+cfgbase+'gcc -DWRITE_OPTIONS_FILE=0', 'borland':'-DOPTIONS_FILE='+cfgbase+'bcc -DWRITE_OPTIONS_FILE=0', 'watcom':'-DOPTIONS_FILE='+cfgbase+'wat -DWRITE_OPTIONS_FILE=0', 'msvc6prj':'$(DSWFLAGS)', } for bake in bakes: if type==CONTRIB_DIR: acdir = '../../contrib/src/%s' % dirname.split('/')[-1] ruledep = '$(CDEPS)' else: acdir = dirname ruledep = '$(SDEPS)' addMakefile('%s/%s' % (dirname, bake), {'all':dirname,'autoconf':acdir}, deps=[ruledep], args=args)
self._setOORandCallbackInfo(PyShapeEvtHandler)
self._setOORandCallbackInfo(PyShape)
def __init__(self, *args, **kwargs): """__init__(self, PyShapeCanvas can=None) -> PyShape""" newobj = _ogl.new_PyShape(*args, **kwargs) self.this = newobj.this self.thisown = 1 del newobj.thisown self._setOORandCallbackInfo(PyShapeEvtHandler)