BBjTopLevelWindow::getWindowMode

Description

In BBj 21.0 and higher, this method returns the runtime mode of a BBjTopLevelWindow. The available modes (MDI, SDI, DETACHED) are defined in BBjMDI::getDefaultMDIMode.

Syntax

Return Value Method
String getWindowMode()

Parameters

None.

Return Value

The return value is one of the following strings:

String Description
MDI The BBjTopLevelWindow is an MDI child window confined to the user area of an MDI master. The child will be terminated when the MDI master is closed.
SDI The BBjTopLevelWindow is attached to an MDI master, but it's not confined to the MDI master's user area. The window will be terminated when its MDI master is closed.
DETACHED This BBjTopLevelWindow is not attached to an MDI window.

Example

rem ' BBjTopLevelWindow::getWindowMode

if argc>1 then goto client
a = scall("bbj "+pgm(-1)+" - Standalone_Window&")
sysgui = unt
open (sysgui)"X0"
mdi! = bbjapi().getMDI()
mdi!.createMDIWindow(50,50,800,600,"MDI Window")
mdi!.setCallback(mdi!.ON_CLOSE,"eoj")
a = scall("bbj "+pgm(-1)+" - MDI_Client&")
mdi!.setDefaultMDIMode("SDI")
a = scall("bbj "+pgm(-1)+" - SDI_CLIENT&")
process_events

eoj:
release

client:
sysgui! = bbjapi().openSysGui("X0")
x$ = argv(1)
window! = sysgui!.addWindow(10,10,640,480,x$)
mode$ = window!.getWindowMode()
window!.setTitle(mode$+": "+x$)
metrics! = sysgui!.getSystemMetrics()
switch window!.getWindowMode()
    case "DETACHED"
        bounds! = metrics!.getScreenBounds()
        break
    case "MDI"
        bounds! = metrics!.getScreenBounds()
        break
    case "SDI"
        screen = metrics!.getScreenNumber(window!)
        bounds! = metrics!.getScreenBounds(screen)
        break
    case default
        bounds! = metrics!.getScreenBounds()
        break
swend
print mode$+" "+str(bounds!)
if (bbjapi().isInMDI()) then
    bounds! = metrics!.getScreenBounds()
    s$ = "MDI w="+str(bounds!.width)+" h="+str(bounds!.height)
    st! = window!.addStaticText(100,10,10,400,25,s$)
    if mode$="MDI" then st!.setBackColor(BBjColor.YELLOW)
    screen = metrics!.getScreenNumber(window!)
    bounds! = metrics!.getScreenBounds(screen)
    s$ = "Screen "+str(screen)+"  w="+str(bounds!.width)+" h="+str(bounds!.height)
    st! = window!.addStaticText(101,10,40,400,25,s$)
    if mode$="SDI" then st!.setBackColor(BBjColor.YELLOW)
else
    bounds! = metrics!.getScreenBounds()
    s$ = "Screen w="+str(bounds!.width)+" h="+str(bounds!.height)
    st! = window!.addStaticText(100,10,10,400,25,s$)
    st!.setBackColor(BBjColor.YELLOW)
endif
window!.setCallback(window!.ON_CLOSE,"eoj")
process_events

ClosedVersion History

  • BBj 21.0: BBjTopLevelWindow::getWindowMode added.

See Also

BBjAPI

BBjSysGui

BBjControl

BBjWindow

BBjMDI::getDefaultMDIMode

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