Jump to content

How To Create Drop-Down Window


Recommended Posts

  • Moderators

Arclite86,

Look at my GUIExtender UDF (the link is in my sig) - it is exactly what you need. :)

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

  • 2 weeks later...

Arclite86,

Look at my GUIExtender UDF (the link is in my sig) - it is exactly what you need. :)

M23

Thank you Melba23 it worked

im using this code for a vertical reducer and extender

$iEdit_Section_Start = 30
$iEdit_Section_Height = 250
$iEdit_Section = _GUIExtender_Section_Start($Form1_1_1_1, $iEdit_Section_Start, $iEdit_Section_Height)
_GUIExtender_Section_Action($Form1_1_1_1, $iEdit_Section)
; All control positions can then be related to the section start rather than the GUI  <<<<<<<<<<<<<


; Now you can check that the _Section_Height is correct and amend if necessary  <<<<<<<<<<<<<
_GUIExtender_Section_End($Form1_1_1_1)
_GUIExtender_Section_Extend($Form1_1_1_1, 0, False)

Now I would like  a horizontal reducer and extender that works the same as the code above

If i could somehow chance $iEdit_Section_Height = 250 to $iEdit_Section_width = 250

my form is  $Form1_1_1_1 = GUICreate("", 852, 715, 688, 114)

and I would like to reduce the width with 300 from the right

just like the code above but than in horizontal

could  somebody help me please.

Link to comment
Share on other sites

  • Moderators

Arclite86,

 

I would like a horizontal reducer and extender

Not that hard to code: :)

#include <GUIConstantsEx.au3>

#include <GUIExtender.au3>

$Form1_1_1_1 = GUICreate("", 852, 715, 688, 114)

_GUIExtender_Init($Form1_1_1_1, 1) ; Horizontal extension

$iEdit_Section_Start = 552
$iEdit_Section_Width = 300
$iEdit_Section = _GUIExtender_Section_Start($Form1_1_1_1, $iEdit_Section_Start, $iEdit_Section_Width)

_GUIExtender_Section_End($Form1_1_1_1)

; This must be created OUTSIDE the section it actions
_GUIExtender_Section_Action($Form1_1_1_1, $iEdit_Section, "Close", "Open", 450, 10, 80, 30)

_GUIExtender_Section_Extend($Form1_1_1_1, 0, False)

GUISetState()

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

    _GUIExtender_Action($Form1_1_1_1, $iMsg)

WEnd
Is that what you wanted? :huh:

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

Arclite86,

 

Not that hard to code: :)

#include <GUIConstantsEx.au3>

#include <GUIExtender.au3>

$Form1_1_1_1 = GUICreate("", 852, 715, 688, 114)

_GUIExtender_Init($Form1_1_1_1, 1) ; Horizontal extension

$iEdit_Section_Start = 552
$iEdit_Section_Width = 300
$iEdit_Section = _GUIExtender_Section_Start($Form1_1_1_1, $iEdit_Section_Start, $iEdit_Section_Width)

_GUIExtender_Section_End($Form1_1_1_1)

; This must be created OUTSIDE the section it actions
_GUIExtender_Section_Action($Form1_1_1_1, $iEdit_Section, "Close", "Open", 450, 10, 80, 30)

_GUIExtender_Section_Extend($Form1_1_1_1, 0, False)

GUISetState()

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

    _GUIExtender_Action($Form1_1_1_1, $iMsg)

WEnd
Is that what you wanted? :huh:

M23

 

okay I see

Im am trying to create 2 buttons, one for an vertical and the other for horizontal

but when I try this

$vertical = GUICtrlCreateButton("vertical", 288, 424, 89, 17)

$horizontal = GUICtrlCreateButton("horizontal", 504, 32, 65, 33)


$iEdit_Section_Start = 30
$iEdit_Section_Height = 250
$iEdit_Section = _GUIExtender_Section_Start($Form1_1_1_1, $iEdit_Section_Start, $iEdit_Section_Height)
_GUIExtender_Section_Action($Form1_1_1_1, $iEdit_Section)
; All control positions can then be related to the section start rather than the GUI  <<<<<<<<<<<<<


; Now you can check that the _Section_Height is correct and amend if necessary  <<<<<<<<<<<<<
_GUIExtender_Section_End($Form1_1_1_1)
_GUIExtender_Section_Extend($Form1_1_1_1, 0, False)




