Jump to content

How to auto resize scite?


E1M1
 Share

Recommended Posts

Ah ok, my bad too I guess. Well I don't know if it behaves like other controls, but regular controls can be resized using a similar function: GUICtrlSetPos.

GUICtrlSetResizing only specifies how a control will be resized when the window that contains the control is resized. It does not by itself resize the control.

Edited by dani
Link to comment
Share on other sites

It's probably something regarding Window Messages or equivalent, unfortunately I have no knowledge on that subject :mellow: You can try searching the forums, or perhaps someone will read this who does know how that works.

Link to comment
Share on other sites

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

Global $hGui, $hRichEdit

Main()

Func Main()
    $hGui = GUICreate("Example WM_SIZE", 320, 350, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX))
    $hRichEdit = _GUICtrlRichEdit_Create($hGui, "This is a test.", 10, 10, 300, 330)

    GUISetState()

    Local $aPos
    While 1
        Switch GUIGetMsg()
            Case -3
                _GUICtrlRichEdit_Destroy($hRichEdit)
                Exit
            Case $GUI_EVENT_RESIZED
                $aPos = WinGetClientSize($hGui)
                ControlMove($hGui, "", $hRichEdit, 10, 10, $aPos[0] - 20, $aPos[1] - 20)
        EndSwitch
    WEnd
EndFunc   ;==>Main

or with messages:

#include <GuiRichEdit.au3>
#include <WindowsConstants.au3>

Global $hGui, $hRichEdit

Main()

Func Main()
    $hGui = GUICreate("Example WM_SIZE", 320, 350, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX))
    $hRichEdit = _GUICtrlRichEdit_Create($hGui, "This is a test.", 10, 10, 300, 330)

    GUIRegisterMsg($WM_SIZE, "WM_SIZE")
    GUISetState()

    While 1
        Switch GUIGetMsg()
            Case -3
                _GUICtrlRichEdit_Destroy($hRichEdit)
                Exit
        EndSwitch
    WEnd
EndFunc   ;==>Main

Func WM_SIZE($hWnd, $iMsg, $wParam, $lParam)
    #forceref $hWnd, $iMsg, $wParam, $lParam
    Local $aPos = WinGetClientSize($hGui)
    ControlMove($hGui, "", $hRichEdit, 10, 10, $aPos[0] - 20, $aPos[1] - 20)
EndFunc
Edited by Mat
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...