Jump to content
Advert

Recommended Posts

Posted

I have noticed, by default, when you hover over the sizegrip ($SBARS_SIZEGRIP) on the statusbar of a resizable GUI that there is no change in cursor. Generally, it should show the SIZENWSE cursor to indicate that the GUI can be resized from the statusbar gripper.

Below, I will share an example from _GUICtrlStatusBar_Resize. The only change that I made was to add the $SBARS_SIZEGRIP style to _GUICtrlStatusBar_Create() in hopes that it might fix the problem.

It did not fix the problem. I am not sure if this is an AutoIt bug with statusbar or if there is just something that I am missing. Thank you for your time. :)

#include <WindowsStylesConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <WindowsNotifsConstants.au3>

Global $g_hStatus

Example()

Func Example()
    ; Create GUI
    Local $hGUI = GUICreate("StatusBar Resize (v" & @AutoItVersion & ")", 450, 320, -1, -1, $WS_OVERLAPPEDWINDOW)

    ; Set parts
    Local $hStatus = _GUICtrlStatusBar_Create($hGUI, -1, -1, $SBARS_SIZEGRIP)
    $g_hStatus = $hStatus

    Local $aParts[3] = [75, 150, -1]
    _GUICtrlStatusBar_SetParts($hStatus, $aParts)
    _GUICtrlStatusBar_SetText($hStatus, "Part 0")
    _GUICtrlStatusBar_SetText($hStatus, "Part 1", 1)
    _GUICtrlStatusBar_SetText($hStatus, "Part 2", 2)

    GUISetState(@SW_SHOW)

    GUIRegisterMsg($WM_SIZE, "WM_SIZE")

    ; Loop until the user exits.
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()
EndFunc   ;==>Example

; Resize the status bar when GUI size changes
Func WM_SIZE($hWnd, $iMsg, $wParam, $lParam)
    #forceref $hWnd, $iMsg, $wParam, $lParam
    _GUICtrlStatusBar_Resize($g_hStatus)
    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_SIZE

 

Advert
Posted

Interestingly, I seem to get the cursor change when I add $WS_SIZEBOX during *StatusBar_Create().

Local $hStatus = _GUICtrlStatusBar_Create($hGUI, -1, -1, BitOR($SBARS_SIZEGRIP, $WS_SIZEBOX))

However, it causes some visual bugs.

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
×
×
  • Create New...