Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

[DONE] Button enabler

Got a good idea? You can suggest new features here.
Post Reply
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

[DONE] Button enabler

Post by Pako »

I have need option Enable/Disable buttons (Test, OK and Apply) after checking validity data in panel.
Seems, that for example

Code: Select all

    def ButtonEnabler(self,flag=True):
        self.dialog.buttonRow.okButton.Enable(flag)
        self.dialog.buttonRow.testButton.Enable(flag)
        if flag and self.isDirty:
            self.dialog.buttonRow.applyButton.Enable(True)
        else:
            self.dialog.buttonRow.applyButton.Enable(False)
added to ConfigPanel.py, work fine.
Pako
User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: Button enabler

Post by Bitmonster »

I have added it this way to the latest beta:

Code: Select all

    def EnableButtons(self, flag=True):
        """
        Enables/Disables the OK, Apply and Test buttons.
        
        Useful if you want to temporarily disable them, because the current
        settings have no valid state and later re-enable them.
        """
        buttonRow = self.dialog.buttonRow
        buttonRow.okButton.Enable(flag)
        buttonRow.testButton.Enable(flag)
        if flag and self.isDirty:
            buttonRow.applyButton.Enable(True)
        else:
            buttonRow.applyButton.Enable(False)
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: [DONE] Button enabler

Post by Pako »

Thanks !!! :)
Pako
Bartman
Plugin Developer
Posts: 881
Joined: Sun Feb 12, 2006 9:03 am

Re: [DONE] Button enabler

Post by Bartman »

what about a config panel wide validator routine like individiual control have them.
Is this possible?
Could reduce the amount of neccessary bindings.
User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: [DONE] Button enabler

Post by Bitmonster »

A wx.Panel doesn't have a Validator option. Only individual controls allow them.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!
Bartman
Plugin Developer
Posts: 881
Joined: Sun Feb 12, 2006 9:03 am

Re: [DONE] Button enabler

Post by Bartman »

ah ok. I was not sure.
Post Reply