lewisg Posted October 13, 2007 Share Posted October 13, 2007 Trying to display a long PATH and filename with a progress bar, however the PATH and filename get cut off because the progress bar display is to small. Only found sizing with GUICtrlCreateProgress which is not being used (trying to not do a rewrite of the code). Link to comment Share on other sites More sharing options...
BrettF Posted October 13, 2007 Share Posted October 13, 2007 (edited) It would be better to create a gui with Koda, and set it with GUICtrlSetData. Would be much more suited to your needs. Maybe Something like this? expandcollapse popup#include <GUIConstants.au3> $Progressctrl = _ProgressOn("title", "maintext", "subtext", 400, 100, -1, -1) $i = 1 While 1 $msg = GUIGetMsg () Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect _ProgressSet ($Progressctrl[0], $i) Sleep (100) $i += 1 WEnd _ProgressOff ($Progressctrl[1]) Func _ProgressOn($title, $maintext, $subtext, $w = 200, $h = 100, $x = -1, $y = -1) Select Case $w = -1 or $w < 200 $w = 200 ContinueCase Case $h = -1 or $h < 100 $h = 100 ContinueCase Case $x = -1 $x = (@DesktopWidth / 2) - ($w / 2) ContinueCase Case $y = -1 $y = (@DesktopHeight / 2) - ($h / 2) ContinueCase EndSelect $ctrlw = Int ($w - 10) $mtexth = Int ($h/3) $ppos = Int ($mtexth + 10) $spos = Int ($ppos + 25) $ProgressGUI = GUICreate ($title, $w, $h, $x, $y) $lblMainText = GUICtrlCreateLabel ($maintext, 5, 5, $ctrlw, $mtexth) $proProgress = GUICtrlCreateProgress (5, $ppos, $ctrlw, 20) $lblSubText = GUICtrlCreateLabel ($subtext, 5, $spos, $ctrlw, $mtexth) GUISetState (@SW_SHOW) Dim $ret[2] $ret[0] = $proProgress $ret[1] = $ProgressGUI Return $ret EndFunc Func _ProgressSet ($proProgress, $percent) GUICtrlSetData ($proProgress, $percent) EndFunc Func _ProgressOff ($hwnd) GUIDelete ($hwnd) EndFunc Also, welcome to the forums Edited October 13, 2007 by Bert 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...
lewisg Posted October 13, 2007 Author Share Posted October 13, 2007 Thanks for the advice, I was really trying to not rewrite the code anymore then I had to. However by "borrowing" some of your example I was able to accomplish just what I wanted! Once I figured out your example I was very impress with the elegance of it, well done and thank you again. It would be better to create a gui with Koda, and set it with GUICtrlSetData. Would be much more suited to your needs. Also, welcome to the forums Link to comment Share on other sites More sharing options...
BrettF Posted October 13, 2007 Share Posted October 13, 2007 Thanks for the advice, I was really trying to not rewrite the code anymore then I had to. However by "borrowing" some of your example I was able to accomplish just what I wanted! Once I figured out your example I was very impress with the elegance of it, well done and thank you again.Glad to be of assistance 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...
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