Sign in to follow this  
Followers 0
Melba23

GUIExtender - Original version

124 posts in this topic

#61 ·  Posted

coolboy2295,

Now that problem is ok

Good! :mellow:

But i cannot use with gui have a child gui, the child gui not hide

As I said above:

"please post a simple reproducing script"

as it is impossible to know why your code does not work without seeing it. :)

My program is use enventmode so the last solution is update the Function

The UDF works perfectly in OnEvent mode. :)

So, over to you to post some code that illustrates the problem that you have. :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

Share this post


Link to post
Share on other sites



#62 ·  Posted (edited)

My source like this

_GUIExtender_Section_Start(295, 15)
_GUIExtender_Section_Action(5, "", "", 50, 295, 15, 15, 0, 1)
_GUIExtender_Section_End()
_GUIExtender_Section_Start(310, 260)
$hguipic=guicreate("",440,220,10,310, $WS_POPUP,  $WS_EX_MDICHILD,$hGUI)
_GDIPlus_StartUp()
$hImage   = _GDIPlus_ImageLoadFromFile(@ScriptDir&"\im.PNG")
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hguipic)
GUIRegisterMsg($WM_PAINT, "MY_WM_PAINT")
GUISetState()
Func MY_WM_PAINT($hWnd, $Msg, $wParam, $lParam)
    _WinAPI_RedrawWindow($hGUI, 0, 0, $RDW_UPDATENOW)
    _GDIPlus_GraphicsDrawImage($hGraphic, $hImage, 0, 0)
    _WinAPI_RedrawWindow($hGUI, 0, 0, $RDW_VALIDATE)
    Return $GUI_RUNDEFMSG
EndFunc
GUISwitch($hgui)
_GUIExtender_Section_End()
_GUIExtender_Section_Start(570, 40)

And this is the image

Posted Image

Posted Image

It need to add @sw_hide with child gui.

Edited by coolboy2295

Share this post


Link to post
Share on other sites

#63 ·  Posted

coolboy2295,

Look at the example I posted for telmob above. The solution is not to use the UDF generated buttons to control the expansion/retraction of the section but to create your own control - then you can use _GUIExtender_Section_Extend to action the section and add in a GUISetState($hguipic, "", @SW_HIDE/SHOW) to deal with the child GUI. :mellow:

Here is an example: :)

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GUIExtender.au3>

Opt("GUIOnEventMode", 1)

$hGUI = GUICreate("Test", 500, 500)
GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")

_GUIExtender_Init($hGUI)

_GUIExtender_Section_Start(0, 250)

; Create a control to do the extending/retracting
$hButton = GUICtrlCreateButton("Extend", 10, 10, 80, 30)
GUICtrlSetOnEvent(-1, "_Action")

_GUIExtender_Section_End()

$iIndex = _GUIExtender_Section_Start(250, 250)

; Here is our child GUI which we create hidden
$hChild_GUI = GUICreate("", 480, 230, 10, 260, $WS_POPUP, $WS_EX_MDICHILD, $hGUI)
GUISetBkColor(0xFF0000)
GUISetState(@SW_HIDE, $hChild_GUI)
GUISwitch($hGUI)

; Make the section extendable
_GUIExtender_Section_Action($iIndex)
_GUIExtender_Section_End()

; Retract the section initially
_GUIExtender_Section_Extend($iIndex, False)

GUISetState(@SW_SHOW, $hGUI)

While 1
    Sleep(10)
WEnd

Func _Action()
    ; What does the button say?
    Switch GUICtrlRead($hButton)
        Case "Extend"
            ; Extend the section
            _GUIExtender_Section_Extend($iIndex)
            ; Show the GUI
            GUISetState(@SW_SHOW, $hChild_GUI)
            ; Change the button text
            GUICtrlSetData($hButton, "Retract")
        Case "Retract"
            ; Do the opposite
            _GUIExtender_Section_Extend($iIndex, False)
            GUISetState(@SW_HIDE, $hChild_GUI)
            GUICtrlSetData($hButton, "Extend")
    EndSwitch

