Jump to content
Sign in to follow this  
KSum

Relative aligning columns

Recommended Posts

Hello all,

When placing controls with GUICoordMode set to 2 (cell) how do I make 2 columns of cells relative to each other without bouncing between coordinate modes? I know that below will create items neatly one next to another, with the first label neatly aligned below the last control:

GUICtrlCreateLabel ("Done 1", -1, 0) ; next line

GUICtrlCreateLabel ("Done 3", 0, -1) ; next cell same line

but I want to then go the the start of the next line, below the first label, and place 2 more labels. What I get instead, is either items below the last item, or below and right of the last item. Is there anything that might go back 2 positions and thus realign with the first cell?

GUICtrlCreateLabel ("Done 1", -1, 0) ; next line

GUICtrlCreateLabel ("Done 3", 0, -1) ; next cell same line

GUICtrlCreateLabel ("Done 2", -1, [back2]) ; next line back 2 cells

GUICtrlCreateLabel ("Done 4", 0, -1) ; next cell same line

What I am after would look like:

Done 1 Done 3

Done 2 Done 4

Any thoughts? For now I create the first column, change coordinate modes and setting a new column with an absolute position. It works, but i thought there might be something cleaner that I am missing.

Regards,

Karl Sumwalt

Share this post


Link to post
Share on other sites

Hello all,

When placing controls with GUICoordMode set to 2 (cell) how do I make 2 columns of cells relative to each other without bouncing between coordinate modes?  I know that below will create items neatly one next to another, with the first label neatly aligned below the last control:

GUICtrlCreateLabel ("Done 1",  -1, 0)  ; next line

GUICtrlCreateLabel ("Done 3",  0, -1)  ; next cell same line

but I want to then go the the start of the next line, below the first label, and place 2 more labels.  What I get instead, is either items below the last item, or below and right of the last item.  Is there anything that might go back 2 positions and thus realign with the first cell?

GUICtrlCreateLabel ("Done 1",  -1, 0)  ; next line

GUICtrlCreateLabel ("Done 3",  0, -1)  ; next cell same line

GUICtrlCreateLabel ("Done 2",  -1, [back2])  ; next line back 2 cells

GUICtrlCreateLabel ("Done 4",  0, -1)  ; next cell same line

What I am after would look like:

Done 1    Done 3

Done 2    Done 4

Any thoughts?  For now I create the first column, change coordinate modes and setting a new column with an absolute position.  It works, but i thought there might be something cleaner that I am missing.

Regards,

Karl Sumwalt

<{POST_SNAPBACK}>

Woah that's a long time I did this function. I was thinking it was a good way to do what you want. In fact JON (autoIT creator) was not liking this mode.

I need to think about again

THanks for your involment in AutoIt :(

Share this post


Link to post
Share on other sites

I reread what I did and there is a solution which was not so well documented :(

The 0,-1 means same line for the -1 but 0 means offset=0 for the next cell so if you use (-2-1)*$cellwidth you will be back with 2 positions :(

I will update the doc on Opt("GUICoordMode",2). At a time this was describe in the GUI reference but after cleaning it just disapear from the help.

Share this post


Link to post
Share on other sites

if you use (-2-1)*$cellwidth  you will be back with 2 positions :(

<{POST_SNAPBACK}>

This seems to be what I am looking for. I gave it a try, and had an error stating the variable, $cellwidth, is not declareed. I also tried changing it to match other built in GUI variable names:

$GUICELLWIDTH

$GUI_CELLWIDTH

$GUI_CELL_WIDTH

all with the same error. Has this been pulled out, or do I have to define it myself? I searched the help for Cell and only came up with 3 entries, none of which mentioned a cell width value.

Karl

Share this post


Link to post
Share on other sites

This seems to be what I am looking for.  I gave it a try, and had an error stating the variable, $cellwidth, is not declareed.  I also tried changing it to match other built in GUI variable names:

$GUICELLWIDTH

$GUI_CELLWIDTH

$GUI_CELL_WIDTH

all with the same error.  Has this been pulled out, or do I have to define it myself?  I searched the help for Cell and only came up with 3 entries, none of which mentioned a cell width value.

Karl

<{POST_SNAPBACK}>

Sorry I should have explain that when you defined the first cell you should use a variable as $cellwidth you have defined before to set the cell width. you could have to do the same with cell height. Afteryou use those variables to navigate between cells. :(

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...