示例#1
0
    def UpdateToolBar(self):
        tb = self.NavCanvas.ToolBar

        # Add triangle 2
        self.wxId_TBAddTri2 = wx.NewId()
        img = myimages.getwrTriangle2Image()
        imgGO = myimages.getwrTriangle2Image()
        imgutil.grayOut(imgGO)
        bmp = wx.BitmapFromImage(img)
        bmpDA = wx.BitmapFromImage(imgGO)

        tb.InsertLabelTool(
            pos=0,
            label="Add triangle 2",
            bitmap=bmp,
            bmpDisabled=bmpDA,
            id=self.wxId_TBAddTri2,
            longHelp="",
            shortHelp="",
        )
        self.Bind(wx.EVT_TOOL, self.OnTBAddTri2, id=self.wxId_TBAddTri2)

        # Add triangle 1
        self.wxId_TBAddTri1 = wx.NewId()
        img = myimages.getwrTriangle1Image()
        imgGO = myimages.getwrTriangle1Image()
        imgutil.grayOut(imgGO)
        bmp = wx.BitmapFromImage(img)
        bmpDA = wx.BitmapFromImage(imgGO)

        tb.InsertLabelTool(
            pos=0,
            label="Add triangle 1",
            bitmap=bmp,
            bmpDisabled=bmpDA,
            id=self.wxId_TBAddTri1,
            longHelp="",
            shortHelp="",
        )
        self.Bind(wx.EVT_TOOL, self.OnTBAddTri1, id=self.wxId_TBAddTri1)

        # Add rectangle
        self.wxId_TBAddRect = wx.NewId()
        img = myimages.getwrRectangleImage()
        imgGO = myimages.getwrRectangleImage()
        imgutil.grayOut(imgGO)
        bmp = wx.BitmapFromImage(img)
        bmpDA = wx.BitmapFromImage(imgGO)

        tb.InsertLabelTool(
            pos=0,
            label="Add rectangle",
            bitmap=bmp,
            bmpDisabled=bmpDA,
            id=self.wxId_TBAddRect,
            longHelp="",
            shortHelp="",
        )
        self.Bind(wx.EVT_TOOL, self.OnTBAddRect, id=self.wxId_TBAddRect)

        # delete
        self.wxId_TBDelete = wx.NewId()
        img = myimages.getwrDeleteImage()
        imgGO = myimages.getwrDeleteImage()
        imgutil.grayOut(imgGO)
        bmp = wx.BitmapFromImage(img)
        bmpDA = wx.BitmapFromImage(imgGO)

        tb.InsertLabelTool(
            pos=0,
            label="Delete shape",
            bitmap=bmp,
            bmpDisabled=bmpDA,
            id=self.wxId_TBDelete,
            longHelp="",
            shortHelp="",
        )
        self.Bind(wx.EVT_TOOL, self.OnTBDelete, id=self.wxId_TBDelete)

        tb.AddSeparator()

        # save
        self.wxId_TBSave = wx.NewId()
        img = myimages.getsaveImage()
        imgGO = myimages.getsaveImage()
        imgutil.grayOut(imgGO)
        bmp = wx.BitmapFromImage(img)
        bmpDA = wx.BitmapFromImage(imgGO)

        tb.InsertLabelTool(
            pos=0,
            label="Save rack design",
            bitmap=bmp,
            bmpDisabled=bmpDA,
            id=self.wxId_TBSave,
            longHelp="",
            shortHelp="",
        )
        self.Bind(wx.EVT_TOOL, self.OnTBSave, id=self.wxId_TBSave)

        tb.AddSeparator()

        tb.Realize()
