Jump to content

Recommended Posts

  • Moderators
Posted

mvk25,

Sorry I missed those lines out of the first script - copy-paste error from the combined script I was working with all morning. :>

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

 

Posted

mvk25,

Sorry I missed those lines out of the first script - copy-paste error from the combined script I was working with all morning. :>

M23

:oops:  I didn't see those lines in the second example :D

  • 2 months later...
Posted

Once in a while the GUI freezes for me on start-up (esp. if you click somewhere else quick after start / de-activate the GUI after it is initially show but before all frames are painted).

Here's a dirty fix that works for me, un-approved by the OP :). This double-call also seems to allow you to set the GUI to the show state after the frames have been painted (directly before the main loop).

_WinAPI_ShowWindow($hGUI, @SW_SHOW)
GUISetState(@SW_SHOW, $hGUI)
  • 1 month later...
Posted

Hi there!

Can you think of a convenient way to get a callback when frame resizing is finished? Unfortunateley, WM_EXITSIZEMOVE isn't called. But something similar would be nice :)

  • Moderators
Posted

Armag3ddon,

Can you explain why you wish to have a callback? :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

 

Posted

I'm drawing a more or less resource-heavy picture into one of the frames (using some GDIPlus stuff). Redrawing this on every call of WM_SIZE is a bit laggy. But redrawing once after resizing has finished, is fine (I do this now on WM_EXITSIZEMOVE). The user doesn't need to see the image while resizing.

  • Moderators
Posted

Armag3ddon,

If you declare a suitable global variable in the main script (I used Global $g_hGUIOrg = $hGUI) and add this line:

_SendMessage($g_hGUIOrg, $WM_EXITSIZEMOVE, 0, 0) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

    EndIf

    ; Pass the message on to org WndProc
    Return _GUIFrame_SepPassMsg($hWnd, $iMsg, $wParam, $lParam)
at the end of the _GUIFrame_SepWndProc function, you get a notification when any frame is adjusted just as if the whole GUI were resized. Will that suffice? :huh:

It looks as if it will require a fair bit more work to get the callback only when a specific frame is resized - let me have a look into that during the week. :)

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

 

  • Moderators
Posted

Armag3ddon,

Great - glad I could help so quickly. :)

I will still look into getting a callback from only a specific frame - might come in useful for someone else. ;)

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

 

  • Moderators
Posted (edited)

Armag3ddon,

Here is my first attempt at a callback integrated within the UDF - you should only get a MsgBox when the green section has been resized (i.e. not when the right frame only is adjusted). Please let me know what you think:

<snip>

I will look today at how I might further integrate the actions into the UDF to prevent the need for so much additional code within the example. :)

M23

Edit:

A much more integrated version - very limited additional code for the user. I must admit to being quite pleased with it: :whistle:

<snip>

Edited by Melba23
See new code below

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

 

  • Moderators
Posted (edited)

Armag3ddon,

As you wanted the ability to know when a resizing event had taken place to redraw a GDI image at the correct size, I felt that my previous approach was too complicated. If the redraw takes as long as I fear it might then you really do not want it to occur inside a handler - so why bother to create one? Instead I used the fact that the script is paused while separators are moved and the GUI resized and produced this new version which needs no further handlers:

<snip>

I also added code to cater for the frame being resized programmatically - press the "Set Sep" button to see that working. ;)

I hope that you now have what you need - if so I will release a new version soon. Comments from anyone else also welcome of course. :)

M23

Edited by Melba23
Beta code removed

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

 

  • 2 weeks later...
  • Moderators
Posted

[NEW VERSION] - 19 May 14

Added:

- 1. A new function _GUIFrame_ResizeState to indicate when frames have been resized and the resizing is complete. The idea is to help users who fill frames with elements which require heavy processing (e.g. GDI images) and where continually rewriting the content would cause severe slowdowns. The function is called in the script idle loop and returns an array of flags indicating that a resizing action is complete.

- 2. A new parameter ($fShowWindow) in the _GUIFrame_Create function. A few people have found that the frames do not always appear on creation - particularly if the GUI does not have focus during this process. KaFu came up with a workaround, not approved by the AutoIt devs, using the API to confirm the frame display. Setting this new parameter to True uses the API call - use it at your own risk and peril!

Fixed: A couple of minor bugs which no-one had noticed - and now never will. :)

New code below and in the first post. :)

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

 

Posted

Ah, you have been busy, I see. Another well done script from you that I use in my project! Already used Scrollbars, ExtMsgBox and just saw StringSize. You really seem to make exactly what I'm desperately in need of ;)

  • Moderators
Posted

Armag3ddon,

Glad you find my UDFs useful. :)

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

 

  • 3 months later...
Posted

Thank you very much for this UDF. It is really great

I am trying to create one horizontal and one vertical frame, but the second frame is invisible (please see the screenshot). Why?

http://imgbox.com/4XPwQXaP

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

#include "GUIFrame.au3"

Global $iSep_Pos

$hGUI = GUICreate("GUI_Frame Example 3", 500, 500, -1, -1, BitOR($WS_MINIMIZEBOX, $WS_MAXIMIZEBOX, $WS_SIZEBOX))
GUISetState()

