Jump to content

Graphic Gui display problem


Go to solution Solved by Melba23,

Recommended Posts

I'm trying to create a GUI that is split (2 ListViews and with draggable divider) 

I followed some example code and it seems to work, but graphically it's like the GUI isn't redrawing correctly. It is leaving graphic "remnants" of where things used to be, or the borders of the controls are missing / not in the right spots. 

Here is a simple example you can run to see if you are seeing what I am seeing. 

#include <GUIConstants.au3>
 #include <GuiStatusbar.au3>


opt("GUIResizeMode",$GUI_DOCKAUTO)
$Form1  = GUICreate("Test", 660, 320, 192, 125, BitOr($WS_SIZEBOX,  $WS_MAXIMIZEBOX, $WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU,$WS_CLIPCHILDREN))

$ListView1  = GUICtrlCreateListView("col1|col2|col3",0, 10, 200, 300, -1,$WS_EX_CLIENTEDGE)
$ListView2 = GUICtrlCreateListView("col1|col2|col3", 205, 10, 450, 300, -1, $WS_EX_CLIENTEDGE)
GUISetState()

While 1
     $msg = GUIGetMsg()
     Select
         Case $msg = $GUI_EVENT_CLOSE
             ExitLoop
     EndSelect
 WEnd
 Exit

When you run the code - Resize the window, Maximize it and then restore it. When I do this, I see the graphical glitches. 

I've also attached a pic showing the effect I am seeing.

post-87120-0-42697900-1422537603_thumb.j

Link to comment
Share on other sites

Here is an easy fix:

#include <GUIConstants.au3>
#include <GuiStatusbar.au3>

Opt("GUIResizeMode", $GUI_DOCKAUTO)

$Form1 = GUICreate("Test", 660, 320, 192, 125, BitOR($WS_POPUP, $WS_OVERLAPPEDWINDOW)) ;<< here

$ListView1 = GUICtrlCreateListView("col1|col2|col3", 0, 10, 200, 300, -1, $WS_EX_CLIENTEDGE)
$ListView2 = GUICtrlCreateListView("col1|col2|col3", 205, 10, 450, 300, -1, $WS_EX_CLIENTEDGE)
GUISetState()

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
    EndSelect
WEnd
Edited by MikahS

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Link to comment
Share on other sites

I've narrowed it down to $WS_CLIPCHILDREN

If I use that style - it causes the graphic issues whenever I resize controls.

Without it though, I don't get the visual update I want when I drag my vertical split. From what I am reading, there is a lot of trouble resizing controls on the fly like this :(

Edited by JakeKenmode
Link to comment
Share on other sites

Have you tried the fix I proposed?

It does everything the same as your original script, without the graphic issues. ;)

EDIT: If there is more to the script, please post it so we can help you further if my solution did not fix this.

Edited by MikahS

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Link to comment
Share on other sites

Your primairy problem lies in the $WS_CLIPCHILDREN on GUICreate

This would be the working code:

#include <GUIConstants.au3>
 #include <GuiStatusbar.au3>

opt("GUIResizeMode",$GUI_DOCKAUTO)
$Form1  = GUICreate("Test", 660, 320, 192, 125, BitOr($WS_SIZEBOX,  $WS_MAXIMIZEBOX, $WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU))
$ListView1  = GUICtrlCreateListView("col1|col2|col3",10, 10, 200, 300, -1, $WS_EX_CLIENTEDGE)
$ListView2 = GUICtrlCreateListView("col1|col2|col3", 215, 10, 435, 300, -1, $WS_EX_CLIENTEDGE)
GUISetState()

While 1
     $msg = GUIGetMsg()
     Select
         Case $msg = $GUI_EVENT_CLOSE
             ExitLoop
     EndSelect
 WEnd
 Exit

But more little things like $WS_EX_CLIENTEDGE are used om GUICtrlCreateListView...

I would start with the following to have the edges stay the same width:

#include <GUIConstants.au3>
#include <GuiStatusbar.au3>

$Form1  = GUICreate("Test", 660, 320, 192, 125, BitOR($WS_OVERLAPPEDWINDOW, $WS_POPUP))
$ListView1  = GUICtrlCreateListView("col1|col2|col3",10, 10, 200, 300)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKLEFT, $GUI_DOCKTOP, $GUI_DOCKBOTTOM, $GUI_DOCKWIDTH))
$ListView2 = GUICtrlCreateListView("col1|col2|col3", 215, 10, 435, 300)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKLEFT, $GUI_DOCKTOP, $GUI_DOCKBOTTOM, $GUI_DOCKRIGHT))
GUISetState()

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

