Home | History | Annotate | Download | only in samples

Lines Matching full:self

31     def __init__(self, parent, log, frame=None):
33 self, parent, -1,
37 self.log = log
38 self.current = "http://wxPython.org/"
39 self.frame = frame
42 self.titleBase = frame.GetTitle()
47 self.webview = wx.webview.WebView(self, -1)
50 btn = wx.Button(self, -1, "Open", style=wx.BU_EXACTFIT)
51 self.Bind(wx.EVT_BUTTON, self.OnOpenButton, btn)
54 btn = wx.Button(self, -1, "<--", style=wx.BU_EXACTFIT)
55 self.Bind(wx.EVT_BUTTON, self.OnPrevPageButton, btn)
58 btn = wx.Button(self, -1, "-->", style=wx.BU_EXACTFIT)
59 self.Bind(wx.EVT_BUTTON, self.OnNextPageButton, btn)
62 btn = wx.Button(self, -1, "Stop", style=wx.BU_EXACTFIT)
63 self.Bind(wx.EVT_BUTTON, self.OnStopButton, btn)
66 btn = wx.Button(self, -1, "Refresh", style=wx.BU_EXACTFIT)
67 self.Bind(wx.EVT_BUTTON, self.OnRefreshPageButton, btn)
70 txt = wx.StaticText(self, -1, "Location:")
73 self.location = wx.ComboBox(
74 self, -1, "", style=wx.CB_DROPDOWN|wx.PROCESS_ENTER
77 self.Bind(wx.EVT_COMBOBOX, self.OnLocationSelect, self.location)
78 self.location.Bind(wx.EVT_KEY_UP, self.OnLocationKey)
79 self.location.Bind(wx.EVT_CHAR, self.IgnoreReturn)
80 btnSizer.Add(self.location, 1, wx.EXPAND|wx.ALL, 2)
83 sizer.Add(self.webview, 1, wx.EXPAND)
85 self.webview.LoadURL(self.current)
86 self.location.Append(self.current)
88 self.webview.Bind(wx.webview.EVT_WEBVIEW_LOAD, self.OnStateChanged)
90 self.SetSizer(sizer)
92 def OnStateChanged(self, event):
93 statusbar = self.GetParent().GetStatusBar()
101 self.location.SetValue(event.GetURL())
102 self.GetParent().SetTitle("wxWebView - " + self.webview.GetPageTitle())
104 def OnLocationKey(self, evt):
106 URL = self.location.GetValue()
107 self.location.Append(URL)
108 self.webview.LoadURL(URL)
112 def IgnoreReturn(self, evt):
116 def OnLocationSelect(self, evt):
117 url = self.location.GetStringSelection()
118 self.webview.LoadURL(url)
120 def OnOpenButton(self, event):
121 dlg = wx.TextEntryDialog(self, "Open Location",
123 self.current, wx.OK|wx.CANCEL)
127 self.current = dlg.GetValue()
128 self.webview.LoadURL(self.current)
132 def OnPrevPageButton(self, event):
133 self.webview.GoBack()
135 def OnNextPageButton(self, event):
136 self.webview.GoForward()
138 def OnStopButton(self, evt):
139 self.webview.Stop()
141 def OnRefreshPageButton(self, evt):
142 self.webview.Reload()
146 def __init__(self):
147 wx.Frame.__init__(self, None, -1, "WebKit in wxPython!")
149 self.panel = TestPanel(self, -1)
150 self.panel.webview.LoadURL("http://www.wxwidgets.org/")
151 self.CreateStatusBar()
154 def OnInit(self):
155 self.webFrame = wkFrame()
156 self.SetTopWindow(self.webFrame)
157 self.webFrame.Show()