; Create a 1st level frame
$iFrame_A = _GUIFrame_Create($hGUI, 1, 50)
_GUIFrame_SetMin($iFrame_A, 50, 420, True)  ; This line sets the minima as absolute values <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<вер
;_GUIFrame_SetMin($iFrame_A, 50, 125)       ; This line adjusts the minima to equivalent percentages on resizing <<<<<<<<<<<<<<<<<<<<<






_GUIFrame_Switch($iFrame_A, 1)
$aWinSize = WinGetClientSize(_GUIFrame_GetHandle($iFrame_A, 2))
;GUICtrlCreateLabel("adv", 5, 5, $aWinSize[0] - 10, $aWinSize[1] - 10)
;GUICtrlSetBkColor(-1, 0x00FF00)
GUICtrlCreateLabel("asd", 0, 0, 50, 50)
;GUICtrlSetBkColor(-1, 0x0000FF)
GUICtrlSetResizing(-1, $GUI_DOCKSIZE)
GUICtrlSetState(-1, $GUI_DISABLE)

_GUIFrame_Switch($iFrame_A, 2)
$aWinSize = WinGetClientSize(_GUIFrame_GetHandle($iFrame_A, 2))
GUICtrlCreateLabel("", 5, 5, $aWinSize[0] - 10, $aWinSize[1] - 10)
;GUICtrlSetBkColor(-1, 0xFF0000)
GUICtrlSetState(-1, $GUI_DISABLE)


;$iFrame_B = _GUIFrame_Create($hGUI, 1, 50)
$iFrame_B = _GUIFrame_Create(_GUIFrame_GetHandle($iFrame_A, 2), 0)
_GUIFrame_SetMin($iFrame_B, 250, 250, True)


GUICtrlSetState(-1, $GUI_DISABLE)

; Set resizing flag for all created frames
_GUIFrame_ResizeSet(0, 2) ; Adjust the second parameter to change the resizing behaviour <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

; Register the $WM_SIZE handler to permit resizing
_GUIFrame_ResizeReg()

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            ; The UDF does all the tidying up as you exit
            Exit
    EndSwitch

WEnd

Thanx in advance!

  • Moderators
Posted

topten,

The separator is there, but you have created a label to fill the lower frame before you create the internal frames and so the separator is hidden behind it. Just remove the section where you create the label in ($iFrame_A, 2) (lines 30-34) and the separator appears. :)

You also have an orphan GUICtrlSetState on line 42 which is not helping matters. ;)

With those 2 changes the script works for me. :)

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

 

Posted (edited)

LOL. Great thanx,

Melba23

 I found it !

 

PS

Question #1

Just in case if you know, how can this be done? (You know those 3 points drawn on frame in skype. I show a screenshot)

http://imgbox.com/GL1FJlkk

 

Question#2

Is it possible to use scrollbars with frames as in '?do=embed' frameborder='0' data-embedContent>>

I was trying to use scrollbars this way, but for some reason doesn't work.

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include "GUIFrame.au3"
#include <GuiScrollBars.au3>

Global $g_hGUI = GUICreate("GUI Frames", 400,400, -1, -1, $WS_SIZEBOX)
GUISetState(@SW_SHOW)

;create frames
$g_Frames = _GUIFrame_Create($g_hGUI);split gui horizontally
_GUIFrame_SetMin($g_Frames, 75, 75)

;get handles to each frame
$g_hLeft = _GUIFrame_GetHandle($g_Frames, 1)
$g_hRight = _GUIFrame_GetHandle($g_Frames, 2)

;create scrolbars
_GUIFrame_Switch($g_Frames, 1)
_GUIScrollBars_Init(-1)
_GUIScrollBars_ShowScrollBar(-1, $SB_HORZ, False)
_GUIScrollBars_SetScrollInfoMax(-1, $SB_VERT, 500)

$aClient = WinGetClientSize($g_hLeft)

;$listview = GUICtrlCreateListView('column 1 | column  2 | column 3', 0, 0, $aClient[0], $aClient[1])
;GUICtrlSetResizing(-1, 102)


;create Listview 2
_GUIFrame_Switch($g_Frames, 2)
$aClient = WinGetClientSize($g_hRight)
$listview2 = GUICtrlCreateListView('column 1 | column  2 | column 3', 0, 0, $aClient[0], $aClient[1])
GUICtrlSetResizing(-1, 102)

;Add some items to listviews
For $i = 1 to 20
   ; GUICtrlCreateListViewItem('item ' & $i, $listview)
    GUICtrlCreateListViewItem('item ' & $i, $listview2)
Next

GUIRegisterMsg($WM_SIZE, "_WM_SIZE")
_GUIFrame_ResizeSet(0)

Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
_GUIFrame_Exit()

Func _WM_SIZE($hWnd, $iMsg, $wParam, $lParam)

    _GUIFrame_SIZE_Handler($hWnd, $iMsg, $wParam, $lParam)

    Return $GUI_RUNDEFMSG

EndFunc

 

Great thanx, again!

Edited by topten
  • Moderators
Posted

topten,

Ans 1: It would need a suitable label in the separator GUI - I will see if I can come up with something if I can find the time. :)

Ans 2: I refer you to >this answer I posted a few weeks ago. ;)

Sorry not to be more helpful, but there are limits to what I will consider - and certainly in what I am capable of coding! :D

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

 

  • 3 months later...

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
  • Recently Browsing   0 members

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