Modify

Opened 14 years ago

Closed 12 years ago

#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 Changed 14 years ago by TicketCleanup

  • Version 3.3.6.1 deleted

Automatic ticket cleanup.

comment:2 Changed 14 years ago by Spiff59

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 Changed 14 years ago by PsaltyDS

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 Changed 14 years ago by Spiff59

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 Changed 13 years ago by trancexx

  • Component changed from AutoIt to Standard UDFs

comment:6 Changed 12 years ago by Spiff59

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 Changed 12 years ago by trancexx

  • Resolution set to Rejected
  • Status changed from new to closed

Atually I'm bored most of the time.

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.