-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModule_Methods.xojo_code
More file actions
1019 lines (674 loc) · 42.2 KB
/
Copy pathModule_Methods.xojo_code
File metadata and controls
1019 lines (674 loc) · 42.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#tag Module
Protected Module Module_Methods
#tag Method, Flags = &h0
Function AdvanceNextLine(Extends myPage As PDFDocument, ReferencePoint As Integer, FontSize As Integer) As Integer
#pragma unused myPage
Return ReferencePoint + FontSize + 2
End Function
#tag EndMethod
#tag Method, Flags = &h0
Function BaseNameFromID(BaseID As Integer) As String
Dim rs As RowSet = db.SelectSQL("Select base_name FROM bases WHERE id=" + Str(BaseID))
Try
If rs<>Nil And Not rs.AfterLastRow Then
Return rs.Column("base_name").StringValue.DefineEncoding(Encodings.UTF8)
End If
Catch err As DatabaseException
End Try
Return "?"
End Function
#tag EndMethod
#tag Method, Flags = &h0
Sub CreatemySQLServerTables()
Try
#Pragma BreakOnExceptions False
db.Connect
db.ExecuteSQL("CREATE DATABASE IF NOT EXISTS liquid_database CHARACTER SET utf8 COLLATE utf8_general_ci")
db.DatabaseName = "liquid_database"
db.Close
db.Connect
db.ExecuteSQL( "set names utf8 collate utf8_general_ci" )
db.ExecuteSQL( "set character set utf8" )
db.ExecuteSQL( "use liquid_database" )
db.ExecuteSQL(mySQLServerTables)
#Pragma BreakOnExceptions True
Catch err As DatabaseException
If err.ErrorNumber <> 1050 Then // Table XXX already exist
MessageDialog.Show Module_Multilanguage.kDatabaseError + EndOfLine + EndOfLine + err.Message
db.Close
System.Log( System.LogLevelEmergency, "Failure while creating the Database. Error: " + err.Message )
Quit
End If
End Try
End Sub
#tag EndMethod
#tag Method, Flags = &h0
Sub CreateSQLiteTables()
Try
#Pragma BreakOnExceptions False
db.Connect
db.ExecuteSQL( SQLiteTables )
#Pragma BreakOnExceptions True
Catch err As DatabaseException
If err.Message.IndexOf( "already exist" ) = -1 Then // Table XXX already exist
MessageDialog.Show Module_Multilanguage.kDatabaseError + EndOfLine + EndOfLine + err.Message
db.Close
System.Log( System.LogLevelEmergency, "Failure while creating the Database. Error: " + err.Message )
Quit
End If
End Try
End Sub
#tag EndMethod
#tag Method, Flags = &h0
Sub ListIndexFromRowTag(Extends PPM As DesktopPopupMenu, theValue As Integer)
If PPM.RowCount > 0 Then
Dim Y As Integer = PPM.RowCount-1
For X As Integer = 0 To Y
If PPM.RowTagAt(X).IntegerValue = theValue Then
PPM.SelectedRowIndex = X
Return
End If
Next
PPM.SelectedRowIndex = 0
End If
End Sub
#tag EndMethod
#tag Method, Flags = &h0
Sub ListIndexFromRowTag(Extends PPM As DesktopPopupMenu, theValue As String)
If PPM.RowCount > 0 Then
Dim Y As Integer = PPM.RowCount-1
For X As Integer = 0 To Y
If PPM.RowTagAt(X).StringValue = theValue Then
PPM.SelectedRowIndex = X
Return
End If
Next
PPM.SelectedRowIndex = 0
End If
End Sub
#tag EndMethod
#tag Method, Flags = &h0
Sub List_Bases(Extends LB As DesktopListbox, SearchPhrase As String)
Var sqlString As String = "SELECT base_name, id, image FROM bases "
If SearchPhrase.Trim.Length > 0 Then
sqlString = sqlString + " WHERE base_name LIKE '%" + SearchPhrase.ReplaceAll( " ", "%" ) + "%' "
End If
sqlString = sqlString + "ORDER BY base_name"
Try
Var rs As RowSet = db.SelectSQL( sqlString )
If rs <> Nil And Not rs.AfterLastRow Then
While Not rs.AfterLastRow
LB.AddRow rs.Column( "base_name" ).StringValue.DefineEncoding( Encodings.UTF8 )
Var pRow As New Picture( LB.RowHeight, LB.RowHeight )
If rs.Column( "image" ).PictureValue <> Nil Then
pRow.Graphics.ScaleToFit( rs.Column( "image" ).PictureValue )
Else
If Color.IsDarkMode Then
pRow.Graphics.ScaleToFit( Base_DarkMode )
Else
pRow.Graphics.ScaleToFit( Base_LightMode )
End If
End If
LB.RowImageAt( LB.LastAddedRowIndex ) = pRow
LB.RowTagAt( LB.LastAddedRowIndex ) = rs.Column( "id" ).IntegerValue
rs.MoveToNextRow
Wend
End If
Catch err As DatabaseException
End Try
End Sub
#tag EndMethod
#tag Method, Flags = &h0
Sub List_Bases(Extends PPM As DesktopPopupMenu)
PPM.RemoveAllRows
Dim rs As RowSet = db.SelectSQL("SELECT base_name, id FROM bases ORDER BY base_name")
Try
If rs <> Nil Then
PPM.AddRow Module_Multilanguage.kNone
PPM.RowTagAt(0) = -1
While Not rs.AfterLastRow
PPM.AddRow rs.Column("base_name").StringValue.DefineEncoding( Encodings.UTF8 )
PPM.RowTagAt(PPM.RowCount-1) = rs.Column("id").IntegerValue
rs.MoveToNextRow
Wend
If PPM.RowCount > 0 Then
PPM.SelectedRowIndex = 0
End If
End If
Catch err As DatabaseException
End Try
End Sub
#tag EndMethod
#tag Method, Flags = &h0
Sub List_Dealers(Extends LB As DesktopListbox, SearchPhrase As String)
Var sqlString As String = "SELECT dealer_name, id, image FROM dealers "
If SearchPhrase.Trim.Length > 0 Then
sqlString = sqlString + " WHERE dealer_name LIKE '%" + SearchPhrase.ReplaceAll( " ", "%" ) + "%' "
End If
sqlString = sqlString + "ORDER BY dealer_name"
Try
Var rs As RowSet = db.SelectSQL( sqlString )
If rs <> Nil And Not rs.AfterLastRow Then
While Not rs.AfterLastRow
LB.AddRow rs.Column( "dealer_name" ).StringValue.DefineEncoding( Encodings.UTF8 )
If rs.Column( "image" ).PictureValue <> Nil Then
Var pRow As New Picture( LB.RowHeight, LB.RowHeight )
pRow.Graphics.ScaleToFit( rs.Column( "image" ).PictureValue )
LB.RowImageAt( LB.LastAddedRowIndex ) = pRow
End If
LB.RowTagAt( LB.LastAddedRowIndex ) = rs.Column( "id" ).IntegerValue
rs.MoveToNextRow
Wend
End If
Catch err As DatabaseException
End Try
End Sub
#tag EndMethod
#tag Method, Flags = &h0
Sub List_Dealers(Extends PPM As DesktopPopupMenu)
PPM.RemoveAllRows
Dim rs As RowSet = db.SelectSQL("SELECT dealer_name, id FROM dealers ORDER BY dealer_name")
Try
If rs <> Nil Then
PPM.AddRow Module_Multilanguage.kNone
PPM.RowTagAt(0) = -1
While Not rs.AfterLastRow
PPM.AddRow rs.Column("dealer_name").StringValue.DefineEncoding( Encodings.UTF8 )
PPM.RowTagAt(PPM.RowCount-1) = rs.Column("id").IntegerValue
rs.MoveToNextRow
Wend
If PPM.RowCount > 0 Then
PPM.SelectedRowIndex = 0
End If
End If
Catch err As DatabaseException
End Try
End Sub
#tag EndMethod
#tag Method, Flags = &h0
Sub List_Flavors(Extends LB As DesktopListbox, SearchPhrase As String)
Var sqlString As String = "SELECT flavor_name, id, image FROM flavors "
If SearchPhrase.Trim.Length > 0 Then
sqlString = sqlString + " WHERE flavor_name LIKE '%" + SearchPhrase.ReplaceAll( " ", "%" ) + "%' "
End If
sqlString = sqlString + "ORDER BY flavor_name"
Try
Var rs As RowSet = db.SelectSQL( sqlString )
If rs <> Nil And Not rs.AfterLastRow Then
While Not rs.AfterLastRow
LB.AddRow rs.Column( "flavor_name" ).StringValue.DefineEncoding( Encodings.UTF8 )
Var pRow As New Picture( LB.RowHeight, LB.RowHeight )
If rs.Column( "image" ).PictureValue <> Nil Then
pRow.Graphics.ScaleToFit( rs.Column( "image" ).PictureValue )
Else
If Color.IsDarkMode Then
pRow.Graphics.ScaleToFit( Flavor_DarkMode )
Else
pRow.Graphics.ScaleToFit( Flavor_LightMode )
End If
End If
LB.RowImageAt( LB.LastAddedRowIndex ) = pRow
LB.RowTagAt( LB.LastAddedRowIndex ) = rs.Column( "id" ).IntegerValue
rs.MoveToNextRow
Wend
End If
End Try
End Sub
#tag EndMethod
#tag Method, Flags = &h0
Sub List_Flavors(Extends PPM As DesktopPopupMenu)
PPM.RemoveAllRows
Try
Dim rs As RowSet = db.SelectSQL("SELECT flavor_name, id FROM flavors ORDER BY flavor_name")
If rs <> Nil Then
PPM.AddRow Module_Multilanguage.kNone
PPM.RowTagAt(0) = -1
While Not rs.AfterLastRow
PPM.AddRow rs.Column("flavor_name").StringValue.DefineEncoding( Encodings.UTF8 )
PPM.RowTagAt(PPM.LastAddedRowIndex) = rs.Column("id").IntegerValue
rs.MoveToNextRow
Wend
If PPM.RowCount > 0 Then
PPM.SelectedRowIndex = 0
End If
End If
Catch err As DatabaseException
End Try
End Sub
#tag EndMethod
#tag Method, Flags = &h0
Sub List_Liquids(Extends LB As DesktopListbox, SearchPhrase As String)
Var sqlString As String = "SELECT liquid_name, id, image FROM liquids "
If SearchPhrase.Trim.Length > 0 Then
sqlString = sqlString + " WHERE liquid_name LIKE '%" + SearchPhrase.ReplaceAll( " ", "%" ) + "%' "
End If
sqlString = sqlString + "ORDER BY liquid_name"
Try
Var rs As RowSet = db.SelectSQL( sqlString )
If rs <> Nil Then
While Not rs.AfterLastRow
LB.AddRow rs.Column( "liquid_name" ).StringValue.DefineEncoding( Encodings.UTF8 )
Var pRow As New Picture( LB.RowHeight, LB.RowHeight )
If rs.Column( "image" ).PictureValue <> Nil Then
pRow.Graphics.ScaleToFit( rs.Column( "image" ).PictureValue )
Else
If Color.IsDarkMode Then
pRow.Graphics.ScaleToFit( Liquid_DarkMode )
Else
pRow.Graphics.ScaleToFit( Liquid_LightMode )
End If
End If
LB.RowImageAt( LB.LastAddedRowIndex ) = pRow
LB.RowTagAt( LB.LastAddedRowIndex ) = rs.Column( "id" ).IntegerValue
rs.MoveToNextRow
Wend
End If
Catch err As DatabaseException
MessageDialog.Show Module_Multilanguage.kDatabaseError + EndOfLine + EndOfLine + err.Message
End Try
End Sub
#tag EndMethod
#tag Method, Flags = &h0
Sub List_Units(Extends PPM As DesktopPopupMenu)
PPM.RemoveAllRows
Try
db.Connect
Var rs As RowSet
rs = db.SelectSQL(Module_Multilanguage.kSQLLoadUnits)
If rs <> Nil Then
While Not rs.AfterLastRow
PPM.AddRow rs.ColumnAt(0).StringValue.DefineEncoding( Encodings.UTF8 )
PPM.RowTagAt(PPM.RowCount-1) = rs.ColumnAt(1).StringValue.DefineEncoding( Encodings.UTF8 )
rs.MoveToNextRow
Wend
If PPM.RowCount > 0 Then
PPM.SelectedRowIndex = 0
End If
End If
Catch err As DatabaseException
End Try
End Sub
#tag EndMethod
#tag Method, Flags = &h0
Function MaximumFlavorCount() As Integer
Var rs As RowSet = db.SelectSQL( "Select COUNT(liquid_id) FROM liquids_ingredients WHERE theType=? GROUP BY liquid_id", Integer( Ingredient.Types.Flavour ) )
Var X As Integer
Try
If rs <> Nil And Not rs.AfterLastRow Then
While Not rs.AfterLastRow
If X < rs.Column( "COUNT(liquid_id)" ).IntegerValue Then
X = rs.Column( "COUNT(liquid_id)" ).IntegerValue
End If
rs.MoveToNextRow
Wend
End If
Catch err As DatabaseException
End Try
Return X
End Function
#tag EndMethod
#tag Method, Flags = &h0
Function MesBox(theMessage As String) As Integer
Var d As New MessageDialog // declare the MessageDialog object
d.IconType = MessageDialog.IconTypes.Caution // display warning icon
d.ActionButton.Caption = Module_Multilanguage.kYes
d.CancelButton.Visible = True // show the Cancel button
d.AlternateActionButton.Visible = False // show the "Don't Save" button
d.CancelButton.Caption = Module_Multilanguage.kNo
d.Message = theMessage
// d.Explanation = "If you don't save, your changes will be lost."
Var b As MessageDialogButton // for handling the result
b = d.ShowModal // display the dialog
Select Case b // determine which button was pressed.
Case d.ActionButton
Return 6
Else
Return 7
End Select
End Function
#tag EndMethod
#tag Method, Flags = &h0
Sub MessageDialogSimple(MessageSymbol As MessageDialog.IconTypes, ActionButtonCaption As String, MessageText As String, Optional MessageExplanation As String)
Var mb As MessageDialogButton
Var md As New MessageDialog
If MessageExplanation.Trim <> "" Then
md.Title = MessageText
Else
md.Message = MessageText
End If
md.IconType = MessageSymbol
md.ActionButton.Caption = ActionButtonCaption
md.CancelButton.Visible = False
md.AlternateActionButton.Visible = False
md.Explanation = MessageExplanation
mb = md.ShowModal
End Sub
#tag EndMethod
#tag Method, Flags = &h0
Sub MsgDlg(MessageString As String, Optional ExplanationString As String, ActionButtonCaption As String, MessageIcon As MessageDialog.IconTypes)
Var d As New MessageDialog // declare the MessageDialog object
Var b As MessageDialogButton // for handling the result
d.IconType = MessageIcon // display icon
d.ActionButton.Caption = ActionButtonCaption
d.CancelButton.Visible = False // show the Cancel button?
d.AlternateActionButton.Visible = False // show the "Don't Save" button?
// d.AlternateActionButton.Caption = "Don't Save"
d.Message = MessageString
d.Explanation = ExplanationString
b = d.ShowModal // display the dialog
// Select Case b // determine which button was pressed.
// Case d.ActionButton
// // user pressed Save
// Case d.AlternateActionButton
// // user pressed Don't Save
// Case d.CancelButton
// // user pressed Cancel
// End Select
End Sub
#tag EndMethod
#tag Method, Flags = &h0
Function RemoveFromStorage(Storage As String, ItemID As String) As Boolean
Select Case Storage
Case Module_Multilanguage.kLiquids
db.ExecuteSQL("UPDATE storage_liquid SET theValue=0 WHERE id_liquid=" + ItemID)
Case Module_Multilanguage.kFlavors
db.ExecuteSQL("UPDATE storage_aroma SET theValue=0 WHERE id_aroma=" + ItemID)
Case Module_Multilanguage.kBases
db.ExecuteSQL("UPDATE storage_base SET theValue=0 WHERE id_base=" + ItemID)
End Select
Try
Return True
Catch err As DatabaseException
End Try
Return False
End Function
#tag EndMethod
#tag Method, Flags = &h0
Sub ReportError(err As InvalidArgumentException, CurrentMethod As String)
System.Log( System.LogLevelError, "Invalid Argument Exception - " + err.Message + EndOfLine + _
"Code: " + err.ErrorNumber.ToString + EndOfLine + _
"Method: " + CurrentMethod + EndOfLine + _
"Stack: " + String.FromArray(err.Stack, EndOfLine))
End Sub
#tag EndMethod
#tag Method, Flags = &h0
Sub ReportError(err As IOException, CurrentMethod As String)
System.Log( System.LogLevelError, "IO Exception - " + err.Message + EndOfLine + _
"Code: " + err.ErrorNumber.ToString + EndOfLine + _
"Method: " + CurrentMethod + EndOfLine + _
"Stack: " + String.FromArray(err.Stack, EndOfLine ) )
End Sub
#tag EndMethod
#tag Method, Flags = &h0
Sub ReportError(err As NilObjectException, CurrentMethod As String)
System.Log( System.LogLevelError, "Nil Object Exception - " + err.Message + EndOfLine + _
"Code: " + err.ErrorNumber.ToString + EndOfLine + _
"Method: " + CurrentMethod + EndOfLine + _
"Stack: " + String.FromArray(err.Stack, EndOfLine ) )
End Sub
#tag EndMethod
#tag Method, Flags = &h0
Sub ReportError(err As OutOfBoundsException, CurrentMethod As String)
System.Log( System.LogLevelError, "Out of bounds Exception - " + err.Message + EndOfLine + _
"Code: " + err.ErrorNumber.ToString + EndOfLine + _
"Method: " + CurrentMethod + EndOfLine + _
"Stack: " + String.FromArray(err.Stack, EndOfLine ) )
End Sub
#tag EndMethod
#tag Method, Flags = &h0
Sub ReportError(err As RegExException, CurrentMethod As String)
System.Log( System.LogLevelError, "RegEx Exception - " + err.Message + EndOfLine + _
"Code: " + err.ErrorNumber.ToString + EndOfLine + _
"Method: " + CurrentMethod + EndOfLine + _
"Stack: " + String.FromArray(err.Stack, EndOfLine ) )
End Sub
#tag EndMethod
#tag Method, Flags = &h0
Sub ReportError(err As RegExSearchPatternException, CurrentMethod As String)
System.Log( System.LogLevelError, "RegEx Search Pattern Exception - " + err.Message + EndOfLine + _
"Code: " + err.ErrorNumber.ToString + EndOfLine + _
"Method: " + CurrentMethod + EndOfLine + _
"Stack: " + String.FromArray(err.Stack, EndOfLine ) )
End Sub
#tag EndMethod
#tag Method, Flags = &h0
Sub ReportError(err As RuntimeException, CurrentMethod As String)
System.Log( System.LogLevelError, "Runtime Exception - " + err.Message + EndOfLine + _
"Code: " + err.ErrorNumber.ToString + EndOfLine + _
"Method: " + CurrentMethod + EndOfLine + _
"Stack: " + String.FromArray(err.Stack, EndOfLine ) )
End Sub
#tag EndMethod
#tag Method, Flags = &h0
Sub ReportError(err As ThreadAccessingUIException, CurrentMethod As String)
System.Log( System.LogLevelError, "Thread Accessing UI Exception - " + err.Message + EndOfLine + _
"Code: " + err.ErrorNumber.ToString + EndOfLine + _
"Method: " + CurrentMethod + EndOfLine + _
"Stack: " + String.FromArray(err.Stack, EndOfLine ) )
End Sub
#tag EndMethod
#tag Method, Flags = &h0
Sub ReportError(err As ThreadAlreadyRunningException, CurrentMethod As String)
System.Log( System.LogLevelError, "Thread Already Running Exception - " + err.Message + EndOfLine + _
"Code: " + err.ErrorNumber.ToString + EndOfLine + _
"Method: " + CurrentMethod + EndOfLine + _
"Stack: " + String.FromArray(err.Stack, EndOfLine ) )
End Sub
#tag EndMethod
#tag Method, Flags = &h0
Sub ReportError(err As TypeMismatchException, CurrentMethod As String)
System.Log( System.LogLevelError, "Type Missmatch Exception - " + err.Message + EndOfLine + _
"Code: " + err.ErrorNumber.ToString + EndOfLine + _
"Method: " + CurrentMethod + EndOfLine + _
"Stack: " + String.FromArray(err.Stack, EndOfLine ) )
End Sub
#tag EndMethod
#tag Method, Flags = &h0
Sub ReportError(err As UnsupportedOperationException, CurrentMethod As String)
System.Log( System.LogLevelError, "Unsupported Operation Exception - " + err.Message + EndOfLine + _
"Code: " + err.ErrorNumber.ToString + EndOfLine + _
"Method: " + CurrentMethod + EndOfLine + _
"Stack: " + String.FromArray(err.Stack, EndOfLine ) )
End Sub
#tag EndMethod
#tag Method, Flags = &h0
Sub RestorePosition(Extends win As DesktopWindow, Optional DoNotTouchSize As Boolean = False)
win.Left = App.Preferences.getIntegerValue(win.Title + " Window Left", win.Left)
win.Top = App.Preferences.getIntegerValue(win.Title + " Window Top", win.Top)
If Not DoNotTouchSize Then
win.Width = App.Preferences.getIntegerValue(win.Title + " Window Width", win.Width)
win.Height = App.Preferences.getIntegerValue( win.Title + " Window Height", win.Height )
End If
End Sub
#tag EndMethod
#tag Method, Flags = &h0
Sub SavePosition(Extends win As DesktopWindow)
App.Preferences.setIntegerValue(win.Title + " Window Left", win.Left)
App.Preferences.setIntegerValue( win.Title + " Window Top", win.Top )
App.Preferences.setIntegerValue(win.Title + " Window Width", win.Width)
App.Preferences.setIntegerValue(win.Title + " Window Height", win.Height)
End Sub
#tag EndMethod
#tag Method, Flags = &h0
Sub ScaleToFit(Extends g As Graphics, p As Picture)
If p = Nil Then Return
// -------------------------------------------------------
// scale picture keeping the ratio between x and y
// -------------------------------------------------------
dim CanvasWidth, CanvasHeight, PicWidth, PicHeight, ScaleWidth, ScaleHeight as int16
dim RatioX, RatioY,PosX, PosY as double
CanvasWidth = g.Width
CanvasHeight =g.Height
PicWidth = p.Width
PicHeight = p.Height
RatioX = CanvasWidth / PicWidth
RatioY = CanvasHeight / PicHeight
if RatioY < RatioX then
ScaleWidth = PicWidth * RatioY
ScaleHeight = PicHeight * RatioY
PosX = (CanvasWidth - ScaleWidth)/2
else
ScaleWidth = PicWidth * RatioX
ScaleHeight = PicHeight * RatioX
PosY = (CanvasHeight - ScaleHeight)/2
end if
g.DrawPicture(p,PosX, PosY, ScaleWidth, ScaleHeight, 0, 0, PicWidth, PicHeight)
End Sub
#tag EndMethod
#tag Method, Flags = &h0
Sub ScrollToID(Extends lst As DesktopListBox, ID As Integer)
If lst.RowCount > -1 And ID > -1 Then
lst.Sort
For X As Integer = lst.LastRowIndex DownTo 0
If lst.RowTagAt( X ).IntegerValue = ID Then
lst.ScrollPosition = X
lst.SelectedRowIndex = X
Exit For X
End If
Next
End If
End Sub
#tag EndMethod
#tag Method, Flags = &h0
Sub ShowHelp()
Select Case Window_Main.PagePanel_Main.SelectedPanelIndex
Case 0
winHelp.lblHelp.Text = Module_Multilanguage.kHelpLiquids
Case 1
winHelp.lblHelp.Text = Module_Multilanguage.kHelpAroma
Case 2
winHelp.lblHelp.Text = Module_Multilanguage.kHelpBases
Case 3
winHelp.lblHelp.Text = Module_Multilanguage.kHelpDealers
Case 4
winHelp.lblHelp.Text = Module_Multilanguage.kHelpStorage
End Select
winHelp.Show
End Sub
#tag EndMethod
#tag Method, Flags = &h0
Function UpdateDBImage(dbID As Integer, dbImage As Picture) As Boolean
If dbID <> 0 Then
If dbImage <> Nil Then
Var s As String
Select Case Window_Main.PagePanel_Main.SelectedPanelIndex
Case 0 // Liquid
s = "liquid"
Case 1 // Aroma
s = "aroma"
Case 2 // Bases
s = "bases"
Case 3 // Dealer
s = "dealer"
End Select
Return True
Try
db.ExecuteSQL( "UPDATE " + s + " SET image=? WHERE id=?", dbImage.ToData( Picture.Formats.PNG ), dbID )
Catch err As DatabaseException
Catch err As UnsupportedFormatException
End Try
End If
End If
Return False
End Function
#tag EndMethod
#tag Method, Flags = &h0, Description = 416C69676E6D656E742028302D4C6566742C20312D43656E7465722C20322D526967687429
Sub WriteString(Extends g As Graphics, StringToDraw As String, Left As Integer, Top As Integer, Width As Integer, Height As Integer, TextSizeMinimum As Integer, BaseLine As Integer, Alignment As Integer)
// Find best TextSize
For i As Integer = 120 DownTo TextSizeMinimum // max font size down to min font size
g.FontSize = i
If g.TextHeight(StringToDraw, Width) <= Height Then
Exit For i
End
Next
If BaseLine = 0 Then BaseLine = g.FontSize/3*2
// Split StringToDraw into seperate Lines for centering
Dim Lines(-1) As String
Dim Words(-1) As String
Words = StringToDraw.Split
If Words.LastIndex > 0 Then
While Words.LastIndex > -1
Dim currentTxt As String
While Words.LastIndex>-1 And g.TextWidth(currentTxt + " " + Words(0)) < Width
currentTxt = currentTxt + " " + Words(0)
Words.RemoveAt(0)
Wend
Lines.Add currentTxt
Wend
Else
Lines.Add Words(0)
End If
// Draw each Line centered
Dim tempX As Integer
Dim tempY As Integer = Top + BaseLine
For currentLine As Integer = 0 To Lines.LastIndex
tempX = (Width - g.TextWidth(Lines(currentLine))) * (Alignment/2)
If tempY <= Height+Top Then
g.DrawText(Lines(currentLine), Left + tempX, tempY)
tempY = tempY + g.FontSize
Else
g.DrawText(Lines(currentLine), Left + tempX, tempY, Width, True)
Exit For currentLine
End If
Next currentLine
End Sub
#tag EndMethod
#tag Property, Flags = &h0
db As Database
#tag EndProperty
#tag Constant, Name = mySQLServerTables, Type = String, Dynamic = False, Default = \"-- MySQL dump --\n-- ---------------------------------------------------------\n\n\n/*!40101 SET @OLD_CHARACTER_SET_CLIENT\x3D@@CHARACTER_SET_CLIENT */;\n/*!40101 SET @OLD_CHARACTER_SET_RESULTS\x3D@@CHARACTER_SET_RESULTS */;\n/*!40101 SET @OLD_COLLATION_CONNECTION\x3D@@COLLATION_CONNECTION */;\n/*!40014 SET @OLD_FOREIGN_KEY_CHECKS\x3D@@FOREIGN_KEY_CHECKS\x2C FOREIGN_KEY_CHECKS\x3D0 */;\n/*!40101 SET @OLD_SQL_MODE\x3D@@SQL_MODE\x2C SQL_MODE\x3D\'NO_AUTO_VALUE_ON_ZERO\' */;\n-- ---------------------------------------------------------\n\n\n-- CREATE DATABASE \"liquid_database\" -----------------------\nCREATE DATABASE IF NOT EXISTS `liquid_database` CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci;\nUSE `liquid_database`;\n-- ---------------------------------------------------------\n\n\n-- CREATE TABLE \"flavors\" --------------------------------------\nCREATE TABLE `flavors`( \n\t`id` Int( 255 ) AUTO_INCREMENT NOT NULL\x2C\n\t`flavor_name` VarChar( 255 ) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci NOT NULL DEFAULT \'Name\'\x2C\n\t`mixing_ratio` VarChar( 255 ) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci NOT NULL DEFAULT \'2-5%\'\x2C\n\t`ripe_time` VarChar( 255 ) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci NOT NULL DEFAULT \'0\'\x2C\n\t`flavor_description` Text CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci NULL DEFAULT NULL\x2C\n\t`flavor_rating` Int( 11 ) NOT NULL DEFAULT 0\x2C\n\t`created_on` DateTime NOT NULL DEFAULT current_timestamp()\x2C\n\t`changed_on` DateTime NOT NULL DEFAULT current_timestamp()\x2C\n\t`image` LongBlob NULL DEFAULT NULL\x2C\n\tCONSTRAINT `unique_id` UNIQUE( `id` ) )\nCHARACTER SET \x3D utf8mb4\nCOLLATE \x3D utf8mb4_uca1400_ai_ci\nENGINE \x3D InnoDB\nAUTO_INCREMENT \x3D 18;\n-- -------------------------------------------------------------\n\n\n-- CREATE TABLE \"dealers_items\" --------------------------------\nCREATE TABLE `dealers_items`( \n\t`id_item` Int( 255 ) NOT NULL\x2C\n\t`theValue` Double NOT NULL DEFAULT 0\x2C\n\t`id_dealer` Int( 255 ) NOT NULL DEFAULT 0\x2C\n\t`theType` Int( 255 ) NOT NULL\x2C\n\t`id` Int( 255 ) AUTO_INCREMENT NOT NULL\x2C\n\tPRIMARY KEY ( `id` )\x2C\n\tCONSTRAINT `unique_id` UNIQUE( `id` ) )\nCHARACTER SET \x3D utf8mb4\nCOLLATE \x3D utf8mb4_uca1400_ai_ci\nENGINE \x3D InnoDB\nAUTO_INCREMENT \x3D 1;\n-- -------------------------------------------------------------\n\n\n-- CREATE TABLE \"storage\" --------------------------------------\nCREATE TABLE `storage`( \n\t`id_item` Int( 255 ) NOT NULL\x2C\n\t`theUnit` Int( 1 ) NOT NULL DEFAULT 1\x2C\n\t`theValue` Double NOT NULL DEFAULT 0\x2C\n\t`theType` Int( 1 ) NOT NULL DEFAULT 0\x2C\n\t`id` Int( 255 ) AUTO_INCREMENT NOT NULL\x2C\n\tPRIMARY KEY ( `id` ) )\nCHARACTER SET \x3D utf8mb4\nCOLLATE \x3D utf8mb4_uca1400_ai_ci\nENGINE \x3D InnoDB\nAUTO_INCREMENT \x3D 1;\n-- -------------------------------------------------------------\n\n\n-- CREATE TABLE \"dealers\" --------------------------------------\nCREATE TABLE `dealers`( \n\t`id` Int( 255 ) AUTO_INCREMENT NOT NULL\x2C\n\t`dealer_name` VarChar( 255 ) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci NOT NULL DEFAULT \'Name\'\x2C\n\t`dealer_address` Text CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci NULL DEFAULT NULL\x2C\n\t`dealer_phone` VarChar( 255 ) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci NULL DEFAULT NULL\x2C\n\t`dealer_mail` VarChar( 255 ) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci NULL DEFAULT NULL\x2C\n\t`dealer_description` Text CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci NULL DEFAULT NULL\x2C\n\t`dealer_url` VarChar( 255 ) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci NULL DEFAULT NULL\x2C\n\t`customer_no` VarChar( 255 ) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci NULL DEFAULT NULL\x2C\n\t`created_on` DateTime NOT NULL DEFAULT current_timestamp()\x2C\n\t`changed_on` DateTime NOT NULL DEFAULT current_timestamp()\x2C\n\t`image` LongBlob NULL DEFAULT NULL\x2C\n\tCONSTRAINT `unique_id` UNIQUE( `id` ) )\nCHARACTER SET \x3D utf8mb4\nCOLLATE \x3D utf8mb4_uca1400_ai_ci\nENGINE \x3D InnoDB\nAUTO_INCREMENT \x3D 5;\n-- -------------------------------------------------------------\n\n\n-- CREATE TABLE \"liquids_ingredients\" --------------------------\nCREATE TABLE `liquids_ingredients`( \n\t`id` Int( 255 ) AUTO_INCREMENT NOT NULL\x2C\n\t`theType` Int( 255 ) NOT NULL DEFAULT 0\x2C\n\t`theValue` Int( 255 ) NOT NULL DEFAULT 0\x2C\n\t`liquid_id` Int( 255 ) NOT NULL DEFAULT 0\x2C\n\t`theIngredientID` Int( 255 ) NOT NULL DEFAULT 0\x2C\n\tCONSTRAINT `unique_id` UNIQUE( `id` ) )\nCHARACTER SET \x3D utf8mb4\nCOLLATE \x3D utf8mb4_uca1400_ai_ci\nENGINE \x3D InnoDB\nAUTO_INCREMENT \x3D 15;\n-- -------------------------------------------------------------\n\n\n-- CREATE TABLE \"liquids\" --------------------------------------\nCREATE TABLE `liquids`( \n\t`id` Int( 255 ) AUTO_INCREMENT NOT NULL\x2C\n\t`liquid_name` VarChar( 255 ) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci NOT NULL DEFAULT \'Name\'\x2C\n\t`liquid_rating` Int( 255 ) NOT NULL DEFAULT 0\x2C\n\t`liquid_description` Text CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci NULL DEFAULT NULL\x2C\n\t`created_on` DateTime NOT NULL DEFAULT current_timestamp()\x2C\n\t`changed_on` DateTime NOT NULL DEFAULT current_timestamp()\x2C\n\t`image` LongBlob NULL DEFAULT NULL\x2C\n\tCONSTRAINT `unique_id` UNIQUE( `id` ) )\nCHARACTER SET \x3D utf8mb4\nCOLLATE \x3D utf8mb4_uca1400_ai_ci\nENGINE \x3D InnoDB\nAUTO_INCREMENT \x3D 45;\n-- -------------------------------------------------------------\n\n\n-- CREATE TABLE \"storage_units\" --------------------------------\nCREATE TABLE `storage_units`( \n\t`id` Int( 255 ) AUTO_INCREMENT NOT NULL\x2C\n\t`name_en` VarChar( 255 ) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci NOT NULL\x2C\n\t`name_de` VarChar( 255 ) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci NOT NULL\x2C\n\tCONSTRAINT `unique_id` UNIQUE( `id` ) )\nCHARACTER SET \x3D utf8mb4\nCOLLATE \x3D utf8mb4_uca1400_ai_ci\nENGINE \x3D InnoDB\nAUTO_INCREMENT \x3D 31;\n-- -------------------------------------------------------------\n\n\n-- CREATE TABLE \"bases\" ----------------------------------------\nCREATE TABLE `bases`( \n\t`id` Int( 255 ) AUTO_INCREMENT NOT NULL\x2C\n\t`base_name` VarChar( 255 ) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci NOT NULL\x2C\n\t`share_pg` Double NOT NULL DEFAULT 50\x2C\n\t`share_vg` Double NOT NULL DEFAULT 50\x2C\n\t`share_water` Double NOT NULL DEFAULT 0\x2C\n\t`nicotine` Double NOT NULL DEFAULT 0\x2C\n\t`created_on` DateTime NOT NULL DEFAULT current_timestamp()\x2C\n\t`changed_on` DateTime NOT NULL DEFAULT current_timestamp()\x2C\n\t`image` LongBlob NULL DEFAULT NULL\x2C\n\t`base_description` Text CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci NULL DEFAULT NULL\x2C\n\tCONSTRAINT `unique_id` UNIQUE( `id` ) )\nCHARACTER SET \x3D utf8mb4\nCOLLATE \x3D utf8mb4_uca1400_ai_ci\nENGINE \x3D InnoDB\nAUTO_INCREMENT \x3D 6;\n-- -------------------------------------------------------------\n\n\n-- Dump data of \"flavors\" ----------------------------------\n-- ---------------------------------------------------------\n\n\n-- Dump data of \"dealers_items\" ----------------------------\n-- ---------------------------------------------------------\n\n\n-- Dump data of \"storage\" ----------------------------------\n-- ---------------------------------------------------------\n\n\n-- Dump data of \"dealers\" ----------------------------------\n-- ---------------------------------------------------------\n\n\n-- Dump data of \"liquids_ingredients\" ----------------------\n-- ---------------------------------------------------------\n\n\n-- Dump data of \"liquids\" ----------------------------------\n-- ---------------------------------------------------------\n\n\n-- Dump data of \"storage_units\" ----------------------------\nINSERT INTO `storage_units`(`id`\x2C`name_en`\x2C`name_de`) VALUES ( \'16\'\x2C \'Unit(s)\'\x2C \'Einheit(en)\' );\nINSERT INTO `storage_units`(`id`\x2C`name_en`\x2C`name_de`) VALUES ( \'17\'\x2C \'fl oz\'\x2C \'Flu\xCC\x88ssigunze\' );\nINSERT INTO `storage_units`(`id`\x2C`name_en`\x2C`name_de`) VALUES ( \'18\'\x2C \'ml\'\x2C \'ml\' );\nINSERT INTO `storage_units`(`id`\x2C`name_en`\x2C`name_de`) VALUES ( \'19\'\x2C \'l\'\x2C \'l\' );\nINSERT INTO `storage_units`(`id`\x2C`name_en`\x2C`name_de`) VALUES ( \'20\'\x2C \'mg\'\x2C \'mg\' );\nINSERT INTO `storage_units`(`id`\x2C`name_en`\x2C`name_de`) VALUES ( \'21\'\x2C \'g\'\x2C \'g\' );\nINSERT INTO `storage_units`(`id`\x2C`name_en`\x2C`name_de`) VALUES ( \'22\'\x2C \'lb\'\x2C \'Pfund\' );\nINSERT INTO `storage_units`(`id`\x2C`name_en`\x2C`name_de`) VALUES ( \'23\'\x2C \'kg\'\x2C \'kg\' );\nINSERT INTO `storage_units`(`id`\x2C`name_en`\x2C`name_de`) VALUES ( \'24\'\x2C \'Package(s)\'\x2C \'Packet(e)\' );\nINSERT INTO `storage_units`(`id`\x2C`name_en`\x2C`name_de`) VALUES ( \'25\'\x2C \'Bottle(s)\'\x2C \'Flasche(n)\' );\nINSERT INTO `storage_units`(`id`\x2C`name_en`\x2C`name_de`) VALUES ( \'26\'\x2C \'Ounce(s)\'\x2C \'Unze(n)\' );\nINSERT INTO `storage_units`(`id`\x2C`name_en`\x2C`name_de`) VALUES ( \'27\'\x2C \'Gramm(s)\'\x2C \'Gramm\' );\nINSERT INTO `storage_units`(`id`\x2C`name_en`\x2C`name_de`) VALUES ( \'28\'\x2C \'Gallon(s)\'\x2C \'Gallone(n)\' );\nINSERT INTO `storage_units`(`id`\x2C`name_en`\x2C`name_de`) VALUES ( \'29\'\x2C \'Box(es)\'\x2C \'Karton(s)\' );\nINSERT INTO `storage_units`(`id`\x2C`name_en`\x2C`name_de`) VALUES ( \'30\'\x2C \'Pallet(s)\'\x2C \'Palette(n)\' );\n-- ---------------------------------------------------------\n\n\n-- Dump data of \"bases\" ------------------------------------\n-- ---------------------------------------------------------\n\n\n/*!40101 SET SQL_MODE\x3D@OLD_SQL_MODE */;\n/*!40014 SET FOREIGN_KEY_CHECKS\x3D@OLD_FOREIGN_KEY_CHECKS */;\n/*!40101 SET CHARACTER_SET_CLIENT\x3D@OLD_CHARACTER_SET_CLIENT */;\n/*!40101 SET CHARACTER_SET_RESULTS\x3D@OLD_CHARACTER_SET_RESULTS */;\n/*!40101 SET COLLATION_CONNECTION\x3D@OLD_COLLATION_CONNECTION */;\n-- ---------------------------------------------------------", Scope = Private
#tag EndConstant
#tag Constant, Name = SQLiteTables, Type = String, Dynamic = False, Default = \"-- ------------------------------------------\n-- Dump of \"bases\"\n-- ------------------------------------------\n\nCREATE TABLE \"bases\"(\n\t\"id\" Integer NOT NULL PRIMARY KEY AUTOINCREMENT\x2C\n\t\"base_name\" Text NOT NULL DEFAULT \'Name\'\x2C\n\t\"share_pg\" Double NOT NULL DEFAULT 50\x2C\n\t\"share_vg\" Double NOT NULL DEFAULT 50\x2C\n\t\"share_water\" Double NOT NULL DEFAULT 0\x2C\n\t\"nicotine\" Double NOT NULL DEFAULT 0\x2C\n\t\"created_on\" DateTime NOT NULL DEFAULT current_timestamp\x2C\n\t\"changed_on\" DateTime NOT NULL DEFAULT current_timestamp\x2C\n\t\"image\" BLOB DEFAULT NULL\x2C\n\t\"base_description\" Text DEFAULT NULL\x2C\nCONSTRAINT \"unique_id\" UNIQUE ( id ) );\n\n\n-- ------------------------------------------\n-- Dump of \"dealers\"\n-- ------------------------------------------\n\nCREATE TABLE \"dealers\"(\n\t\"id\" Integer NOT NULL PRIMARY KEY AUTOINCREMENT\x2C\n\t\"dealer_name\" Text NOT NULL DEFAULT \'Name\'\x2C\n\t\"dealer_address\" Text DEFAULT NULL\x2C\n\t\"dealer_phone\" Text DEFAULT NULL\x2C\n\t\"dealer_mail\" Text DEFAULT NULL\x2C\n\t\"dealer_description\" Text DEFAULT NULL\x2C\n\t\"dealer_url\" Text DEFAULT NULL\x2C\n\t\"customer_no\" Text DEFAULT NULL\x2C\n\t\"created_on\" DateTime NOT NULL DEFAULT current_timestamp\x2C\n\t\"changed_on\" DateTime NOT NULL DEFAULT current_timestamp\x2C\n\t\"image\" BLOB DEFAULT NULL\x2C\nCONSTRAINT \"unique_id\" UNIQUE ( id ) );\n\n\n-- ------------------------------------------\n-- Dump of \"dealers_items\"\n-- ------------------------------------------\n\nCREATE TABLE \"dealers_items\"(\n\t\"id_item\" Integer NOT NULL\x2C\n\t\"theValue\" Double NOT NULL DEFAULT 0\x2C\n\t\"id_dealer\" Integer NOT NULL DEFAULT 0\x2C\n\t\"theType\" Integer NOT NULL\x2C\n\t\"id\" Integer NOT NULL PRIMARY KEY AUTOINCREMENT\x2C\nCONSTRAINT \"unique_id\" UNIQUE ( id ) );\n\n\n-- ------------------------------------------\n-- Dump of \"flavors\"\n-- ------------------------------------------\n\nCREATE TABLE \"flavors\"(\n\t\"id\" Integer NOT NULL PRIMARY KEY AUTOINCREMENT\x2C\n\t\"flavor_name\" Text NOT NULL DEFAULT \'Name\'\x2C\n\t\"mixing_ratio\" Text DEFAULT \'2-5%\'\x2C\n\t\"ripe_time\" Text NOT NULL DEFAULT \'2\'\x2C\n\t\"flavor_description\" Text DEFAULT NULL\x2C\n\t\"flavor_rating\" Integer NOT NULL DEFAULT 0\x2C\n\t\"created_on\" DateTime NOT NULL DEFAULT current_timestamp\x2C\n\t\"changed_on\" DateTime NOT NULL DEFAULT current_timestamp\x2C\n\t\"image\" BLOB DEFAULT NULL\x2C\nCONSTRAINT \"unique_id\" UNIQUE ( id ) );\n\n\n-- ------------------------------------------\n-- Dump of \"liquids\"\n-- ------------------------------------------\n\nCREATE TABLE \"liquids\"(\n\t\"id\" Integer NOT NULL PRIMARY KEY AUTOINCREMENT\x2C\n\t\"liquid_name\" Text NOT NULL DEFAULT \'Name\'\x2C\n\t\"liquid_rating\" Integer NOT NULL DEFAULT 0\x2C\n\t\"liquid_description\" Text DEFAULT NULL\x2C\n\t\"created_on\" DateTime NOT NULL DEFAULT current_timestamp\x2C\n\t\"changed_on\" DateTime NOT NULL DEFAULT current_timestamp\x2C\n\t\"image\" BLOB DEFAULT NULL\x2C\nCONSTRAINT \"unique_id\" UNIQUE ( id ) );\n\n\n-- ------------------------------------------\n-- Dump of \"liquids_ingredients\"\n-- ------------------------------------------\n\nCREATE TABLE \"liquids_ingredients\"(\n\t\"id\" Integer NOT NULL PRIMARY KEY AUTOINCREMENT\x2C\n\t\"theType\" Integer NOT NULL DEFAULT 0\x2C\n\t\"theValue\" Integer NOT NULL DEFAULT 0\x2C\n\t\"liquid_id\" Integer NOT NULL DEFAULT 0\x2C\n\t\"theIngredientID\" Integer NOT NULL DEFAULT 0\x2C\nCONSTRAINT \"unique_id\" UNIQUE ( id ) );\n\n\n-- ------------------------------------------\n-- Dump of \"storage\"\n-- ------------------------------------------\n\nCREATE TABLE \"storage\"(\n\t\"id_item\" Integer NOT NULL\x2C\n\t\"theUnit\" Integer NOT NULL DEFAULT 1\x2C\n\t\"theValue\" Double NOT NULL DEFAULT 0\x2C\n\t\"theType\" Integer NOT NULL DEFAULT 0\x2C\n\t\"id\" Integer NOT NULL PRIMARY KEY AUTOINCREMENT\x2C\nCONSTRAINT \"unique_id\" UNIQUE ( id ) );\n\n\n-- ------------------------------------------\n-- Dump of \"storage_units\"\n-- ------------------------------------------\n\nCREATE TABLE \"storage_units\"(\n\t\"id\" Integer NOT NULL PRIMARY KEY AUTOINCREMENT\x2C\n\t\"name_en\" Text NOT NULL DEFAULT \'en_EN\'\x2C\n\t\"name_de\" Text NOT NULL DEFAULT \'de_DE\'\x2C\nCONSTRAINT \"unique_id\" UNIQUE ( id ) );\n\n\nBEGIN;\n\nINSERT INTO \"storage_units\" (\"id\"\x2C\"name_en\"\x2C\"name_de\") VALUES \n( 16\x2C \'Unit(s)\'\x2C \'Einheit(en)\' )\x2C\n( 17\x2C \'fl oz\'\x2C \'Flu\xCC\x88ssigunze\' )\x2C\n( 18\x2C \'ml\'\x2C \'ml\' )\x2C\n( 19\x2C \'l\'\x2C \'l\' )\x2C\n( 20\x2C \'mg\'\x2C \'mg\' )\x2C\n( 21\x2C \'g\'\x2C \'g\' )\x2C\n( 22\x2C \'lb\'\x2C \'Pfund\' )\x2C\n( 23\x2C \'kg\'\x2C \'kg\' )\x2C\n( 24\x2C \'Package(s)\'\x2C \'Packet(e)\' )\x2C\n( 25\x2C \'Bottle(s)\'\x2C \'Flasche(n)\' )\x2C\n( 26\x2C \'Ounce(s)\'\x2C \'Unze(n)\' )\x2C\n( 27\x2C \'Gramm(s)\'\x2C \'Gramm\' )\x2C\n( 28\x2C \'Gallon(s)\'\x2C \'Gallone(n)\' )\x2C\n( 29\x2C \'Box(es)\'\x2C \'Karton(s)\' )\x2C\n( 30\x2C \'Pallet(s)\'\x2C \'Palette(n)\' );\n\n\n\nCOMMIT;", Scope = Private
#tag EndConstant
#tag ViewBehavior
#tag ViewProperty
Name="Index"
Visible=true
Group="ID"
InitialValue="-2147483648"
Type="Integer"
EditorType=""
#tag EndViewProperty
#tag ViewProperty
Name="Left"
Visible=true
Group="Position"
InitialValue="0"
Type="Integer"
EditorType=""
#tag EndViewProperty
#tag ViewProperty
Name="Name"
Visible=true
Group="ID"
InitialValue=""
Type="String"
EditorType=""
#tag EndViewProperty
#tag ViewProperty
Name="Super"
Visible=true
Group="ID"
InitialValue=""
Type="String"
EditorType=""
#tag EndViewProperty