diff options
author | Behrend Cornelius <bc@openoffice.org> | 2001-11-16 10:21:09 +0000 |
---|---|---|
committer | Behrend Cornelius <bc@openoffice.org> | 2001-11-16 10:21:09 +0000 |
commit | 851c270bc104fb3d1e551ec01e70ff95fcadedb4 (patch) | |
tree | ac7332783c26ad31315e56e90d1f35ad1ab3ab48 | |
parent | a420f83900e42f410e2a336323b43eb2aac7f618 (diff) |
#94767# chinese(TW), japanese and american holidays added. Also HIDs
-rw-r--r-- | wizards/source/schedule/BankHoliday.xba | 21 | ||||
-rw-r--r-- | wizards/source/schedule/CalendarMain.xba | 27 | ||||
-rw-r--r-- | wizards/source/schedule/CreateTable.xba | 7 | ||||
-rw-r--r-- | wizards/source/schedule/DlgCalendar.xdl | 57 | ||||
-rw-r--r-- | wizards/source/schedule/DlgControl.xba | 25 | ||||
-rw-r--r-- | wizards/source/schedule/GermanHolidays.xba | 38 | ||||
-rw-r--r-- | wizards/source/schedule/Language.xba | 11 | ||||
-rw-r--r-- | wizards/source/schedule/LocalHolidays.xba | 168 | ||||
-rw-r--r-- | wizards/source/schedule/OwnEvents.xba | 3 |
9 files changed, 193 insertions, 164 deletions
diff --git a/wizards/source/schedule/BankHoliday.xba b/wizards/source/schedule/BankHoliday.xba index a593809ee..f2eb78ec6 100644 --- a/wizards/source/schedule/BankHoliday.xba +++ b/wizards/source/schedule/BankHoliday.xba @@ -135,22 +135,19 @@ End Sub ' Finds eg the first,second Monday in a month ' Note: in This Function the week starts with the Sunday -Function GetMonthDate(iWeekDay, iMonth, iCount as Integer) +Function GetMonthDate(YearInt as Integer, iMonth as Integer, iWeekDay as Integer, iOffset as Integer) Dim bFound as Boolean -Dim i as Integer -Dim lDate as Integer +Dim lDate as Long ' 1st Tue in Nov : Election Day, Half bFound = False - i = 0 - lDate = DateSerial(YearInt%, iMonth, 1) - While Not bFound - If (iWeekDay = WeekDay(lDate)) Then i = i + 1 - If (i < iCount) Then - lDate = lDate + 1 - Else + lDate = DateSerial(YearInt, iMonth, 1) + Do + If iWeekDay = WeekDay(lDate) Then bFound = True + Else + lDate = lDate + 1 End If - Wend - GetMonthDate = lDate + Loop Until bFound + GetMonthDate = lDate + iOffset End Function </script:module>
\ No newline at end of file diff --git a/wizards/source/schedule/CalendarMain.xba b/wizards/source/schedule/CalendarMain.xba index dbaeaf779..798d8cf4c 100644 --- a/wizards/source/schedule/CalendarMain.xba +++ b/wizards/source/schedule/CalendarMain.xba @@ -6,7 +6,7 @@ Const _DEBUG = 0 ' CalenderMain Public sCurLangLocale as String - +Public sCurCountryLocale as String ' Dieses Flag dient zur Abfrage ob die individuellen Daten abgespeichert werden sollen. Public bCalOwnDataChanged as Boolean @@ -66,14 +66,15 @@ Public DlgCalModel as Object Sub CalAutopilotTable() Dim BitmapDir as String Dim iThisMonth as Integer -' On Error Goto ErrorHandler +'On Error Goto ErrorHandler BasicLibraries.LoadLibrary("Tools") bSelectByMouseMove = True - ' HauptRoutine zur Erstellung des Kalenders - oDocument = StarDesktop.ActiveFrame.Controller.Model + oDocument = ThisComponent oStatusline = oDocument.GetCurrentController.GetFrame.CreateStatusIndicator ToggleWindow(False) sCurLangLocale = oDocument.CharLocale.Language + sCurCountryLocale = oDocument.CharLocale.Country + DlgCalendar = LoadDialog("Schedule", "DlgCalendar") DlgCalModel = DlgCalendar.Model LoadLanguage(sCurLangLocale) @@ -108,11 +109,11 @@ Dim iThisMonth as Integer iThisMonth = Month(Now) DlgCalendar.GetControl("lstMonth").SelectItemPos(iThisMonth-1, True) DlgCalendar.GetControl("lstHolidays").SelectItemPos(0,True) + DlgCalModel.cmdGoOn.DefaultButton = True ToggleWindow(True) DlgCalendar.Execute() DlgCalendar.Dispose() Exit Sub - ErrorHandler: MsgBox(sError$, 16, sWizardTitle$) End Sub @@ -146,6 +147,8 @@ Dim SelYear as String UnprotectSheets(oSheets) oSheets.RemovebyName(oSheets.GetbyIndex(0).Name) iSelYear = DlgCalModel.txtYear.Value +' sCurLangLocale = "zh" +' sCurCountryLocale = "TW" Select Case sCurLangLocale Case cLANGUAGE_GERMAN If Ubound(DlgCalModel.lstHolidays.SelectedItems()) > -1 Then @@ -174,6 +177,14 @@ Dim SelYear as String Call FindWholeYearHolidays_PL(iSelYear) Case cLANGUAGE_RUSSIAN Call FindWholeYearHolidays_RU(iSelYear) + Case cLANGUAGE_JAPANESE + Call FindWholeYearHolidays_JP(iSelYear) + Case cLANGUAGE_CHINESE + If sCurCountryLocale = "TW" Then + Call FindWholeYearHolidays_TW(iSelYear) + Else + + End If End Select Call CalInsertOwnDataInTables(iSelYear) @@ -182,7 +193,7 @@ Dim SelYear as String oSheets.RemovebyName(oSheets.GetbyIndex(0).Name) oSheet = oSheets.GetbyIndex(0) oSheet.Name = sCalendarTitle$ + " " + iSelYear -' oDocument.AddActionLock + oDocument.AddActionLock Call CalCreateYearTable(iSelYear) ElseIf DlgCalModel.optMonth.State = 1 Then Dim iMonth @@ -190,11 +201,11 @@ Dim SelYear as String oSheets.RemovebyName(oSheets.GetbyIndex(1).Name) oSheet = oSheets.GetbyIndex(0) oSheet.Name = sMonthTitle$ + " " + cCalLongMonthNames(iMonth-1) -' oDocument.AddActionLock + oDocument.AddActionLock Call CalCreateMonthTable(iSelYear, iMonth) End If -' oDocument.RemoveActionLock + oDocument.RemoveActionLock oSheet.protect("") oStatusLine.End DlgCalendar.EndExecute() diff --git a/wizards/source/schedule/CreateTable.xba b/wizards/source/schedule/CreateTable.xba index 4ea92f962..3be1ac44c 100644 --- a/wizards/source/schedule/CreateTable.xba +++ b/wizards/source/schedule/CreateTable.xba @@ -26,13 +26,10 @@ Dim oRangeBlank as Object Dim sBlankStyle as String ' On Error Goto ErrorHandling oStatusLine.Start("",140) 'GetResText(sProgress) - iDate = DateSerial(iSelYear,1,1) - - ' Insert year oYearCell = oSheet.GetCellRangeByName("Year") oYearCell.Value = iSelYear - ' Insert holidays + CalMonth = 1 CalDay = 0 s = 10 @@ -47,7 +44,7 @@ Dim sBlankStyle as String End If ColPos = NewYearColumn+(2*CalMonth) RowPos = NewYearRow + CalDay - FormatCalCells(ColPos,RowPos,i) + FormatCalCells(ColPos,RowPos,i) Next If NOT CalIsLeapYear(iSelYear) Then ' Delete 29th February if necessary diff --git a/wizards/source/schedule/DlgCalendar.xdl b/wizards/source/schedule/DlgCalendar.xdl index 6ee490af8..fe40453f8 100644 --- a/wizards/source/schedule/DlgCalendar.xdl +++ b/wizards/source/schedule/DlgCalendar.xdl @@ -1,70 +1,71 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd"> -<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="Dialog1" dlg:left="160" dlg:top="81" dlg:width="208" dlg:height="156" dlg:page="2"> +<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="Dialog1" dlg:left="160" dlg:top="81" dlg:width="208" dlg:height="156" dlg:page="2" dlg:help-url="HID:34700"> <dlg:styles> - <dlg:style dlg:style-id="0" dlg:font-name="Cumberland" dlg:font-stylename="Standard" dlg:font-family="modern" dlg:font-charset="ansi"/> + <dlg:style dlg:style-id="0" dlg:background-color="0x8000"/> <dlg:style dlg:style-id="1" dlg:font-name="Cumberland" dlg:font-stylename="Standard" dlg:font-family="modern" dlg:font-charset="ansi"/> + <dlg:style dlg:style-id="2" dlg:font-name="Cumberland" dlg:font-stylename="Standard" dlg:font-family="modern" dlg:font-charset="ansi"/> </dlg:styles> <dlg:bulletinboard> - <dlg:menulist dlg:id="lstHolidays" dlg:tab-index="0" dlg:left="6" dlg:top="17" dlg:width="105" dlg:height="12" dlg:page="1" dlg:spin="true"/> - <dlg:fixedline dlg:id="hlnCalendar" dlg:tab-index="1" dlg:left="6" dlg:top="36" dlg:width="105" dlg:height="8" dlg:page="1" dlg:value="hlnCalendar"/> + <dlg:menulist dlg:id="lstHolidays" dlg:tab-index="0" dlg:left="6" dlg:top="17" dlg:width="95" dlg:height="12" dlg:page="1" dlg:help-url="HID:34708" dlg:spin="true"/> + <dlg:fixedline dlg:id="hlnCalendar" dlg:tab-index="1" dlg:left="6" dlg:top="36" dlg:width="95" dlg:height="8" dlg:page="1" dlg:value="hlnCalendar"/> <dlg:radiogroup> - <dlg:radio dlg:id="optYear" dlg:tab-index="2" dlg:left="12" dlg:top="47" dlg:width="81" dlg:height="10" dlg:page="1" dlg:value="optYear"> + <dlg:radio dlg:id="optYear" dlg:tab-index="2" dlg:left="12" dlg:top="47" dlg:width="81" dlg:height="10" dlg:page="1" dlg:help-url="HID:34702" dlg:value="optYear"> <script:event script:event-name="on-performaction" script:location="application" script:macro-name="Schedule.CalendarMain.CalChooseCalendar" script:language="StarBasic"/> </dlg:radio> - <dlg:radio dlg:id="optMonth" dlg:tab-index="3" dlg:left="13" dlg:top="61" dlg:width="81" dlg:height="10" dlg:page="1" dlg:value="optMonth"> + <dlg:radio dlg:id="optMonth" dlg:tab-index="3" dlg:left="13" dlg:top="61" dlg:width="81" dlg:height="10" dlg:page="1" dlg:help-url="HID:34703" dlg:value="optMonth"> <script:event script:event-name="on-performaction" script:location="application" script:macro-name="Schedule.CalendarMain.CalChooseCalendar" script:language="StarBasic"/> </dlg:radio> </dlg:radiogroup> <dlg:text dlg:id="lblHolidays" dlg:tab-index="4" dlg:left="6" dlg:top="6" dlg:width="87" dlg:height="8" dlg:page="1" dlg:value="lblHolidays"/> - <dlg:img dlg:id="imgCountry" dlg:tab-index="5" dlg:left="119" dlg:top="10" dlg:width="83" dlg:height="103" dlg:page="1"> + <dlg:img dlg:style-id="0" dlg:id="imgCountry" dlg:tab-index="5" dlg:left="106" dlg:top="6" dlg:width="95" dlg:height="113" dlg:page="1" dlg:help-url="HID:34701" dlg:scale-image="false"> <script:event script:event-name="on-mousedown" script:location="application" script:macro-name="Schedule.DlgControl.SelectState" script:language="StarBasic"/> <script:event script:event-name="on-mouseout" script:location="application" script:macro-name="Schedule.DlgControl.MouseLeavesImage" script:language="StarBasic"/> <script:event script:event-name="on-mousemove" script:location="application" script:macro-name="Schedule.DlgControl.CalMouseMoved" script:language="StarBasic"/> </dlg:img> - <dlg:fixedline dlg:id="hlnTime" dlg:tab-index="6" dlg:left="5" dlg:top="78" dlg:width="105" dlg:height="8" dlg:page="1" dlg:value="hlnTime"/> - <dlg:menulist dlg:id="lstMonth" dlg:tab-index="7" dlg:left="65" dlg:top="106" dlg:width="40" dlg:height="12" dlg:page="1" dlg:spin="true"/> + <dlg:fixedline dlg:id="hlnTime" dlg:tab-index="6" dlg:left="5" dlg:top="78" dlg:width="95" dlg:height="8" dlg:page="1" dlg:value="hlnTime"/> + <dlg:menulist dlg:id="lstMonth" dlg:tab-index="7" dlg:left="62" dlg:top="106" dlg:width="38" dlg:height="12" dlg:page="1" dlg:help-url="HID:34705" dlg:spin="true"/> <dlg:text dlg:id="lblYear" dlg:tab-index="8" dlg:left="12" dlg:top="91" dlg:width="46" dlg:height="8" dlg:page="1" dlg:value="lblYear"/> <dlg:text dlg:id="lblMonth" dlg:tab-index="9" dlg:left="12" dlg:top="108" dlg:width="46" dlg:height="8" dlg:page="1" dlg:value="lblMonth"/> <dlg:fixedline dlg:id="FixedLine1" dlg:tab-index="10" dlg:left="6" dlg:top="125" dlg:width="196" dlg:height="4"/> - <dlg:button dlg:id="cmdCancel" dlg:tab-index="11" dlg:left="6" dlg:top="136" dlg:width="50" dlg:height="14" dlg:value="cmdCancel"> + <dlg:button dlg:id="cmdCancel" dlg:tab-index="11" dlg:left="6" dlg:top="136" dlg:width="50" dlg:height="14" dlg:help-url="HID:34721" dlg:value="cmdCancel"> <script:event script:event-name="on-performaction" script:location="application" script:macro-name="Schedule.CalendarMain.CalcmdCancel" script:language="StarBasic"/> </dlg:button> - <dlg:button dlg:id="cmdOwnData" dlg:tab-index="12" dlg:left="99" dlg:top="136" dlg:width="50" dlg:height="14" dlg:value="cmdOwnData"> + <dlg:button dlg:id="cmdOwnData" dlg:tab-index="12" dlg:left="99" dlg:top="136" dlg:width="50" dlg:height="14" dlg:help-url="HID:34720" dlg:value="cmdOwnData"> <script:event script:event-name="on-performaction" script:location="application" script:macro-name="Schedule.DlgControl.CalmdSwitchOwnDataOrGeneral" script:language="StarBasic"/> </dlg:button> - <dlg:button dlg:id="cmdGoOn" dlg:tab-index="13" dlg:left="152" dlg:top="136" dlg:width="50" dlg:height="14" dlg:value="cmdGoOn"> + <dlg:button dlg:id="cmdGoOn" dlg:tab-index="13" dlg:left="152" dlg:top="136" dlg:width="50" dlg:height="14" dlg:help-url="HID:34722" dlg:value="cmdGoOn"> <script:event script:event-name="on-performaction" script:location="application" script:macro-name="Schedule.CalendarMain.CalcmdOk" script:language="StarBasic"/> </dlg:button> <dlg:text dlg:id="lblEvent" dlg:tab-index="14" dlg:left="12" dlg:top="17" dlg:width="67" dlg:height="8" dlg:page="2" dlg:value="lblEvent"/> <dlg:fixedline dlg:id="hlnNewEvent" dlg:tab-index="15" dlg:left="6" dlg:top="6" dlg:width="196" dlg:height="8" dlg:page="2" dlg:value="hlnNewEvent"/> - <dlg:textfield dlg:style-id="0" dlg:id="txtEvent" dlg:tab-index="16" dlg:left="12" dlg:top="28" dlg:width="107" dlg:height="12" dlg:page="2"> + <dlg:textfield dlg:style-id="1" dlg:id="txtEvent" dlg:tab-index="16" dlg:left="12" dlg:top="28" dlg:width="107" dlg:height="12" dlg:page="2" dlg:help-url="HID:34712"> <script:event script:event-name="on-textchange" script:location="application" script:macro-name="Schedule.OwnEvents.CheckInsertedDates" script:language="StarBasic"/> </dlg:textfield> - <dlg:numericfield dlg:id="txtOwnEventDay" dlg:tab-index="17" dlg:left="13" dlg:top="55" dlg:width="30" dlg:height="12" dlg:page="2" dlg:decimal-accuracy="0" dlg:value-min="1.0"> + <dlg:checkbox dlg:id="chkEventOnce" dlg:tab-index="17" dlg:left="140" dlg:top="29" dlg:width="62" dlg:height="10" dlg:page="2" dlg:help-url="HID:34713" dlg:value="chkEventOnce" dlg:checked="false"> + <script:event script:event-name="on-performaction" script:location="application" script:macro-name="Schedule.DlgControl.ToggleYearBox" script:language="StarBasic"/> + </dlg:checkbox> + <dlg:numericfield dlg:id="txtOwnEventDay" dlg:tab-index="18" dlg:left="13" dlg:top="55" dlg:width="30" dlg:height="12" dlg:page="2" dlg:help-url="HID:34714" dlg:decimal-accuracy="0" dlg:value-min="1.0"> <script:event script:event-name="on-textchange" script:location="application" script:macro-name="Schedule.OwnEvents.CheckInsertedDates" script:language="StarBasic"/> </dlg:numericfield> - <dlg:checkbox dlg:id="chkEventOnce" dlg:tab-index="18" dlg:left="140" dlg:top="29" dlg:width="62" dlg:height="10" dlg:page="2" dlg:value="chkEventOnce"> - <script:event script:event-name="on-itemstatechange" script:location="application" script:macro-name="Schedule.DlgControl.ToggleYearBox" script:language="StarBasic"/> - </dlg:checkbox> - <dlg:menulist dlg:id="lstOwnEventMonth" dlg:tab-index="19" dlg:left="60" dlg:top="55" dlg:width="30" dlg:height="12" dlg:page="2" dlg:spin="true"> + <dlg:menulist dlg:id="lstOwnEventMonth" dlg:tab-index="19" dlg:left="60" dlg:top="55" dlg:width="30" dlg:height="12" dlg:page="2" dlg:help-url="HID:34716" dlg:spin="true"> <script:event script:event-name="on-itemstatechange" script:location="application" script:macro-name="Schedule.OwnEvents.GetOwnMonth" script:language="StarBasic"/> </dlg:menulist> - <dlg:button dlg:id="cmdInsert" dlg:tab-index="20" dlg:left="99" dlg:top="70" dlg:width="50" dlg:height="14" dlg:page="2" dlg:value="cmdInsert"> + <dlg:numericfield dlg:id="txtOwnEventYear" dlg:tab-index="20" dlg:left="110" dlg:top="55" dlg:width="40" dlg:height="12" dlg:page="2" dlg:help-url="HID:34718" dlg:decimal-accuracy="0" dlg:value-min="1582.0" dlg:value-max="9957.0" dlg:spin="true"> + <script:event script:event-name="on-textchange" script:location="application" script:macro-name="Schedule.OwnEvents.CheckInsertedDates" script:language="StarBasic"/> + </dlg:numericfield> + <dlg:button dlg:id="cmdInsert" dlg:tab-index="21" dlg:left="99" dlg:top="70" dlg:width="50" dlg:height="14" dlg:page="2" dlg:help-url="HID:34710" dlg:value="cmdInsert"> <script:event script:event-name="on-performaction" script:location="application" script:macro-name="Schedule.OwnEvents.CalcmdInsertData" script:language="StarBasic"/> </dlg:button> - <dlg:button dlg:id="cmdDelete" dlg:tab-index="21" dlg:left="152" dlg:top="70" dlg:width="50" dlg:height="14" dlg:page="2" dlg:value="cmdDelete"> + <dlg:button dlg:id="cmdDelete" dlg:tab-index="22" dlg:left="152" dlg:top="70" dlg:width="50" dlg:height="14" dlg:page="2" dlg:help-url="HID:34711" dlg:value="cmdDelete"> <script:event script:event-name="on-performaction" script:location="application" script:macro-name="Schedule.DlgControl.CalcmdDeleteSelect" script:language="StarBasic"/> </dlg:button> - <dlg:menulist dlg:style-id="1" dlg:id="lstOwnData" dlg:tab-index="22" dlg:left="12" dlg:top="86" dlg:width="190" dlg:height="34" dlg:page="2"> + <dlg:menulist dlg:style-id="2" dlg:id="lstOwnData" dlg:tab-index="23" dlg:left="12" dlg:top="86" dlg:width="190" dlg:height="34" dlg:page="2" dlg:help-url="HID:34709"> <script:event script:event-name="on-itemstatechange" script:location="application" script:macro-name="Schedule.DlgControl.CalUpdateNewEventFrame" script:language="StarBasic"/> </dlg:menulist> - <dlg:text dlg:id="lblEventDay" dlg:tab-index="23" dlg:left="12" dlg:top="44" dlg:width="44" dlg:height="8" dlg:page="2" dlg:value="lblEventDay"/> - <dlg:text dlg:id="lblEventMonth" dlg:tab-index="24" dlg:left="60" dlg:top="44" dlg:width="44" dlg:height="8" dlg:page="2" dlg:value="lblEventMonth"/> - <dlg:text dlg:id="lblEventYear" dlg:tab-index="25" dlg:left="110" dlg:top="44" dlg:width="59" dlg:height="8" dlg:page="2" dlg:value="lblEventYear"/> - <dlg:numericfield dlg:id="txtOwnEventYear" dlg:tab-index="26" dlg:left="110" dlg:top="55" dlg:width="40" dlg:height="12" dlg:page="2" dlg:decimal-accuracy="0" dlg:value-min="1582.0" dlg:value-max="9957.0" dlg:spin="true"> - <script:event script:event-name="on-textchange" script:location="application" script:macro-name="Schedule.OwnEvents.CheckInsertedDates" script:language="StarBasic"/> - </dlg:numericfield> - <dlg:numericfield dlg:id="txtYear" dlg:tab-index="27" dlg:left="65" dlg:top="89" dlg:width="40" dlg:height="12" dlg:page="1" dlg:decimal-accuracy="0" dlg:value-min="1582.0" dlg:value-max="9957.0" dlg:spin="true"/> + <dlg:text dlg:id="lblEventDay" dlg:tab-index="24" dlg:left="12" dlg:top="44" dlg:width="44" dlg:height="8" dlg:page="2" dlg:value="lblEventDay"/> + <dlg:text dlg:id="lblEventMonth" dlg:tab-index="25" dlg:left="60" dlg:top="44" dlg:width="44" dlg:height="8" dlg:page="2" dlg:value="lblEventMonth"/> + <dlg:text dlg:id="lblEventYear" dlg:tab-index="26" dlg:left="110" dlg:top="44" dlg:width="59" dlg:height="8" dlg:page="2" dlg:value="lblEventYear"/> + <dlg:numericfield dlg:id="txtYear" dlg:tab-index="27" dlg:left="62" dlg:top="89" dlg:width="38" dlg:height="12" dlg:page="1" dlg:help-url="HID:34704" dlg:decimal-accuracy="0" dlg:value-min="1582.0" dlg:value-max="9957.0" dlg:spin="true"/> </dlg:bulletinboard> </dlg:window>
\ No newline at end of file diff --git a/wizards/source/schedule/DlgControl.xba b/wizards/source/schedule/DlgControl.xba index 36683a875..1a63cb126 100644 --- a/wizards/source/schedule/DlgControl.xba +++ b/wizards/source/schedule/DlgControl.xba @@ -83,6 +83,7 @@ Dim ListIndex as Integer Select Case sCurLangLocale Case cLANGUAGE_GERMAN If bSelectByMouseMove Then +' oStatusLine.SetText(aEvent.X & " ; " & aEvent.Y) ListIndex = CalGetGermanLandAtMousePos(aEvent.X, aEvent.Y, Land$) DlgCalendar.GetControl("lstHolidays").SelectItemPos(ListIndex, True) End If @@ -104,30 +105,6 @@ Sub MouseLeavesImage End Sub -'Sub CalChangeGeneralMonth() -' -' Dim MonthToCheck$ -' Dim ValMonthToCheck% -' -' MonthToCheck$ = DlgCalModel.txtMonth.Text -' ValMonthToCheck% = Val(MonthToCheck$) -' -' If (ValMonthToCheck% >= 1) And (ValMonthToCheck% <=12) Then -' DlgCalModel.txtMonth.Text = cCalShortMonthNames$(ValMonthToCheck%) -' Exit Sub -' End If -' -' If CalGetIntOfShortMonthName%(Trim(Left(MonthToCheck$, 3))) = 0 Then -' Beep -' DlgCalModel.txtMonth.Text = DlgCalModel.txtMonth.Tag -' Else -' DlgCalModel.txtMonth.Text = Trim(Left(MonthToCheck, 3)) -' End If -' -'End Sub - - - Sub CalClearInputMask() Dim NullList() as String ' Löscht die Werte der Eingabe Controls für ein neues Ereignis. diff --git a/wizards/source/schedule/GermanHolidays.xba b/wizards/source/schedule/GermanHolidays.xba index f619144d1..6f01c4c99 100644 --- a/wizards/source/schedule/GermanHolidays.xba +++ b/wizards/source/schedule/GermanHolidays.xba @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> -<script:module xmlns:script="http://openoffice.org/2000/script" script:name="HolidayGerman" script:language="StarBasic">Option Explicit +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="GermanHolidays" script:language="StarBasic">Option Explicit Sub Main() Call CalAutopilotTable() @@ -8,58 +8,58 @@ End Sub Function CalGetGermanLandAtMousePos(byval X as single, byval Y as single) as Integer CalChoosenLand = 0 - If (X>68)And(X<125)And(Y>116)And(Y<176) Then + If (X>73)And(X<130)And(Y>121)And(Y<181) Then CalChoosenLand = CalBLBayern - ElseIf (X>36)And(X<84)And(Y>131)And(Y<178) Then + ElseIf (X>41)And(X<89)And(Y>136)And(Y<183) Then CalChoosenLand = CalBLBadenWuert - ElseIf (X>9)And(X<26)And(Y>128)And(Y<139) Then + ElseIf (X>14)And(X<31)And(Y>133)And(Y<144) Then CalChoosenLand = CalBLSaarland - ElseIf (X>8)And(X<37)And(Y>107)And(Y<141) Then + ElseIf (X>13)And(X<42)And(Y>111)And(Y<146) Then CalChoosenLand = CalBLRheinlandPfalz - ElseIf (X>5)And(X<53)And(Y>65)And(Y<107) Then + ElseIf (X>10)And(X<58)And(Y>70)And(Y<112) Then CalChoosenLand = CalBLNordrheinWest - ElseIf (X>39)And(X<70)And(Y>87)And(Y<131) Then + ElseIf (X>44)And(X<75)And(Y>92)And(Y<136) Then CalChoosenLand = CalBLHessen - ElseIf (X>70)And(X<105)And(Y>83)And(Y<116) Then + ElseIf (X>75)And(X<110)And(Y>88)And(Y<120) Then CalChoosenLand = CalBLThueringen - ElseIf (X>105)And(X<150)And(Y>82)And(Y<107) Then + ElseIf (X>110)And(X<155)And(Y>87)And(Y<112) Then CalChoosenLand = CalBLSachsen - ElseIf (X>47)And(X<85)And(Y>6)And(Y<37) Then + ElseIf (X>52)And(X<90)And(Y>11)And(Y<42) Then CalChoosenLand = CalBLSchlHolstein - ElseIf (X>74)And(X<85)And(Y>37)And(Y<43) Then + ElseIf (X>79)And(X<90)And(Y>42)And(Y<48) Then CalChoosenLand = CalBLHamburg - ElseIf (X>85)And(X<138)And(Y>18)And(Y<45) Then + ElseIf (X>90)And(X<143)And(Y>23)And(Y<50) Then CalChoosenLand = CalBLMeckPomm - ElseIf (X>49)And(X<55)And(Y>41)And(Y<47) Then + ElseIf (X>54)And(X<60)And(Y>46)And(Y<52) Then CalChoosenLand = CalBLBremen - ElseIf (X>51)And(X<65)And(Y>53)And(Y<60) Then + ElseIf (X>53)And(X<67)And(Y>55)And(Y<62) Then CalChoosenLand = CalBLBremen - ElseIf (X>23)And(X<85)And(Y>38)And(Y<67) Then + ElseIf (X>25)And(X<87)And(Y>40)And(Y<69) Then CalChoosenLand = CalBLNiedersachsen - ElseIf (X>53)And(X<85)And(Y>67)And(Y<83) Then + ElseIf (X>55)And(X<87)And(Y>69)And(Y<85) Then CalChoosenLand = CalBLNiedersachsen - ElseIf (X>85)And(X<105)And(Y>45)And(Y<83) Then + ElseIf (X>87)And(X<107)And(Y>47)And(Y<85) Then CalChoosenLand = CalBLSachsenAnhalt - ElseIf (X>116)And(X<130)And(Y>58)And(Y<68) Then + ElseIf (X>122)And(X<135)And(Y>62)And(Y<72) Then CalChoosenLand = CalBLBerlin - ElseIf (X>105)And(X<144)And(Y>45)And(Y<82) Then + ElseIf (X>107)And(X<146)And(Y>47)And(Y<84) Then CalChoosenLand = CalBLBrandenburg End If ' If (CalChoosenLand >= Lbound(BLNameList)) AND ((CalChoosenLand <= Ubound(BLNameList))) Then diff --git a/wizards/source/schedule/Language.xba b/wizards/source/schedule/Language.xba index a7d6ee2ab..cc650dd87 100644 --- a/wizards/source/schedule/Language.xba +++ b/wizards/source/schedule/Language.xba @@ -49,17 +49,6 @@ Const dlgShortMonth = 1225 BLNameList(16) = "Thüringen" DlgCalModel.lstHolidays.StringItemList() = BLNameList() -' Dim FirstItem as String -' -' FirstItem = GetResText(1100) -' DlgCalModel.lstSpecBankholidays.AddItem(FirstItem) -' For i = 1 To Ubound(BLNameList()) -' DlgCalModel.cmbState.AddItem(BLNameList(i)) -' Next i - Else -' printdbgInfo DlgCalendar.GetControl("lblSpecBankholidays") -' DlgCalendar.GetControl("lblSpecBankholidays").Visible = False -' DlgCalendar.GetControl("lstSpecBankholidays").Visible = False End If sWizardTitle$ = GetResText(1300) sError$ = GetResText(1301) diff --git a/wizards/source/schedule/LocalHolidays.xba b/wizards/source/schedule/LocalHolidays.xba index a94219466..84afd458c 100644 --- a/wizards/source/schedule/LocalHolidays.xba +++ b/wizards/source/schedule/LocalHolidays.xba @@ -258,72 +258,30 @@ End Sub Sub FindWholeYearHolidays_US(ByVal YearInt as Integer) -Dim lDate& - -' "Administrative Professionals' Day" "False" 8 "4,4" -' "Grandparents' Day" "False" 1 "9,2,6" - +Dim lDate as Long +Dim lFirstNov as Long +Dim lElectDate as Long CalInsertBankholiday(DateSerial(YearInt, 1, 1), "New Year's Day", cHolidayType_Full) - CalInsertBankholiday(DateSerial(YearInt, 1, 17), "Martin Luther King", cHolidayType_Full) -' "Birthday of Martin Luther King" "True" 4 "1,2,14" Todo: Was ist richtig? - CalInsertBankholiday(DateSerial(YearInt, 2, 2), "Groundhog Day", cHolidayType_Half) - - CalInsertBankholiday(DateSerial(YearInt, 2, 12), "Lincoln's Birthday", cHolidayType_Half) CalInsertBankholiday(DateSerial(YearInt, 2, 14), "Valentine's Day", cHolidayType_Half) - - CalInsertBankholiday(DateSerial(YearInt, 2, 21), "President's Day", cHolidayType_Full) - CalInsertBankholiday(DateSerial(YearInt, 2, 22), "Washington's Birthday", cHolidayType_Half) -' "Washington's Birthday" "True" 4 "2,2,14" Todo: Was ist richtig? - CalInsertBankholiday(DateSerial(YearInt, 3, 17), "St Patrick's Day", cHolidayType_Half) CalInsertBankholiday(DateSerial(YearInt, 4, 1), "April Fools' Day", cHolidayType_Half) CalInsertBankholiday(DateSerial(YearInt, 4, 22), "Earth Day", cHolidayType_Half) - CalInsertBankholiday(DateSerial(YearInt, 5, 6), "Nurses Day", cHolidayType_Half) + CalInsertBankholiday(DateSerial(YearInt, 5, 6), "Nurses' Day", cHolidayType_Half) + CalInsertBankholiday(DateSerial(YearInt, 6, 14), "Flag Day", cHolidayType_Half) + CalInsertBankholiday(DateSerial(YearInt, 6, 14), "Army Day", cHolidayType_Half) CalInsertBankholiday(DateSerial(YearInt, 6, 19), "Juneteenth(Liberation of Slaves)", cHolidayType_Half) -' CalInsertBankholiday(DateSerial(YearInt, , ), "Sweetest Day", cHolidayType_Half) 'Todo??? -' "Sweetest Day" "False" 1 "10,7,14" - ' Last Monday in May: Menorial Day, Full - lDate = DateSerial(YearInt, 6, 1) - 1 - While WeekDay(lDate) <> 2 - lDate = lDate - 1 - Wend - CalInsertBankholiday(lDate, "Memorial Day", cHolidayType_Full) - - ' Mothers Day : 2nd Sunday in May, Full - CalInsertBankholiday(GetMonthDate(5,1,2), "Mother's Day", cHolidayType_Full) - - ' Fathers Day : 3rd Sunday in June - CalInsertBankholiday(GetMonthDate(6,1,3), "Father's Day", cHolidayType_Half) - - ' Easter, get it with look-up table - lDate = CalEasterTable(YearInt) - CalInsertBankholiday(lDate, "Easter Sunday", cHolidayType_Full) - CalInsertBankholiday(DateSerial(YearInt, 7, 4), "Independence Day", cHolidayType_Full) - CalInsertBankholiday(DateSerial(YearInt, 9, 17), "Citizenship Day or Constitution Day", cHolidayType_Half) - CalInsertBankholiday(DateSerial(YearInt, 10, 9), "Columbus Day", cHolidayType_Half) + CalInsertBankholiday(DateSerial(YearInt, 8, 1), "Air Force Day", cHolidayType_Half) + CalInsertBankholiday(DateSerial(YearInt, 8, 4), "Coast Guard Day", cHolidayType_Half) + CalInsertBankholiday(DateSerial(YearInt, 9, 17), "Citizenship Day or Constitution Day", cHolidayType_Half) CalInsertBankholiday(DateSerial(YearInt, 10, 16), "Bosses' Day", cHolidayType_Half) CalInsertBankholiday(DateSerial(YearInt, 10, 26 ), "Mother-in-Law's Day", cHolidayType_Half) + CalInsertBankholiday(DateSerial(YearInt, 10, 27), "Navy Day", cHolidayType_Half) CalInsertBankholiday(DateSerial(YearInt, 10, 31), "Halloween", cHolidayType_Half) - - ' 1st Monday in Sep : Labor Day, Full - CalInsertBankholiday(GetMonthDate(9,2,1), "Labor Day", cHolidayType_Full) - - ' First Thursday in November - CalInsertBankholiday(GetMonthDate(11, 3, 1), "Election Day", cHolidayType_Full) - - ' 3rd Thu in Nov : Thanksgiving, Full - CalInsertBankholiday(GetMonthDate(11, 5, 21), "Thanksgiving", cHolidayType_Full) - CalInsertBankholiday(GetMonthDate(10, 2 1), "Columbus Day", cHolidayType_Full) - CalInsertBankholiday(GetMonthDate(5, 5, 1), "National Day of Prayer", cHolidayType_Half) - CalInsertBankholiday(GetMonthDate(7, 1, 21), "Parents' Day", cHolidayType_Half) - CalInsertBankholiday(GetMonthDate(8, 1, 1), "Friendship Day", cHolidayType_Half) - CalInsertBankholiday(GetMonthDate(10, 1, 1), "National Children's Day", cHolidayType_Half) - CalInsertBankholiday(GetMonthDate(7, 5, 21), "Armed Forces Day", cHolidayType_Half) - - CalInsertBankholiday(DateSerial(YearInt, 11, 11), "Veteran's Day", cHolidayType_Half) ' Todo: Oder ganzer Feiertag?? + CalInsertBankholiday(DateSerial(YearInt, 11, 10), "Marine Corps Day", cHolidayType_Half) + CalInsertBankholiday(DateSerial(YearInt, 11, 11), "Veteran's Day", cHolidayType_Full) CalInsertBankholiday(DateSerial(YearInt, 12, 7), "Pearl Harbor Remembrance Day", cHolidayType_Half) CalInsertBankholiday(DateSerial(YearInt, 12, 24), "Christmas Eve", cHolidayType_Half) CalInsertBankholiday(DateSerial(YearInt, 12, 25), "Christmas Day", cHolidayType_Full) @@ -332,7 +290,105 @@ Dim lDate& CalInsertBankholiday(DateSerial(YearInt, 12, 28), "Kwanzaa", cHolidayType_Half) CalInsertBankholiday(DateSerial(YearInt, 12, 29), "Kwanzaa", cHolidayType_Half) CalInsertBankholiday(DateSerial(YearInt, 12, 30), "Kwanzaa", cHolidayType_Half) - CalInsertBankholiday(DateSerial(YearInt, 12, 31), "Kwanzaa", cHolidayType_Half) + CalInsertBankholiday(DateSerial(YearInt, 12, 31), "Kwanzaa", cHolidayType_Half) CalInsertBankholiday(DateSerial(YearInt, 12, 31), "New Year's Eve", cHolidayType_Half) + + CalInsertBankholiday(CalEasterTable(YearInt), "Easter Sunday", cHolidayType_Half) + + ' Inauguration Day occurs every 4 years (1997, 2001) in the year following the presidential election + ' always on the 20th of January unless this is a Sunday in which case on Monday 21st January + If YearInt Mod 4 = 1 Then + lDate = DateSerial(YearInt, 1, 20) + If WeekDay(lDate) = 1 Then + CalInsertBankholiday(lDate + 1, "Inauguration Day", cHolidayType_Half) + Else + CalInsertBankholiday(lDate, "Inauguration Day", cHolidayType_Half) + End If + End If + ' First Tuesday in November, but only after the 1st of November and only on evenly numbered years + If YearInt Mod 2 = 0 Then + lFirstNov = DateSerial(YearInt, 11, 1) + lElectDate = GetMonthDate(YearInt, 11, 3, 0) + If lElectDate > lFirstNov Then + CalInsertBankholiday(lElectDate, "Election Day", cHolidayType_Half) + Else + CalInsertBankholiday(lElectDate + 7, "Election Day", cHolidayType_Half) + End If + End If + CalInsertBankholiday(GetMonthDate(YearInt, 1, 2, 14), "Martin Luther King Jr Day", cHolidayType_Full) + CalInsertBankholiday(GetMonthDate(YearInt, 2, 2, 14), "President's Day", cHolidayType_Full) + ' Mothers Day : 2nd Sunday in May, Full + CalInsertBankholiday(GetMonthDate(YearInt, 5,1,7), "Mother's Day", cHolidayType_Full) + + ' Wednesday of the last full week of April Administrative Professionals' Day (formerly Secretaries' Day) + CalInsertBankholiday(GetMonthDate(YearInt, 5, 7, -7)-3, "Administrative Professionals' Day", cHolidayType_Half) + + CalInsertBankholiday(GetMonthDate(YearInt, 5, 5, 0), "National Day of Prayer", cHolidayType_Half) + CalInsertBankholiday(GetMonthDate(YearInt, 5, 7, 14), "Armed Forces Day", cHolidayType_Half) + ' Fathers Day : 3rd Sunday in June + CalInsertBankholiday(GetMonthDate(YearInt, 6,1,14), "Father's Day", cHolidayType_Half) + + ' Last Monday in May: Menorial Day, Full + CalInsertBankholiday(GetMonthDate(YearInt, 6, 2, 0)-7, "Memorial Day", cHolidayType_Full) + CalInsertBankholiday(GetMonthDate(YearInt, 7, 1, 21), "Parents' Day", cHolidayType_Half) + CalInsertBankholiday(GetMonthDate(YearInt, 8, 1, 0), "Friendship Day", cHolidayType_Half) + + ' 1st Monday in Sep : Labor Day, Full + CalInsertBankholiday(GetMonthDate(YearInt, 9, 2, 0), "Labor Day", cHolidayType_Full) + ' Sunday after Labor Day Grandparents' Day + CalInsertBankholiday(GetMonthDate(YearInt, 9, 2, 0)+6, "Grandparents' Day", cHolidayType_Half) + + CalInsertBankholiday(GetMonthDate(YearInt, 10, 1, 0), "National Children's Day", cHolidayType_Half) + CalInsertBankholiday(GetMonthDate(YearInt, 10, 2, 7), "Columbus Day", cHolidayType_Full) + ' Sweetest Day: Third Saturday in October + CalInsertBankholiday(GetMonthDate(YearInt, 10, 7, 14), "Sweetest Day", cHolidayType_Half) + ' 4th Thu in Nov : Thanksgiving, Full + CalInsertBankholiday(GetMonthDate(YearInt, 11, 5, 21), "Thanksgiving", cHolidayType_Full) End Sub -</script:module>
\ No newline at end of file + + +Sub FindWholeYearHolidays_JP(ByVal YearInt as Integer) +Dim lDate& + CalInsertBankholiday(DateSerial(YearInt, 1, 1), "元日", cHolidayType_Full) + + ' 2nd Monday in January + CalInsertBankholiday(GetMonthDate(YearInt, 1, 2, 7), "成人の日", cHolidayType_Full) + CalInsertBankholiday(DateSerial(YearInt, 2, 11), "建国記念の日", cHolidayType_Full) + CalInsertBankholiday(DateSerial(YearInt, 3, 21), "春分の日", cHolidayType_Full) + CalInsertBankholiday(DateSerial(YearInt, 4, 29), "みどりの日", cHolidayType_Full) + CalInsertBankholiday(DateSerial(YearInt, 5, 3), "憲法記念日", cHolidayType_Full) + CalInsertBankholiday(DateSerial(YearInt, 5, 4), "国民の休日", cHolidayType_Full) + CalInsertBankholiday(DateSerial(YearInt, 5, 5), "こどもの日", cHolidayType_Full) + CalInsertBankholiday(DateSerial(YearInt, 9, 23), "秋分の日", cHolidayType_Full) + CalInsertBankholiday(DateSerial(YearInt, 10, 2), "体育の日", cHolidayType_Full) + CalInsertBankholiday(DateSerial(YearInt, 11, 3), "文化の日", cHolidayType_Full) + CalInsertBankholiday(DateSerial(YearInt, 11, 23), "勤労感謝の日", cHolidayType_Full) + CalInsertBankholiday(DateSerial(YearInt, 12, 23), "天皇誕生日", cHolidayType_Full) + If YearInt > 2002 Then + CalInsertBankholiday(GetMonthDate(YearInt, 7, 2, 14), "海の日", cHolidayType_Full) + CalInsertBankholiday(GetMonthDate(YearInt, 9, 2, 14), "敬老の日", cHolidayType_Full) + Else + CalInsertBankholiday(DateSerial(YearInt, 7, 20), "海の日", cHolidayType_Full) + CalInsertBankholiday(DateSerial(YearInt, 9, 15), "敬老の日", cHolidayType_Full) + End If +End Sub + + +Sub FindWholeYearHolidays_TW(YearInt as Integer) + CalInsertBankholiday(DateSerial(YearInt, 2, 28), "和平紀念日", cHolidayType_Full) + CalInsertBankholiday(DateSerial(YearInt, 3, 8), "婦女節", cHolidayType_Half) + CalInsertBankholiday(DateSerial(YearInt, 3, 29), "革命先烈紀念日(青年節)", cHolidayType_Half) + CalInsertBankholiday(DateSerial(YearInt, 4, 4), "兒童節", cHolidayType_Half) + CalInsertBankholiday(DateSerial(YearInt, 4, 5), "民族掃墓節", cHolidayType_Full) + CalInsertBankholiday(DateSerial(YearInt, 5, 1), "勞動節", cHolidayType_Full) + CalInsertBankholiday(DateSerial(YearInt, 5, 19), "佛陀誕辰紀念日", cHolidayType_Full) ' Todo: Wie Columbus Day + CalInsertBankholiday(DateSerial(YearInt, 6, 15), "端午節", cHolidayType_Full) + CalInsertBankholiday(DateSerial(YearInt, 9, 3), "軍人節", cHolidayType_Half) + CalInsertBankholiday(DateSerial(YearInt, 9, 21), "中秋節", cHolidayType_Full) + CalInsertBankholiday(DateSerial(YearInt, 9, 28), "孔子誕辰紀念日(教師節)", cHolidayType_Full) ' Todo: wie Columnbusday + CalInsertBankholiday(DateSerial(YearInt, 10, 10), "國慶日", cHolidayType_Full) + CalInsertBankholiday(DateSerial(YearInt, 10, 25), "臺灣光復節", cHolidayType_Half) + CalInsertBankholiday(DateSerial(YearInt, 10, 31), "先總統 蔣公誕辰紀念日", cHolidayType_Half) + CalInsertBankholiday(DateSerial(YearInt, 12, 11), "國父誕辰紀念日(中華文化復興節)", cHolidayType_Half) + CalInsertBankholiday(DateSerial(YearInt, 12, 25), "行憲紀念日", cHolidayType_Half) +End Sub</script:module>
\ No newline at end of file diff --git a/wizards/source/schedule/OwnEvents.xba b/wizards/source/schedule/OwnEvents.xba index af50b66bc..0de19ec28 100644 --- a/wizards/source/schedule/OwnEvents.xba +++ b/wizards/source/schedule/OwnEvents.xba @@ -242,9 +242,10 @@ Dim bDoEnable as Boolean End Sub -Sub GetOwnMonth +Sub GetOwnMonth() Dim EvYear as Integer EvYear = GetOwnYear() CurOwnMonth = DlgCalModel.lstOwnEventMonth.SelectedItems(0) + 1 DlgCalModel.txtOwnEventDay.ValueMax = CalMaxDayInMonth(EvYear, CurOwnMonth) + CheckInsertedDates() End Sub</script:module>
\ No newline at end of file |