|
1 | 1 | # Encoding: utf-8 |
2 | 2 |
|
3 | 3 | import matplotlib |
| 4 | + |
| 5 | +from cpa.guiutils import create_status_bar |
| 6 | + |
4 | 7 | matplotlib.use('WXAgg') |
5 | 8 |
|
6 | 9 | import matplotlib.pyplot as plt |
@@ -131,11 +134,11 @@ def __init__(self, properties=None, parent=None, id=ID_CLASSIFIER, **kwargs): |
131 | 134 | self.SetMenuBar(self.menuBar) |
132 | 135 | self.CreateMenus() |
133 | 136 |
|
134 | | - self.CreateStatusBar() |
135 | | - |
| 137 | + self.status_bar = create_status_bar(self, force=True) |
136 | 138 | #### Create GUI elements |
137 | 139 | # Top level - three split windows |
138 | 140 | self.splitter = wx.SplitterWindow(self, style=wx.NO_BORDER | wx.SP_3DSASH | wx.SP_LIVE_UPDATE) |
| 141 | + |
139 | 142 | self.fetch_and_rules_panel = wx.Panel(self.splitter) |
140 | 143 | self.bins_splitter = wx.SplitterWindow(self.splitter, style=wx.NO_BORDER | wx.SP_3DSASH | wx.SP_LIVE_UPDATE) |
141 | 144 |
|
@@ -187,7 +190,7 @@ def __init__(self, properties=None, parent=None, id=ID_CLASSIFIER, **kwargs): |
187 | 190 | self.scoreImageBtn = wx.Button(self.find_rules_panel, -1, 'Score Image') |
188 | 191 |
|
189 | 192 | # add sorting class |
190 | | - self.addSortClassBtn = wx.Button(self.GetStatusBar(), -1, "Add new class", style=wx.BU_EXACTFIT) |
| 193 | + self.addSortClassBtn = wx.Button(self.status_bar, -1, "Add new class", style=wx.BU_EXACTFIT) |
191 | 194 |
|
192 | 195 | #### Create Sizers |
193 | 196 | self.fetchSizer = wx.BoxSizer(wx.HORIZONTAL) |
@@ -358,7 +361,7 @@ def __init__(self, properties=None, parent=None, id=ID_CLASSIFIER, **kwargs): |
358 | 361 | self.nNeuronsTxt.Bind(wx.EVT_TEXT, self.ValidateNumberOfNeurons) |
359 | 362 | self.nObjectsTxt.Bind(wx.EVT_TEXT_ENTER, self.OnFetch) |
360 | 363 |
|
361 | | - self.GetStatusBar().Bind(wx.EVT_SIZE, self.status_bar_onsize) |
| 364 | + self.status_bar.Bind(wx.EVT_SIZE, self.status_bar_onsize) |
362 | 365 | wx.CallAfter(self.status_bar_onsize, None) |
363 | 366 |
|
364 | 367 | self.Bind(wx.EVT_MENU, self.OnClose, self.exitMenuItem) |
@@ -391,7 +394,7 @@ def __init__(self, properties=None, parent=None, id=ID_CLASSIFIER, **kwargs): |
391 | 394 | def status_bar_onsize(self, event): |
392 | 395 | # draw the "add sort class..." button in the status bar |
393 | 396 | button = self.addSortClassBtn |
394 | | - width, height = self.GetStatusBar().GetClientSize() |
| 397 | + width, height = self.status_bar.GetClientSize() |
395 | 398 | # diagonal lines drawn on mac, so move let by height. |
396 | 399 | button.SetPosition((width - button.GetSize()[0] - 1 - height, button.GetPosition()[1])) |
397 | 400 |
|
|
0 commit comments