Jump to content

Scrollbars Made Easy - New version 27 Jan 22


Recommended Posts

@Melba23 These custom scrollbars are a real pita (it's not a too rude word, is it ?)

It's a good improvement now that the user can also delete rows/cols. You're right when saying : "There still seems to be a problem the first time a scrollbar is created or removed although..." . Let's hope you'll find a solution for that.

Meanwhile, I'm adding a pic below (please delete it after test if you want) showing a potential issue on my PC after some changes in the coords (7 original lines of "MinRes_Size_Example.au3" are placed at the left of the vertical bar) :

105697495_MinRes2issue.png.1479a4e27498c0122afd65c5898a82a5.png

When running the modified script, without any add or remove, row 10 is here... but hidden by the visible horizontal scrollbar. It won't happen with $i_Aperture_Height = 199 or less (instead of 200) because a vertical scrollbar would have appeared when $i_Aperture_Height = 199 or less.

If $i_Aperture_Height = 201 (or 202 etc...) then still no vertical scrollbar, but a row 10 showing more and more under the visible horizontal scrollbar. Row 10 would have shown fully with $i_Aperture_Height = 200 + 17 (i.e. 200 + $iScroll_Height)

Don't know if you consider it as an issue, you'll decide.

Edited by pixelsearch
Link to post
Share on other sites
  • 5 months later...
  • Replies 266
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

[New Version] - 27 Jan 22 New: The GUIScrollbar_Ex UDF now recognises Win-D and taskbar desktop clearance commands and runs the correct minimize/restore code automatically. The previous UDF _Mini

pixelsearch, What an interesting discovery that you seem to need to hide/show BOTH scrollbars using $SB_BOTH  to get it to work properly. Good detective work on your behalf. But I notice tha

[New Version] - 18 May 18 Changed: UDF now plays nicely with other controls which use the same Windows messages. New UDFs, examples in first post. M23

Posted Images

  • Moderators

jitb,

I see the problem and I will look into it over the weekend.

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 post
Share on other sites
  • Moderators

jitb,

How about this using a child GUI to hold the status bar?

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiStatusBar.au3>
#include "GUIScrollbars_Ex.au3"

$hGUI = GUICreate("Status Bar & Scroll", 500, 500)
GUISetBkColor(0xFF0000, $hGUI)
GUISetState(@SW_SHOW)

; Create labels to show scrolling
GUICtrlCreateLabel("", 0, 0, 500, 500)
GUICtrlSetBkColor(-1, 0x00FF00)
GUICtrlCreateLabel("", 500, 500, 500, 500)
GUICtrlSetBkColor(-1, 0x00FF00)
GUICtrlCreateLabel("", 0, 500, 500, 500)
GUICtrlSetBkColor(-1, 0x0000FF)
GUICtrlCreateLabel("", 500, 0, 500, 500)
GUICtrlSetBkColor(-1, 0x0000FF)

GUICtrlCreateLabel("", 990, 990, 10, 10)
GUICtrlSetBkColor(-1, 0)

; Generate scrollbars
_GUIScrollbars_Generate($hGUI, 1000, 1000)

; Create child to hold the status bar
$hGUI_Status = GUICreate("", 500, 23, -18, 484, $WS_POPUP, BitOR($WS_EX_MDICHILD, $WS_EX_CLIENTEDGE), $hGUI)

$hStatus = _GUICtrlStatusBar_Create($hGUI_Status)
Local $aParts[3] = [75, 150, -1]
_GUICtrlStatusBar_SetParts($hStatus, $aParts)
_GUICtrlStatusBar_SetText($hStatus, "Part 0")
_GUICtrlStatusBar_SetText($hStatus, "Part 1", 1)
_GUICtrlStatusBar_SetText($hStatus, "Part 2", 2)

GUISetState(@SW_SHOWNOACTIVATE)

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Any use?

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 post
Share on other sites
  • 2 months later...

Hi Melba,

thanks a lot for this great UDF, been using it for some years to make larger child-windows within a main window scrollable. Good solution to put many, many GUICtrls in a (sub)-window.

There is one thing that would be very nice to achieve: I now have a child-window within my main window where GUI elements are added and subtracted during run time. The display area of the y-axis (vertical scroll bar) changes during run-time depending on the number of GUICtrls in the area. Therefore, it would be elegant if I could change the existing scroll bar (once successfully added with _GUIScrollbars_Generate) to another size. I tried to re-call _GUIScrollbars_Generate with new parameters, but that does not work.

Any idea if this is possible?

Best,

Jan

 

Link to post
Share on other sites
  • Moderators

jandings,

Glad you like the UDF.

The GUIScrollbars_Size_Example_2.au3 script which you find in the UDF zip file shows how to adjust the scrollbars to cope with changing values of the y-axis. See if you can amend it to match your requirements - if not please do come back with a reproducer script and we can try and find a solution.

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

    No registered users viewing this page.

×
×
  • Create New...