A few other tweaks, reduced some flicker in the demo, and etc...

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16055 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2002-07-06 00:56:57 +00:00
parent 763d71e442
commit c2dac7366c
6 changed files with 47 additions and 22 deletions

View File

@@ -34,7 +34,8 @@ if wxPlatform == '__WXMSW__':
class TestPanel(wxWindow): class TestPanel(wxWindow):
def __init__(self, parent, log, frame=None): def __init__(self, parent, log, frame=None):
wxWindow.__init__(self, parent, -1)#, style=wxCLIP_CHILDREN) wxWindow.__init__(self, parent, -1,
style=wxCLIP_CHILDREN|wxNO_FULL_REPAINT_ON_RESIZE)
self.ie = None self.ie = None
self.log = log self.log = log
self.current = "http://wxPython.org/" self.current = "http://wxPython.org/"
@@ -53,33 +54,45 @@ class TestPanel(wxWindow):
eventObj = self) eventObj = self)
# Create an instance of that class # Create an instance of that class
self.ie = theClass(self, -1, style=wxSUNKEN_BORDER) self.ie = theClass(self, -1) ##, style=wxSUNKEN_BORDER)
#btn = wxButton(self, wxNewId(), " Open ") btn = wxButton(self, wxNewId(), "Open", style=wxBU_EXACTFIT)
#EVT_BUTTON(self, btn.GetId(), self.OnOpenButton) EVT_BUTTON(self, btn.GetId(), self.OnOpenButton)
#btnSizer.Add(btn, 0, wxEXPAND|wxALL, 5) btnSizer.Add(btn, 0, wxEXPAND|wxALL, 2)
btn = wxButton(self, wxNewId(), " Home ") btn = wxButton(self, wxNewId(), "Home", style=wxBU_EXACTFIT)
EVT_BUTTON(self, btn.GetId(), self.OnHomeButton) EVT_BUTTON(self, btn.GetId(), self.OnHomeButton)
btnSizer.Add(btn, 0, wxEXPAND|wxALL, 5) btnSizer.Add(btn, 0, wxEXPAND|wxALL, 2)
btn = wxButton(self, wxNewId(), " <-- ") btn = wxButton(self, wxNewId(), "<--", style=wxBU_EXACTFIT)
EVT_BUTTON(self, btn.GetId(), self.OnPrevPageButton) EVT_BUTTON(self, btn.GetId(), self.OnPrevPageButton)
btnSizer.Add(btn, 0, wxEXPAND|wxALL, 5) btnSizer.Add(btn, 0, wxEXPAND|wxALL, 2)
btn = wxButton(self, wxNewId(), " --> ") btn = wxButton(self, wxNewId(), "-->", style=wxBU_EXACTFIT)
EVT_BUTTON(self, btn.GetId(), self.OnNextPageButton) EVT_BUTTON(self, btn.GetId(), self.OnNextPageButton)
btnSizer.Add(btn, 0, wxEXPAND|wxALL, 5) btnSizer.Add(btn, 0, wxEXPAND|wxALL, 2)
btn = wxButton(self, wxNewId(), "Stop", style=wxBU_EXACTFIT)
EVT_BUTTON(self, btn.GetId(), self.OnStopButton)
btnSizer.Add(btn, 0, wxEXPAND|wxALL, 2)
btn = wxButton(self, wxNewId(), "Search", style=wxBU_EXACTFIT)
EVT_BUTTON(self, btn.GetId(), self.OnSearchPageButton)
btnSizer.Add(btn, 0, wxEXPAND|wxALL, 2)
btn = wxButton(self, wxNewId(), "Refresh", style=wxBU_EXACTFIT)
EVT_BUTTON(self, btn.GetId(), self.OnRefreshPageButton)
btnSizer.Add(btn, 0, wxEXPAND|wxALL, 2)
txt = wxStaticText(self, -1, "Location:") txt = wxStaticText(self, -1, "Location:")
btnSizer.Add(txt, 0, wxCENTER|wxALL, 5) btnSizer.Add(txt, 0, wxCENTER|wxALL, 2)
self.location = wxComboBox(self, wxNewId(), "", style=wxCB_DROPDOWN) self.location = wxComboBox(self, wxNewId(), "", style=wxCB_DROPDOWN)
EVT_COMBOBOX(self, self.location.GetId(), self.OnLocationSelect) EVT_COMBOBOX(self, self.location.GetId(), self.OnLocationSelect)
EVT_KEY_UP(self.location, self.OnLocationKey) EVT_KEY_UP(self.location, self.OnLocationKey)
EVT_CHAR(self.location, self.IgnoreReturn) EVT_CHAR(self.location, self.IgnoreReturn)
btnSizer.Add(self.location, 1, wxEXPAND|wxALL, 5) btnSizer.Add(self.location, 1, wxEXPAND|wxALL, 2)
sizer.Add(btnSizer, 0, wxEXPAND) sizer.Add(btnSizer, 0, wxEXPAND)
sizer.Add(self.ie, 1, wxEXPAND) sizer.Add(self.ie, 1, wxEXPAND)
@@ -134,10 +147,19 @@ class TestPanel(wxWindow):
def OnPrevPageButton(self, event): def OnPrevPageButton(self, event):
self.ie.GoBack() self.ie.GoBack()
def OnNextPageButton(self, event): def OnNextPageButton(self, event):
self.ie.GoForward() self.ie.GoForward()
def OnStopButton(self, evt):
self.ie.Stop()
def OnSearchPageButton(self, evt):
self.ie.GoSearch()
def OnRefreshPageButton(self, evt):
self.ie.Refresh2(3)
# The following event handlers are called by the web browser COM # The following event handlers are called by the web browser COM
# control since we passed self to MakeActiveXClass. It will look # control since we passed self to MakeActiveXClass. It will look

