what is the difference in GridBag Position and span?

hello, as I mentioned before in a previous email, I was wondering how
to use a box layout system with horizontal and vertical boxes to lay
out my screen which has 2 pares of lables and textboxes in a single
row and then a row of about 6 buttons at the bottom of the screen,
just above the status bar.
I had got good feedback and guidance on this issue thanks to tacao in
particular.
I am trying now to understand the gridbag layout and wonder how to add
uneven gaps between controls and is it possible to make the controls
like buttons or lables in different sizes?
I am actually confused between how GBPosition and span work together?
for example if I add a spacer between a lable and text box to occupy
just 5 pikcells and after the first pare of lable-textbox ad a big
horizontal gap of 50 pikcells does it mean that the position should
have 50 as its column parameter or should span have 50 to span 50
columns?
can some one explain me the actual meaning of position and span and
where and how it applies?
and can I make buttons of different sizes or text boxes of different
sizes when using a gridbag?
regards,
Krishnakant.

Sunday, May 6, 2007, 5:56:11 AM, krishnakant Mane wrote:

I am trying now to understand the gridbag layout and wonder how to
add uneven gaps between controls and is it possible to make the
controls like buttons or lables in different sizes?

Yes. The code I sent previously has buttons, text ctrls and static
texts. The size of the buttons is different than the size of the text
ctrls and is different from the static texts.

I am actually confused between how GBPosition and span work together?
for example if I add a spacer between a lable and text box to occupy
just 5 pikcells and after the first pare of lable-textbox ad a big
horizontal gap of 50 pikcells does it mean that the position should
have 50 as its column parameter or should span have 50 to span 50
columns?

No. The keyword 'pos' in the sizer's Add method just tell the sizer
where in its grid it should place the widget (or spacer) that's being
added. It has absolutely nothing to do with the size of the widget (or
spacer).

The keyword 'span' in the GridBagSizer's Add method is optional and
you may pass it when you want to place a widget in the sizer so that
it spans more than one row and/or column.

-- tacao

No bits were harmed during the making of this e-mail.

Hi Krishnakant,

krishnakant Mane wrote:

hello, as I mentioned before in a previous email, I was wondering how
to use a box layout system with horizontal and vertical boxes to lay
out my screen which has 2 pares of lables and textboxes in a single
row and then a row of about 6 buttons at the bottom of the screen,
just above the status bar.
I had got good feedback and guidance on this issue thanks to tacao in
particular.
I am trying now to understand the gridbag layout and wonder how to add
uneven gaps between controls and is it possible to make the controls
like buttons or lables in different sizes?
I am actually confused between how GBPosition and span work together?
for example if I add a spacer between a lable and text box to occupy
just 5 pikcells and after the first pare of lable-textbox ad a big
horizontal gap of 50 pikcells does it mean that the position should
have 50 as its column parameter or should span have 50 to span 50
columns?
can some one explain me the actual meaning of position and span and
where and how it applies?
and can I make buttons of different sizes or text boxes of different
sizes when using a gridbag?

The position defines which row and column you place a control within the grid and span allows you to define if a control can span into adjoining rows and/or columns.

I think most if not all of what you explain above is possible using one or more sizers. Just one thing the gbs places controls into rows and columns and not pixels - although you can define row and/or column spacing and border in pixels.

Why don't you put a small sample together using a gridbagsizer and then if you have a problem post the sample here and I am sure that people will look at it and propose solutions to your problem.

Best regards
Werner

hello,
I have only one confusing factor now.
I am not understanding how to add absolute blank space in a vertical
orientation
I will give an example.
I have 4 rows of static text and edit boxes.
and after those 4 rows I want to leave a blank space and after that in
one row just above the status bar, I want tpu put a row of buttons.
so if we were to asume that screen can take 60 rows, my first 4 rows r
filled and then I leave a gap of 46 rows and then put a box sizer
which can span about 6 rows and the entire column area.
I have 8 columns in my grid.
so how do I just leave empty space after my 4 rows of lable-text box pares?
is it ok just to leave a few rows blank and then put the horizontal
box on the row where I want it to be? will that create the blank
space?
if this is possible then can I put horizontal boxes inside flex grids
which will span all the columns and add controls to those boxes? is
it a practical solution to work out?
I will make a small demo of my ideas with the help of some feedback on
my above questions.
then some one might just look at the code and suggest some more ideas.

regards.
Krishnakant.

Sunday, May 6, 2007, 12:26:23 PM, krishnakant Mane wrote:

hello,
I have only one confusing factor now.
I am not understanding how to add absolute blank space in a vertical
orientation
I will give an example.
I have 4 rows of static text and edit boxes.
and after those 4 rows I want to leave a blank space and after that in
one row just above the status bar, I want tpu put a row of buttons.
so if we were to asume that screen can take 60 rows, my first 4 rows r
filled and then I leave a gap of 46 rows and then put a box sizer
which can span about 6 rows and the entire column area.

There's no need to do that. Try to use the minimum number of rows and
columns to do that. (Simple is better than complex :)). Fill the first
4 rows (0-3) with static texts and text ctrls, then add your box sizer
to the row #5.

I have 8 columns in my grid. so how do I just leave empty space
after my 4 rows of lable-text box pares? is it ok just to leave a
few rows blank and then put the horizontal box on the row where I
want it to be? will that create the blank space?

It's ok to leave rows and/or columns blank. Again, try to use the
minimum number of them. The GridBagSizer by default leaves a space
(not a spacer) automatically on unused cells. If you want more space,
you can add a spacer somewhere in your row #4.

if this is possible then can I put horizontal boxes inside flex
grids which will span all the columns and add controls to those
boxes? is it a practical solution to work out?

I'm not sure if you can span cells on any sizer except the
GridBagSizer.

-- tacao

No bits were harmed during the making of this e-mail.