Sign in to follow this  
Followers 0
ds34

Embedded Progressbar

2 posts in this topic

I have a progressbar embedded into a statusbar:

CODE

$StatusBar1 = _GUICtrlStatusBar_Create($Form1,-1,"", $SBARS_TOOLTIPS)

Dim $StatusBar1_PartsWidth[3] = [50, 350, 460]

_GUICtrlStatusBar_SetParts($StatusBar1, $StatusBar1_PartsWidth)

_GUICtrlStatusBar_SetText($StatusBar1, "* ", 0)

_GUICtrlStatusBar_SetTipText($StatusBar1,0,"Pause till next command is sent")

_GUICtrlStatusBar_SetText($StatusBar1, " ", 1)

_GUICtrlStatusBar_SetTipText($StatusBar1,1,"Next command to be sent")

$statprogress = GUICtrlCreateProgress(0, 0, -1, -1, $PBS_SMOOTH,4)

$hstatProgress = GUICtrlGetHandle($statprogress)

_GUICtrlStatusBar_EmbedControl ($StatusBar1, 2, $hstatProgress)

GUICtrlSetColor( $statprogress,0x0000FF)

GUICtrlSetTip($statProgress,"Script progress indicator")

Throughout my func I use a lot of call to set data (330msec updates) like:

CODE

_GUICtrlStatusBar_SetText($StatusBar1, Int(($MinTimeBetweenTL1Sends+$TL1SendQuePauseBeforeNextCommand-$timerdifference)/1000)&" sec ", 0)

_GUICtrlStatusBar_SetText($StatusBar1, $TL1SendQue [1] [1]&" ", 1)

GUICtrlSetColor( $statprogress,0x0000FF)

GUICtrlSetTip($statProgress,"Script progress indicator")

GUICtrlSetData($statprogress, 0)

Sooner or later the progressbar size (w/o any [intentional] GUI resizing event) is changed: the progressbar occupies the complete statusbar area.

I have no idea, what triggers this change, subsequently I tried to use

CODE

_GUICtrlStatusBar_SetParts($StatusBar1, $StatusBar1_PartsWidth)

_GUICtrlStatusBar_Resize($StatusBar1) ;just to check if this repairs the oversized progress bar

in order to reset the size, but it does not help. I tried as well with ControlMove to reseat the progressbar, but then the progressbar is gone completley.

Anyone who suffered the same problem and has an idea?

How to resize such embedded Progressbar (with ControlGetPos I can detect the change, so a subsequent Resize might be helpful)

Thanks!

Daniel

Share this post


Link to post
Share on other sites



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
Sign in to follow this  
Followers 0