Jump to content

Retractable Window?


Recommended Posts

Hey :)

I've created a simple GUI with 1 window.

is there a way to make a retractable window that opens once you press button X?

For example:

This is the window I have (just for example, this is actually MSI Afterburner)

msilike1.png

I want to be able to "pull" another window from the right once a button is pressed, like this:

msilike.png

How do I do that?

Thank you,

Omga4000 :)

Link to comment
Share on other sites

Try doing it with UDF from Melba

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

Do you also want to theme your GUI?

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 parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

Thank you, will do :)

Oh no sir, there is no need.

No need for formalities, guinness is just fine. OK, that's good to hear.

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 parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

I've tried using M23's script - but I keep receiving error after error..

What variables should I declare before running my script?

This is what I declared:

Global $aGUIExt_GUI_Data[1][2] = [[0, 0]]
Global $aGUIExt_Obj_Data[1][2] = [[0]]
Global $fGUIExt_SectionAction = False
Local $aActive_Section_Data[1][9] = [[0, 0, 1, 0, "", 9999]]

And now it says:


B:2) ProgramsAutoIt3IncludeGUIExtender.au3 (228) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:

$aGUIExt_GUI_Data[$iGUI_Index][1] = $aActive_Section_Data
^ ERROR

I've searched M23's file yet I didn't find the place he declareiGUI_Index.

.

Edited by Omga4000
Link to comment
Share on other sites

  • Moderators

Omga4000,

You do not have to declare any of those - the UDF does it for you. All you need to do is to place GUIExtender.au3 in the same folder as the examples and then run them. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Thank you for commenting M23 :)

I've placed GUIExtender.au3 inside "AutoIt3Include" and included your file in the following way: #include <GUIExtender.au3>

Do I also need to add the other files to this folder? (the example files)

Also - for creating a scenario where I want the program to extend the window do I use this?

$iCalc_Section = _GUIExtender_Section_Start($hGUI, 80, 110)
   //All of the GUI content here
_GUIExtender_Section_End($hGUI)

Thanks again :)

Link to comment
Share on other sites

  • Moderators

Omga4000,

I suggest you read the Adding UDFs to AutoIt and SciTE tutorial in the Wiki - putting UDFs in the main Include folder is not recommended.  But as you have done this, you should be able to run the examples from any folder. ;)

I cannot comment on the snippet you posted - I need to see the whole script.  Perhaps you could post it - see here how to do it.  And please add comments so that I know which part is supposed to be retractable/extendable and what control should action it. :)

M23

Edited by Melba23
Fixed link

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Hey M23,

Sorry - read the entire post and did as mentioned. It now stores the UDF in an external location.

I know how to post AutoIt links of course - used it in this topic a few times ;)

I've wrote comments in the GUI region so you'd know what I need to be extended (although it is pretty obvious).

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <ProgressConstants.au3>
#include <SendMessage.au3>
#include <GUIExtender.au3>

#Region ### START Koda GUI section ### Form=b:\2) programs\autoit3\koda 1.7.3.0\forms\diablo iii auto-gem v1.kxf
$Form1 = GUICreate("Form1", 330, 380, 779, 310)
$Num_of_Radiants_Label = GUICtrlCreateLabel("Num. of Radiants(1-24):", 16, 8, 116, 17)
$Num_of_Radiants_Input = GUICtrlCreateInput("", 16, 32, 105, 21)
$Label1 = GUICtrlCreateLabel("Start From:", 168, 8, 55, 17)
$Start_From_Combo = GUICtrlCreateCombo("", 168, 32, 145, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "Perfect Square|Radiant Square|Star|Flawless Star|Perfect Star|Radiant Star", "Perfect Square")

