Commit 705d3adfcb263e770bdcf06d43c088eccfa27bf7
1 parent
5346f067
Exists in
master
and in
68 other branches
ENH: Change icon to selected orientation
Showing
1 changed file
with
9 additions
and
4 deletions
Show diff stats
invesalius/gui/default_viewers.py
| ... | ... | @@ -230,6 +230,7 @@ class VolumeToolPanel(wx.Panel): |
| 230 | 230 | menu.AppendItem(item5) |
| 231 | 231 | menu.AppendItem(item6) |
| 232 | 232 | menu.AppendItem(item7) |
| 233 | + self.menu = menu | |
| 233 | 234 | |
| 234 | 235 | button_position = pbtn.PlateButton(self, wx.ID_ANY,"", FRONT_BMP, |
| 235 | 236 | style=pbtn.PB_STYLE_SQUARE, size=(24,24)) |
| ... | ... | @@ -248,12 +249,16 @@ class VolumeToolPanel(wx.Panel): |
| 248 | 249 | self.SetSizer(sizer) |
| 249 | 250 | sizer.Fit(self) |
| 250 | 251 | |
| 252 | + self.orientations = {0:("FRONT", FRONT_BMP), 1:("BACK", BACK_BMP),\ | |
| 253 | + 2:("TOP",TOP_BMP), 3:("BOTTOM",BOTTOM_BMP),\ | |
| 254 | + 4:("RIGHT",RIGHT_BMP), 5:("LEFT", LEFT_BMP),\ | |
| 255 | + 6:("ISOMETRIC",ISOMETRIC_BMP)} | |
| 256 | + | |
| 251 | 257 | def OnMenu(self, evt): |
| 252 | - values = {0:"FRONT", 1:"BACK", 2:"TOP",\ | |
| 253 | - 3:"BOTTOM", 4:"RIGHT", 5:"LEFT",\ | |
| 254 | - 6:"ISOMETRIC"} | |
| 258 | + | |
| 259 | + self.button_position.SetBitmapSelected(self.orientations[evt.GetId()][1]) | |
| 255 | 260 | ps.Publisher().sendMessage('Reposition Actor',\ |
| 256 | - values[evt.GetId()]) | |
| 261 | + self.orientations[evt.GetId()][0]) | |
| 257 | 262 | |
| 258 | 263 | def OnSelectColour(self, evt): |
| 259 | 264 | colour = c = [i/255.0 for i in evt.GetValue()] | ... | ... |