May 09, 2024, 01:03:22 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


wrapping text with a static text control

Started by TexasPete, June 07, 2008, 05:19:32 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

TexasPete

I am trying to find a flag command that will wrap long text on the screen . I did not set a flag for doing this in the manual. I assume that I must use multiple stactic controls to get my text on the screen. If this is the case would somebody send me a yes. If I am missing something send me that to.
Thanks Texas Pete

billhsln

Give this a try, from HELP:

@CTEDITMULTI

Designates a multiline edit control. The default is single-line edit control. When the multiline edit control is in a dialog box, the default response to pressing the ENTER key is to activate the default button. To use the ENTER key as a carriage return, use the @CTEDITRETURN style. When the multiline edit control is not in a dialog box and the @CTEDITAUTOV style is specified, the edit control shows as many lines as possible and scrolls vertically when the user presses the ENTER key. If you do not specify @CTEDITAUTOV, the edit control shows as many lines as possible and beeps if the user presses the ENTER key when no more lines can be displayed. If you specify the @CTEDITAUTOH style, the multiline edit control automatically scrolls horizontally when the caret goes past the right edge of the control. To start a new line, the user must press the ENTER key. If you do not specify @CTEDITAUTOH, the control automatically wraps words to the beginning of the next line when necessary. A new line is also started if the user presses the ENTER key. The window size determines the position of the word wrap. If the window size changes, the word wrapping position changes and the text is redisplayed. Multiline edit controls can have scroll bars. An edit control with scroll bars processes its own scroll bar messages. Note that edit controls without scroll bars scroll as described in the previous paragraphs and process any scroll messages sent by the parent window.

I have seen @CT stuff on STATIC controls, maybe this will do what you are looking for.

Bill
When all else fails, get a bigger hammer.

peterpuk

Pete,
I think if you just make the Static Control height enough to fit the number of lines you need (about 100 will fit 6 lines), it will wrap automatically. The sytle flag SS_LEFT (use CONST SS_LEFT = 0x0) says that text is left aligned and will wrap.

EG.
CONTROL w1,@STATIC,"",10,50,180,100,SS_LEFT ,2

If you want to force new lines in the Static Control, use \n in the string.

EG
SETCONTROLTEXT w1,2,"This is the first line of text which exceed the length of the static control.\nThis is the next line."



Peter

TexasPete

Dear Peter,

Thanks alot. Used the ss_left and it did exactly, what It was supposed to. I assume that SS_left was not predefned. I tried it both ways. When I defined it the command worked just fine.