Commit ae2012a4d7eb732e15b9a5d6c483dc5d03a6cc15
1 parent
93044664
Exists in
master
and in
68 other branches
ENH: Changed project toolbari to aui
Showing
1 changed file
with
15 additions
and
25 deletions
Show diff stats
invesalius/gui/frame.py
| @@ -20,6 +20,7 @@ import sys | @@ -20,6 +20,7 @@ import sys | ||
| 20 | 20 | ||
| 21 | import wx | 21 | import wx |
| 22 | import wx.aui | 22 | import wx.aui |
| 23 | +import wx.lib.agw.aui as aui | ||
| 23 | import wx.lib.pubsub as ps | 24 | import wx.lib.pubsub as ps |
| 24 | import math | 25 | import math |
| 25 | 26 | ||
| @@ -292,10 +293,11 @@ class TaskBarIcon(wx.TaskBarIcon): | @@ -292,10 +293,11 @@ class TaskBarIcon(wx.TaskBarIcon): | ||
| 292 | 293 | ||
| 293 | # ------------------------------------------------------------------------------ | 294 | # ------------------------------------------------------------------------------ |
| 294 | 295 | ||
| 295 | -class ProjectToolBar(wx.ToolBar): | 296 | +class ProjectToolBar(aui.AuiToolBar): |
| 296 | def __init__(self, parent): | 297 | def __init__(self, parent): |
| 297 | - wx.ToolBar.__init__(self, parent, -1, wx.DefaultPosition, | ||
| 298 | - wx.DefaultSize, wx.TB_FLAT|wx.TB_NODIVIDER) | 298 | + aui.AuiToolBar.__init__(self, parent, -1, wx.DefaultPosition, |
| 299 | + wx.DefaultSize, | ||
| 300 | + aui.AUI_TB_DEFAULT_STYLE|aui.AUI_TB_OVERFLOW) | ||
| 299 | 301 | ||
| 300 | self.SetToolBitmapSize(wx.Size(32,32)) | 302 | self.SetToolBitmapSize(wx.Size(32,32)) |
| 301 | 303 | ||
| @@ -306,35 +308,23 @@ class ProjectToolBar(wx.ToolBar): | @@ -306,35 +308,23 @@ class ProjectToolBar(wx.ToolBar): | ||
| 306 | def __init_items(self): | 308 | def __init_items(self): |
| 307 | 309 | ||
| 308 | 310 | ||
| 309 | - if sys.platform == 'darwin': | ||
| 310 | - BMP_IMPORT = wx.Bitmap("../icons/file_import_original.png", | ||
| 311 | - wx.BITMAP_TYPE_PNG) | ||
| 312 | - BMP_NET = wx.Bitmap("../icons/file_from_internet_original.png", | ||
| 313 | - wx.BITMAP_TYPE_PNG) | ||
| 314 | - BMP_SAVE = wx.Bitmap("../icons/file_save_original.png", | ||
| 315 | - wx.BITMAP_TYPE_PNG) | ||
| 316 | - BMP_PRINT = wx.Bitmap("../icons/print_original.png", | ||
| 317 | - wx.BITMAP_TYPE_PNG) | ||
| 318 | - BMP_PHOTO = wx.Bitmap("../icons/tool_photo_original.png", | ||
| 319 | - wx.BITMAP_TYPE_PNG) | ||
| 320 | - else: | ||
| 321 | - BMP_IMPORT = wx.Bitmap("../icons/file_import.png", | 311 | + BMP_IMPORT = wx.Bitmap("../icons/file_import.png", |
| 322 | wx.BITMAP_TYPE_PNG) | 312 | wx.BITMAP_TYPE_PNG) |
| 323 | - BMP_NET = wx.Bitmap("../icons/file_from_internet.png", | 313 | + BMP_NET = wx.Bitmap("../icons/file_from_internet.png", |
| 324 | wx.BITMAP_TYPE_PNG) | 314 | wx.BITMAP_TYPE_PNG) |
| 325 | - BMP_SAVE = wx.Bitmap("../icons/file_save.png", | 315 | + BMP_SAVE = wx.Bitmap("../icons/file_save.png", |
| 326 | wx.BITMAP_TYPE_PNG) | 316 | wx.BITMAP_TYPE_PNG) |
| 327 | - BMP_PRINT = wx.Bitmap("../icons/print.png", | 317 | + BMP_PRINT = wx.Bitmap("../icons/print.png", |
| 328 | wx.BITMAP_TYPE_PNG) | 318 | wx.BITMAP_TYPE_PNG) |
| 329 | - BMP_PHOTO = wx.Bitmap("../icons/tool_photo.png", | 319 | + BMP_PHOTO = wx.Bitmap("../icons/tool_photo.png", |
| 330 | wx.BITMAP_TYPE_PNG) | 320 | wx.BITMAP_TYPE_PNG) |
| 331 | 321 | ||
| 332 | - self.AddLabelTool(ID_FILE_IMPORT, "Import medical image...", BMP_IMPORT) | ||
| 333 | - self.AddLabelTool(ID_FILE_LOAD_INTERNET, "Load medical image...", | 322 | + self.AddSimpleTool(ID_FILE_IMPORT, "Import medical image...", BMP_IMPORT) |
| 323 | + self.AddSimpleTool(ID_FILE_LOAD_INTERNET, "Load medical image...", | ||
| 334 | BMP_NET) | 324 | BMP_NET) |
| 335 | - self.AddLabelTool(ID_FILE_SAVE, "Save InVesalius project", BMP_SAVE) | ||
| 336 | - self.AddLabelTool(101, "Take photo of screen", BMP_PHOTO) | ||
| 337 | - self.AddLabelTool(ID_FILE_PRINT, "Print medical image...", BMP_PRINT) | 325 | + self.AddSimpleTool(ID_FILE_SAVE, "Save InVesalius project", BMP_SAVE) |
| 326 | + self.AddSimpleTool(101, "Take photo of screen", BMP_PHOTO) | ||
| 327 | + self.AddSimpleTool(ID_FILE_PRINT, "Print medical image...", BMP_PRINT) | ||
| 338 | 328 | ||
| 339 | 329 | ||
| 340 | self.Realize() | 330 | self.Realize() |