Welcome to Foxite.COM Community Weblog Sign in | Join | Help



SplitterBar class

I've developed a SplitterBar class and would like to receive some feedback about them.

Features:
- Anchor
- Collapse/expand "panels"

Download the post attachment file below and unzip them.
Open the project and run Form1, Form2 and Form3 samples.
Try to "resize" the panels or click on the "arrows".

The class will only work with VFP 9.

Please, send suggestions or report bugs.

This class is based on Christof Wollenhaupt class.

Published Wednesday, November 01, 2006 6:43 PM by emersonreed
Filed Under:
Attachment(s): SplitterBar.zip

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: SplitterBar class

Thursday, November 02, 2006 11:40 AM by Juan Antonio Santana Medina
Hi Emerson It´s good, but it only works with two objects and you have to use two different classes for vertical and horizontal splitters.
What I would do is having a property that indicates it it´s a vertical or horizontal splitter, another one to check wether collapsing is allowed or not and one more for checking the collapsing status, so you do not have to check the caption of the label.
To make it work with more that one object what you can try is looping the object collection of the splitter container (Splitter.Parent) and checking the relative position about the splitter. It will be at the left if Obj.Left<=Splitter.Left, at the right if Obj.Left>Splitter.Left, and so on.

I will try to do what I´m writting.

Cheers.

# re: SplitterBar class

Thursday, November 02, 2006 12:02 PM by Horacio Giménez
Emerson, te escribo en español. Me es más sencillo.
La clase me parece muy útil, fácil de usar, fantástica. Gracias por compartirla.
Un detalle que he observado: cuando deba colocarse un objeto que no posea la propiedad Anchor, (como un grid), debería poderse ampliar sus dimensiones de acuerdo al tamaño final del contenedor. ¿Cual es tu pensamiento al respecto?

# re: SplitterBar class

Thursday, November 02, 2006 12:23 PM by Horacio Giménez
Emerson, prdón, rectifico lo que dije del anchor.
Debo estar dormido aún.
Funciona correctamente, es bárbara.
Nuevamente perdón.

# re: SplitterBar class

Monday, November 06, 2006 7:26 PM by emersonreed
Hi Juan!

1- I'm using two different classes (horizontal and vertical) to give at design time a better view of how splitter will be at run time.

2- I'm using two objects with the splitter because it will "separate" two areas. If you want to use more controls, you can use a container and put the controls inside them. This way is more simple and faster than check all objects each time the splitter is "moved" and you can anchor the objects inside container as you want.

3- I will add a property to know if a panel is "collapsed" instead of check Caption.

Tks for your suggestions!

What do you think?

(required) 
required 
(required)