[Class] Rebar - Adjustable GUI controls (Updated 03/17/2016)

Post your working scripts, libraries and tools
User avatar
Pulover
Posts: 365
Joined: 29 Sep 2013, 19:51
Location: Brazil
Contact:

[Class] Rebar - Adjustable GUI controls (Updated 03/17/2016)

04 Oct 2013, 07:31

This class attempts to provide intuitive methods to work with rebars created using Gui Custom controls.

A Rebar control acts as a container for child windows. It can contain one or more bands, and each band can have any combination of a gripper bar, a bitmap, a text label, and one child window. An application assigns a child window—typically another control— to a rebar control band. As you dynamically reposition a rebar control band, the rebar control manages the size and position of the child window assigned to that band. Also, an application can specify a background bitmap for a band, and the rebar control will display the band's child window over the bitmap. -- MSDN

Screenshot:
Image

Features:
  • Insert bands with any control.
  • Add text, image icon and background for each band.
  • Save and load layouts.
  • Retrieve and change information of bar and each band.

:arrow: Sources, documentation and examples on GitHub

Reference: Rebar (MSDN)
Last edited by Pulover on 17 Mar 2016, 06:19, edited 4 times in total.
Rodolfo U. Batista
Pulover's Macro Creator - Automation Tool (Recorder & Script Writer)
User avatar
Chef
Posts: 50
Joined: 14 Nov 2013, 13:01

Re: [Class] Rebar - Adjustable GUI controls

22 Nov 2013, 12:31

Very nice, time to rewrite few scripts Image
User avatar
Pulover
Posts: 365
Joined: 29 Sep 2013, 19:51
Location: Brazil
Contact:

Re: [Class] Rebar - Adjustable GUI controls

16 Mar 2016, 19:52

Update:
  • Updated class to new AHK Object methods.
Rodolfo U. Batista
Pulover's Macro Creator - Automation Tool (Recorder & Script Writer)
User avatar
CheshireCat
Posts: 6
Joined: 07 Mar 2016, 15:58

Re: [Class] Rebar - Adjustable GUI controls (Updated 03/17/2016)

03 Apr 2016, 19:43

Hi,
This is awesome. I have used the Rebar library by majkinetor previously but I think this one is more user friendly.
I have a few questions however. I am interested in using a Rebar mainly because it has a "splitter" or "separator". I've made a GUI that has a listbox on the left side of the window with a drop down box above it, and then a tab control on the right side. I can set two Rebar bands (as used in your Rebar_Multiple example on GitHub) with one band having a GUI with the dropdown list and listbox, and the second band with the tab control and any other controls, etc.
My question is how can I implement the "SetMaxRows()" method in order to limit the max rows to be only 1? ie: both bands being side by side without the ability to stack the bands above or below one another.

Any insight or assistance would be great.

Thank you.
User avatar
Pulover
Posts: 365
Joined: 29 Sep 2013, 19:51
Location: Brazil
Contact:

Re: [Class] Rebar - Adjustable GUI controls (Updated 03/17/2016)

03 Apr 2016, 22:13

Hello CheshireCat,
Thank you for the feedback, it's good to know that this class is being useful. :D

Well, SetMaxRows(1) seems to work. You just can't forget to implement OnNotify(). I have found your description interesting and thought I should include an example of split panels with resizable controls in the repo.

This is the new demo, it should help you get this splitter done. I've set a few styles to make it look good for this purpose.

Code: [Select all] [Expand] [Download] (SplitPanels.ahk)GeSHi © Codebox Plus

The only thing that doesn't work when I make controls resizable is the minWidth of the bands... Probably another bug in MS control.

Let me know if you have more doubts.
Last edited by Pulover on 04 Apr 2016, 00:15, edited 1 time in total.
Rodolfo U. Batista
Pulover's Macro Creator - Automation Tool (Recorder & Script Writer)
User avatar
CheshireCat
Posts: 6
Joined: 07 Mar 2016, 15:58

Re: [Class] Rebar - Adjustable GUI controls (Updated 03/17/2016)

03 Apr 2016, 23:44

Ahhhh, wow, that's exactly what I had in mind. I thought it would be harder to code. As I start using it I'm sure I'll have more questions, but that was excellent.
Thank you so much for your prompt response and example. :)
User avatar
evilC
Posts: 3428
Joined: 27 Feb 2014, 12:30

Re: [Class] Rebar - Adjustable GUI controls (Updated 03/17/2016)

04 Sep 2016, 15:27

Hi, I need something like Rebar for UCR (See sig).
However, UCR uses AHK_H, and we have support for resizable guis + guicontrols in AHK_H, so I was wondering if there is any code in this project which would help me.

Here is a mockup of the GUI that I have, laid out using AHK_H's layout system. I would want to be able to resize the divide between the red and blue GUIs

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus


Return to “Scripts and Functions”

Who is online

Users browsing this forum: No registered users and 9 guests