Exit
Edited by DutchCoder
Link to comment
Share on other sites

DutchCoder have you tested that? As, it does not resize correctly.

JakeKenmode - $WS_POPUP -- creates a popup window

                         $WS_OVERLAPPEDWINDOW -- Creates an overlapped window with the WS_OVERLAPPED, WS_CAPTION, WS_SYSMENU, WS_THICKFRAME, WS_MINIMIZEBOX, and WS_MAXIMIZEBOX styles. Same as the WS_TILEDWINDOW style.

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Link to comment
Share on other sites

Yes thanks, I am aware of the styles via the help files. 

Here is a modified example of the splitter code I found on these forums that I am using. Many of the UDF's were old and needed to be updated to work correctly. 

#include <GUIConstants.au3>
 #include <GuiStatusbar.au3>

;===============================================================================
; FileName:         splitterdemo.au3
; Description:    Splitter Bar demo
;
; Requirement:    Beta
; Author(s):        eltorro (Steve Podhajecki <[email="gehossafats@netmdc.com"]gehossafats@netmdc.com[/email]>)
; Note(s):          This is just a proof of concept at the moment.
;                   This could be tweaked into a udf with a little more work
;                   The basic principle is to create a pic box and drag it
;                   then resize the controls.
;                   I bowwored some filler for the tree and list from the help files.
;===============================================================================
;~  $WM_SIZE =0x0005
 $Form1  = GUICreate("Splitter Demo", 622, 448, 192, 125, BitOr($WS_SIZEBOX,  $WS_MAXIMIZEBOX, $WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU,$WS_CLIPCHILDREN))

 $TreeView1  = GUICtrlCreateTreeView(0, 8, 145, 313, BitOR($TVS_HASBUTTONS,  $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP,  $TVS_SHOWSELALWAYS), $WS_EX_CLIENTEDGE)
 GUICtrlSetResizing(-1, 42)
     $generalitem = GUICtrlCreateTreeViewItem("General", $TreeView1)
     GUICtrlSetColor(-1, 0x0000C0)
     $displayitem = GUICtrlCreateTreeViewItem("Display", $TreeView1)
     GUICtrlSetColor(-1, 0x0000C0)
     $aboutitem = GUICreate
     $aboutitem = GUICtrlCreateTreeViewItem("About", $generalitem)
     $compitem = GUICtrlCreateTreeViewItem("Computer", $generalitem)
     $useritem = GUICtrlCreateTreeViewItem("User", $generalitem)
     $resitem = GUICtrlCreateTreeViewItem("Resolution", $displayitem)
     $otheritem = GUICtrlCreateTreeViewItem("Other", $displayitem)

$ListView1 = GUICtrlCreateListView("col1  |col2|col3  ", 152, 8, 465, 313, -1, $WS_EX_CLIENTEDGE)
 GUICtrlSetResizing(-1, 44)
     $item1 = GUICtrlCreateListViewItem("item2|col22|col23", $ListView1)
     $item2 = GUICtrlCreateListViewItem("item1|col12|col13", $ListView1)
     $item3 = GUICtrlCreateListViewItem("item3|col32|col33", $ListView1)
     GUICtrlSetState(-1, $GUI_DROPACCEPTED); to allow drag and dropping
     GUISetState()
     GUICtrlSetData($item2, "ITEM1")
     GUICtrlSetData($item3, "||COL33")

;vertical divider
 $Pic1 = GUICtrlCreatePic("", 144, 8, 5, 313, $SS_NOTIFY)
 GUICtrlSetResizing($Pic1, 128 + 2 + 256)
 GUICtrlSetCursor($Pic1, 13)
