|
Month Calendar control help
Function help:
Real API_MonthCal_Create (Real Parent Handle, Real X, Real Y, Real Width, Real Height, Real Style Flags, Real Extended Style Flags);
This function creates a new date and time picker control.
Argument list:
(0) Parent Handle: Identifies the window handle of the window to create this control on.
(1) X: The horizontal position of the control in pixels, relative to the parent window.
(2) Y: The vertical position of the control in pixels, relative to the parent window.
(3) Width: The horizontal size of the control in pixels.
(4) Height: The vertical size of the control in pixels.
(5) Style Flags: The style flags, supports the Global Control Styles and the following styles:
MCS_WEEKNUMBERS
The month calendar control will display week numbers (1-52) to the left of each row of days. Week 1 is defined as the first week that contains at least four days.
MCS_NOTODAYCIRCLE
The month calendar control will not circle the "today" date.
MCS_NOTODAY
The month calendar control will not display the "today" date at the bottom of the control.
MCS_NOTRAILINGDATES
Microsoft Windows Vista. This flag disables displaying the dates from the previous/next month in the current calendar.
Style flags can be separated by a bitwise or '|' operator.
(6) Extended Style Flags: This can be any combination of the Global Extended Control Styles.
Return value:
If this function succeeds, it returns the Control ID of the control, otherwise it returns 0.
Real API_MonthCal_SetRange ( Real Control ID, Real Range Type, Real Year,
Real Month, Real Day,Real Hour,Real Minute,Real Second,Real Milliseconds )
This function changes the minimum or maximum date that can be selected in the control.
Argument list:
(0) Control ID: The control ID returned by API_MonthCal_Create.
(1) Range type: 0 = Set the minimum part of the range, 1 = Set the maximum part of the range.
(2) Year: The years of the date
(3) Month: The months of the date
(4) Day: The
days of the date
(5) Hour: The hours of the date
(6) Minute: The minutes of the date
(7) Second:
The seconds of the date
(8) Miliseconds: The miliseconds of the date
Return value:
Returns true (1) when succesful or false (0) otherwise.
Real API_MonthCal_GetRange ( Real Control ID, Real Range Type, Real Date Part )
This function returns the current minimum or maximum date that can be selected in the control.
Argument list:
(0) Control ID: The control ID returned by API_MonthCal_Create.
(1) Range type: 0 = Get the minimum part of the range, 1 = Get the maximum part of the range.
(2) Date part, one of the following:
0: Return the year.
1: Return the month
2: Return the day
Return value:
Returns the date part.
Real API_MonthCal_SetSel ( Real Control ID,Real Year,
Real Month, Real Day)
This function changes the current date entered into the control.
Argument list:
(0) Control ID: The control ID returned by API_MonthCal_Create.
(1) Year: The years of the date
(2) Month: The months of the date
(3) Day: The
days of the date
Return value:
Returns true (1) when succesful or false (0) otherwise.
Real API_MonthCal_GetSel ( Real Control ID,Real Date part)
This function returns the current date entered into the control.s
Argument list:
(0) Control ID: The control ID returned by API_MonthCal_Create.
(1) Date part, one of the following:
0: Return the year.
1: Return the month
2: Return the day
Return value:
Returns the date part.
Real API_MonthCal_SetColor ( Real Control ID,Real Color part, Real Color)
This function changes the colors inside the date and time control.
Argument list:
(0) Control ID: The control ID returned by API_MonthCal_Create.
(1) Color part, one of the following:
MCSC_BACKGROUND
Set the background color displayed between months.
MCSC_MONTHBK
Set the background color displayed within the month.
MCSC_TEXT
Set the color used to display text within a month.
MCSC_TITLEBK
Set the background color displayed in the calendar's title.
MCSC_TITLETEXT
Set the color used to display text within the calendar's title.
MCSC_TRAILINGTEXT
Set the color used to display header day and trailing day text. Header and trailing days are the days from the previous and following months that appear on the current month calendar.
(2) Color: The new color.
Return value:
Returns the previous color when succesful, or -1 otherwise.
Real API_MonthCal_GetColor ( Real Control ID,Real Color part)
This function changes the colors inside the date and time control.
Argument list:
(0) Control ID: The control ID returned by API_MonthCal_Create.
(1) Color part, one of the following:
MCSC_BACKGROUND
Get the background color displayed between months.
MCSC_MONTHBK
Get the background color displayed within the month.
MCSC_TEXT
Get the color used to display text within a month.
MCSC_TITLEBK
Get the background color displayed in the calendar's title.
MCSC_TITLETEXT
Get the color used to display text within the calendar's title.
MCSC_TRAILINGTEXT
Get the color used to display header day and trailing day text. Header and trailing days are the days from the previous and following months that appear on the current month calendar.
Return value:
Returns the color when succesful, or -1 otherwise.
Secondary check commands for date and time pickers:
MCN_SELCHANGE
Sent by a month calendar control when the currently selected date or range of dates changes.
MCN_SELECT
Sent by a month calendar control when the user makes an explicit date selection within a month calendar control.
Example:
Command = API_Check_Command (1);
if ( Command == Calendar1 )
{
Second = API_Check_SecondaryCommand (1);
if ( Second == MCN_SELECT)
{
show_message ("You changed the selection.");
}
} |
Example code:
DateTime1 = API_MonthCal_Create (Win,300,60,300,20,0,0);
API_MonthCal_SetRange (DateTime1,0,2006,1,1);
API_MonthCal_SetRange (DateTime1,1,2007,1,1);
|
is
Return to help index
|
|