BBjInputD::calendar

Description

In BBj 4.00 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:

CSS Selector

Description

.BBjInputD-calendar

The primary style name of the calendar popup

.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.