home *** CD-ROM | disk | FTP | other *** search
/ Studylink Australia 1999…ovember (Revised Edition) / STUDYLINK.ISO / mac / Proj / p5Print-preview.cst / 00002_PrintListCourse.ls < prev    next >
Encoding:
Text File  |  1999-11-17  |  2.0 KB  |  106 lines

  1. on mouseUp 
  2.   
  3.   global gSRCH_userFoundCount
  4.   if gSRCH_userFoundCount = 0 then
  5.     exit    
  6.   end if
  7.   
  8.   
  9.   PrintInstDetails
  10. end
  11.  
  12. on PrintInstDetails  
  13.   
  14.   set doc  = createXtraInstance()
  15.   if not objectP(doc) then exit
  16.   
  17.   SetDocumentAttributes doc
  18.   
  19.   AppendHeader doc
  20.   AppendList doc
  21.   AppendFooter doc
  22.   PrintDocument doc
  23.   
  24.   deleteXtraInstance doc  
  25.   
  26. end
  27.  
  28. on AppendHeader doc
  29.   append doc, member "List of Courses Print Heading"  
  30.   --
  31.   -- INSTITUTE name
  32.   setTextFont doc, "Arial" 
  33.   setTextSize doc, 14 
  34.   setTextStyle doc, "bold"
  35.   --append doc, the text of member "InstName" 
  36.   append doc, RETURN 
  37.   append doc, RETURN 
  38. end
  39.  
  40. on AppendFooter doc
  41.   append doc, member "visit website graphic"  
  42.   append doc, RETURN  
  43.   setTextFont doc, "Arial"
  44.   setTextSize doc, 10
  45.   setTextStyle doc, "Bold"
  46.   append doc, "For further information please contact an IDP office:"
  47.   append doc, RETURN 
  48.   
  49.   setTextFont doc, "Times New Roman"
  50.   setTextSize doc, 10
  51.   setTextStyle doc, "normal"
  52.   global IDPoffice
  53.   append doc, IDPoffice
  54.   
  55. end
  56.  
  57. on AppendList doc
  58.   
  59.   
  60.   set tempCount to count(the valueList of Sprite 5 )
  61.   
  62.   set TempInstCode to ""
  63.   
  64.   repeat with i = 1 to tempCount
  65.     set thisname to getAt (the instCodeList of Sprite 5, i)
  66.     
  67.     if TempInstCode <> thisname then
  68.       setTextFont doc, "Arial"
  69.       setTextSize doc, 12
  70.       setTextStyle doc, "bold"
  71.       
  72.       append doc, GEN_GetInstNameFromCode(getAt (the instCodeList of Sprite 5, i)) 
  73.       append doc, RETURN  
  74.       set i = i -1
  75.       
  76.       set TempInstCode to thisname
  77.       setTextFont doc, "Arial"
  78.       setTextSize doc, 10
  79.       setTextStyle doc, "normal"
  80.       
  81.     else
  82.       if TempInstCode = thisname then
  83.         append doc, getAt(the valueList of Sprite 5, i)    
  84.         append doc, RETURN 
  85.       end if 
  86.       
  87.     end if
  88.   end repeat  
  89.   
  90.   append doc, RETURN  
  91.   append doc, RETURN 
  92.   
  93. end
  94.  
  95.  
  96. -- Change document attributes
  97. on SetDocumentAttributes doc
  98.   
  99.   setDocumentName doc, "List of Courses"
  100.   setLandscapeMode doc, FALSE
  101.   setMargins doc, Rect(70,55,70,70)
  102. end
  103.  
  104.  
  105.  
  106.