;horizontal divider.
 $Pic2 = GUICtrlCreatePic("", 0, 320, 617, 20, BitOR($SS_NOTIFY, $SS_ETCHEDFRAME), $WS_EX_CLIENTEDGE)
 GUICtrlSetResizing($Pic2, 8 + 64 +  512)
 GUICtrlSetCursor($Pic2, 11)

 Local $a[3] = [150,150, -1]
 Local $b[3] = ["Ready.", "",""], $InitiateDrag = "False", $DragCtrl

 $Edit1 = GUICtrlCreateEdit("", 0, 328, 617, 113, -1, $WS_EX_CLIENTEDGE)
 GUICtrlSetResizing(-1, 128)
 GUICtrlSetData($Edit1, "Drag the bars between the controls and they will resize." & @CRLF & _
         "Resize the screen and see what happens."& @CRLF & _
         "The Status bar show True the left mouse button is down and over a splitter.")

 opt("MouseCoordMode", 2)
 GUICtrlSetState($generalitem, BitOR($GUI_EXPAND, $GUI_DEFBUTTON)) ; Expand the "General"-item and paint in bold
 GUICtrlSetState($displayitem, BitOR($GUI_EXPAND, $GUI_DEFBUTTON)) ; Expand the "Display"-item and paint in bold

 GUISetState(@SW_SHOW)
 ResizeControls()
 GUIRegisterMsg($WM_SIZE,"RESIZECONTROLS")
 While 1
     $msg = GUIGetMsg()
     Select
         Case $msg = $GUI_EVENT_PRIMARYDOWN
         Case $msg = $Pic1
             $InitiateDrag = "True"
             $DragCtrl = $Pic1
         Case $msg = $Pic2
             $InitiateDrag = "True"
             $DragCtrl = $Pic2
         Case $msg = $GUI_EVENT_PRIMARYUP
             $InitiateDrag = "False"
             Select
                 Case $DragCtrl = $Pic1
                     SplitterVert($TreeView1, $ListView1, $Pic1, $Pic2)
                     $DragCtrl = ""
                 Case $DragCtrl = $Pic2
                     SplitterHort($TreeView1, $ListView1, $Edit1, $Pic2)
                     $DragCtrl = ""
             EndSelect
         Case $msg = $GUI_EVENT_SECONDARYDOWN
         Case $msg = $GUI_EVENT_SECONDARYUP
         Case $msg = $GUI_EVENT_MOUSEMOVE
             If $InitiateDrag = "True" Then
                 Local $picpos = ControlGetPos("", "", $DragCtrl)
                 Local $mousepos = MouseGetPos()
                 Local $winpos = WinGetClientSize("")
                 If $DragCtrl = $Pic1 Then
                      If $mousepos[0] > 25 And $mousepos[0]<  ($winpos[0] - 25) Then GUICtrlSetPos($Pic1, $mousepos[0], $picpos[1])
                 EndIf
                 If $DragCtrl = $Pic2 Then
                      If $mousepos[1] > 25 And $mousepos[1]<  ($winpos[1] - 25) Then GUICtrlSetPos($Pic2, $picpos[0], $mousepos[1])
                 EndIf
             EndIf
         Case $msg = $GUI_EVENT_RESIZED or $msg = $GUI_EVENT_MAXIMIZE
             ResizeControls()
         Case $msg = $GUI_EVENT_CLOSE
             ExitLoop
     EndSelect
 WEnd
 Exit
 Func RESIZE_CONTROLS($hWnd, $Msg, $wParam, $lParam)
     ResizeControls()
     Return $GUI_RUNDEFMSG
 EndFunc

 Func ResizeControls()
     Local $winpos = WinGetPos("")
     Local $picpos1 = ControlGetPos("", "", $Pic1)
     Local $picpos2 = ControlGetPos("", "", $Pic2)
     Local $pos = $picpos2

     GUICtrlSetPos($Pic2, 0, $picpos2[1], $winpos[2], $picpos2[3])
     GUICtrlSetPos($Pic1, $picpos1[0], $picpos1[1], $picpos1[2], $picpos2[1])
     SplitterHort($TreeView1, $ListView1, $Edit1, $Pic2)
     SplitterVert($TreeView1, $ListView1, $Pic1, $Pic2)
 EndFunc;==>ResizeControls

 Func SplitterVert($ctrl1, $ctrl2, $split1, $split2)
     Local $splitpos1 = ControlGetPos("", "", $split1)
     Local $splitpos2 = ControlGetPos("", "", $split2)
     Local $ctrl1pos = ControlGetPos("", "", $ctrl1)
     Local $ctrl2pos = ControlGetPos("", "", $ctrl2)
     Local $winpos = WinGetClientSize("")
     GUICtrlSetPos($ctrl1, $ctrl1pos[0], _
             $ctrl1pos[1], _
             (($splitpos1[0] - 1) - $ctrl1pos[0]), _
             $splitpos2[1]-10)
     Local $nw = $winpos[0] - $splitpos1[0] - 5
     GUICtrlSetPos($ctrl2, $splitpos1[0] + 5, _
             $ctrl2pos[1], _
             $nw, _
             $splitpos2[1] - 10)

 EndFunc;==>SplitterVert

 Func SplitterHort($ctrl1, $ctrl2, $ctrl3, $split)
     Local $splitpos = ControlGetPos("", "", $split)
     Local $ctrl1pos = ControlGetPos("", "", $ctrl1)
     Local $ctrl2pos = ControlGetPos("", "", $ctrl2)
     Local $ctrl3pos = ControlGetPos("", "", $ctrl3)
     Local $winpos = WinGetClientSize("")
     Local $nh
     Select
         Case $splitpos[1] > $ctrl1pos[3]
             $nh = ($ctrl1pos[3]+ ($splitpos[1] - $ctrl1pos[3])) - 10
         Case $splitpos[1] < $ctrl1pos[3]
             $nh = ($ctrl1pos[3]- ($ctrl1pos[3] - $splitpos[1])) - 10
     EndSelect

     GUICtrlSetPos($ctrl1, $ctrl1pos[0], _
             $ctrl1pos[1], _
             $ctrl1pos[2], _
             $nh)

     GUICtrlSetPos($ctrl2, $ctrl2pos[0], _
             $ctrl2pos[1], _
             $ctrl2pos[2], _
             $nh)
     Local $nh
     $nh = $winpos[1] - $splitpos[1] + $splitpos[3] - 60; move this up above the status bar
     GUICtrlSetPos($ctrl3,  $ctrl3pos[0], _
                               $splitpos[1] + $splitpos[3] + 1, _
                             $winpos[0], _
                             $nh)
 EndFunc;==>SplitterHort