EndFunc

Func _Exit()
    Exit
EndFunc

All clear? :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

Share this post


Link to post
Share on other sites

#64 ·  Posted (edited)

Ok. It 's ok but it don't have the arrow like the UDF. Can it show the arrow like UDF default. I need that.

Thanks

Edited by coolboy2295

Share this post


Link to post
Share on other sites

#65 ·  Posted

coolboy2295,

Well, you know where I am if you still have problems. :mellow:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

Share this post


Link to post
Share on other sites

#66 ·  Posted (edited)

Well, i think the UDF should have a new function to declare the child gui like the obj. And the child gui auto hide or show when retract and extended. No need to do _GUIExtender_Section_Extend() like your example.

All this just to build your UDF better. You known.

Edited by coolboy2295

Share this post


Link to post
Share on other sites

#67 ·  Posted

coolboy2295,

Well, i think the UDF should have a new function to declare the child gui like the obj

Well, I do not. Such a function would also have to cope with all the possible non-native controls that might be created - and have you any idea how many that would be? The UDF is quite capable of dealing with any such control in the same way as I have demonstrated for child GUIs if the user does a small amount of additional coding - if you want exotic controls, you have to write the code to deal with them. :)

If you are interested, look at the Tabs tutorial in the Wiki to see how other UDFs also expect the user to write their own code to function correctly. :)

However, if you really feel the need for such a function, please write it and post it here - if it is good enough I might include it in the UDF. :mellow:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

Share this post


Link to post
Share on other sites

#68 ·  Posted

Now i don't have enough time to make a new function. But all i need now is how to make the button with guictrlcreatebutton() look like _GUIExtender_Section_Action.

Share this post


Link to post
Share on other sites

#69 ·  Posted (edited)

coolboy2295,

all i need now is how to make the button with guictrlcreatebutton() look like _GUIExtender_Section_Action

_GUIExtender_Section_Action creates a standard AutoIt control - you use the $iType parameter to determine whether it is a single-push button or a toggle-push checkbox. The arrows come from the WebDings font which is installed in every Windows release. :mellow:

Here is an example showing the 2 types:

#include <GUIConstantsEx.au3>

$hGUI = GUICreate("Test", 500, 500)

$hButton = GUICtrlCreateButton("5", 10, 10, 80, 30)
GUICtrlSetFont(-1, 10, 400, 0, "Webdings")
GUICtrlCreateLabel("Single-push button", 100, 20, 300, 20)

$hCheck = GUICtrlCreateCheckBox("3", 10, 50, 80, 30, 0x1000) ; $BS_PUSHLIKE)
GUICtrlSetFont(-1, 10, 400, 0, "Webdings")
GUICtrlCreateLabel("Toggle-push checkbox", 100, 60, 300, 20)

GUISetState()

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $hButton
            Switch GUICtrlRead($hButton)
                Case 5
                    GUICtrlSetData($hButton, 6)
                Case 6
                    GUICtrlSetData($hButton, 5)
            EndSwitch
        Case $hCheck
            Switch GUICtrlRead($hCheck, 1)
                Case 3
                    GUICtrlSetData($hCheck, 4)
                Case 4
                    GUICtrlSetData($hCheck, 3)
            EndSwitch
    EndSwitch

WEnd

All clear? :)

M23

Edit: Just realised you had asked earlier about the "arrows" and so amended the example to show them. :)

Edited by Melba23

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

Share this post


Link to post
Share on other sites

#70 ·  Posted

Oh thank you.

Every thing is clear now

Share this post


Link to post
Share on other sites

#71 ·  Posted

coolboy2295,

Every thing is clear now

Good. :mellow:

I will keep an eye open for that additional function. :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

Share this post


Link to post
Share on other sites

#72 ·  Posted

