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=
"DlgControl" script:
language=
"StarBasic">Option Explicit
5 Dim CalBitmap As Object
6 Public bSelectByMouseMove as Boolean
7 Public fHeightCorrFactor as Double
8 Public fWidthCorrFactor as Double
13 Call CalAutopilotTable()
17 Sub CalcmdDeleteSelect()
18 Dim MsgBoxResult as Integer
19 Dim bDoEnable as Boolean
21 Dim MaxIndex as Integer
22 If Ubound(DlgCalModel.lstOwnData.SelectedItems())
> -
1 Then
23 MsgBoxResult = MsgBox(cCalSubcmdDeleteSelect_DeleteSelEntry$,
4+
32, cCalSubcmdDeleteSelect_DeleteSelEntryTitle$)
24 If MsgBoxResult =
6 Then
25 iSel = DlgCalModel.lstOwnData.SelectedItems(
0)
26 DlgCalModel.lstOwnData.StringItemList() = RemoveSelected(DlgCalModel.lstOwnData)
27 ' Flag to store the new data
28 bCalOwnDataChanged = True
29 bDoEnable = Ubound(DlgCalModel.lstOwnData.StringItemList())
> -
1
30 DlgCalModel.cmdDelete.Enabled = bDoEnable
32 MaxIndex = Ubound(DlgCalModel.lstOwnData.StringItemList())
33 If iSel
> MaxIndex Then
36 DlgCalendar.GetControl(
"lstOwnData
").SelectItemPos(iSel, True)
37 CalUpdateNewEventFrame()
39 Call CalClearInputMask()
46 Sub CalSaveOwnEventControls()
48 .txtOwnEventDay.Tag = .txtOwnEventDay.Value
49 .txtOwnEventMonth.Tag = .txtOwnEventMonth.Text
54 Sub CalMouseMoved(aEvent as object)
55 Dim ListIndex as Integer
56 Select Case sCurLangLocale
58 If bSelectByMouseMove Then
59 ' oStatusLine.SetText(
"Position:
" & aEvent.X
& " ;
" & aEvent.Y)
60 ListIndex = CalGetGermanLandAtMousePos(CInt(aEvent.X/fWidthCorrFactor), CInt(aEvent.Y/fHeightCorrFactor))
61 DlgCalendar.GetControl(
"lstHolidays
").SelectItemPos(ListIndex, True)
67 Sub SelectState(aEvent as Object)
68 Dim ListIndex as Integer
69 Select Case sCurLangLocale
71 If aEvent.ClickCount
>=
1 Then
72 ListIndex = CalGetGermanLandAtMousePos(CInt(aEvent.X/fWidthCorrFactor), CInt(aEvent.Y/fHeightCorrFactor))
73 DlgCalendar.GetControl(
"lstHolidays
").SelectItemPos(ListIndex, True)
74 bSelectByMouseMove = False
81 bSelectbyMouseMove = True
85 Sub CalClearInputMask()
86 Dim NullList() as String
88 .txtEvent.Text =
""
89 .txtOwnEventDay.SetPropertyToDefault(
"Value
")
90 .cmdInsert.Enabled = False
92 If Ubound(DlgCalModel.lstOwnData.StringItemList())
> -
1 Then
93 If Ubound(DlgCalModel.lstOwnData.SelectedItems()) = -
1 Then
94 DlgCalendar.GetControl(
"lstOwnData
").SelectItemPos(
0,True)
95 CalUpdateNewEventFrame()
101 Sub CalmdSwitchOwnDataOrGeneral()
102 If DlgCalModel.Step =
1 Then
104 DlgCalModel.cmdOwnData.Label = cCalSubcmdSwitchOwnDataOrGeneral_Back$
105 DlgCalModel.cmdInsert.Enabled = DlgCalModel.txtEvent.Text
<> ""
106 ' ToggleYearBox()
110 DlgCalendar.GetControl(
"lblHolidays
").Visible = sCurLangLocale = cLANGUAGE_GERMAN
111 DlgCalendar.GetControl(
"lstHolidays
").Visible = sCurLangLocale = cLANGUAGE_GERMAN
112 DlgCalModel.cmdOwnData.Label = cCalSubcmdSwitchOwnDataOrGeneral_OwnData$
117 Sub ToggleInsertButton()
118 DlgCalModel.cmdInsert.Enabled = LTrim(DlgCalModel.txtEvent.Text)
<> ""
122 Sub CalUpdateNewEventFrame()
123 Dim bDoEnable as Boolean
125 Dim ListIndex as Integer
126 Dim MaxSelIndex as Integer
127 Dim CurEvMonth as Integer
128 Dim CurEvDay as Integer
129 Dim DateStr as String
132 MaxSelIndex = Ubound(DlgCalModel.lstOwnData.SelectedItems())
133 If MaxSelIndex
> -
1 Then
134 ListIndex = .lstOwnData.SelectedItems(MaxSelIndex)
135 .txtEvent.Text = CalGetNameofEvent(ListIndex)
136 If GetSelectedDateUnits(CurEvDay, CurEvMonth, ListIndex)
<> SBDATEUNDEFINED Then
137 .txtOwnEventDay.Value = CurEvDay
138 DlgCalendar.GetControl(
"lstOwnEventMonth
").SelectItemPos(CurEvMonth-
1, True)
139 .cmdDelete.Enabled = True
140 .cmdInsert.Enabled = True
142 Call CalClearInputMask()
143 .cmdDelete.Enabled = True