Sign in to follow this  
Followers 0

Split your GUI

25 posts in this topic

Posted (edited) · Report post

Another quick and dirty proof of concept.

This script splits the window horizontally and vertically.

Please check it out.
#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 = 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
 $Status1 = _GuiCtrlStatusBarCreate ($Form1, $a, $b)
 
 $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
			 _GuiCtrlStatusBarSetText ($Status1, "Primary Down", 0)
		 Case $msg = $Pic1
			 _GuiCtrlStatusBarSetText ($Status1, "Pic1 Primary Down",0)
			 $InitiateDrag = "True"
			 $DragCtrl = $Pic1
		 Case $msg = $Pic2
			 _GuiCtrlStatusBarSetText ($Status1, "Pic2 Primary Down", 0)
			 $InitiateDrag = "True"
			 $DragCtrl = $Pic2
		 Case $msg = $GUI_EVENT_PRIMARYUP
			 _GuiCtrlStatusBarSetText ($Status1, "Primary Up", 0)
			 $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
			 _GuiCtrlStatusBarSetText ($Status1, "Secondary Down", 0)
		 Case $msg = $GUI_EVENT_SECONDARYUP
			 _GuiCtrlStatusBarSetText ($Status1, "Secondary Up", 0)
		 Case $msg = $GUI_EVENT_MOUSEMOVE
			 _GuiCtrlStatusBarSetText ($Status1, "Mouse Move", 0)
			 If $InitiateDrag = "True" Then
				 _GuiCtrlStatusBarSetText ($Status1, "Dragging", 1)
				 
				 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
		 Case Else
			 If _GuiCtrlStatusBarGetText ($Status1, 0) <> "Ready." Then _GuiCtrlStatusBarSetText ($Status1, "Ready.", 0)
			  If _GuiCtrlStatusBarGetText ($Status1, 1) <>  $InitiateDrag Then _GuiCtrlStatusBarSetText ($Status1, $InitiateDrag, 1)
		  ;;;;;;;
	 EndSelect
 WEnd
 Exit
 Func RESIZE_CONTROLS($hWnd, $Msg, $wParam, $lParam)
	 ResizeControls()
	 Return $GUI_RUNDEFMSG
 EndFunc
 
 Func ResizeControls()
;	GUISetState(@SW_LOCK)
  ;_ResizeHandler();needed to handle child????
	 _GuiCtrlStatusBarResize ($Status1)
	 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)
;	GUISetState(@SW_UNLOCK)
 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
;	 ConsoleWrite($nh & "=" & $winpos[1] & "-" &  $splitpos[1] & "+" & $splitpos[3] & "-40" & @CR)
	 GUICtrlSetPos($ctrl3,	$ctrl3pos[0], _
							   $splitpos[1] + $splitpos[3] + 1, _
							 $winpos[0], _
							 $nh)
 EndFunc;==>SplitterHort


[attachment=6482:attachment]
Edit
: I updated the code a little bit. Now has form buttons, and everything resizes if the window resizes.
[attachment=6817:attachment]
Edit: Fixed a couple of bugs.
[attachment=7476:attachment]

Hope someone finds this useful.

edit: Finally changed you to your in the topic title. Edited by eltorro

Share this post


Link to post
Share on other sites



Posted · Report post

I like it! Glancing at your script it looks like the seperaters are pictures. Am I correct?

Share this post


Link to post
Share on other sites

Posted · Report post

Yes the seperator bars are picture boxes. $SS_NOTIFY style is needed for the mouse events to register. I'm going to assume that a label would probable work too.

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

This is VERY cool, I like it a lot! I see many uses for it, I'm sure there are many more I haven't thought of yet.

Gene

Edit: spelling


Another quick and dirty proof of concept.

This script splits the window horizontally and vertically.

Please check it out.

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

;===============================================================================
; FileName:			splitterdemo.au3
; Description:	  Splitter Bar demo
;
; Requirement:	  Beta .103 or >
; Author(s):		eltorro (Steve Podhajecki <gehossafats@netmdc.com>)
; 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 borrowed some filler for the tree and list from the help files.
;===============================================================================

$Form1 = GUICreate("Splitter Bar", 622, 448, 192, 125, $WS_SIZEBOX)

