Jump to content

Scrollbars Made Easy - New version 27 Jan 22


Melba23
 Share

Recommended Posts

  • Moderators

Belini,

I also need ways to hide Scrollbars

And _GUIScrollBars_ShowScrollBar($hGUI, $SB_VERT/HORZ, False) does not work? :oops:

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

Belini,

So what has this got to do with my UDF? :oops:

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

Link to comment
Share on other sites

  • 1 month later...
  • 4 months later...
  • Moderators

jevon,

I hope it can suport $WS_CHILD style!

Have you run into a problem with this style and the UDF? If so, then please post the code so I can take a look. :)

And what on earth has my response to Belini got to do with it? :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

jevon,

Have you run into a problem with this style and the UDF? If so, then please post the code so I can take a look. :)

And what on earth has my response to Belini got to do with it? :huh:

M23

M23,

It does matter with Belini.I had consult you before.This the link of topic

I do not know how to express what I meaning.

Link to comment
Share on other sites

  • 2 weeks later...
  • Moderators

jevon,

As I explained in the thread to which you linked, AutoIt sometimes has problem with the $WS_CHILD style and I have found it better to use the _WinAPI_SetParent function. The UDF works fine then as you can see. :)

Drigger,

I will look into it - but no promises on time scale. Give me a reminder if I do not come back soon enough. :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

 

Link to comment
Share on other sites

  • 2 weeks later...

jevon,

As I explained in the thread to which you linked, AutoIt sometimes has problem with the $WS_CHILD style and I have found it better to use the _WinAPI_SetParent function. The UDF works fine then as you can see. :)

Drigger,

I will look into it - but no promises on time scale. Give me a reminder if I do not come back soon enough. :D

M23

Thanks M23,I had fix the problem.(mousewheel-gui-variable).but i have a nother problem,how to use skin for scrollbar?

Jevon

Link to comment
Share on other sites

  • Moderators

jevon,

how to use skin for scrollbar?

Absolutely no idea. There a couple of "skin" UDFs out there - I suggest you try them. :)

M23

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

Open spoiler to see my UDFs:

Spoiler

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

 

Link to comment
Share on other sites

  • 2 weeks later...
  • Moderators

jevon,

As I have already explained to you several times, AutoIt GUIs and the $WS_CHILD style are not the happiest of bedfellows. :)

Now please stop polluting my UDF thread with questions about skinning scrollbars in GUIs with this style set - it is not a problem with the UDF so asking here is not going to get you an answer. ;)

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

Drigger,

Sorry, I forgot to post my findings. :>

The UDF relies on getting the MINIMIZE message to save the current scrollbar position which it can then use to reposition the scrollbars on RESTORE - the scrollbars are reset to the top/left position before the actual MINIMIZE so that the underlying GUI is not misplaced by Windows during the cycle.

Unfortunately, it seems that the other methods of minimizing the GUI send this message to the GUI after the actual clearance and so the UDF cannot intercept it and do the necessary (save position, reset and then reposition) beforehand. I tried keeping a running note of the scrollbar position so that there would always be a value for the reposition, but the fact that the scrollbars are not reset before the MINIMIZE means that the underlying GUI gets misplaced by Windows and so the result is much the same as if nothing was done.

Sorry not to have better news - I looked into how I might detect the various ways of clearing the open GUIs and so get teh UDF to do its thing, but I have found nothing useful as yet. I will keep looking, but do not expect miracles. :(

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

I've been experimenting with it and I must say I'm quite impressed. using a lot of one of your examples, I came up with this code

#include 
#include 
#include 
#include 

#include "GUIScrollbars_Ex.au3"


$width = 575
$height = 600

$hGUI = GUICreate("Scroll Bar Examples", $width, $height)
$bUp = GUICtrlCreateButton("/", $width-10-75, 10, 75, 75)
$bUp = GUICtrlCreateButton("/", $width-10-75, $height-75-10, 75, 75)
GUISetState()

; Start example
;~ While 1

$n = 29

$iSubView_H = $height - 20
$iSubView_W = $width - 20 - 75
$nRatio_Vert = 3;Random(2, 20)
$iScroll_Ht = 10+(110*Ceiling($n/floor(($iSubView_W-10)/110)))

$numperrow = floor(($iSubView_W-10)/110)

$iH_Tight = 1
$iV_Tight = 1

$hSubContent = GUICreate("", $iSubView_W, $iSubView_H, 10, 10, $WS_POPUP, $WS_EX_MDICHILD, $hGUI)
GUISetBkColor(0xFFFFFF)

$aSubContent = _GUIScrollbars_Generate($hSubContent, 0, $iScroll_Ht, 1, 1, True)
If @error Then
MsgBox(16, "Error", "Scrollbar generation failed")
Exit
EndIf
$iSubView_W = $aSubContent[0]
$iSubView_H = $aSubContent[1]


$iLine_Width = $iSubView_W
For $i = 1 To $n
$x = Mod(($i-1),floor(($iSubView_W-10)/110))
$y = Floor(($i-1)/floor(($iSubView_W-10)/110))
GUICtrlCreateButton($i&" ("&$x&", "&$y&")",10+$x*110,10+$y*110,100,100)
Next
GUICtrlCreateLabel("", $iSubView_W - 40, $iSubView_H - 50, 40, 100)
GUICtrlSetBkColor(-1, 0xFFC4C4)
GUICtrlCreateLabel("Page 1", $iSubView_W - 40, $iSubView_H - 15, 40, 15)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlCreateLabel("Page 2", $iSubView_W - 40, $iSubView_H, 40, 15)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)

