Sign in to follow this  
Followers 0
GaryFrost

Label refresh

7 posts in this topic

#1 ·  Posted (edited)

The label in the group won't refresh, the one out side the group does.

I know that guictrlsetdata is what should be used for gui, but this and many other functions were made to work on not only autoit scripts but other apps as well

Edit: using 3.1.1.68 btw

Edit: moved code to bug reports

Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites



** GOT IT!! **

This reminds me of the same senario when you helped me with labels

#include <GuiConstants.au3>

$GUI = GuiCreate("MyGUI", 750, 250)
;$grp = GUICtrlCreateGroup("Preview", 25, 25, 700, 100); CUT HERE**********************
;GUICtrlSetState( -1, $GUI_DISABLE)
$preview_label = GUICtrlCreateLabel("Preview in Label", 50, 55, 650, 20, $SS_SUNKEN)
GUICtrlSetFont(-1, -1, -1, -1, "Courier New")
$preview_input = GUICtrlCreateInput("Preview in Input", 50, 80, 650, 20)
GUICtrlSetFont(-1, -1, -1, -1, "Courier New")
GUICtrlCreateGroup("", -99, -99, 1, 1)

$preview_label2 = GUICtrlCreateLabel("Preview in Label", 50, 140, 650, 20, $SS_SUNKEN)
GUICtrlSetFont(-1, -1, -1, -1, "Courier New")
$preview_input2 = GUICtrlCreateInput("Preview in Input", 50, 165, 650, 20)
GUICtrlSetFont(-1, -1, -1, -1, "Courier New")

$Button_4 = GuiCtrlCreateButton("Animate", 130, 200, 100, 40)
$str_test = "this is a test, this is only a test"

$grp = GUICtrlCreateGroup("Preview", 25, 25, 700, 100); MOVED HERE****************
GUICtrlSetState( -1, $GUI_DISABLE)

GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $Button_4
        _txt_eff__move_in_from_left($GUI, $preview_label, $str_test, 100)
        _txt_eff__move_in_from_left($GUI, $preview_input, $str_test, 100)
        _txt_eff__move_in_from_left($GUI, $preview_label2, $str_test, 100)
        _txt_eff__move_in_from_left($GUI, $preview_input2, $str_test, 100)
    Case Else
   ;;;
    EndSelect
WEnd
Exit

Func _txt_eff__move_in_from_left($winhandle, $control_id, $text = "", $delay = 100)
    If $text = "" Then $text = ControlGetText($winhandle, "", $control_id)
    Local $static = _IsStatic($winhandle, $control_id)
    For $i = 1 To StringLen($text)
        If $static = 1 Then GUISetState(@SW_LOCK, $winhandle)
        ControlSetText($winhandle, "", $control_id, StringRight($text, $i))
        If $static = 1 Then GUISetState(@SW_UNLOCK, $winhandle)
        Sleep($delay)
    Next
EndFunc ;==>_txt_eff__move_in_from_left

Func _IsStatic($winhandle, $control_id)
    Local $ret = DllCall("user32.dll", "int", "GetClassName", "hwnd", ControlGetHandle($winhandle, "", $control_id), "str", "", "int", 128)
    If StringInStr($ret[2], "Static") <> 0 Then Return 1
    Return 0
EndFunc ;==>_IsStatic

autoit recognizes the "lower/first" label... in this case the "group" label

but it works

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

ok, that's a work around, but what I'm trying to determine if this should be catorgized as a bug.

Edit: try the my code unchanged, run it, then bring another window to the foreground and then the script back to the front the label is refreshed.

Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

ok, that's a work around, but what I'm trying to determine if this should be catorgized as a bug.

<{POST_SNAPBACK}>

I certainly don't think it's a bug. Because all labels seem to have the same characteristics.

8)

(but, i'm not a dev either)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Edit: try the my code unchanged, run it, then bring another window to the foreground and then the script back to the front the label is refreshed.

<{POST_SNAPBACK}>

Yepper...

This is really interesting. Replace this line in your code and watch

$grp = GUICtrlCreateGroup("Preview", 85, 25, 650, 100)

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

in a group control, i'd expect only radio's, checkboxes and buttons to behave differently(they're supposed to). Anything else should be a bug (why should the behaviour change just because there's a frame drawn around it?)


[u]Do more with pre-existing apps![/u]ANYGUIv2.8

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