Jump to content

Flickering GUI when moving a GUI having a table (table UDF) and scrollbars (GUIScrollbars_Ex.au3)


Recommended Posts

So I am playing around testing out what is possible and started of with the example provided for table.au3. I then wanted to add a scrollbar. The GUIScrollbars_Ex.au3 was super easy to use!
But I realized that moving around the GUI causes quite some flickering. That only happens if the GUI is actually resizable. And if I would resize the GUI I would understand that the GUI somewhat needs to be redrawn but since I am just moving around the GUI without resizing I am slightly confused why everything on the GUI is "redrawn".

Here is the Example Script I am using:

 

#include "Table.au3"
#include <GUIScrollbars_Ex.au3>

;----- GUI (Double Buffered) -----
$GUI = GUICreate("", 450, 450, -1, -1, $WS_SIZEBOX + $WS_SYSMENU)
createScrollBarsForGUI()

;----- Make sure GUI exists BEFORE creating Tables -----
GUISetState()

;----- Lock GUI until tables drawn -----
GUISetState(@SW_LOCK)

;----- Table Example 1 -----
GUICtrlCreateLabel(" Example 1 ", 25, 7, 100, 13)
$Table1 = _GUICtrlTable_Create(25, 27, 55, 13, 4, 4, 1)
_GUICtrlTable_Set_ColumnWidth($Table1, 2, 20)
_GUICtrlTable_Set_Justify_All($Table1, 1, 1)
_GUICtrlTable_Set_TextFont_Row($Table1, 1, 8.5, 800)
_GUICtrlTable_Set_CellColor_Row($Table1, 1, 0xEEEEEE)
_GUICtrlTable_Set_Text_Row($Table1, 1, "Control|ID|Window|Staus")
_GUICtrlTable_Set_Text_Row($Table1, 2, "CheckBox|2|Main|disabled")
_GUICtrlTable_Set_Text_Row($Table1, 3, "ListView|3|Child|active")
_GUICtrlTable_Set_Text_Row($Table1, 4, "UpDown|4|Child|disabled")

;----- Table Example 2 -----
GUICtrlCreateLabel(" Example 2 ", 260, 7, 100, 13)
$Table2 = _GUICtrlTable_Create(260, 27, 80, 18, 7, 2, 0)
_GUICtrlTable_Set_Justify_All($Table2, 1, 1)
_GUICtrlTable_Set_TextFont_All($Table2, 8.5, 400, 2, "Century Gothic")
_GUICtrlTable_Set_TextFont_Column($Table2, 1, 8.5, 800, 0, "Century Gothic")
_GUICtrlTable_Set_CellColor_Column($Table2, 1, 0xffd700)
_GUICtrlTable_Set_Text_Row($Table2, 1, "Surname|Biochem")
_GUICtrlTable_Set_Text_Row($Table2, 2, "Forename|Andy")
_GUICtrlTable_Set_Text_Row($Table2, 3, "Age|30")
_GUICtrlTable_Set_Text_Row($Table2, 4, "Height|5'8''")
_GUICtrlTable_Set_Text_Row($Table2, 5, "Weight|75kg")
_GUICtrlTable_Set_Text_Row($Table2, 6, "Eyes|Brown")
_GUICtrlTable_Set_Text_Row($Table2, 7, "M/F|M")
_GUICtrlTable_Set_Border_Table($Table2)

;----- Table Example 3 -----
GUICtrlCreateLabel(" Example 3 ", 25, 100, 100, 13)
$Table3 = _GUICtrlTable_Create(25, 120, 62, 18, 6, 3, 0)
_GUICtrlTable_Set_ColumnWidth($Table3, 1, 70)
_GUICtrlTable_Set_Justify_Column($Table3, 1, 1, 1)
_GUICtrlTable_Set_Justify_Column($Table3, 2, 2, 1)
_GUICtrlTable_Set_Justify_Column($Table3, 3, 1, 1)
_GUICtrlTable_Set_Justify_Row($Table3, 1, 1, 1)
_GUICtrlTable_Set_Border_Row($Table3, 1, 8)
_GUICtrlTable_Set_Border_Row($Table3, 5, 8)
_GUICtrlTable_Set_Text_Row($Table3, 1, "Transaction|In|Out")
_GUICtrlTable_Set_Text_Row($Table3, 6, "Total|£51.01   |-£157.30   ")
_GUICtrlTable_Set_Text_Row($Table3, 2, "Petrol||-£35.00 ")
_GUICtrlTable_Set_Text_Row($Table3, 3, "Groceries||-£42.30 ")
_GUICtrlTable_Set_Text_Row($Table3, 4, "Interest|£51.01   ")
_GUICtrlTable_Set_Text_Row($Table3, 5, "Section 5||-£80.00 ")
For $row = 2 To 6
    For $col = 2 To 3
        _GUICtrlTable_Set_TextFont_Cell($Table3, $row, $col, 9, 400, 2)
    Next
