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.

CSS

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
RETURN

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.



______________________________________________________________________________________

Copyright BASIS International Ltd. BBj®, Visual PRO/5®, PRO/5®, and BBx® are registered trademarks.