Commit a74def232852647a63a397faeb37634a842e855d
1 parent
50153a5a
Exists in
master
and in
68 other branches
ENH: Update generic task
Showing
1 changed file
with
40 additions
and
3 deletions
Show diff stats
invesalius/gui/task_generic.py
@@ -20,7 +20,44 @@ | @@ -20,7 +20,44 @@ | ||
20 | import wx | 20 | import wx |
21 | 21 | ||
22 | class TaskPanel(wx.Panel): | 22 | class TaskPanel(wx.Panel): |
23 | + """ | ||
24 | + This panel works as a "frame", drawing a white margin arround | ||
25 | + the panel that really matters (InnerTaskPanel). | ||
26 | + """ | ||
23 | def __init__(self, parent): | 27 | def __init__(self, parent): |
24 | - wx.Panel.__init__(self, parent, pos=wx.Point(0, 50), size=wx.Size(256, 120)) | ||
25 | - self.SetBackgroundColour(wx.Colour(221, 221, 221, 255)) | ||
26 | - | ||
27 | \ No newline at end of file | 28 | \ No newline at end of file |
29 | + # note: don't change this class!!! | ||
30 | + wx.Panel.__init__(self, parent) | ||
31 | + | ||
32 | + sizer = wx.BoxSizer(wx.HORIZONTAL) | ||
33 | + sizer.Add(InnerTaskPanel(self), 1, wx.EXPAND | wx.GROW | | ||
34 | + wx.BOTTOM | wx.RIGHT | wx.LEFT, 7) | ||
35 | + sizer.Fit(self) | ||
36 | + | ||
37 | + self.SetSizer(sizer) | ||
38 | + self.Update() | ||
39 | + self.SetAutoLayout(1) | ||
40 | + | ||
41 | +class InnerTaskPanel(wx.Panel): | ||
42 | + | ||
43 | + def __init__(self, parent): | ||
44 | + wx.Panel.__init__(self, parent) | ||
45 | + self.SetBackgroundColour(wx.Colour(255,255,255)) | ||
46 | + self.SetAutoLayout(1) | ||
47 | + | ||
48 | + # Bind events | ||
49 | + self.__bind_events() | ||
50 | + self.__bind_wx_events() | ||
51 | + | ||
52 | + def __bind_events(self): | ||
53 | + """ | ||
54 | + Bind pubsube events | ||
55 | + """ | ||
56 | + # Example: ps.Publisher().subscribe("Test") | ||
57 | + pass | ||
58 | + | ||
59 | + def __bind_wx_events(self): | ||
60 | + """ | ||
61 | + Bind wx general events | ||
62 | + """ | ||
63 | + # Example: self.Bind(wx.EVT_BUTTON, self.OnButton) | ||
64 | + pass |