Next
_GUICtrlTable_Set_TextFont_All($Table3, 8.5, 400, 2, "Tahoma")
_GUICtrlTable_Set_TextFont_Row($Table3, 1, 8.5, 600, 0, "Tahoma")

;----- Table Example 4 -----
GUICtrlCreateLabel(" Example 4 ", 25, 250, 100, 13)
$Table4 = _GUICtrlTable_Create(35, 268, 62, 18, 8, 6, 0)
_GUICtrlTable_Set_RowHeight($Table4, 1, 35)
_GUICtrlTable_Set_Justify_All($Table4, 1, 1)
_GUICtrlTable_Set_TextFont_All($Table4, 8.5, 800, 0, "Tahoma")
_GUICtrlTable_Set_CellColor_Row($Table4, 1, 0x555555)
_GUICtrlTable_Set_TextColor_All($Table4, 0x555555)
_GUICtrlTable_Set_TextColor_Row($Table4, 1, 0xFFFFFF)
For $row = 3 To 10 Step 2
    _GUICtrlTable_Set_CellColor_Row($Table4, $row, 0xDDDDDD)
Next
_GUICtrlTable_Set_Text_Row($Table4, 1, "Fixing|Size|Weight|Net|Gross|Order")
_GUICtrlTable_Set_Text_Row($Table4, 2, "Block|20.0|0.01|300|340|No")
_GUICtrlTable_Set_Text_Row($Table4, 3, "Screw|8.5|0.3|50|100|No")
_GUICtrlTable_Set_Text_Row($Table4, 4, "Rivet|0.1|0.4|10|11|Yes")
_GUICtrlTable_Set_Text_Row($Table4, 5, "Rope|300.0|100.0|2|10|No")
_GUICtrlTable_Set_Text_Row($Table4, 6, "Tack|10.6|0.3|1000|1011|Yes")
_GUICtrlTable_Set_Text_Row($Table4, 7, "Nail|30.3|0.4|400|600|No")
_GUICtrlTable_Set_Text_Row($Table4, 8, "Staple|0.3|0.05|10000|12000|No")
_GUICtrlTable_Set_Border_Table($Table4, 0x555555)

;----- Table Example 5 -----
GUICtrlCreateLabel(" Example 5 ", 260, 165, 100, 13)
$Table5 = _GUICtrlTable_Create(260, 182, 30, 20, 3, 3, 0)
_GUICtrlTable_Set_ColumnWidth($Table5, 1, 200)
_GUICtrlTable_Set_Text_Row($Table5, 1, "Attribute|x|y")
_GUICtrlTable_Set_CellColor_Row($Table5, 1, 0xEEEEEE)
_GUICtrlTable_Set_Justify_All($Table5, 1, 1)
_GUICtrlTable_Set_TextFont_All($Table5, 8.5, 200)
_GUICtrlTable_Set_TextFont_Row($Table5, 1, 9, 800)
_GUICtrlTable_Set_Border_Column($Table5, 2, 1, 0xEEEEEE)
_GUICtrlTable_Set_Border_Column($Table5, 3, 1, 0xEEEEEE)
_GUICtrlTable_Set_Border_Row($Table5, 1, 11)
_GUICtrlTable_Set_Border_Table($Table5)
_GUICtrlTable_Set_ColumnWidth($Table5, 1, 100)

;----- Unlock GUI to show tables -----
GUISetState(@SW_UNLOCK)

;----- Loop -----
Do
    Sleep(10)
    $m = MouseGetPos()
    _GUICtrlTable_Set_Text_Row($Table5, 2, "Mouse Position|" & $m[0] & "|" & $m[1])

    $w = WinGetPos("")
    _GUICtrlTable_Set_Text_Row($Table5, 3, "Window Position|" & $w[0] & "|" & $w[1])