示例#2
0
    def CreateToolBar(self):
        toolSize = (24, 24)
        self.TB.SetToolBitmapSize(toolSize)

        # save
        self.wxId_TBSave =wx.NewId()
        img = myimages.getsaveImage()
        imgGO = myimages.getsaveImage()
        imgutil.grayOut(imgGO)
        bmp = wx.BitmapFromImage(img)
        bmpDA = wx.BitmapFromImage(imgGO)

        self.TB.AddLabelTool(label = 'Save rack design',
                bitmap = bmp,
                bmpDisabled = bmpDA,
                id = self.wxId_TBSave,
                longHelp = '',
                shortHelp = '')
        self.Bind(wx.EVT_TOOL, self.OnTBSave, id=self.wxId_TBSave)

        self.TB.AddSeparator()

        # delete
        self.wxId_TBDelete =wx.NewId()
        img = myimages.getwrDeleteImage()
        imgGO = myimages.getwrDeleteImage()
        imgutil.grayOut(imgGO)
        bmp = wx.BitmapFromImage(img)
        bmpDA = wx.BitmapFromImage(imgGO)

        self.TB.AddLabelTool(label = 'Delete shape',
                bitmap = bmp,
                bmpDisabled = bmpDA,
                id = self.wxId_TBDelete,
                longHelp = '',
                shortHelp = '')
        self.Bind(wx.EVT_TOOL, self.OnTBDelete, id=self.wxId_TBDelete)
        
        self.TB.AddSeparator()

        # Add rectangle
        self.wxId_TBAddRect =wx.NewId()
        img = myimages.getwrRectangleImage()
        imgGO = myimages.getwrRectangleImage()
        imgutil.grayOut(imgGO)
        bmp = wx.BitmapFromImage(img)
        bmpDA = wx.BitmapFromImage(imgGO)

        self.TB.AddLabelTool(label = 'Add rectangle',
                bitmap = bmp,
                bmpDisabled = bmpDA,
                id = self.wxId_TBAddRect,
                longHelp = '',
                shortHelp = '')
        self.Bind(wx.EVT_TOOL, self.OnTBAddRect, id=self.wxId_TBAddRect)

        # Add triangle 1
        self.wxId_TBAddTri1 =wx.NewId()
        img = myimages.getwrTriangle1Image()
        imgGO = myimages.getwrTriangle1Image()
        imgutil.grayOut(imgGO)
        bmp = wx.BitmapFromImage(img)
        bmpDA = wx.BitmapFromImage(imgGO)

        self.TB.AddLabelTool(label = 'Add triangle 1',
                bitmap = bmp,
                bmpDisabled = bmpDA,
                id = self.wxId_TBAddTri1,
                longHelp = '',
                shortHelp = '')
        self.Bind(wx.EVT_TOOL, self.OnTBAddTri1, id=self.wxId_TBAddTri1)

        # Add triangle 2
        self.wxId_TBAddTri2 =wx.NewId()
        img = myimages.getwrTriangle2Image()
        imgGO = myimages.getwrTriangle2Image()
        imgutil.grayOut(imgGO)
        bmp = wx.BitmapFromImage(img)
        bmpDA = wx.BitmapFromImage(imgGO)

        self.TB.AddLabelTool(label = 'Add triangle 2',
                bitmap = bmp,
                bmpDisabled = bmpDA,
                id = self.wxId_TBAddTri2,
                longHelp = '',
                shortHelp = '')
        self.Bind(wx.EVT_TOOL, self.OnTBAddTri2, id=self.wxId_TBAddTri2)
        
        # Add triangle 3
        self.wxId_TBAddTri3 =wx.NewId()
        img = myimages.getwrTriangle3Image()
        imgGO = myimages.getwrTriangle3Image()
        imgutil.grayOut(imgGO)
        bmp = wx.BitmapFromImage(img)
        bmpDA = wx.BitmapFromImage(imgGO)

        self.TB.AddLabelTool(label = 'Add triangle 3',
                bitmap = bmp,
                bmpDisabled = bmpDA,
                id = self.wxId_TBAddTri3,
                longHelp = '',
                shortHelp = '')
        self.Bind(wx.EVT_TOOL, self.OnTBAddTri3, id=self.wxId_TBAddTri3)

        # Add triangle 4
        self.wxId_TBAddTri4 =wx.NewId()
        img = myimages.getwrTriangle4Image()
        imgGO = myimages.getwrTriangle4Image()
        imgutil.grayOut(imgGO)
        bmp = wx.BitmapFromImage(img)
        bmpDA = wx.BitmapFromImage(imgGO)

        self.TB.AddLabelTool(label = 'Add triangle 4',
                bitmap = bmp,
                bmpDisabled = bmpDA,
                id = self.wxId_TBAddTri4,
                longHelp = '',
                shortHelp = '')
        self.Bind(wx.EVT_TOOL, self.OnTBAddTri4, id=self.wxId_TBAddTri4)

        # Add triangle 5
        self.wxId_TBAddTri5 =wx.NewId()
        img = myimages.getwrTriangle5Image()
        imgGO = myimages.getwrTriangle5Image()
        imgutil.grayOut(imgGO)
        bmp = wx.BitmapFromImage(img)
        bmpDA = wx.BitmapFromImage(imgGO)

        self.TB.AddLabelTool(label = 'Add triangle 5',
                bitmap = bmp,
                bmpDisabled = bmpDA,
                id = self.wxId_TBAddTri5,
                longHelp = '',
                shortHelp = '')
        self.Bind(wx.EVT_TOOL, self.OnTBAddTri5, id=self.wxId_TBAddTri5)

        # Add triangle 6
        self.wxId_TBAddTri6 =wx.NewId()
        img = myimages.getwrTriangle6Image()
        imgGO = myimages.getwrTriangle6Image()
        imgutil.grayOut(imgGO)
        bmp = wx.BitmapFromImage(img)
        bmpDA = wx.BitmapFromImage(imgGO)

        self.TB.AddLabelTool(label = 'Add triangle 6',
                bitmap = bmp,
                bmpDisabled = bmpDA,
                id = self.wxId_TBAddTri6,
                longHelp = '',
                shortHelp = '')
        self.Bind(wx.EVT_TOOL, self.OnTBAddTri6, id=self.wxId_TBAddTri6)

        # Add triangle 7
        self.wxId_TBAddTri7 =wx.NewId()
        img = myimages.getwrTriangle7Image()
        imgGO = myimages.getwrTriangle7Image()
        imgutil.grayOut(imgGO)
        bmp = wx.BitmapFromImage(img)
        bmpDA = wx.BitmapFromImage(imgGO)

        self.TB.AddLabelTool(label = 'Add triangle 7',
                bitmap = bmp,
                bmpDisabled = bmpDA,
                id = self.wxId_TBAddTri7,
                longHelp = '',
                shortHelp = '')
        self.Bind(wx.EVT_TOOL, self.OnTBAddTri7, id=self.wxId_TBAddTri7)

        # Add triangle 8
        self.wxId_TBAddTri8 =wx.NewId()
        img = myimages.getwrTriangle8Image()
        imgGO = myimages.getwrTriangle8Image()
        imgutil.grayOut(imgGO)
        bmp = wx.BitmapFromImage(img)
        bmpDA = wx.BitmapFromImage(imgGO)

        self.TB.AddLabelTool(label = 'Add triangle 8',
                bitmap = bmp,
                bmpDisabled = bmpDA,
                id = self.wxId_TBAddTri8,
                longHelp = '',
                shortHelp = '')
        self.Bind(wx.EVT_TOOL, self.OnTBAddTri8, id=self.wxId_TBAddTri8)

        self.TB.Realize()
        self.TB.Layout()
        self.TB.Refresh()