$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 = 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")


$Pic1 = GUICtrlCreatePic("", 144, 8, 5, 313, $SS_NOTIFY)
GUICtrlSetResizing($Pic1, 128 + 256);2+32+256)
GUICtrlSetCursor($Pic1, 13)

$Pic2 = GUICtrlCreatePic("", 0, 320, 617, 20, BitOR($SS_NOTIFY, $SS_ETCHEDFRAME), $WS_EX_CLIENTEDGE)
GUICtrlSetResizing($Pic2, 2 + 8 + 512)
GUICtrlSetCursor($Pic2, 11)

Local $a[2] = [150, -1]
Local $b[2] = ["Ready.", ""], $InitiateDrag = "False", $DragCtrl
$Status1 = _GuiCtrlStatusBarCreate ($Form1, $a, $b)

$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()
While 1
	$msg = GUIGetMsg()
	Select
		Case $msg = $GUI_EVENT_PRIMARYDOWN
			_GuiCtrlStatusBarSetText ($Status1, "Primary Down", 0)
		Case $msg = $Pic1
			_GuiCtrlStatusBarSetText ($Status1, "Pic Primary Down", 0)
			$InitiateDrag = "True"
			$DragCtrl = $Pic1
		Case $msg = $Pic2
			_GuiCtrlStatusBarSetText ($Status1, "Pic Primary Down", 0)
			$InitiateDrag = "True"
			$DragCtrl = $Pic2
		Case $msg = $GUI_EVENT_PRIMARYUP
			_GuiCtrlStatusBarSetText ($Status1, "Primary Up", 0)
			$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
			_GuiCtrlStatusBarSetText ($Status1, "Secondary Down", 0)
		Case $msg = $GUI_EVENT_SECONDARYUP
			_GuiCtrlStatusBarSetText ($Status1, "Secondary Up", 0)
		Case $msg = $GUI_EVENT_MOUSEMOVE
			_GuiCtrlStatusBarSetText ($Status1, "Mouse Move", 0)
			If $InitiateDrag = "True" Then
				_GuiCtrlStatusBarSetText ($Status1, "Dragging", 1)
				
				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
			ResizeControls()
		Case $msg = $GUI_EVENT_CLOSE
			ExitLoop
		Case Else
			If _GuiCtrlStatusBarGetText ($Status1, 0) <> "Ready." Then _GuiCtrlStatusBarSetText ($Status1, "Ready.", 0)
			If _GuiCtrlStatusBarGetText ($Status1, 1) <> $InitiateDrag Then _GuiCtrlStatusBarSetText ($Status1, $InitiateDrag, 1)
;;;;;;;
	EndSelect
WEnd
Exit

Func ResizeControls()
;_ResizeHandler();needed to handle child????
	_GuiCtrlStatusBarResize ($Status1)
	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] - 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
;	ConsoleWrite($nh & "=" & $winpos[1] & "-" & $splitpos[1] & "+" & $splitpos[3] & "-40" & @CR)
	GUICtrlSetPos($ctrl3,	$ctrl3pos[0], _
							  $splitpos[1] + $splitpos[3] + 1, _
							$winpos[0], _
							$nh)
EndFunc;==>SplitterHort


[attachment=6482:attachment]
Hope someone finds this useful.

Edited by Gene

Share this post


Link to post
Share on other sites

Posted · Report post

Updated first post.

Steve

Share this post


Link to post
Share on other sites

Posted · Report post

nice! keep it up!

Share this post


Link to post
Share on other sites

Posted · Report post

Good Work!

Share this post


Link to post
Share on other sites

Posted · Report post

I like, you mind if I use part(with credit, of course)?

Share this post


Link to post
Share on other sites

Posted · Report post

Nice Work!!

8)

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

Very nice! I was trying to figure out an effective way to do multi-paned windows, but got bored with the project and abandoned it. I'm glad you didn't. :o

One thing though. As I drag the window to size it, things shift oddly. See the attachments. Basically, the left pane gets smaller, the right pane follows it, and the bottom pane moves downward.

Attachment 1: Start the script.
Attachments 2 & 3: After dragging the lower-right corner around a bit.
[attachment=7373:attachment] [attachment=7374:attachment] [attachment=7375:attachment] Edited by c0deWorm