Until GUIGetMsg() = -3

Func createScrollBarsForGUI()
    ;return
    Local $tiMax_Scroll = 900
    ; Generate initial scrollbars - required scrollbar handlers registered
    _GUIScrollbars_Generate($GUI, $tiMax_Scroll, $tiMax_Scroll)
    ; Intialise for resizing
    Local $tiFullClient = 0
    Local $taMaxSize = _GUIScrollbars_ReSizer($GUI, $tiMax_Scroll, $tiMax_Scroll, $tiFullClient)
EndFunc

I am just wondering: Is there even any way to prevent the flickering in this case (moving the window without resizing)?
 

Link to comment
Share on other sites

Hi Kloud
Does it flicker same or less if you add an extended style $WS_EX_COMPOSITED by changing this line...

$GUI = GUICreate("", 450, 450, -1, -1, $WS_SIZEBOX + $WS_SYSMENU)

...to

$GUI = GUICreate("", 450, 450, -1, -1, $WS_SIZEBOX + $WS_SYSMENU, $WS_EX_COMPOSITED)

If your OS is new, it should flicker same. If it's an old one, it could make a difference.
 

Edited by pixelsearch
Link to comment
Share on other sites

just checked it, unfortunately it still flickers, even with

$WS_EX_COMPOSITED

I'm running Windows 10 (if that helps)

There is absolutely no flickering if I don't use the scrollbars. 

Edited by Kloud
Link to comment
Share on other sites

  • Moderators

Kloud,

I imagine it is my GUIScrollbars_Ex UDF which is causing the problem - specifically the _GUIScrollbars_ReSizer function which registers the WM_ENTER/EXITSIZEMOVE messages. So when the GUI is resized (or moved as MS have combined the 2 events alas) the UDF looks to reset the scrollbars correctly which looks to be the source of the flickering as you get exactly the same effect when resizing the GUI.

I will look to see if I can do something to change this behaviour when the GUI is simply moved.

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

Kloud,

Try this version of the UDF - I have locked the GUI during the EXITSIZEMOVE handler which has reduced the flicker. There is still one redraw as the scrollbars are regenerated, but not the complete GUI content redraw of earlier: 

And here is a slightly modified version of your script to show it working - look for the <<<<<<<<<<< lines:

#include <WindowsConstants.au3>
#include "Table.au3"
#include <GUIScrollbars_Ex_Mod.au3>

;----- GUI (Double Buffered) -----
$GUI = GUICreate("", 450, 450, -1, -1, BitOr($WS_SIZEBOX, $WS_SYSMENU)) ; Use BitOR to combine styles <<<<<<<<<<<<<<<<<<<<<
createScrollBarsForGUI()

;----- Make sure GUI exists BEFORE creating Tables -----
GUISetState()

;----- Lock GUI until tables drawn -----
GUISetState(@SW_LOCK)

;----- Table Example 1 -----
GUICtrlCreateLabel(" Example 1 ", 25, 7, 100, 13)
$Table1 = _GUICtrlTable_Create(25, 27, 55, 13, 4, 4, 1)
_GUICtrlTable_Set_ColumnWidth($Table1, 2, 20)
_GUICtrlTable_Set_Justify_All($Table1, 1, 1)
_GUICtrlTable_Set_TextFont_Row($Table1, 1, 8.5, 800)
_GUICtrlTable_Set_CellColor_Row($Table1, 1, 0xEEEEEE)
_GUICtrlTable_Set_Text_Row($Table1, 1, "Control|ID|Window|Staus")
_GUICtrlTable_Set_Text_Row($Table1, 2, "CheckBox|2|Main|disabled")
_GUICtrlTable_Set_Text_Row($Table1, 3, "ListView|3|Child|active")
_GUICtrlTable_Set_Text_Row($Table1, 4, "UpDown|4|Child|disabled")

