Jump to content

Resizing Gui without Docking


Recommended Posts

I have to say I'm pretty much a newbie at AutoIt. I've been working on a program, a shell replacement, and I've gotten pretty far along with it, both conceptually and in actual work. I'm making a window and I need resize a Listview control to be proportionate to the window. I anticipate skining the window myself, however. Because of this I can't use docking since I won't be using $WS_SIZEBOX in my window GUI. So my question is: How can I resize a GUI control, namely a listview, dynamically without using docking?

PS: I truly have been searching and searching for the answer, I keep coming up with nada.

Edited by JohnnyThrash
Link to comment
Share on other sites

If you won't use docking, it won't happen automatically.

You can handle the $GUI_EVENT_RESIZED event by checking the new GUI size, doing the math, and resizing the control with ControlMove().

:mellow:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

If you won't use docking, it won't happen automatically.

You can handle the $GUI_EVENT_RESIZED event by checking the new GUI size, doing the math, and resizing the control with ControlMove().

:mellow:

It's not that I don't want to use docking so much as it is I don't think I'll be able to use docking on a Popup window that doesn't use Size box.

Thanks for your response I'll try it out. If you think I might be going about this all wrong please let me know. I'm just thinking here.

Link to comment
Share on other sites

Resizing does not require that you have a WS_SIZEBOX style. It simply determines the way a control is resized when the parent window is resized. So if you change a window using WinMove for example then the resizing mode for the controls will take effect.

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

$gg = GUICreate("nothing",400,400,400,400,$WS_POPUP)
$edit = GUICtrlCreateEdit("htfg",10,10,380,380)
GUICtrlSetResizing(-1,$GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKBOTTOM + $GUI_DOCKRIGHT)
GUISetState()

sleep(5000)
winmove($gg,"",400,400,800,600)
sleep(5000)
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Resizing does not require that you have a WS_SIZEBOX style. It simply determines the way a control is resized when the parent window is resized. So if you change a window using WinMove for example then the resizing mode for the controls will take effect.

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

$gg = GUICreate("nothing",400,400,400,400,$WS_POPUP)
$edit = GUICtrlCreateEdit("htfg",10,10,380,380)
GUICtrlSetResizing(-1,$GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKBOTTOM + $GUI_DOCKRIGHT)
GUISetState()

sleep(5000)
winmove($gg,"",400,400,800,600)
sleep(5000)

Thanks alot Martin, this is great to know. I have one major problem however. I'm using the Explorer View UDF. For some reason docking won't work on this GUI control. If necessary I can show you my code.
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...