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 

redirect
Goto page Previous  1, 2
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Laszlo



Joined: 14 Feb 2005
Posts: 4078
Location: Pittsburgh

PostPosted: Sun Apr 10, 2005 12:27 am    Post subject: Reply with quote

Code:
Gui Submit
Back to top
View user's profile Send private message
corrupt



Joined: 29 Dec 2004
Posts: 2436

PostPosted: Sun Apr 10, 2005 1:03 am    Post subject: Reply with quote

GuiControlGet, OutputVar , , textbox
Back to top
View user's profile Send private message Visit poster's website
olaf
Guest





PostPosted: Wed Apr 20, 2005 7:10 am    Post subject: Reply with quote

yet another simple question for an answer I don't have.
How do I get the the command in another gui to act on, or do something in the main gui (or any other gui).
Here I'm trying to get the text from 2ndgui to display in the editbox in the 1st gui. If you run this as is, 2 text files will be created on your system.

Code:

IfNotExist, 1stguitext.txt
  {
  FileAppend, Text displayed from 1stgui., 1stguitext.txt
  }
IfNotExist, 2ndguitext.txt
  {
  FileAppend, Text displayed from 2ndgui., 2ndguitext.txt
  }

Gosub, 2ndguistuff

Gui, +Resize
Gui, 1:Add, Radio, x100 y35 vdisplayit Checked, Display
Gui, 1:Add, Radio, x200 y35, Unassigned
Gui, 1:Add, Button, x50 y85 w125 h27, &Go
Gui, 1:Add, Button, x200 y85 Default, &Quit
Gui, 1:Add, Button, x275 y85, Clear
Gui, 1:Add, Button, x350 y85 gOpen2ndgui, Goto&2ndgui
Gui, Font, S10 CDefault Norm, Verdana
Gui, 1:Add, Edit, x5 y150 w450 R10 vPostbox
Gui, Font,,
Gui, 1:Show,, 1stgui
Return

ButtonGo:
Gui, Submit, NoHide

if displayit=1
   {
      FileRead, outtobox, 1stguitext.txt
      Postbox := outtobox
      GuiControl,,Postbox, %Postbox%
      Postbox :=
   }
else
   {
      MsgBox, Nothing done in 1stgui
   }

Return

ButtonClear:
Postbox :=
GuiControl,,Postbox, %Postbox%
Return


;### 2nd gui
Open2ndgui:
   Gui, 2:Show, x250 y150, 2ndwindow
Return

2ndguistuff:
   Gui, 2:+ToolWindow +AlwaysOnTop
   Gui, 2:Add, Radio, vdisplayit2, display2
   Gui, 2:Add, Button,, 2go
   Gui, 2:Add, Button,, &Quit
   Gui, 2:Add, Button, ys gBtnCancel Default, Cancel
Return

2Button2go:
Gui, Submit, NoHide

if displayit2=1
   {
      FileRead, outtobox, 2ndguitext.txt
      Postbox := outtobox
      GuiControl,, Postbox, %Postbox%
      Postbox :=
   }
else
   {
      MsgBox, Nothing done in 2ndgui
   }
Return

2ButtonQuit:
Exitapp

2GuiClose:
2GuiEscape:
BtnCancel:
Gui, 2:Cancel
Return

ButtonQuit:
Gui, Destroy

GuiClose:
GuiEscape:
ExitApp
Back to top
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10480

PostPosted: Thu Apr 21, 2005 11:59 am    Post subject: Reply with quote

olaf wrote:
I'm trying to get the text from 2ndgui to display in the editbox in the 1st gui.
Here's a working example that demonstrates how to move text from one window to another. Hopefully its close to what you need:
Code:
; Window #1:
gui, add, Edit, r3 vEdit1, Enter some text to move.
gui, add, Button, gButtonMoveText, Move Text to Other Window

; Window #2
gui, 2:add, Edit, r3 vEdit2

gui, 2:show, y100
gui, show, y300
return

ButtonMoveText:
GuiControlGet, Edit1
GuiControl, 2:, Edit2, %Edit1%
return

GuiClose:
ExitApp
Back to top
View user's profile Send private message Send e-mail
olaf



Joined: 20 Apr 2005
Posts: 25

PostPosted: Fri Apr 22, 2005 1:05 am    Post subject: Reply with quote

Chris wrote:
Here's a working example that demonstrates how to move text from one window to another. Hopefully its close to what you need:


What was needed was the reverse, and added here, which I now understand from your script. Thanks for your help, Chris!

Code:

; Window #1:
gui, add, Edit, r3 vEdit1, Enter some text to move.
gui, add, Button, gButtonMoveText, Move Text to Other Window

; Window #2
gui, 2:add, Edit, r3 vEdit2, Enter text to move to Window1.
gui, 2:add, Button, gButtonMoveTo1, Move Text to Window 1
gui, 2:show, y100
gui, show, y300
return

ButtonMoveText:
GuiControlGet, Edit1
GuiControl, 2:, Edit2, %Edit1%
return

ButtonMoveTo1:
GuiControlGet, Edit2
GuiControl, 1:, Edit1, %Edit2%
return

GuiClose:
ExitApp

_________________
Berserker
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
Goto page Previous  1, 2
Page 2 of 2

 
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