summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wizards/source/schedule/BankHoliday.xba67
-rw-r--r--wizards/source/schedule/CalendarMain.xba83
-rw-r--r--wizards/source/schedule/CreateTable.xba49
-rw-r--r--wizards/source/schedule/DlgCalendar.xdl66
-rw-r--r--wizards/source/schedule/DlgControl.xba66
-rw-r--r--wizards/source/schedule/Language.xba6
-rw-r--r--wizards/source/schedule/OwnEvents.xba100
7 files changed, 248 insertions, 189 deletions
diff --git a/wizards/source/schedule/BankHoliday.xba b/wizards/source/schedule/BankHoliday.xba
index 70417ee507fd..f36b28b1df29 100644
--- a/wizards/source/schedule/BankHoliday.xba
+++ b/wizards/source/schedule/BankHoliday.xba
@@ -42,82 +42,81 @@ End Sub
-Sub CalInsertBankholiday(byval actDate&, byval Event$, ByVal nBankholidayLevel%)
- Dim DayInYear%
+Sub CalInsertBankholiday(byval CurDate as Long, byval EventName as String, ByVal iLevel as Integer)
+Dim iDay
' Fuegt ein Ereignis in das globale EventArray ein.
' Der Sonderfall der eintreten kann, ist der, dass das Datum
' an dem eingefuegt werden soll, bereits ein Ereignis enthaelt.
' Dann werden beide Ereignisse mit einem Schraegstrich verbunden.
- DayInYear% =(Month(actDate&)-1)*31 +Day(actDate&)
+ iDay =(Month(CurDate)-1)*31 +Day(CurDate)
' Hoehere Prioritaet des Feiertagtyps
- If (0 <> CalTypeOfBankHoliday%(DayInYear%)) Then
- If (nBankholidayLevel% < CalTypeOfBankHoliday%(DayInYear%)) Then
- CalTypeOfBankHoliday%(DayInYear%) = nBankholidayLevel%
+ If (0 <> CalTypeOfBankHoliday(iDay)) Then
+ If (nBankholidayLevel < CalTypeOfBankHoliday(iDay)) Then
+ CalTypeOfBankHoliday(iDay) = iLevel
End If
Else
- CalTypeOfBankHoliday%(DayInYear%) = nBankholidayLevel%
+ CalTypeOfBankHoliday(iDay) = iLevel
End If
- If (CalBankHolidayName$(DayInYear%) = "") Then
- CalBankHolidayName$(DayInYear%) = Event$
+ If (CalBankHolidayName(iDay) = "") Then
+ CalBankHolidayName(iDay) = EventName
Else
- CalBankHolidayName$(DayInYear%) = CalBankHolidayName$(DayInYear%) + " / " + Event$
+ CalBankHolidayName(iDay) = CalBankHolidayName(iDay) & " / " & EventName
End If
End Sub
-Function CalIsLeapYear%(ByVal TheYear%)
- CalIsLeapYear% = TheYear Mod 4 = 0
+Function CalIsLeapYear(ByVal iYear as Integer) as Boolean
+ CalIsLeapYear = iYear Mod 4 = 0
End Function
-Function CalMaxDayInMonth%(byval YearVal%, byval MonthVal%)
- ' Liefert den maximalen Tag eines Monats in einem
- ' bestimmten Jahr.
-
- Dim tmpDate&
- Dim MaxDay%
+Function CalMaxDayInMonth(ByVal iYear as Integer, ByVal iMonth as Integer) as Integer
+' Liefert den maximalen Tag eines Monats in einem
+' bestimmten Jahr.
+ Dim TmpDate as Long
+ Dim MaxDay as Long
MaxDay = 28
- tmpDate& = DateSerial(YearVal%, MonthVal%, MaxDay)
+ TmpDate = DateSerial(iYear, iMonth, MaxDay)
- While Month(tmpDate&) = MonthVal%
- MaxDay% = MaxDay% + 1
- tmpDate& = tmpDate& + 1
+ While Month(TmpDate) = iMonth
+ MaxDay = MaxDay + 1
+ TmpDate = TmpDate + 1
Wend
- Maxday% = MaxDay% - 1
- CalMaxDayInMonth% = MaxDay%
+ Maxday = MaxDay - 1
+ CalMaxDayInMonth() = MaxDay
End Function
-Function CalGetIntOfShortMonthName%(byval MonthName$)
+Function CalGetIntOfShortMonthName(ByVal MonthName as String) as Integer
Dim i as Integer
Dim nMonth as Integer
- nMonth = Val(MonthName$)
+ nMonth = Val(MonthName)
If (1 <= nMonth And 12 >= nMonth) Then
- CalGetIntOfShortMonthName% = nMonth
+ CalGetIntOfShortMonthName = nMonth
Exit Function
End If
- MonthName$ = UCase(Trim(Left(MonthName, 3)))
+ MonthName = UCase(Trim(Left(MonthName, 3)))
- For i = 1 To 12
- If (UCase(cCalShortMonthNames$(i)) = MonthName$) Then
- CalGetIntOfShortMonthName% = i
+ For i = 0 To 11
+ If (UCase(cCalShortMonthNames(i)) = MonthName) Then
+ CalGetIntOfShortMonthName = i+1
Exit Function
End If
Next
' Not Found
- CalGetIntOfShortMonthName% = 0
+ CalGetIntOfShortMonthName = 0
End Function
-Sub CalInsertOwnDataInTables(byval YearToInsert%)
+Sub CalInsertOwnDataInTables(ByVal iSelYear as Integer)
' Fügt die eigenen Individuellen Daten aus der Tabelle in die
' bereits erstellte unsortierte Tabelle ein.
Dim CurEventName as String
@@ -129,7 +128,7 @@ Dim i as Integer
LastIndex = Ubound(DlgCalModel.lstOwnData.StringItemList())
For i = 0 To LastIndex
CurYear = CalGetYearOfEvent(i)
- If (CurYear = YearToInsert) Or (CurYear = 0) Then
+ If (CurYear = iSelYear) Or (CurYear = 0) Then
CurMonth = CalGetMonthofEvent(i)
CurDay = CalGetDayofEvent(i)
CurEventName = CalGetNameOfEvent(i)
diff --git a/wizards/source/schedule/CalendarMain.xba b/wizards/source/schedule/CalendarMain.xba
index 1e03bd877fe8..718a578b5e5f 100644
--- a/wizards/source/schedule/CalendarMain.xba
+++ b/wizards/source/schedule/CalendarMain.xba
@@ -30,8 +30,8 @@ Public cCalSubcmdSwitchOwnDataOrGeneral_Back$
Public cCalSubcmdSwitchOwnDataOrGeneral_OwnData$
'Language
-Public cCalLongMonthNames$(12)
-Public cCalShortMonthNames$(12)
+Public cCalLongMonthNames(11) as String
+Public cCalShortMonthNames(11) as String
Public sBitmapFilename$
Public sCalendarTitle$, sMonthTitle$, sWizardTitle$, sError$
@@ -39,13 +39,15 @@ Public cCalStyleWorkday$, cCalStyleWeekend$
' German only
' Variablen, die zur Verwaltung der Eingabe der Bundesländer dienen
-Public CalChoosenLand%, MouseClicked%, LandWhenClick%
+Public CalChoosenLand as Integer
+' LandWhenClick%, MouseClicked%,
Public LastMousePosX, LastMousePosY As Single
Public oDocument as Object
Public oSheets as Object
Public oSheet as Object
Public oStatusLine as Object
+Public bCancelTask as Boolean
' BL* bedeutet BundesLand*
Public CONST CalBLBayern = 1
@@ -70,15 +72,16 @@ Public DlgCalModel as Object
Sub CalAutopilotTable()
Dim BitmapDir as String
-
+Dim iThisMonth as Integer
' On Error Goto ErrorHandler
BasicLibraries.LoadLibrary("Tools")
+ bDoSelect = True
' HauptRoutine zur Erstellung des Kalenders
oDocument = StarDesktop.ActiveFrame.Controller.Model
oStatusline = oDocument.GetCurrentController.GetFrame.CreateStatusIndicator
sCurLangLocale = oDocument.CharLocale.Language
- DlgCalendar = LoadDialog("Schedule", "Dialog1")
+ DlgCalendar = LoadDialog("Schedule", "DlgCalendar")
DlgCalModel = DlgCalendar.Model
LoadLanguage(sCurLangLocale)
' Da modulübergreifende Variablen unsicher sind,
@@ -88,26 +91,36 @@ Dim BitmapDir as String
BitmapDir = GetOfficeSubPath("Template","wizard/bitmap")
DlgCalModel.imgCountry.ImageURL = BitmapDir & sBitmapFilename
CalChoosenLand = -2
- MouseClicked% = False
+' MouseClicked% = False
' Die Daten für die eigenen Ereignisdaten werden geladen.
CalLoadOwnData()
- DlgCalendar.GetControl("lstMonth").SelectItem(cCalShortMonthNames$(Month(Now())), True)
With DlgCalModel
-' .lbOwnData.FontName = "Courier"
+' Todo: In der DocAssigndatenbank festhalten, dass der Font der Listbox lstOwnEvents für die asiatischen
+' Sprachen von Hand von Cumberland umgesetzt werden muss
.cmdDelete.Enabled = False
' .lstMonth.Tag = DlgCalModel.txtMonth.Text
- .lstMonth.StringItemList() = cCalShortMonthNames$()
- .lstOwnEventMonth.StringItemList() = cCalShortMonthNames$()
+ .lstMonth.StringItemList() = cCalShortMonthNames()
+ .lstOwnEventMonth.StringItemList() = cCalShortMonthNames()
.optYear.State = 1
.txtYear.Text = Year(Now())
.txtYear.Tag = DlgCalModel.txtYear.Text
.Step = 1
End With
CalChooseCalendar() ' month
+ iThisMonth = Month(Now)
+ DlgCalendar.GetControl("lstMonth").SelectItemPos(iThisMonth-1, True)
DlgCalendar.GetControl("lstHolidays").SelectItemPos(0,True)
- DlgCalendar.Visible = True
+
+' bCancelTask = False
+ DlgCalendar.Execute()
+ DlgCalendar.Dispose()
+' Do
+' If Not bCancelTask Then
+' DlgCalendar.Visible = True
+' End If
+' Loop Until bCancelTask
Exit Sub
ErrorHandler:
@@ -124,10 +137,9 @@ End Sub
Sub CalcmdCancel()
- If bCalOwnDataChanged Then
- Call CalSaveOwnData()
- End If
- DlgCalendar.Visible = False
+ Call CalSaveOwnData()
+' bCancelTask = True
+ DlgCalendar.EndExecute 'Visible = False
End Sub
@@ -137,29 +149,20 @@ Sub CalcmdOk()
' It is either given out a month or a year
Dim i, iSelYear as Integer
Dim SelYear as String
- DlgCalendar.Visible = False
-
- If cLANGUAGE_GERMAN = sCurLangLocale Then
- If Ubound(DlgCalModel.lstHolidays.SelectedItems()) > -1 Then
- CalChoosenLand = DlgCalModel.lstHolidays.SelectedItems(0)
- Else
- CalChoosenLand = 0
- End If
- End If
+' DlgCalendar.Visible = False
+
oSheets = oDocument.sheets
- If bCalOwnDataChanged Then
- Call CalSaveOwnData()
- End If
-
- ' Unprotect all tables so they can be deleted or modified
- For i = 0 To oSheets.Count - 1
- oSheets.GetbyIndex(i).unprotect("")
- Next
+ Call CalSaveOwnData()
+ UnprotectSheets(oSheets)
oSheets.RemovebyName(oSheets.GetbyIndex(0).Name)
-
iSelYear = Val(DlgCalModel.txtYear.Text)
Select Case sCurLangLocale
Case cLANGUAGE_GERMAN
+ If Ubound(DlgCalModel.lstHolidays.SelectedItems()) > -1 Then
+ CalChoosenLand = DlgCalModel.lstHolidays.SelectedItems(0)
+ Else
+ CalChoosenLand = 0
+ End If
Call CalFindWholeYearHolidays_GERMANY(iSelYear, CalChoosenLand)
Case cLANGUAGE_ENGLISH
Call FindWholeYearHolidays_US(iSelYear)
@@ -189,22 +192,22 @@ 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
- iMonth = DlgCalModel.lstMonth.SelectedItem(0)
+ iMonth = DlgCalModel.lstMonth.SelectedItems(0) + 1
oSheets.RemovebyName(oSheets.GetbyIndex(1).Name)
oSheet = oSheets.GetbyIndex(0)
- oSheet.Name = sMonthTitle$ + " " + cCalLongMonthNames$(iMonth)
- oDocument.AddActionLock
+ oSheet.Name = sMonthTitle$ + " " + cCalLongMonthNames(iMonth)
+' oDocument.AddActionLock
Call CalCreateMonthTable(iSelYear, iMonth)
End If
- oDocument.RemoveActionLock
- ' Protect the remaining sheet
+' oDocument.RemoveActionLock
oSheet.protect("")
oStatusLine.End
- DlgCalendar.Visible = False
+ DlgCalendar.EndExecute()
+ bCancelTask = True
End Sub
</script:module> \ No newline at end of file
diff --git a/wizards/source/schedule/CreateTable.xba b/wizards/source/schedule/CreateTable.xba
index ef9ffc68c43e..4ea92f962161 100644
--- a/wizards/source/schedule/CreateTable.xba
+++ b/wizards/source/schedule/CreateTable.xba
@@ -8,33 +8,33 @@ Public Const NewYearRow = 4 &apos; Row on year sheet for January 1st
Public Const NewYearColumn = 2 &apos; Column on year sheet for January 1st
-Sub CalCreateYearTable(ByVal YearInt%)
+Sub CalCreateYearTable(ByVal iSelYear as Integer)
&apos; Completes the overview for whole year
&apos; Needed by StarOffice Calc and StarOffice Schedule
-Dim CalDay%, CalMonth%, Count%, nCount%
-
-&apos; Only needed by StarOffice Schedule
+Dim CalDay as Integer
+Dim CalMonth as Integer
+Dim i as Integer
+Dim s as Integer
Dim oYearCell as object
Dim iDate
-Dim i, s as Integer
Dim ColPos, RowPos as Integer
Dim oNameCell, oDateCell as Object
Dim iCellValue as Long
Dim oRangeFebCell, oCellAddress, oFebcell as Object
Dim oRangeBlank as Object
Dim sBlankStyle as String
- On Error Goto ErrorHandling
- oStatusLine.Start(GetResText(sProgress),140)
+&apos; On Error Goto ErrorHandling
+ oStatusLine.Start(&quot;&quot;,140) &apos;GetResText(sProgress)
- iDate = DateSerial(Val(DlgCalModel.txtYear.Text),1,1)
+ iDate = DateSerial(iSelYear,1,1)
&apos; Insert year
oYearCell = oSheet.GetCellRangeByName(&quot;Year&quot;)
- oYearCell.Value = Val(DlgCalModel.txtYear.Text)
+ oYearCell.Value = iSelYear
&apos; Insert holidays
- CalMonth% = 1
- CalDay% = 0
+ CalMonth = 1
+ CalDay = 0
s = 10
oStatusLine.SetValue(s)
For i = 1 To 374
@@ -49,7 +49,7 @@ Dim sBlankStyle as String
RowPos = NewYearRow + CalDay
FormatCalCells(ColPos,RowPos,i)
Next
- If NOT CalIsLeapYear(Val(txtYear.Text)) Then
+ If NOT CalIsLeapYear(iSelYear) Then
&apos; Delete 29th February if necessary
oRangeFebCell = oSheet.GetCellRangeByName(&quot;Feb29&quot;)
oCellAddress = oRangeFebCell.RangeAddress
@@ -69,41 +69,40 @@ End Sub
-Sub CalCreateMonthTable(ByVal YearInt%, ByVal MonthInt%)
+Sub CalCreateMonthTable(ByVal iSelYear as Integer, iSelMonth as Integer)
Dim oMonthCell, oDateCell as Object
Dim iDate as Date
Dim oAddress
Dim i, s as Integer
-Dim StartDay%, TargetMonth%
+Dim iStartDay as Integer
&apos; Completes the monthly calendar
-On Error Goto ErrorHandling
- oStatusLine.Start(GetResText(sProgess),40)
+&apos;On Error Goto ErrorHandling
+ oStatusLine.Start(&quot;&quot;,40) &apos;GetResText(sProgess)
&apos; Set month
- TargetMonth% = CalGetIntOfShortMonthName%(txtMonth.Text)
oMonthCell = oSheet.GetCellRangeByName(&quot;Month&quot;)
-
- iDate = DateSerial(Val(DlgCalModel.txtYear.Text),TargetMonth%,1)
+
+ iDate = DateSerial(iSelYear,iSelMonth,1)
oMonthCell.Value = iDate
&apos; Inserting holidays
- StartDay% = (TargetMonth% - 1) * 31 + 1
+ iStartDay = (iSelMonth - 1) * 31 + 1
s = 5
- For i = StartDay% To StartDay%+30
+ For i = iStartDay To iStartDay + 30
oStatusLine.SetValue(s)
s = s + 1
- FormatCalCells(DateColumn+1,FirstDayRow+i-StartDay,i)
+ FormatCalCells(DateColumn+1,FirstDayRow + i - iStartDay,i)
Next
- oDateCell = oSheet.GetCellbyPosition(DateColumn,FirstDayRow+i-StartDay - 1)
+ oDateCell = oSheet.GetCellbyPosition(DateColumn,FirstDayRow+i-iStartDay - 1)
oAddress = oDateCell.RangeAddress
- Select Case TargetMonth
+ Select Case iSelMonth
Case 2,4,6,9,11
oSheet.RemoveRange(oAddress, com.sun.star.sheet.CellDeleteMode.ROWS)
If TargetMonth = 2 Then
oAddress.StartRow = oAddress.StartRow - 1
oAddress.EndRow = oAddress.StartRow
oSheet.RemoveRange(oAddress, com.sun.star.sheet.CellDeleteMode.ROWS)
- If Not CalIsLeapYear(Val(txtYear.Text)) Then
+ If Not CalIsLeapYear(iSelYear) Then
oAddress.StartRow = oAddress.StartRow - 1
oAddress.EndRow = oAddress.StartRow
oSheet.RemoveRange(oAddress, com.sun.star.sheet.CellDeleteMode.ROWS)
diff --git a/wizards/source/schedule/DlgCalendar.xdl b/wizards/source/schedule/DlgCalendar.xdl
index b3874d002615..81e02be7afed 100644
--- a/wizards/source/schedule/DlgCalendar.xdl
+++ b/wizards/source/schedule/DlgCalendar.xdl
@@ -1,7 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
-
-<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" dlg:id="DlgCalendar" dlg:style-id="0">
+<!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:styles>
- <dlg:style dlg:style-id="0"/>
+ <dlg:style dlg:style-id="0" dlg:font-name="Cumberland" dlg:font-stylename="Standard" dlg:font-family="modern" dlg:font-charset="ansi"/>
</dlg:styles>
+ <dlg:bulletinboard>
+ <dlg:fixedline dlg:id="hlnCalendar" dlg:tab-index="0" dlg:left="6" dlg:top="36" dlg:width="105" dlg:height="8" dlg:page="1" dlg:value="hlnCalendar"/>
+ <dlg:radiogroup>
+ <dlg:radio dlg:id="optYear" dlg:tab-index="1" dlg:left="12" dlg:top="47" dlg:width="81" dlg:height="10" dlg:page="1" 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="2" dlg:left="13" dlg:top="61" dlg:width="81" dlg:height="10" dlg:page="1" 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="3" dlg:left="6" dlg:top="6" dlg:width="87" dlg:height="8" dlg:page="1" dlg:value="lblHolidays"/>
+ <dlg:menulist dlg:id="lstHolidays" dlg:tab-index="4" dlg:left="6" dlg:top="17" dlg:width="105" dlg:height="12" dlg:page="1" dlg:spin="true"/>
+ <dlg:img dlg:id="imgCountry" dlg:tab-index="5" dlg:left="119" dlg:top="10" dlg:width="83" dlg:height="103" dlg:page="1">
+ <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:textfield dlg:id="txtYear" dlg:tab-index="7" dlg:left="65" dlg:top="90" dlg:width="40" dlg:height="12" dlg:page="1"/>
+ <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:button dlg:id="cmdCancel" dlg:tab-index="10" dlg:left="6" dlg:top="136" dlg:width="50" dlg:height="14" 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:fixedline dlg:id="FixedLine1" dlg:tab-index="11" dlg:left="6" dlg:top="125" dlg:width="196" dlg:height="4"/>
+ <dlg:button dlg:id="cmdGoOn" dlg:tab-index="12" dlg:left="152" dlg:top="136" dlg:width="50" dlg:height="14" 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:button dlg:id="cmdOwnData" dlg:tab-index="13" dlg:left="99" dlg:top="136" dlg:width="50" dlg:height="14" 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:menulist dlg:id="lstMonth" dlg:tab-index="14" dlg:left="65" dlg:top="106" dlg:width="40" dlg:height="12" dlg:page="1" dlg:spin="true"/>
+ <dlg:text dlg:id="lblEvent" dlg:tab-index="15" 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="16" dlg:left="6" dlg:top="6" dlg:width="196" dlg:height="8" dlg:page="2" dlg:value="hlnNewEvent"/>
+ <dlg:textfield dlg:id="txtEvent" dlg:tab-index="17" dlg:left="12" dlg:top="28" dlg:width="107" dlg:height="12" dlg:page="2">
+ <script:event script:event-name="on-textchange" script:location="application" script:macro-name="Schedule.OwnEvents.CheckInsertedDates" script:language="StarBasic"/>
+ </dlg:textfield>
+ <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:text dlg:id="lblEventDay" dlg:tab-index="19" dlg:left="12" dlg:top="44" dlg:width="44" dlg:height="8" dlg:page="2" dlg:value="lblEventDay"/>
+ <dlg:textfield dlg:id="txtOwnEventDay" dlg:tab-index="20" dlg:left="12" dlg:top="55" dlg:width="30" dlg:height="12" dlg:page="2">
+ <script:event script:event-name="on-textchange" script:location="application" script:macro-name="Schedule.OwnEvents.CheckInsertedDates" script:language="StarBasic"/>
+ </dlg:textfield>
+ <dlg:button dlg:id="cmdInsert" dlg:tab-index="21" dlg:left="86" dlg:top="71" dlg:width="50" dlg:height="14" dlg:page="2" 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="22" dlg:left="140" dlg:top="70" dlg:width="50" dlg:height="14" dlg:page="2" 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="0" dlg:id="lstOwnData" dlg:tab-index="23" dlg:left="12" dlg:top="86" dlg:width="190" dlg:height="34" dlg:page="2">
+ <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="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:textfield dlg:id="txtOwnEventYear" dlg:tab-index="26" dlg:left="110" dlg:top="55" dlg:width="30" dlg:height="12" dlg:page="2">
+ <script:event script:event-name="on-textchange" script:location="application" script:macro-name="Schedule.OwnEvents.CheckInsertedDates" script:language="StarBasic"/>
+ </dlg:textfield>
+ <dlg:menulist dlg:id="lstOwnEventMonth" dlg:tab-index="27" dlg:left="60" dlg:top="55" dlg:width="30" dlg:height="12" dlg:page="2" dlg:spin="true">
+ <script:event script:event-name="on-itemstatechange" script:location="application" script:macro-name="Schedule.OwnEvents.CheckInsertedDates" script:language="StarBasic"/>
+ </dlg:menulist>
+ </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 deee7546ae4f..61fc14321534 100644
--- a/wizards/source/schedule/DlgControl.xba
+++ b/wizards/source/schedule/DlgControl.xba
@@ -110,26 +110,19 @@ End Sub
Sub CalMouseMoved(aEvent as object)
Dim ListIndex as Integer
- oStatusline.SetText(aEvent.ClickCount)
-&apos; If aEvent.ClickCount = 2 Then
-&apos; oStatusLine.SetText(&quot;Click&quot;)
-&apos; bDoSelect = False
-&apos; Else
-&apos; oStatusLine.SetText(&quot;&quot;)
-&apos; End If
- &apos; Nimmt Mousemoves ueber dem Bitmap entgegen, und wertet sie je nach
- &apos; Land aus.
+ &apos; Nimmt Mousemoves ueber dem Bitmap entgegen, und wertet sie je nach Land aus.
Select Case sCurLangLocale
Case cLANGUAGE_GERMAN
&apos; Ermittelt das Land auf dem sich der MausCursor befindet, und aktualisiert
&apos; die Textbox mit der Bundeslandbezeichnung, falls ein Mausklick stattfandt.
-&apos; If bDoSelect Then
+ oStatusline.SetText(aEvent.ClickCount)
+ If bDoSelect Then
ListIndex = CalGetGermanLandAtMousePos(aEvent.X, aEvent.Y, Land$)
DlgCalendar.GetControl(&quot;lstHolidays&quot;).SelectItemPos(ListIndex, True)
- If aEvent.ClickCount = 2 Then
+ If aEvent.ClickCount = 1 Then
bDoSelect = False
End If
-&apos; End If
+ End If
End Select
LastMousePosX = aEvent.X
@@ -161,12 +154,12 @@ End Sub
-Sub CalChkForChangeInsertAccept
- &apos; Aktualisiert die Label des Insert/Accept Buttons
- If (DataSelectedFromList=True) And (ButtonLabelIsInsert) Then
- DlgCalModel.cmdInsert.Label = cSubChkForChangeInsertAccept_Accpet$
- End If
-End Sub
+&apos;Sub CalChkForChangeInsertAccept
+&apos; Aktualisiert die Label des Insert/Accept Buttons
+&apos;If (DataSelectedFromList=True) And (ButtonLabelIsInsert) Then
+&apos; DlgCalModel.cmdInsert.Label = cSubChkForChangeInsertAccept_Accpet$
+&apos; End If
+&apos;End Sub
@@ -177,7 +170,6 @@ Dim NullList() as String
.chkEventOnce.State = 0
.lblEventYear.Enabled = False
.txtOwnEventYear.Enabled = False
-&apos; SpinOwnEventYear.Enabled = False
.txtOwnEventYear.Text = &quot;&quot;
.txtEvent.Text = &quot;&quot;
.txtOwnEventDay.Text = &quot;&quot;
@@ -208,22 +200,22 @@ Sub ToggleInsertButton()
End Sub
-Sub CalModMonthTextBox(txtMonth As Object,IncFactor as Integer)
- Dim nActVal&amp;
- nActVal&amp; = Val(txtMonth.Text)
- If (1 &lt;= nActVal&amp; And 12 &gt;= nActVal) Then
- txtMonth.Text = cCalShortMonthNames$(nActVal&amp;)
- End If
- nActVal&amp; = CalGetIntOfShortMonthName%(txtMonth.Text)
- If 0 = nActVal&amp; Then
- Beep
- txtMonth.Text = cCalShortMonthNames$(1)
- ElseIf (1 &lt; nActVal&amp;) AND (IncFactor = -1) Then
- txtMonth.Text = cCalShortMonthNames$(nActVal&amp; + IncFactor)
- ElseIf (12 &gt; nActVal&amp;)AND (IncFactor = 1) Then
- txtMonth.Text = cCalShortMonthNames$(nActVal&amp; + IncFactor)
- End If
-End Sub
+&apos;Sub CalModMonthTextBox(txtMonth As Object,IncFactor as Integer)
+&apos; Dim nActVal&amp;
+&apos; nActVal&amp; = Val(txtMonth.Text)
+&apos; If (1 &lt;= nActVal&amp; And 12 &gt;= nActVal) Then
+&apos; txtMonth.Text = cCalShortMonthNames$(nActVal&amp;)
+&apos; End If
+&apos; nActVal&amp; = CalGetIntOfShortMonthName%(txtMonth.Text)
+&apos; If 0 = nActVal&amp; Then
+&apos; Beep
+&apos; txtMonth.Text = cCalShortMonthNames$(1)
+&apos; ElseIf (1 &lt; nActVal&amp;) AND (IncFactor = -1) Then
+&apos; txtMonth.Text = cCalShortMonthNames$(nActVal&amp; + IncFactor)
+&apos; ElseIf (12 &gt; nActVal&amp;)AND (IncFactor = 1) Then
+&apos; txtMonth.Text = cCalShortMonthNames$(nActVal&amp; + IncFactor)
+&apos; End If
+&apos;End Sub
Sub CalUpdateNewEventFrame()
@@ -231,6 +223,7 @@ Dim bDoEnable as Boolean
Dim sSelectedItem
Dim ListIndex as Integer
Dim MaxSelIndex as Integer
+Dim iMonth as Integer
bDoEnable = False
With DlgCalModel
MaxSelIndex = Ubound(DlgCalModel.lstOwnData.SelectedItems())
@@ -238,7 +231,8 @@ Dim MaxSelIndex as Integer
ListIndex = .lstOwnData.SelectedItems(MaxSelIndex)
.txtEvent.Text = CalGetNameofEvent(ListIndex)
.txtOwnEventDay.Text = CalGetDayOfEvent(ListIndex)
- DlgCalendar.GetControl(&quot;lstOwnEventMonth&quot;).SelectItem(CalGetMonthOfEvent(ListIndex), True)
+ iMonth = CalGetMonthOfEvent(ListIndex)
+ DlgCalendar.GetControl(&quot;lstOwnEventMonth&quot;).SelectItemPos(iMonth, True)
.txtOwnEventYear.Text = CalGetYearofEvent(ListIndex)
bDoEnable = DlgCalModel.txtOwnEventYear.Text = &quot;&quot;
.chkEventOnce.State = Abs(bDoEnable)
diff --git a/wizards/source/schedule/Language.xba b/wizards/source/schedule/Language.xba
index d502fdcf5c7f..a7d6ee2ab774 100644
--- a/wizards/source/schedule/Language.xba
+++ b/wizards/source/schedule/Language.xba
@@ -24,7 +24,7 @@ Const dlgMonth = 1200
&apos; Abreviated months start 1225
Const dlgShortMonth = 1225
- If InitResources(&quot;Calendar-template&quot;, &quot;cal&quot;) Then
+ If InitResources(&quot;schedule&quot;, &quot;cal&quot;) Then
If LangLocale = cLANGUAGE_GERMAN Then
DlgCalendar.GetControl(&quot;lblHolidays&quot;).Visible = True
DlgCalendar.GetControl(&quot;lstHolidays&quot;).Visible = True
@@ -91,8 +91,8 @@ Const dlgShortMonth = 1225
.cmdDelete.Label = GetResText(1017)
&apos; Load long month names
For i = 0 To 11
- cCalLongMonthNames(i+1) = GetResText(dlgMonth+i)
- cCalShortMonthNames(i+1)= Left$(cCalLongMonthNames(i+1), 3)
+ cCalLongMonthNames(i) = GetResText(dlgMonth+i)
+ cCalShortMonthNames(i)= Left$(cCalLongMonthNames(i), 3)
Next
&apos; Load sheet names
sCalendarTitle$ = GetResText(1410)
diff --git a/wizards/source/schedule/OwnEvents.xba b/wizards/source/schedule/OwnEvents.xba
index 583afddcef44..cd0d5d26945c 100644
--- a/wizards/source/schedule/OwnEvents.xba
+++ b/wizards/source/schedule/OwnEvents.xba
@@ -6,62 +6,66 @@ Sub Main
Call CalAutopilotTable()
End Sub
-Sub CalSaveOwnData()
+
&apos; Sichert die Daten, die im lbOwnData Control eingegeben wurden.
&apos; Die Datei heißt Date.Dat und wird ins Unterverzeichnis Konfiguration
&apos; des Office3 Verzeichnis geschrieben.
-Dim FileName$
-Dim FileChannel%
- Dim i as Integer
- FileName$ = GetPathSettings(&quot;Config&quot;, False)+ GetPathSeparator() + &quot;DATE.DAT&quot;
- &apos; Falls die Datei neu geschrieben wird, muß sie vorher gelöscht werden
- If Dir$(FileName$) = &quot;DATE.DAT&quot; Then
- kill(FileName$)
- End If
- FileChannel% = FreeFile()
- Open FileName$ For OUTPUT Access WRITE LOCK WRITE As FileChannel%
-
- Write #FileChannel%, &quot;==========================================================&quot;
- Write #FileChannel%, &quot;Don&apos;t edit this file,&quot;
- Write #FileChannel%, &quot;Don&apos;t edit this file!&quot;
- Write #FileChannel%, &quot;----------------------------------------------------------&quot;
- Write #FileChannel%, &quot;It is not allowed to edit this file! Don&apos;t edit this file!&quot;
- Write #FileChannel%, &quot;==========================================================&quot;
+Sub CalSaveOwnData()
+Dim FileName as String
+Dim FileChannel as Integer
+Dim i as Integer
+ If bCalOwnDataChanged Then
+ FileName = GetPathSettings(&quot;Config&quot;, False) &amp; &quot;/&quot; &amp; &quot;DATE.DAT&quot;
+ &apos; Falls die Datei neu geschrieben wird, muß sie vorher gelöscht werden
+ If Dir$(FileName) = &quot;DATE.DAT&quot; Then
+ kill(FileName)
+ End If
+
+ FileChannel = FreeFile()
+ Open FileName For OUTPUT Access WRITE LOCK WRITE As FileChannel
- For i = 0 To Ubound(DlgCalModel.lstOwnData.StringItemList())
- Write #FileChannel%, DlgCalModel.lstOwnData.StringItemList(i)
- Next
+ Write #FileChannel, &quot;==========================================================&quot;
+ Write #FileChannel, &quot;Don&apos;t edit this file,&quot;
+ Write #FileChannel, &quot;Don&apos;t edit this file!&quot;
+ Write #FileChannel, &quot;----------------------------------------------------------&quot;
+ Write #FileChannel, &quot;It is not allowed to edit this file! Don&apos;t edit this file!&quot;
+ Write #FileChannel, &quot;==========================================================&quot;
- Close #FileChannel%
+ For i = 0 To Ubound(DlgCalModel.lstOwnData.StringItemList())
+ Write #FileChannel, DlgCalModel.lstOwnData.StringItemList(i)
+ Next
+ Close #FileChannel
+ End If
End Sub
&apos; Lädt die Daten der persönlichen Ereignisse und
&apos; schreibt diese dann in das Control lbOwnData.
Sub CalLoadOwnData()
-Dim FileName$, tempStr$
-Dim FileChannel%, Count%
+Dim FileName as String
+Dim TempStr as String
+Dim FileChannel as Integer
Dim i as Integer
- FileName$ = GetPathSettings(&quot;Config&quot;, False)+ GetPathSeparator() + &quot;DATE.DAT&quot;
+ FileName = GetPathSettings(&quot;Config&quot;, False) &amp; &quot;/DATE.DAT&quot;
- If Dir(FileName$) = &quot;DATE.DAT&quot; Then
- FileChannel% = FreeFile()
- Open FileName$ For INPUT Access READ LOCK READ As FileChannel%
+ If Dir(FileName) = &quot;DATE.DAT&quot; Then
+ FileChannel = FreeFile()
+ Open FileName For INPUT Access READ LOCK READ As FileChannel
&apos; Kommentare werden eingelesen
- For Count% = 1 To 6
- Line Input #FileChannel%, tempStr$
+ For i = 1 To 6
+ Line Input #FileChannel, TempStr
Next
i = 0
&apos; Einfügen nach Reihenfolge sortiert.
- While (not eof(#FileChannel%))
- Input #FileChannel%, tempStr$
- DlgCalModel.lstOwnData.AddItem(tempStr$, i)
+ While (not eof(#FileChannel))
+ Input #FileChannel, TempStr
+ DlgCalendar.GetControl(&quot;lstOwnData&quot;).AddItem(TempStr, i)
i = i + 1
Wend
- Close #FileChannel%
+ Close #FileChannel
End If
End Sub
@@ -84,7 +88,7 @@ Dim newDate as Date
Dim EvMonth as Integer
Dim EvDay as Integer
Dim EvYear as Integer
- EvMonth = DlgCalModel.lstOwnEventMonth.SelectedItems(0)
+ EvMonth = DlgCalModel.lstOwnEventMonth.SelectedItems(0) + 1
EvDay = Val(DlgCalModel.txtOwnEventDay.Text)
If DlgCalModel.chkEventOnce.State = 1 Then
EvYear = Val(DlgCalModel.txtOwnEventYear.Text)
@@ -132,6 +136,7 @@ Dim bInserted as Boolean
Dim bDateDoubled as Boolean
Dim EvYear as Integer
Dim i as Integer
+Dim CurDate as Date
Dim CurEvYear as Integer
Dim CurEvMonth as Integer
Dim CurEvDay as Integer
@@ -141,14 +146,11 @@ Dim CurEvDay as Integer
If bGetYear Then
EvYear = Val(DlgCalModel.txtOwnEventYear.Text)
If (EvYear &lt;= 1582) OR (EvYear &gt;= 9957) Then
- SetFocusToControl(txtOwnEventMonth)
+ SetFocusToControl(DlgCalModel.txtOwnEventMonth)
Exit Sub
End If
End If
- If DlgCalModel.chkEventOnce.State = 1 Then
- EvYear = Val(DlgCalModel.txtOwnEventYear.Text)
- End If
newDate = CalCreateDateFromInput()
DateStr = CalCreateDateStrOfInput()
If DateStr = &quot;&quot; Then Exit Sub
@@ -201,23 +203,25 @@ Dim CurEvDay as Integer
Loop Until bInserted Or i &gt; LastIndex
End If
- &apos; Das Datum ist noch nicht vorhanden und wir richtig einsortiert
+ &apos; Das Datum ist noch nicht vorhanden und wird richtig einsortiert
If Not bInserted And Not bDateDoubled Then
i = 0
Do
- bInserted = newDate &gt; CalGetDateWithoutYear(i)
- i = i + 1
+ CurDate = CalGetDateWithoutYear(i)
+ bInserted = newDate &lt; CurDate
If bInserted Then
- DlgCalendar.GetControl(&quot;lstOwnData&quot;).AddItem(DateStr, i)
+ Exit Do
End If
+ i = i + 1
Loop Until bInserted Or i &gt; LastIndex
+ DlgCalendar.GetControl(&quot;lstOwnData&quot;).AddItem(DateStr, i)
End If
End If
&apos; Flag zum Speichern der neuen Daten.
- If bInserted = True Then
+&apos; If bInserted Then
bCalOwnDataChanged = True
- End If
+&apos; End If
Call CalClearInputMask()
End Sub
@@ -237,7 +241,7 @@ Dim DayStr as String
End Function
-Function CalGetNameOfEvent(ByVal ListIndex as Integer) as Integer
+Function CalGetNameOfEvent(ByVal ListIndex as Integer) as String
Dim NameStr as String
NameStr = DlgCalModel.lstOwnData.StringItemList(ListIndex)
NameStr = Trim (Mid(NameStr, 16))
@@ -274,8 +278,8 @@ Dim bDoEnable as Boolean
EvDay = Val(DlgCalModel.txtOwnEventDay.Text)
bDoEnable = Ubound(DlgCalModel.lstOwnEventMonth.SelectedItems()) &gt; -1
If bDoEnable Then
- EvMonth = DlgCalModel.lstOwnEventMonth.SelectedItems(0)
- bDoEnable = (EvDay &gt; 1) AND (EvDay &lt; CalMaxDayInMonth(EvYear, EvMonth))
+ EvMonth = DlgCalModel.lstOwnEventMonth.SelectedItems(0) + 1
+ bDoEnable = (EvDay &gt; 1) AND (EvDay &lt;= CalMaxDayInMonth(EvYear, EvMonth))
If bDoEnable Then
bDoEnable = LTrim(DlgCalModel.txtEvent.Text) &lt;&gt; &quot;&quot;
End If