BBjMDI::getToolButton

Description

In BBj 14.0 and higher, this method returns a tool button control that was previously added to the BBjMDI window.

Syntax

Return Value

Method

BBjToolButton

getToolButton(int ID)

Parameters

Variable

Description

ID

Specifies the control ID number of a BBjToolButton control that was previously added to this BBjMDI window

Return Value

Returns a BBjToolButton object.

Remarks

None.

Example

rem ' getToolButton.txt

open (unt)"X0"
mdi! = BBjAPI().getMDI()
mdi!.createMDIWindow(50, 50, 800, 600, "MDI Window")

menuBar! = mdi!.addMenuBar()
AMenu!=menuBar!.addMenu(20,"Sample menu")
MenuItem201! = AMenu!.addMenuItem(201, "Set BBj Command line params")
MenuItem202! = AMenu!.addMenuItem(202, "Set Program Command line params")
MenuItem203! = AMenu!.addMenuItem(203, "Run Program")
MenuItem204! = AMenu!.addMenuItem(204, "add toolbars")
MenuItem205! = AMenu!.addMenuItem(205, "Enable MDI WindowsMenu")

MenuItem201!.setCallback(menuBar!.ON_MENU_ITEM_SELECT, "selected_201")
MenuItem202!.setCallback(menuBar!.ON_MENU_ITEM_SELECT, "selected_202")
MenuItem203!.setCallback(menuBar!.ON_MENU_ITEM_SELECT, "selected_203")
MenuItem204!.setCallback(menuBar!.ON_MENU_ITEM_SELECT, "selected_204")
MenuItem205!.setCallback(menuBar!.ON_MENU_ITEM_SELECT, "selected_205")

CALLBACK(ON_CLOSE,eoj,mdi!.MDI_CONTEXT)

process_events

eoj:
release

selected_201:
    print (0,ERR=*return) 'GETS'("","commandLineParams: ", cmdLineParams$)
    read cmdLineParams$
return

selected_202:
    print (0,ERR=*return) 'GETS'("","ProgramParams: ", programParams$)
    read programParams$
return

selected_203:
    filename$ = fileopen("choose file","/","","")
    if (filename$ <> "::CANCEL::") then
        command$ = "bbj " + cmdLineParams$ + " " + filename$ + " - " + programParams$ + " &"
        print "scalling: " , command$
        x = scall(command$)
    endif
return

selected_204:
    tb1! = mdi!.addToolButton(101,0,0,40,40,"1",$4000$)
    tb1! = mdi!.getToolButton(101)
    tb2! = mdi!.addToolButton(102,0,0,40,40,"2",$4000$)
    tb2! = mdi!.getToolButton(102)
    tb3! = mdi!.addToolButton(103,0,0,40,40,"3",$4000$)
    tb3! = mdi!.getToolButton(103)
    tb1!.setCallback(tb1!.ON_TOOL_BUTTON_PUSH,"tb1")
    tb2!.setCallback(tb1!.ON_TOOL_BUTTON_PUSH,"tb2")
    tb3!.setCallback(tb1!.ON_TOOL_BUTTON_PUSH,"tb3")
    menuItem204!.setEnabled(0)
return

TB1:
    print "1"
return

TB2:
    print "2"
return

TB3:
    print "3"
return

selected_205:
    mdi!.enableMDIWindowMenu()
    menuItem205!.setEnabled(0)
return

See Also

BBjAPI

BBjMDI

BBjToolButton

Object Variables

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