Bambookit Home    Bambookit GUI Tutorial

Back    Next   

II. GUI Basics

Chapter 6. Widgets - Using Widgets to Create Interfaces




Calendar

Calendar Widget

XML Element Name

<Calendar/>
By default Calendar will display Today's date.

Example

<Widget setSize="150,100">
<Calendar/>
</Widget>


Calendar's properties

The following Widget's properties found in Chapter 9 apply to the Calendar: fonts, background/foreground colors, borders, highlights, rollovers. Some of the Widget attribute properties apply as well. You won't be able to override the size of the Calendar, but you can set location.

The following properties are specific t0 Calendar widget only: setYear, setMonth, setDate to set a date for the Calendar; and addToDate property.

Method signature

setYear = "[year]"
[year] is an integer

setMonth = "[month]"
[month] is an integer

setMonth = "[date]"
[date] is an integer

Examples

In this example we will be using a Widget and Calendar widgets
<Widget setSize="150,100">
<Calendar setYear="2007" setMonth="11" setDate="5"/>
</Widget>


Method signature

addToDate = "[int delta_day, int delta_month, int delta_year]
[int delta_day, int delta_month, int delta_year] valid values are an integers

The calendar by default is loaded with todays date, this method will increment or decrement the date according to the values set. (i.e. addToDate(-7,0,0) will set the calendar to the previous week addToDate(0,1,0) will set the calendar to the next month addToDate(-5,1,-1) will set the calendar to last years date, minus 5 days and plus a month. )

Examples

In this example we will be using a Widget and a Calendar widgets

<Widget setSize="150,100">
<Calendar addToDate="-10, -3, -1"/>
</Widget>


See Popup Calendar

Back    Next