Что нового

Альтернатива Прогрессбару

ArgoNaft

Новичок
Сообщения
129
Репутация
0
Код:
#include <ButtonConstants.au3>
#include <GuiRichEdit.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Date.au3>
#include <String.au3>
#include <Array.au3>
#include <File.au3>

WinFirst()

Func WinFirst()
    Local $hGui, $hRichEdit, $iMsg
    $hGui = GUICreate("Install (" & StringTrimRight(@ScriptName,4) &")", 480, 300, -1, -1)
    $hRichEdit = _GUICtrlRichEdit_Create($hGui,"", 170, 10, 300, 220, BitOR($ES_MULTILINE, $WS_VSCROLL,$ES_READONLY,$ES_LEFT))
    _GUICtrlRichEdit_SetText($hRichEdit,"This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text This is more text ")
	
	$CheckBoxYes = GUICtrlCreateCheckbox("Я на все согласен", 251, 240, 120, 17)
	$Button_1 = GUICtrlCreateButton("Запускай", 250, 265, 120)
	GUICtrlSetState ($CheckBoxYes, $GUI_CHECKED)
    GUISetState()

    While True
        $iMsg = GUIGetMsg()
        Select
            Case $iMsg = $GUI_EVENT_CLOSE
			   GUIDelete()
			   Exit
			 Case $iMsg = $Button_1
			   
			   Exit
        EndSelect
    WEnd
EndFunc



Case $iMsg = $Button_1 после нажатия на эту кнопку происходит событие а именно запускается инсталляция программы. Я не могу время какое то там сказать сколько оно будет ставиться, по этому я подумал может быть заместо соглашения мне вывести такой большой кружок - типа такого: Load ну чтоб человек понимал что нужно подождать идет какой то процесс.
Но там Gif и проблемы я думаю будут, ведь Windows работает с BMP. Остальное на костылях ходит по сути. Может что то другое придумать посоветуете? Наверняка уже кто то сталкивался и что то уже придумывал, вместо этого мега кружочка :smile:
 

MnM

Post-Hardcore
Сообщения
679
Репутация
90
ArgoNaft
в стилях для прогресс бара установите $PBS_MARQUEE (бегунок без значения).
а если хотите оригинальней то могу предложить .avi либо свой либо из ресурсов системы(из 2 варианта могут не совпадать значения на определенный ресурс)
 

madmasles

Модератор
Глобальный модератор
Сообщения
7,790
Репутация
2,322
ArgoNaft,
Попробуйте сделать примерно так.
Код:
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>

$hGUI = GUICreate('Example', 200, 100)
$nProgress = GUICtrlCreateProgress(10, 10, 180, 20, $PBS_MARQUEE)
GUICtrlSetState(-1, $GUI_HIDE)
$nLbl = GUICtrlCreateLabel('', 10, 30, 180, 20, BitOR($GUI_SS_DEFAULT_LABEL, $SS_CENTER, $SS_CENTERIMAGE))
$nBtn = GUICtrlCreateButton('Click me', 50, 60, 100, 30)
GUISetState()

While 1
	Switch GUIGetMsg()
		Case $GUI_EVENT_CLOSE
			ExitLoop
		Case $nBtn
			GUICtrlSetState($nBtn, $GUI_DISABLE)
			GUICtrlSetData($nLbl, 'Ждите...' & @TAB & '0.00 сек')
			GUICtrlSetState($nProgress, $GUI_SHOW)
			GUICtrlSendMsg($nProgress, $PBM_SETMARQUEE, 1, 50)
			$iTimer = TimerInit()
			$iEnd = Random(10000, 30000, 1)
;~ 			$iPid = Run('какая-то программа')
;~ 			While ProcessExists($iPid)
			While TimerDiff($iTimer) < $iEnd
				Sleep(500)
				GUICtrlSetData($nLbl, 'Ждите...' & @TAB & StringFormat('%.2f сек', TimerDiff($iTimer) / 1000))
			WEnd
			GUICtrlSendMsg($nProgress, $PBM_SETMARQUEE, 0, 0)
			GUICtrlSetState($nProgress, $GUI_HIDE)
			GUICtrlSetData($nLbl, '')
			GUICtrlSetState($nBtn, $GUI_ENABLE)
	EndSwitch
WEnd
 

Spyhunter

Знающий
Сообщения
56
Репутация
13
Код выше работает без нареканий.
А вот исправить ваш код, не увидев его, никто не сможет :(
 
Верх