BBjFileChooser::isNewFolderEnabled

Description

In BBj 16.00 and higher, this method returns whether the "New Folder" BBjFileChooser button is enabled.

Syntax

Return Value

Method

boolean

isNewFolderEnabled()

Parameters

None.

Return Value

Returns whether the "New Folder" BBjFileChooser button is enabled.

Remarks

This setting may be ignored by the underlying look and feel.

Example

rem ' isNewFolderEnabled

sysgui = unt
open (sysgui)"X0"
sysgui! = bbjapi().getSysGui()
title$ = "isNewFolderEnabled"
window! = sysgui!.addWindow(50,50,600,500,title$,$00090003$)
window!.setCallback(window!.ON_CLOSE,"eoj")
directory$ = dsk("") + dir("")
chooser! = window!.addFileChooser(101,25,25,550,400,directory$,$$)
vector! = bbjapi().makeVector()
vector!.add("*.gif")
vector!.add("*.jpg")
vector!.add("*.png")
vector!.add("*.bmp")
vector!.add("*.ico")
chooser!.addFileFilter("Image Files", vector!)
chooser!.addFileFilter("Text Files", "*.txt")
chooser!.setActiveFileFilter("Text Files")
chooser!.setCallback(chooser!.ON_FILECHOOSER_CHANGE,"change")
chooser!.setCallback(chooser!.ON_FILECHOOSER_APPROVE,"approve")
chooser!.setCallback(chooser!.ON_FILECHOOSER_CANCEL,"cancel")
chooser!.setCallback(chooser!.ON_FILECHOOSER_FILTER,"filter")
chooser!.setCallback(chooser!.ON_GAINED_FOCUS,"event")
chooser!.setCallback(chooser!.ON_LOST_FOCUS,"event")
chooser!.setCallback(chooser!.ON_MOUSE_ENTER,"event")
chooser!.setCallback(chooser!.ON_MOUSE_EXIT,"event")
chooser!.setCallback(chooser!.ON_POPUP_REQUEST,"event")
chooser!.setCallback(chooser!.ON_RIGHT_MOUSE_DOWN,"event")
flags$ = iff(chooser!.isNewFolderEnabled(),$0004$,$0000$)
newfolder! = window!.addCheckBox(102,25,450,550,25,"setNewFolderEnabled",flags$)
newfolder!.setCallback(newfolder!.ON_CHECK_ON,"newFolderEnabled")
newfolder!.setCallback(newfolder!.ON_CHECK_OFF,"newFolderDisabled")
process_events

eoj:
release

newFolderEnabled:
    chooser!.setNewFolderEnabled(1)
    title$ = "newFolderEnabled: "+Boolean.toString(chooser!.isNewFolderEnabled())
    window!.setTitle(title$)
return

newFolderDisabled:
    chooser!.setNewFolderEnabled(0)
    title$ = "newFolderEnabled: "+Boolean.toString(chooser!.isNewFolderEnabled())
    window!.setTitle(title$)
return

change:
    event! = sysgui!.getLastEvent()
    event$ = event!.toString(), event$ = event$(1,pos("@"=event$)-1)
    print event$,": ",event!.getSelectedFiles(),"; ",chooser!.getText()
return

approve:
    event! = sysgui!.getLastEvent()
    event$ = event!.toString(), event$ = event$(1,pos("@"=event$)-1)
    print event$,": ",event!.getSelectedFiles(),"; ",chooser!.getText()
return

cancel:
    event! = sysgui!.getLastEvent()
    event$ = event!.toString(), event$ = event$(1,pos("@"=event$)-1)
    print event$,"; ",chooser!.getText()
return

filter:
    event! = sysgui!.getLastEvent()
    event$ = event!.toString(), event$ = event$(1,pos("@"=event$)-1)
    print event$,": ",event!.getActiveFileFilter(),"; ",chooser!.getText()
return

event:
    event! = sysgui!.getLastEvent()
    event$ = event!.toString(), event$ = event$(1,pos("@"=event$)-1)
    control! = event!.getControl()
    control$ = control!.toString(), control$ = control$(1,pos("@"=control$)-1)
    print control$," ",event$,"; ",chooser!.getText()
return

See Also

BBjAPI

BBjSysGui

BBjWindow

BBjFileChooser

BBjFileChooser::setNewFolderEnabled

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