Bump for 3.6-28
[LibreOffice.git] / wizards / source / schedule / DlgControl.xba
blobb7a7c4c957ae50b6a664b4d68fd61079b7bb6266
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
12 Sub Main()
13 Call CalAutopilotTable()
14 End Sub
17 Sub CalcmdDeleteSelect()
18 Dim MsgBoxResult as Integer
19 Dim bDoEnable as Boolean
20 Dim iSel as Integer
21 Dim MaxIndex as Integer
22 If Ubound(DlgCalModel.lstOwnData.SelectedItems()) &gt; -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 &apos; Flag to store the new data
28 bCalOwnDataChanged = True
29 bDoEnable = Ubound(DlgCalModel.lstOwnData.StringItemList()) &gt; -1
30 DlgCalModel.cmdDelete.Enabled = bDoEnable
31 If bDoEnable Then
32 MaxIndex = Ubound(DlgCalModel.lstOwnData.StringItemList())
33 If iSel &gt; MaxIndex Then
34 iSel = MaxIndex
35 End If
36 DlgCalendar.GetControl(&quot;lstOwnData&quot;).SelectItemPos(iSel, True)
37 CalUpdateNewEventFrame()
38 Else
39 Call CalClearInputMask()
40 End If
41 End If
42 End If
43 End Sub
46 Sub CalSaveOwnEventControls()
47 With DlgCalModel
48 .txtOwnEventDay.Tag = .txtOwnEventDay.Value
49 .txtOwnEventMonth.Tag = .txtOwnEventMonth.Text
50 End With
51 End Sub
54 Sub CalMouseMoved(aEvent as object)
55 Dim ListIndex as Integer
56 Select Case sCurLangLocale
57 Case cLANGUAGE_GERMAN
58 If bSelectByMouseMove Then
59 &apos; oStatusLine.SetText(&quot;Position: &quot; &amp; aEvent.X &amp; &quot; ; &quot; &amp; aEvent.Y)
60 ListIndex = CalGetGermanLandAtMousePos(CInt(aEvent.X/fWidthCorrFactor), CInt(aEvent.Y/fHeightCorrFactor))
61 DlgCalendar.GetControl(&quot;lstHolidays&quot;).SelectItemPos(ListIndex, True)
62 End If
63 End Select
64 End Sub
67 Sub SelectState(aEvent as Object)
68 Dim ListIndex as Integer
69 Select Case sCurLangLocale
70 Case cLANGUAGE_GERMAN
71 If aEvent.ClickCount &gt;= 1 Then
72 ListIndex = CalGetGermanLandAtMousePos(CInt(aEvent.X/fWidthCorrFactor), CInt(aEvent.Y/fHeightCorrFactor))
73 DlgCalendar.GetControl(&quot;lstHolidays&quot;).SelectItemPos(ListIndex, True)
74 bSelectByMouseMove = False
75 End If
76 End Select
77 End Sub
80 Sub MouseLeavesImage
81 bSelectbyMouseMove = True
82 End Sub
85 Sub CalClearInputMask()
86 Dim NullList() as String
87 With DlgCalModel
88 .txtEvent.Text = &quot;&quot;
89 .txtOwnEventDay.SetPropertyToDefault(&quot;Value&quot;)
90 .cmdInsert.Enabled = False
91 End With
92 If Ubound(DlgCalModel.lstOwnData.StringItemList()) &gt; -1 Then
93 If Ubound(DlgCalModel.lstOwnData.SelectedItems()) = -1 Then
94 DlgCalendar.GetControl(&quot;lstOwnData&quot;).SelectItemPos(0,True)
95 CalUpdateNewEventFrame()
96 End If
97 End If
98 End Sub
101 Sub CalmdSwitchOwnDataOrGeneral()
102 If DlgCalModel.Step = 1 Then
103 DlgCalModel.Step = 2
104 DlgCalModel.cmdOwnData.Label = cCalSubcmdSwitchOwnDataOrGeneral_Back$
105 DlgCalModel.cmdInsert.Enabled = DlgCalModel.txtEvent.Text &lt;&gt; &quot;&quot;
106 &apos; ToggleYearBox()
107 Else
108 dim bla as boolean
109 DlgCalModel.Step = 1
110 DlgCalendar.GetControl(&quot;lblHolidays&quot;).Visible = sCurLangLocale = cLANGUAGE_GERMAN
111 DlgCalendar.GetControl(&quot;lstHolidays&quot;).Visible = sCurLangLocale = cLANGUAGE_GERMAN
112 DlgCalModel.cmdOwnData.Label = cCalSubcmdSwitchOwnDataOrGeneral_OwnData$
113 End If
114 End Sub
117 Sub ToggleInsertButton()
118 DlgCalModel.cmdInsert.Enabled = LTrim(DlgCalModel.txtEvent.Text) &lt;&gt; &quot;&quot;
119 End Sub
122 Sub CalUpdateNewEventFrame()
123 Dim bDoEnable as Boolean
124 Dim sSelectedItem
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
130 bDoEnable = False
131 With DlgCalModel
132 MaxSelIndex = Ubound(DlgCalModel.lstOwnData.SelectedItems())
133 If MaxSelIndex &gt; -1 Then
134 ListIndex = .lstOwnData.SelectedItems(MaxSelIndex)
135 .txtEvent.Text = CalGetNameofEvent(ListIndex)
136 If GetSelectedDateUnits(CurEvDay, CurEvMonth, ListIndex) &lt;&gt; SBDATEUNDEFINED Then
137 .txtOwnEventDay.Value = CurEvDay
138 DlgCalendar.GetControl(&quot;lstOwnEventMonth&quot;).SelectItemPos(CurEvMonth-1, True)
139 .cmdDelete.Enabled = True
140 .cmdInsert.Enabled = True
141 Else
142 Call CalClearInputMask()
143 .cmdDelete.Enabled = True
144 End If
145 End If
146 End With
147 End Sub
148 </script:module>