;;;;
;;Would like this to be extended - Starting here;;
$Flaw_SQR_Label = GUICtrlCreateLabel("Flawless Square Needed:", 48, 112, 125, 17)
$Flaw_SQR_Input = GUICtrlCreateInput("", 176, 108, 105, 21)
$Perf_SQR_Label = GUICtrlCreateLabel("Perfect Square Needed:", 48, 145, 119, 17)
$Perf_SQR_Input = GUICtrlCreateInput("", 176, 141, 105, 21)
$Rada_SQR_Label = GUICtrlCreateLabel("Radiant Sqaure Needed:", 48, 178, 122, 17)
$Rada_SQR_Input = GUICtrlCreateInput("", 176, 174, 105, 21)
$Star_Label = GUICtrlCreateLabel("Star Needed:", 48, 211, 67, 17)
$Star_Input = GUICtrlCreateInput("", 176, 207, 105, 21)
$Flaw_Star_Label = GUICtrlCreateLabel("Flawless Star Needed:", 48, 244, 110, 17)
$Flaw_Star_Input = GUICtrlCreateInput("", 176, 240, 105, 21)
$Perf_Star_Label = GUICtrlCreateLabel("Perfect Star Needed:", 48, 277, 104, 17)
$Perf_Star_Input = GUICtrlCreateInput("", 176, 273, 105, 21)
$Tome_Label = GUICtrlCreateLabel("Tome of Secrets Needed:", 48, 310, 126, 17)
$Tome_Input = GUICtrlCreateInput("", 176, 306, 105, 21)
;;Ending Here;;
;;;;

$OK_Button = GUICtrlCreateButton("Go!", 127, 344, 75, 25)
$Calc_Label = GUICtrlCreateLabel("Calculations:", 29, 80, 64, 17)

;;;;
;;This is the button that should activate the extension process;;
$Calc_Button = GUICtrlCreateButton("-->", 96, 77, 27, 20)
;;Ending here;;
;;;;

GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###




While 1
    $Flaw_to_Rada = 729
   $Perf_to_Rada = 243
   $Rad_to_Rada = 81
   $Star_to_Rada = 27
   $Flaw_Star_to_Rada = 9
   $Perf_Start_to_Rada = 3

   $Tome_Flaw_to_Rada = 1631
   $Tome_Perf_to_Rada = 902
   $Tome_Rad_to_Rada = 416
   $Tome_Star_to_Rada = 173
   $Tome_Flaw_Star_to_Rada = 65
   $Tome_Perf_Start_to_Rada = 20
   $nMsg = GUIGetMsg()

   Switch $nMsg
   Case $GUI_EVENT_CLOSE
      Exit

   Case  $Start_From_Combo OR $Num_of_Radiants_Input

      $Start_From = GUICtrlRead($Start_From_Combo)
      $Num_Rada = GUICtrlRead($Num_of_Radiants_Input)

      If $Start_From = "Perfect Square" Then
         GUICtrlSetData($Flaw_SQR_Input, 729*$Num_Rada)
         GUICtrlSetData($Perf_SQR_Input, 243*$Num_Rada)
         GUICtrlSetData($Rada_SQR_Input, 81*$Num_Rada)
         GUICtrlSetData($Star_Input, 27*$Num_Rada)
         GUICtrlSetData($Flaw_Star_Input, 9*$Num_Rada)
         GUICtrlSetData($Perf_Star_Input, 3*$Num_Rada)
         GUICtrlSetData($Tome_Input, 1631*$Num_Rada)
      EndIf

      If $Start_From = "Radiant Square" Then
         GUICtrlSetData($Flaw_SQR_Input, 0)
         GUICtrlSetData($Perf_SQR_Input, 243*$Num_Rada)
         GUICtrlSetData($Rada_SQR_Input, 81*$Num_Rada)
         GUICtrlSetData($Star_Input, 27*$Num_Rada)
         GUICtrlSetData($Flaw_Star_Input, 9*$Num_Rada)
         GUICtrlSetData($Perf_Star_Input, 3*$Num_Rada)
         GUICtrlSetData($Tome_Input, 902*$Num_Rada)
      EndIf

      If $Start_From = "Star" Then
         GUICtrlSetData($Flaw_SQR_Input, 0)
         GUICtrlSetData($Perf_SQR_Input, 0)
         GUICtrlSetData($Rada_SQR_Input, 81*$Num_Rada)
         GUICtrlSetData($Star_Input, 27*$Num_Rada)
         GUICtrlSetData($Flaw_Star_Input, 9*$Num_Rada)
         GUICtrlSetData($Perf_Star_Input, 3*$Num_Rada)
         GUICtrlSetData($Tome_Input, 416*$Num_Rada)
      EndIf

      If $Start_From = "Flawless Star" Then
         GUICtrlSetData($Flaw_SQR_Input, 0)
         GUICtrlSetData($Perf_SQR_Input, 0)
         GUICtrlSetData($Rada_SQR_Input, 0)
         GUICtrlSetData($Star_Input, 27*$Num_Rada)
         GUICtrlSetData($Flaw_Star_Input, 9*$Num_Rada)
         GUICtrlSetData($Perf_Star_Input, 3*$Num_Rada)
         GUICtrlSetData($Tome_Input, 173*$Num_Rada)
      EndIf

      If $Start_From = "Perfect Star" Then
         GUICtrlSetData($Flaw_SQR_Input, 0)
         GUICtrlSetData($Perf_SQR_Input, 0)
         GUICtrlSetData($Rada_SQR_Input, 0)
         GUICtrlSetData($Star_Input, 0)
         GUICtrlSetData($Flaw_Star_Input, 9*$Num_Rada)
         GUICtrlSetData($Perf_Star_Input, 3*$Num_Rada)
         GUICtrlSetData($Tome_Input, 65*$Num_Rada)
      EndIf

      If $Start_From = "Radiant Star" Then
         GUICtrlSetData($Flaw_SQR_Input, 0)
         GUICtrlSetData($Perf_SQR_Input, 0)
         GUICtrlSetData($Rada_SQR_Input, 0)
         GUICtrlSetData($Star_Input, 0)
         GUICtrlSetData($Flaw_Star_Input, 0)
         GUICtrlSetData($Perf_Star_Input, 3*$Num_Rada)
         GUICtrlSetData($Tome_Input, 20*$Num_Rada)
      EndIf

   Case $OK_Button


    EndSwitch
