full row select on custom button

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
TSS
Posts: 24
Joined: 24 May 2013 18:00

full row select on custom button

Post by TSS »

I'd like to have a "tools/customize list/full row select" on custom button toolbar. Perhaps this is possible by script ... but I've no idea how to do this. I read posts about scripting... but it's too difficult for me. I didn't found topic how to add function form drop down menu to custom buttons.

RalphM
Posts: 2090
Joined: 27 Jan 2005 23:38
Location: Cairns, Australia

Re: full row select on custom button

Post by RalphM »

No script needed, just add a new user button to your toolbar (Tools / Customize Toolbar) then edit the button (right-click on it) and enter something like this:
hc_178.jpg
#404 is the command ID of "Full Row Select".
Command ID's can be found by browsing "Tools / Customize Keyboard Shortcuts" where for every menu command the respective ID is displayed at the bottom of the window.
To see the attached files, you need to log into the forum.
Ralph :)
(OS: W11 25H2 Home x64 - XY: Current x64 beta - Office 2024 64-bit - Display: 1920x1080 @ 125%)

TSS
Posts: 24
Joined: 24 May 2013 18:00

Re: full row select on custom button

Post by TSS »

Indeed it's very simple! But everything is easy if you know where to click ;-)
Thank you very much for this advice :)

And by the way... is there a way to make this button "pushed down" effect for full row select ON, and "pushed up" for OFF ?

RalphM
Posts: 2090
Joined: 27 Jan 2005 23:38
Location: Cairns, Australia

Re: full row select on custom button

Post by RalphM »

As far as I recall it can be done somehow, but certainly isn't a one-liner anymore.
Since #404 is a toogle you need to check first what state it currently has (maybe SC "get") and then change the buttons state accordingly.
I think "CTBstate" is the SC to use, but never used it myself, so let's wait for a button-guru to chime in here...

Just another thought, what happens to the button's state if you use the menu to toggle this setting???
Ralph :)
(OS: W11 25H2 Home x64 - XY: Current x64 beta - Office 2024 64-bit - Display: 1920x1080 @ 125%)

admin
Site Admin
Posts: 66365
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: full row select on custom button

Post by admin »

FYI, "Full Row Select" is in the context menu of any of the existing list style buttons. So it's quite near when just on of those buttons is in the toolbar.

Alternatively you can assign a keyboad shortcut to "Full Row Select".

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: full row select on custom button

Post by TheQwerty »

TSS wrote:And by the way... is there a way to make this button "pushed down" effect for full row select ON, and "pushed up" for OFF ?
Not easily.

RalphM's correct in describing all the details but there's a lot of "unfortunately"s that complicate things.

Unfortunately, #404 / Full Row Select is not one of the options whose state can be retrieved with the Get() SC.
Unfortunately, it isn't even a simple boolean key in any of XYplorer's INI files. It gets stored in the Style bit-flag under the appropriate list mode within the active tabset's pane.ini file.

Unfortunately, even if you are okay with saving the pane.ini file to retrieve the true status there's no good way to detect when the option is changed outside of the custom button.

Thus, unfortunately, it is rather difficult to have the button be truly representative of the option's actual state.



Given all that I'd use the following in your left-click script:

Code: Select all

"Toggle Full Row Select"
  #404; // Tools | Customize List | Full Row Select
  CTBState(! CTBState()); // Toggles CTB's state.
I'd add this to the right-click script so you can reset the button's state without affecting the option:

Code: Select all

"Toggle Button State" CTBState(! CTBState()); // Toggle CTB's state
And then I'd call it a day. ;)

TSS
Posts: 24
Joined: 24 May 2013 18:00

Re: full row select on custom button

Post by TSS »

Thank You TheQwerty !
That's what I'm looking for! I know there will be no effect when I select it via "customize list" drop down menu, but now when I have dedicated button for that - I'm gonna using it instead drop down menu or key-shortcut! Also your right-click button state is very handy to change it for some reason.

summing: thank you all for your help! I got what I wanted. :)

Post Reply