Jump to content

List View UDF Resizing


zackrspv
 Share

Recommended Posts

Hello there all, it's been awhile :)

I have 3 elements, 2 of which are UDF Listview's and 1 of which is a standard combo box. I want all 3 of them to move and resize with each other.

Here is what I have:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#include <WinAPI.au3>
#include <GUIListBox.au3>
$OTLX = 0
$OTLY = 0
$OTLH = 0
$OTLW = 0
$otlxDiff = 0
$otlyDiff = 0
$otlhDiff = 0
$otlwDiff = 0
$width = 1024
$height = 768
$Gui = GUICreate("Gui", $width, $height, -1, -1, BitOR($WS_MINIMIZEBOX, $WS_SIZEBOX, $WS_THICKFRAME, $WS_SYSMENU, $WS_CAPTION, $WS_POPUPWINDOW, $WS_GROUP, $WS_BORDER, $WS_CLIPSIBLINGS))
$list1X = 615
$list1Y = 22
$list1W = 300
$list1H = 195
$List = _GUICtrlListView_Create($Gui, "", $list1X, $list1Y, $list1W, $list1H, $LBS_MULTICOLUMN + $WS_HSCROLL)
$otlComboX = 615
$otlComboY = 219
$otlComboW = 300
$otlComboH = 10
$otTLCombo = GUICtrlCreateCombo("All Tickets", $otlComboX, $otlComboY, $otlComboW, $otlComboH)
GUICtrlSetData($otTLCombo, "Escalated Tickets|Needs Update")
$list2X = 615
$list2Y = 241
$list2W = 300
$list2H = 232
$List2 = _GUICtrlListView_Create($Gui, "", $list2X, $list2Y, $list2W, $list2H, $LBS_MULTICOLUMN + $WS_HSCROLL)
GUIRegisterMsg($WM_SIZE, "WM_SIZE")
GUISetState()
While 1
    $Msg = GUIGetMsg()
    Switch $Msg
        Case - 3
            Exit
        Case Else
            $curwinpos = WinGetPos("", "")
            $curwinW = $curwinpos[2]
            $curwinH = $curwinpos[3]
    EndSwitch
WEnd
Func WM_SIZE($hWnd, $Msg, $wParam, $lParam)
    Local $iWidth = BitAND($lParam, 0xFFFF)
    Local $iHeight = BitShift($lParam, 16)
    $combostats = ControlGetPos("", "", $otTLCombo)
    If @error = 1 Then
    Else
        $OTLX = $combostats[0]
        $OTLY = $combostats[1]
        $OTLW = $combostats[2]
        $OTLH = $combostats[3]
        $otlxDiff = $otlComboX - $OTLX
        $otlyDiff = $otlComboY - $OTLY
        $otlhDiff = $otlComboH - $OTLH
        $otlwDiff = $otlComboW - $OTLW
        
        _WinAPI_MoveWindow($List, $list1X - $otlxDiff, $list1Y + $otlyDiff, $list1W - $otlwDiff, $list1H,  True)
        _WinAPI_MoveWindow($List2, $list2X - $otlxDiff, $list2Y + $otlyDiff, $list2W - $otlwDiff, $list2H, True)
    EndIf
    Return $GUI_RUNDEFMSG
EndFunc  ;==>WM_SIZE