Thank you Melba23 for this UDF. It works great, although it took me a while to figure out why things weren't working the way I wanted them to at first, playing around with it for a little while made everything clearer. There's no way I could have figured out how to do this on my own at the present time, so I'm really glad you took the time to come up with this.

5 stars from me. :graduated:


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

Share this post


Link to post
Share on other sites

#73 ·  Posted

I'm having a problem when there is a _GUICtrlComboBox in a section that needs to be extendable.

It seems to be immune to _GUIExtender

Any ideas for me to try please?

For example:

#include "GUIExtender.au3"
#include <GUIComboBox.au3>
#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
$hGUI = GUICreate("Test", 500, 200)
_GUIExtender_Init($hGUI, 1)
_GUIExtender_Section_Start(0, 100)
GUICtrlCreateGroup(" 1 - Static ", 10, 10, 80, 180)
_GUIExtender_Section_Action(2, "", "", 70, 20, 15, 15)
_GUIExtender_Section_End()
_GUIExtender_Section_Start(100, 100)
GUICtrlCreateGroup(" 2 - Extendable ", 110, 10, 80, 180)
_GUIExtender_Section_End()
_GUIExtender_Section_Start(200, 100)
GUICtrlCreateGroup(" 3 - Static", 210, 10, 80, 180)
_GUIExtender_Section_Action(4, "Close 4", "Open 4", 220, 90, 60, 20, 1) ; Push button
_GUIExtender_Section_End()
_GUIExtender_Section_Start(300, 100)
GUICtrlCreateGroup(" 4 - Extendable", 310, 10, 80, 180)
   $Typ1 = _GUICtrlComboBox_Create($hGUI, "", 330, 90, 42, 50, BitOR($CBS_DROPDOWN, $WS_VSCROLL, $WS_TABSTOP, $CBS_UPPERCASE))
   ;  If $CadSwitchX = 0 Then
   _GUICtrlComboBox_BeginUpdate($Typ1)
   _GUICtrlComboBox_AddString($Typ1, "ONE")
   _GUICtrlComboBox_AddString($Typ1, "TWO")
   _GUICtrlComboBox_AddString($Typ1, "THREE")
   _GUICtrlComboBox_EndUpdate($Typ1)
_GUIExtender_Section_End()
_GUIExtender_Section_Start(400, 100)
GUICtrlCreateGroup(" 5 - Static", 410, 10, 80, 180)
_GUIExtender_Section_Action(0, "Close All", "Open All", 420, 160, 60, 20) ; Normal button
_GUIExtender_Section_End()
GUICtrlCreateGroup("", -99, -99, 1, 1)
_GUIExtender_Section_Extend(2, False)
GUISetState()
While 1
$iMsg = GUIGetMsg()
Switch $iMsg
  Case $GUI_EVENT_CLOSE
   Exit
EndSwitch
_GUIExtender_Action($iMsg) ; Check for click on Action control
WEnd

Share this post


Link to post
Share on other sites

#74 ·  Posted (edited)

Tippex,

The GUIExtender UDF only works with controls created with the native AutoIt functions as it uses the returned ControlID to show/hide them:

#include <guiconstantsex.au3>
#include <windowsconstants.au3>
#include "GUIExtender.au3"

$hGUI = GUICreate("Test", 500, 200)

_GUIExtender_Init($hGUI, 1)

_GUIExtender_Section_Start(0, 100)
GUICtrlCreateGroup(" 1 - Static ", 10, 10, 80, 180)
_GUIExtender_Section_Action(2, "", "", 70, 20, 15, 15)
_GUIExtender_Section_End()

_GUIExtender_Section_Start(100, 100)
GUICtrlCreateGroup(" 2 - Extendable ", 110, 10, 80, 180)
_GUIExtender_Section_End()

_GUIExtender_Section_Start(200, 100)
GUICtrlCreateGroup(" 3 - Static", 210, 10, 80, 180)
_GUIExtender_Section_Action(4, "Close 4", "Open 4", 220, 90, 60, 20, 1) ; Push button
_GUIExtender_Section_End()

