Sign in to follow this  
Followers 0
Tomy46

How to put my GUI in full screen without deforming it?

11 posts in this topic

Hello all,

Everything is in the title...

I am going to develop you a little more my problem:

I have a window showing graph for monitoring and pictures, all this work with positions indeed specify.

My problem is to be able to enlarge this window on any screen without losing all positions : like a "zoom"...

Can you help me? :)


======> Tomy ... just for fun ;) <======

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

Yes, it's a good idea but can helps me more?

My window's code :

$fenetre = GUICreate("NetSolar - Monitoring solaire", 1254, 730)

How to put this window in full screen without losing the proportions? HELP HELP HELP :)

P.S : There is also an image not bottom of screen these dimensions would have to adapt themselves also

Edited by Tomy46

======> Tomy ... just for fun ;) <======

Share this post


Link to post
Share on other sites

Tomy46,

Does this help explain GUICtrlSetResizing a bit better? :)

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

$hGUI = GUICreate("Test", 500, 400, -1, -1, BitOr($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX) )

$hLabel = GUICtrlCreateLabel("", 10, 10, 480, 100)

$hPic = GUICtrlCreatePic("C:\Program Files\AutoIt3\Examples\GUI\logo4.gif", 10, 100, 480, 200)
GUICtrlSetResizing(-1, $GUI_DOCKBORDERS) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

GUISetState()

$iCurr_Width = 0

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch

    $aGUI_Pos = WinGetPos($hGUI)
    $aPic_Pos = WinGetPos(GUICtrlGetHandle($hPic))
    If $aGUI_Pos[2] <> $iCurr_Width Then
        $iCurr_Width = $aGUI_Pos[2]
        $sLabel = "GUI Size: " & $aGUI_Pos[2] & " x " & $aGUI_Pos[3] & @CRLF & "Pic size: " & $aPic_Pos[2] & " x " & $aPic_Pos[3]
        GUICtrlSetData($hLabel, $sLabel)
    EndIf

WEnd

Sinon, envoie-moi un PM en francais - il faut pas utiliser trop de langue étrangere ici. ;)

For non-francophones: If not, send a PM in French so as not to clutter up the forums.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

#Include<GUIConstantsEx.au3>
#Include<WindowsConstants.au3>

$fFullScreen = False

$hGUI = GUICreate ("test", 500, 500, -1, -1)

$hBtn = GUICtrlCreateButton ("Click me!!", 20, 20, 200, 200)
   GUICtrlSetResizing (-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)

GUISetState ()

While 1
   Switch GUIGetMsg ()
      Case -3
         Exit
      Case $hBtn
         If $fFullScreen Then
            WinMove ($hGUI, "", (@DesktopWidth - 500) / 2, (@DesktopHeight - 500) / 2, 500, 500)
            GUISetStyle ($GUI_SS_DEFAULT_GUI, 0)
         Else
            WinMove ($hGUI, "", 0, 0, @DesktopWidth, @DesktopHeight)
            GUISetStyle (BitAND ($WS_POPUPWINDOW, $WS_SYSMENU))
         EndIf
         $fFullScreen = Not $fFullScreen
   EndSwitch
WEnd

See the line with GUICtrlSetResizing? Thats what decides how the button is redrawn when the window is resized. The helpfile has a lot of... Helpful ... info on that :)

Mat

Edit: There are also the French autoit forums somewhere... Can't find the link atm.

Edited by Mat

Share this post


Link to post
Share on other sites

$WS_OVERLAPPEDWINDOW gui style with Melba23's example would be a killer.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

What the op wanted was something that keeps the picture in proprtion and I don't see how the examples so far do that. I might be wrong but just in case here is what I think is needed.

#include <GUIConstants.au3>
#include <windowsconstants.au3>
Global $GUISize[2] = [550, 300]
Global $k;if true set the width by ht else set ht by width
$wayset = False ;we haven't decided which way were're resizing by
$Parent = GUICreate("My Proportional GUI", $GUISize[0], $GUISize[1], -1, -1, $WS_SIZEBOX + $WS_SYSMENU + $WS_MAXIMIZEBOX)
GUICtrlCreateButton("I'm a button!", 100, 100, 200, 100)
GUICtrlSetResizing(-1, 1)
GUICtrlCreateButton("So am I!", 350, 100, 50, 100);or a pic etc
GUICtrlSetResizing(-1, 1)
Const $WM_EXITSIZEMOVE = 0x232
Const $WM_ENTERSIZEMOVE = 0x231

GUISetState()
Global $Pos1 = WinGetPos($Parent)
GUIRegisterMsg($WM_GETMINMAXINFO, "StayProportional")
GUIRegisterMsg($WM_EXITSIZEMOVE, "Setway")

Do
    Sleep(15)
Until GUIGetMsg() = -3


Func StayProportional($hWnd, $Msg, $wParam, $lParam)
    
    
    If $hWnd <> $Parent Then Return
    $minmaxinfo = DllStructCreate("int;int;int;int;int;int;int;int;int;int", $lParam)
    Local $_pos = WinGetPos($Parent)
    If Not $wayset Then
        If $_pos[2] <> $Pos1[2] Then
            $k = False
            $wayset = True
        EndIf
    
        If $_pos[3] <> $Pos1[3] Then
            $k = True;we set the width according to the ht
            $wayset = True
        EndIf
    EndIf
    
    If Not $wayset Then;allow width and ht to change
        DllStructSetData($minmaxinfo, 8, 0)
        DllStructSetData($minmaxinfo, 10, @DesktopHeight)
        DllStructSetData($minmaxinfo, 7, 0)
        DllStructSetData($minmaxinfo, 9, @DesktopWidth)
    Else
        If $k Then;set wid
            DllStructSetData($minmaxinfo, 7, $_pos[3] * ($GUISize[0] / $GUISize[1]))
            DllStructSetData($minmaxinfo, 9, $_pos[3] * ($GUISize[0] / $GUISize[1]))
        Else
            DllStructSetData($minmaxinfo, 8, $_pos[2] * ($GUISize[1] / $GUISize[0]))
            DllStructSetData($minmaxinfo, 10, $_pos[2] * ($GUISize[1] / $GUISize[0]))
        EndIf
    EndIf
    Return 0
EndFunc ;==>StayProportional


Func SetWay()
    $wayset = False
    $k = False
    $Pos1 = WinGetPos($Parent)
EndFunc ;==>SetWay
Edited by martin

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.

Share this post


Link to post
Share on other sites

@Mat

For future reference

http://www.autoit.fr/

Also I have the links to the other non-English forums on my web site (sig) under Other AutoIt Sites.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

@Mat

For future reference

http://www.autoit.fr/

Also I have the links to the other non-English forums on my web site (sig) under Other AutoIt Sites.

Knew it was something like that.

Incidentally,

http://www.autoit.fr/forum/

http://www.autoitScript.fr/forum/

point to the same place :) (With a very nice clock)

Mat

Share this post


Link to post
Share on other sites

Knew it was something like that.

Incidentally,

http://www.autoit.fr/forum/

http://www.autoitScript.fr/forum/

point to the same place :) (With a very nice clock)

Mat

Good info and I'll work it into the site the next time I'm working on the toc.

I need to get in touch with all the people running the other forums anyway so I can change my online docs to multi-language.

And now we return you to our regularly scheduled thread topic.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

Thanks all, It's perfect :)


======> Tomy ... just for fun ;) <======

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