Copyright © 1998-2006,2011 Dipl.-Inform. Kai Hofmann. All rights reserved! |
|||||||
The idea of this class was born during developing my Gregor application.
MUI abstract public custom class allowing easy handling of dates. Because it is abstract it is only usefull for developers who are working with classes that are based on Date.mcc (like DateString.mcc), or who want to build their own classes based on Date.mcc.
MUIA_Date_Calendar, calendar,
/*result =*/ get(obj,MUIA_Date_Calendar,&calendar);
Defaults to MUIV_Date_Calendar_Heis
Calendar is defined in the date.library (Aminet:util/lib/DateLib.lha) as follows:typedef enum {date_Julian,date_Gregorian,date_Heis} date_Calendar;
MUIA_Date_Country, country,
\*result =*\ get(obj, MUIA_Date_Country, &country);
Defaults to locale.library settings if present, else to unknown.
At the moment this is only a dummy attribut, because country support for the date.library is still under construction.
Countries is defined in the date.library (Aminet:util/libs/DateLib.lha) as follows:typedef enum {date_unknown,date_Italia,date_Deutschland,date_Schweiz, date_Danmark,date_Nederland,date_GreatBritain} date_Countries;
MUIA_Date_Day, 1,
\*result =*\ set(obj,MUIA_Date_Day,day);
\*result =*\ get(obj,MUIA_Date_Day,&day);
\*result =*\ DoMethod(obj,MUIM_Notify,MUIA_Date_Day, MUIV_EveryTime,STRINGOBJ,2,MUIM_String_Integer,MUIV_TriggerValue);
Defaults to 0 if there was never a valid date value given!
Must be within the range 1-(last day of the month)
If you set a wrong date or if the date is not within MinDate and MaxDate then this attribute will be set back to its default!
MUIA_Date_FirstWeekday, Monday,Defaults to locale.library setting if present, else it defaults to Monday.
Weekdays is defined in the date.library (Aminet:util/libs/DateLib.lha) as follows:
typedef enum {date_dayerr, date_Monday, date_Tuesday, date_Wednesday, date_Thursday, date_Friday, date_Saturday, date_Sunday} date_Weekdays;
MUIA_Date_JD, 2450521,
\*result =*\ set(obj,MUIA_Date_JD,jd);
\*result =*\ get(obj,MUIA_Date_JD,&jd);
\*result =*\ DoMethod(obj,MUIM_Notify,MUIA_Date_JD,MUIV_EveryTime,STRINGOBJ,2,MUIM_String_Integer,MUIV_TriggerValue);
Defaults to 0 if there was never a valid date value given!
Must be within the range 1723980-2914672
Don't forget to check the return value of DoMethod()!
If you set a wrong date or if the date is not within MinDate and MaxDate then this attribute will be set back to its default!
MUIA_Date_Language, language,Defaults to locale.library settings if present, else to ENGLISH
Languages is defined in the date.library (Aminet:util/libs/DateLib.lha) as follows:
typedef enum {date_Locale, date_ENGLISH, date_DEUTSCH, date_FRANCAIS, date_ESPANOL, date_PORTUGUES, date_DANSK, date_ITALIANO, date_NEDERLANDS, date_NORSK, date_SVENSKA, date_POLSKI, date_SUOMI, date_MAGYAR, date_GREEK, date_ESPERANTO, date_TURKCE, date_LATINA, date_RUSSIAN, date_CZECH, date_CATALONIAN} date_Languages;
MUIA_Date_MJD, 0,
\*result =*\ set(obj,MUIA_Date_MJD,mjd);
\*result =*\ get(obj,MUIA_Date_MJD,&mjd);
\*result =*\ DoMethod(obj,MUIM_Notify,MUIA_Date_MJD,MUIV_EveryTime,STRINGOBJ,2,MUIM_String_Integer,MUIV_TriggerValue);
Defaults to 0 if there was never a valid date value given!
Must be within the range 1-514671
Don't forget to check the return value of DoMethod()!
If you set a wrong date or if the date is not within MinDate and MaxDate then this attribute will be set back to its default!
MUIA_Date_MaxDay, 31,
\*result =*\ set(obj,MUIA_Date_MaxDay,mday);
\*result =*\ get(obj,MUIA_Date_MaxDay,&mday);
Defaults to 31.
If you set a wrong date or if MinDate is >= MaxDate then this attribute will be set back to its default!
MUIA_Date_MaxMonth, 1,
\*result =*\ set(obj,MUIA_Date_MaxMonth,mmonth);
\*result =*\ get(obj,MUIA_Date_MaxMonth,&mmonth);
Defaults to 12.
If you set a wrong date or if MinDate is >= MaxDate then this attribute will be set back to its default!
MUIA_Date_MaxYear, 2077,
\*result =*\ set(obj,MUIA_Date_MaxYear,myear);
\*result =*\ get(obj,MUIA_Date_MaxYear,&myear);
Defaults to 8000.
If you set a wrong date or if MinDate is >= MaxDate then this attribute will be set back to its default!
MUIA_Date_MinDay, 1,
\*result =*\ set(obj,MUIA_Date_MinDay,mday);
\*result =*\ get(obj,MUIA_Date_MinDay,&mday);
Defaults to 1.
If you set a wrong date or if MinDate is >= MaxDate then this attribute will be set back to its default!
MUIA_Date_MinMonth, 1,
\*result =*\ set(obj,MUIA_Date_MinMonth,mmonth);
\*result =*\ get(obj,MUIA_Date_MinMonth,&mmonth);
Defaults to 1.
If you set a wrong date or if MinDate is >= MaxDate then this attribute will be set back to its default!
MUIA_Date_MinYear, 1978,
\*result =*\ set(obj,MUIA_Date_MinYear,myear);
\*result =*\ get(obj,MUIA_Date_MinYear,&myear);
Defaults to 8.
If you set a wrong date or if MinDate is >= MaxDate then this attribute will be set back to its default!
MUIA_Date_Month, 1,
\*result =*\ set(obj,MUIA_Date_Month,month);
\*result =*\ get(obj,MUIA_Date_Month,&month);
\*result =*\ DoMethod(obj,MUIM_Notify,MUIA_Date_Month,MUIV_EveryTime,STRINGOBJ,2,MUIM_String_Integer,MUIV_TriggerValue);
Defaults to 0 if there was never a valid date value given!
Must be within the range 1-12
If you set a wrong date or if the date is not within MinDate and MaxDate then this attribute will be set back to its default!
\*result =*\ get(obj,MUIA_Date_Week,&week);
\*result =*\ DoMethod(obj,MUIM_Notify,MUIA_Date_Week,
MUIV_EveryTime,STRINGOBJ,2,MUIM_String_Integer,MUIV_TriggerValue);
\*result =*\ get(obj,MUIA_Date_Weekday,&wd);
\*result =*\ DoMethod(obj,MUIM_Notify,MUIA_Date_Weekday,MUIV_EveryTime,STRINGOBJ,2,MUIM_String_Integer,MUIV_TriggerValue);
\*result =*\ get(obj,MUIA_Date_YDay,&yday);
\*result =*\ DoMethod(obj,MUIM_Notify,MUIA_Date_YDay,MUIV_EveryTime,STRINGOBJ,2,MUIM_String_Integer,MUIV_TriggerValue);
MUIA_Date_Year, 1997,
\*result =*\ set(obj,MUIA_Date_Year,year);
\*result =*\ get(obj,MUIA_Date_Year,&year);
\*result =*\ DoMethod(obj,MUIM_Notify,MUIA_Date_Year,MUIV_EveryTime,STRINGOBJ,2,MUIM_String_Integer,MUIV_TriggerValue);
Defaults to 0 if there was never a valid date value given!
Must be within the range 8-8000
If you set a wrong date or if the date is not within MinDate and MaxDate then this attribute will be set back to its default!
result = (LONG)DoMethod(obj,MUIM_Date_Compare,dobj);\*result =*\ DoMethod(obj,MUIM_Date_DecreaseDays,days);\*result =*\ DoMethod(obj,MUIM_Date_DecreaseMonths,months);\*result =*\ DoMethod(obj,MUIM_Date_DecreaseToWeekday,weekday);\*result =*\ DoMethod(obj,MUIM_Date_DecreaseYears,years);\*result =*\ DoMethod(obj,MUIM_Date_IncreaseDays,days);\*result =*\ DoMethod(obj,MUIM_Date_IncreaseMonths,months);\*result =*\ DoMethod(obj,MUIM_Date_IncreaseToWeekday,weekday);\*result =*\ DoMethod(obj,MUIM_Date_IncreaseYears,years);\*result =*\ DoMethod(obj,MUIM_Date_SetCurrent);When the current date exceeds the min or max limit, it will be set to the belonging limit.