home *** CD-ROM | disk | FTP | other *** search
/ PC World 2004 May / PCWorld_2004-05_cd.bin / akce / openoffice / f_0191 / GermanHolidays.xba < prev    next >
Extensible Markup Language  |  2002-10-29  |  6KB  |  132 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
  3. <script:module xmlns:script="http://openoffice.org/2000/script" script:name="GermanHolidays" script:language="StarBasic">Option Explicit
  4.  
  5. Sub Main()
  6.     Call CalAutopilotTable()
  7. End Sub
  8.  
  9. Function CalGetGermanLandAtMousePos(byval X as single, byval Y as single) as Integer
  10.     CalChoosenLand = 0
  11.     If (X>73)And(X<130)And(Y>=117)And(Y<181) Then
  12.         CalChoosenLand = CalBLBayern
  13.  
  14.     ElseIf (X>41)And(X<89)And(Y>=136)And(Y<183) Then
  15.         CalChoosenLand = CalBLBadenWuert
  16.         
  17.     ElseIf (X>18)And(X<35)And(Y>136)And(Y<147) Then
  18.         CalChoosenLand = CalBLSaarland
  19.         
  20.     ElseIf (X>13)And(X<42)And(Y>111)And(Y<146) Then 
  21.         CalChoosenLand = CalBLRheinlandPfalz
  22.         
  23.     ElseIf (X>15)And(X<=60)And(Y>=69)And(Y<112) Then 
  24.         CalChoosenLand = CalBLNordrheinWest
  25.  
  26.     ElseIf (X>=42)And(X<78)And(Y>=95)And(Y<136) Then 
  27.         CalChoosenLand = CalBLHessen
  28.  
  29.     ElseIf (X>=78)And(X<112)And(Y>=95)And(Y<117) Then 
  30.         CalChoosenLand = CalBLThueringen
  31.         
  32.     ElseIf (X>=112)And(X<158)And(Y>=88)And(Y<114) Then
  33.         CalChoosenLand = CalBLSachsen
  34.  
  35.     ElseIf (X>77)And(X<84)And(Y>35)And(Y<42) Then
  36.         CalChoosenLand = CalBLHamburg
  37.  
  38.     ElseIf (X>56)And(X<60)And(Y>36)And(Y<41) Then 
  39.         CalChoosenLand = CalBLBremen
  40.  
  41.     ElseIf (X>58)And(X<63)And(Y>44)And(Y<52) Then
  42.         CalChoosenLand = CalBLBremen
  43.         
  44.     ElseIf (X>52)And(X<95)And(Y>8)And(Y<40) Then
  45.         CalChoosenLand = CalBLSchlHolstein
  46.  
  47.     ElseIf (X>90)And(X<149)And(Y>23)And(Y<48) Then
  48.         CalChoosenLand = CalBLMeckPomm
  49.  
  50.     ElseIf (X>28)And(X<90)And(Y>35)And(Y<69) Then
  51.         CalChoosenLand = CalBLNiedersachsen
  52.  
  53.     ElseIf (X>60)And(X<90)And(Y>=69)And(Y<95) Then
  54.         CalChoosenLand = CalBLNiedersachsen
  55.  
  56.     ElseIf (X>=90)And(X<=115)And(Y>47)And(Y<95) Then
  57.         CalChoosenLand = CalBLSachsenAnhalt
  58.  
  59.     ElseIf (X>129)And(X<139)And(Y>60)And(Y<66) Then 
  60.         CalChoosenLand = CalBLBerlin
  61.  
  62.     ElseIf (X>115)And(X<151)And(Y>=48)And(Y<88) Then
  63.         CalChoosenLand = CalBLBrandenburg
  64.     End If
  65.     CalGetGermanLandAtMousePos = CalChoosenLand
  66. End Function
  67.  
  68.  
  69.  
  70. Sub CalFindWholeYearHolidays_GERMANY(ByVal iSelYear as Integer, ByVal iCountry as Integer)
  71.     Dim So as Integer
  72.     Dim OsternDate&, VierterAdvent&
  73.  
  74.     If (iCountry < 1) Or (iCountry > 16) Then 
  75.         iCountry = CalBLHamburg
  76.     End If
  77.     OsternDate& = CalEasterTable&(iSelYear)
  78.     So = 1
  79.  
  80.     CalInsertBankholiday(DateSerial(iSelYear, 1, 1), "Neujahr", cHolidayType_Full)
  81.     
  82.     If (iCountry = CalBLBayern) Or (iCountry = CalBLBadenWuert) Or (iCountry = CalBLSachsenAnhalt) Then
  83.         CalInsertBankholiday(DateSerial(iSelYear, 1, 6), "Hl. 3 K├╢nige", cHolidayType_Full)
  84.     End If
  85.     
  86.     CalInsertBankholiday(OsternDate&-2, "Karfreitag", cHolidayType_Full)
  87.     CalInsertBankholiday(OsternDate&, "Ostersonntag", cHolidayType_Full)
  88.     CalInsertBankholiday(OsternDate&+1, "Ostermontag", cHolidayType_Full)
  89.     CalInsertBankholiday(DateSerial(iSelYear, 5, 1), "Maifeiertag", cHolidayType_Full)
  90.     CalInsertBankholiday(OsternDate&+39, "Christi Himmelfahrt", cHolidayType_Full)
  91.     CalInsertBankholiday(OsternDate&+49, "Pfingstsonntag", cHolidayType_Full)
  92.     CalInsertBankholiday(OsternDate&+50, "Pfingstmontag", cHolidayType_Full)
  93.  
  94.     If (iCountry = CalBLBadenWuert) Or (iCountry = CalBLBayern) Or (iCountry = CalBLHessen) Or (iCountry = CalBLNordRheinWest) Or (iCountry = CalBLRheinlandPfalz) Or (iCountry = CalBLSaarland) Or (iCountry = CalBLSachsen) Or (iCountry = CalBLThueringen) Then
  95.         CalInsertBankholiday(OsternDate&+60, "Fronleichnam", cHolidayType_Full)
  96.     End If
  97.  
  98.     If (iCountry = CalBLBayern) Or (iCountry = CalBLSaarland) Then
  99.         CalInsertBankholiday(DateSerial(iSelYear, 8, 15), "Mari├ñ Himmelfahrt", cHolidayType_Full)
  100.     End If
  101.  
  102.     CalInsertBankholiday(DateSerial(iSelYear, 10, 3), "Tag der dt. Einheit", cHolidayType_Full)
  103.  
  104.     If (iCountry=CalBLBrandenburg) Or (iCountry=CalBLMeckPomm) Or (iCountry=CalBLSachsenAnhalt) Or (iCountry=CalBLSachsen) Or (iCountry=CalBLThueringen) Then
  105.         CalInsertBankholiday(DateSerial(iSelYear, 10, 31), "Reformationstag", cHolidayType_Full)
  106.     End If
  107.  
  108.     If (iCountry = CalBLBadenWuert) Or (iCountry = CalBLBayern) Or (iCountry = CalBLNordRheinWest) Or (iCountry = CalBLRheinlandPfalz) Or (iCountry = CalBLSaarland) Or (iCountry = CalBLSachsen) Or (iCountry = CalBLThueringen) Then
  109.         CalInsertBankholiday(DateSerial(iSelYear, 11, 1), "Allerheiligen", cHolidayType_Full)
  110.     End If
  111.  
  112.     vierterAdvent = DateSerial(iSelYear, 12, 24)
  113.     While WeekDay(vierterAdvent) <> So
  114.         vierterAdvent = vierterAdvent - 1
  115.     Wend
  116.  
  117.     If iCountry = CalBLSachsen Then
  118.         CalInsertBankholiday(vierterAdvent-32, "Bu├ƒ- und Bettag", cHolidayType_Full)
  119.     Else
  120.         CalInsertBankholiday(vierterAdvent-32, "Bu├ƒ- und Bettag", cHolidayType_Half)
  121.     End If
  122.     CalInsertBankholiday(vierterAdvent-21, "1. Advent", cHolidayType_Full)
  123.     CalInsertBankholiday(vierterAdvent-14, "2. Advent", cHolidayType_Full)
  124.     CalInsertBankholiday(vierterAdvent-7, "3. Advent", cHolidayType_Full)
  125.     CalInsertBankholiday(vierterAdvent, "4. Advent", cHolidayType_Full)
  126.  
  127.     CalInsertBankholiday(Dateserial(iSelYear, 12, 24), "Heiligabend", cHolidayType_Half)
  128.     CalInsertBankholiday(Dateserial(iSelYear, 12, 25), "1. Weihnachtstag", cHolidayType_Full)
  129.     CalInsertBankholiday(Dateserial(iSelYear, 12, 26), "2. Weihnachtstag", cHolidayType_Full)
  130.     CalInsertBankholiday(Dateserial(iSelYear, 12, 31), "Sylvester", cHolidayType_Half)
  131. End Sub
  132. </script:module>