View previous topic :: View next topic |
Author |
Message |
X-Tools Valued Contributor
Joined: 20 Sep 2001 Posts: 296 Location: Germany
|
Posted: Tue Apr 08, 2003 6:31 am Post subject: Setposition for justified text |
|
|
Hi,
I think it's a bug.
I am trying to set the position of a right-justified text and
after that it becomes left-justified.
Could somebody test it and tell me if you have the same ?
Bye, Fabian |
|
Back to top |
|
|
Serge Professional Member
Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Tue Apr 08, 2003 9:26 am Post subject: |
|
|
i think what might be the problem fabian
make sure that your text box is wide enough ie. wider than the length of your text
for example, the following code works ok for me to have the text right justified
Code: | Title 123
DIALOG CREATE,New Dialog,-1,0,430,241
REM *** Modified by Dialog Designer on 08/04/03 - 19:21 ***
DIALOG ADD,STYLE,STYLE1,,,R,,
DIALOG ADD,TEXT,TEXT1,24,0,400,,TEXT1,,STYLE1
DIALOG SHOW
:Evloop
wait event
goto @event()
:Close
exit |
but the following code doesn't right justify
Code: | Title 123
DIALOG CREATE,New Dialog,-1,0,430,241
REM *** Modified by Dialog Designer on 08/04/03 - 19:21 ***
DIALOG ADD,STYLE,STYLE1,,,R,,
DIALOG ADD,TEXT,TEXT1,24,0,,,TEXT1,,STYLE1
DIALOG SHOW
:Evloop
wait event
goto @event()
:Close
exit |
hope this helps
Serge _________________
|
|
Back to top |
|
|
X-Tools Valued Contributor
Joined: 20 Sep 2001 Posts: 296 Location: Germany
|
Posted: Tue Apr 08, 2003 9:42 am Post subject: Setposition for justified text |
|
|
Hi again, Serge
what I mean is setting the position (on resize).
I want to set it again to the right border of my dialog,
but the position i give as top an left gives the left-justified
position for the text.
At the moment I have to substract the lenght of the text to
set it on the right position.
Bye, Fabian |
|
Back to top |
|
|
Serge Professional Member
Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Tue Apr 08, 2003 9:55 am Post subject: |
|
|
you mean something like this?
Code: | Title 123
DIALOG CREATE,New Dialog,-1,0,430,241
REM *** Modified by Dialog Designer on 08/04/03 - 19:21 ***
DIALOG ADD,STYLE,STYLE1,,,R,,
DIALOG ADD,TEXT,TEXT1,24,0,400,,TEXT1,,STYLE1
DIALOG SHOW
dialog setpos, text1, 100
:Evloop
wait event
goto @event()
:Close
exit
|
Serge _________________
|
|
Back to top |
|
|
X-Tools Valued Contributor
Joined: 20 Sep 2001 Posts: 296 Location: Germany
|
Posted: Tue Apr 08, 2003 10:07 am Post subject: Setposition for justified text |
|
|
Hi Serge,
I tested it
Code: | Title 123
DIALOG CREATE,New Dialog,-1,0,430,241,RESIZABLE
REM *** Modified by Dialog Designer on 08/04/03 - 19:21 ***
DIALOG ADD,STYLE,STYLE1,,,R,,
DIALOG ADD,TEXT,TEXT1,24,@diff(@dlgpos(,w),200),100,,TEXT1,,STYLE1
DIALOG SHOW
DIALOG SET,TEXT1,Hi Serge
:Evloop
wait event
goto @event()
:RESIZE
dialog setpos, text1, 24,@diff(@dlgpos(,w),200)
goto evloop
:Close
exit |
but you're right - it seems to work.
Bye, Fabian |
|
Back to top |
|
|
X-Tools Valued Contributor
Joined: 20 Sep 2001 Posts: 296 Location: Germany
|
Posted: Tue Apr 08, 2003 10:16 am Post subject: Setposition for justified text |
|
|
the error really occurs only, if you dont specify width for the text:
Code: | Title 123
DIALOG CREATE,New Dialog,-1,0,430,241,RESIZABLE
REM *** Modified by Dialog Designer on 08/04/03 - 19:21 ***
DIALOG ADD,STYLE,STYLE1,Arial,24,BR,,
DIALOG ADD,TEXT,TEXT1,24,@diff(@dlgpos(,w),200),,,TEXT1,,STYLE1,TransPARENT
DIALOG SHOW
DIALOG SET,TEXT1,Hi Serge"," its @datetime(hh:nn)
:Evloop
wait event
goto @event()
:RESIZE
dialog setpos, text1, 24,@diff(@dlgpos(,w),200)
goto evloop
:Close
exit |
|
|
Back to top |
|
|
Serge Professional Member
Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Tue Apr 08, 2003 1:07 pm Post subject: |
|
|
you're right about that...if you don't set the width for the text then the text element will only be as wide as the text it contains and hence cannot obe right justified
Serge _________________
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|