View File

@@ -8,9 +8,10 @@ if wxPlatform == '__WXMSW__':
class TestPanel(wxWindow): class TestPanel(wxWindow):
def __init__(self, parent, log, frame=None): def __init__(self, parent, log, frame=None):
wxWindow.__init__(self, parent, -1, style=wxCLIP_CHILDREN) wxWindow.__init__(self, parent, -1,
style=wxCLIP_CHILDREN|wxNO_FULL_REPAINT_ON_RESIZE)
self.log = log self.log = log
self.current = "http://wxPython.org/" self.current = "http://wxWindows.org/"
self.frame = frame self.frame = frame
if frame: if frame:
self.titleBase = frame.GetTitle() self.titleBase = frame.GetTitle()
@@ -19,7 +20,7 @@ class TestPanel(wxWindow):
sizer = wxBoxSizer(wxVERTICAL) sizer = wxBoxSizer(wxVERTICAL)
btnSizer = wxBoxSizer(wxHORIZONTAL) btnSizer = wxBoxSizer(wxHORIZONTAL)
self.ie = wxIEHtmlWin(self, -1) ##, style=wxSUNKEN_BORDER) self.ie = wxIEHtmlWin(self, -1, style = wxNO_FULL_REPAINT_ON_RESIZE)
btn = wxButton(self, wxNewId(), "Open", style=wxBU_EXACTFIT) btn = wxButton(self, wxNewId(), "Open", style=wxBU_EXACTFIT)

View File

@@ -659,7 +659,8 @@ _wxCallAfterId = None
def wxCallAfter(callable, *args, **kw): def wxCallAfter(callable, *args, **kw):
""" """
Call the specified function after the current and pending event Call the specified function after the current and pending event
handlers have been completed. handlers have been completed. This is also good for making GUI
method calls from non-GUI threads.
""" """
app = wxGetApp() app = wxGetApp()
assert app, 'No wxApp created yet' assert app, 'No wxApp created yet'

View File

@@ -1,4 +1,3 @@
# Stuff these names into the wx namespace so wxPyConstructObject can find them # Stuff these names into the wx namespace so wxPyConstructObject can find them
import wx import wx
wx.wxHelpEventPtr = wxHelpEventPtr wx.wxHelpEventPtr = wxHelpEventPtr
wx.wxContextMenuEventPtr = wxContextMenuEventPtr

View File

@@ -1583,7 +1583,8 @@ _wxCallAfterId = None
def wxCallAfter(callable, *args, **kw): def wxCallAfter(callable, *args, **kw):
""" """
Call the specified function after the current and pending event Call the specified function after the current and pending event
handlers have been completed. handlers have been completed. This is also good for making GUI
method calls from non-GUI threads.
""" """
app = wxGetApp() app = wxGetApp()
assert app, 'No wxApp created yet' assert app, 'No wxApp created yet'

View File

@@ -87,7 +87,7 @@ def MakeActiveXClass(CoClass, eventClass=None, eventObj=None):
def axw__init__(self, parent, ID, pos=wxDefaultPosition, size=wxDefaultSize, style=0): def axw__init__(self, parent, ID, pos=wxDefaultPosition, size=wxDefaultSize, style=0):
# init base classes # init base classes
pywin.mfc.activex.Control.__init__(self) pywin.mfc.activex.Control.__init__(self)
wxWindow.__init__(self, parent, -1, pos, size, style) wxWindow.__init__(self, parent, -1, pos, size, style|wxNO_FULL_REPAINT_ON_RESIZE)
win32ui.EnableControlContainer() win32ui.EnableControlContainer()
self._eventObj = self._eventObj # move from class to instance self._eventObj = self._eventObj # move from class to instance
@@ -106,7 +106,7 @@ def axw__init__(self, parent, ID, pos=wxDefaultPosition, size=wxDefaultSize, sty
# hook some wx events # hook some wx events
EVT_SIZE(self, self.axw_OnSize) EVT_SIZE(self, self.axw_OnSize)
EVT_ERASE_BACKGROUND(self, self.axw_OEB) #EVT_ERASE_BACKGROUND(self, self.axw_OEB)
def axw__getattr__(self, attr): def axw__getattr__(self, attr):
@@ -132,6 +132,7 @@ def axw_OEB(self, event):
def axw_Cleanup(self): def axw_Cleanup(self):
del self._wnd del self._wnd
self.close() self.close()
pass
## anything else??? ## anything else???