Jump to content
Sign in to follow this  
E1M1

How to auto resize scite?

Recommended Posts

E1M1

How to auto resize scite? I used UDF to create window with scite, but i cant find way to resize it.

link to udf & example

I have tried GUICtrlSetResizing but it didn't work.


edited

Share this post


Link to post
Share on other sites
E1M1

WinMove resizes window not Scintilla (this is that rich text control that highlights words, it's not a window)

sorry for being not cear in my 1st post.


edited

Share this post


Link to post
Share on other sites
dani

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

Share this post


Link to post
Share on other sites
E1M1

only controlmove() can resize it, but now question: how to call controlmove() every time window size changes?


edited

Share this post


Link to post
Share on other sites
dani

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.

Share this post


Link to post
Share on other sites
Mat

#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

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.