AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Gui, Submit - opposite

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
dncarac



Joined: 31 Aug 2006
Posts: 64

PostPosted: Sun Dec 23, 2007 8:41 pm    Post subject: Gui, Submit - opposite Reply with quote

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
View user's profile Send private message
tic



Joined: 22 Apr 2007
Posts: 1375

PostPosted: Sun Dec 23, 2007 11:42 pm    Post subject: Reply with quote

There is. Thats what the x, y,w,h are for.
Back to top
View user's profile Send private message
dncarac



Joined: 31 Aug 2006
Posts: 64

PostPosted: Mon Dec 24, 2007 1:26 am    Post subject: Reply with quote

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
View user's profile Send private message
Lexikos



Joined: 17 Oct 2006
Posts: 2739
Location: Australia, Qld

PostPosted: Mon Dec 24, 2007 2:53 am    Post subject: Reply with quote

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
View user's profile Send private message
dncarac



Joined: 31 Aug 2006
Posts: 64

PostPosted: Mon Dec 24, 2007 1:56 pm    Post subject: Reply with quote

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
View user's profile Send private message
Lexikos



Joined: 17 Oct 2006
Posts: 2739
Location: Australia, Qld

PostPosted: Mon Dec 24, 2007 2:47 pm    Post subject: Reply with quote

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
View user's profile Send private message
dncarac



Joined: 31 Aug 2006
Posts: 64

PostPosted: Mon Dec 24, 2007 3:13 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group