Modify

Opened 3 months ago

Last modified 2 months ago

#3830 assigned Bug

GUICtrlSetResizing and fullscreen mode

Reported by: kAnon Owned by: Jpm
Milestone: Component: AutoIt
Version: 3.3.14.5 Severity: None
Keywords: Cc:

Description

$GUI_DOCKBOTTOM doesn't work correctly when switching fullscreen mode.

#include <GUIConstants.au3>

test()

Func test()
    GUICreate('', 400, 400, -1, -1, -1, $WS_EX_WINDOWEDGE)
    Local $idButton_Fullscreen = GUICtrlCreateButton("Fullscreen", 20, 340, 360, 40)
    GUICtrlSetResizing(-1, BitOR($GUI_DOCKBOTTOM, $GUI_DOCKHCENTER, $GUI_DOCKSIZE))
    GUISetState()

    While True
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
            Case $idButton_Fullscreen
                fullscreen()
        EndSwitch
    WEnd
EndFunc   ;==>test

Func fullscreen()
    Local $aStyles = GUIGetStyle()
    If BitAND($aStyles[0], $WS_CAPTION) Then
        GUISetStyle($WS_POPUP, 0)
        GUISetState(@SW_MAXIMIZE)
    Else
        GUISetState(@SW_RESTORE)
        GUISetStyle($GUI_SS_DEFAULT_GUI, $WS_EX_WINDOWEDGE)
    EndIf
EndFunc   ;==>fullscreen

Windows 10 Pro 21H1 x64
AutoIt Version: 3.3.14.5 / 3.3.15.4

Attachments (0)

Change History (5)

comment:2 Changed 2 months ago by Jpm

  • Owner set to Jpm
  • Status changed from new to assigned

In fact if you use Maximised stated it works
Any I did a small improvement for your test not using Extendedstyle = 0 which does not make sense to me.

I sent the fix to Jon

#include <AutoItConstants.au3>
#include <GUIConstants.au3>

Global $g_hGui
test()

Func test()
	$g_hGui = GUICreate('', 400, 400, -1, -1, $WS_OVERLAPPEDWINDOW)
    Local $idButton_maximize = GUICtrlCreateButton("toggle maximize", 20, 280, 360, 40)
    GUICtrlSetResizing(-1, BitOR($GUI_DOCKBOTTOM, $GUI_DOCKHCENTER, $GUI_DOCKSIZE))
    Local $idButton_fullscreen = GUICtrlCreateButton("toggle fullscreen", 20, 340, 360, 40)
    GUICtrlSetResizing(-1, BitOR($GUI_DOCKBOTTOM, $GUI_DOCKHCENTER, $GUI_DOCKSIZE))
    GUISetState()

    While True
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
            Case $idButton_fullscreen
                fullscreen()
            Case $idButton_maximize
                toggle_maximize()
        EndSwitch
    WEnd
EndFunc   ;==>test

Func fullscreen()
    Local $aStyles = GUIGetStyle()
    If BitAND($aStyles[0], $WS_CAPTION) Then
        GUISetStyle($WS_POPUP)
        GUISetState(@SW_MAXIMIZE)
    Else
        GUISetState(@SW_RESTORE)
        GUISetStyle($WS_OVERLAPPEDWINDOW)
    EndIf
EndFunc   ;==>fullscreen

Func toggle_maximize()
		If BitAND(WinGetState($g_hGui, ""), $WIN_STATE_MAXIMIZED) Then
			GUISetState(@SW_RESTORE)
		Else
			GUISetState(@SW_MAXIMIZE)
		EndIf
EndFunc   ;==>toggle_maximize

comment:3 Changed 2 months ago by kAnon

I don’t know English and almost don’t understand you (even with Google Translate), but with the extended style in full screen mode, the client area is calculated incorrectly

#include <AutoItConstants.au3>
#include <GUIConstants.au3>

Global $g_hGui
test()

Func test()
        $g_hGui = GUICreate('', 400, 400, -1, -1, $WS_OVERLAPPEDWINDOW)
        Local $idButton_maximize = GUICtrlCreateButton("toggle maximize", 20, 280, 360, 40)
        GUICtrlSetResizing(-1, BitOR($GUI_DOCKBOTTOM, $GUI_DOCKHCENTER, $GUI_DOCKSIZE))
        Local $idButton_fullscreen = GUICtrlCreateButton("toggle fullscreen", 20, 360, 360, 40)
        GUICtrlSetResizing(-1, BitOR($GUI_DOCKBOTTOM, $GUI_DOCKHCENTER, $GUI_DOCKSIZE))
        GUISetState()

        While True
                Switch GUIGetMsg()
                        Case $GUI_EVENT_CLOSE
                                ExitLoop
                        Case $idButton_fullscreen
                                fullscreen()
                        Case $idButton_maximize
                                toggle_maximize()
                EndSwitch
        WEnd
EndFunc   ;==>test

Func fullscreen()
        Local $aStyles = GUIGetStyle()
        If BitAND($aStyles[0], $WS_CAPTION) Then
                GUISetStyle($WS_POPUP)
                GUISetState(@SW_MAXIMIZE)
        Else
                GUISetState(@SW_RESTORE)
                GUISetStyle($WS_OVERLAPPEDWINDOW)
        EndIf
EndFunc   ;==>fullscreen

Func toggle_maximize()
        If BitAND(WinGetState($g_hGui, ""), $WIN_STATE_MAXIMIZED) Then
                GUISetState(@SW_RESTORE)
        Else
                GUISetState(@SW_MAXIMIZE)
        EndIf
EndFunc   ;==>toggle_maximize

comment:5 Changed 2 months ago by kAnon

still strange behavior

#include <GUIConstants.au3>

test()

Func test()
    GUICreate('', 400, 400, -1, -1, $WS_OVERLAPPEDWINDOW)
    Local $idButton_ToggleFrame = GUICtrlCreateButton('Toggle Frame', 20, 360, 360, 40)
    GUICtrlSetResizing(-1, BitOR($GUI_DOCKBOTTOM, $GUI_DOCKHCENTER, $GUI_DOCKSIZE))
    GUISetState()

    While True
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
            Case $idButton_ToggleFrame
                toggleFrame()
        EndSwitch
    WEnd
EndFunc   ;==>test

Func toggleFrame()
    Local $aStyle = GUIGetStyle()
    If BitAND($aStyle[1], $WS_EX_WINDOWEDGE) Then
;~      GUISetStyle($WS_POPUPWINDOW, 0) ; not responding
        GUISetStyle($WS_POPUP) ;  work
    Else
        GUISetStyle($GUI_SS_DEFAULT_GUI, $WS_EX_WINDOWEDGE)
    EndIf
EndFunc   ;==>toggleFrame

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as assigned The owner will remain Jpm.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.