Re: xControls Questions

new topic     » goto parent     » topic index » view thread      » older message » newer message

----- Original Message -----
>From: "C. K. Lester" <cklester at yahoo.com>
>To: "EUforum" <EUforum at topica.com>
>Subject: xControls Questions
>

>
>I'm trying to control the size and position of a
>group and its elements. For instance, I have a list
>control and two buttons inside of a group. I have
>gotten the group widget to size when the window is
>resized, but I can't figure out how to keep the
>list control and buttons relatively positioned.
>Can somebody provide code for that, or is there
>a hint/trick to it?
>
>__Group_______
>| _________  |
>| |List   |  |
>| |       |  |
>| |       |  |
>| |       |  |
>| |       |  |
>| |       |  |
>| ---------  |
>| Btn1 Btn2  |
>--------------

I do this sort of thing all the time. The first step is to write down what
are the relationships you want to preserve. For this example, I'll guess the
following...

The top edge of List is always x1 pixels from the top edge of Group.
The left edge of List is always x2 pixels from the left edge of Group.
The right edge of List is always -x3 pixels from the right edge of Group.
The bottom edge of List is always -x4 pixels from the top edge of Btn1.
The left edge of Btn1 is always the same as List.
The width of Btn1 is always x5 pixels.
The height of Btn1 is always x6 pixels.
The right edge of Btn2 is always the same as the right edge of List.
The top of Btn2 is always the same as the top of Btn1.
The width of Btn2 is always x7 pixels.
The height of Btn2 is always x6 pixels.
The bottom of Btn1 is always -x8 pixels from the bottom edge of Group.

Now order these rules based on their dependancies. In this case, apply the
rules that related to the Group edges first.

The top edge of List is always x1 pixels from the top edge of Group.
The left edge of List is always x2 pixels from the left edge of Group.
The right edge of List is always -x3 pixels from the right edge of Group.
The bottom of Btn1 is always -x8 pixels from the bottom edge of Group.

Now that these have been 'fixed', apply the next rules related to the fixed
edges.

The left edge of Btn1 is always the same as List.
The right edge of Btn2 is always the same as the right edge of List.
The top of Btn2 is always the same as the top of Btn1.
The width of Btn2 is always x7 pixels.
The height of Btn2 is always x6 pixels.
The width of Btn1 is always x5 pixels.
The height of Btn1 is always x6 pixels.

Finally, apply the remaining rule.

The bottom edge of List is always -x4 pixels from the top edge of Btn1.


Hope this helps.
----------------
cheers,
Derek Parnell

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu