Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Thu Dec 14, 2017 5:56 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Changng rotated text
PostPosted: Wed Feb 20, 2013 3:03 am 
Offline

Joined: Thu Jul 28, 2011 2:45 am
Posts: 32
I have produced an engineering program with a graph in a canvas. For the Y-axis of the I have rotated the text using the 2D Group method. I want to change the text when I change content of a pop-up menu. When I run the program, the text is changed but it just writes over the previous text. I need to somehow erase the old text before writing over it. Can anybody help. My present code is as follows:

Dim s as new stringshape
Dim d as New Group2D

s.textsize = 12
s.textfont = "system"

If Win1.Popup.text="niobium" then
s.text = "wt % niobium"
elseif Win1.popup.text="vanadium" then
s.text = "wt % vanadium"
elseif Win1.popup.text="titanium" then
s.text = "wt % titanium"
End if
s.rotation =-3.1415926535897931/2
d.append s

Winmultiple.Graphics.drawobject d, 50, 405

I have placed the code in the change event of the popup control.


Regards,
Ozzy


Top
 Profile  
Reply with quote  
 Post subject: Re: Changng rotated text
PostPosted: Wed Feb 20, 2013 9:32 am 
Offline

Joined: Mon May 30, 2011 12:56 am
Posts: 702
Make the object (d) and the stringshape, a property of the window.

When the contents change, set the stringshape to nil, then create a new stringobject.


Do not call Winmultiple.Graphics.drawobject d, 50, 405


but instead invalidate WinMultiple
And call

g.drawobject d, 50, 405 in the Window's Paint event.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours


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

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group