示例#3
0
    def CreateToolBar(self):
        toolSize = (24, 24)
        self.TB.SetToolBitmapSize(toolSize)

        # save
        self.wxId_TBSave = wx.NewId()
        img = myimages.getsaveImage()
        imgGO = myimages.getsaveImage()
        imgutil.grayOut(imgGO)
        bmp = wx.BitmapFromImage(img)
        bmpDA = wx.BitmapFromImage(imgGO)

        self.TB.AddLabelTool(
            label="Save rack design",
            bitmap=bmp,
            bmpDisabled=bmpDA,
            id=self.wxId_TBSave,
            longHelp="",
            shortHelp="",
        )
        self.Bind(wx.EVT_TOOL, self.OnTBSave, id=self.wxId_TBSave)

        self.TB.AddSeparator()

        # delete
        self.wxId_TBDelete = wx.NewId()
        img = myimages.getwrDeleteImage()
        imgGO = myimages.getwrDeleteImage()
        imgutil.grayOut(imgGO)
        bmp = wx.BitmapFromImage(img)
        bmpDA = wx.BitmapFromImage(imgGO)

        self.TB.AddLabelTool(
            label="Delete shape",
            bitmap=bmp,
            bmpDisabled=bmpDA,
            id=self.wxId_TBDelete,
            longHelp="",
            shortHelp="",
        )
        self.Bind(wx.EVT_TOOL, self.OnTBDelete, id=self.wxId_TBDelete)

        self.TB.AddSeparator()

        # Add rectangle
        self.wxId_TBAddRect = wx.NewId()
        img = myimages.getwrRectangleImage()
        imgGO = myimages.getwrRectangleImage()
        imgutil.grayOut(imgGO)
        bmp = wx.BitmapFromImage(img)
        bmpDA = wx.BitmapFromImage(imgGO)

        self.TB.AddLabelTool(
            label="Add rectangle",
            bitmap=bmp,
            bmpDisabled=bmpDA,
            id=self.wxId_TBAddRect,
            longHelp="",
            shortHelp="",
        )
        self.Bind(wx.EVT_TOOL, self.OnTBAddRect, id=self.wxId_TBAddRect)

        # Add triangle 1
        self.wxId_TBAddTri1 = wx.NewId()
        img = myimages.getwrTriangle1Image()
        imgGO = myimages.getwrTriangle1Image()
        imgutil.grayOut(imgGO)
        bmp = wx.BitmapFromImage(img)
        bmpDA = wx.BitmapFromImage(imgGO)

        self.TB.AddLabelTool(
            label="Add triangle 1",
            bitmap=bmp,
            bmpDisabled=bmpDA,
            id=self.wxId_TBAddTri1,
            longHelp="",
            shortHelp="",
        )
        self.Bind(wx.EVT_TOOL, self.OnTBAddTri1, id=self.wxId_TBAddTri1)

        # Add triangle 2
        self.wxId_TBAddTri2 = wx.NewId()
        img = myimages.getwrTriangle2Image()
        imgGO = myimages.getwrTriangle2Image()
        imgutil.grayOut(imgGO)
        bmp = wx.BitmapFromImage(img)
        bmpDA = wx.BitmapFromImage(imgGO)

        self.TB.AddLabelTool(
            label="Add triangle 2",
            bitmap=bmp,
            bmpDisabled=bmpDA,
            id=self.wxId_TBAddTri2,
            longHelp="",
            shortHelp="",
        )
        self.Bind(wx.EVT_TOOL, self.OnTBAddTri2, id=self.wxId_TBAddTri2)

        # Add triangle 3
        self.wxId_TBAddTri3 = wx.NewId()
        img = myimages.getwrTriangle3Image()
        imgGO = myimages.getwrTriangle3Image()
        imgutil.grayOut(imgGO)
        bmp = wx.BitmapFromImage(img)
        bmpDA = wx.BitmapFromImage(imgGO)

        self.TB.AddLabelTool(
            label="Add triangle 3",
            bitmap=bmp,
            bmpDisabled=bmpDA,
            id=self.wxId_TBAddTri3,
            longHelp="",
            shortHelp="",
        )
        self.Bind(wx.EVT_TOOL, self.OnTBAddTri3, id=self.wxId_TBAddTri3)

        # Add triangle 4
        self.wxId_TBAddTri4 = wx.NewId()
        img = myimages.getwrTriangle4Image()
        imgGO = myimages.getwrTriangle4Image()
        imgutil.grayOut(imgGO)
        bmp = wx.BitmapFromImage(img)
        bmpDA = wx.BitmapFromImage(imgGO)

        self.TB.AddLabelTool(
            label="Add triangle 4",
            bitmap=bmp,
            bmpDisabled=bmpDA,
            id=self.wxId_TBAddTri4,
            longHelp="",
            shortHelp="",
        )
        self.Bind(wx.EVT_TOOL, self.OnTBAddTri4, id=self.wxId_TBAddTri4)

        # Add triangle 5
        self.wxId_TBAddTri5 = wx.NewId()
        img = myimages.getwrTriangle5Image()
        imgGO = myimages.getwrTriangle5Image()
        imgutil.grayOut(imgGO)
        bmp = wx.BitmapFromImage(img)
        bmpDA = wx.BitmapFromImage(imgGO)

        self.TB.AddLabelTool(
            label="Add triangle 5",
            bitmap=bmp,
            bmpDisabled=bmpDA,
            id=self.wxId_TBAddTri5,
            longHelp="",
            shortHelp="",
        )
        self.Bind(wx.EVT_TOOL, self.OnTBAddTri5, id=self.wxId_TBAddTri5)

        # Add triangle 6
        self.wxId_TBAddTri6 = wx.NewId()
        img = myimages.getwrTriangle6Image()
        imgGO = myimages.getwrTriangle6Image()
        imgutil.grayOut(imgGO)
        bmp = wx.BitmapFromImage(img)
        bmpDA = wx.BitmapFromImage(imgGO)

        self.TB.AddLabelTool(
            label="Add triangle 6",
            bitmap=bmp,
            bmpDisabled=bmpDA,
            id=self.wxId_TBAddTri6,
            longHelp="",
            shortHelp="",
        )
        self.Bind(wx.EVT_TOOL, self.OnTBAddTri6, id=self.wxId_TBAddTri6)

        # Add triangle 7
        self.wxId_TBAddTri7 = wx.NewId()
        img = myimages.getwrTriangle7Image()
        imgGO = myimages.getwrTriangle7Image()
        imgutil.grayOut(imgGO)
        bmp = wx.BitmapFromImage(img)
        bmpDA = wx.BitmapFromImage(imgGO)

        self.TB.AddLabelTool(
            label="Add triangle 7",
            bitmap=bmp,
            bmpDisabled=bmpDA,
            id=self.wxId_TBAddTri7,
            longHelp="",
            shortHelp="",
        )
        self.Bind(wx.EVT_TOOL, self.OnTBAddTri7, id=self.wxId_TBAddTri7)

        # Add triangle 8
        self.wxId_TBAddTri8 = wx.NewId()
        img = myimages.getwrTriangle8Image()
        imgGO = myimages.getwrTriangle8Image()
        imgutil.grayOut(imgGO)
        bmp = wx.BitmapFromImage(img)
        bmpDA = wx.BitmapFromImage(imgGO)

        self.TB.AddLabelTool(
            label="Add triangle 8",
            bitmap=bmp,
            bmpDisabled=bmpDA,
            id=self.wxId_TBAddTri8,
            longHelp="",
            shortHelp="",
        )
        self.Bind(wx.EVT_TOOL, self.OnTBAddTri8, id=self.wxId_TBAddTri8)

        self.TB.Realize()
        self.TB.Layout()
        self.TB.Refresh()