Note, the X movement (ie changing the WIDTH of the GUI works, but the Y (height changes) movement does not. When the window is resized up and down, I need all 3 boxes to resize and move together acting as if they were one element.

Can one of y'all gurus' help me finish this script? Thanks!

-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

Link to comment
Share on other sites

Use Opt("GUIResizeMode")...

But this work properly only with built-in functions, i commented out the udfs, you can uncomment them (and the line with GUIRegisterMsg) and it's will work, but it's not so good as with built-in functions:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#include <WinAPI.au3>
#include <GUIListBox.au3>

Opt("GUIResizeMode", $GUI_DOCKMENUBAR)

$OTLX = 0
$OTLY = 0
$OTLH = 0
$OTLW = 0
$otlxDiff = 0
$otlyDiff = 0
$otlhDiff = 0
$otlwDiff = 0
$width = @DesktopWidth
$height = @DesktopHeight

$Gui = GUICreate("Gui", $width, $height, -1, -1, _
    BitOR($WS_MINIMIZEBOX, $WS_SIZEBOX, $WS_THICKFRAME, $WS_SYSMENU, $WS_CAPTION, $WS_POPUPWINDOW, $WS_GROUP, $WS_BORDER, $WS_CLIPSIBLINGS))

$list1X = 615
$list1Y = 22
$list1W = 300
$list1H = 195

$List = GUICtrlCreateListView("", $list1X, $list1Y, $list1W, $list1H, $LBS_MULTICOLUMN + $WS_HSCROLL)
;$List = _GUICtrlListView_Create($Gui, "", $list1X, $list1Y, $list1W, $list1H, $LBS_MULTICOLUMN + $WS_HSCROLL)

$otlComboX = 615
$otlComboY = 219
$otlComboW = 300
$otlComboH = 10

$otTLCombo = GUICtrlCreateCombo("All Tickets", $otlComboX, $otlComboY, $otlComboW, $otlComboH)
GUICtrlSetData($otTLCombo, "Escalated Tickets|Needs Update")

$list2X = 615
$list2Y = 241
$list2W = 300
$list2H = 232

$List2 = GUICtrlCreateListView("", $list2X, $list2Y, $list2W, $list2H, $LBS_MULTICOLUMN + $WS_HSCROLL)
;$List2 = _GUICtrlListView_Create($Gui, "", $list2X, $list2Y, $list2W, $list2H, $LBS_MULTICOLUMN + $WS_HSCROLL)
;GUIRegisterMsg($WM_SIZE, "WM_SIZE")

GUISetState()

While 1
    $Msg = GUIGetMsg()
    Switch $Msg
        Case - 3
            Exit
        Case Else
            $curwinpos = WinGetPos("", "")
            $curwinW = $curwinpos[2]
            $curwinH = $curwinpos[3]
    EndSwitch
WEnd

Func WM_SIZE($hWnd, $Msg, $wParam, $lParam)
    Local $iWidth = BitAND($lParam, 0xFFFF)
    Local $iHeight = BitShift($lParam, 16)
    $combostats = ControlGetPos("", "", $otTLCombo)
    If @error = 1 Then
    Else
        $OTLX = $combostats[0]
        $OTLY = $combostats[1]
        $OTLW = $combostats[2]
        $OTLH = $combostats[3]
        $otlxDiff = $otlComboX - $OTLX
        $otlyDiff = $otlComboY - $OTLY
        $otlhDiff = $otlComboH - $OTLH
        $otlwDiff = $otlComboW - $OTLW
        
        _WinAPI_MoveWindow($List, $list1X - $otlxDiff, $list1Y + $otlyDiff, $list1W - $otlwDiff, $list1H,  True)
        _WinAPI_MoveWindow($List2, $list2X - $otlxDiff, $list2Y + $otlyDiff, $list2W - $otlwDiff, $list2H, True)
    EndIf
    Return $GUI_RUNDEFMSG
EndFunc  ;==>WM_SIZE

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

Use Opt("GUIResizeMode")...

But this work properly only with built-in functions, i commented out the udfs, you can uncomment them (and the line with GUIRegisterMsg) and it's will work, but it's not so good as with built-in functions:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#include <WinAPI.au3>
#include <GUIListBox.au3>

Opt("GUIResizeMode", $GUI_DOCKMENUBAR)

$OTLX = 0
$OTLY = 0
$OTLH = 0
$OTLW = 0
$otlxDiff = 0
$otlyDiff = 0
$otlhDiff = 0
$otlwDiff = 0
$width = @DesktopWidth
$height = @DesktopHeight

$Gui = GUICreate("Gui", $width, $height, -1, -1, _
    BitOR($WS_MINIMIZEBOX, $WS_SIZEBOX, $WS_THICKFRAME, $WS_SYSMENU, $WS_CAPTION, $WS_POPUPWINDOW, $WS_GROUP, $WS_BORDER, $WS_CLIPSIBLINGS))

$list1X = 615
$list1Y = 22
$list1W = 300
$list1H = 195

$List = GUICtrlCreateListView("", $list1X, $list1Y, $list1W, $list1H, $LBS_MULTICOLUMN + $WS_HSCROLL)
;$List = _GUICtrlListView_Create($Gui, "", $list1X, $list1Y, $list1W, $list1H, $LBS_MULTICOLUMN + $WS_HSCROLL)

$otlComboX = 615
$otlComboY = 219
$otlComboW = 300
$otlComboH = 10

$otTLCombo = GUICtrlCreateCombo("All Tickets", $otlComboX, $otlComboY, $otlComboW, $otlComboH)
GUICtrlSetData($otTLCombo, "Escalated Tickets|Needs Update")

$list2X = 615
$list2Y = 241
$list2W = 300
$list2H = 232

$List2 = GUICtrlCreateListView("", $list2X, $list2Y, $list2W, $list2H, $LBS_MULTICOLUMN + $WS_HSCROLL)
;$List2 = _GUICtrlListView_Create($Gui, "", $list2X, $list2Y, $list2W, $list2H, $LBS_MULTICOLUMN + $WS_HSCROLL)
;GUIRegisterMsg($WM_SIZE, "WM_SIZE")

GUISetState()

While 1
    $Msg = GUIGetMsg()
    Switch $Msg
        Case - 3
            Exit
        Case Else
            $curwinpos = WinGetPos("", "")
            $curwinW = $curwinpos[2]
            $curwinH = $curwinpos[3]
    EndSwitch
WEnd

Func WM_SIZE($hWnd, $Msg, $wParam, $lParam)
    Local $iWidth = BitAND($lParam, 0xFFFF)
    Local $iHeight = BitShift($lParam, 16)
    $combostats = ControlGetPos("", "", $otTLCombo)
    If @error = 1 Then
    Else
        $OTLX = $combostats[0]
        $OTLY = $combostats[1]
        $OTLW = $combostats[2]
        $OTLH = $combostats[3]
        $otlxDiff = $otlComboX - $OTLX
        $otlyDiff = $otlComboY - $OTLY
        $otlhDiff = $otlComboH - $OTLH
        $otlwDiff = $otlComboW - $OTLW
        
        _WinAPI_MoveWindow($List, $list1X - $otlxDiff, $list1Y + $otlyDiff, $list1W - $otlwDiff, $list1H,  True)
        _WinAPI_MoveWindow($List2, $list2X - $otlxDiff, $list2Y + $otlyDiff, $list2W - $otlwDiff, $list2H, True)
    EndIf
    Return $GUI_RUNDEFMSG
EndFunc  ;==>WM_SIZE

The issue is that i have to use the UDF's, not the built in functions. I have custom context menus, custom icons, string searches, list view verification checks, etc, for the list view items. Built-In UDF's don't support all of those features. Is there a way to do this w/ the UDF's?

NOTE: I tested out the above code, even w/ the UDF's commented out, and not commented out, and you still have the same issue I do. You have the HORIZONTAL MOVEMENT working, but not the Vertical movement. When the screen is resized UP AND DOWN, the boxes need to MOVE together, as well as resize together.

Edited by zackrspv

-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

Link to comment
Share on other sites

Built-In UDF's don't support all of those features

It's supports, the problem is that this is more complicated and hard to do.

Is there a way to do this w/ the UDF's?

Yes, read the first comments in my previous post :)

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

