Skip to content

Commit 5f9129b

Browse files
committed
Implement event editor for MySQL 5.1+ servers. Also, simplify some code around database objects and their editors. Fixes issue HeidiSQL#1527
1 parent ea8574b commit 5f9129b

15 files changed

Lines changed: 992 additions & 246 deletions

packages/delphi2010/heidisql.dpr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ uses
3636
mysql_api in '..\..\source\mysql_api.pas',
3737
mysql_connection in '..\..\source\mysql_connection.pas',
3838
trigger_editor in '..\..\source\trigger_editor.pas' {frmTriggerEditor: TFrame},
39-
searchreplace in '..\..\source\searchreplace.pas' {frmSearchReplace};
39+
searchreplace in '..\..\source\searchreplace.pas' {frmSearchReplace},
40+
event_editor in '..\..\source\event_editor.pas' {frmEventEditor: TFrame};
4041

4142
{$R ..\..\res\icon.RES}
4243
{$R ..\..\res\version.RES}

packages/delphi2010/heidisql.dproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,10 @@
198198
<DCCReference Include="..\..\source\searchreplace.pas">
199199
<Form>frmSearchReplace</Form>
200200
</DCCReference>
201+
<DCCReference Include="..\..\source\event_editor.pas">
202+
<Form>frmEventEditor</Form>
203+
<DesignClass>TFrame</DesignClass>
204+
</DCCReference>
201205
<RcCompile Include="..\..\res\updater.rc">
202206
<Form>updater.res</Form>
203207
</RcCompile>

source/const.inc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ const
279279
ICONINDEX_STOREDFUNCTION = 35;
280280
ICONINDEX_TRIGGER = 137;
281281
ICONINDEX_FUNCTION = 13;
282+
ICONINDEX_EVENT = 80;
282283
ICONINDEX_KEYWORD = 25;
283284

284285
// Size of byte units

source/event_editor.dfm

