Modify

#1788 closed Feature Request (Rejected)

_GUICtrlRichEdit_GetMargins and _GUICtrlRichEdit_SetMargins

Reported by: Spiff59 Owned by:
Milestone: Component: Standard UDFs
Version: Severity: None
Keywords: Cc:

Description

I find it difficult to properly format/view/print any generated RTF data without the ability to specify document margins.

The RTF tags \margl, \margr, \margt, and \margb are available for the left, right, top and bottom margins. The value is specified in twips, so a tag to set the left margin to 1 inch would be "\margl1440".

Would you be able to create get/set functions to manage these margin tags?
Thank you.

Attachments (0)

Change History (7)

comment:1 by TicketCleanup, on Oct 14, 2010 at 7:00:03 PM

Version: 3.3.6.1

Automatic ticket cleanup.

comment:2 by Spiff59, on Oct 15, 2010 at 2:37:54 PM

Just a little more ammunition in support of the creation of these two routines. If you search the RTF UDF on the word "margin" you will see there are *MANY* functions that refer to, are based upon, or work in relationship with, the left, or right (or top, or bottom) margins. The inability to modify these margin settings, that so many routines are dependent upon, is a problem worthy of addressing.
Thank you for your time.

comment:3 by PsaltyDS, on Nov 10, 2010 at 8:47:32 PM

You can set margins on a RichEdit with the same message that sets it on a regular Edit: EM_SETMARGIN

Therefore _GuiCtrlEdit_SetMargins() works fine:

#include <GuiRichEdit.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <SendMessage.au3>
#Include <GuiEdit.au3>

Global $hGui, $hRichEdit, $iMsg

$hGui = GUICreate("Example (" & StringTrimRight(@ScriptName, 4) & ")", 320, 350, -1, -1)
$hRichEdit = _GUICtrlRichEdit_Create($hGui, "This is a test.", 10, 10, 300, 220, _
		BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL))
_GUICtrlRichEdit_AppendText($hRichEdit, @CR & "This is more text")
$idButton = GUICtrlCreateButton("MARGIN", 110, 300, 100, 30)
GUISetState()

While True
	Switch GUIGetMsg()
		Case $GUI_EVENT_CLOSE
			_GUICtrlRichEdit_Destroy($hRichEdit)
			Exit
		Case $idButton
			_GUICtrlEdit_SetMargins($hRichEdit, BitOR($EC_LEFTMARGIN, $EC_RIGHTMARGIN), 100, 100)
	EndSwitch
WEnd

comment:4 by Spiff59, on Nov 15, 2010 at 9:01:38 AM

That only affects the margins of the control on-screen.
If you _GUICtrlRichEdit_StreamToFile() the control to an .RTF file, the margins are lost. No \margl or \margr tags are inserted into the resulting file.

comment:5 by trancexx, on May 23, 2012 at 4:22:31 PM

Component: AutoItStandard UDFs

comment:6 by Spiff59, on Aug 11, 2012 at 3:17:34 AM

I personally no longer have any interest in this enhancement. There are tons of inaccessable RTF tags. You guys already have enough to do.

comment:7 by trancexx, on Aug 19, 2012 at 9:30:09 PM

Resolution: Rejected
Status: newclosed

Atually I'm bored most of the time.

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


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