Function Reference


_GUICtrlRichEdit_SetSpaceUnit

Sets the unit of measure of horizontal and vertical space used in parameters of various _GUICtrlRichEdit functions

#include <GuiRichEdit.au3>
_GUICtrlRichEdit_SetSpaceUnit ( $sUnit )

Parameters

$sUnit "in", "cm", "mm", "pt" (points), or "tw" (twips, 1/1440 inches, 1/567 centimeters)

Return Value

Success: True.
Failure: False and sets the @error flag to non-zero.

Remarks

Initially, space is measured in inches.

Related

_GUICtrlRichEdit_GetSpaceUnit, _GUICtrlRichEdit_SetParaBorder, _GUICtrlRichEdit_SetParaIndents, _GUICtrlRichEdit_SetParaNumbering, _GUICtrlRichEdit_SetParaSpacing, _GUICtrlRichEdit_SetParaTabStops, _GUICtrlRichEdit_SetTabStops

Example

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

Global $g_idLblMsg

Example()

Func Example()
        Local $hGui = GUICreate("RichEdit Get/Set SpaceUnit (v" & @AutoItVersion & ")", 360, 350, -1, -1)
        Local $hRichEdit = _GUICtrlRichEdit_Create($hGui, "This is a test.", 10, 10, 340, 220, _
                        BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL))
        $g_idLblMsg = GUICtrlCreateLabel("", 10, 235, 300, 60)
        Local $idBtnNext = GUICtrlCreateButton("Next", 270, 310, 40, 30)
        GUISetState(@SW_SHOW)

        _GUICtrlRichEdit_SetText($hRichEdit, "Paragraph 1")
        Local $iMsg, $iStep = 0
        While True
                $iMsg = GUIGetMsg()
                Select
                        Case $iMsg = $GUI_EVENT_CLOSE
                                _GUICtrlRichEdit_Destroy($hRichEdit) ; needed unless script crashes
                                ; GUIDelete()   ; is OK too
                                Exit
                        Case $iMsg = $idBtnNext
                                $iStep += 1
                                Switch $iStep
                                        Case 1
                                                Report("1. Initial setting")
                                        Case 2
                                                _GUICtrlRichEdit_SetSpaceUnit("cm")
                                                Report("2. Setting is now")
                                                GUICtrlSetState($idBtnNext, $GUI_DISABLE)
                                EndSwitch
                EndSelect
        WEnd
EndFunc   ;==>Example

Func Report($sMsg)
        $sMsg = $sMsg & @CRLF & _GUICtrlRichEdit_GetSpaceUnit()
        GUICtrlSetData($g_idLblMsg, $sMsg)
EndFunc   ;==>Report