Fix some refresh issues
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@23911 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -26,7 +26,8 @@ class EditorFrame(frame.Frame):
|
|||||||
|
|
||||||
def __init__(self, parent=None, id=-1, title='PyAlaCarte',
|
def __init__(self, parent=None, id=-1, title='PyAlaCarte',
|
||||||
pos=wx.DefaultPosition, size=(800, 600),
|
pos=wx.DefaultPosition, size=(800, 600),
|
||||||
style=wx.DEFAULT_FRAME_STYLE, filename=None):
|
style=wx.DEFAULT_FRAME_STYLE | wx.NO_FULL_REPAINT_ON_RESIZE,
|
||||||
|
filename=None):
|
||||||
"""Create EditorFrame instance."""
|
"""Create EditorFrame instance."""
|
||||||
frame.Frame.__init__(self, parent, id, title, pos, size, style)
|
frame.Frame.__init__(self, parent, id, title, pos, size, style)
|
||||||
self.buffers = {}
|
self.buffers = {}
|
||||||
@@ -142,6 +143,7 @@ class EditorFrame(frame.Frame):
|
|||||||
self.bufferDestroy()
|
self.bufferDestroy()
|
||||||
buffer = Buffer()
|
buffer = Buffer()
|
||||||
self.panel = panel = wx.Panel(parent=self, id=-1)
|
self.panel = panel = wx.Panel(parent=self, id=-1)
|
||||||
|
wx.EVT_ERASE_BACKGROUND(panel, lambda x: x)
|
||||||
editor = Editor(parent=panel)
|
editor = Editor(parent=panel)
|
||||||
panel.editor = editor
|
panel.editor = editor
|
||||||
sizer = wx.BoxSizer(wx.VERTICAL)
|
sizer = wx.BoxSizer(wx.VERTICAL)
|
||||||
@@ -153,6 +155,8 @@ class EditorFrame(frame.Frame):
|
|||||||
buffer.open(filename)
|
buffer.open(filename)
|
||||||
self.setEditor(editor)
|
self.setEditor(editor)
|
||||||
self.editor.setFocus()
|
self.editor.setFocus()
|
||||||
|
self.SendSizeEvent()
|
||||||
|
|
||||||
|
|
||||||
def bufferDestroy(self):
|
def bufferDestroy(self):
|
||||||
"""Destroy the current buffer."""
|
"""Destroy the current buffer."""
|
||||||
@@ -164,6 +168,7 @@ class EditorFrame(frame.Frame):
|
|||||||
self.buffer = None
|
self.buffer = None
|
||||||
self.panel.Destroy()
|
self.panel.Destroy()
|
||||||
|
|
||||||
|
|
||||||
def bufferHasChanged(self):
|
def bufferHasChanged(self):
|
||||||
"""Return True if buffer has changed since last save."""
|
"""Return True if buffer has changed since last save."""
|
||||||
if self.buffer:
|
if self.buffer:
|
||||||
@@ -256,7 +261,8 @@ class EditorNotebookFrame(EditorFrame):
|
|||||||
|
|
||||||
def __init__(self, parent=None, id=-1, title='PyAlaMode',
|
def __init__(self, parent=None, id=-1, title='PyAlaMode',
|
||||||
pos=wx.DefaultPosition, size=(800, 600),
|
pos=wx.DefaultPosition, size=(800, 600),
|
||||||
style=wx.DEFAULT_FRAME_STYLE, filename=None):
|
style=wx.DEFAULT_FRAME_STYLE | wx.NO_FULL_REPAINT_ON_RESIZE,
|
||||||
|
filename=None):
|
||||||
"""Create EditorNotebookFrame instance."""
|
"""Create EditorNotebookFrame instance."""
|
||||||
self.notebook = None
|
self.notebook = None
|
||||||
EditorFrame.__init__(self, parent, id, title, pos,
|
EditorFrame.__init__(self, parent, id, title, pos,
|
||||||
@@ -318,6 +324,7 @@ class EditorNotebookFrame(EditorFrame):
|
|||||||
"""Create new buffer."""
|
"""Create new buffer."""
|
||||||
buffer = Buffer()
|
buffer = Buffer()
|
||||||
panel = wx.Panel(parent=self.notebook, id=-1)
|
panel = wx.Panel(parent=self.notebook, id=-1)
|
||||||
|
wx.EVT_ERASE_BACKGROUND(panel, lambda x: x)
|
||||||
editor = Editor(parent=panel)
|
editor = Editor(parent=panel)
|
||||||
panel.editor = editor
|
panel.editor = editor
|
||||||
sizer = wx.BoxSizer(wx.VERTICAL)
|
sizer = wx.BoxSizer(wx.VERTICAL)
|
||||||
@@ -364,7 +371,7 @@ class EditorNotebook(wx.Notebook):
|
|||||||
|
|
||||||
def __init__(self, parent):
|
def __init__(self, parent):
|
||||||
"""Create EditorNotebook instance."""
|
"""Create EditorNotebook instance."""
|
||||||
wx.Notebook.__init__(self, parent, id=-1)
|
wx.Notebook.__init__(self, parent, id=-1, style=wx.NO_FULL_REPAINT_ON_RESIZE)
|
||||||
wx.EVT_NOTEBOOK_PAGE_CHANGING(self, self.GetId(),
|
wx.EVT_NOTEBOOK_PAGE_CHANGING(self, self.GetId(),
|
||||||
self.OnPageChanging)
|
self.OnPageChanging)
|
||||||
wx.EVT_NOTEBOOK_PAGE_CHANGED(self, self.GetId(),
|
wx.EVT_NOTEBOOK_PAGE_CHANGED(self, self.GetId(),
|
||||||
|
Reference in New Issue
Block a user