Share this post


Link to post
Share on other sites

Posted · Report post

Very nice! I was trying to figure out an effective way to do multi-paned windows, but got bored with the project and abandoned it. I'm glad you didn't. :)

One thing though. As I drag the window to size it, things shift oddly. See the attachments. Basically, the left pane gets smaller, the right pane follows it, and the bottom pane moves downward.


There was an issue with GuiCtrlSetResizing for the pic bars.
They now remain stationary when dragging the window to resize.
I also fixed an issue when maximizing the window the vertical bar was not re-drawn.

Updated code is in first post.

Share this post


Link to post
Share on other sites

Posted · Report post

Updated code again.

Added window style $WS_CLIPCHILDREN.

Reduces the annoying flicker when resizing the window.

Share this post


Link to post
Share on other sites

Posted · Report post

How can you have two horizontal splits?

Share this post


Link to post
Share on other sites

Posted · Report post

Wow nice , well done :D

Share this post


Link to post
Share on other sites

Posted · Report post

Nice! i'm glad somebody finaly implemented this to autoit!

Share this post


Link to post
Share on other sites

Posted · Report post

Nice! Could come in handy some time.

Share this post


Link to post
Share on other sites

Posted · Report post

I set the style to this..

$ListView1 = GUICtrlCreateListView("col1 |col2|col3 ", 152, 8, 465, 313,BitOR($LVS_REPORT, $LVS_SHOWSELALWAYS))

and the whole listview disapeared..

Share this post


Link to post
Share on other sites

Posted · Report post

I set the style to this..

$ListView1 = GUICtrlCreateListView("col1 |col2|col3 ", 152, 8, 465, 313,BitOR($LVS_REPORT, $LVS_SHOWSELALWAYS))

and the whole listview disapeared..

Try
$ListView1 = GUICtrlCreateListView("col1 |col2|col3 ", 152, 8, 465, 313,BitOR($LVS_REPORT, $LVS_SHOWSELALWAYS),$WS_EX_CLIENTEDGE)


eltorro

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

Updated code again.

Added window style $WS_CLIPCHILDREN.

Reduces the annoying flicker when resizing the window.

I modified the code to take rid of several bugs.

All the lines I modified have ;!!! so that you can find them

You can run it without the beta version of AutoIt
#include <GUIConstants.au3>
#include <GuiStatusbar.au3>

;===============================================================================
; FileName:            splitterdemo.au3
; Description:      Splitter Bar demo
;
; Requirement:      Beta  ;!!! Beta not necessary
; Author(s):        eltorro (Steve Podhajecki <gehossafats@netmdc.com>)
; 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,1+2+32);jcd 42)
    $generalitem = GUICtrlCreateTreeViewItem("General", $TreeView1)
    GUICtrlSetColor(-1, 0x0000C0)
    $displayitem = GUICtrlCreateTreeViewItem("Display", $TreeView1)
    GUICtrlSetColor(-1, 0x0000C0)
    $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,4+32);!!! 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, 32+64+256);!!! 128 +2+256)
GUICtrlSetCursor($Pic1, 13)

GUICtrlSetBkColor($Pic1,$GUI_BKCOLOR_TRANSPARENT )
;horizontal divider.
$Pic2 = GUICtrlCreatePic("", 0, 320, 617, 20,$SS_NOTIFY);!!! BitOR($SS_NOTIFY, $SS_ETCHEDFRAME), $WS_EX_CLIENTEDGE)
GUICtrlSetResizing($Pic2, 2+4+512);!!!8 + 64 +  512)
GUICtrlSetBkColor($Pic2,$GUI_BKCOLOR_TRANSPARENT )
GUICtrlSetCursor($Pic2, 11)

Local $a[3] = [150,350, -1];!!!
Local $b[3] = ["Ready.", "",""], $InitiateDrag = "False", $DragCtrl
$Status1 = _GuiCtrlStatusBarCreate ($Form1, $a, $B)

