Tomy46 Posted November 29, 2009 Share Posted November 29, 2009 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 <====== Link to comment Share on other sites More sharing options...
KaFu Posted November 29, 2009 Share Posted November 29, 2009 Take a look at the GUICtrlSetResizing(). OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Tomy46 Posted November 29, 2009 Author Share Posted November 29, 2009 (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 November 29, 2009 by Tomy46 ======> Tomy ... just for fun <====== Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 29, 2009 Moderators Share Posted November 29, 2009 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 WEndSinon, 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 Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Mat Posted November 29, 2009 Share Posted November 29, 2009 (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 November 29, 2009 by Mat AutoIt Project Listing Link to comment Share on other sites More sharing options...
trancexx Posted November 29, 2009 Share Posted November 29, 2009 $WS_OVERLAPPEDWINDOW gui style with Melba23's example would be a killer. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
martin Posted November 29, 2009 Share Posted November 29, 2009 (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. expandcollapse popup#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 November 29, 2009 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. Link to comment Share on other sites More sharing options...
GEOSoft Posted November 29, 2009 Share Posted November 29, 2009 @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!" Link to comment Share on other sites More sharing options...
Mat Posted November 29, 2009 Share Posted November 29, 2009 @MatFor future referencehttp://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 AutoIt Project Listing Link to comment Share on other sites More sharing options...
GEOSoft Posted November 29, 2009 Share Posted November 29, 2009 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)MatGood 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!" Link to comment Share on other sites More sharing options...
Tomy46 Posted November 29, 2009 Author Share Posted November 29, 2009 Thanks all, It's perfect ======> Tomy ... just for fun <====== Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now