;----- Table Example 2 -----
GUICtrlCreateLabel(" Example 2 ", 260, 7, 100, 13)
$Table2 = _GUICtrlTable_Create(260, 27, 80, 18, 7, 2, 0)
_GUICtrlTable_Set_Justify_All($Table2, 1, 1)
_GUICtrlTable_Set_TextFont_All($Table2, 8.5, 400, 2, "Century Gothic")
_GUICtrlTable_Set_TextFont_Column($Table2, 1, 8.5, 800, 0, "Century Gothic")
_GUICtrlTable_Set_CellColor_Column($Table2, 1, 0xffd700)
_GUICtrlTable_Set_Text_Row($Table2, 1, "Surname|Biochem")
_GUICtrlTable_Set_Text_Row($Table2, 2, "Forename|Andy")
_GUICtrlTable_Set_Text_Row($Table2, 3, "Age|30")
_GUICtrlTable_Set_Text_Row($Table2, 4, "Height|5'8''")
_GUICtrlTable_Set_Text_Row($Table2, 5, "Weight|75kg")
_GUICtrlTable_Set_Text_Row($Table2, 6, "Eyes|Brown")
_GUICtrlTable_Set_Text_Row($Table2, 7, "M/F|M")
_GUICtrlTable_Set_Border_Table($Table2)

;----- Table Example 3 -----
GUICtrlCreateLabel(" Example 3 ", 25, 100, 100, 13)
$Table3 = _GUICtrlTable_Create(25, 120, 62, 18, 6, 3, 0)
_GUICtrlTable_Set_ColumnWidth($Table3, 1, 70)
_GUICtrlTable_Set_Justify_Column($Table3, 1, 1, 1)
_GUICtrlTable_Set_Justify_Column($Table3, 2, 2, 1)
_GUICtrlTable_Set_Justify_Column($Table3, 3, 1, 1)
_GUICtrlTable_Set_Justify_Row($Table3, 1, 1, 1)
_GUICtrlTable_Set_Border_Row($Table3, 1, 8)
_GUICtrlTable_Set_Border_Row($Table3, 5, 8)
_GUICtrlTable_Set_Text_Row($Table3, 1, "Transaction|In|Out")
_GUICtrlTable_Set_Text_Row($Table3, 6, "Total|£51.01   |-£157.30   ")
_GUICtrlTable_Set_Text_Row($Table3, 2, "Petrol||-£35.00 ")
_GUICtrlTable_Set_Text_Row($Table3, 3, "Groceries||-£42.30 ")
_GUICtrlTable_Set_Text_Row($Table3, 4, "Interest|£51.01   ")
_GUICtrlTable_Set_Text_Row($Table3, 5, "Section 5||-£80.00 ")
For $row = 2 To 6
    For $col = 2 To 3
        _GUICtrlTable_Set_TextFont_Cell($Table3, $row, $col, 9, 400, 2)
    Next
Next
_GUICtrlTable_Set_TextFont_All($Table3, 8.5, 400, 2, "Tahoma")
_GUICtrlTable_Set_TextFont_Row($Table3, 1, 8.5, 600, 0, "Tahoma")

;----- Table Example 4 -----
GUICtrlCreateLabel(" Example 4 ", 25, 250, 100, 13)
$Table4 = _GUICtrlTable_Create(35, 268, 62, 18, 8, 6, 0)
_GUICtrlTable_Set_RowHeight($Table4, 1, 35)
_GUICtrlTable_Set_Justify_All($Table4, 1, 1)
_GUICtrlTable_Set_TextFont_All($Table4, 8.5, 800, 0, "Tahoma")
_GUICtrlTable_Set_CellColor_Row($Table4, 1, 0x555555)
_GUICtrlTable_Set_TextColor_All($Table4, 0x555555)
_GUICtrlTable_Set_TextColor_Row($Table4, 1, 0xFFFFFF)
For $row = 3 To 10 Step 2
    _GUICtrlTable_Set_CellColor_Row($Table4, $row, 0xDDDDDD)
Next
_GUICtrlTable_Set_Text_Row($Table4, 1, "Fixing|Size|Weight|Net|Gross|Order")
_GUICtrlTable_Set_Text_Row($Table4, 2, "Block|20.0|0.01|300|340|No")
_GUICtrlTable_Set_Text_Row($Table4, 3, "Screw|8.5|0.3|50|100|No")
_GUICtrlTable_Set_Text_Row($Table4, 4, "Rivet|0.1|0.4|10|11|Yes")
_GUICtrlTable_Set_Text_Row($Table4, 5, "Rope|300.0|100.0|2|10|No")
_GUICtrlTable_Set_Text_Row($Table4, 6, "Tack|10.6|0.3|1000|1011|Yes")
_GUICtrlTable_Set_Text_Row($Table4, 7, "Nail|30.3|0.4|400|600|No")
_GUICtrlTable_Set_Text_Row($Table4, 8, "Staple|0.3|0.05|10000|12000|No")
_GUICtrlTable_Set_Border_Table($Table4, 0x555555)

