(self, parent, url="", useTimer=True,
timerMillis=DEFAULT_TIMER_MILLIS,
browserSettings=None, hasNavBar=True,
*args, **kwargs)
| 237 | |
| 238 | class ChromeCtrl(wx.Panel): |
| 239 | def __init__(self, parent, url="", useTimer=True, |
| 240 | timerMillis=DEFAULT_TIMER_MILLIS, |
| 241 | browserSettings=None, hasNavBar=True, |
| 242 | *args, **kwargs): |
| 243 | # You also have to set the wx.WANTS_CHARS style for |
| 244 | # all parent panels/controls, if it's deeply embedded. |
| 245 | wx.Panel.__init__(self, parent, style=wx.WANTS_CHARS, *args, **kwargs) |
| 246 | |
| 247 | self.chromeWindow = ChromeWindow(self, url=str(url), useTimer=useTimer, |
| 248 | browserSettings=browserSettings) |
| 249 | sizer = wx.BoxSizer(wx.VERTICAL) |
| 250 | self.navigationBar = None |
| 251 | if hasNavBar: |
| 252 | self.navigationBar = self.CreateNavigationBar() |
| 253 | sizer.Add(self.navigationBar, 0, wx.EXPAND|wx.ALL, 0) |
| 254 | self._InitEventHandlers() |
| 255 | |
| 256 | sizer.Add(self.chromeWindow, 1, wx.EXPAND, 0) |
| 257 | |
| 258 | self.SetSizer(sizer) |
| 259 | self.Fit() |
| 260 | |
| 261 | ch = DefaultClientHandler(self) |
| 262 | self.SetClientHandler(ch) |
| 263 | if self.navigationBar: |
| 264 | self.UpdateButtonsState() |
| 265 | |
| 266 | def _InitEventHandlers(self): |
| 267 | self.navigationBar.backBtn.Bind(wx.EVT_BUTTON, self.OnLeft) |
no test coverage detected