Уроки PureBasic

Categories

Other Sites

Other Sites

Other Sites



             Поиск по сайту

     

                


    Оставить мне сообщение:



Индикатор загрузки программы

Уроки PureBasic

Заставка перед запуском программы.

Фото результата :

Индикатор загрузки


Код реализации :

;/////////////////////////PureBasic 4.30/////////////////////////////////////// Enumeration #Window_0 EndEnumeration Procedure LineGadgetHeight(Gadget, x, y, Height,color) Im=CreateImage(#PB_Any, 2, Height) If Im If StartDrawing(ImageOutput(Im)) CompilerIf #PB_Compiler_Version > 430 Line(0,0, 1,Height ,color) CompilerElse Line(0,0, 0,Height ,color) CompilerEndIf StopDrawing() ImageGadget(Gadget,x, y, 2,Height,ImageID(Im)) EndIf EndIf EndProcedure ;////////////////////////////////////////////////////////////// OpenWindow(#Window_0, 0, 0, 350, 80, "Индикатор", #PB_Window_ScreenCentered | #PB_Window_BorderLess ) SetWindowColor(#Window_0, $000000) TextGadget(300, 85, 45, 180, 15, "Подключение к сети") SetGadgetColor(300, #PB_Gadget_FrontColor, $055AE6) SetGadgetColor(300, #PB_Gadget_BackColor, $000000) For a = 1 To 150 LineGadgetHeight(151-a, 22+a*2, 20, 20,$E3031C) For i=0 To 350 WindowEvent() Next i Delay(5) Next TextGadget(300, 85, 45, 180, 15, "Загрузка информации из сети") SetGadgetColor(300, #PB_Gadget_FrontColor, $055AE6) SetGadgetColor(300, #PB_Gadget_BackColor, $000000) For a = 1 To 150 LineGadgetHeight(a, 324-a*2, 20, 20,$0302FC) For i=0 To 350 WindowEvent() Next i Delay(10) Next TextGadget(300, 85, 45, 180, 15, "Не предвиденный сбой") SetGadgetColor(300, #PB_Gadget_FrontColor, $055AE6) SetGadgetColor(300, #PB_Gadget_BackColor, $000000) For a = 1 To 150 LineGadgetHeight(151-a, 22+a*2, 20, 20,$000000) For i=0 To 350 WindowEvent() Next i Delay(5) Next TextGadget(300, 115, 35, 180, 25, " Ошибка") SetGadgetColor(300, #PB_Gadget_FrontColor, $055AE6) SetGadgetColor(300, #PB_Gadget_BackColor, $000000) SetGadgetFont(300, LoadFont(301, "Microsoft Sans Serif", 14, 272)) Delay(2000) OpenWindow(#Window_0, 0, 0, 350, 350, "Заголовок", #PB_Window_ScreenCentered | #PB_Window_SystemMenu ) Repeat Event= WaitWindowEvent() If Event=#PB_Event_CloseWindow Q=1 EndIf Until Q=1 End </plaintext> </div><br><br><br> <img src="img/lin.jpg" width="700" height="20" alt="Уроки PureBasic"><br><br> </div> </div> <!-- copyright (t4) --><div align="center">Используются технологии <a href="http://www.ucoz.ru/" title="Создать сайт бесплатно"><b>uCoz</b></a><br /></div><!-- /copyright --> </body> </html>