Previous Thread
Next Thread
Print Thread
LEO dialog pos variables #28696 10 Mar 09 01:03 PM
Joined: Nov 2006
Posts: 2,192
S
Stephen Funkhouser Online Content OP
Member
OP Online Content
Member
S
Joined: Nov 2006
Posts: 2,192
Hi Jorge, could add an option to pass the dialogs position to the load'dialog() procedure, rather than them being hard coded into the XCALL AUI that creates the dialog?


Stephen Funkhouser
Diversified Data Solutions
Re: LEO dialog pos variables #28697 10 Mar 09 05:22 PM
Joined: Jun 2001
Posts: 3,376
J
Jorge Tavares - UmZero Online Content
Member
Online Content
Member
J
Joined: Jun 2001
Posts: 3,376
Sure...

What do you think about add a checkbox ("use arguments") in the coordinates panel to define that, ALL the currently selected controls should receive in their corresponding function/procedure their coordinates in arguments?

This way we extend this to any control, and allow multi-selection.


Jorge Tavares

UmZero - SoftwareHouse
Brasil/Portugal
Re: LEO dialog pos variables #28698 10 Mar 09 08:38 PM
Joined: Nov 2006
Posts: 2,192
S
Stephen Funkhouser Online Content OP
Member
OP Online Content
Member
S
Joined: Nov 2006
Posts: 2,192
Yeah, that sounds good.


Stephen Funkhouser
Diversified Data Solutions
Re: LEO dialog pos variables #28699 15 Apr 09 08:57 AM
Joined: Nov 2006
Posts: 2,192
S
Stephen Funkhouser Online Content OP
Member
OP Online Content
Member
S
Joined: Nov 2006
Posts: 2,192
Hi Jorge,

Just curious as to when you think there might be a LEO update w/ this feature?


Stephen Funkhouser
Diversified Data Solutions
Re: LEO dialog pos variables #28700 15 Apr 09 11:25 AM
Joined: Jun 2001
Posts: 3,376
J
Jorge Tavares - UmZero Online Content
Member
Online Content
Member
J
Joined: Jun 2001
Posts: 3,376
Well reminded, this was already on my hands when something crossed the way and put me on another direction, let's see if I can solve it right now.


Jorge Tavares

UmZero - SoftwareHouse
Brasil/Portugal
Re: LEO dialog pos variables #28701 16 Apr 09 03:10 AM
Joined: Jun 2001
Posts: 3,376
J
Jorge Tavares - UmZero Online Content
Member
Online Content
Member
J
Joined: Jun 2001
Posts: 3,376
Hi Stephen,

It's published a rough version for handling control coordinates as arguments.
In the "coordinates" panel, below the row/col fields, there are a new checkbox "use arguments".
Besides you can check it for any control, by now, it only processes it for the Dialog so, when checked for the Dialog, on generating code the following happens:

Main program:

call dlg_1_load'dialog(dlg_1'dlgid, 0, 5000 , 5000 , 20000 , 55000 )

GEN file:

PROCEDURE dlg_1_load'dialog(dlg'id as b4,dlg'parent'id as b4,srow as b4, scol as b4, erow as b4, ecol as b4)
++pragma auto_extern

xcall AUI, AUI_CONTROL, CTLOP_ADD, "args.dlg_1", "dlg_1", 0, &
MBF_DIALOG+MBF_SYSMENU+MBF_DLGNOCREEP+MBF_ALTPOS, "", "", dlg'id, &
srow, scol, erow, ecol, -2, -2, 0, 0, "", "", dlg'parent'id

call dlg_1_screen'layout()
xputarg 1,dlg'id

ENDPROCEDURE


I think that, this completely solves the case where you want to define startup coordinates for the Dialog where you just need to substitute the absolute values for the coordinates by your variables, or other absolute values, on calling the load'dialog procedure.

This doesn't solve the case where you want to change the coordinates in the middle of your program.
Here was where I stopped to listen for suggestions before staring to waste time on unnecessary things.

As I suggested previously, in this version, is already possible to define any control with "use arguments", including when there are multiple controls selected but, this is useless if nothing is done on generating code.
Let me add that, there are no particular difficulty to add this to all controls, it's just a matter of being reasonable.

The "problem" of the arguments are the definition of external variables to be sent into the corresponding AUI control PROCEDURE.
Defining those variables also is not a problem, I just don't know if coordinate changes should be programmed inside the GEN file.
To change the coordinates of an AUI control, we just need to know the ID or ID$ of the control and execute:
xcall AUI, AUI_CONTROL, CTLOP_CHG, ID$, "", MBST_CHGALL, ... , new'srow, new'scol, new'erow, new'ecol

In my opinion, it would make sense to consider coordinate arguments for any control if, on startup, their coordinates can vary.

Opinions are welcome, even from those who don't use Leo, what I want to know is which cases do you have about changing control coordinates.

Thanks


Jorge Tavares

UmZero - SoftwareHouse
Brasil/Portugal
Re: LEO dialog pos variables #28702 16 Apr 09 10:01 AM
Joined: Nov 2006
Posts: 2,192
S
Stephen Funkhouser Online Content OP
Member
OP Online Content
Member
S
Joined: Nov 2006
Posts: 2,192
First, I think that it would be really good to be able to do this for any control. You could add srow,scol,erow,ecol variables to the state'value$ and infld'state'values arrays. In this case rather than making the position arguments part of the function and procedure calls you'd just use the values currently in the arrays. You could also create a procedure to set the defaults defined in LEO that could be optionally called from load'dialog() based on a a new argument passed to load'dialog(), defaulting to call the defaults procedure.