It's supports, the problem is that this is more complicated and hard to do.

Yes, read the first comments in my previous post :)

You comments were:

Use Opt("GUIResizeMode")...

But this work properly only with built-in functions, i commented out the udfs, you can uncomment them (and the line with GUIRegisterMsg) and it's will work, but it's not so good as with built-in functions:

I have done just that, and ran your script, and it does exactly what mine does. It does NOT resize the controls VERTICALLY, however, which is the one part that I was stuck on. I appriciate the help, trust me, this has been bugging me for awhile now. It's the only element of my entire program that isn't compatable yet with resizing LOL, kinda makes end users upset, ya know?

If i can finally get the VERTICAL SIDE (IE UP AND DOWN movement of the window) to work, and move and resize all the elements at the same time, then I'll be happy. But, as you've seen, in my script, it only works on the horizontal side, taking the queue's from the current window size and the COMBO Box's size/position. But, that doesn't seem to help me on the VERTICAL side.

Any thoughts on that?

-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

Link to comment
Share on other sites

Hi, I wanted to state also that all o fthose functions i'm doing on the UDF ListViews, i've had help on this forum before, and some of the MVP's stated it couldn't be done. I'm sure it can be, just have to code this param, that param, etc lol, but as you say, it would take longer and be more complicated. That's a discussion for another time :)

