X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/611dc22ceee63fcfd8b6af38f7f74ba9f3c5a268..80a81a12af49ab6acdaf0b62f4aa55e56f45ac6d:/wxPython/demo/ContextHelp.py diff --git a/wxPython/demo/ContextHelp.py b/wxPython/demo/ContextHelp.py index d66719655c..505d2130f8 100644 --- a/wxPython/demo/ContextHelp.py +++ b/wxPython/demo/ContextHelp.py @@ -1,6 +1,5 @@ from wxPython.wx import * -from wxPython.help import * #---------------------------------------------------------------------- # We first have to set an application-wide help provider. Normally you @@ -27,25 +26,25 @@ class TestPanel(wxPanel): s = wxBoxSizer(wxHORIZONTAL) s.Add(cBtn, 0, wxALL, 5) s.Add(cBtnText, 0, wxALL, 5) - sizer.Add(20,20) + sizer.Add((20,20)) sizer.Add(s) text = wxTextCtrl(self, -1, "Each sub-window can have its own help message", size=(240, 60), style = wxTE_MULTILINE) text.SetHelpText("This is my very own help message. This is a really long long long long long long long long long long long long long long long long long long long long message!") - sizer.Add(20,20) + sizer.Add((20,20)) sizer.Add(text) text = wxTextCtrl(self, -1, "You can also intercept the help event if you like. Watch the log window when you click here...", size=(240, 60), style = wxTE_MULTILINE) text.SetHelpText("Yet another context help message.") - sizer.Add(20,20) + sizer.Add((20,20)) sizer.Add(text) EVT_HELP(text, text.GetId(), self.OnCtxHelp) text = wxTextCtrl(self, -1, "This one displays the tip itself...", size=(240, 60), style = wxTE_MULTILINE) - sizer.Add(20,20) + sizer.Add((20,20)) sizer.Add(text) EVT_HELP(text, text.GetId(), self.OnCtxHelp2) @@ -53,7 +52,7 @@ class TestPanel(wxPanel): border = wxBoxSizer(wxVERTICAL) border.Add(sizer, 0, wxALL, 25) - self.SetAutoLayout(true) + self.SetAutoLayout(True) self.SetSizer(border) self.Layout() @@ -64,7 +63,7 @@ class TestPanel(wxPanel): def OnCtxHelp2(self, evt): - self.log.write("OnCtxHelp: %s" % evt) + self.log.write("OnCtxHelp: %s\n" % evt) tip = wxTipWindow(self, "This is a wxTipWindow") @@ -81,8 +80,8 @@ def runTest(frame, nb, log): overview = """ -This demo shows how to encorporate Context Sensitive -help into your applicaiton using the wxSimpleHelpProvider class. +This demo shows how to incorporate Context Sensitive +help into your application using the wxSimpleHelpProvider class. """ @@ -90,3 +89,10 @@ help into your applicaiton using the wxSimpleHelpProvider class. #---------------------------------------------------------------------- + + +if __name__ == '__main__': + import sys,os + import run + run.main(['', os.path.basename(sys.argv[0])]) +