Sign in to follow this  
Followers 0
nuki

Gui Dialog Resize questions

8 posts in this topic

hey people,

maybe im too stupid to find it but i would be really pleased if somebody of you could tell me a command to change the size of the gui dialog with a command.... for example GuiSetSize($gui,height,witdh,top,left)

or maybe someone could tell me how to do something like this if there is no specified command

hm and i need a command to know wich gui ctrl is activated (in use) at the moment like GuiCtrlGetActive($gui) for example

and my last question (im sure this was discussed alot already but i cant find anything with this crappy search) i want to doubleclick on my tray icon to show my program but i still wanna have a tray menu when i press with my right mousbutton on the icon... it wasnt possible for me cuz of the TrayOnEventMode option, would be nice if somebody just could send a link to a thread where u got that problem

thank you very much :)

Share this post


Link to post
Share on other sites



hey people,

maybe im too stupid to find it but i would be really pleased if somebody of you could tell me a command to change the size of the gui dialog with a command.... for example GuiSetSize($gui,height,witdh,top,left)

or maybe someone could tell me how to do something like this if there is no specified command

thank you very much :)

WinMove()

Share this post


Link to post
Share on other sites

lol thanks and i searched around the gui commands :<

but i remember this command ^^

could you help me with the other things too?

Share this post


Link to post
Share on other sites

hmm i wanted to make a popup in my gui... u press a button and the gui gets bigger and the hidden controls gets visible, you press it again and the gui gets small again.... that isnt possible with winmove :<

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

u press a button and the gui gets bigger and the hidden controls gets visible, you press it again and the gui gets small again.... that isnt possible with winmove

Yes it is :)

#include <GuiConstants.au3>

$Gui = GuiCreate("Test", 300, 200)

$Expand_Button = GUICtrlCreateButton("Expand", 20, 80, 80)
GUICtrlSetResizing(-1, $GUI_DOCKALL)

$Button1 = GUICtrlCreateButton("Some Button", 20, 240, 80)
GUICtrlSetResizing(-1, $GUI_DOCKALL)
$Button1 = GUICtrlCreateButton("Other Button", 120, 240, 80)
GUICtrlSetResizing(-1, $GUI_DOCKALL)

$Input = GUICtrlCreateInput("", 20, 200, 200, 20)
GUICtrlSetResizing(-1, $GUI_DOCKALL)

GUISetState()

While 1
    $Msg = GUIGetMsg()
    Switch $Msg
        Case -3
            Exit
        Case $Expand_Button
            Local $Height, $ButtonText
            $GuiPos = WinGetPos($Gui)
            If $GuiPos[3] < 320 Then
                $Height = 320
                $ButtonText = "Hide"
            Else
                $Height = 225
                $ButtonText = "Expand"
            EndIf
            GUICtrlSetData($Expand_Button, $ButtonText)
            WinMove($Gui, "", $GuiPos[0], $GuiPos[1], $GuiPos[2], $Height)
    EndSwitch
WEnd

Edit: Change the example a litle, so now there is now need to declare $IsExpanded, it checked by the current height position.

Edited by MsCreatoR

 

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

Share this post


Link to post
Share on other sites

i dont like that thing with resizing :/

i thought there would be a command for the dialog too :)

i guess i will do it with 2 guis....

has somebody ideas for my other questions?

Share this post


Link to post
Share on other sites

i dont like that thing with resizing

Now it's not resizing :) (i have edited the post a 10 minutes after i created it).

i need a command to know wich gui ctrl is activated

Use GuiGetMsg(1) in the main loop (read in help file about it).

i want to doubleclick on my tray icon to show my program but i still wanna have a tray menu when i press with my right mousbutton on the icon

If i understand right, you need that user be able to doubleclick on it, and the GUI will be shown?

Try this:

#include <Constants.au3>
Opt("TrayMenuMode", 1)
Opt("TrayOnEventMode", 1)

TraySetClick(16)
TraySetOnEvent($TRAY_EVENT_PRIMARYDOUBLE, "ShowHideGui")

TrayCreateItem("Exit")
TrayItemSetOnEvent(-1, "Quit")

$Gui = GuiCreate("Test")

GUISetState()

While 1
    $Msg = GUIGetMsg()
    Switch $Msg
        Case -3
            Exit
        Case Else
            
    EndSwitch
WEnd

Func ShowHideGui()
    If _WinIsVisible($Gui) Then
        GUISetState(@SW_HIDE)
    Else
        GUISetState(@SW_SHOW)
        WinActivate($Gui)
    EndIf
EndFunc

Func _WinIsVisible($hWnd, $Text="")
    Return BitAND(WinGetState($hWnd, $Text), 2)
EndFunc

Func Quit()
    Exit
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

Share this post


Link to post
Share on other sites

wow thank you soo much <3 you are great :)

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