WEnd

Thank you for being so patient with me! :)

Regards,

Omga4000.

Edited by Omga4000
Link to comment
Share on other sites

  • Moderators

Omga4000,

Apologies for the "how to post code" bit - I have used it so much since the forum was updated that I added it by default. ;)

Here is a small script that shows how to implement the UDF with the GUI you have:

#include <GUIConstantsEx.au3>

#include <GUIExtender.au3>

$Form1 = GUICreate("Form1", 330, 380)

; Initialise GUI
_GUIExtender_Init($Form1)

; Create first static section
$iSection = _GUIExtender_Section_Start($Form1, 0, 100) ; Starts at 0 and is 100 deep
; Create action button for next section
_GUIExtender_Section_Action($Form1, $iSection + 1, "-->", "<--", 96, 77, 27, 20)
; Close this section
_GUIExtender_Section_End($Form1)

; Start the next retractable section
_GUIExtender_Section_Start($Form1, 100, 220) ; Starts at 100 (sum of coords of previous section) and is 220 deep)
; Create alabel to show the area
GUICtrlCreateLabel("", 0, 100, 330, 220)
GUICtrlSetBkColor(-1, 0xCCFFCC)
GUICtrlSetState(-1, $GUI_DISABLE)
; Close the section
_GUIExtender_Section_End($Form1)

; Create and close the final static section
_GUIExtender_Section_Start($Form1, 320, 60) ; Note the same formula for the coords
_GUIExtender_Section_End($Form1)

GUISetState(@SW_SHOW)

While 1

    $nMsg = GUIGetMsg()

    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch

    ; This actions the button
    _GUIExtender_Action($Form1, $nMsg)

WEnd

However, as the text of your script makes it abundantly clear that the GUI is intended for use as within Diablo III, that is as far as my help goes.  And you only got that much because adding the UDF to the script is purely cosmetic and has no effect on its running.  Please read the Forum rules (the link is also at bottom right of each page) - particularly the bit about not discussing game interaction - before you post again.  Thread locked. :naughty:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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