示例#4
0
    def UpdateToolBar(self):
        tb = self.NavCanvas.ToolBar
        
        # Add triangle 2
        self.wxId_TBAddTri2 =wx.NewId()
        img = myimages.getwrTriangle2Image()
        imgGO = myimages.getwrTriangle2Image()
        imgutil.grayOut(imgGO)
        bmp = wx.BitmapFromImage(img)
        bmpDA = wx.BitmapFromImage(imgGO)

        tb.InsertLabelTool(pos=0, label = 'Add triangle 2',
                bitmap = bmp,
                bmpDisabled = bmpDA,
                id = self.wxId_TBAddTri2,
                longHelp = '',
                shortHelp = '')
        self.Bind(wx.EVT_TOOL, self.OnTBAddTri2, id=self.wxId_TBAddTri2)

        # Add triangle 1
        self.wxId_TBAddTri1 =wx.NewId()
        img = myimages.getwrTriangle1Image()
        imgGO = myimages.getwrTriangle1Image()
        imgutil.grayOut(imgGO)
        bmp = wx.BitmapFromImage(img)
        bmpDA = wx.BitmapFromImage(imgGO)

        tb.InsertLabelTool(pos=0, label = 'Add triangle 1',
                bitmap = bmp,
                bmpDisabled = bmpDA,
                id = self.wxId_TBAddTri1,
                longHelp = '',
                shortHelp = '')
        self.Bind(wx.EVT_TOOL, self.OnTBAddTri1, id=self.wxId_TBAddTri1)

        # Add rectangle
        self.wxId_TBAddRect =wx.NewId()
        img = myimages.getwrRectangleImage()
        imgGO = myimages.getwrRectangleImage()
        imgutil.grayOut(imgGO)
        bmp = wx.BitmapFromImage(img)
        bmpDA = wx.BitmapFromImage(imgGO)

        tb.InsertLabelTool(pos=0, label = 'Add rectangle',
                bitmap = bmp,
                bmpDisabled = bmpDA,
                id = self.wxId_TBAddRect,
                longHelp = '',
                shortHelp = '')
        self.Bind(wx.EVT_TOOL, self.OnTBAddRect, id=self.wxId_TBAddRect)

        # delete
        self.wxId_TBDelete =wx.NewId()
        img = myimages.getwrDeleteImage()
        imgGO = myimages.getwrDeleteImage()
        imgutil.grayOut(imgGO)
        bmp = wx.BitmapFromImage(img)
        bmpDA = wx.BitmapFromImage(imgGO)

        tb.InsertLabelTool(pos=0, label = 'Delete shape',
                bitmap = bmp,
                bmpDisabled = bmpDA,
                id = self.wxId_TBDelete,
                longHelp = '',
                shortHelp = '')
        self.Bind(wx.EVT_TOOL, self.OnTBDelete, id=self.wxId_TBDelete)
        
        tb.AddSeparator()
        
        # save
        self.wxId_TBSave =wx.NewId()
        img = myimages.getsaveImage()
        imgGO = myimages.getsaveImage()
        imgutil.grayOut(imgGO)
        bmp = wx.BitmapFromImage(img)
        bmpDA = wx.BitmapFromImage(imgGO)

        tb.InsertLabelTool(pos=0, label = 'Save rack design',
                bitmap = bmp,
                bmpDisabled = bmpDA,
                id = self.wxId_TBSave,
                longHelp = '',
                shortHelp = '')
        self.Bind(wx.EVT_TOOL, self.OnTBSave, id=self.wxId_TBSave)

        tb.AddSeparator()
        
        tb.Realize()