-
Notifications
You must be signed in to change notification settings - Fork 19
/
PropPanel.py
82 lines (63 loc) · 2.2 KB
/
PropPanel.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# -*- coding: utf-8 -*-
## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
# PropPanel.py ---
# --------------------------------
# Copyright (c) 2013
# Laurent CAPOCCHI
# University of Corsica
# --------------------------------
# Version 1.0 last modified: 27/02/2014
## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
#
# GENERAL NOTES AND REMARKS:
#
## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
#
# GLOBAL VARIABLES AND FUNCTIONS
#
## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
import wx
_ = wx.GetTranslation
class PropPanel(wx.Panel):
"""
"""
def __init__(self, parent, name):
wx.Panel.__init__(self, parent=parent, id=wx.NewIdRef(), name=name)
self.frame = parent
propSizer = wx.BoxSizer(wx.VERTICAL)
propSizer.Add(self.defaultPropertiesPage(), 1, wx.EXPAND|wx.ALL, 10)
self.SetAutoLayout(True)
self.SetSizerAndFit(propSizer)
self.Layout()
self.SetBackgroundColour(wx.WHITE)
self.__set_tips()
def defaultPropertiesPage(self):
"""
"""
propContent = wx.StaticText(self, wx.NewIdRef(), _("Select a model from diagram \n to see their properties."))
sum_font = propContent.GetFont()
sum_font.SetWeight(700)
propContent.SetFont(sum_font)
return propContent
def UpdatePropertiesPage(self, panel=None):
""" Update the propPanel with the new panel parameter of the model.
"""
sizer = self.GetSizer()
if wx.VERSION_STRING < '4.0':
sizer.DeleteWindows()
else:
sizer.Clear(True)
sizer.Add(panel, 1, wx.EXPAND|wx.ALL, 10)
self.SetSizerAndFit(sizer)
self.Layout()
if wx.VERSION_STRING > '4.0':
self.frame.Layout()
def __set_tips(self):
"""
"""
self.propToolTip =[_("No model selected.\nChoose a model to show in this panel its properties."),_("You can change the properties by editing the cell.")]
if wx.VERSION_STRING < '4.0':
self.SetToolTipString(self.propToolTip[0])
else:
self.SetToolTip(self.propToolTip[0])