BBjInputD::calendar

Description

In BBj 4.0 and higher, this method pops up a calendar dialog attached to the BBjInputD control.

Syntax

Return Value

Method

void

calendar()

Parameters

None.

Return Value

None.

BUI logoCSS

The visual appearance of BUI controls is defined using CSS (cascading style sheets) rules. Easily change the default colors, border, and other settings by customizing these rules, all without changing any application code. See CSS API for a high-level overview of BUI CSS.

The calendar popup is a structured <div> with a primary style name of .BBjInputD-calendar. Internal calendar elements inherit their names from the GWT DatePicker:

.BBjInputD-calendar

.datePickerMonthSelector  (the month selector widget)

.datePickerMonth  (the month in the month selector widget)

.datePickerPreviousButton (the previous month button)

.datePickerNextButton (the next month button)

.datePickerDays (the portion of the picker that shows the days)

.datePickerWeekdayLabel (the label over weekdays)

.datePickerWeekendLabel (the label over weekends)

.datePickerDay (a single day)

.datePickerDayIsToday (today's date)

.datePickerDayIsWeekend (a weekend day)

.datePickerDayIsFiller (a day in another month)

.datePickerDayIsValue (the selected day)

.datePickerDayIsDisabled (a disabled day)

.datePickerDayIsHighlighted (the currently highlighted day)

.datePickerDayIsValueAndHighlighted (the highlighted day if it is also selected)

Remarks

Pops up a calendar underneath the InputD control. The user can pick a date from the calendar and return it to the InputD control, or click the Close box to exit with no selection.

Example

rem 'Popup an InputD calendar

rem 'Obtain the instance of the BBjAPI object
let myAPI! = BBjAPI()

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

rem 'Create data structures for keypress event handler
DIM EVENT$:TMPL(SYSGUI),GENERIC$:NOTICETPL(0,0)

rem 'Obtain the instance of the BBjSysGui object
let mySysGui! = myAPI!.getSysGui()

rem 'Set addWindow param values
X = 10
Y = 10
WIDTH = 200
HEIGHT = 200
TITLE$="BBj Window"

rem 'Set the current context
mySysGui!.setContext(0)

rem 'Create a window
myWindow! = mySysGui!.addWindow(X,Y,WIDTH,HEIGHT,TITLE$,$00010002$)

Text! = myWindow!.addStaticText(100,50,60,90,30,"Press F2 for a popup calendar")

rem 'Create an InputD control
myInputD! = myWindow!.addInputD(101,50,100,90,30)

rem 'Create a button control for popping up the calendar
myButton! = myWindow!.addToolButton(1,140,100,30,30,"BITMAP = calendar.png")

rem 'Focus on the InputD control
myInputD!.focus()

rem 'Register the CALLBACK routines
CALLBACK(ON_INPUT_KEYPRESS,KEYPRESS,mySysGui!.getContext(),myInputD!.getID())
CALLBACK(ON_TOOL_BUTTON_PUSH,PopupCalendar,mySysGui!.getContext(),myButton!.getID())
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

rem 'Popup calendar if F2 key is pressed
KEYPRESS:
    EVENT$ = mySysGui!.getLastEventString()
    GENERIC$ = NOTICE(SYSGUI,EVENT.X)
    DIM NOTICE$:NOTICETPL(GENERIC.OBJTYPE,EVENT.FLAGS)
    NOTICE$ = GENERIC$
    if NOTICE.KEY$ = $014C$ then gosub PopupCalendar
return

PopupCalendar:
    myInputD!.calendar()
return

See Also

BBjAPI

BBjSysGui

BBjControl

BBjWindow

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