| View previous topic :: View next topic |
| Author |
Message |
dncarac
Joined: 31 Aug 2006 Posts: 64
|
Posted: Sun Dec 23, 2007 8:41 pm Post subject: Gui, Submit - opposite |
|
|
Gui, Submit will traverse all the controls and transfer the contents of the controls to the associated variables.
What I'm doing is an editor to generate a control file for a program. I can generate a GUI, fill it in, perform a Gui,Submit, then write the file from the associated variables.
What I'd like to do is be able to read a previously generated file and perform the opposite of the Gui, Submit - that is, take the file data, and transfer it to the associated controls on the GUI.
I am doing a whole series of Gui Controls. And I have to keep the series up to date as I add and delete controls. But for completeness sake, there should be an opposite function.
DNC |
|
| Back to top |
|
 |
tic
Joined: 22 Apr 2007 Posts: 1375
|
Posted: Sun Dec 23, 2007 11:42 pm Post subject: |
|
|
| There is. Thats what the x, y,w,h are for. |
|
| Back to top |
|
 |
dncarac
Joined: 31 Aug 2006 Posts: 64
|
Posted: Mon Dec 24, 2007 1:26 am Post subject: |
|
|
Sorry. But aren't w h x y related to location of a control?
I'm talking about a single function for simultaneously setting data from associated variables INTO all the controls (wherever they are located) -- the opposite of Gui, Submit, which gets data FROM all the controls and puts it in associated variables. |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 2739 Location: Australia, Qld
|
Posted: Mon Dec 24, 2007 2:53 am Post subject: |
|
|
That would be useful, but I think it doesn't exist yet. Assuming you can get the associated variables from the control file as a list, you could iterate through and use GuiControl on each control.
| Code: | | GuiControl,, %VarContainingVarName%, % %VarContainingVarName% |
The "% " would be necessary to retrieve the contents of the variable indirectly, given the variable's name. ("% " forces expression mode, then "%Var...%" performs a double-deref.) |
|
| Back to top |
|
 |
dncarac
Joined: 31 Aug 2006 Posts: 64
|
Posted: Mon Dec 24, 2007 1:56 pm Post subject: |
|
|
| Thanks. I had thought of that too. So, given that there is no existing function, is there some sort of "enumerate control IDs" function for a GUI? |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 2739 Location: Australia, Qld
|
Posted: Mon Dec 24, 2007 2:47 pm Post subject: |
|
|
| Not that I'm aware of. If you are restoring the control contents from a "previously generated file", do you not already have the list of IDs? |
|
| Back to top |
|
 |
dncarac
Joined: 31 Aug 2006 Posts: 64
|
Posted: Mon Dec 24, 2007 3:13 pm Post subject: |
|
|
I do, but I am in the process of adding and subtracting controls. Each time I do, I have to update the list of GuiControl's to update the control from the file data. Not really a big deal, but this leads to errors which have to be found and fixed.
If there were a Gui,Submit opposite, I could just execute that, and all variables which are associated with a control would update their control and I wouldn't have to worry about it. |
|
| Back to top |
|
 |
|