BBjPrintPreview

Creation Path


BBjAPI

|

+--BBjSysGui

|

+--BBjWindow

|

+--BBjPrintPreview

 

Description

In BBj 7.0 and higher, the BBjPrintPreview object provides methods for previewing print jobs.

Implemented Interfaces

DropTarget

Creation

A BBjPrintPreview object is created through the following BBjWindow methods:

 

Return Value

Method

BBjPrintPreview

addPrintPreview(int ID, int x, int y, int width, int height, string title, string flags)

Methods of BBjPrintPreview

Return Value

Method

void

firstPage()

void

fitToHeight()

void

fitToWidth()

int

getIndex()

int

getPageCount()

double

getZoom()

void

lastPage()

void

nextPage()

void

previousPage()

void

scrollDown()

void

scrollUp()

void

setIndex(int pageNumber)

void

setZoom(double zoomAmount)

void

twoPage()

Methods of BBjPrintPreview implemented for DropTarget

Return Value

Method

int

getDropActions()

void

setDropActions(int actions)

BBjVector

getDropTypes()

void

setDropTypes(BBjVector types)

Methods of BBjPrintPreview inherited from BBjControl

Events

Callback Code

Object-oriented Event

Read Record Event

Code

ON_DROP_TARGET_DROP

BBjDropTargetDropEvent

Drop Target Drop Event

D

ON_GAINED_FOCUS

BBjGainedFocusEvent

Control Focus Gained/Lost Event

f

ON_LOST_FOCUS

BBjLostFocusEvent

Control Focus Gained/Lost Event

f

ON_MOUSE_ENTER

BBjMouseEnterEvent

Mouse Enter/Exit Event

E

ON_MOUSE_EXIT

BBjMouseExitEvent

Mouse Enter/Exit Event

E

ON_POPUP_REQUEST

BBjPopupRequestEvent

Popup Request Event

r

ON_RIGHT_MOUSE_DOWN

BBjRightMouseDownEvent

Right Mouse Button Down Event

R

Remarks

None.

Constants inherited from BBjControl

Example

rem ' addPrintPreview

LET myAPI!=BBjAPI()

REM Open the SysGui device
SYSGUI=UNT
OPEN (SYSGUI)"X0"

REM Obtain the instance of the BBjSysGui object
LET mySysGui!=myAPI!.getSysGui()

REM Set addWindow param values
X=10
Y=10
WIDTH=800
HEIGHT=600
TITLE$="addPrintPreview"

REM Set the current context
mySysGui!.setContext(0)

REM Create a window
myWindow! = mySysGui!.addWindow(X,Y,WIDTH,HEIGHT,TITLE$,$00010003$)

REM Add a print preview control to the window
myPrintPreview! = myWindow!.addPrintPreview(101,50,50,700,500,"",$$)
myPrintPreview!.setZoom(2)

form! = myAPI!.getBBjPrinter(0).getForm(0)
page! = form!.createPage()
para! = page!.newParagraph()
para!.setHorizontalFill(1)
para!.setFont(new java.awt.Font("Courier",java.awt.Font.PLAIN,24))
para!.setText("BBjPrintPreview, new for BBj 7!")
page!.add(para!)
form!.preview(myPrintPreview!)

REM Register the CALLBACK routines
CALLBACK(ON_CLOSE,APP_CLOSE,mySysGui!.getContext())

REM Process Events
PROCESS_EVENTS

REM Callback routine called when the user closes the application window
APP_CLOSE:
RELEASE

See Also

BBjAPI

BBjSysGui

BBjWindow

CALLBACK Verb - Register BBj Subroutine

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.