self.SetSizer(sizer)
self.SetAutoLayout(true)
- def __del__(self):
+ EVT_WINDOW_DESTROY(self, self.OnDestroy)
+
+
+ def OnDestroy(self, evt):
if self.pdf:
self.pdf.Cleanup()
self.pdf = None
wxFrame.__init__(self, None, -1, "ActiveX test -- Acrobat", size=(640, 480),
style=wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE)
self.tp = TestPanel(self, sys.stdout)
- EVT_CLOSE(self, self.OnCloseWindow)
-
- def OnCloseWindow(self, event):
-
- self.tp.pdf.Cleanup()
- self.Destroy()
app = wxPySimpleApp()
self.SetAutoLayout(true)
EVT_SIZE(self, self.OnSize)
+ EVT_WINDOW_DESTROY(self, self.OnDestroy)
- def OnSize(self, evt):
- self.Layout()
- def __del__(self):
+ def OnDestroy(self, evt):
if self.ie:
self.ie.Cleanup()
self.ie = None
+
+ def OnSize(self, evt):
+ self.Layout()
+
+
def OnLocationSelect(self, evt):
url = self.location.GetStringSelection()
self.log.write('OnLocationSelect: %s\n' % url)
style=wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE)
self.CreateStatusBar()
self.tp = TestPanel(self, sys.stdout, self)
- EVT_CLOSE(self, self.OnCloseWindow)
-
- def OnCloseWindow(self, event):
- self.tp.ie.Cleanup()
- self.Destroy()
app = wxPySimpleApp()
self.txt.SetFont(font)
self.txt.SetSize(self.txt.GetBestSize())
-
+## st = font.GetNativeFontInfo().ToString()
+## ni2 = wxNativeFontInfo()
+## ni2.FromString(st)
+## font2 = wxFontFromNativeInfo(ni2)
#----------------------------------------------------------------------
-
-
-
-
overview = """\
wxFontEnumerator enumerates either all available fonts on the system or only the ones with given attributes - either only fixed-width (suited for use in programs such as terminal emulators and the like) or the fonts available in the given encoding.
"""
+
+
+if __name__ == '__main__':
+ import sys,os
+ import run
+ run.main(['', os.path.basename(sys.argv[0])])
+
overview = filling.__doc__
+if __name__ == '__main__':
+ import sys,os
+ import run
+ run.main(['', os.path.basename(sys.argv[0])])
+
tree = TestTree(splitter, -1, style = wxTR_HAS_BUTTONS |
wxTR_NO_LINES |
wxTR_ROW_LINES |
+ #wxTR_HIDE_ROOT |
wxNO_BORDER )
valueWindow = TestValueWindow(splitter, -1, style=wxNO_BORDER)
"""
+
+if __name__ == '__main__':
+ import sys,os
+ import run
+ run.main(['', os.path.basename(sys.argv[0])])
+
txt = wxStaticText(self, -1, "Location:")
btnSizer.Add(txt, 0, wxCENTER|wxALL, 2)
- self.location = wxComboBox(self, wxNewId(), "", style=wxCB_DROPDOWN)
+ self.location = wxComboBox(self, wxNewId(), "", style=wxCB_DROPDOWN|wxPROCESS_ENTER)
EVT_COMBOBOX(self, self.location.GetId(), self.OnLocationSelect)
EVT_KEY_UP(self.location, self.OnLocationKey)
EVT_CHAR(self.location, self.IgnoreReturn)
btnSizer.Add(self.location, 1, wxEXPAND|wxALL, 2)
+
sizer.Add(btnSizer, 0, wxEXPAND)
sizer.Add(self.ie, 1, wxEXPAND)
- self.ie.LoadUrl(self.current)
+ self.ie.Navigate(self.current)
self.location.Append(self.current)
self.SetSizer(sizer)
def OnSize(self, evt):
self.Layout()
+
def OnLocationSelect(self, evt):
url = self.location.GetStringSelection()
self.log.write('OnLocationSelect: %s\n' % url)
- self.ie.LoadUrl(url)
+ self.ie.Navigate(url)
def OnLocationKey(self, evt):
if evt.KeyCode() == WXK_RETURN:
URL = self.location.GetValue()
self.location.Append(URL)
- self.ie.LoadUrl(URL)
+ self.ie.Navigate(URL)
else:
evt.Skip()
+
def IgnoreReturn(self, evt):
- print 'IgnoreReturn'
- if evt.KeyCode() != WXK_RETURN:
+ if evt.GetKeyCode() != WXK_RETURN:
evt.Skip()
def OnOpenButton(self, event):
dlg.CentreOnParent()
if dlg.ShowModal() == wxID_OK:
self.current = dlg.GetValue()
- self.ie.LoadUrl(self.current)
+ self.ie.Navigate(self.current)
dlg.Destroy()
def OnHomeButton(self, event):
def logEvt(self, name, event):
self.log.write('%s: %s\n' %
- (name, (event.GetLong1(), event.GetLong2(), event.GetText())))
+ (name, (event.GetLong1(), event.GetLong2(), event.GetText1())))
def OnBeforeNavigate2(self, evt):
self.logEvt('OnBeforeNavigate2', evt)
def OnDocumentComplete(self, evt):
self.logEvt('OnDocumentComplete', evt)
- self.current = evt.GetText()
+ self.current = evt.GetText1()
self.location.SetValue(self.current)
def OnTitleChange(self, evt):
self.logEvt('OnTitleChange', evt)
if self.frame:
- self.frame.SetTitle(self.titleBase + ' -- ' + evt.GetText())
+ self.frame.SetTitle(self.titleBase + ' -- ' + evt.GetText1())
def OnStatusTextChange(self, evt):
self.logEvt('OnStatusTextChange', evt)
if self.frame:
- self.frame.SetStatusText(evt.GetText())
+ self.frame.SetStatusText(evt.GetText1())
#----------------------------------------------------------------------
self.list.SetImageList(self.il, wxIMAGE_LIST_SMALL)
# Why doesn't this show up on MSW???
- self.list.SetToolTip(wxToolTip("This is a ToolTip!"))
+ #self.list.SetToolTip(wxToolTip("This is a ToolTip!"))
if 0:
# for normal, simple columns, you can add them like this:
def OnPopupOne(self, event):
self.log.WriteText("Popup one\n")
+ print "FindItem:", self.list.FindItem(-1, "Billy Joel")
+ print "FindItemData:", self.list.FindItemData(-1, 20)
def OnPopupTwo(self, event):
self.log.WriteText("Popup two\n")
EVT_STC_START_DRAG(self, ID, self.OnStartDrag)
EVT_STC_MODIFIED(self, ID, self.OnModified)
-## EVT_WINDOW_DESTROY(self, self.OnDestroy)
-## def OnDestroy(self, evt):
-## wxTheClipboard.Flush()
-## evt.Skip()
+ EVT_WINDOW_DESTROY(self, self.OnDestroy)
+
+ def OnDestroy(self, evt):
+ # This is how the clipboard contents can be preserved after
+ # the app has exited.
+ wxTheClipboard.Flush()
+ evt.Skip()
def OnStartDrag(self, evt):
ed = p = MySTC(nb, -1, log)
else:
- p = wxPanel(nb, -1)
+ p = wxPanel(nb, -1, style=wxNO_FULL_REPAINT_ON_RESIZE)
ed = MySTC(p, -1, log)
s = wxBoxSizer(wxHORIZONTAL)
s.Add(ed, 1, wxEXPAND)
ed.SetSelection(25, 35)
print "GetSelectedText(): ", repr(ed.GetSelectedText())
print "GetTextRange(25, 35): ", repr(ed.GetTextRange(25, 35))
-
+ print "FindText(0, max, 'indicators'): ",
+ print ed.FindText(0, ed.GetTextLength(), "indicators")
ed.GotoPos(0)
+
return p
l4 = wxStaticText(self, -1, "Rich Text")
t4 = wxTextCtrl(self, 40, "If supported by the native control, this is red, and this is a different font.",
- size=(200, 100), style=wxTE_MULTILINE|wxTE_RICH)
+ size=(200, 100), style=wxTE_MULTILINE|wxTE_RICH2)
t4.SetInsertionPoint(0)
t4.SetStyle(44, 47, wxTextAttr("RED", "YELLOW"))
points = t4.GetFont().GetPointSize() # get the current size
f = wxFont(points+3, wxROMAN, wxITALIC, wxBOLD, true)
-## print 'a1', sys.getrefcount(f)
-## t4.SetStyle(63, 77, wxTextAttr("BLUE", font=f))
t4.SetStyle(63, 77, wxTextAttr("BLUE", wxNullColour, f))
-## print 'a2', sys.getrefcount(f)
bsizer = wxBoxSizer(wxVERTICAL)
bsizer.Add(b, 0, wxGROW)
overview = """\
"""
+
+
+
+
+if __name__ == '__main__':
+ import sys,os
+ import run
+ run.main(['', os.path.basename(sys.argv[0])])
+
self.tree = MyTreeCtrl(self, tID, wxDefaultPosition, wxDefaultSize,
wxTR_HAS_BUTTONS | wxTR_EDIT_LABELS# | wxTR_MULTIPLE
+ #| wxTR_HIDE_ROOT
, self.log)