_GUIExtender_Init($Form1_1_1_1, 1) ; Horizontal extension

$iEdit_Section_Start = 552
$iEdit_Section_Width = 300
$iEdit_Section = _GUIExtender_Section_Start($Form1_1_1_1, $iEdit_Section_Start, $iEdit_Section_Width)

_GUIExtender_Section_End($Form1_1_1_1)

; This must be created OUTSIDE the section it actions
_GUIExtender_Section_Action($Form1_1_1_1, $iEdit_Section, "Close", "Open", 450, 10, 80, 30)

_GUIExtender_Section_Extend($Form1_1_1_1, 0, False)

GUISetState() 

both buttons ($vertical and $horizontal) dont work, can this be solved?

Link to comment
Share on other sites

  • Moderators

Arclite86,

 

Im am trying to create 2 buttons, one for an vertical and the other for horizontal

That is not possible - you can only extend in one sense or the other (as set in the _GUIExtender_Init call), not both in the same GUI. I did try to code for that but it got far too complicated and I abandoned the idea. :(>

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

Arclite86,

 

That is not possible - you can only extend in one sense or the other (as set in the _GUIExtender_Init call), not both in the same GUI. I did try to code for that but it got far too complicated and I abandoned the idea. :(>

M23

okay thank you anyways  :)

Link to comment
Share on other sites

  • Moderators

Arclite86,

When you reply, please use the "Reply to this topic" button at the top of the thread or the "Reply to this topic" editor at the bottom rather than the "Quote" button - I know what I wrote and it just pads the thread unnecessarily. ;)

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

  • Moderators

Arclite86,

Does this meet your requirements? :huh:

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

#include <GUIExtender.au3>

$hGUI_Vert = GUICreate("", 500, 500, 300, 200, BitOR($WS_POPUP, $WS_BORDER))

_GUIExtender_Init($hGUI_Vert)

$iVert_Section_Start = 300
$iVert_Section_Height = 200
$iVert_Section = _GUIExtender_Section_Start($hGUI_Vert, $iVert_Section_Start, $iVert_Section_Height)

_GUIExtender_Section_End($hGUI_Vert)

GUISetState()

$hGUI_Horz = GUICreate("", 800, 300, 300, 225, BitOR($WS_POPUP, $WS_BORDER))

_GUIExtender_Init($hGUI_Horz, 1) ; Horizontal extension

$iHorz_Section_Start = 500
$iHorz_Section_Width = 300
$iHorz_Section = _GUIExtender_Section_Start($hGUI_Horz, $iHorz_Section_Start, $iHorz_Section_Width)

_GUIExtender_Section_End($hGUI_Horz)

GUISetState()

$hGUI_Main = GUICreate("", 500, 300, 300, 200)

_GUIExtender_Section_Action($hGUI_Horz, $iHorz_Section, "Horz Close", "Horz Open", 350, 10, 130, 30)
_GUIExtender_Section_Action($hGUI_Vert, $iVert_Section, "Vert Close", "Vert Open", 350, 50, 130, 30)

GUISetState()

WinSetOnTop($hGUI_Main, "", 1)


_GUIExtender_Section_Extend($hGUI_Horz, 0, False)
_GUIExtender_Section_Extend($hGUI_Vert, 0, False)

GUISetState()

GUIRegisterMsg($WM_MOVE, "_WM_MOVE")

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

    _GUIExtender_Action($hGUI_Horz, $iMsg)
    _GUIExtender_Action($hGUI_Vert, $iMsg)

WEnd

Func _WM_MOVE($hWnd, $iMsg, $wParam, $lParam)
    #forceref $hWnd, $iMsg, $wParam, $lParam
    Switch $hWnd
        Case $hGUI_Main
            _SynchroGUIs()
    EndSwitch
    Return $GUI_RUNDEFMSG
EndFunc   ;==>_WM_MOVE

Func _SynchroGUIs()

    Local $aPos_Vert = WinGetPos($hGUI_Main)

    WinMove($hGUI_Horz, "", $aPos_Vert[0], $aPos_Vert[1] + 25)
    WinMove($hGUI_Vert, "", $aPos_Vert[0], $aPos_Vert[1])

EndFunc   ;==>_SynchroGUIs
It needs a bit of refinement, but before I start I would like to know if it is worth pursuing this line of attack. :)

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

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...