_GUIExtender_Section_Start(300, 100)
GUICtrlCreateGroup(" 4 - Extendable", 310, 10, 80, 180)
$Typ1 = GUICtrlCreateCombo("", 330, 90, 42, 50)
GUICtrlSetData($Typ1, "ONE|TWO|THREE")
_GUIExtender_Section_End()

_GUIExtender_Section_Start(400, 100)
GUICtrlCreateGroup(" 5 - Static", 410, 10, 80, 180)
_GUIExtender_Section_Action(0, "Close All", "Open All", 420, 160, 60, 20) ; Normal button
_GUIExtender_Section_End()

GUICtrlCreateGroup("", -99, -99, 1, 1)

_GUIExtender_Section_Extend(2, False)

GUISetState()

While 1
    $iMsg = GUIGetMsg()
    Switch $iMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
    _GUIExtender_Action($iMsg) ; Check for click on Action control
WEnd

If you create a control using the UDF functions it has a handle not a ControlID and so GUIExtender cannot see it - in fact AutoIt itself cannot see it as explained in the Tabs tutorial in the Wiki. :)

If you really need to use the UDF functions to create a control then you need to look after it yourself like this - look for part between the ################### lines:

#include "GUIExtender.au3"
#include <guicombobox.au3>
#include <guiconstantsex.au3>
#include <windowsconstants.au3>

$hGUI = GUICreate("Test", 500, 200)

_GUIExtender_Init($hGUI, 1)

_GUIExtender_Section_Start(0, 100)
GUICtrlCreateGroup(" 1 - Static ", 10, 10, 80, 180)
_GUIExtender_Section_Action(2, "", "", 70, 20, 15, 15)
_GUIExtender_Section_End()

_GUIExtender_Section_Start(100, 100)
GUICtrlCreateGroup(" 2 - Extendable ", 110, 10, 80, 180)
_GUIExtender_Section_End()

_GUIExtender_Section_Start(200, 100)
GUICtrlCreateGroup(" 3 - Static", 210, 10, 80, 180)
_GUIExtender_Section_Action(4, "Close 4", "Open 4", 220, 90, 60, 20, 1) ; Push button
_GUIExtender_Section_End()

_GUIExtender_Section_Start(300, 100)
GUICtrlCreateGroup(" 4 - Extendable", 310, 10, 80, 180)
_GUIExtender_Section_End()

_GUIExtender_Section_Start(400, 100)
GUICtrlCreateGroup(" 5 - Static", 410, 10, 80, 180)
_GUIExtender_Section_Action(0, "Close All", "Open All", 420, 160, 60, 20) ; Normal button
_GUIExtender_Section_End()

GUICtrlCreateGroup("", -99, -99, 1, 1)

; Create the combo
$Typ1 = _GUICtrlComboBox_Create($hGUI, "", 330, 90, 42, 50, BitOR($CBS_DROPDOWN, $WS_VSCROLL, $WS_TABSTOP, $CBS_UPPERCASE))
_GUICtrlComboBox_BeginUpdate($Typ1)
_GUICtrlComboBox_AddString($Typ1, "ONE")
_GUICtrlComboBox_AddString($Typ1, "TWO")
_GUICtrlComboBox_AddString($Typ1, "THREE")
_GUICtrlComboBox_EndUpdate($Typ1)

;_GUIExtender_Section_Extend(2, False)

GUISetState()

While 1
    $iMsg = GUIGetMsg()
    Switch $iMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch

    _GUIExtender_Action($iMsg) ; Check for click on Action control

    ; #######################################################################
    ; Check combo visibility
    Switch _GUIExtender_Section_State(4)
        Case 1
            ; We need to make it visible
            If Not BitAnd(WinGetState($Typ1), 2) Then
                ; So do so if it was not - if we just do it we get flickering
                ControlShow($hGUI, "", $TYP1)
            EndIf
            ; Now check required position within the GUI
            $iCombo_X = 30
            ; Check which sections to the left are extended
            For $i = 1 To 3
                If _GUIExtender_Section_State($i) Then
                    ; Add add their width if they are
                    $iCombo_X += 100
                EndIf
            Next
            WinMove($Typ1, "", $iCombo_X, 90)
        Case 0
            ; We need to hide it
            If BitAnd(WinGetState($Typ1), 2) Then
                ; So do so if it was visible - again the check to prevent flickering
                ControlHide($hGUI, "", $TYP1)
            EndIf
    EndSwitch
    ; #######################################################################

