Jump to content

switching gui smoothness! :)


Recommended Posts

hi, could someone one point me in the right direction. i'm trying to jump from one form to another. am getting annoyed with the flickering refresh rate. here is the nugget of the code im usin:

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Home_Button3
            
            GUISetState(@SW_HIDE, "Page 1")
            GUISwitch($Form1)
            GUISetState(@SW_SHOW, "Page 2")
            !
    EndSwitch
WEnd

im not very experianced with the GUI's, so any help at all is appreciated. would destorying the controls and creating new ones for the next page on the same form work and be fluid? or is their another way? thanks

Link to comment
Share on other sites

hi, could someone one point me in the right direction. i'm trying to jump from one form to another. am getting annoyed with the flickering refresh rate. here is the nugget of the code im usin:

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Home_Button3
            
            GUISetState(@SW_HIDE, "Page 1")
            GUISwitch($Form1)
            GUISetState(@SW_SHOW, "Page 2")
            !
    EndSwitch
WEnd

im not very experianced with the GUI's, so any help at all is appreciated. would destorying the controls and creating new ones for the next page on the same form work and be fluid? or is their another way? thanks

I would need more of your code before I would see if I could help; preferably a working example that shows the problem.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

maybe...

; Demo
;#cs
#include <GUIConstants.au3>
Dim $repeat = 1
$hwnd = GUICreate("XSkin Animate", 300, 300)

$ret = XSkinAnimate($hwnd, 1, $repeat)
Sleep(2000)

While $repeat <= 28 ;*********** will error - for testing
    $repeat += 1
    XSkinAnimate($hwnd, "", $repeat)
   
    Sleep(1000)
   
    $repeat += 1
    XSkinAnimate($hwnd, "", $repeat)
    Sleep(1000)
WEnd
;#ce



Func XSkinAnimate($Xwnd, $Xstate = 1, $Xstyle = 0, $Xtrans = 0, $Xspeed = 1000)
    ; $Xstate  - 1 = Show, 2 = Hide, "" = No State Set
    ; $Xstyle - 1=Fade, 3=Explode, 5=L-Slide, 7=R-Slide, 9=T-Slide, 11=B-Slide, 13=TL-Diag-Slide, 15=TR-Diag-Slide, 17=BL-Diag-Slide, 19=BR-Diag-Slide
    Local $Xpick = StringSplit('80000,90000,40010,50010,40001,50002,40002,50001,40004,50008,40008,50004,40005,5000a,40006,50009,40009,50006,4000a,50005', ",")
    If Not WinExists($Xwnd) Then XSkinAnError("XSkinAnimate, $Xwnd - Window not found   ")
    If $Xstyle > $Xpick[0] Then XSkinAnError("XSkinAnimate, $Xstyle max is 19  ")
    If $Xstyle <> 0 Then Local $ret = DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $Xwnd, "int", $Xspeed, "long", "0x000" & $Xpick[$Xstyle])
    If $Xtrans <> 0 Then WinSetTrans($Xwnd, "", $Xtrans)
    If $Xstate = 1 Then GUISetState(@SW_SHOW, $Xwnd)
    If $Xstate = 2 Then GUISetState(@SW_HIDE, $Xwnd)
    If $Xstyle <> 0 Then Return $ret
EndFunc   ;==>XSkinAnimate

Func XSkinAnError($XE_msg)
    MsgBox(262208, "XSkin Error", $XE_msg, 5)
    Exit
EndFunc   ;==>XSkinAnError

8)

NEWHeader1.png

Link to comment
Share on other sites

Hello!

Or simplie so?

#include <GUIConstants.au3>
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
    Case $GUI_EVENT_CLOSE
        Exit
    Case $Home_Button3
        For $i = 255 To 0 Step - 10
            WinSetTrans($Form1, '', $i)
        Next
        GUISetState(@SW_HIDE, $Form1)
        GUISwitch($Form1)
        For $i = 0 To 255 Step 10
            WinSetTrans($Form2, '', $i)
        Next
        GUISetState(@SW_SHOW, $Form2)
EndSwitch
WEnd

Not testet but it should work..

Mfg / Best Regards Spider

www.AutoIt.de - Moderator of the German AutoIt Forum

 

Link to comment
Share on other sites

Hello!

Or simplie so?

#include <GUIConstants.au3>
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
    Case $GUI_EVENT_CLOSE
        Exit
    Case $Home_Button3
        For $i = 255 To 0 Step - 10
            WinSetTrans($Form1, '', $i)
        Next
        GUISetState(@SW_HIDE, $Form1)
        GUISwitch($Form1)
        For $i = 0 To 255 Step 10
            WinSetTrans($Form2, '', $i)
        Next
        GUISetState(@SW_SHOW, $Form2)
EndSwitch
WEnd

Not testet but it should work..

Mfg / Best Regards Spider

Actually, I would have placed that in a "reverseable" function so if the user decides to return to form 1

Func GUITransfer( $GUI_to_Hide, $GUI_to_Show)

8)

Edited by Valuater

NEWHeader1.png

Link to comment
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
 Share

  • Recently Browsing   0 members

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