home *** CD-ROM | disk | FTP | other *** search
/ PC Direkt 1998 #11 / PCDIREKT_1198.bin / SHOWDATA / ECKESHOP.DXR / 00151_print2.ls < prev    next >
Encoding:
Text File  |  1998-03-20  |  3.6 KB  |  120 lines

  1. global gPrintText
  2.  
  3. on printit_xobject
  4.   global printer, gpropfont, gmonofont, gxobjfile, Xtrapath, sharedPath
  5.   if not objectp(printer) then
  6.     alert("There is no currently selected printer. Printing features are disabled.")
  7.   else
  8.     cursor(4)
  9.     if the platform contains "mac" then
  10.       set bild1 to "bestell1.pct"
  11.       set bild2 to "bestell2.pct"
  12.     else
  13.       set bild1 to "bestell1.bmp"
  14.       set bild2 to "bestell2.bmp"
  15.     end if
  16.     printer(mreset)
  17.     printer(msetdocumentname, "AOL-Shop")
  18.     printer(msetmargins, 20, 48, 20, 40)
  19.     printer(mnewpage)
  20.     printer(mpicture, sharedPath & bild1, 0, 0)
  21.     printer(msettextfont, gmonofont)
  22.     printer(msettextsize, 10)
  23.     printer(msettextstyle, "mormal")
  24.     printer(msettextjust, "left")
  25.     printer(mtextbox, 60, 220, printer(mgetpaperwidth), 415, 0)
  26.     printer(mSetText, gPrintText)
  27.     printer(mpicture, sharedPath & bild2, 0, printer(mGetPaperHeight) / 2)
  28.     cursor(-1)
  29.     if printer(mdojobsetup) = 1 then
  30.       updateStage()
  31.       printer(mprint)
  32.     end if
  33.   end if
  34.   if objectp(printer) then
  35.     printer(mdispose)
  36.   end if
  37.   closeXLib(Xtrapath & gxobjfile)
  38. end
  39.  
  40. on fieldmani
  41.   set gPrintText to EMPTY & RETURN
  42.   leftText("Anz", 5, " ")
  43.   leftText("Produkt", 51, " ")
  44.   leftText("Einzel", 8, " ")
  45.   leftText("Gesamt", 8, " ")
  46.   leftText(RETURN, 0, EMPTY)
  47.   leftText(EMPTY, 70, "_")
  48.   leftText(RETURN, 0, EMPTY)
  49.   repeat with i = 1 to the number of lines in field "Name2" - 1
  50.     rightText(line i of field "Anzahl2", 3, " ")
  51.     leftText(EMPTY, 2, " ")
  52.     leftText(line i of field "Name2", 51, ".")
  53.     rightText(line i of field "EPreis2", 6, ".")
  54.     rightText(line i of field "GPreis2", 8, " ")
  55.     leftText(RETURN, 0, EMPTY)
  56.   end repeat
  57.   leftText(EMPTY, 70, "_")
  58.   leftText(RETURN, 0, EMPTY)
  59.   rightText(the text of field "summe", 70, " ")
  60.   leftText(RETURN, 0, EMPTY)
  61.   rightText("Versandkostenpauschale:    6.95", 70, " ")
  62.   leftText(RETURN, 0, EMPTY)
  63.   rightText("_______", 70, " ")
  64.   leftText(RETURN, 0, EMPTY)
  65.   rightText("Summe:", 62, " ")
  66.   rightText(chckStr(float(value(field "summe")) + 6.95000000000000018), 8, " ")
  67.   return gPrintText
  68. end
  69.  
  70. on chckStr fl
  71.   set i to integer(fl)
  72.   if float(i) > fl then
  73.     set i to i - 1
  74.   end if
  75.   set fract to integer((fl - float(i)) * 100.0)
  76.   if fract < 10 then
  77.     set frstr to "0" & string(fract)
  78.   else
  79.     set frstr to string(fract)
  80.   end if
  81.   return string(i) & "." & frstr
  82. end
  83.  
  84. on leftText T, n, c
  85.   set gPrintText to gPrintText & char 1 to n of T
  86.   set m to n - length(T)
  87.   if m > 0 then
  88.     repeat with i = 1 to m
  89.       set gPrintText to gPrintText & c
  90.     end repeat
  91.   end if
  92. end
  93.  
  94. on rightText T, n, c
  95.   set m to n - length(T)
  96.   if m > 0 then
  97.     repeat with i = 1 to m
  98.       set gPrintText to gPrintText & c
  99.     end repeat
  100.   end if
  101.   set gPrintText to gPrintText & char 1 to n of T
  102. end
  103.  
  104. on oldfieldmani
  105.   set the text of member "Anzahl3" to "Anzahl" & RETURN & the text of field "Anzahl2"
  106.   set the textSize of member "Anzahl3" to 10
  107.   set the textSize of line 1 of member "Anzahl3" to 14
  108.   set the text of member "Name3" to "Produkt" & RETURN & the text of field "Name2"
  109.   set the textSize of member "Name3" to 10
  110.   set the textSize of line 1 of member "Name3" to 14
  111.   set the text of member "EPreis3" to "Einzelpreis" & RETURN & the text of field "EPreis2"
  112.   set the textSize of member "EPreis3" to 10
  113.   set the textSize of line 1 of member "EPreis3" to 14
  114.   set the text of member "GPreis3" to "Gesamtpreis" & RETURN & the text of field "GPreis2"
  115.   set the textSize of member "GPreis3" to 10
  116.   set the textSize of line 1 of member "GPreis3" to 14
  117.   set the text of member "Summe3" to the text of field "Summe"
  118.   set the textSize of member "Summe3" to 14
  119. end
  120.