--- a/c_ext/CFileEditor.py Tue May 14 18:43:52 2013 +0200
+++ b/c_ext/CFileEditor.py Tue May 14 20:16:07 2013 +0200
@@ -36,18 +36,9 @@
class CFileEditor(CodeFileEditor):
- CONFNODEEDITOR_TABS = CodeFileEditor.CONFNODEEDITOR_TABS + [
- (_("C code"), "_create_CCodeEditor")]
- def _create_CCodeEditor(self, prnt):
- self.CCodeEditor = CppEditor(prnt, self.ParentWindow, self.Controler)
- return self.CCodeEditor
+ CONFNODEEDITOR_TABS = [ + (_("C code"), "_create_CodePanel")] + CODE_EDITOR = CppEditor
- CodeFileEditor.RefreshView(self)
- self.CCodeEditor.RefreshView()
- def Find(self, direction, search_params):
- self.CCodeEditor.Find(direction, search_params)
--- a/editors/CodeFileEditor.py Tue May 14 18:43:52 2013 +0200
+++ b/editors/CodeFileEditor.py Tue May 14 20:16:07 2013 +0200
@@ -172,8 +172,21 @@
def OnDoDrop(self, event):
- wx.CallAfter(self.RefreshModel)
+ values = eval(event.GetDragText()) + values = event.GetDragText() + if isinstance(values, tuple): + if values[3] == self.Controler.GetCurrentLocation(): + event.SetDragText(values[0]) + wx.CallAfter(self.RefreshModel) + wx.CallAfter(self.RefreshModel) # Buffer the last model state
@@ -731,9 +744,8 @@
data_type = self.Table.GetValueByName(row, "Type")
var_name = self.Table.GetValueByName(row, "Name")
- location = "_".join(map(lambda x:str(x), self.Controler.GetCurrentLocation()))
- data = wx.TextDataObject(str(("%s_%s" % (var_name, location),
- "Global", data_type, "")))
+ data = wx.TextDataObject(str((var_name, "Global", data_type, + self.Controler.GetCurrentLocation()))) dragSource = wx.DropSource(self.VariablesGrid)
@@ -747,16 +759,31 @@
class CodeFileEditor(ConfTreeNodeEditor):
- CONFNODEEDITOR_TABS = [
- (_("Variables"), "_create_VariablesPanel")]
+ CONFNODEEDITOR_TABS = [] - def _create_VariablesPanel(self, prnt):
- self.VariablesPanel = VariablesEditor(prnt, self.ParentWindow, self.Controler)
+ def _create_CodePanel(self, prnt): + self.CodeEditorPanel = wx.SplitterWindow(prnt) + self.CodeEditorPanel.SetMinimumPaneSize(1) + self.VariablesPanel = VariablesEditor(self.CodeEditorPanel, + self.ParentWindow, self.Controler) - return self.VariablesPanel
+ if self.CODE_EDITOR is not None: + self.CodeEditor = self.CODE_EDITOR(self.CodeEditorPanel, + self.ParentWindow, self.Controler) + self.CodeEditorPanel.SplitHorizontally(self.VariablesPanel, + self.CodeEditorPanel.Initialize(self.VariablesPanel) + return self.CodeEditorPanel def __init__(self, parent, controler, window):
ConfTreeNodeEditor.__init__(self, parent, controler, window)
+ wx.CallAfter(self.CodeEditorPanel.SetSashPosition, 150) def GetBufferState(self):
return self.Controler.GetBufferState()
@@ -773,4 +800,8 @@
ConfTreeNodeEditor.RefreshView(self)
self.VariablesPanel.RefreshView()
\ No newline at end of file
+ self.CodeEditor.RefreshView() + def Find(self, direction, search_params): + self.CodeEditor.Find(direction, search_params) \ No newline at end of file
--- a/py_ext/PythonEditor.py Tue May 14 18:43:52 2013 +0200
+++ b/py_ext/PythonEditor.py Tue May 14 20:16:07 2013 +0200
@@ -53,18 +53,7 @@
class PythonEditor(CodeFileEditor):
- CONFNODEEDITOR_TABS = CodeFileEditor.CONFNODEEDITOR_TABS + [
- (_("Python code"), "_create_PythonCodeEditor")]
- def _create_PythonCodeEditor(self, prnt):
- self.PythonCodeEditor = PythonCodeEditor(prnt, self.ParentWindow, self.Controler)
- return self.PythonCodeEditor
+ CONFNODEEDITOR_TABS = [ + (_("Python code"), "_create_CodePanel")] + CODE_EDITOR = PythonCodeEditor
- CodeFileEditor.RefreshView(self)
- self.PythonCodeEditor.RefreshView()
- def Find(self, direction, search_params):
- self.PythonCodeEditor.Find(direction, search_params)