I'm in the middle of making a Directory Opus Cleaner button (like CCleaner for Opus, but as a jscript button implemented purely with Opus' scripting capabilities and no third-party externals) to detect invalid paths in Opus' "Favorites", "Folder Aliases", "Path Labels" and "Tab Groups" and clean them away right from Opus.
More
(This is in fact the reason why I've asked for a recently-implemented Check List Box, thanks Jon!)
The "Tab Groups" category is missing for now...
Now, I've sorted out practically everything except how to graphically present the "Tab Groups" in the GUI?
I could use the additional Opus' Tab Control with listboxes inside, but I don't think Tab Control supports scrolling (overflow)? I'd need a way to display the parent objects (i.e., saved Tab Group/title) and child sub-objects (i.e., individual tabs in that group) and those child-objects must be presented as checkboxes one way or another. Both the parent and child objects would have to be scrollable (as there could be "infinite" number of them) and they would be created in runtime.
So the question is: what existing Opus Script Dialog Control(s) could be used to present Tab Groups?
Maybe a list of tab groups at the top, and then a list of the tabs in the selected group at the bottom.
If the tab group has tabs for both left and right, you could either have two lists in the bottom half, side by side, or have a single list with a Left/Right column.
I've decided to go with this approach. How do you recommend I resize these bottom two lists horizontally when the user resizes the main window? Resizing the left one is not a problem, but the right one gets in way... and I'd like them to be split evenly across the main window width. I guess I could do that dynamically in code, but there doesn't seem to be any method for getting & setting the size of controls & dialogs (there's MoveItem but I didn't play with it yet, I guess I can at least use that for setting the position of the right list)?
I'll release it here once it's reasonably polished and tested a bit
This possibility has been added in the new beta 12.7.3:
Script dialog controls now have properties and methods to get and set their position within the client area of the dialog. The properties x, y, cx and cy let you get and set the left, top, width and height of the control. The SetPos, SetSize and SetPosAndSize methods let the position and size be set in a single call.
Thanks!
However, I can't process the detached dialog's resize events because they don't exist(?), and the event while loop -- Opus seems to process it efficiently -- which means only when there is some event (and not e.g., every frame or something) so I can't keep setting the controls to correct position/dimensions that way either (not that I would be happy about that way ).
I have a problem with the control's height behaving erratically if I change its cx: listviewTgLeft.cx = listviewTabGroups.cx / 2;
The automatic H resize is set and I don't touch it in the code, but as soon as I modify the cx in code AND the user resizes the window vertically, the control's height starts drifting seemingly randomly (sometimes it shrinks, sometimes it expands). But cx relates to width and not height and should be unrelated, and shouldn't affect the automatic H sizing by the layout?
Could be a bug?
Please check the attached minimum button with example (try to resize the window vertically rapidly). Min test.7z (1.2 KB)
UPDATE: it seems the speed of resizing affects the behavior (slow enough and the H doesn't move at all), it's as if some delta_t gets jumpy.