AskPrintPages (prompt for pages to print)

Top  Previous  Next

 

AskPrintPages, VIRTUAL, PROTECTED, PROC

The AskPrintPages method prompts the end user for the number(s) of the pages to print from the previewed report.

Implementation:

The PrintPreviewClass.TakeAccepted method calls the AskPrintPages method and returns TRUE (1) when completed or FALSE (0) if the user presses the cancel button. The AskPrintPages method displays a dialog that prompts for the page numbers to print.

Return Data Type:     BYTE

Example:

!Virtual implementation of AskThumbnails

PrintPreviewClass.AskPrintPages PROCEDURE

Preserve  LIKE(PrintPreviewClass.PagesToPrint),AUTO

Window WINDOW('Pages to Print'),AT(,,260,37),CENTER,SYSTEM,GRAY

      PROMPT('&Pages to Print:'),AT(4,8),USE(?Prompt)

      ENTRY(@s255),AT(56,4,200,11),USE(SELF.PagesToPrint, , ?PagesToPrint)

      BUTTON('&Reset'),AT(116,20,45,14),USE(?Reset)

      BUTTON('&Ok'),AT(164,20,45,14),USE(?Ok),DEFAULT

      BUTTON('&Cancel'),AT(212,20,45,14),USE(?Cancel),STD(STD:Close)

    END

RVal  BYTE(False)

 CODE

 Preserve = SELF.PagesToPrint

 OPEN(Window)

 ACCEPT

   CASE EVENT()

   OF EVENT:Accepted

     CASE ACCEPTED()

     OF ?Cancel

       SELF.PagesToPrint = Preserve

       POST(EVENT:CloseWindow)

     OF ?Ok

       RVal = True

       POST(EVENT:CloseWindow)

     OF ?Reset

       SELF.SetDefaultPages

       SELECT(?PagesToPrint)

     END

   OF EVENT:OpenWindow

     ! INIMgr code for FETCHing window settings

   OF EVENT:CloseWindow

     ! INIMgr code for UPDATEing window settings

   END

 END

 CLOSE(Window)

 RETURN Rval