Lines changed: 355 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,355 @@
1+
object frmEventEditor: TfrmEventEditor
2+
Left = 0
3+
Top = 0
4+
Width = 672
5+
Height = 438
6+
TabOrder = 0
7+
DesignSize = (
8+
672
9+
438)
10+
object lblBody: TLabel
11+
AlignWithMargins = True
12+
Left = 3
13+
Top = 175
14+
Width = 666
15+
Height = 13
16+
Align = alTop
17+
Caption = 'Execution body:'
18+
FocusControl = SynMemoBody
19+
end
20+
object SynMemoBody: TSynMemo
21+
AlignWithMargins = True
22+
Left = 3
23+
Top = 194
24+
Width = 666
25+
Height = 214
26+
Margins.Bottom = 30
27+
SingleLineMode = False
28+
Align = alClient
29+
Font.Charset = DEFAULT_CHARSET
30+
Font.Color = clWindowText
31+
Font.Height = -13
32+
Font.Name = 'Courier New'
33+
Font.Style = []
34+
TabOrder = 1
35+
Gutter.AutoSize = True
36+
Gutter.DigitCount = 2
37+
Gutter.Font.Charset = DEFAULT_CHARSET
38+
Gutter.Font.Color = clWindowText
39+
Gutter.Font.Height = -11
40+
Gutter.Font.Name = 'Courier New'
41+
Gutter.Font.Style = []
42+
Gutter.LeftOffset = 2
43+
Gutter.ShowLineNumbers = True
44+
Highlighter = MainForm.SynSQLSyn1
45+
Lines.Strings = (
46+
'SynMemoBody')
47+
Options = [eoAutoIndent, eoDragDropEditing, eoEnhanceEndKey, eoGroupUndo, eoHideShowScrollbars, eoKeepCaretX, eoShowScrollHint, eoSmartTabDelete, eoSmartTabs, eoTabsToSpaces]
48+
OnChange = Modification
49+
end
50+
object btnHelp: TButton
51+
Left = 3
52+
Top = 410
53+
Width = 75
54+
Height = 25
55+
Anchors = [akLeft, akBottom]
56+
Caption = 'Help'
57+
TabOrder = 2
58+
OnClick = btnHelpClick
59+
end
60+
object btnDiscard: TButton
61+
Left = 84
62+
Top = 410
63+
Width = 75
64+
Height = 25
65+
Anchors = [akLeft, akBottom]
66+
Caption = 'Discard'
67+
TabOrder = 3
68+
OnClick = btnDiscardClick
69+
end
70+
object btnSave: TButton
71+
Left = 165
72+
Top = 410
73+
Width = 75
74+
Height = 25
75+
Anchors = [akLeft, akBottom]
76+
Caption = 'Save'
77+
Default = True
78+
TabOrder = 4
79+
OnClick = btnSaveClick
80+
end
81+
object PageControlMain: TPageControl
82+
AlignWithMargins = True
83+
Left = 3
84+
Top = 3
85+
Width = 666
86+
Height = 166
87+
ActivePage = tabSettings
88+
Align = alTop
89+
Images = MainForm.ImageListMain
90+
TabOrder = 0
91+
OnChange = PageControlMainChange
92+
object tabSettings: TTabSheet
93+
Caption = 'Settings'
94+
ImageIndex = 39
95+
DesignSize = (
96+
658
97+
137)
98+
object lblName: TLabel
99+
Left = 3
100+
Top = 6
101+
Width = 31
102+
Height = 13
103+
Caption = 'Name:'
104+
FocusControl = editName
105+
end
106+
object lblComment: TLabel
107+
Left = 3
108+
Top = 33
109+
Width = 49
110+
Height = 13
111+
Caption = 'Comment:'
112+
end
113+
object editName: TEdit
114+
Left = 88
115+
Top = 3
116+
Width = 567
117+
Height = 21
118+
Anchors = [akLeft, akTop, akRight]
119+
TabOrder = 0
120+
Text = 'editName'
121+
TextHint = 'Enter event name ...'
122+
OnChange = Modification
123+
end
124+
object chkDropAfterExpiration: TCheckBox
125+
Left = 88
126+
Top = 57
127+
Width = 567
128+
Height = 17
129+
Anchors = [akLeft, akTop, akRight]
130+
Caption = 'Drop event after expiration'
131+
TabOrder = 2
132+
OnClick = Modification
133+
end
134+
object editComment: TEdit
135+
Left = 88
136+
Top = 30
137+
Width = 567
138+
Height = 21
139+
Anchors = [akLeft, akTop, akRight]
140+
TabOrder = 1
141+
Text = 'editComment'
142+
OnChange = Modification
143+
end
144+
object grpState: TRadioGroup
145+
Left = 88
146+
Top = 80
147+
Width = 349
148+
Height = 52
149+
Caption = 'State'
150+
Columns = 3
151+
TabOrder = 3
152+
OnClick = Modification
153+
end
154+
end
155+
object tabScheduling: TTabSheet
156+
Caption = 'Timing'
157+
ImageIndex = 80
158+
object radioOnce: TRadioButton
159+
Left = 3
160+
Top = 15
161+
Width = 74
162+
Height = 17
163+
Caption = 'Once, at:'
164+
Checked = True
165+
TabOrder = 0
166+
TabStop = True
167+
OnClick = radioScheduleClick
168+
end
169+
object radioEvery: TRadioButton
170+
Left = 3
171+
Top = 50
172+
Width = 54
173+
Height = 17
174+
Caption = 'Every'
175+
TabOrder = 3
176+
OnClick = radioScheduleClick
177+
end
178+
object dateOnce: TDateTimePicker
179+
Left = 96
180+
Top = 11
181+
Width = 133
182+
Height = 21
183+
Date = 40273.547337048610000000
184+
Time = 40273.547337048610000000
185+
TabOrder = 1
186+
OnChange = Modification
187+
end
188+
object timeOnce: TDateTimePicker
189+
Left = 235
190+
Top = 11
191+
Width = 133
192+
Height = 21
193+
Date = 40273.548026377310000000
194+
Time = 40273.548026377310000000
195+
Kind = dtkTime
196+
TabOrder = 2
197+
OnChange = Modification
198+
end
199+
object editEveryQuantity: TEdit
200+
Left = 96
201+
Top = 48
202+
Width = 53
203+
Height = 21
204+
TabOrder = 4
205+
Text = '1'
206+
OnChange = Modification
207+
end
208+
object udEveryQuantity: TUpDown
209+
Left = 149
210+
Top = 48
211+
Width = 16
212+
Height = 21
213+
Associate = editEveryQuantity
214+
Min = 1
215+
Max = 400000
216+
Position = 1
217+
TabOrder = 5
218+
end
219+
object comboEveryInterval: TComboBox
220+
Left = 172
221+
Top = 48
222+
Width = 133
223+
Height = 21
224+
Style = csDropDownList
225+
TabOrder = 6
226+
OnChange = comboEveryIntervalChange
227+
end
228+
object chkStarts: TCheckBox
229+
Left = 96
230+
Top = 78
231+
Width = 70
232+
Height = 17
233+
Caption = 'Starts at:'
234+
TabOrder = 7
235+
OnClick = chkStartsEndsClick
236+
end
237+
object chkEnds: TCheckBox
238+
Left = 96
239+
Top = 105
240+
Width = 70
241+
Height = 17
242+
Caption = 'Ends at:'
243+
TabOrder = 10
244+
OnClick = chkStartsEndsClick
245+
end
246+
object dateStarts: TDateTimePicker
247+
Left = 171
248+
Top = 75
249+
Width = 133
250+
Height = 21
251+
Date = 40273.548478379630000000
252+
Time = 40273.548478379630000000
253+
TabOrder = 8
254+
OnChange = Modification
255+
end
256+
object timeStarts: TDateTimePicker
257+
Left = 310
258+
Top = 75
259+
Width = 133
260+
Height = 21
261+
Date = 40273.549206851850000000
262+
Time = 40273.549206851850000000
263+
Kind = dtkTime
264+
TabOrder = 9
265+
OnChange = Modification
266+
end
267+
object timeEnds: TDateTimePicker
268+
Left = 310
269+
Top = 102
270+
Width = 133
271+
Height = 21
272+
Date = 40273.549548981480000000
273+
Time = 40273.549548981480000000
274+
Kind = dtkTime
275+
TabOrder = 12
276+
OnChange = Modification
277+
end
278+
object dateEnds: TDateTimePicker
279+
Left = 171
280+
Top = 102
281+
Width = 133
282+
Height = 21
283+
Date = 40273.549452245370000000
284+
Time = 40273.549452245370000000
285+
TabOrder = 11
286+
OnChange = Modification
287+
end
288+
end
289+
object tabCREATEcode: TTabSheet
290+
Caption = 'CREATE code'
291+
ImageIndex = 119
292+
object SynMemoCREATEcode: TSynMemo
293+
Left = 0
294+
Top = 0
295+
Width = 658
296+
Height = 137
297+
SingleLineMode = False
298+
Align = alClient
299+
Font.Charset = DEFAULT_CHARSET
300+
Font.Color = clWindowText
301+
Font.Height = -13
302+
Font.Name = 'Courier New'
303+
Font.Style = []
304+
TabOrder = 0
305+
Gutter.AutoSize = True
306+
Gutter.DigitCount = 2
307+
Gutter.Font.Charset = DEFAULT_CHARSET
308+
Gutter.Font.Color = clWindowText
309+
Gutter.Font.Height = -11
310+
Gutter.Font.Name = 'Courier New'
311+
Gutter.Font.Style = []
312+
Gutter.LeftOffset = 2
313+
Gutter.ShowLineNumbers = True
314+
Highlighter = MainForm.SynSQLSyn1
315+
Lines.Strings = (
316+
'SynMemoCREATEcode')
317+
Options = [eoAutoIndent, eoAutoSizeMaxScrollWidth, eoDragDropEditing, eoEnhanceEndKey, eoGroupUndo, eoHideShowScrollbars, eoKeepCaretX, eoShowScrollHint, eoSmartTabDelete, eoSmartTabs, eoTabsToSpaces]
318+
ReadOnly = True
319+
end
320+
end
321+
object tabALTERcode: TTabSheet
322+
Caption = 'ALTER code'
323+
ImageIndex = 119
324+
TabVisible = False
325+
object SynMemoALTERcode: TSynMemo
326+
Left = 0
327+
Top = 0
328+
Width = 658
329+
Height = 137
330+
SingleLineMode = False
331+
Align = alClient
332+
Font.Charset = DEFAULT_CHARSET
333+
Font.Color = clWindowText
334+
Font.Height = -13
335+
Font.Name = 'Courier New'
336+
Font.Style = []
337+
TabOrder = 0
338+
Gutter.AutoSize = True
339+
Gutter.DigitCount = 2
340+
Gutter.Font.Charset = DEFAULT_CHARSET
341+
Gutter.Font.Color = clWindowText
342+
Gutter.Font.Height = -11
343+
Gutter.Font.Name = 'Courier New'
344+
Gutter.Font.Style = []
345+
Gutter.LeftOffset = 2
346+
Gutter.ShowLineNumbers = True
347+
Highlighter = MainForm.SynSQLSyn1
348+
Lines.Strings = (
349+
'SynMemoALTERcode')
350+
Options = [eoAutoIndent, eoAutoSizeMaxScrollWidth, eoDragDropEditing, eoEnhanceEndKey, eoGroupUndo, eoHideShowScrollbars, eoKeepCaretX, eoShowScrollHint, eoSmartTabDelete, eoSmartTabs, eoTabsToSpaces]
351+
ReadOnly = True
352+
end
353+
end
354+
end
355+
end

0 commit comments

Comments
 (0)