Sparrowlord Posted December 4, 2007 Share Posted December 4, 2007 Is it possible to just have a GUI centered at the bottom of my screen maybe 165 pixels high and 750 pixels wide that is always on top and acts like a console? I have never made a GUI in my life so I have no idea what a GUI can do. I thought maybe I was able to save the added lines to a file and call a function to update the GUI. Example: When the GUI refreshes it shows in this format, where the last action is at the bottom and it works its way up the console with each new action and after so many just disappears from the GUI but is still in the file. _____________________________________________________________________________________ Time: The action before that Time: The action before that Time: The action before that Time: The action before that Time: The action before that Time: Last Action... _____________________________________________________________________________________ And when I want to update the GUI I just call the function like "GUIUpdate()" where ever I want it to refresh... Anyways, is this even possible if so what all would I have to do? I am almost finished with my script I have been working on now for over three weeks and I have never used a GUI so I don't really want to ruin my script with a horrible looking GUI. Link to comment Share on other sites More sharing options...
Generator Posted December 4, 2007 Share Posted December 4, 2007 Is it possible to just have a GUI centered at the bottom of my screen maybe 165 pixels high and 750 pixels wide that is always on top and acts like a console? I have never made a GUI in my life so I have no idea what a GUI can do. I thought maybe I was able to save the added lines to a file and call a function to update the GUI.Example: When the GUI refreshes it shows in this format, where the last action is at the bottom and it works its way up the console with each new action and after so many just disappears from the GUI but is still in the file._____________________________________________________________________________________Time: The action before thatTime: The action before thatTime: The action before thatTime: The action before thatTime: The action before thatTime: Last Action..._____________________________________________________________________________________And when I want to update the GUI I just call the function like "GUIUpdate()" where ever I want it to refresh...Anyways, is this even possible if so what all would I have to do? I am almost finished with my script I have been working on now for over three weeks and I have never used a GUI so I don't really want to ruin my script with a horrible looking GUI.Use Koda that comes along with SCiTe installation. Link to comment Share on other sites More sharing options...
Sparrowlord Posted December 4, 2007 Author Share Posted December 4, 2007 (edited) I just tried to use Koda I can't make anything that looks good.. Edited December 4, 2007 by Sparrowlord Link to comment Share on other sites More sharing options...
BrettF Posted December 4, 2007 Share Posted December 4, 2007 I just tried to use Koda I can't make anything that looks good.. Can't be that bad... post what you created! And if you want some bling with it, do a search for X-Skin... Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Sparrowlord Posted December 4, 2007 Author Share Posted December 4, 2007 Ah screw it, I just spent the last 9 hours working on this and I couldn't do it correctly. I screwed it up so bad that I just had to restart a few times.. I would post what I had, but I got so pissed off I went on a deleting rampage and ended up deleting half of the stuff on my computer. It hasn't been a very good day Link to comment Share on other sites More sharing options...
Zedna Posted December 4, 2007 Share Posted December 4, 2007 (edited) Just save this code as Form1.kxf and load it by Koda and make desired changes: expandcollapse popup<?xml version="1.0" encoding="windows-1251"?> <object type="TAForm" name="Form1"> <properties> <property name="Left" vt="Int16">259</property> <property name="Top" vt="Int16">158</property> <property name="Width" vt="Int16">538</property> <property name="Height" vt="Int16">394</property> <property name="Caption" vt="String">Form1</property> <property name="Color" vt="Ident">clBtnFace</property> <property name="Font.Charset" vt="Ident">DEFAULT_CHARSET</property> <property name="Font.Color" vt="Ident">clWindowText</property> <property name="Font.Height" vt="Int8">-11</property> <property name="Font.Name" vt="String">MS Sans Serif</property> <property name="Font.Style" vt="Set"/> <property name="OldCreateOrder" vt="False">False</property> <property name="Position" vt="Ident">poDesktopCenter</property> <property name="Visible" vt="True">True</property> <property name="Style" vt="Int32">-1798701056</property> <property name="ExStyle" vt="Int16">264</property> <property name="Version" vt="String">1.03</property> <property name="PixelsPerInch" vt="Int8">96</property> <property name="TextHeight" vt="Int8">13</property> </properties> <components> <object type="TAList" name="List1"> <properties> <property name="Left" vt="Int8">4</property> <property name="Top" vt="Int8">4</property> <property name="Width" vt="Int16">522</property> <property name="Height" vt="Int16">357</property> <property name="ItemHeight" vt="Int8">13</property> <property name="TabOrder" vt="Int8">0</property> <property name="CtrlStyle" vt="Int32">1350631427</property> <property name="CtrlExStyle" vt="Int16">512</property> <property name="Resizing" vt="Set"/> </properties> <components/> </object> </components> </object> Edited December 4, 2007 by Zedna Resources UDF Â ResourcesEx UDF Â AutoIt Forum Search Link to comment Share on other sites More sharing options...
Sparrowlord Posted December 4, 2007 Author Share Posted December 4, 2007 Oh wow, thanks Zedna.. I got it going and workingJust one question though, after the List gets full the messages keep displaying downwards but it don't scroll with it so they don't show unless you manually scroll.. how would I make it so it scrolls down with the messages as they appear ?Example:As you can see in that screen shot there are messages below "Line 10" but they don't show.Any suggestions on what I should do to fix this?Also I have no idea if I am putting the messages to the GUI right, I was just messing around with it and this seems to work so I went with it.expandcollapse popup#include <GUIConstants.au3> #include <file.au3> #Region ### START Koda GUI section ### Form=c:\documents and settings\chris\desktop\form1.kxf $Form1_1 = GUICreate("JMC - Console", 452, 144, -1, -1, -1, BitOR($WS_EX_TOPMOST, $WS_EX_WINDOWEDGE)) $list = GUICtrlCreateList("", 4, 4, 442, 136) GUISetState(@SW_SHOW) WinMove("JMC - Console", "", 0, 840) GUICtrlSetData($list, "#Welcome Message Line 1") GUICtrlSetData($list, "#Welcome Message Line 2") GUICtrlSetData($list, "#Welcome Message Line 3") GUICtrlSetData($list, "#Welcome Message Line 4") GUICtrlSetData($list, "#Welcome Message Line 5") #EndRegion ### END Koda GUI section ### Sleep(5000) GUICtrlSetData($list, Time() & "Line 6") Sleep(2000) GUICtrlSetData($list, Time() & "Line 7") Sleep(2000) GUICtrlSetData($list, Time() & "Line 8") Sleep(2000) GUICtrlSetData($list, Time() & "Line 9") Sleep(2000) GUICtrlSetData($list, Time() & "Line 10") Sleep(2000) GUICtrlSetData($list, Time() & "Line 11") Sleep(2000) GUICtrlSetData($list, Time() & "Line 12") Sleep(2000) GUICtrlSetData($list, Time() & "Line 13") Sleep(1000) GUICtrlSetData($list, Time() & "Line 14") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Time() Func Time() If @HOUR > 12 Then $hour = @HOUR - 12 $AMPM = " PM: " ElseIf @HOUR = 0 Then $hour = 12 $AMPM = " AM: " Else $hour = @HOUR $AMPM = " AM: " EndIf Return $hour & ":" & @MIN & ":" & @SEC & $AMPM EndFunc ;==>TimeHelp? Link to comment Share on other sites More sharing options...
Zedna Posted December 4, 2007 Share Posted December 4, 2007 Func AddText($text) $i = GUICtrlSendMsg($List, $LB_ADDSTRING, 0, $text) ; returns index of added line GUICtrlSendMsg($List, $LB_SETTOPINDEX, $i, 0) EndFunc Resources UDF Â ResourcesEx UDF Â AutoIt Forum Search Link to comment Share on other sites More sharing options...
Valuater Posted December 4, 2007 Share Posted December 4, 2007 (edited) We fixed the time function, here is the new one Func Time($Seconds = 1) Local $hour = @HOUR, $AMPM = "AM" If $hour > 11 Then $AMPM = "PM" If $hour = 0 Then $hour = 12 If $hour > 12 Then $hour -= 12 If $Seconds Then Return $hour & ":" & @MIN & ":" & @SEC & " " & $AMPM Return $hour & ":" & @MIN & " " & $AMPM EndFunc 8) Edited December 4, 2007 by Valuater Link to comment Share on other sites More sharing options...
GEOSoft Posted December 4, 2007 Share Posted December 4, 2007 We fixed the time function, here is the new one Func Time() Local $hour = @HOUR, $AMPM = "AM" If $hour > 11 Then $AMPM = "PM" If $hour = 0 Then $hour = 12 If $hour > 12 Then $hour -= 12 Return $hour & ":" & @MIN & " " & $AMPM EndFunc 8)The only problem with that function is it's lack of flexibility. You can't properly display seconds if you need them. And I just removed the code that did. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
Valuater Posted December 4, 2007 Share Posted December 4, 2007 OK, how about this expandcollapse popup#include <GUIConstants.au3> #include <file.au3> #Region ### START Koda GUI section ### Form=c:\documents and settings\chris\desktop\form1.kxf $Form1_1 = GUICreate("JMC - Console", 452, 144, -1, -1, -1, BitOR($WS_EX_TOPMOST, $WS_EX_WINDOWEDGE)) $list = GUICtrlCreateList("", 4, 4, 442, 136) GUISetState(@SW_SHOW) ;WinMove("JMC - Console", "", 0, 840) AddText( "#Welcome Message Line 1") AddText( "#Welcome Message Line 2") AddText( "#Welcome Message Line 3") AddText( "#Welcome Message Line 4") AddText( "#Welcome Message Line 5") #EndRegion ### END Koda GUI section ### Sleep(5000) AddText( Time() & " Line 6") Sleep(2000) AddText( Time() & " Line 7") Sleep(2000) AddText( Time() & " Line 8") Sleep(2000) AddText( Time() & " Line 9") Sleep(2000) AddText( Time() & " Line 10") Sleep(2000) AddText( Time() & " Line 11") Sleep(2000) AddText( Time() & " Line 12") Sleep(2000) AddText( Time() & " Line 13") Sleep(1000) AddText( Time() & " Line 14") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func AddText($text) $i = GUICtrlSendMsg($List, $LB_ADDSTRING, 0, $text) ; returns index of added line GUICtrlSendMsg($List, $LB_SETTOPINDEX, $i, 0) EndFunc Func Time($Seconds = 1) Local $hour = @HOUR, $AMPM = "AM" If $hour > 11 Then $AMPM = "PM" If $hour = 0 Then $hour = 12 If $hour > 12 Then $hour -= 12 If $Seconds Then Return $hour & ":" & @MIN & ":" & @SEC & " " & $AMPM Return $hour & ":" & @MIN & " " & $AMPM EndFunc 8) Link to comment Share on other sites More sharing options...
GEOSoft Posted December 5, 2007 Share Posted December 5, 2007 Func Time($Seconds = 1) Local $hour = @HOUR, $AMPM = "AM" If $hour > 11 Then $AMPM = "PM" If $hour = 0 Then $hour = 12 If $hour > 12 Then $hour -= 12 If $Seconds Then Return $hour & ":" & @MIN & ":" & @SEC & " " & $AMPM Return $hour & ":" & @MIN & " " & $AMPM EndFunc That does seconds but my earlier version did it easier by using the two functions. Luck I saved a copy . MsgBox(4096, "Time test", nHour() & @Min & ":" & @Sec & SetAP()) Func nHour() Local $hour = @Hour If $hour = 0 Then $hour = 12 If $hour > 12 Then $hour -= 12 Return $hour & ":"; & @MIN & " " & $AMPM EndFunc Func SetAP() Local $ap = " AM" If @Hour > 11 Then $ap = " PM" Return $ap EndFunc You can chang the function name if you need to. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
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