$Edit1 = GUICtrlCreateEdit("", 0, 328, 617, 113, -1, $WS_EX_CLIENTEDGE)
GUICtrlSetResizing(-1,2+4+64);!!! 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)
dim $precedingMsg,$stopTime
ResizeControls()
;!!!GUIRegisterMsg($WM_SIZE,"RESIZE_CONTROLS")
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_PRIMARYDOWN
            _GuiCtrlStatusBarSetText ($Status1, "Primary Down", 0)
		Case $msg = $Pic1
            if $DragCtrl="" then _GuiCtrlStatusBarSetText ($Status1, "Pic1 Primary Down",0)
            $InitiateDrag = "True"
            $DragCtrl = $Pic1
        Case $msg = $Pic2
            _GuiCtrlStatusBarSetText ($Status1, "Pic2 Primary Down", 0)
            $InitiateDrag = "True"
            $DragCtrl = $Pic2
        Case $msg = $GUI_EVENT_PRIMARYUP
            _GuiCtrlStatusBarSetText ($Status1, "Primary Up", 0)
            $InitiateDrag = "False"
			_GuiCtrlStatusBarSetText ($Status1, "", 1)
            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
            _GuiCtrlStatusBarSetText ($Status1, "Secondary Down", 0)
        Case $msg = $GUI_EVENT_SECONDARYUP
            _GuiCtrlStatusBarSetText ($Status1, "Secondary Up", 0)
        Case $msg = $GUI_EVENT_MOUSEMOVE
            $stopTime=TimerInit()
            If $InitiateDrag = "True" Then
                _GuiCtrlStatusBarSetText ($Status1, "Dragging", 1)
                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
            Else
				_GuiCtrlStatusBarSetText ($Status1, "Mouse Move", 0)
            EndIf
        Case $msg = $GUI_EVENT_RESIZED or $msg = $GUI_EVENT_MAXIMIZE or $msg=$GUI_EVENT_RESTORE;!!!
            ResizeControls()
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case Else;!!!
			$idleTime=TimerDiff($stopTime)
			if $idleTime>100 Then
				$stopTime=TimerInit()
				if $InitiateDrag = "True" Then
					_GuiCtrlStatusBarSetText ($Status1, "Idling", 1)
				Else
					_GuiCtrlStatusBarSetText ($Status1, "Idling", 0)
				EndIf
			EndIf
    EndSelect
WEnd
Exit
;!!!Func RESIZE_CONTROLS($hWnd, $Msg, $wParam, $lParam)
;!!!	ResizeControls()
;!!!    Return $GUI_RUNDEFMSG
;!!!EndFunc

Func ResizeControls()
;    GUISetState(@SW_LOCK)
  ;_ResizeHandler();needed to handle child????
    _GuiCtrlStatusBarResize ($Status1)
;!!!    Local $winpos = WinGetPos("")
;!!!    Local $picpos1 = ControlGetPos("", "", $Pic1)
;!!!    Local $picpos2 = ControlGetPos("", "", $Pic2)
;!!!    Local $pos = $picpos2
    
	
;!!!	GUICtrlSetPos($Pic1, $picpos1[0], $picpos1[1], $picpos1[2], $picpos2[1])
;!!!    GUICtrlSetPos($Pic2, 0, $picpos2[1], $winpos[2], $picpos2[3])
    SplitterHort($TreeView1, $ListView1, $Edit1, $Pic2)
    SplitterVert($TreeView1, $ListView1, $Pic1, $Pic2)
;    GUISetState(@SW_UNLOCK)
EndFunc ;==>ResizeControls

Func SplitterVert($ctrl1, $ctrl2, $split1, $split2)
	GUICtrlSetState($split1,$gui_hide);!!!
    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)
	GUICtrlSetPos($split1,$splitpos1[0],$splitpos1[1],$splitpos1[2],$ctrl2pos[3]);!!!
	GUICtrlSetState($split1,$gui_show);!!!
EndFunc ;==>SplitterVert

Func SplitterHort($ctrl1, $ctrl2, $ctrl3, $split)
	GUICtrlSetState($split,$gui_hide);!!!
    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 $splitpic1 = ControlGetPos("", "", $pic1);!!!
	GUICtrlSetPos($pic1,$splitpic1[0],$splitpic1[1],$splitpic1[2],$nh);!!!
    Local $nh
    $nh = $winpos[1] - $splitpos[1] + $splitpos[3] - 60; move this up above the status bar
