Commit e2ad208df906500925faa8daf2fbb2d667209047

Authored by Paulo Henrique Junqueira Amorim
1 parent 4f8bc05f

ADD: Zoom function

Showing 1 changed file with 11 additions and 11 deletions   Show diff stats
invesalius/gui/frame.py
@@ -355,7 +355,7 @@ class ObjectToolBar(wx.ToolBar): @@ -355,7 +355,7 @@ class ObjectToolBar(wx.ToolBar):
355 wx.BITMAP_TYPE_GIF) 355 wx.BITMAP_TYPE_GIF)
356 BMP_TRANSLATE = wx.Bitmap("../icons/tool_translate_original.png", 356 BMP_TRANSLATE = wx.Bitmap("../icons/tool_translate_original.png",
357 wx.BITMAP_TYPE_PNG) 357 wx.BITMAP_TYPE_PNG)
358 - BMP_ZOOM_IN = wx.Bitmap("../icons/tool_zoom_in_original.png", 358 + BMP_ZOOM = wx.Bitmap("../icons/tool_zoom_original.png",
359 wx.BITMAP_TYPE_PNG) 359 wx.BITMAP_TYPE_PNG)
360 BMP_ZOOM_OUT = wx.Bitmap("../icons/tool_zoom_out_original.png", 360 BMP_ZOOM_OUT = wx.Bitmap("../icons/tool_zoom_out_original.png",
361 wx.BITMAP_TYPE_PNG) 361 wx.BITMAP_TYPE_PNG)
@@ -364,12 +364,12 @@ class ObjectToolBar(wx.ToolBar): @@ -364,12 +364,12 @@ class ObjectToolBar(wx.ToolBar):
364 else: 364 else:
365 BMP_ROTATE = wx.Bitmap("../icons/tool_rotate.gif", wx.BITMAP_TYPE_GIF) 365 BMP_ROTATE = wx.Bitmap("../icons/tool_rotate.gif", wx.BITMAP_TYPE_GIF)
366 BMP_TRANSLATE = wx.Bitmap("../icons/tool_translate.gif", wx.BITMAP_TYPE_GIF) 366 BMP_TRANSLATE = wx.Bitmap("../icons/tool_translate.gif", wx.BITMAP_TYPE_GIF)
367 - BMP_ZOOM_IN = wx.Bitmap("../icons/tool_zoom_in.png", wx.BITMAP_TYPE_PNG) 367 + BMP_ZOOM = wx.Bitmap("../icons/tool_zoom.png", wx.BITMAP_TYPE_PNG)
368 BMP_ZOOM_OUT = wx.Bitmap("../icons/tool_zoom_out.png", wx.BITMAP_TYPE_PNG) 368 BMP_ZOOM_OUT = wx.Bitmap("../icons/tool_zoom_out.png", wx.BITMAP_TYPE_PNG)
369 BMP_CONTRAST = wx.Bitmap("../icons/tool_contrast.png", wx.BITMAP_TYPE_PNG) 369 BMP_CONTRAST = wx.Bitmap("../icons/tool_contrast.png", wx.BITMAP_TYPE_PNG)
370 370
371 371
372 - self.AddLabelTool(1, "Zoom in image", BMP_ZOOM_IN, kind = wx.ITEM_CHECK) 372 + self.AddLabelTool(1, "Zoom in image", BMP_ZOOM, kind = wx.ITEM_CHECK)
373 self.AddLabelTool(2, "Zoom out image", BMP_ZOOM_OUT, kind = wx.ITEM_CHECK) 373 self.AddLabelTool(2, "Zoom out image", BMP_ZOOM_OUT, kind = wx.ITEM_CHECK)
374 self.AddLabelTool(3, "Rotate image", BMP_ROTATE, kind = wx.ITEM_CHECK) 374 self.AddLabelTool(3, "Rotate image", BMP_ROTATE, kind = wx.ITEM_CHECK)
375 self.AddLabelTool(4, "Translate image", BMP_TRANSLATE, kind = wx.ITEM_CHECK) 375 self.AddLabelTool(4, "Translate image", BMP_TRANSLATE, kind = wx.ITEM_CHECK)
@@ -377,21 +377,21 @@ class ObjectToolBar(wx.ToolBar): @@ -377,21 +377,21 @@ class ObjectToolBar(wx.ToolBar):
377 377
378 self.Bind(wx.EVT_TOOL, self.OnClick) 378 self.Bind(wx.EVT_TOOL, self.OnClick)
379 self.Realize() 379 self.Realize()
380 -  
381 - self.states = {1:"Zoom in image", 2:"Zoom out image", 380 +
  381 + self.states = {1:"Set Zoom Mode", 2:"Set Zoom Select Mode",
382 3:"Set Spin Mode", 4:"Set Pan Mode", 382 3:"Set Spin Mode", 4:"Set Pan Mode",
383 5: "Bright and contrast adjustment"} 383 5: "Bright and contrast adjustment"}
384 - 384 +
385 def __bind_events(self): 385 def __bind_events(self):
386 pass 386 pass
387 387
388 def OnClick(self, evt): 388 def OnClick(self, evt):
389 - 389 +
390 id = evt.GetId() 390 id = evt.GetId()
391 exist_enable_state = 0 391 exist_enable_state = 0
392 - 392 +
393 for x in xrange(1,6): 393 for x in xrange(1,6):
394 - #necessary if the usurio enable another state 394 + #necessary if the usurio enable another state
395 #with a longer allow, disable the previous state 395 #with a longer allow, disable the previous state
396 state = self.GetToolState(x) 396 state = self.GetToolState(x)
397 if not (x == id) and (state == True): 397 if not (x == id) and (state == True):
@@ -399,11 +399,11 @@ class ObjectToolBar(wx.ToolBar): @@ -399,11 +399,11 @@ class ObjectToolBar(wx.ToolBar):
399 elif(state == True) and (id == x): 399 elif(state == True) and (id == x):
400 ps.Publisher().sendMessage(self.states[id]) 400 ps.Publisher().sendMessage(self.states[id])
401 exist_enable_state = 1 401 exist_enable_state = 1
402 - 402 +
403 #Not exist's tool enbled, change to default state 403 #Not exist's tool enbled, change to default state
404 if not (exist_enable_state): 404 if not (exist_enable_state):
405 ps.Publisher().sendMessage('Set Editor Mode') 405 ps.Publisher().sendMessage('Set Editor Mode')
406 - 406 +
407 evt.Skip() 407 evt.Skip()
408 408
409 class LayoutToolBar(wx.ToolBar): 409 class LayoutToolBar(wx.ToolBar):