Commit 22b555c08bd2c8389deff0dd3ee81d365afff518
1 parent
489a5ffe
Exists in
master
and in
2 other branches
Added a tool menu
Showing
1 changed file
with
19 additions
and
15 deletions
Show diff stats
invesalius/gui/frame.py
... | ... | @@ -51,7 +51,7 @@ class MessageWatershed(wx.PopupWindow): |
51 | 51 | def __init__(self, prnt, msg): |
52 | 52 | wx.PopupWindow.__init__(self, prnt, -1) |
53 | 53 | self.txt = wx.StaticText(self, -1, msg) |
54 | - | |
54 | + | |
55 | 55 | self.sizer = wx.BoxSizer(wx.HORIZONTAL) |
56 | 56 | self.sizer.Add(self.txt, 1, wx.EXPAND) |
57 | 57 | self.SetSizer(self.sizer) |
... | ... | @@ -81,10 +81,10 @@ class Frame(wx.Frame): |
81 | 81 | self.SetIcon(wx.Icon(icon_path, wx.BITMAP_TYPE_ICO)) |
82 | 82 | |
83 | 83 | self.mw = None |
84 | - | |
84 | + | |
85 | 85 | if sys.platform != 'darwin': |
86 | 86 | self.Maximize() |
87 | - | |
87 | + | |
88 | 88 | self.sizeChanged = True |
89 | 89 | #Necessary update AUI (statusBar in special) |
90 | 90 | #when maximized in the Win 7 and XP |
... | ... | @@ -381,12 +381,12 @@ class Frame(wx.Frame): |
381 | 381 | elif id == const.ID_START: |
382 | 382 | self.ShowGettingStarted() |
383 | 383 | elif id == const.ID_PREFERENCES: |
384 | - self.ShowPreferences() | |
384 | + self.ShowPreferences() | |
385 | 385 | elif id == const.ID_DICOM_NETWORK: |
386 | - self.ShowRetrieveDicomPanel() | |
386 | + self.ShowRetrieveDicomPanel() | |
387 | 387 | elif id in (const.ID_FLIP_X, const.ID_FLIP_Y, const.ID_FLIP_Z): |
388 | - axis = {const.ID_FLIP_X: 2, | |
389 | - const.ID_FLIP_Y: 1, | |
388 | + axis = {const.ID_FLIP_X: 2, | |
389 | + const.ID_FLIP_Y: 1, | |
390 | 390 | const.ID_FLIP_Z: 0}[id] |
391 | 391 | self.FlipVolume(axis) |
392 | 392 | elif id in (const.ID_SWAP_XY, const.ID_SWAP_XZ, const.ID_SWAP_YZ): |
... | ... | @@ -431,10 +431,10 @@ class Frame(wx.Frame): |
431 | 431 | if self.preferences.ShowModal() == wx.ID_OK: |
432 | 432 | values = self.preferences.GetPreferences() |
433 | 433 | self.preferences.Close() |
434 | - | |
434 | + | |
435 | 435 | ses.Session().rendering = values[const.RENDERING] |
436 | 436 | ses.Session().surface_interpolation = values[const.SURFACE_INTERPOLATION] |
437 | - ses.Session().language = values[const.LANGUAGE] | |
437 | + ses.Session().language = values[const.LANGUAGE] | |
438 | 438 | |
439 | 439 | Publisher.sendMessage('Remove Volume') |
440 | 440 | Publisher.sendMessage('Reset Reaycasting') |
... | ... | @@ -481,7 +481,7 @@ class Frame(wx.Frame): |
481 | 481 | Show save as dialog. |
482 | 482 | """ |
483 | 483 | Publisher.sendMessage('Show save dialog', True) |
484 | - | |
484 | + | |
485 | 485 | def ShowAnalyzeImporter(self): |
486 | 486 | """ |
487 | 487 | Show save as dialog. |
... | ... | @@ -490,12 +490,12 @@ class Frame(wx.Frame): |
490 | 490 | |
491 | 491 | def FlipVolume(self, axis): |
492 | 492 | Publisher.sendMessage('Flip volume', axis) |
493 | - Publisher.sendMessage('Reload actual slice') | |
493 | + Publisher.sendMessage('Reload actual slice') | |
494 | 494 | |
495 | 495 | def SwapAxes(self, axes): |
496 | 496 | Publisher.sendMessage('Swap volume axes', axes) |
497 | 497 | Publisher.sendMessage('Update scroll') |
498 | - Publisher.sendMessage('Reload actual slice') | |
498 | + Publisher.sendMessage('Reload actual slice') | |
499 | 499 | |
500 | 500 | def OnUndo(self): |
501 | 501 | print "Undo" |
... | ... | @@ -561,7 +561,7 @@ class MenuBar(wx.MenuBar): |
561 | 561 | Create all menu and submenus, and add them to self. |
562 | 562 | """ |
563 | 563 | # TODO: This definetely needs improvements... ;) |
564 | - | |
564 | + | |
565 | 565 | #Import Others Files |
566 | 566 | others_file_menu = wx.Menu() |
567 | 567 | others_file_menu.Append(const.ID_ANALYZE_IMPORT, "Analyze") |
... | ... | @@ -604,7 +604,7 @@ class MenuBar(wx.MenuBar): |
604 | 604 | file_edit = wx.Menu() |
605 | 605 | #file_edit.AppendMenu(wx.NewId(), _('Flip'), flip_menu) |
606 | 606 | #file_edit.AppendMenu(wx.NewId(), _('Swap axes'), swap_axes_menu) |
607 | - | |
607 | + | |
608 | 608 | |
609 | 609 | d = const.ICON_DIR |
610 | 610 | if not(sys.platform == 'darwin'): |
... | ... | @@ -630,6 +630,9 @@ class MenuBar(wx.MenuBar): |
630 | 630 | #app(const.ID_EDIT_LIST, "Show Undo List...") |
631 | 631 | ################################################################# |
632 | 632 | |
633 | + # Tool menu | |
634 | + tools_menu = wx.Menu() | |
635 | + | |
633 | 636 | # Mask Menu |
634 | 637 | mask_menu = wx.Menu() |
635 | 638 | self.bool_op_menu = mask_menu.Append(const.ID_BOOLEAN_MASK, _(u"Boolean operations")) |
... | ... | @@ -638,7 +641,7 @@ class MenuBar(wx.MenuBar): |
638 | 641 | self.clean_mask_menu = mask_menu.Append(const.ID_CLEAN_MASK, _(u"Clean Mask\tCtrl+Shift+A")) |
639 | 642 | self.clean_mask_menu.Enable(False) |
640 | 643 | |
641 | - file_edit.AppendMenu(-1, _(u"Mask"), mask_menu) | |
644 | + tools_menu.AppendMenu(-1, _(u"Mask"), mask_menu) | |
642 | 645 | |
643 | 646 | |
644 | 647 | # VIEW |
... | ... | @@ -688,6 +691,7 @@ class MenuBar(wx.MenuBar): |
688 | 691 | # Add all menus to menubar |
689 | 692 | self.Append(file_menu, _("File")) |
690 | 693 | self.Append(file_edit, _("Edit")) |
694 | + self.Append(tools_menu, _(u"Tools")) | |
691 | 695 | #self.Append(view_menu, "View") |
692 | 696 | #self.Append(tools_menu, "Tools") |
693 | 697 | self.Append(options_menu, _("Options")) | ... | ... |