;     ConsoleWrite($nh & "=" & $winpos[1] & "-" &  $splitpos[1] & "+" & $splitpos[3] & "-40" & @CR)
    GUICtrlSetPos($ctrl3,    $ctrl3pos[0], _
                              $splitpos[1] + $splitpos[3] + 1, _
                            $winpos[0], _
                            $nh)

	GUICtrlSetState($split,$gui_show);!!!
EndFunc ;==>SplitterHort
Edited by tresa

Share this post


Link to post
Share on other sites

Posted · Report post

Nice touch @tresa.
Althought it still does not redraw the splitters correctly all the time. Increas the bottom area then decrease it.
I thought this would do it, but no :lmao:
 Case $DragCtrl = $Pic1
	 SplitterVert($TreeView1, $ListView1, $Pic1, $Pic2)
	 $DragCtrl = ""
	 If 0 = DLLCall("user32.dll","int","InvalidateRect","hwnd",Hwnd($Pic1),"int",0,"int",1) Then ;invalidate client area			   
	  ConsoleWrite("!FAILDE to invalidaterect $Pic1" & @LF)
   EndIf
 Case $DragCtrl = $Pic2
	 SplitterHort($TreeView1, $ListView1, $Edit1, $Pic2)
	 $DragCtrl = ""
	 If 0 = DLLCall("user32.dll","int","InvalidateRect","hwnd",Hwnd($Pic2),"int",0,"int",1) Then ;invalidate client area			   
		 ConsoleWrite("!FAILDE to invalidaterect $Pic2" & @LF)
	  EndIf

Share this post


Link to post
Share on other sites

Posted · Report post

Nice touch @tresa.
Althought it still does not redraw the splitters correctly all the time. Increas the bottom area then decrease it.
I thought this would do it, but no :whistle:

I modified again a few things, specially to have a correct resizing when dragging the window edges

To do a udf I'm looking for the correct concept to link either the splitters either the divided zones (or both)

Tresa


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

;===============================================================================
; FileName:            splitterdemo.au3
; Description:      Splitter Bar demo
;
; Requirement:      Beta;!!! with this version beta is not required
; Author(s):        eltorro (Steve Podhajecki <gehossafats@netmdc.com>) modified by Tresa
; 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 or label and drag it
;                    then resize the controls.
;                    I bowwored some filler for the tree and list from the help files.
;===============================================================================
;$WM_SIZE =0x0005
	Global $Form1Height=448
	Global $Form1Width=622
	Global $splitWidth=5
	Global $leftVSplit=144
	Global $topHSplit=320
	Global $topMargin=6
	Global $leftMargin=4
	Global $rigthMargin=4
	Global $bottomMargin=6
	Global $statusBarHeight

$Form1  = GUICreate("Splitter Demo", $Form1Width, $Form1Height,192,125, BitOr($WS_SIZEBOX,  $WS_MAXIMIZEBOX, $WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU,$WS_CLIPCHILDREN))

$TreeView1  = GUICtrlCreateTreeView($leftMargin, $topMargin, $leftVSplit-$leftMargin, $topHSplit-$topMargin, BitOR($TVS_HASBUTTONS,  $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP,  $TVS_SHOWSELALWAYS), $WS_EX_CLIENTEDGE)
    $generalitem = GUICtrlCreateTreeViewItem("General", $TreeView1)
    GUICtrlSetColor(-1, 0x0000C0)
    $displayitem = GUICtrlCreateTreeViewItem("Display", $TreeView1)
    GUICtrlSetColor(-1, 0x0000C0)
    $aboutitem = GUICtrlCreateTreeViewItem("About", $generalitem)
    $compitem = GUICtrlCreateTreeViewItem("Computer", $generalitem)
    $useritem = GUICtrlCreateTreeViewItem("User", $generalitem)
    $resitem = GUICtrlCreateTreeViewItem("Resolution", $displayitem)
    $otheritem = GUICtrlCreateTreeViewItem("Other", $displayitem)
	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


$ListView1 = GUICtrlCreateListView("col1  |col2|col3  ", $leftVSplit+$splitWidth, $topMargin, $Form1Width-$rigthMargin-($leftVSplit+$splitWidth), $topHSplit-$topMargin, -1, $WS_EX_CLIENTEDGE)
    $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")