;----- Table Example 5 -----
GUICtrlCreateLabel(" Example 5 ", 260, 165, 100, 13)
$Table5 = _GUICtrlTable_Create(260, 182, 30, 20, 3, 3, 0)
_GUICtrlTable_Set_ColumnWidth($Table5, 1, 200)
_GUICtrlTable_Set_Text_Row($Table5, 1, "Attribute|x|y")
_GUICtrlTable_Set_CellColor_Row($Table5, 1, 0xEEEEEE)
_GUICtrlTable_Set_Justify_All($Table5, 1, 1)
_GUICtrlTable_Set_TextFont_All($Table5, 8.5, 200)
_GUICtrlTable_Set_TextFont_Row($Table5, 1, 9, 800)
_GUICtrlTable_Set_Border_Column($Table5, 2, 1, 0xEEEEEE)
_GUICtrlTable_Set_Border_Column($Table5, 3, 1, 0xEEEEEE)
_GUICtrlTable_Set_Border_Row($Table5, 1, 11)
_GUICtrlTable_Set_Border_Table($Table5)
_GUICtrlTable_Set_ColumnWidth($Table5, 1, 100)

;----- Unlock GUI to show tables -----
GUISetState(@SW_UNLOCK)

;----- Loop -----
Do
    Sleep(10)
    $m = MouseGetPos()
    _GUICtrlTable_Set_Text_Row($Table5, 2, "Mouse Position|" & $m[0] & "|" & $m[1])

    $w = WinGetPos("")
    _GUICtrlTable_Set_Text_Row($Table5, 3, "Window Position|" & $w[0] & "|" & $w[1])

    _GUIScrollbars_EventMonitor() ; You need this line to cater for Minimize/Restore cycles <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Until GUIGetMsg() = -3

Func createScrollBarsForGUI()
    ;return
    Local $tiMax_Scroll = 900
    ; Generate initial scrollbars - required scrollbar handlers registered
    _GUIScrollbars_Generate($GUI, $tiMax_Scroll, $tiMax_Scroll)
    ; Intialise for resizing
    Local $tiFullClient = 0
    Local $taMaxSize = _GUIScrollbars_ReSizer($GUI, $tiMax_Scroll, $tiMax_Scroll, $tiFullClient, True) ; Add True to register the handlers <<<<<<<<<<<
EndFunc

How does it look to you?

M23

Edited by Melba23
Removed code

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

That works! Thanks a lot Melba!

I just tried to put everything on a tab and noticed a little additional flicker again, I'll try to post a new example tomorrow. But in any case your fix already made my day!

 

Link to comment
Share on other sites

Here is the example with a tab:
 

#include <WindowsConstants.au3>
#include "Table.au3"
#include <GUIScrollbars_Ex_Mod.au3>

;----- GUI (Double Buffered) -----
$GUI = GUICreate("", 500, 500, -1, -1, BitOr($WS_SIZEBOX , $WS_SYSMENU, $WS_EX_COMPOSITED))
GUISetBkColor(0xFFFFFFFF)

; Tab
GUICtrlCreateTab(0, 0, 500,500, "", $WS_EX_COMPOSITED)
GUICtrlSetResizing(-1, $GUI_DOCKSIZE + $GUI_DOCKLEFT)

; Tab-Item
GUICtrlCreateTabItem("  Test  ")
GUICtrlSetResizing(-1, $GUI_DOCKSIZE + $GUI_DOCKLEFT)

; Scrollbars
createScrollBarsForGUI()

; Show GUID
GUISwitch($GUI)
GUISetState(@SW_SHOW, $GUI)

;----- Table Example 4 -----
$Table4 = _GUICtrlTable_Create(35, 30, 62, 18, 8, 6, 0)
For $i = 1 To Ubound($Table4, 1)-1
    For $j = 1 To Ubound($Table4, 2)-1
        GUICtrlSetResizing($Table4[$i][$j], $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKSIZE)
    Next