-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

Link to comment
Share on other sites

This one make the resizing as you need, or it isn't?

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#include <WinAPI.au3>
#include <GUIListBox.au3>

Opt("GUIResizeMode", $GUI_DOCKMENUBAR)

$OTLX = 0
$OTLY = 0
$OTLH = 0
$OTLW = 0
$otlxDiff = 0
$otlyDiff = 0
$otlhDiff = 0
$otlwDiff = 0
$width = @DesktopWidth
$height = @DesktopHeight

$Gui = GUICreate("Gui", $width, $height, -1, -1, _
    BitOR($WS_MINIMIZEBOX, $WS_SIZEBOX, $WS_THICKFRAME, $WS_SYSMENU, $WS_CAPTION, $WS_POPUPWINDOW, $WS_GROUP, $WS_BORDER, $WS_CLIPSIBLINGS))

$list1X = 615
$list1Y = 22
$list1W = 300
$list1H = 195

$List = _GUICtrlListView_Create($Gui, "", $list1X, $list1Y, $list1W, $list1H, $LBS_MULTICOLUMN + $WS_HSCROLL)

$otlComboX = 615
$otlComboY = 219
$otlComboW = 300
$otlComboH = 10

$otTLCombo = GUICtrlCreateCombo("All Tickets", $otlComboX, $otlComboY, $otlComboW, $otlComboH)
GUICtrlSetData($otTLCombo, "Escalated Tickets|Needs Update")

$list2X = 615
$list2Y = 241
$list2W = 300
$list2H = 232

$List2 = _GUICtrlListView_Create($Gui, "", $list2X, $list2Y, $list2W, $list2H, $LBS_MULTICOLUMN + $WS_HSCROLL)
GUIRegisterMsg($WM_SIZE, "WM_SIZE")

GUISetState()

While 1
    $Msg = GUIGetMsg()
    Switch $Msg
        Case - 3
            Exit
        Case Else
            $curwinpos = WinGetPos("", "")
            $curwinW = $curwinpos[2]
            $curwinH = $curwinpos[3]
    EndSwitch
WEnd

Func WM_SIZE($hWnd, $Msg, $wParam, $lParam)
    Local $iWidth = BitAND($lParam, 0xFFFF)
    Local $iHeight = BitShift($lParam, 16)
    $combostats = ControlGetPos("", "", $otTLCombo)
    If @error = 1 Then
    Else
        $OTLX = $combostats[0]
        $OTLY = $combostats[1]
        $OTLW = $combostats[2]
        $OTLH = $combostats[3]
        $otlxDiff = $otlComboX - $OTLX
        $otlyDiff = $otlComboY - $OTLY
        $otlhDiff = $otlComboH - $OTLH
        $otlwDiff = $otlComboW - $OTLW
        
        _WinAPI_MoveWindow($List, $list1X - $otlxDiff, $list1Y + $otlyDiff, $list1W - $otlwDiff, $list1H,  True)
        _WinAPI_MoveWindow($List2, $list2X - $otlxDiff, $list2Y + $otlyDiff, $list2W - $otlwDiff, $list2H, True)
    EndIf
    Return $GUI_RUNDEFMSG
EndFunc ;==>WM_SIZE

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

This one make the resizing as you need, or it isn't?

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#include <WinAPI.au3>
#include <GUIListBox.au3>

Opt("GUIResizeMode", $GUI_DOCKMENUBAR)

$OTLX = 0
$OTLY = 0
$OTLH = 0
$OTLW = 0
$otlxDiff = 0
$otlyDiff = 0
$otlhDiff = 0
$otlwDiff = 0
$width = @DesktopWidth
$height = @DesktopHeight

$Gui = GUICreate("Gui", $width, $height, -1, -1, _
    BitOR($WS_MINIMIZEBOX, $WS_SIZEBOX, $WS_THICKFRAME, $WS_SYSMENU, $WS_CAPTION, $WS_POPUPWINDOW, $WS_GROUP, $WS_BORDER, $WS_CLIPSIBLINGS))

$list1X = 615
$list1Y = 22
$list1W = 300
$list1H = 195

$List = _GUICtrlListView_Create($Gui, "", $list1X, $list1Y, $list1W, $list1H, $LBS_MULTICOLUMN + $WS_HSCROLL)

