home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / apple2 / 25335 < prev    next >
Encoding:
Internet Message Format  |  1992-12-11  |  2.6 KB

  1. Path: sparky!uunet!gatech!europa.asd.contel.com!emory!wupost!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!ucbvax!CU.NIH.GOV!JDA
  2. From: JDA@CU.NIH.GOV ("Doug Ashbrook")
  3. Newsgroups: comp.sys.apple2
  4. Subject: Need help with ParamText routine
  5. Message-ID: <9212111838.AA09948@apple.com>
  6. Date: 11 Dec 92 18:32:32 GMT
  7. Sender: daemon@ucbvax.BERKELEY.EDU
  8. Distribution: world
  9. Organization: The Internet
  10. Lines: 60
  11.  
  12. On page 229 of the ByteWork's "Programming the Toolbox in Pascal"
  13. tutorial it states:
  14.  
  15.      "Setting bit 1 of the flag word tells the Control Manager to
  16.      perform text substitution.  This lets you substitute text in a
  17.      static text string, more or less like you did in an alert
  18.      window."
  19.  
  20. I have been attempting to do this but have been unsuccessful in
  21. everything I have tried so far.  I found the ParamText toolbox
  22. routine in volume 1 of the Toolbox Reference Manual and I assume that
  23. this is the routine that I need to use.  My static text gets drawn,
  24. but there appears to be garbage where the substitute text should
  25. appear.  In addition to the code shown below, I have tried calls such
  26. as the following, but none work:
  27.  
  28.    ParamText(strPtr, nil, nil, nil);
  29.    ParamText(@'Output', nil, nil, nil);
  30.  
  31. Here is a portion of my Pascal source (I am using ORCA/Pascal
  32. version 1.4):
  33.  
  34.    var
  35.       str: pString;
  36.       strPtr: pStringPtr;
  37.  
  38.    begin {InitWindow}
  39.    str := 'Input';
  40.    strPtr := @str;
  41.    ParamText(pointer(ord4(strPtr)), nil, nil, nil);
  42.    wPtr := NewWindow2(nil, 0, @DrawContents, nil, $02,
  43.                status, rWindParam1);
  44.    end; {InitWindow}
  45.  
  46. And here is the Rez source for the template for the static text
  47. control:
  48.  
  49. resource rControlTemplate (statInput) {
  50.    statInput,                           /* control ID */
  51.    {5,15,16,500},                       /* control rect */
  52.    statTextControl {{
  53.       $0002,                            /* flags */
  54.       $1002,                            /* more flags */
  55.       0,                                /* refcon */
  56.       statInput+status                  /* Title Ref */
  57.       }};
  58.    };
  59. resource rTextForLETextBox2 (statInput+status) {"Input File:  *0"};
  60.  
  61.  
  62. Please note that the curly brackets probably will not survive the
  63. translation from my EBCDIC IBM mainframe through the mostly ASCII
  64. network.  Can you please shed some light on what I am doing wrong?
  65. Or at least point me in the right direction.  Thanks.
  66.  
  67. ====================================================================
  68. J. Douglas Ashbrook                                   (301) 402-1248
  69. INTERNET: JDA@CU.NIH.GOV                           BITNET: JDA@NIHCU
  70. National Institutes of Health, Computer Center,   Bethesda, MD 20892
  71.  
  72.