Next
_GUICtrlTable_Set_RowHeight($Table4, 1, 35)
For $row = 3 To 10 Step 2
    _GUICtrlTable_Set_CellColor_Row($Table4, $row, 0xDDDDDD)
Next
_GUICtrlTable_Set_Text_Row($Table4, 1, "Fixing|Size|Weight|Net|Gross|Order")
_GUICtrlTable_Set_Text_Row($Table4, 2, "Block|20.0|0.01|300|340|No")
_GUICtrlTable_Set_Text_Row($Table4, 3, "Screw|8.5|0.3|50|100|No")
_GUICtrlTable_Set_Text_Row($Table4, 4, "Rivet|0.1|0.4|10|11|Yes")
_GUICtrlTable_Set_Text_Row($Table4, 5, "Rope|300.0|100.0|2|10|No")
_GUICtrlTable_Set_Text_Row($Table4, 6, "Tack|10.6|0.3|1000|1011|Yes")
_GUICtrlTable_Set_Text_Row($Table4, 7, "Nail|30.3|0.4|400|600|No")
_GUICtrlTable_Set_Text_Row($Table4, 8, "Staple|0.3|0.05|10000|12000|No")

;----- Loop -----
Do
    Sleep(10)
    _GUIScrollbars_EventMonitor()

Until GUIGetMsg() = -3

Func createScrollBarsForGUI()
    ;return
    Local $tiMax_Scroll = 9000
    ; Generate initial scrollbars - required scrollbar handlers registered
    _GUIScrollbars_Generate($GUI, $tiMax_Scroll, $tiMax_Scroll)
    ; Intialise for resizing
    Local $tiFullClient = 0
    Local $taMaxSize = _GUIScrollbars_ReSizer($GUI, $tiMax_Scroll, $tiMax_Scroll, $tiFullClient, True) ; Add True to register the handlers <<<<<<<<<<<
EndFunc

I removed all other tables from the first example and added a tab. With the tab the GUI is flickering once when the scrollbars are redrawn. Without the tab there is almost no flickering noticeable. Is that unavoidable?

Edited by Kloud
Link to comment
Share on other sites

  • Moderators

Kloud,

If you want scrollbars in a resizable GUI using my UDF then I am afraid that there will always be a slight flicker as the scrollbars are redrawn after either a resize or a move. This is because I remove the scrollbars as the resize/move event starts and then redraw them as it finishes. This is only strictly necessary for a resize, but as I mentioned earlier, MS has combined the 2 events into the one message and as yet I have not found a way to distinguish between them. But we have a very wet few days forecast (yes, even in the south of Spain!) and I will plug away at the problem to see if I can come up with something.

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

Kloud,

Try this version of the UDF - essentially no flickering for me whether the GUI is resized or moved: GUIScrollbars_Ex_Mod.au3

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

It still flickers for me when using tabs and resizeable. If I don't have resizeable then it is absolutely perfect. Or if I don't have tabs. But tabs + scrollbars seem to be a flickering combination. I guess I now just go without resizing as I really want to have scrollbars and tabs. Thank you for your help Melba!

Link to comment
Share on other sites

@Kloud

no Flicking for Mouse & Win Pos(below script):

Global $st = "on", $prev, $prev2
;----- Loop -----
Do
    if $st = "on" Then
        $prev = MouseGetPos()
        $prev2 = WinGetPos("")
        $st = "of"
    EndIf
    $m = MouseGetPos()
    if $prev[0] <> $m[0] Or $prev[1] <> $m[1] Then
        _GUICtrlTable_Set_Text_Row($Table5, 2, "Mouse Position|" & $m[0] & "|" & $m[1])
        Sleep(20)
        $st = "on"
    EndIf
    $w = WinGetPos("")
    if $prev2[0] <> $w[0] Or $prev2[1] <> $w[1] Then
        _GUICtrlTable_Set_Text_Row($Table5, 3, "Window Position|" & $w[0] & "|" & $w[1])
        $st = "on"
    EndIf
    Sleep(80)
Until GUIGetMsg() = -3

 

Edited by ad777

iam ِAutoit programmer.

best thing in life is to use your Brain to

Achieve

everything you want.

Link to comment
Share on other sites

  • Moderators

ad777,

I believe Kloud is complaining about the whole GUI flickering as his second example script does not contain the frequently updated mouse position table.

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