diff options
author | Behrend Cornelius <bc@openoffice.org> | 2002-10-29 09:48:13 +0000 |
---|---|---|
committer | Behrend Cornelius <bc@openoffice.org> | 2002-10-29 09:48:13 +0000 |
commit | 050eec5b4096686f60683441291b6575513f9976 (patch) | |
tree | 5fd59b2fc6711e8fdaf39870fea4dd8a8079e792 /wizards/source/schedule/DlgControl.xba | |
parent | 4457d8cd564ba8e313a4158cef5eab1346e03ce7 (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.xba | 94 |
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()) > -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) - ' Flag zum Speichern der neuen Daten. + ' Flag to store the new data bCalOwnDataChanged = True - DlgCalModel.cmdDelete.Enabled = Ubound(DlgCalModel.lstOwnData.StringItemList()) > -1 - Call CalClearInputMask() + bDoEnable = Ubound(DlgCalModel.lstOwnData.StringItemList()) > -1 + DlgCalModel.cmdDelete.Enabled = bDoEnable + If bDoEnable Then + MaxIndex = Ubound(DlgCalModel.lstOwnData.StringItemList()) + If iSel > MaxIndex Then + iSel = MaxIndex + End If + DlgCalendar.GetControl("lstOwnData").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() -' Falls der RadioButton für einen Jahreskalender angeklickt -' worden ist, müssen die Controls für den Monat Disabled -' 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 >= 1 Then - ListIndex = CalGetGermanLandAtMousePos(CInt(aEvent.X/fWidthCorrFactor), CInt(aEvent.Y/fHeightCorrFactor), Land$) - DlgCalendar.GetControl("lstHolidays").SelectItemPos(ListIndex, True) - bSelectByMouseMove = False - End If + Select Case sCurLangLocale + Case cLANGUAGE_GERMAN + If aEvent.ClickCount >= 1 Then + ListIndex = CalGetGermanLandAtMousePos(CInt(aEvent.X/fWidthCorrFactor), CInt(aEvent.Y/fHeightCorrFactor), Land$) + DlgCalendar.GetControl("lstHolidays").SelectItemPos(ListIndex, True) + bSelectByMouseMove = False + End If + End Select End Sub @@ -81,29 +84,26 @@ End Sub Sub CalClearInputMask() Dim NullList() as String -' 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("Value") .txtEvent.Text = "" .txtOwnEventDay.SetPropertyToDefault("Value") .cmdInsert.Enabled = False End With - DlgCalendar.GetControl("lstOwnEventMonth").SelectItemPos(0,True) - CurOwnMonth = 1 + If Ubound(DlgCalModel.lstOwnData.StringItemList()) > -1 Then + If Ubound(DlgCalModel.lstOwnData.SelectedItems()) = -1 Then + DlgCalendar.GetControl("lstOwnData").SelectItemPos(0,True) + CalUpdateNewEventFrame() + End If + End If End Sub Sub CalmdSwitchOwnDataOrGeneral() - 'Ändert den Titel der Dialogbox beim Seitenwechsel und die - 'Beschriftungen der Knöpfe If DlgCalModel.Step = 1 Then DlgCalModel.Step = 2 DlgCalModel.cmdOwnData.Label = cCalSubcmdSwitchOwnDataOrGeneral_Back$ DlgCalModel.cmdInsert.Enabled = DlgCalModel.txtEvent.Text <> "" - ToggleYearBox() +' 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 > -1 Then ListIndex = .lstOwnData.SelectedItems(MaxSelIndex) .txtEvent.Text = CalGetNameofEvent(ListIndex) - .txtOwnEventDay.Value = CalGetDayOfEvent(ListIndex) - iMonth = CalGetMonthOfEvent(ListIndex) - DlgCalendar.GetControl("lstOwnEventMonth").SelectItemPos(iMonth-1, True) - CurOwnMonth = DlgCalModel.lstOwnEventMonth.SelectedItems(0) + 1 - If CalGetYearofEvent(ListIndex) <> 0 Then - .txtOwnEventYear.Value = CalGetYearofEvent(ListIndex) - bDoEnable = True + If GetSelectedDateUnits(CurEvDay, CurEvMonth, ListIndex) <> SBDATEUNDEFINED Then + .txtOwnEventDay.Value = CurEvDay + DlgCalendar.GetControl("lstOwnEventMonth").SelectItemPos(CurEvMonth-1, True) + .cmdDelete.Enabled = True + .cmdInsert.Enabled = True Else - bDoEnable = False - DlgCalModel.txtOwnEventYear.SetPropertyToDefault("Value") + 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 |