Now  if this is run, you will see the graphic issues. 

If you simply remove $WS_CLIPCHILDREN it will "work" but you will not see the split's updating properly until you mouse up. The clipping allows you to drag the split and see it move. That is what I am looking to achieve. 

I mean - If I had to go without it to avoid glitches, I will, but if there is a way to fix it - I'd love to investigate it :)

Link to comment
Share on other sites

  • Moderators
  • Solution

JakeKenmode,

Why not use my GUIFrame UDF and let it do all the work for you? :huh:

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

#include "GUIFrame.au3"

$hGUI  = GUICreate("Test", 660, 320, 192, 125, BitOr($WS_SIZEBOX, $WS_MAXIMIZEBOX, $WS_MINIMIZEBOX, $WS_CAPTION, $WS_SYSMENU))

GUISetState()

$iIndex = _GUIFrame_Create($hGUI, 0, 200)

_GUIFrame_Switch($iIndex, 1)

$ListView1  = GUICtrlCreateListView("col1|col2|col3",0, 10, 200, 300, -1,$WS_EX_CLIENTEDGE)

_GUIFrame_Switch($iIndex, 2)

$ListView2 = GUICtrlCreateListView("col1|col2|col3", 0, 10, 450, 300, -1, $WS_EX_CLIENTEDGE)

_GUIFrame_ResizeSet(0)

_GUIFrame_ResizeReg()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd
That seems to work quite nicely. :)

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 would love to :) I didn't know of its existence till just now, so thanks for that! 

I do seem to have a problem though - that file isn't on my system (or in the path it's looking in). I'll dig around, perhaps I need an update 

Current Version: Version 3.4.1

*edit using SciTE 3.4.4 now and AutoIT 3.3.12 - still can't find that include. 

and.... one day I'll learn to read - and realize you said "why not try my UDF"

Edited by JakeKenmode
Link to comment
Share on other sites

  • Moderators

JakeKenmode,

It is one of my personal UDFs - look in my sig for the link to find it. Once you have downloaded it you might like to look at the Adding UDFs to AutoIt and SciTE tutorial in the Wiki to see how to get it running properly on your system. ;)

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

JakeKenmode,

"Picky" is the word! :D

You are resizing ListViews - which are one of the flakiest controls in Windows - so I feel a little flicker is a small price to pay. ;)

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

