Jump to content

Set Margins for One line in Edit


Madza91
 Share

Recommended Posts

Hello, i want to know is it possible to set margins for only one line - not for whole edit?

[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Link to comment
Share on other sites

That is for whole edit, i need to set margins for one line...

[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Link to comment
Share on other sites

I know for that, but it's too big (Tab) : )))

PS. I need this for RichEdit, but almost all edit funcions works for it... maybe is not possible in edit to set margins for one line, but is it possible to do that in RichEdit?!

Edited by n3nE

[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Link to comment
Share on other sites

I know for that, but it's too big (Tab) : )))

PS. I need this for RichEdit, but almost all edit funcions works for it... maybe is not possible in edit to set margins for one line, but is it possible to do that in RichEdit?!

If @TAB is too big, why not just add as many " " or CHR(32) (spaces) to the front of your line as you need/want?
Link to comment
Share on other sites

I know for that, but it's too big (Tab) : )))

PS. I need this for RichEdit, but almost all edit funcions works for it... maybe is not possible in edit to set margins for one line, but is it possible to do that in RichEdit?!

$Txt = _SetMarginLeft() & "This is some text."

Func _SetMarginLeft($iLevel = 3)
   Local $sRtn = ""
   For $i = 1 to $iLevel
      $sRtn &+ Chr(32)
   Next
   Return $sRtn
EndFunc

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

I forgot to tell you, i can't add spaces or Tab because is dynamic text, edit is Resizeable and if I add spaces when resize Edit that spaces will not be on start of line... only way is to set margins, wright? ^^

[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Link to comment
Share on other sites

I forgot to tell you, i can't add spaces or Tab because is dynamic text, edit is Resizeable and if I add spaces when resize Edit that spaces will not be on start of line... only way is to set margins, wright? ^^

The function will assume that you are adding the spaces at the beginning of a new line and if that's the case then resizing shouldn't make any difference. New lines will still be starting at the left (or right for RTL text).

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Of new line yes, but i have One line with word wrap, and that will be in more than 1 one line... you understand now?

[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Link to comment
Share on other sites

Of new line yes, but i have One line with word wrap, and that will be in more than 1 one line... you understand now?

Don't see where that will make a difference. Word-wrap is not the beginning of a new line. Have you bothered to try it yet?

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

...Word-wrap is not the beginning of a new line...

Exactly... if add "Tab" in my text (one proposition with word wrap) on 2nd line and improve Edit what I get? One line with tab ^^...

If u don't understand me look this demo script:

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("Form1", 300, 161, -1, -1, BitOR($WS_MAXIMIZEBOX,$WS_MINIMIZEBOX,$WS_SYSMENU,$WS_CAPTION,$WS_POPUP,$WS_POPUPWINDOW,$WS_GROUP,$WS_TABSTOP,$WS_BORDER,$WS_CLIPSIBLINGS))
$Edit1 = GUICtrlCreateEdit("", 8, 8, 281, 113, BitOR($ES_AUTOVSCROLL,$ES_WANTRETURN,$WS_VSCROLL))
GUICtrlSetData(-1, "Teeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee      eeeeeeeeeeeee eeeeeeeeeeeeeeeeeee eeeeeeeeeeeeeeeext")
$Button1 = GUICtrlCreateButton("Click Maximize!", 8, 128, 283, 25, 0)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Link to comment
Share on other sites

I can't test on this system without instaling AutoIt and that's not happening so it wll have to wait until I'm on the other system Judging from your code thou I get the feeling that you are attempting to indent at the wrap point and not at the beginning of the text. AFAIK that will not be possible unless you can first determine where the wrap point will be.

Edit: Removed bad idea

Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...