GUISetState()

GUICtrlCreateLabel("fdahadfh", -10, $iScroll_Ht - 10, 10, 10)
GUICtrlSetBkColor(-1, 0x0000FF)

While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
;~ Case $hButton_1

;~ _GUIScrollbars_Scroll_Page($hSubContent, 0, 2)

EndSwitch
WEnd
;~ WEnd

what I can't figure out is 1: How do I make this resizable? and 2: how do I make the buttons on the side make it go up and down by 1 "page"? The example included making it scroll to a page number, but I could find no way to make it scroll down one page, by a set amount, or to read the current "page" value and scroll to that value + 1

0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e

Link to comment
Share on other sites

  • Moderators

corgano,

To make the buttons work you need to keep track of the current page like this: ;)

#include "GUIScrollbars_Ex.au3"

Global $iScroll_Page = 1 ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

$width = 575
$height = 600

$hGUI = GUICreate("Scroll Bar Examples", $width, $height)
$bUp = GUICtrlCreateButton("/", $width - 10 - 75, 10, 75, 75)
$bDn = GUICtrlCreateButton("/", $width - 10 - 75, $height - 75 - 10, 75, 75)
GUISetState()

; Start example
;~ While 1

$n = 29

$iSubView_H = $height - 20
$iSubView_W = $width - 20 - 75
$nRatio_Vert = 3;Random(2, 20)
$iScroll_Ht = 10 + (110 * Ceiling($n / Floor(($iSubView_W - 10) / 110)))

$numperrow = Floor(($iSubView_W - 10) / 110)

$iH_Tight = 1
$iV_Tight = 1

$hSubContent = GUICreate("", $iSubView_W, $iSubView_H, 10, 10, $WS_POPUP, $WS_EX_MDICHILD, $hGUI)
GUISetBkColor(0xFFFFFF)

$aSubContent = _GUIScrollbars_Generate($hSubContent, 0, $iScroll_Ht, 1, 1, True)

$iScrollH_Max = Ceiling($iScroll_Ht / $height) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

If @error Then
    MsgBox(16, "Error", "Scrollbar generation failed")
    Exit
EndIf
$iSubView_W = $aSubContent[0]
$iSubView_H = $aSubContent[1]


$iLine_Width = $iSubView_W
For $i = 1 To $n
    $x = Mod(($i - 1), Floor(($iSubView_W - 10) / 110))
    $y = Floor(($i - 1) / Floor(($iSubView_W - 10) / 110))
    GUICtrlCreateButton($i & " (" & $x & ", " & $y & ")", 10 + $x * 110, 10 + $y * 110, 100, 100)
Next
GUICtrlCreateLabel("", $iSubView_W - 40, $iSubView_H - 50, 40, 100)
GUICtrlSetBkColor(-1, 0xFFC4C4)
GUICtrlCreateLabel("Page 1", $iSubView_W - 40, $iSubView_H - 15, 40, 15)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlCreateLabel("Page 2", $iSubView_W - 40, $iSubView_H, 40, 15)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)

GUISetState()

GUICtrlCreateLabel("fdahadfh", -10, $iScroll_Ht - 10, 10, 10)
GUICtrlSetBkColor(-1, 0x0000FF)

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $bUp ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
            $iScroll_Page -= 1
            If $iScroll_Page < 1 Then $iScroll_Page = 1
            _GUIScrollbars_Scroll_Page($hSubContent, 0, $iScroll_Page)
        Case $bDn ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
            $iScroll_Page += 1
            If $iScroll_Page > $iScrollH_Max Then $iScroll_Page = $iScrollH_Max
            _GUIScrollbars_Scroll_Page($hSubContent, 0, $iScroll_Page)
    EndSwitch
WEnd

When you say "resizeable" what exactly so you mean? The whole GUI with the other controls resizing? :huh:

I would like to know exactly what you want before coding anything. ;)

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

I want the guI to be resizable, like most windows are (click and drag corner, you know?) I want the position and size of the buttons on the side to remain unchanged, anchored to the bottom and top corners that is, and I want the middle scrollable section to expand as the gui is expanded, and I want the buttons in the scrollable area to fill as many as will fit in the scrollable area (If you manually change the width and height at the top of the script, and restart, you'll notice I already have the math for it there)

I know how to go most of this myself, the problem is I have no idea how to expand the middle bit, and how to detect resizing to redistribute the buttons in the scrollable bit

#EDIT# Alright, i took a look at the buttons to go a page up / down, will _GUIScrollbars_Scroll_Page always go by the height of the subpage? Is there any way to make it scroll down by an arbitrary value? say, 110*mod($iSubView_H,110)?

Any help would be appreciated

Edited by corgano

0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e

Link to comment
Share on other sites

  • Melba23 changed the title to Scrollbars Made Easy - New version 27 Jan 22

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