author | laurent |
Wed, 23 May 2012 12:19:53 +0200 | |
changeset 749 | 050f5a001826 |
parent 746 | 2e09777a40d3 |
child 756 | 35cd28825be7 |
permissions | -rw-r--r-- |
738 | 1 |
|
2 |
import wx |
|
3 |
||
746
2e09777a40d3
Fix refresh of ConfTreeNodeEditors content when values change
laurent
parents:
743
diff
changeset
|
4 |
from controls import EditorPanel |
738 | 5 |
from ConfTreeNodeEditor import ConfTreeNodeEditor, WINDOW_COLOUR |
6 |
||
7 |
class ProjectNodeEditor(ConfTreeNodeEditor): |
|
8 |
||
9 |
VARIABLE_PANEL_TYPE = "config" |
|
10 |
||
11 |
def _init_Editor(self, prnt): |
|
12 |
self.Editor = wx.ScrolledWindow(prnt, -1, size=wx.Size(-1, -1), |
|
13 |
style=wx.TAB_TRAVERSAL|wx.SUNKEN_BORDER|wx.HSCROLL|wx.VSCROLL) |
|
14 |
self.Editor.SetBackgroundColour(WINDOW_COLOUR) |
|
743 | 15 |
self.Editor.Bind(wx.EVT_SIZE, self.OnWindowResize) |
16 |
self.Editor.Bind(wx.EVT_MOUSEWHEEL, self.OnMouseWheel) |
|
738 | 17 |
self.ParamsEditor = self.Editor |
18 |
||
19 |
# Variable allowing disabling of Editor scroll when Popup shown |
|
20 |
self.ScrollingEnabled = True |
|
21 |
||
22 |
self.ParamsEditorSizer = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=5) |
|
23 |
self.ParamsEditorSizer.AddGrowableCol(0) |
|
24 |
self.ParamsEditorSizer.AddGrowableRow(1) |
|
25 |
||
26 |
self.Editor.SetSizer(self.ParamsEditorSizer) |
|
27 |
||
28 |
||
29 |
buttons_sizer = self.GenerateMethodButtonSizer() |
|
30 |
self.ParamsEditorSizer.AddSizer(buttons_sizer, 0, border=5, |
|
31 |
flag=wx.GROW|wx.LEFT|wx.RIGHT|wx.TOP) |
|
32 |
||
33 |
self.ConfNodeParamsSizer = wx.BoxSizer(wx.VERTICAL) |
|
34 |
self.ParamsEditorSizer.AddSizer(self.ConfNodeParamsSizer, 0, border=5, |
|
35 |
flag=wx.LEFT|wx.RIGHT|wx.BOTTOM) |
|
36 |
||
37 |
def __init__(self, parent, controler, window): |
|
38 |
configuration = controler.GetProjectMainConfigurationName() |
|
39 |
if configuration is not None: |
|
40 |
tagname = controler.ComputeConfigurationName(configuration) |
|
41 |
else: |
|
42 |
tagname = "" |
|
43 |
||
743 | 44 |
ConfTreeNodeEditor.__init__(self, parent, controler, window, tagname) |
738 | 45 |
|
46 |
def GetTagName(self): |
|
47 |
return self.Controler.CTNName() |
|
48 |
||
49 |
def GetTitle(self): |
|
50 |
fullname = self.Controler.CTNName() |
|
51 |
if self.Controler.CTNTestModified(): |
|
52 |
return "~%s~" % fullname |
|
53 |
return fullname |
|
746
2e09777a40d3
Fix refresh of ConfTreeNodeEditors content when values change
laurent
parents:
743
diff
changeset
|
54 |
|
2e09777a40d3
Fix refresh of ConfTreeNodeEditors content when values change
laurent
parents:
743
diff
changeset
|
55 |
def RefreshView(self): |
2e09777a40d3
Fix refresh of ConfTreeNodeEditors content when values change
laurent
parents:
743
diff
changeset
|
56 |
EditorPanel.RefreshView(self) |
2e09777a40d3
Fix refresh of ConfTreeNodeEditors content when values change
laurent
parents:
743
diff
changeset
|
57 |
self.RefreshConfNodeParamsSizer() |
738 | 58 |
|
59 |