Usability fixes for the demo
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@18749 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -107,6 +107,12 @@ class TestPanel(wxWindow):
|
|||||||
EVT_WINDOW_DESTROY(self, self.OnDestroy)
|
EVT_WINDOW_DESTROY(self, self.OnDestroy)
|
||||||
|
|
||||||
|
|
||||||
|
def ShutdownDemo(self):
|
||||||
|
# put the frame title back
|
||||||
|
if self.frame:
|
||||||
|
self.frame.SetTitle(self.titleBase)
|
||||||
|
|
||||||
|
|
||||||
def OnDestroy(self, evt):
|
def OnDestroy(self, evt):
|
||||||
if self.ie:
|
if self.ie:
|
||||||
self.ie.Cleanup()
|
self.ie.Cleanup()
|
||||||
|
@@ -3,6 +3,9 @@
|
|||||||
from wxPython.wx import *
|
from wxPython.wx import *
|
||||||
from wxScrolledWindow import MyCanvas
|
from wxScrolledWindow import MyCanvas
|
||||||
|
|
||||||
|
import images
|
||||||
|
SHOW_BACKGROUND = 1
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
class MyParentFrame(wxMDIParentFrame):
|
class MyParentFrame(wxMDIParentFrame):
|
||||||
@@ -24,6 +27,10 @@ class MyParentFrame(wxMDIParentFrame):
|
|||||||
EVT_MENU(self, 5000, self.OnNewWindow)
|
EVT_MENU(self, 5000, self.OnNewWindow)
|
||||||
EVT_MENU(self, 5001, self.OnExit)
|
EVT_MENU(self, 5001, self.OnExit)
|
||||||
|
|
||||||
|
if SHOW_BACKGROUND:
|
||||||
|
self.bg_bmp = images.getGridBGBitmap()
|
||||||
|
EVT_ERASE_BACKGROUND(self.GetClientWindow(), self.OnEraseBackground)
|
||||||
|
|
||||||
|
|
||||||
def OnExit(self, evt):
|
def OnExit(self, evt):
|
||||||
self.Close(true)
|
self.Close(true)
|
||||||
@@ -36,6 +43,24 @@ class MyParentFrame(wxMDIParentFrame):
|
|||||||
win.Show(true)
|
win.Show(true)
|
||||||
|
|
||||||
|
|
||||||
|
def OnEraseBackground(self, evt):
|
||||||
|
dc = evt.GetDC()
|
||||||
|
if not dc:
|
||||||
|
dc = wxClientDC(self.GetClientWindow())
|
||||||
|
|
||||||
|
# tile the background bitmap
|
||||||
|
sz = self.GetClientSize()
|
||||||
|
w = self.bg_bmp.GetWidth()
|
||||||
|
h = self.bg_bmp.GetHeight()
|
||||||
|
x = 0
|
||||||
|
while x < sz.width:
|
||||||
|
y = 0
|
||||||
|
while y < sz.height:
|
||||||
|
dc.DrawBitmap(self.bg_bmp, x, y)
|
||||||
|
y = y + h
|
||||||
|
x = x + w
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
@@ -161,7 +161,7 @@ _treeList = [
|
|||||||
]),
|
]),
|
||||||
|
|
||||||
# Images
|
# Images
|
||||||
('Images', [
|
('Using Images', [
|
||||||
'Throbber',
|
'Throbber',
|
||||||
'wxDragImage',
|
'wxDragImage',
|
||||||
'wxImage',
|
'wxImage',
|
||||||
|
@@ -68,11 +68,13 @@ class TestHtmlPanel(wxPanel):
|
|||||||
self.cwd = os.path.split(sys.argv[0])[0]
|
self.cwd = os.path.split(sys.argv[0])[0]
|
||||||
if not self.cwd:
|
if not self.cwd:
|
||||||
self.cwd = os.getcwd()
|
self.cwd = os.getcwd()
|
||||||
|
if frame:
|
||||||
|
self.titleBase = frame.GetTitle()
|
||||||
|
|
||||||
wxHtmlWindow_AddFilter(MyHtmlFilter(log))
|
wxHtmlWindow_AddFilter(MyHtmlFilter(log))
|
||||||
|
|
||||||
self.html = MyHtmlWindow(self, -1, log)
|
self.html = MyHtmlWindow(self, -1, log)
|
||||||
self.html.SetRelatedFrame(frame, "wxPython: (A Demonstration) -- %s")
|
self.html.SetRelatedFrame(frame, self.titleBase + " -- %s")
|
||||||
self.html.SetRelatedStatusBar(0)
|
self.html.SetRelatedStatusBar(0)
|
||||||
|
|
||||||
self.printer = wxHtmlEasyPrinting()
|
self.printer = wxHtmlEasyPrinting()
|
||||||
@@ -120,6 +122,11 @@ class TestHtmlPanel(wxPanel):
|
|||||||
self.OnShowDefault(None)
|
self.OnShowDefault(None)
|
||||||
|
|
||||||
|
|
||||||
|
def ShutdownDemo(self):
|
||||||
|
# put the frame title back
|
||||||
|
if self.frame:
|
||||||
|
self.frame.SetTitle(self.titleBase)
|
||||||
|
|
||||||
|
|
||||||
def OnShowDefault(self, event):
|
def OnShowDefault(self, event):
|
||||||
name = os.path.join(self.cwd, opj('data/test.htm'))
|
name = os.path.join(self.cwd, opj('data/test.htm'))
|
||||||
|
@@ -80,6 +80,12 @@ class TestPanel(wxWindow):
|
|||||||
EVT_MSHTML_TITLECHANGE(self, -1, self.OnTitleChange)
|
EVT_MSHTML_TITLECHANGE(self, -1, self.OnTitleChange)
|
||||||
|
|
||||||
|
|
||||||
|
def ShutdownDemo(self):
|
||||||
|
# put the frame title back
|
||||||
|
if self.frame:
|
||||||
|
self.frame.SetTitle(self.titleBase)
|
||||||
|
|
||||||
|
|
||||||
def OnSize(self, evt):
|
def OnSize(self, evt):
|
||||||
self.Layout()
|
self.Layout()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user