$otlComboX = 615
$otlComboY = 219
$otlComboW = 300
$otlComboH = 10

$otTLCombo = GUICtrlCreateCombo("All Tickets", $otlComboX, $otlComboY, $otlComboW, $otlComboH)
GUICtrlSetData($otTLCombo, "Escalated Tickets|Needs Update")

$list2X = 615
$list2Y = 241
$list2W = 300
$list2H = 232

$List2 = _GUICtrlListView_Create($Gui, "", $list2X, $list2Y, $list2W, $list2H, $LBS_MULTICOLUMN + $WS_HSCROLL)
GUIRegisterMsg($WM_SIZE, "WM_SIZE")

GUISetState()

While 1
    $Msg = GUIGetMsg()
    Switch $Msg
        Case - 3
            Exit
        Case Else
            $curwinpos = WinGetPos("", "")
            $curwinW = $curwinpos[2]
            $curwinH = $curwinpos[3]
    EndSwitch
WEnd

Func WM_SIZE($hWnd, $Msg, $wParam, $lParam)
    Local $iWidth = BitAND($lParam, 0xFFFF)
    Local $iHeight = BitShift($lParam, 16)
    $combostats = ControlGetPos("", "", $otTLCombo)
    If @error = 1 Then
    Else
        $OTLX = $combostats[0]
        $OTLY = $combostats[1]
        $OTLW = $combostats[2]
        $OTLH = $combostats[3]
        $otlxDiff = $otlComboX - $OTLX
        $otlyDiff = $otlComboY - $OTLY
        $otlhDiff = $otlComboH - $OTLH
        $otlwDiff = $otlComboW - $OTLW
        
        _WinAPI_MoveWindow($List, $list1X - $otlxDiff, $list1Y + $otlyDiff, $list1W - $otlwDiff, $list1H,  True)
        _WinAPI_MoveWindow($List2, $list2X - $otlxDiff, $list2Y + $otlyDiff, $list2W - $otlwDiff, $list2H, True)
    EndIf
    Return $GUI_RUNDEFMSG
EndFunc;==>WM_SIZE

Nope, same issue, as you can see from the picture, there is no Vertical resizing going on.

Posted Image

Do we have a solution to where the boxes will properly resize based on the positioning of the combo box and size of the window, i think is what this calls for.

-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

Link to comment
Share on other sites

I think i got what you mean now, but i don't think that you should do it that way, better use built-in functions.

Try this one, it's close :):

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#include <WinAPI.au3>
#include <GUIListBox.au3>

$OTLX = 0
$OTLY = 0
$OTLH = 0
$OTLW = 0
$otlxDiff = 0
$otlyDiff = 0
$otlhDiff = 0
$otlwDiff = 0
$width = @DesktopWidth
$height = @DesktopHeight

$Gui = GUICreate("Gui", $width, $height, -1, -1, _
    BitOR($WS_MINIMIZEBOX, $WS_SIZEBOX, $WS_THICKFRAME, $WS_SYSMENU, $WS_CAPTION, $WS_POPUPWINDOW, $WS_GROUP, $WS_BORDER, $WS_CLIPSIBLINGS))

$list1X = 615
$list1Y = 22
$list1W = 300
$list1H = 195

$List = _GUICtrlListView_Create($Gui, "", $list1X, $list1Y, $list1W, $list1H, $LBS_MULTICOLUMN + $WS_HSCROLL)

$otlComboX = 615
$otlComboY = 219
$otlComboW = 300
$otlComboH = 10

$otTLCombo = GUICtrlCreateCombo("All Tickets", $otlComboX, $otlComboY, $otlComboW, $otlComboH)
GUICtrlSetData($otTLCombo, "Escalated Tickets|Needs Update")

$list2X = 615
$list2Y = 241
$list2W = 300
$list2H = 232

$List2 = _GUICtrlListView_Create($Gui, "", $list2X, $list2Y, $list2W, $list2H, $LBS_MULTICOLUMN + $WS_HSCROLL)

GUIRegisterMsg($WM_SIZE, "WM_SIZE")
GUISetState()

While 1
    Switch GUIGetMsg()
        Case -3
            Exit
    EndSwitch
WEnd