;horizontal divider.
$Pic2 = GUICtrlCreatePic("", $leftMargin, $topHSplit, $Form1Width-$leftMargin-$rigthMargin, $splitWidth,$SS_NOTIFY);!!! BitOR($SS_NOTIFY, $SS_ETCHEDFRAME), $WS_EX_CLIENTEDGE)
GUICtrlSetCursor($Pic2, 11)

;vertical divider
$Pic1 = GUICtrlCreateLabel("", $leftVSplit, $topMargin, $splitWidth, $topHSplit-$topMargin, $SS_NOTIFY)
GUICtrlSetCursor($Pic1, 13)

;statusBar
Local $a[3] = [150,350, -1]
Local $b[3] = ["Ready.", "",""], $DragCtrl=""
$Status1 = _GuiCtrlStatusBarCreate ($Form1, $a, $B)
Local $a_rect = _GUICtrlStatusBarGetRect ($Status1, 1)
$statusBarHeight=($a_rect[3]-$a_rect[1])

$Edit1 = GUICtrlCreateEdit("", $leftMargin, $topHSplit+$splitWidth, $Form1Width-$leftMargin-$rigthMargin, $Form1Height-$bottomMargin-$statusBarHeight-$topHSplit-$splitWidth, -1, $WS_EX_CLIENTEDGE)
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)

GUISetState(@SW_SHOW)
dim $precedingMsg,$stopTime
ResizeControls()
GUIRegisterMsg($WM_SIZE,"RESIZE_CONTROLS")
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_PRIMARYDOWN
            _GuiCtrlStatusBarSetText ($Status1, "Primary Down", 0)
		Case $msg = $Pic1
            if $DragCtrl="" then _GuiCtrlStatusBarSetText ($Status1, "Pic1 Primary Down",0)
            $DragCtrl = $Pic1

		Case $msg = $Pic2
            _GuiCtrlStatusBarSetText ($Status1, "Pic2 Primary Down", 0)
            $DragCtrl = $Pic2
        Case $msg = $GUI_EVENT_PRIMARYUP
            _GuiCtrlStatusBarSetText ($Status1, "Primary Up", 0)
			saveSplitPos()
			_GuiCtrlStatusBarSetText ($Status1, "", 1)
            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
            _GuiCtrlStatusBarSetText ($Status1, "Secondary Down", 0)
        Case $msg = $GUI_EVENT_SECONDARYUP
            _GuiCtrlStatusBarSetText ($Status1, "Secondary Up", 0)
        Case $msg = $GUI_EVENT_MOUSEMOVE
            $stopTime=TimerInit()
			if $DragCtrl<>"" then
                _GuiCtrlStatusBarSetText ($Status1, "Dragging", 1)
                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],2)
                EndIf
                If $DragCtrl = $Pic2 Then
                     If $mousepos[1] > 25 And $mousepos[1]<  ($winpos[1] - 25) Then GUICtrlSetPos($Pic2, $picpos[0], $mousepos[1],$picpos[2],2)
                EndIf
            Else
				_GuiCtrlStatusBarSetText ($Status1, "Mouse Move", 0)
            EndIf
        Case $msg = $GUI_EVENT_RESIZED or $msg = $GUI_EVENT_MAXIMIZE or $msg=$GUI_EVENT_RESTORE;!!!
            ResizeControls()
			saveSplitPos()

        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case Else
			$idleTime=TimerDiff($stopTime)
			if $idleTime>100 Then
				$stopTime=TimerInit()
				if $DragCtrl<>"" then
					_GuiCtrlStatusBarSetText ($Status1, "Idling", 1)
				Else
					_GuiCtrlStatusBarSetText ($Status1, "Idling", 0)
				EndIf
			EndIf
    EndSelect
WEnd
Exit

Func saveSplitPos()
	Local $winpos = WinGetClientSize("")
	$Form1Width=$winpos[0]
	$Form1Height=$winpos[1]
	Local $splitpos1 = ControlGetPos("", "", $Pic1)
	$leftVSplit=$splitpos1[0]
	Local $splitpos2 = ControlGetPos("", "", $Pic2)
	$topHSplit=$splitpos2[1]
EndFunc
		
