BBjSystemMetrics::getScreenNumber

Description

In BBj 15.0 and higher, this BBjSystemMetrics method returns the screen number of the specified BBjControl.

Syntax

Return Value

Method

int

getScreenNumber(BBjControl control)

Parameters

Variable

Description

control

Any BBjControl.

Return Value

Returns the screen number of the specified BBjControl.

Remarks

In BUI, this method always returns 0. 

Example

rem ' BBjSystemMetrics::getScreenNumber

sysgui = unt

open (sysgui)"X0"

sysgui! = bbjapi().getSysGui()

metrics! = sysgui!.getSystemMetrics()

print "Default:"

print "getScreenResolution:",metrics!.getScreenResolution()," DPI"

print "getScreenSize: ",metrics!.getScreenSize()

print "getScreenBounds: ",metrics!.getScreenBounds()

print "getScreenInsets: ",metrics!.getScreenInsets()

screens = metrics!.getScreenCount()

for screen = 0 to screens-1

 print ""

 print "Screen",screen,":"

 print "getScreenSize",screen,": ",metrics!.getScreenSize(screen)

 print "getScreenBounds",screen,": ",metrics!.getScreenBounds(screen)

 print "getScreenInsets",screen,": ",metrics!.getScreenInsets(screen)

next screen

title$ = "BBjSystemMetrics::getScreenNumber"

window! = sysgui!.addWindow(100,100,300,100,title$,$00090003$)

screen = metrics!.getScreenNumber(window!)

if screens = 1 then

  screen$ = "There is 1 screen available."

else

  screen$ = "There are " + str(screens)+" available."

endif

screen$ = screen$ + $0a$ + "This window is on screen #" + str(screen)

window!.addStaticText(101,25,25,250,50,screen$,$$)

window!.setCallback(window!.ON_CLOSE,"eoj")

process_events

eoj:

release   

See Also

BBjAPI

BBjSysGui

BBjSystemMetrics::getScreenCount

Object Variables

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