Modify

Opened 15 years ago

Closed 14 years ago

#1803 closed Bug (Rejected)

GuiRichEdit Zoom Set

Reported by: luc.leveque@… Owned by: Gary
Milestone: Component: Standard UDFs
Version: 3.3.6.1 Severity: None
Keywords: GuiRichEdit Zoom Set Cc:

Description

_GUICtrlRichEdit_GetZoom

; Remarks .......: MSDN claims that EM_SETZOOM works from 1.56% (1/64) to 6400$ (64/1) but testing shows that
; it only works reliably for the values shown above

FALSE

I send you my proposal for changing the function _GUICtrlRichEdit_GetZoom with an example, who works fine on my computer(values between 2 to 6399). with the code hereafter you can reduce zoom under 100% :

==
#AutoIt3Wrapper_Au3Check_Parameters= -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <GuiRichEdit.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Global $lblMsg, $hRichEdit

Main()

Func Main()

Local $hGui, $iMsg, $btnNext, $iStep = 0
$hGui = GUICreate("Example (" & StringTrimRight(@ScriptName,4) &")", 320, 350, -1, -1)


$hRichEdit = _GUICtrlRichEdit_Create($hGui, "This is a test.", 10, 20, 300, 190, BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL))
$slider = GUICtrlCreateSlider(55, 245, 260, 30)
$lblZoom = GUICtrlCreateLabel("Zoom 100%", 10, 245, 40, 30)


;Zoom
$iZoomFocal = 5 ; possible value between 1, 63.99 : Msoffice value is 4
$iZoomCurrent = 100 ;percent Default Value
$iZoomScaleMax = int($iZoomCurrent * $iZoomFocal);percent
$iZoomScaleMin = 10 ;percent

GUICtrlSetLimit ($slider, $iZoomScaleMax, $iZoomScaleMin)
GUICtrlSetData($slider,$iZoomCurrent)


GUISetState()

Do

$msg = GUIGetMsg()


If $msg = $slider Then

$iZoomCurrent = GUICtrlRead($slider)

GUICtrlRichEdit_SetZoom($hRichEdit, $iZoomCurrent)


GUICtrlSetData($lblZoom, "Zoom : " & $iZoomCurrent & " %" )

EndIf

Until $msg = $GUI_EVENT_CLOSE


EndFunc ;==>Main

Func Report($sMsg)

GUICtrlSetData($lblMsg, $sMsg)

EndFunc ;==>Report

;
;PROPOSAL
;
Func GUICtrlRichEdit_SetZoom($hWnd, $iPercent)

If Not IsHWnd($hWnd) Then Return SetError(101, 0, False)
If Not GCR_IsNumeric($iPercent, ">1") Then Return SetError(1021, 0, False)
If Not
GCR_IsNumeric($iPercent, "<6400") Then Return SetError(1021, 0, False)


Return _SendMessage($hWnd, $EM_SETZOOM, $iPercent, 100) <> 0


EndFunc ;==>_GUICtrlRichEdit_SetZoom

==

Attachments (0)

Change History (2)

comment:1 by RoyGlanfield, 15 years ago

;---this needs to be modified---$r = _GUICtrlRichEdit_SetZoom($hRichEdit, 1/2)--------------

I think the problum may be SendMessage not sending integers
;----- Below works well---but does have to be reset after anything is streamed in------
;----OK--------$r = _SendMessage($h_RichEdit, $EM_SETZOOM, $nominator, $denominator)
;$r = _SendMessage($hRichEdit, $EM_SETZOOM, 1000, 2333)
;--must be integer -- "1000, 2333" not "1, 2.333"
;$r = _SendMessage($hRichEdit, $EM_SETZOOM, 100, 200);-------eg 50%
$r = _SendMessage($hRichEdit, $EM_SETZOOM, 1, 2);-------eg 50%

comment:2 by trancexx, 14 years ago

Resolution: Rejected
Status: newclosed

It's very hard to understand what's this about.

Modify Ticket

Action
as closed The owner will remain Gary.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.