Func WM_SIZE($hWnd, $Msg, $wParam, $lParam)
    Local $iWidth = BitAND($lParam, 0xFFFF)
    Local $iHeight = BitShift($lParam, 16)
    
    Local $aCombo_Pos = ControlGetPos($hWnd, "", $otTLCombo)
    
    If Not @error Then
        $OTLX = $aCombo_Pos[0]
        $OTLY = $aCombo_Pos[1]
        $OTLW = $aCombo_Pos[2]
        $OTLH = $aCombo_Pos[3]
        $otlxDiff = $otlComboX - $OTLX
        $otlyDiff = $otlComboY - $OTLY
        $otlhDiff = $otlComboH - $OTLH
        $otlwDiff = $otlComboW - $OTLW
        
        _WinAPI_MoveWindow($List, $list1X - $otlxDiff, $list1Y, $list1W - $otlwDiff, $OTLY - $list1Y - 3,  True)
        _WinAPI_MoveWindow($List2, $list2X - $otlxDiff, $OTLY + $OTLH + 3, $list2W - $otlwDiff, $OTLY - $list1Y - 3, True)
    EndIf
    
    Return $GUI_RUNDEFMSG
EndFunc

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

I think i got what you mean now, but i don't think that you should do it that way, better use built-in functions.

Try this one, it's close :):

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#include <WinAPI.au3>
#include <GUIListBox.au3>

$OTLX = 0
$OTLY = 0
$OTLH = 0
$OTLW = 0
$otlxDiff = 0
$otlyDiff = 0
$otlhDiff = 0
$otlwDiff = 0
$width = @DesktopWidth
$height = @DesktopHeight

$Gui = GUICreate("Gui", $width, $height, -1, -1, _
    BitOR($WS_MINIMIZEBOX, $WS_SIZEBOX, $WS_THICKFRAME, $WS_SYSMENU, $WS_CAPTION, $WS_POPUPWINDOW, $WS_GROUP, $WS_BORDER, $WS_CLIPSIBLINGS))

$list1X = 615
$list1Y = 22
$list1W = 300
$list1H = 195

$List = _GUICtrlListView_Create($Gui, "", $list1X, $list1Y, $list1W, $list1H, $LBS_MULTICOLUMN + $WS_HSCROLL)

$otlComboX = 615
$otlComboY = 219
$otlComboW = 300
$otlComboH = 10

$otTLCombo = GUICtrlCreateCombo("All Tickets", $otlComboX, $otlComboY, $otlComboW, $otlComboH)
GUICtrlSetData($otTLCombo, "Escalated Tickets|Needs Update")

$list2X = 615
$list2Y = 241
$list2W = 300
$list2H = 232

$List2 = _GUICtrlListView_Create($Gui, "", $list2X, $list2Y, $list2W, $list2H, $LBS_MULTICOLUMN + $WS_HSCROLL)

GUIRegisterMsg($WM_SIZE, "WM_SIZE")
GUISetState()

While 1
    Switch GUIGetMsg()
        Case -3
            Exit
    EndSwitch
WEnd

Func WM_SIZE($hWnd, $Msg, $wParam, $lParam)
    Local $iWidth = BitAND($lParam, 0xFFFF)
    Local $iHeight = BitShift($lParam, 16)
    
    Local $aCombo_Pos = ControlGetPos($hWnd, "", $otTLCombo)
    
    If Not @error Then
        $OTLX = $aCombo_Pos[0]
        $OTLY = $aCombo_Pos[1]
        $OTLW = $aCombo_Pos[2]
        $OTLH = $aCombo_Pos[3]
        $otlxDiff = $otlComboX - $OTLX
        $otlyDiff = $otlComboY - $OTLY
        $otlhDiff = $otlComboH - $OTLH
        $otlwDiff = $otlComboW - $OTLW
        
        _WinAPI_MoveWindow($List, $list1X - $otlxDiff, $list1Y, $list1W - $otlwDiff, $OTLY - $list1Y - 3,  True)
        _WinAPI_MoveWindow($List2, $list2X - $otlxDiff, $OTLY + $OTLH + 3, $list2W - $otlwDiff, $OTLY - $list1Y - 3, True)
    EndIf
    
    Return $GUI_RUNDEFMSG
EndFunc

Much better! Good job, man, and thanks for helping. I'd use the internal ListViews if i could >_< But this will work just fine :idiot:

-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

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