Frame/Panel with scrollbar?

For questions and postings not covered by the other forums
AndrewHC
Posts: 5
Joined: Sat May 29, 2010 4:16 pm

Frame/Panel with scrollbar?

Postby AndrewHC » Sun Jul 25, 2010 8:49 pm

Is there any equivalent of a .NET Panel in JADE? I'd like to add devices to a frame/panel at run-time, but I'm not sure on the number of elements. Because the standard JADE frame doesn't have a scrollbar, if I add more items than it can show, the extra items are hidden.

A workaround I can think of is having the frame expand when it has more items than can be shown, which would use the form's scrollbar to scroll up/down. It would look weird having the bottom of the frame cut off though.

Is there a "proper" way to show a group of components within a larger component, and have the larger component scroll when there's too many items?

User avatar
Dino
Posts: 49
Joined: Wed Jun 24, 2009 6:55 am
Location: London
Contact:

Re: Frame/Panel with scrollbar?

Postby Dino » Mon Jul 26, 2010 1:12 am

Try using a Picture control as the container. Picture controls support scroll bars. If you want to keep the beveled borders of the Frame control, then you could put a borderless Picture control inside the Frame. When you add your controls to the Picture, keep track of the bottom position (top + height) of the lowest control. If this is more than the client height of the Picture then add a vertical scroll bar, otherwise remove the vertical scroll bar. You could do this check immediately after adding controls to the Picture, as well as when the Form resizes. For example:

Code: Select all

resize() updating; begin if pic.clientHeight < self.lowestCtrlBottom then pic.scrollBars := ScrollBar_Vertical; else pic.scrollBars := ScrollBars_None; endif; end;
Hope this helps.

Dean.

AndrewHC
Posts: 5
Joined: Sat May 29, 2010 4:16 pm

Re: Frame/Panel with scrollbar?

Postby AndrewHC » Mon Jul 26, 2010 9:27 am

Brilliant idea! Pictures support a border style of 3D sunken, which works well. Thank-you Dino.


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 7 guests

cron