kaufpark Posted November 16, 2017 Posted November 16, 2017 Hi AutoIt Community, I am new and hope that you have a tip for my simple question. I'm trying out Koda and looking for a way to output text. I found an input box - but is there an output box that can be built into the GUI? So almost like the MsgBox or ToolBox but just firmly integrated in the GUI? Thx, Kauf
Moderators JLogan3o13 Posted November 16, 2017 Moderators Posted November 16, 2017 Welcome to the forum. Look at GUICtrlCreateEdit in the help file. Look at the Styles to see how you would make it read only "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
aa2zz6 Posted November 16, 2017 Posted November 16, 2017 Is this supposed to be some type of log sheet built inside the GUI as your script is running?
kaufpark Posted November 17, 2017 Author Posted November 17, 2017 I mean it a little differently. I measure the temperature every 10 secounds via USB-RS232-microcontroller etc. That works so far. Now I have created a GUI with KODA and in this GUI I want to display this temperature as text. That's why I wanted to know if anyone knows how to incorporate some kind of "output field" into the GUI. The "input field" in the coda menu I have found but no output field.
Simpel Posted November 17, 2017 Posted November 17, 2017 Hi. You can simply use GUICtrlCreateLabel. Regards, Conrad SciTE4AutoIt = 3.7.3.0 AutoIt = 3.3.14.2 AutoItX64 = 0 OS = Win_10 Build = 19044 OSArch = X64 Language = 0407/german H:\...\AutoIt3\SciTE H:\...\AutoIt3 H:\...\AutoIt3\Include (H:\ = Network Drive) Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.
kaufpark Posted November 17, 2017 Author Posted November 17, 2017 The solution is always simple, you just have to find it. Thanks!
Moderators JLogan3o13 Posted November 17, 2017 Moderators Posted November 17, 2017 It might help us help you find it if you actually posted code rather than having us guess "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
aa2zz6 Posted November 18, 2017 Posted November 18, 2017 So when the temp changes you want it to display inside the GUI? Maybe BrewManNH has your solution in this thread? He uses a label as a display for the counter. I assume you would want the label to display the temperature every 10 seconds? GUICtrlSetData($lbl01, $seconds) #include <GUIConstantsEx.au3> $seconds = 0 $gui = GUICreate("Test", 360, 333) $btn01=GUICtrlCreateButton("START",15,15) GUISetFont(222 ) $lbl01 = GUICtrlCreateLabel("", 25, 53, 330, 300) GUISetState() Global $cnt=0, $swh=0 While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $btn01 $cnt +=1 $swh=mod($cnt,2) $tBegin01 = TimerInit() EndSwitch If $swh=1 and TimerDiff($tBegin01) > 999 Then $seconds +=1 GUICtrlSetData($lbl01, $seconds) $tBegin01 = TimerInit() EndIf WEnd
kylomas Posted November 18, 2017 Posted November 18, 2017 kaufpark, A small example of using timers for the time of day and a 10 second countdown... expandcollapse popup#include <StaticConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <timers.au3> #AutoIt3Wrapper_Add_Constants=n Local $gui010 = GUICreate('WM_Timer Example',310,70) GUICtrlCreateLabel('Time of Day', 10, 10, 100, 20) Local $TOD = GUICtrlCreateLabel('', 10, 30, 100, 20, BitOR($ss_center, $ss_sunken, $ss_centerimage)) GUICtrlCreateLabel('10 second Count', 200, 10, 100, 20) Local $10sec = GUICtrlCreateLabel('10', 200, 30, 100, 20, BitOR($ss_sunken, $ss_center, $ss_centerimage)) Local $dummy_TOD = GUICtrlCreateDummy() Local $dummy_10sec = GUICtrlCreateDummy() GUISetState() GUIRegisterMsg($wm_timer, 'WM_TIMER') Local $tod_timer = _Timer_SetTimer($gui010, 500, '', -1) Local $10sec_timer = _Timer_SetTimer($gui010, 1000, '', -1) While 1 Switch GUIGetMsg() Case $gui_event_close Exit Case $dummy_TOD GUICtrlSetData($TOD, StringFormat('%02i:%02i:%02i', @HOUR, @MIN, @SEC)) Case $dummy_10sec If GUICtrlRead($10sec) = 0 Then GUICtrlSetBkColor($10sec, 0xffffffff) GUICtrlSetData($10sec, 10) ContinueLoop EndIf GUICtrlSetData($10sec, GUICtrlRead($10sec) - 1) If GUICtrlRead($10sec) = 0 Then GUICtrlSetBkColor($10sec, 0xff0000) EndSwitch WEnd Func WM_TIMER($hWnd, $iMsg, $iwParam, $ilParam) Switch $iwParam Case $tod_timer GUICtrlSendToDummy($dummy_TOD) Case $10sec_timer GUICtrlSendToDummy($dummy_10sec) EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_TIMER kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now