Jump to content

solid progress bars


Recommended Posts

ok this is more of a making the "gui look better" question. In stead of having the progress bar in little blocks, how can i have it solid if anyway.

Im almost done with me program and im starting to think of ^'ing the cool factor lmao

thanks,

toothy

---╔╦═╗╔╗'''╔╗╔═╦═╗╔╦═╗---╝╠═╣╝║'''║╝╝''''''╝╝║'''......''''''''''''''''''''''''''''''---╔╩═╩═╩═╩═══╩═╦═╩═╩══╦══════╗''''╔╩════════════╩══╗╔══╩══╗╔══╝ ''''''''''''''''''''''''''''''''''''''''''''''''''''║║'''''''''''''''║║ ''''''''''''''''''''''''''''''''''''''''''''''╔══╝╚══╗''''''║║''''''''''''''''''''''''''''''''''''''''''''''╚══════╝''''''╚╝
Link to comment
Share on other sites

is this what you are looking for??

#include <GuiConstants.au3>

$gui = GuiCreate("MyGUI", 350, 42,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))
$Pic_1 = GUICtrlCreateLabel("", 10, 10, 340, 20)
GUICtrlSetBkColor($Pic_1,0x0000ff) ;color of the bar
$Label_2 = GuiCtrlCreateLabel("", 10, 10, 340, 20)
$Label_3 = GUICtrlCreateLabel("", 10, 13, 5, 15, $SS_CENTER)
GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)
GuiSetState()

do
    $msg = GuiGetMsg()
    $pos = ControlGetPos($gui,"",$Label_2)
    if $pos[0] < 340 then
        GUICtrlSetPos($Label_2,$pos[0]+((340/100)*1),10)
        GUICtrlSetPos($Label_3, 10, 13, 360,15)
        GUICtrlSetData( $Label_3, int($pos[0]/(340/100)+1) & "%")
    EndIf
    sleep(1)
    if $pos[0] = 340 then
        MsgBox(0,"test","Done!")
        exit
    EndIf
    $msg = GuiGetMsg()
until $msg = $GUI_EVENT_CLOSE

[font="Impact"]Never fear, I is here.[/font]

Link to comment
Share on other sites

oooo so its kinda just like having a lable and adding to the position of it...hey this answers another question i have

Thanks!!!

---╔╦═╗╔╗'''╔╗╔═╦═╗╔╦═╗---╝╠═╣╝║'''║╝╝''''''╝╝║'''......''''''''''''''''''''''''''''''---╔╩═╩═╩═╩═══╩═╦═╩═╩══╦══════╗''''╔╩════════════╩══╗╔══╩══╗╔══╝ ''''''''''''''''''''''''''''''''''''''''''''''''''''║║'''''''''''''''║║ ''''''''''''''''''''''''''''''''''''''''''''''╔══╝╚══╗''''''║║''''''''''''''''''''''''''''''''''''''''''''''╚══════╝''''''╚╝
Link to comment
Share on other sites

You do know that the progress control has a style you can apply to it that will make it solid, right?

GUICtrlCreateProgress(x, y, w, h, $PBS_SMOOTH)

Although that doesn't work outside of classic style windows, it would be a real progress bar, and would act properly (Alek's example has a lot of flickering for me). Up to you though.

Link to comment
Share on other sites

You do know that the progress control has a style you can apply to it that will make it solid, right?

GUICtrlCreateProgress(x, y, w, h, $PBS_SMOOTH)

Although that doesn't work outside of classic style windows, it would be a real progress bar, and would act properly (Alek's example has a lot of flickering for me). Up to you though.

Actually you can do it by shutting off xp style, creating your GUI... then turn it back on

http://www.autoitscript.com/forum/index.ph...st&p=319516

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

Maybe...

Func ClassicStyle($OnOff = 1)   
    If $OnOff And StringInStr(@OSTYPE, "WIN32_NT") Then
        $XS_n = DllCall("uxtheme.dll", "int", "GetThemeAppProperties")
        DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 3)
        Return 1
    ElseIf StringInStr(@OSTYPE, "WIN32_NT") And IsArray($XS_n) Then
        DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", $XS_n[0])
        $XS_n = ""
        Return 1
    EndIf
    Return 0
EndFunc

******** NOT TESTED *********

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

Nope, don't think it works.

#include <GUIConstants.au3>

Dim $XS_n
ClassicStyle(0); also tried with 1

$gui = GUICreate('', 200, 200)
GUICtrlCreateButton('Button', 5, 5, 100, 25)
GUICtrlCreateProgress(5, 35, 120, 20)
GUICtrlSetData(-1, 75)
GUICtrlCreateInput('Input', 5, 65, 110, 20)

GUISetState()

While 1
     $gm = GUIGetMsg()
     Switch $gm
          Case $GUI_EVENT_CLOSE
               ExitLoop
     EndSwitch
WEnd

Func ClassicStyle($OnOff = 1)   
    If $OnOff And StringInStr(@OSTYPE, "WIN32_NT") Then
        $XS_n = DllCall("uxtheme.dll", "int", "GetThemeAppProperties")
        DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 3)
        Return 1
    ElseIf StringInStr(@OSTYPE, "WIN32_NT") And IsArray($XS_n) Then
        DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", $XS_n[0])
        $XS_n = ""
        Return 1
    EndIf
    Return 0
EndFunc
Link to comment
Share on other sites

  • 1 month later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...