summaryrefslogtreecommitdiff
path: root/wizards/source/schedule/DlgControl.xba
diff options
context:
space:
mode:
authorBehrend Cornelius <bc@openoffice.org>2002-10-29 09:48:13 +0000
committerBehrend Cornelius <bc@openoffice.org>2002-10-29 09:48:13 +0000
commit050eec5b4096686f60683441291b6575513f9976 (patch)
tree5fd59b2fc6711e8fdaf39870fea4dd8a8079e792 /wizards/source/schedule/DlgControl.xba
parent4457d8cd564ba8e313a4158cef5eab1346e03ce7 (diff)
#96771# Own Holidays that occur once no longer supported
Diffstat (limited to 'wizards/source/schedule/DlgControl.xba')
-rw-r--r--wizards/source/schedule/DlgControl.xba94
1 files changed, 43 insertions, 51 deletions
diff --git a/wizards/source/schedule/DlgControl.xba b/wizards/source/schedule/DlgControl.xba
index 0ba3ca42e..275e507fa 100644
--- a/wizards/source/schedule/DlgControl.xba
+++ b/wizards/source/schedule/DlgControl.xba
@@ -8,6 +8,7 @@ Public fHeightCorrFactor as Double
Public fWidthCorrFactor as Double
+
Sub Main()
Call CalAutopilotTable()
End Sub
@@ -15,14 +16,28 @@ End Sub
Sub CalcmdDeleteSelect()
Dim MsgBoxResult as Integer
+Dim bDoEnable as Boolean
+Dim iSel as Integer
+Dim MaxIndex as Integer
If Ubound(DlgCalModel.lstOwnData.SelectedItems()) &gt; -1 Then
MsgBoxResult = MsgBox(cCalSubcmdDeleteSelect_DeleteSelEntry$, 4+32, cCalSubcmdDeleteSelect_DeleteSelEntryTitle$)
If MsgBoxResult = 6 Then
+ iSel = DlgCalModel.lstOwnData.SelectedItems(0)
DlgCalModel.lstOwnData.StringItemList() = RemoveSelected(DlgCalModel.lstOwnData)
- &apos; Flag zum Speichern der neuen Daten.
+ &apos; Flag to store the new data
bCalOwnDataChanged = True
- DlgCalModel.cmdDelete.Enabled = Ubound(DlgCalModel.lstOwnData.StringItemList()) &gt; -1
- Call CalClearInputMask()
+ bDoEnable = Ubound(DlgCalModel.lstOwnData.StringItemList()) &gt; -1
+ DlgCalModel.cmdDelete.Enabled = bDoEnable
+ If bDoEnable Then
+ MaxIndex = Ubound(DlgCalModel.lstOwnData.StringItemList())
+ If iSel &gt; MaxIndex Then
+ iSel = MaxIndex
+ End If
+ DlgCalendar.GetControl(&quot;lstOwnData&quot;).SelectItemPos(iSel, True)
+ CalUpdateNewEventFrame()
+ Else
+ Call CalClearInputMask()
+ End If
End If
End If
End Sub
@@ -32,21 +47,6 @@ Sub CalSaveOwnEventControls()
With DlgCalModel
.txtOwnEventDay.Tag = .txtOwnEventDay.Value
.txtOwnEventMonth.Tag = .txtOwnEventMonth.Text
- .DlgCalModel.txtOwnEventYear.Tag = DlgCalModel.txtOwnEventYear.Value
- End With
-End Sub
-
-
-Sub ToggleYearBox()
-&apos; Falls der RadioButton für einen Jahreskalender angeklickt
-&apos; worden ist, müssen die Controls für den Monat Disabled
-&apos; werden, da ihre Werte in einer Jahrestabelle aufgehen.
- With DlgCalModel
- .txtOwnEventYear.Enabled = .chkEventOnce.State = 1
- .lblEventYear.Enabled = .chkEventOnce.State = 1
- If .txtOwnEventYear.Value = 0 And .lblEventYear.Enabled Then
- .txtOwnEventYear.Value = Year(Now)
- End If
End With
End Sub
@@ -66,11 +66,14 @@ End Sub
Sub SelectState(aEvent as Object)
Dim ListIndex as Integer
- If aEvent.ClickCount &gt;= 1 Then
- ListIndex = CalGetGermanLandAtMousePos(CInt(aEvent.X/fWidthCorrFactor), CInt(aEvent.Y/fHeightCorrFactor), Land$)
- DlgCalendar.GetControl(&quot;lstHolidays&quot;).SelectItemPos(ListIndex, True)
- bSelectByMouseMove = False
- End If
+ Select Case sCurLangLocale
+ Case cLANGUAGE_GERMAN
+ If aEvent.ClickCount &gt;= 1 Then
+ ListIndex = CalGetGermanLandAtMousePos(CInt(aEvent.X/fWidthCorrFactor), CInt(aEvent.Y/fHeightCorrFactor), Land$)
+ DlgCalendar.GetControl(&quot;lstHolidays&quot;).SelectItemPos(ListIndex, True)
+ bSelectByMouseMove = False
+ End If
+ End Select
End Sub
@@ -81,29 +84,26 @@ End Sub
Sub CalClearInputMask()
Dim NullList() as String
-&apos; Löscht die Werte der Eingabe Controls für ein neues Ereignis.
With DlgCalModel
- .chkEventOnce.State = 0
- .lblEventYear.Enabled = False
- .txtOwnEventYear.Enabled = False
- .txtOwnEventYear.SetPropertyToDefault(&quot;Value&quot;)
.txtEvent.Text = &quot;&quot;
.txtOwnEventDay.SetPropertyToDefault(&quot;Value&quot;)
.cmdInsert.Enabled = False
End With
- DlgCalendar.GetControl(&quot;lstOwnEventMonth&quot;).SelectItemPos(0,True)
- CurOwnMonth = 1
+ If Ubound(DlgCalModel.lstOwnData.StringItemList()) &gt; -1 Then
+ If Ubound(DlgCalModel.lstOwnData.SelectedItems()) = -1 Then
+ DlgCalendar.GetControl(&quot;lstOwnData&quot;).SelectItemPos(0,True)
+ CalUpdateNewEventFrame()
+ End If
+ End If
End Sub
Sub CalmdSwitchOwnDataOrGeneral()
- &apos;Ändert den Titel der Dialogbox beim Seitenwechsel und die
- &apos;Beschriftungen der Knöpfe
If DlgCalModel.Step = 1 Then
DlgCalModel.Step = 2
DlgCalModel.cmdOwnData.Label = cCalSubcmdSwitchOwnDataOrGeneral_Back$
DlgCalModel.cmdInsert.Enabled = DlgCalModel.txtEvent.Text &lt;&gt; &quot;&quot;
- ToggleYearBox()
+&apos; ToggleYearBox()
Else
dim bla as boolean
DlgCalModel.Step = 1
@@ -124,32 +124,24 @@ Dim bDoEnable as Boolean
Dim sSelectedItem
Dim ListIndex as Integer
Dim MaxSelIndex as Integer
-Dim iMonth as Integer
+Dim CurEvMonth as Integer
+Dim CurEvDay as Integer
+Dim DateStr as String
bDoEnable = False
With DlgCalModel
MaxSelIndex = Ubound(DlgCalModel.lstOwnData.SelectedItems())
If MaxSelIndex &gt; -1 Then
ListIndex = .lstOwnData.SelectedItems(MaxSelIndex)
.txtEvent.Text = CalGetNameofEvent(ListIndex)
- .txtOwnEventDay.Value = CalGetDayOfEvent(ListIndex)
- iMonth = CalGetMonthOfEvent(ListIndex)
- DlgCalendar.GetControl(&quot;lstOwnEventMonth&quot;).SelectItemPos(iMonth-1, True)
- CurOwnMonth = DlgCalModel.lstOwnEventMonth.SelectedItems(0) + 1
- If CalGetYearofEvent(ListIndex) &lt;&gt; 0 Then
- .txtOwnEventYear.Value = CalGetYearofEvent(ListIndex)
- bDoEnable = True
+ If GetSelectedDateUnits(CurEvDay, CurEvMonth, ListIndex) &lt;&gt; SBDATEUNDEFINED Then
+ .txtOwnEventDay.Value = CurEvDay
+ DlgCalendar.GetControl(&quot;lstOwnEventMonth&quot;).SelectItemPos(CurEvMonth-1, True)
+ .cmdDelete.Enabled = True
+ .cmdInsert.Enabled = True
Else
- bDoEnable = False
- DlgCalModel.txtOwnEventYear.SetPropertyToDefault(&quot;Value&quot;)
+ Call CalClearInputMask()
+ .cmdDelete.Enabled = True
End If
- .chkEventOnce.State = Abs(bDoEnable)
- .lblEventYear.Enabled = bDoEnable
- .txtOwnEventYear.Enabled = bDoEnable
- .cmdDelete.Enabled = True
- .cmdInsert.Enabled = True
- Else
- Call CalClearInputMask()
- .cmdDelete.Enabled = False
End If
End With
End Sub</script:module> \ No newline at end of file