Func RESIZE_CONTROLS($hWnd, $Msg, $wParam, $lParam)
    Local $winpos = WinGetClientSize("")
	Local $Hcoef=($winpos[0]-$leftMargin-$rigthMargin-$splitWidth)/($Form1Width-$leftMargin-$rigthMargin-$splitWidth)
	Local $Vcoef=($winpos[1]-$topMargin-$bottomMargin-$splitWidth-$statusBarHeight)/($Form1Height-$topMargin-$bottomMargin-$splitWidth-$statusBarHeight)

	GUICtrlSetPos($pic2,$leftMargin,$topMargin+($topHSplit-$topMargin)*$Vcoef,$winpos[0])
	GUICtrlSetPos($pic1,$leftMargin+($leftVSplit-$leftMargin)*$Hcoef,$topMargin,$splitWidth,($topHSplit-$topMargin)*$Vcoef)
	
	ResizeControls()
    Return $GUI_RUNDEFMSG
EndFunc

Func ResizeControls()
    _GuiCtrlStatusBarResize ($Status1)

	SplitterHort($TreeView1, $ListView1, $Edit1, $Pic2)
    SplitterVert($TreeView1, $ListView1, $Pic1, $Pic2)
EndFunc ;==>ResizeControls

Func SplitterVert($ctrl1, $ctrl2, $split1,$iop)
	GUICtrlSetState($split1,$gui_hide);!!!
    Local $splitpos1 = ControlGetPos("", "", $split1)
	Local $winpos = WinGetClientSize("")

	GUICtrlSetPos($split1,$splitpos1[0],$splitpos1[1],$splitWidth,$splitpos1[3]);!!!

	GUICtrlSetPos($ctrl1, $leftMargin, $splitpos1[1], _
            ($splitpos1[0] - $leftMargin), _
			$splitpos1[3])
	
	GUICtrlSetPos($ctrl2, $splitpos1[0] + $splitWidth, _
            $splitpos1[1], _
            $winpos[0] -$rigthMargin- $splitpos1[0] - $splitWidth, _
			$splitpos1[3])
	GUICtrlSetState($split1,$gui_show);!!!
EndFunc ;==>SplitterVert

Func SplitterHort($ctrl1, $ctrl2, $ctrl3, $split)
    Local $splitpos = ControlGetPos("", "", $split)
    Local $splitpic1 = ControlGetPos("", "", $pic1);!!!
	$splitpos[3]=$splitWidth
	GUICtrlSetPos($split,$splitpos[0],$splitpos[1],$splitpos[2],$splitWidth);!!!
	GUICtrlSetState($split,$gui_hide);!!!

	Local $winpos = WinGetClientSize("")

	Local $nh
	$nh = $splitpos[1]-$topMargin;jcd - 9

    GUICtrlSetPos($ctrl1, $leftMargin, $topMargin, $splitpic1[0]-$leftMargin,$nh)
    GUICtrlSetPos($ctrl2, $splitpic1[0]+$splitWidth,$topMargin,$winpos[0]-$rigthMargin-($splitpic1[0]+$splitWidth),$nh)
	
	Local $top = $splitpos[1] + $splitWidth
	GUICtrlSetPos($pic1, $splitpic1[0], $splitpic1[1], $splitpic1[2], $nh);!!!

    $nh = $winpos[1] - $top - $bottomMargin-$statusBarHeight; move this up above the status bar

	GUICtrlSetPos($ctrl3, $leftMargin, _
                              $top, _
                            $winpos[0]-$leftMargin-$rigthMargin, _
                            $nh)

	GUICtrlSetState($split,$gui_show);!!!
EndFunc ;==>SplitterHort

Share this post


Link to post
Share on other sites

Posted · Report post

Nice :whistle:
Keep it comming, keep it comming ....

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

Hurrah!

2^10 posts. Edited by Manadar

Share this post


Link to post
Share on other sites

Posted · Report post

Hi. When I copy any of these scripts in my autoit, it doesn't start at all... Why please?

ZOMG just saw, last post in 2006.

Share this post


Link to post
Share on other sites

Posted · Report post

CroatianPig,

Always a good idea to look at the date. ;)

If you want to split your GUI, look at the GUIFrames UDF in my sig. But please ask any questions about it in the UDF thread and not here. :)

M23

Share this post


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
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.