Esempio n. 1
0
    def CreateControls(self, propGrid, property, pos, sz):
        # Create and populate buttons-subwindow
        buttons = wxpg.PGMultiButton(propGrid, sz)

        # Add two regular buttons
        buttons.AddBitmapButton(
            wx.Bitmap(Chemins.GetStaticPath("Images/16x16/Mecanisme.png"),
                      wx.BITMAP_TYPE_PNG))
        buttons.GetButton(0).SetToolTip(
            wx.ToolTip(
                _(u"Cliquez ici pour accéder à la gestion des paramètres")))

        # Create the 'primary' editor control (textctrl in this case)
        if 'phoenix' in wx.PlatformInfo:
            wnd = super(EditeurComboBoxAvecBoutons,
                        self).CreateControls(propGrid, property, pos,
                                             buttons.GetPrimarySize())
            wnd = wnd.m_primary
            buttons.Finalize(propGrid, pos)
            self.buttons = buttons
            return wxpg.PGWindowList(wnd, buttons)
        else:
            wnd = self.CallSuperMethod("CreateControls", propGrid, property,
                                       pos, buttons.GetPrimarySize())
            buttons.Finalize(propGrid, pos)
            self.buttons = buttons
            return (wnd, buttons)
Esempio n. 2
0
    def CreateControls(self, propGrid, property, pos, sz):
        # Create and populate buttons-subwindow
        buttons = wxpg.PGMultiButton(propGrid, sz)

        # Add two regular buttons
        buttons.AddButton("...")
        buttons.AddButton("A")
        # Add a bitmap button
        buttons.AddBitmapButton(wx.ArtProvider.GetBitmap(wx.ART_FOLDER))

        # Create the 'primary' editor control (textctrl in this case)
        wnd = super(SampleMultiButtonEditor,
                    self).CreateControls(propGrid, property, pos,
                                         buttons.GetPrimarySize())
        wnd = wnd.m_primary

        # Finally, move buttons-subwindow to correct position and make sure
        # returned wxPGWindowList contains our custom button list.
        buttons.Finalize(propGrid, pos)

        # We must maintain a reference to any editor objects we created
        # ourselves. Otherwise they might be freed prematurely. Also,
        # we need it in OnEvent() below, because in Python we cannot "cast"
        # result of wxPropertyGrid.GetEditorControlSecondary() into
        # PGMultiButton instance.
        self.buttons = buttons

        return wxpg.PGWindowList(wnd, buttons)
Esempio n. 3
0
    def CreateControls(self, propGrid, property, pos, sz):
        # Create and populate buttons-subwindow
        buttons = wxpg.PGMultiButton(propGrid, sz)

        # Add two regular buttons
        buttons.AddButton("...")
        buttons.AddButton("A")
        # Add a bitmap button
        x = ImageUtil()
        buttons.AddBitmapButton(x.getBitmap(iconName='pdf', size=(10, 10)))
        
        # Create the 'primary' editor control (textctrl in this case)
        wnd = self.CallSuperMethod("CreateControls",
                                   propGrid,
                                   property,
                                   pos,
                                   buttons.GetPrimarySize())

        # Finally, move buttons-subwindow to correct position and make sure
        # returned wxPGWindowList contains our custom button list.
        buttons.Finalize(propGrid, pos);

        # We must maintain a reference to any editor objects we created
        # ourselves. Otherwise they might be freed prematurely. Also,
        # we need it in OnEvent() below, because in Python we cannot "cast"
        # result of wxPropertyGrid.GetEditorControlSecondary() into
        # PGMultiButton instance.
        self.buttons = buttons

        return (wnd, buttons)
Esempio n. 4
0
    def add_multi_button(self, name, key, value, status=None, enabled=True, **kwargs):
        """
        Add multi-button.

        :param name:
        :param key:
        :param value:
        :param status: status bar string
        :param enabled:
        :param kwargs:
        :return:
        """
        buttons = propgrid.PGMultiButton(self, wx.Size(10, 10))
        buttons.Add('...')
        buttons.Add('A')

        # Finally, move button-subwindow to correct position and make sure
        # returned wxPGWindowList contains our custom button list.
        buttons.Finalize(self, wx.Point(1, 1))

        self.Append(buttons)

        if status:
            self.SetPropertyHelpString(key, status)

        if enabled:
            self.EnableProperty(key)
        else:
            self.DisableProperty(key)

        return buttons
Esempio n. 5
0
	def CreateControls(self, propGrid, property, pos, sz):
		buttons = wxpg.PGMultiButton(propGrid, sz)
		buttons.AddButton("+")

		wnd = self.CallSuperMethod("CreateControls",
		                           propGrid,
		                           property,
		                           pos,
		                           buttons.GetPrimarySize())
		buttons.Finalize(propGrid, pos);
		self.buttons = buttons

		return (wnd, buttons)
    def CreateControls(self, propGrid, property, pos, sz):
        # Create and populate buttons-subwindow
        buttons = wxpg.PGMultiButton(propGrid, sz)

        # Add two regular buttons
        buttons.AddBitmapButton(wx.Bitmap(Chemins.GetStaticPath("Images/16x16/Mecanisme.png"), wx.BITMAP_TYPE_PNG))
        buttons.GetButton(0).SetToolTipString(_(u"Cliquez ici pour accéder à la gestion des paramètres"))
        
        # Create the 'primary' editor control (textctrl in this case)
        wnd = self.CallSuperMethod("CreateControls", propGrid, property, pos, buttons.GetPrimarySize())
        buttons.Finalize(propGrid, pos);
        self.buttons = buttons
        return (wnd, buttons)
Esempio n. 7
0
    def CreateControls(self, propGrid, property, pos, sz):
        # Create and populate buttons-subwindow
        buttons = wxpg.PGMultiButton(propGrid, sz)

        # Add two regular buttons
        buttons.AddBitmapButton(
            wx.Bitmap(MECANISME_16X16_IMG, wx.BITMAP_TYPE_PNG))
        buttons.GetButton(0).SetToolTip(PARAM_IMP_TXT)

        # Create the 'primary' editor control (textctrl in this case)
        wnd = self.CallSuperMethod("CreateControls", propGrid, property, pos,
                                   buttons.GetPrimarySize())
        buttons.Finalize(propGrid, pos)
        self.buttons = buttons
        return (wnd, buttons)
Esempio n. 8
0
    def CreateControls(self, propGrid, property, pos, sz):
        # Create and populate buttons-subwindow
        buttons = wxpg.PGMultiButton(propGrid, sz)

        # Add two regular buttons
        buttons.AddBitmapButton(
            wx.Bitmap(Chemins.GetStaticPath("Images/16x16/Actualiser2.png"),
                      wx.BITMAP_TYPE_PNG))
        buttons.GetButton(0).SetToolTip(
            wx.ToolTip(_(u"Cliquez ici pour rétablir la valeur par défaut")))

        # Create the 'primary' editor control (textctrl in this case)
        wnd = self.CallSuperMethod("CreateControls", propGrid, property, pos,
                                   buttons.GetPrimarySize())
        buttons.Finalize(propGrid, pos)
        self.buttons = buttons
        return (wnd, buttons)
 def test_propgrideditors10(self):
     pgrid = pg.PropertyGrid(self.frame)
     mb = pg.PGMultiButton(pgrid, (100, 25))