The dlg'ordslt_state'control() procedure would probably be the best place to do the AUI_CONTROL changes.

I'm not exactly sure what would be the best way to handle SBXINP inputs. The best thing might be to delete the dialog and then recreate it w/ with the coordinate variables set in the array?

Secondly, here is the topic that brought this up

Resizing Dialog

I did accomplish resizing a dialog, here are snapshots of it.

Dialog before expansion
[Linked Image]

Dialog after expansion
[Linked Image]

So, here's how I acheived this (this procedure is called when the blue expand and contract buttons are clicked)

Code
PROCEDURE dlg'ordslt_dialog_resize(dlg'id as b4,cstate as b4,ctext$ as S32,dlg'parent'id as b4)
++PRAGMA AUTO_EXTERN

	!delete dialog probably should check to see if it's a valid control so we can use this on original creation
	!of the dialog in case we wan't to create the dialog expanded to start with
	XCALL AUI, AUI_CONTROL, CTLOP_DEL, "dlg'ordsldlg'ordslt"

	SWITCH dlg'ordslt_expand
		CASE true                                                       ! expand dialog and display xtr'que
			!set button states
			dlg'ordslt_state'value$(dlg'ordslt_BTN'EXPAND)	= MBST_DISABLE
			dlg'ordslt_state'value$(dlg'ordslt_BTN'COLLAPSE)	= MBST_ENABLE
			dlg'ordslt_state'value$(dlg'ordslt_BTN'ADD)		= MBST_ENABLE
			dlg'ordslt_state'value$(dlg'ordslt_BTN'REMOVE)	= MBST_ENABLE

			!create dialog and all controls expanded
			CALL dlg'ordslt_load'dialog(dlg'id,cstate,ctext$,0,30000)

			!create order selection xtree
			CALL xtr'ordslt_set_opcode(XTROP_CREATE)
			CALL xtr'ordslt_set_xtrflags(3)
			CALL fn'xtr'ordslt_do'xtree()

			!create order que xtree
			CALL xtr'que_set_xtrctl(dlg'id,21,1,29,51)
			CALL xtr'que_set_coldef()
			CALL xtr'que_set_xtrflags(3)
			CALL fn'xtr'que_do'xtree()

			EXIT
		CASE false                                                      ! collapse dialog and don't display xtr'que
			!set button states
			dlg'ordslt_state'value$(dlg'ordslt_BTN'EXPAND)	= MBST_ENABLE
			dlg'ordslt_state'value$(dlg'ordslt_BTN'COLLAPSE)	= MBST_DISABLE
			dlg'ordslt_state'value$(dlg'ordslt_BTN'ADD)		= MBST_DISABLE
			dlg'ordslt_state'value$(dlg'ordslt_BTN'REMOVE)	= MBST_DISABLE

			!create dialog and all controls contracted
			CALL dlg'ordslt_load'dialog(dlg'id,cstate,ctext$,0,21000)

			!create order selection xtree
			CALL xtr'ordslt_set_opcode(XTROP_CREATE)
			CALL xtr'ordslt_set_xtrflags(3)
			CALL fn'xtr'ordslt_do'xtree()
			EXIT
	ENDSWITCH

	!return the newly created dialogs id
	XPUTARG 2,dlg'id

ENDPROCEDURE


Stephen Funkhouser
Diversified Data Solutions
Re: LEO dialog pos variables #28703 16 Apr 09 10:05 AM
Joined: Nov 2006
Posts: 2,192
S
Stephen Funkhouser Online Content OP
Member
OP Online Content
Member
S
Joined: Nov 2006
Posts: 2,192
Also, my suggestion here would probably make the "use arguments" option be applied to the dialog and all of it's controls if turned on, rather than individual controls?


Stephen Funkhouser
Diversified Data Solutions
Re: LEO dialog pos variables #28704 20 Apr 09 06:32 PM
Joined: Nov 2006
Posts: 2,192
S
Stephen Funkhouser Online Content OP
Member
OP Online Content
Member
S
Joined: Nov 2006
Posts: 2,192
Jorge,

Just curious if you have an opinion about my suggestion here?


Stephen Funkhouser
Diversified Data Solutions
Re: LEO dialog pos variables #28705 20 Apr 09 08:01 PM
Joined: Jun 2001
Posts: 3,376
J
Jorge Tavares - UmZero Online Content
Member
Online Content
Member
J
Joined: Jun 2001
Posts: 3,376
Your suggestion is also my opinion about how this should work, it's not forgotten, I just need some extra-time to implement it, but it will be soon.


Jorge Tavares

UmZero - SoftwareHouse
Brasil/Portugal
Re: LEO dialog pos variables #28706 21 Apr 09 08:02 AM
Joined: Nov 2006
Posts: 2,192
S
Stephen Funkhouser Online Content OP
Member
OP Online Content
Member
S
Joined: Nov 2006
Posts: 2,192
Cool, no rush. I was just curious what you thought.


Stephen Funkhouser
Diversified Data Solutions

Powered by UBB.threads™ PHP Forum Software 7.7.3