Glad Melba was able to help you. ;)

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Link to comment
Share on other sites

Yeah - im sticking with  it, The users are low end users as it is. I'm sure they won't even notice anything. Visual Studio has made me picky! it's not my fault! HAHA

Thanks again for the UDF. I'm using your GUIListViewEx.au3 as well for the final result. 

How do UDF list views function with your GUIFrame.au3? Do they play nice?

Link to comment
Share on other sites

  • Moderators

JakeKenmode,

There is no reason why they should not as the "frames" are just standard GUIs. I suggest you try it and see. ;)

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

@ Melba

Am I missing something here? I have been tinkering for a while and I can't seem to get this one to behave like the built in Listview. 

When resize the Window the UDF ListView doesn't move, nor does it update if I drag the separator. 

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

$hGUI  = GUICreate("Test", 660, 320, 192, 125, BitOr($WS_SIZEBOX, $WS_MAXIMIZEBOX, $WS_MINIMIZEBOX, $WS_CAPTION, $WS_SYSMENU))

GUISetState()

$iIndex = _GUIFrame_Create($hGUI, 0, 200)

_GUIFrame_Switch($iIndex, 1)

$ListView1  = GUICtrlCreateListView("col1|col2|col3",0, 10, 200, 300, -1,-1)

_GUIFrame_Switch($iIndex, 2)

; Create Right ListView

$hListView_Right = _GUICtrlListView_Create($hGUI, "Peter|Paul|Mary", 210, 10, 200, 300, BitOR($LVS_SHOWSELALWAYS, $LVS_REPORT, $WS_BORDER))
_GUICtrlListView_SetExtendedListViewStyle($hListView_Right, $LVS_EX_FULLROWSELECT)


_GUIFrame_ResizeSet(0)

_GUIFrame_ResizeReg()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd
Link to comment
Share on other sites

  • Moderators

JakeKenmode,

UDF-created controls do not respond to the native GUICtrlSetResizing commands, so you have to do it yourself as I explained here. A good reason to stick with the native ListViews unless you really need the UDF ones. ;)

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 wrote a little routine for you (and others)

I hope it helps

#include <GUIConstants.au3>
#include <GuiStatusbar.au3>
AutoItSetOption('MouseCoordMode', 2)
$DividerOffset = 330

$Form1  = GUICreate("Test", 660, 320, 192, 125, BitOR($WS_OVERLAPPEDWINDOW, $WS_POPUP))
$ListView1  = GUICtrlCreateListView("col1|col2|col3", 5, 5, $DividerOffset - 5, 310)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKLEFT, $GUI_DOCKTOP, $GUI_DOCKBOTTOM, $GUI_DOCKWIDTH))
$ListView2 = GUICtrlCreateListView("col1|col2|col3", $DividerOffset + 5, 5, 660 - $DividerOffset - 10, 310)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKLEFT, $GUI_DOCKTOP, $GUI_DOCKBOTTOM, $GUI_DOCKRIGHT))
$Divider = GUICtrlCreateLabel('', $DividerOffset, 5, 5, 310)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKLEFT, $GUI_DOCKTOP, $GUI_DOCKBOTTOM, $GUI_DOCKRIGHT))
GUICtrlSetCursor(-1, 13)
GUISetState()

While 1
     Switch GUIGetMsg()
         Case $GUI_EVENT_CLOSE
             ExitLoop
         Case $Divider
             Resize()
     EndSwitch
WEnd

Exit

Func Resize()
    GUISetCursor(13, 1, $Form1)
    $siz = WinGetClientSize($Form1)
    Do
        $arr = GUIGetCursorInfo($Form1)
        $pos = MouseGetPos(0)
        Select
            Case $pos < 100
                $pos = 100
            Case $pos > $siz[0] - 100
                $pos = $siz[0] - 100
        EndSelect
        If $pos <> $DividerOffset Then
            $DividerOffset = $pos
            GUICtrlSetPos($ListView1, -1, -1, $DividerOffset - 5)
            GUICtrlSetPos($ListView2, $DividerOffset + 5, -1, $siz[0] - $DividerOffset - 10)
        EndIf
    Until Not $arr[2]
    GUICtrlSetPos($Divider, $DividerOffset)
    GUISetCursor(-1, 0, $Form1)
EndFunc
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...