Spikeedoodles Posted October 4, 2014 Share Posted October 4, 2014 Hey all, I'm working on something a little more complex and could use some ideas. I have a GUI that displays new information when a user clicks next or previous. There are about 10 different controls that are changed every time the user clicks next or previous. Because AutoIT is a line by line language, it can look sketchy when transitioning to new GUI controls. I was looking for ideas to make this smoother. My personal idea was to make a like an animation between screens that would fade away when the new controls are loaded, but I have no idea how to do this. Anyone have a quick and dirty way to make the transition cleaner? Link to comment Share on other sites More sharing options...
kylomas Posted October 4, 2014 Share Posted October 4, 2014 Spikeedoodles, I found this on the forum some time ago. Don't remember the original author. Something in here may be of use... expandcollapse popup; Animate Display ; Author Raindancer Global Const $hwnd = GUICreate("Animate Window", 300, 300) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00080000) ; fade-in GUISetState(@SW_SHOWNORMAL) ;~ DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00090000) ; fade-out ;~ DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040001) ; slide in from left ;~ DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00050002) ; slide out to left ;~ DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040002) ; slide in from right ;~ DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00050001) ; slide out to right ;~ DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040004) ; slide-in from top ;~ DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00050008) ; slide-out to top ;~ DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040008) ; slide-in from bottom ;~ DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00050004) ; slide-out to bottom ;~ DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040005) ; diag slide-in from Top-left ;~ DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x0005000a) ; diag slide-out to Top-left ;~ DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040006) ; diag slide-in from Top-Right ;~ DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00050009) ; diag slide-out to Top-Right ;~ DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040009) ; diag slide-in from Bottom-left ;~ DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00050006) ; diag slide-out to Bottom-left ;~ DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x0004000a) ; diag slide-in from Bottom-right ;~ DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00050005) ; diag slide-out to Bottom-right DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040010) ; explode DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00050010) ; implode #define AW_HOR_POSITIVE 0x00000001 #define AW_HOR_NEGATIVE 0x00000002 #define AW_VER_POSITIVE 0x00000004 #define AW_VER_NEGATIVE 0x00000008 #define AW_CENTER 0x00000010 #define AW_HIDE 0x00010000 #define AW_ACTIVATE 0x00020000 #define AW_SLIDE 0x00040000 #define AW_BLEND 0x00080000 kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
Spikeedoodles Posted October 4, 2014 Author Share Posted October 4, 2014 Mhm, I will look into some of these. Thanks Link to comment Share on other sites More sharing options...
mikell Posted October 4, 2014 Share Posted October 4, 2014 kylomas, Looks like _WinAPI_AnimateWindow Link to comment Share on other sites More sharing options...
guinness Posted October 4, 2014 Share Posted October 4, 2014 It's already in the WinAPI UDFs. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
kylomas Posted October 4, 2014 Share Posted October 4, 2014 Thank you, gentlemen, shows how much I use something like this... Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
Solution Spikeedoodles Posted October 5, 2014 Author Solution Share Posted October 5, 2014 (edited) Alright, so I figured out how to do this. the WinAPI gave me help, but wasn't exactly what I was looking for (probably too vague). I wanted the GUI itself to stay open, but the dialogs within the GUI to change smoothly. WinAPI wasn't helping too much because it would take over the entire window, rather than the dialog inside. So I did something like this: 1. Dialog will appear 2. User will click a button to move to the next page This code executes: $lnqbkg=GUICtrlCreatePic (@ScriptDir&"/assets/images/lnqbkg.jpg", 1, 1, 600, 400) GUICtrlSetState($lnqbkg, $GUI_DISABLE) guisetstate (@SW_LOCK) When the loop comes around again (the GUI is based off of one loop that changes the text and controls within it based on an Excel Sheet), this code executes: ;Old controls are deleted and new controls are created here. A lot of lines, no need to copy and paste them all GUICtrlDelete ($lnqbkg) GUISetState (@SW_UNLOCK) This removes a picture that pretty much says "Loading" and goes back to the GUI. The key was @SW_LOCK and @SW_UNLOCK ... I did a little research in the help file and found these. Never knew they existed, quite useful! Thanks for the help of everyone! Gave me a lot of great ideas about this problem plus some others I'm having. Edited October 5, 2014 by Spikeedoodles Link to comment Share on other sites More sharing options...
kylomas Posted October 5, 2014 Share Posted October 5, 2014 Good Job! @SW_LOCK...@SW_UNLOCK are also great at minimizing listview flicker, if you ever need it. Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now