WEnd

You can see how that would get very complicated very quickly if you had several such controls. :rip:

My advice - stick to the native controls if you can. :D

M23

Edit: I have an idea for a function to deal with UDF-controls semi-automatically - you will still have to write a line or two of additional code, but if you want exotic controls then you already have to deal with them differently. I will work on it today and see what I can come up with. :oops:

Edited by Melba23

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

Share this post


Link to post
Share on other sites

#75 ·  Posted (edited)

Thank you so very much for the guidance (which works) and of course for the excellent UDF.

I'm quite excited by the idea of a "semi-automatic UDF-controls" ... good luck with this & thanks again

Edited by Tippex

Share this post


Link to post
Share on other sites

#76 ·  Posted (edited)

Tippex,

The new function is done - I am now testing it furiously to see if I can break it. So do not get too involved in recoding as you may only need to add something as simple as this to your code each time you extend/retract a section:

_GUIExtender_UDFCtrlCheck($hButton, 2, 120, 40)
; Parameters: (Handle, Section, X-coord, Y-coord) - note coords are relative to the section, not the main GUI

This should please coolboy2295 as well (se above) as I believe it can deal with child GUIs too. :oops:

M23

Edit: Child GUIs are much harder to deal with - coolboy2295 will have to wait. Besides he said he would write a function himself! :D

Edited by Melba23

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

Share this post


Link to post
Share on other sites

#77 ·  Posted

New version 6/12/11

2 new functions _GUIExtender_ActionCheck and _GUIExtender_UDFCtrlCheck have been added to allow you to use UDF-created controls within the GUI. All you need to do is to check whether a section has been actioned using _GUIExtender_ActionCheck and then call _GUIExtender_UDFCtrlCheck for each UDF-created control in the GUI - GUIExtender then determines whether and where to display the control.

_GUIExtender_ActionCheck returns True/False to indicate if a section has been actioned. If it has then _GUIExtender_UDFCtrlCheck should be called with these 4 parameters for each control:

_GUIExtender_UDFCtrlCheck($hControl_Handle, $iSection, $iX, $iY)
; Parameters ....: $hControl_Handle - Handle of UDF-created control
;                  $iSection        - Section within which control is situated
;                  $iX, $iY         - Coords of control - relative to section not to GUI <<<<<<

Two examples have been added to show the functions in action in both MessageLoop and OnEvent modes.

Thanks to Tippex who pushed me to develop it. :D

New UDF, examples and zip in first post. :oops:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

Share this post


Link to post
Share on other sites

#78 ·  Posted

Greatful thanks!! :D

Share this post


Link to post
Share on other sites

#79 ·  Posted

How would I use this on a resizable gui, or isn't that possible? Basically, I have a listview that fills most of the gui except for ~200 pixels high at the bottom. There I have some controls that I want to hide, but when the section retracts, my listview still leaves a section at the bottom where the controls would be if I would have resized the window.

Share this post


Link to post
Share on other sites

#80 ·  Posted

ChrisN,

"Not possible with the current UDF" is the answer I am afraid. The UDF stores the initial sizes of the sections so that it knows where everything needs to go as the different sections expand and retract. Changing the size of the GUI will throw off all these calculations. :)

Could you please post the GUI creation part of your script so I can see exactly what you are trying to do. I will then take a look at the internal workings of the UDF to see if there is an easy way to produce a version for resizable GUIs - as you only want to action a section at the bottom of the GUI it might prove possible. But do not hold your breath! ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0