Пример #1
0
    def __init__(self,
                   parent,
                   id = wx.ID_ANY,
                   size = wx.DefaultSize,
                   **kwargs): # The rest just get passed into FloatCanvas
        wx.Panel.__init__(self, parent, id, size=size)

        self.Modes = [("Pointer",  GUIMode.GUIMouse(),   Resources.getPointerBitmap()),
                      ("Zoom In",  GUIMode.GUIZoomIn(),  Resources.getMagPlusBitmap()),
                      ("Zoom Out", GUIMode.GUIZoomOut(), Resources.getMagMinusBitmap()),
                      ("Pan",      GUIMode.GUIMove(),    Resources.getHandBitmap()),
                      ]
        
        # self.BuildToolbar()
        ## Create the vertical sizer for the toolbar and Panel
        # box = wx.BoxSizer(wx.VERTICAL)
        # box.Add(self.ToolBar, 0, wx.ALL | wx.ALIGN_LEFT | wx.GROW, 4)

        # self.Canvas = FloatCanvas.FloatCanvas(self, **kwargs)
        # self.Canvas = MyFloatCanvas ( self, ** kwargs )
        # box.Add(self.Canvas, 1, wx.GROW)
# 
        # self.SetSizerAndFit(box)

        # default to first mode
        #self.ToolBar.ToggleTool(self.PointerTool.GetId(), True)
        # self.Canvas.SetMode(self.Modes[0][1])

        return None
 def __init__(self, parent,id = wx.ID_ANY,size = wx.DefaultSize,**kwargs):
     FloatCanvas.FloatCanvas.__init__(self,parent,**kwargs)
     # self.dc_list = ['dense','pooling','convolution','flatten','dropout','Input','Connection',output
     self.InitAll()
     self.Test_object()
     self.Modes = [("Pointer", GUIMode.GUIMouse(), Resources.getPointerBitmap()),
                   ("Zoom In", GUIMode.GUIZoomIn(), Resources.getMagPlusBitmap()),
                   ("Zoom Out", GUIMode.GUIZoomOut(), Resources.getMagMinusBitmap()),
                   ("Pan", GUIMode.GUIMove(), Resources.getHandBitmap()),
                   ]
     self.SetMode(self.Modes[0][1])
Пример #3
0
   def __init__(self, parent, id=wx.ID_ANY, size=wx.DefaultSize, **kwargs):
      wx.Panel.__init__(self, parent, id, size=size)
      self.Modes = [("Pointer", GUIMode.GUIMouse(), Resources.getPointerBitmap()),
                   ("Zoom In",  NavGuiZoomIn(),  Resources.getMagPlusBitmap()),
                   ("Zoom Out", NavGuiZoomOut(), Resources.getMagMinusBitmap()),
                   ("Pan", NavGuiMove(), Resources.getHandBitmap()),
                   ]
      self.timeLine = None
      self.BuildToolbar()
      box = wx.BoxSizer(wx.VERTICAL)
      box.Add(self.ToolBar, 0, wx.ALL | wx.ALIGN_LEFT | wx.GROW, 1)

      self.Canvas = CustomFloatCanvas(self, **kwargs)
      box.Add(self.Canvas, 1, wx.ALL | wx.EXPAND)

      self.SetSizerAndFit(box)
Пример #4
0
    def __init__(self, parent, id=wx.ID_ANY, size=wx.DefaultSize, **kwargs):
        wx.Panel.__init__(self, parent, id, size=size)
        self.Modes = [
            ("Pointer", GUIMode.GUIMouse(), Resources.getPointerBitmap()),
            ("Zoom In", NavGuiZoomIn(), Resources.getMagPlusBitmap()),
            ("Zoom Out", NavGuiZoomOut(), Resources.getMagMinusBitmap()),
            ("Pan", NavGuiMove(), Resources.getHandBitmap()),
        ]
        self.timeLine = None
        self.BuildToolbar()
        box = wx.BoxSizer(wx.VERTICAL)
        box.Add(self.ToolBar, 0, wx.ALL | wx.ALIGN_LEFT | wx.GROW, 1)

        self.Canvas = CustomFloatCanvas(self, **kwargs)
        box.Add(self.Canvas, 1, wx.ALL | wx.EXPAND)

        self.SetSizerAndFit(box)
Пример #5
0
 def get_modes(self):
     return {
         self.POINTER: ("Pointer", "Drag a component to move it", GUIMode.GUIMouse(), Resources.getPointerBitmap()),
         self.ZOOM_IN: ("Zoom In", "Click somewhere to zoom in", GUIMode.GUIZoomIn(), Resources.getMagPlusBitmap()),
         self.ZOOM_OUT: ("Zoom Out", "Click somewhere to zoom out", GUIMode.GUIZoomOut(), Resources.getMagMinusBitmap()),
         self.PAN: ("Pan", "Drag on the canvas to move it", GUIMode.GUIMove(), Resources.getHandBitmap()),
         self.BUS: ("Bus (Ctrl+B)", "Click somewhere to insert a bus", GUIMode.GUIMouse(), wx.Bitmap('resources/' + Bus.key + '_small.png', wx.BITMAP_TYPE_PNG)),
         self.SOURCE: ("Source (Ctrl+G)", "Click somewhere to insert a source", GUIMode.GUIMouse(), wx.Bitmap('resources/' + Source.key + '_small.png', wx.BITMAP_TYPE_PNG)),
         self.CHARGE: ("Charge (Ctrl+A)", "Click somewhere to insert a source", GUIMode.GUIMouse(), wx.Bitmap('resources/' + Charge.key + '_small.png', wx.BITMAP_TYPE_PNG)),
         self.STORAGE: ("Storage (Ctrl+T)", "Click somewhere to insert a storage", GUIMode.GUIMouse(), wx.Bitmap('resources/' + Storage.key + '_small.png', wx.BITMAP_TYPE_PNG)),
         self.LINE: ("Line (Ctrl+L)", "Connecting bus", GUIMode.GUIMouse(), wx.Bitmap('resources/' + Line.key + '_small.png', wx.BITMAP_TYPE_PNG)),
         self.BRANCH: ("Branch (Ctrl+R)", "Connecting components to bus", GUIMode.GUIMouse(), wx.Bitmap('resources/' + Branch.key + '_small.png', wx.BITMAP_TYPE_PNG)),
     }