J'ai du créer pour un projet des groupes qui puissent se minimiser et augmenter de taille suivant la volonté de l'utilisateur.
Voici donc HideAndShow.au3 cet UDF vous permettra de :
- Créer des groupes rétractable
- Déplacer tous les autres contrôles en conséquences
- Activer indépendamment chaque groupe (j'imagine que cela va de soit )
Exemple.au3
► Afficher le texte
Code : Tout sélectionner
#include <Array.au3>
#include <GuiConstants.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
#include "HideAndShow.au3"
_Exemple()
func _Exemple()
Global $Form1 = GUICreate("Example", 600, 600, 0, 0)
GUISetState(@SW_SHOW)
_HS_Start($Form1)
Global $hGrpEV = _HS_GroupOpen("Titre du group", 5, 5 , 515, 150)
$hListView = GUICtrlCreateListView("wd", 12, 20, 500, 125)
_HS_GroupClose()
Global $hGrpEV2 = _HS_GroupOpen("Titre du group", 5, 160 , 515, 150)
GUICtrlCreateLabel("TEST", 15, 185)
$idprg = GUICtrlCreateProgress(40,210,150,15)
_HS_GroupClose()
Global $hGrpEV3 = _HS_GroupOpen("Titre du group3", 5, 315, 515, 200)
GUICtrlCreateButton("Button3", 10, 475, 75, 25)
$itestExclude = GUICtrlCreateCheckbox("Exlcuded", 100, 475, 75, 25)
_HS_Exclude($itestExclude)
$hListView3 = GUICtrlCreateListView("test3|test3", 12, 330, 500, 125)
_HS_GroupClose()
GUICtrlCreateButton("Moving With Groups", 5, 550, 120, 20)
_HS_Stop()
$GetPos = GUICtrlCreateButton("NoMove", 200, 550, 50, 20)
EndFunc
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
case $hGrpEV
_HS_ActiveGroup($hGrpEV)
case $hGrpEV2
_HS_ActiveGroup($hGrpEV2)
case $hGrpEV3
_HS_ActiveGroup($hGrpEV3)
EndSwitch
WEnd
HideAndShow.au3 - 19.08.2013
► Afficher le texte
Code : Tout sélectionner
; #INDEX# ============================================================================================================
; Title .........: HideAndShow
; AutoIt Version : 3.3 +
; Language ......: Eng
; Description ...: Allow user to create group with hide/show function.
; Remarks .......: If your GUI is using $WS_SIZE, dont forget to set $iStyle and $iStyleIco when you call _HS_GroupOpen
; (Thanks to Mikell for his tips) for example you can use this following style :
;
; Global $iGrpStyle = $GUI_DOCKHEIGHT + $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKRIGHT
; Global $iIcoStyle = $GUI_DOCKHEIGHT + $GUI_DOCKTOP + $GUI_DOCKWIDTH + $GUI_DOCKRIGHT
;
; You can have trouble if you use ScrollBars, you can fix this behavior by using this following functions :
;
; _HS_PosBackup() - To Save top position before change
; _HS_PosRestore() - To Restore top position after change
;
; Version .......: 0.5 (TEST)
; Author ........: M4n0x (20 july 2013)
; ====================================================================================================================
; #INCLUDES# =========================================================================================================
#include <GuiConstantsEx.au3>
#include <ButtonConstants.au3>
#include <Array.au3>
; #GLOBAL VARIABLES# =================================================================================================
; Array to save groups and other details.
Global $aHS_AllGroups[1][8], $aHSAllPos[1][1]
; Global to manage id to not hide
Global $aHS_ExcludeCtrl[1]
; #CURRENT# ==========================================================================================================
; _HS_GroupStart : Save the parent gui
; _HS_GroupOpen : Create a group and save its positions to an array
; _HS_GroupClose : Close the group
; _HS_ActiveGroup : Main Function allow to use fonction hide and show.
; _HS_Stop : Stop controls moves after this function.
; _HS_PosBackup : Stored all controls top value for future use
; _HS_PosRestore : Restore all controls top value
; _HS_Exclude : Exclude a control from the hide function
; _HS_GetIDGroup : Get group ID by the return of _HS_GroupOpen
; ====================================================================================================================
; #INTERNAL_USE_ONLY#=================================================================================================
; _HS_ControlUP : Move up all controls id between the group and HS_Stop
; _HS_ControlDown : Move down all controls id between the group and HS_Stop
; ====================================================================================================================
; #FUNCTION# =========================================================================================================
; Name...........: _HS_Start
; Description ...: save GUI where groups are created
; Syntax.........: _HS_Start($hWnd)
; Parameters ....: $hWnd - Handle GUI where groups will be created
; Requirement(s).: v3.3 +
; Return values .: -
;=====================================================================================================================
Func _HS_Start($hWnd)
$aHS_AllGroups[0][2] = $hWnd
EndFunc ;==>_HS_Start
; #FUNCTION# =========================================================================================================
; Name...........: _HS_GroupOpen
; Description ...: Create a group and save informations into an global array
; Syntax.........: _HS_GroupOpen($sName, $iLeft, $iTop, $iWidth, $iHeight [, $iStyle = $GUI_DOCKHEIGHT + $GUI_DOCKTOP [, $iStyleIco = -1]])
; Parameters ....: $sName - Group label
; $iLeft - Left position
; $iTop - Top position
; $iWidth - Group width
; $iHeight - Group height
; $iStyle - Set resize parameter in case of a gui with $WS_SIZEBOX (for the groupe only, not the controls in it)
; $iStyleIco - Define resizing style for the Ico (button) for switching between hide and show
; Requirement(s).: v3.3 +
; Return values .:
; Remarks .......:
; Example........: Yes
;=====================================================================================================================
Func _HS_GroupOpen($sName, $iLeft, $iTop, $iWidth, $iHeight, $iStyle = -1, $iStyleIco = -1)
Local $iCurrID = UBound($aHS_AllGroups)
$aHS_AllGroups[0][0] = $iCurrID
ReDim $aHS_AllGroups[$iCurrID + 1][8]
$aHS_AllGroups[$iCurrID][0] = GUICtrlCreateGroup($sName, $iLeft, $iTop, $iWidth, $iHeight)
if $iStyle <> -1 then GuiCtrlSetResizing(-1, $iStyle)
$aHS_AllGroups[$iCurrID][1] = $iLeft
$aHS_AllGroups[$iCurrID][2] = $iTop
$aHS_AllGroups[$iCurrID][3] = $iWidth
$aHS_AllGroups[$iCurrID][4] = $iHeight
$aHS_AllGroups[$iCurrID][6] = True
$aHS_AllGroups[$iCurrID][7] = GUICtrlCreateButton("", $iLeft + $iWidth, $iTop + 5, 19, 19, $BS_ICON)
if $iStyleIco <> -1 then GuiCtrlSetResizing(-1, $iStyleIco)
GUICtrlSetImage($aHS_AllGroups[$iCurrID][7], "Shell32.dll", -247, 0)
Return $aHS_AllGroups[$iCurrID][7]
EndFunc ;==>_HS_GroupOpen
; #FUNCTION# =========================================================================================================
; Name...........: _HS_GroupClose
; Description ...: Close the group and save informations in the global array
; Syntax.........: _HS_GroupClose()
; Parameters ....: NoParam
; Requirement(s).: v3.3 +
; Return values .:
; Remarks .......:
; Example........: Yes
;=====================================================================================================================
Func _HS_GroupClose()
$aHS_AllGroups[UBound($aHS_AllGroups) - 1][5] = GUICtrlCreateGroup("", -99, -99, 1, 1)
GuiCtrlSetResizing(-1, $GUI_DOCKALL)
EndFunc ;==>_HS_GroupClose
; #FUNCTION# =========================================================================================================
; Name...........: _HS_ActiveGroup
; Description ...: Retract or expand the group and moves all controls created after the group until _HS_Stop()
; Syntax.........: _HS_ActiveGroup($iCtlID)
; Parameters ....: $iCtrlID - handle the return of _HS_GroupOpen to use hide/show function, this paramater is saved in the global
; array, with this, the udf can retrieve the group id by searching in the global array.
; Requirement(s).: v3.3 +
; Return values .:
; Remarks .......:
; Example........: Yes
;=====================================================================================================================
Func _HS_ActiveGroup($iCtrlID)
Local $iCurrID = UBound($aHS_AllGroups)
; retrieve the group
For $id = 0 To $iCurrID - 1
If $iCtrlID = $aHS_AllGroups[$id][7] Then ExitLoop
Next
If $aHS_AllGroups[$id][6] Then
GUICtrlSetPos($aHS_AllGroups[$id][0], Default, Default, Default, 30)
; hide all objects in the group
For $i = $aHS_AllGroups[$id][0] + 1 To $aHS_AllGroups[$id][5] - 1
If $aHS_AllGroups[$id][7] = $i Then
GUICtrlSetImage($aHS_AllGroups[$id][7], "shell32.dll", -248, 0)
ContinueLoop
EndIf
if $aHS_ExcludeCtrl <> 0 Then
if _ArraySearch($aHS_ExcludeCtrl,$i,1) < 1 Then
GUICtrlSetState($i, $GUI_HIDE)
EndIf
EndIf
Next
_HS_ControlUP($id)
;Switch to know if is already retracted ( false = retracted )
$aHS_AllGroups[$id][6] = False
Else
_HS_ControlDown($id)
GUICtrlSetPos($aHS_AllGroups[$id][0], Default, Default, Default, $aHS_AllGroups[$id][4])
For $i = $aHS_AllGroups[$id][0] + 1 To $aHS_AllGroups[$id][5] - 1
If $aHS_AllGroups[$id][7] = $i Then
GUICtrlSetImage($aHS_AllGroups[$id][7], "shell32.dll", -247, 0)
ContinueLoop
EndIf
GUICtrlSetState($i, $GUI_SHOW)
Next
;Switch to know if is already retracted ( true = not retracted )
$aHS_AllGroups[$id][6] = True
EndIf
EndFunc ;==>_HS_ActiveGroup
; #INTERNAL_USE_ONLY# =========================================================================================================
; Name...........: _HS_ControlUP
; Description ...: Move up all controls id between the group and HS_Stop
;==============================================================================================================================
Func _HS_ControlUP($id)
For $i = $aHS_AllGroups[$id][5]+1 To $aHS_AllGroups[0][1] - 1
$test = ControlGetPos($aHS_AllGroups[0][2], "", $i)
;~ if $test[0] < 0 and $test[1] < 0 Then ContinueLoop
GUICtrlSetPos($i, Default, ($test[1] - $aHS_AllGroups[$id][4]) + 30)
Next
EndFunc ;==>_HS_ControlUP
; #INTERNAL_USE_ONLY# =========================================================================================================
; Name...........: _HS_ControlUP
; Description ...: Move down all controls id between the group and HS_Stop
;==============================================================================================================================
Func _HS_ControlDown($id)
For $i = $aHS_AllGroups[$id][5]+1 To $aHS_AllGroups[0][1] - 1
$test = ControlGetPos($aHS_AllGroups[0][2], "", $i)
;~ if $test[0] < 0 and $test[1] < 0 Then ContinueLoop
GUICtrlSetPos($i, Default, ($test[1] + $aHS_AllGroups[$id][4]) - 30)
Next
EndFunc ;==>_HS_ControlDown
; #FUNCTION# =========================================================================================================
; Name...........: _HS_Stop
; Description ...: Stored the last control id for moving the rights controls
; Syntax.........: _HS_Stop()
; Parameters ....: No param
; Requirement(s).: v3.3 +
; Return values .: -
;=====================================================================================================================
Func _HS_Stop()
$aHS_AllGroups[0][1] = GUICtrlCreateDummy()
EndFunc ;==>_HS_Stop
; #FUNCTION# =========================================================================================================
; Name...........: _HS_GetIDGroup
; Description ...: Get group ID
; Syntax.........: _HS_GetIDGroup($iCtrlID)
; Parameters ....: $iCtrlID - It's the _HS_GroupOpen() return
; Requirement(s).: v3.3 +
; Return values .: Return the group ID
;=====================================================================================================================
Func _HS_GetIDGroup($iCtrlID)
Local $iCurrID = UBound($aHS_AllGroups)
For $id = 0 To $iCurrID - 1
If $iCtrlID = $aHS_AllGroups[$id][7] Then ExitLoop
Next
Return $aHS_AllGroups[$id][0]
EndFunc
; #FUNCTION# =========================================================================================================
; Name...........: _HS_PosBackUp
; Description ...: Return if the group is open or close
; Syntax.........: _HS_PosBackUp()
; Parameters ....: $iCtrlID - it's the value returned by _HS_GroupOpen
; Requirement(s).: v3.3 +
; Return values .: True - Not retracted
; False - Retracted
;=====================================================================================================================
Func _HS_IsShown($iCtrlID)
Local $iCurrID = UBound($aHS_AllGroups)
For $id = 0 To $iCurrID - 1
If $iCtrlID = $aHS_AllGroups[$id][7] Then ExitLoop
Next
Return $aHS_AllGroups[$id][6]
EndFunc
; #FUNCTION# =========================================================================================================
; Name...........: _HS_PosBackUp
; Description ...: Stored Top value for all controls under HS section (Start and Stop)
; Syntax.........: _HS_PosBackUp()
; Parameters ....: No param
; Requirement(s).: v3.3 +
; Return values .: -
;=====================================================================================================================
Func _HS_PosBackUp()
Local $iMaxID = UBound($aHS_AllGroups) -1
Local $iCount = ($aHS_AllGroups[0][1] -$aHS_AllGroups[1][0]) + 1
ReDim $aHSAllPos[$iCount][1]
local $nb = 0
For $i = $aHS_AllGroups[1][0] To $aHS_AllGroups[0][1]
$aTemp = ControlGetPos($aHS_AllGroups[0][2], "", $i)
if IsArray($aTemp) Then
$aHSAllPos[$nb][0] = $aTemp[1]
Else
$aHSAllPos[$nb][0] = "N/A"
EndIf
$nb += 1
Next
EndFunc
; #FUNCTION# =========================================================================================================
; Name...........: _HS_PosRestore
; Description ...: Restore Top value for all controls under HS section (Start and Stop)
; Syntax.........: _HS_PosRestore()
; Parameters ....: No param
; Requirement(s).: Use _HS_PosBackup before using this function.
; Return values .: -
;=====================================================================================================================
Func _HS_PosRestore()
local $nb = 0
Local $iMaxID = UBound($aHS_AllGroups) -1
For $i = $aHS_AllGroups[1][0] To $aHS_AllGroups[0][1]
if $aHSAllPos[$nb][0] <> "N/A" then
GUICtrlSetPos($i, default, $aHSAllPos[$nb][0])
EndIf
$nb += 1
Next
EndFunc
; #FUNCTION# =========================================================================================================
; Name...........: _HS_Exclude
; Description ...: Exclude control from Hide and Show function.
; Syntax.........: HS_Exclude($iCtrlID)
; Parameters ....: $iCtrlID - Control ID to exclude on hide and show function, it will be always displayed.
; Return values .: -
;=====================================================================================================================
Func _HS_Exclude($iCtrlID)
Local $iMax = UBound($aHS_ExcludeCtrl)
$aHS_ExcludeCtrl[0] = UBound($aHS_ExcludeCtrl)
ReDim $aHS_ExcludeCtrl[$iMax + 1]
$aHS_ExcludeCtrl[$iMax] = $iCtrlID
EndFunc
► Afficher le texte
Code : Tout sélectionner
; #INDEX# ============================================================================================================
; Title .........: HideAndShow
; AutoIt Version : 3.3 +
; Language ......: Eng
; Description ...: Allow user to create group with hide/show function.
; Remarks .......:
; Version .......: 0.1 (TEST)
; Author ........: M4n0x (20 july 2013)
; ====================================================================================================================
; #INCLUDES# =========================================================================================================
#include <GuiConstantsEx.au3>
#include <ButtonConstants.au3>
; #GLOBAL VARIABLES# =================================================================================================
; Array to save groups and other details about the main gui and number of groups.
Global $aHS_AllGroups[1][8]
; #CURRENT# ==========================================================================================================
; _HS_GroupStart: Save the parent gui
; _HS_GroupOpen: create a group and save position info to an array
; _HS_GroupClose: Close the group and save last control id
; _HS_ActiveGroup: Main Function allow to use fonction hide and show.
; _HS_Stop: Stop deplacement of controls after this function.
; ====================================================================================================================
; #INTERNAL_USE_ONLY#=================================================================================================
; _HS_ControlUP: Move up all controls id between the group and HS_Stop
; _HS_ControlDown: Move down all controls id between the group and HS_Stop
; ====================================================================================================================
; #FUNCTION# =========================================================================================================
; Name...........: _HS_Start
; Description ...: save GUI where groups are created
; Syntax.........: _HS_Start($hWnd)
; Parameters ....: $hWnd - Handle GUI where groups will be created
; Requirement(s).: v3.3 +
; Return values .: -
; Author ........: M4n0x
;=====================================================================================================================
Func _HS_Start($hWnd)
$aHS_AllGroups[0][2] = $hWnd
EndFunc ;==>_HS_Start
; #FUNCTION# =========================================================================================================
; Name...........: _HS_GroupOpen
; Description ...: Create a group and save informations into an global array
; Syntax.........: _HS_GroupOpen($sName, $iLeft, $iTop, $iWidth, $iHeight [, $iStyle = $GUI_DOCKHEIGHT + $GUI_DOCKTOP [, $iStyleIco = -1]])
; Parameters ....: $sName - label of the groupe
; $iLeft - Left position
; $iTop - Top position
; $iWidth - Width of the group
; $iHeight - Heigth of the group
; $iStyle - Set resize parameter on case of a gui with $WS_SIZEBOX (for the groupe only, not the controls in it)
; $iStyleIco - Define resizing style for the Ico (button) for switching between hide and show
; Requirement(s).: v3.3 +
; Return values .:
; Author ........: M4n0x
; Remarks .......:
; Example........: Yes
;=====================================================================================================================
Func _HS_GroupOpen($sName, $iLeft, $iTop, $iWidth, $iHeight, $iStyle = -1, $iStyleIco = -1)
Local $iCurrID = UBound($aHS_AllGroups)
$aHS_AllGroups[0][0] = $iCurrID ; Le Total de groupe
ReDim $aHS_AllGroups[$iCurrID + 1][8]
$aHS_AllGroups[$iCurrID][0] = GUICtrlCreateGroup($sName, $iLeft, $iTop, $iWidth, $iHeight)
if $iStyle <> -1 then GuiCtrlSetResizing(-1, $iStyle)
$aHS_AllGroups[$iCurrID][1] = $iLeft
$aHS_AllGroups[$iCurrID][2] = $iTop
$aHS_AllGroups[$iCurrID][3] = $iWidth
$aHS_AllGroups[$iCurrID][4] = $iHeight
$aHS_AllGroups[$iCurrID][6] = True
$aHS_AllGroups[$iCurrID][7] = GUICtrlCreateButton("", $iWidth +5, $iTop + 5, 19, 19, $BS_ICON)
if $iStyleIco <> -1 then GuiCtrlSetResizing(-1, $iStyleIco)
GUICtrlSetImage($aHS_AllGroups[$iCurrID][7], "Shell32.dll", -247, 0)
Return $aHS_AllGroups[$iCurrID][7]
EndFunc ;==>_HS_GroupOpen
; #FUNCTION# =========================================================================================================
; Name...........: _HS_GroupClose
; Description ...: Close the group and save informations in the global array
; Syntax.........: _HS_GroupClose()
; Parameters ....: NoParam
; Requirement(s).: v3.3 +
; Return values .:
; Author ........: M4n0x
; Remarks .......:
; Example........: Yes
;=====================================================================================================================
Func _HS_GroupClose()
$aHS_AllGroups[UBound($aHS_AllGroups) - 1][5] = GUICtrlCreateGroup("", -99, -99, 1, 1)
GuiCtrlSetResizing(-1, $GUI_DOCKALL)
EndFunc ;==>_HS_GroupClose
; #FUNCTION# =========================================================================================================
; Name...........: _HS_ActiveGroup
; Description ...: Retract the group in parameter and moves all controls created after the group until _HS_Stop()
; Syntax.........: _HS_GroupOpen($sName, $iLeft, $iTop, $iWidth, $iHeight)
; Parameters ....: $iCtrlID - handle the image id control to use hide/show function, this paramater is saved in the global
; array, with this, the udf can retrieve the group id by searching in the global array.
; Requirement(s).: v3.3 +
; Return values .:
; Author ........: M4n0x
; Remarks .......:
; Example........: Yes
;=====================================================================================================================
Func _HS_ActiveGroup($iCtrlID)
Local $iCurrID = UBound($aHS_AllGroups)
; retrieve the group
For $id = 0 To $iCurrID - 1
If $iCtrlID = $aHS_AllGroups[$id][7] Then ExitLoop
Next
If $aHS_AllGroups[$id][6] Then
GUICtrlSetPos($aHS_AllGroups[$id][0], Default, Default, Default, 30)
; hide all objects in the group
For $i = $aHS_AllGroups[$id][0] + 1 To $aHS_AllGroups[$id][5] - 1
If $aHS_AllGroups[$id][7] = $i Then
GUICtrlSetImage($aHS_AllGroups[$id][7], "shell32.dll", -248, 0)
ContinueLoop
EndIf
GUICtrlSetState($i, $GUI_HIDE)
Next
_HS_ControlUP($id)
;Switch to know if is already retracted ( false = not retracted )
$aHS_AllGroups[$id][6] = False
Else
_HS_ControlDown($id)
GUICtrlSetPos($aHS_AllGroups[$id][0], Default, Default, Default, $aHS_AllGroups[$id][4])
; show all objects in the group
For $i = $aHS_AllGroups[$id][0] + 1 To $aHS_AllGroups[$id][5] - 1
If $aHS_AllGroups[$id][7] = $i Then
GUICtrlSetImage($aHS_AllGroups[$id][7], "shell32.dll", -247, 0)
ContinueLoop
EndIf
GUICtrlSetState($i, $GUI_SHOW)
Next
;Switch to know if is already retracted ( true = not retracted )
$aHS_AllGroups[$id][6] = True
EndIf
EndFunc ;==>_HS_ActiveGroup
; #INTERNAL_USE_ONLY# =========================================================================================================
; Name...........: _HS_ControlUP
; Description ...: Move up all controls id between the group and HS_Stop
; Author ........: M4n0x
;==============================================================================================================================
Func _HS_ControlUP($id)
For $i = $aHS_AllGroups[$id][5]+1 To $aHS_AllGroups[0][1] - 1
$test = ControlGetPos($aHS_AllGroups[0][2], "", $i)
if $test[0] = -99 and $test[1] = -99 Then ContinueLoop
GUICtrlSetPos($i, Default, ($test[1] - $aHS_AllGroups[$id][4]) + 30)
Next
EndFunc ;==>_HS_ControlUP
; #INTERNAL_USE_ONLY# =========================================================================================================
; Name...........: _HS_ControlUP
; Description ...: Move down all controls id between the group and HS_Stop
; Author ........: M4n0x
;==============================================================================================================================
Func _HS_ControlDown($id)
For $i = $aHS_AllGroups[$id][5]+1 To $aHS_AllGroups[0][1] - 1
$test = ControlGetPos($aHS_AllGroups[0][2], "", $i)
if $test[0] = -99 and $test[1] = -99 Then ContinueLoop
GUICtrlSetPos($i, Default, ($test[1] + $aHS_AllGroups[$id][4]) - 30)
Next
EndFunc ;==>_HS_ControlDown
; #FUNCTION# =========================================================================================================
; Name...........: _HS_Stop
; Description ...: Stored the last control id for moving the correct controls
; Syntax.........: _HS_Start()
; Parameters ....: No param
; Requirement(s).: v3.3 +
; Return values .: -
; Author ........: M4n0x
;=====================================================================================================================
Func _HS_Stop()
$aHS_AllGroups[0][1] = GUICtrlCreateDummy()
EndFunc ;==>_HS_Stop
_HS_Start() -> Première fonction à utiliser, elle sert juste à indiquer le "GUI" à utiliser pour la création des groupes, ça évite de le passer dans la fonction suivante à chaque fois.
_HS_GroupOpen() -> Seconde fonction à utiliser, elle permet de déclarer un groupe, avec les paramètres qui vont avec, il retourne la valeur du bouton qui sera utiliser pour cacher/afficher le groupe. Il faut déclarer le return dans un Global pour pouvoir le réutiliser après coup pour afficher/cacher
_HS_GroupClose() -> Après avoir ouvert un groupe toujours utiliser cette fonction, elle ferme le groupe . (concrètement tous les contrôles entre groupOpen et groupClose seront cachés à contrario les autres non).
_HS_Stop() -> Défini jusqu'a quel item les contrôles seront déplacés, je sais pas si c'est clair mais sur les principe tous les contrôles de votre groupClose à Stop seront déplacés lors de la fermerture ou l'ouverture d'un groupe.
_HS_ActiveGroup() -> Est utilisé pour fermer ou ouvrir le groupe, le paramètre passer doit être le return de _HS_GroupOpen()
NEW FUNCTIONS
_HS_IsShown() -> Permet de savoir l'état du groupe (ouvert ou fermé)
_HS_PosBackUp() -> Sauvegarde la valeur "Top" de tous les contrôles pris en charge par l'udf. Cette func peut-être utile si vous utilisez une fenêtre redimensionnée avec des scrollbars par exemple, à utiliser conjointement avec _HS_PosRestore().
_HS_PosRestore() -> Restaure la valeur "Top" sur tous les contrôles sauvegardés auparavant par _HS_PosBackUp().
_HS_Exclude() -> Exclue le contrôle passé en paramètre de la function hide, le contrôle sera toujours visible. (à utiliser exclusivement sur les contrôles entre _HS_Start et _HS_Stop!)
_HS_GetIDGroup -> Retourne l'ID du groupe en passant en paramètre la valeur de retour de la function _HS_GroupOpen
l'UDF n'est pas parfait loin de là, je l'ai, à la base, fait pour un besoin particulier, mais c'est particulière le genre de controles que je pense avoir a réutiliser dans le futur, alors plutôt que de faire une version spécifique, en voici la version générique.
Tous les cas n'ont pas étés testés, aussi, je vous serais reconnaissant de me donner des retours en cas de bug et plus particulière si le code peut-être optimisé ne vous gênez pas, ça me servira surement beaucoup et j'espère à d'autres.
M40
Edit (20.07.13): Optimisations et corrections
Edit (31.07.13): Ajout de function.
Edit (02.08.13): Update mineure
Edit (19.08.13): Update mineure