diff options
Diffstat (limited to 'wizards/source/schedule/DlgControl.xba')
-rw-r--r-- | wizards/source/schedule/DlgControl.xba | 148 |
1 files changed, 148 insertions, 0 deletions
diff --git a/wizards/source/schedule/DlgControl.xba b/wizards/source/schedule/DlgControl.xba new file mode 100644 index 000000000000..b7a7c4c957ae --- /dev/null +++ b/wizards/source/schedule/DlgControl.xba @@ -0,0 +1,148 @@ +<?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="DlgControl" script:language="StarBasic">Option Explicit + +Dim CalBitmap As Object +Public bSelectByMouseMove as Boolean +Public fHeightCorrFactor as Double +Public fWidthCorrFactor as Double + + + +Sub Main() + Call CalAutopilotTable() +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 to store the new data + bCalOwnDataChanged = True + 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 + + +Sub CalSaveOwnEventControls() + With DlgCalModel + .txtOwnEventDay.Tag = .txtOwnEventDay.Value + .txtOwnEventMonth.Tag = .txtOwnEventMonth.Text + End With +End Sub + + +Sub CalMouseMoved(aEvent as object) +Dim ListIndex as Integer + Select Case sCurLangLocale + Case cLANGUAGE_GERMAN + If bSelectByMouseMove Then +' oStatusLine.SetText("Position: " & aEvent.X & " ; " & aEvent.Y) + ListIndex = CalGetGermanLandAtMousePos(CInt(aEvent.X/fWidthCorrFactor), CInt(aEvent.Y/fHeightCorrFactor)) + DlgCalendar.GetControl("lstHolidays").SelectItemPos(ListIndex, True) + End If + End Select +End Sub + + +Sub SelectState(aEvent as Object) +Dim ListIndex as Integer + Select Case sCurLangLocale + Case cLANGUAGE_GERMAN + If aEvent.ClickCount >= 1 Then + ListIndex = CalGetGermanLandAtMousePos(CInt(aEvent.X/fWidthCorrFactor), CInt(aEvent.Y/fHeightCorrFactor)) + DlgCalendar.GetControl("lstHolidays").SelectItemPos(ListIndex, True) + bSelectByMouseMove = False + End If + End Select +End Sub + + +Sub MouseLeavesImage + bSelectbyMouseMove = True +End Sub + + +Sub CalClearInputMask() +Dim NullList() as String + With DlgCalModel + .txtEvent.Text = "" + .txtOwnEventDay.SetPropertyToDefault("Value") + .cmdInsert.Enabled = False + End With + 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() + If DlgCalModel.Step = 1 Then + DlgCalModel.Step = 2 + DlgCalModel.cmdOwnData.Label = cCalSubcmdSwitchOwnDataOrGeneral_Back$ + DlgCalModel.cmdInsert.Enabled = DlgCalModel.txtEvent.Text <> "" +' ToggleYearBox() + Else + dim bla as boolean + DlgCalModel.Step = 1 + DlgCalendar.GetControl("lblHolidays").Visible = sCurLangLocale = cLANGUAGE_GERMAN + DlgCalendar.GetControl("lstHolidays").Visible = sCurLangLocale = cLANGUAGE_GERMAN + DlgCalModel.cmdOwnData.Label = cCalSubcmdSwitchOwnDataOrGeneral_OwnData$ + End If +End Sub + + +Sub ToggleInsertButton() + DlgCalModel.cmdInsert.Enabled = LTrim(DlgCalModel.txtEvent.Text) <> "" +End Sub + + +Sub CalUpdateNewEventFrame() +Dim bDoEnable as Boolean +Dim sSelectedItem +Dim ListIndex as Integer +Dim MaxSelIndex 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) + If GetSelectedDateUnits(CurEvDay, CurEvMonth, ListIndex) <> SBDATEUNDEFINED Then + .txtOwnEventDay.Value = CurEvDay + DlgCalendar.GetControl("lstOwnEventMonth").SelectItemPos(CurEvMonth-1, True) + .cmdDelete.Enabled = True + .cmdInsert.Enabled = True + Else + Call CalClearInputMask() + .cmdDelete.Enabled = True + End If + End If + End With +End Sub +</script:module>
\ No newline at end of file |