From c2dac7366ce3bdfaab2d49fc043dceb25b9c0709 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sat, 6 Jul 2002 00:56:57 +0000 Subject: [PATCH] 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 --- wxPython/demo/ActiveXWrapper_IE.py | 50 ++++++++++++++++++------- wxPython/demo/wxIEHtmlWin.py | 7 ++-- wxPython/src/_extras.py | 3 +- wxPython/src/_helpextras.py | 1 - wxPython/src/msw/wx.py | 3 +- wxPython/wxPython/lib/activexwrapper.py | 5 ++- 6 files changed, 47 insertions(+), 22 deletions(-) diff --git a/wxPython/demo/ActiveXWrapper_IE.py b/wxPython/demo/ActiveXWrapper_IE.py index 216825dd29..c91db4d56b 100644 --- a/wxPython/demo/ActiveXWrapper_IE.py +++ b/wxPython/demo/ActiveXWrapper_IE.py @@ -34,7 +34,8 @@ if wxPlatform == '__WXMSW__': class TestPanel(wxWindow): 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.log = log self.current = "http://wxPython.org/" @@ -53,33 +54,45 @@ class TestPanel(wxWindow): eventObj = self) # 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 ") - #EVT_BUTTON(self, btn.GetId(), self.OnOpenButton) - #btnSizer.Add(btn, 0, wxEXPAND|wxALL, 5) + btn = wxButton(self, wxNewId(), "Open", style=wxBU_EXACTFIT) + EVT_BUTTON(self, btn.GetId(), self.OnOpenButton) + 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) - 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) - 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) - 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:") - btnSizer.Add(txt, 0, wxCENTER|wxALL, 5) + btnSizer.Add(txt, 0, wxCENTER|wxALL, 2) self.location = wxComboBox(self, wxNewId(), "", style=wxCB_DROPDOWN) EVT_COMBOBOX(self, self.location.GetId(), self.OnLocationSelect) EVT_KEY_UP(self.location, self.OnLocationKey) 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(self.ie, 1, wxEXPAND) @@ -134,10 +147,19 @@ class TestPanel(wxWindow): def OnPrevPageButton(self, event): self.ie.GoBack() - def OnNextPageButton(self, event): 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 # control since we passed self to MakeActiveXClass. It will look diff --git a/wxPython/demo/wxIEHtmlWin.py b/wxPython/demo/wxIEHtmlWin.py index 12210cf03b..5bdd7191be 100644 --- a/wxPython/demo/wxIEHtmlWin.py +++ b/wxPython/demo/wxIEHtmlWin.py @@ -8,9 +8,10 @@ if wxPlatform == '__WXMSW__': class TestPanel(wxWindow): 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.current = "http://wxPython.org/" + self.current = "http://wxWindows.org/" self.frame = frame if frame: self.titleBase = frame.GetTitle() @@ -19,7 +20,7 @@ class TestPanel(wxWindow): sizer = wxBoxSizer(wxVERTICAL) 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) diff --git a/wxPython/src/_extras.py b/wxPython/src/_extras.py index 5289d06a0e..e802d6d65d 100644 --- a/wxPython/src/_extras.py +++ b/wxPython/src/_extras.py @@ -659,7 +659,8 @@ _wxCallAfterId = None def wxCallAfter(callable, *args, **kw): """ 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() assert app, 'No wxApp created yet' diff --git a/wxPython/src/_helpextras.py b/wxPython/src/_helpextras.py index b925ee0362..c933721561 100644 --- a/wxPython/src/_helpextras.py +++ b/wxPython/src/_helpextras.py @@ -1,4 +1,3 @@ # Stuff these names into the wx namespace so wxPyConstructObject can find them import wx wx.wxHelpEventPtr = wxHelpEventPtr -wx.wxContextMenuEventPtr = wxContextMenuEventPtr diff --git a/wxPython/src/msw/wx.py b/wxPython/src/msw/wx.py index 3ae0ac13d0..671a737189 100644 --- a/wxPython/src/msw/wx.py +++ b/wxPython/src/msw/wx.py @@ -1583,7 +1583,8 @@ _wxCallAfterId = None def wxCallAfter(callable, *args, **kw): """ 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() assert app, 'No wxApp created yet' diff --git a/wxPython/wxPython/lib/activexwrapper.py b/wxPython/wxPython/lib/activexwrapper.py index d7dde4bbda..30ed18ea4f 100644 --- a/wxPython/wxPython/lib/activexwrapper.py +++ b/wxPython/wxPython/lib/activexwrapper.py @@ -87,7 +87,7 @@ def MakeActiveXClass(CoClass, eventClass=None, eventObj=None): def axw__init__(self, parent, ID, pos=wxDefaultPosition, size=wxDefaultSize, style=0): # init base classes 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() 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 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): @@ -132,6 +132,7 @@ def axw_OEB(self, event): def axw_Cleanup(self): del self._wnd self.close() + pass ## anything else???