Guidance
指路人
g.yi.org
Guidance Forums / Rapid-Q Basic / TextOut

Register 
新用户注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. TextOut
#5287
Posted by: 2004-10-21 23:28:35
I am very new to RapidQ, and, having started using it right after the basicguru site ceased to exist, I'm having some trouble finding good reference sites.  So here's my question: Could someone give me a working code example using QForm's textOut method?  If you find it annoying that I am asking such a simple question, feel free to give me a link to a good reference site also.
Message2. Re: TextOut
#5288
Posted by: 2004-10-22 04:15:46
TextOut is used to put text in graphics areas, so first make a graphics area;

 DIM Image1 AS QCANVAS
 Image1.PARENT = form
 Image1.Left = 1
 Image1.Top = 1
 Image1.Width = 300
 Image1.Height = 300
 Image1.OnPaint = Image1.Paint

after the Form.ShowModal add a routine;

 SUB Image1.paint
  d$="whatever"
  fntclr = &h503030 : 'blue
  bckclr = &hffffff : 'white
  Image1.TextOut (20,20,d$,fntclr,bckclr)
 END SUB

that's all really .....
Message3. Re: TextOut
#5289
Posted by: 2004-10-22 11:17:58
Thanks so much for your help, Baardaap.  Now that I know about QCanvases, I'm wondering how I can pass variables (directly or indirectly) to textOut.  What I mean is that somehow, whenever I call repaint I can control, for example, what textOut displays or where the text is, etc.  I tried something like this:

 ...
 Form.SHOWMODAL

 DIM stuff AS STRING

 SUB textArea.paint 'my QCanvas event sub
  textArea.textOut(15, 10, stuff, &hffffff, -1)
 END SUB

 ...

 stuff = "hello world"
 textArea.repaint

...but it fails to display anything at all and generates an error upon the call of repaint.  What should I do?
Message4. Re: TextOut
#5291
Posted by: guidance 2004-10-22 11:54:46
Check here:
http://g.yi.org/Software/RQ%20Intro/Tips/#textout
Message5. Re: TextOut
#5322
Posted by: 2004-10-30 05:51:27
do the "stuff" before the ShowModal; just use a line like

Stuff$="my message"

this makes Stuff$ a global string variable.
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Wed 2017-11-22  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0