-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsimple-sqlite-studio-window.pbf
More file actions
57 lines (46 loc) · 2.12 KB
/
simple-sqlite-studio-window.pbf
File metadata and controls
57 lines (46 loc) · 2.12 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
; Form Designer for Purebasic - 5.60
; Warning: this file uses a strict syntax, if you edit it, make sure to respect the Form Designer limitation or it won't be opened again.
;
; This code is automatically generated by the FormDesigner.
; Manual modification is possible to adjust existing commands, but anything else will be dropped when the code is compiled.
; Event procedures needs to be put in another source file.
;
Global WindowMain
Global Output, ButtonOpen, ButtonExecute, Query
Declare ResizeGadgetsWindowMain()
Procedure OpenWindowMain(x = 0, y = 0, width = 600, height = 400)
WindowMain = OpenWindow(#PB_Any, x, y, width, height, "Simple SQLite Studio", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget | #PB_Window_ScreenCentered)
Output = ListIconGadget(#PB_Any, 10, 50, 580, 340, "", 0, #PB_ListIcon_GridLines | #PB_ListIcon_FullRowSelect)
DisableGadget(Output, 1)
ButtonOpen = ButtonGadget(#PB_Any, 10, 10, 50, 25, "Open...")
GadgetToolTip(ButtonOpen, "Open SQLite database")
ButtonExecute = ButtonGadget(#PB_Any, 490, 10, 100, 25, "Execute")
GadgetToolTip(ButtonExecute, "Execute Query")
DisableGadget(ButtonExecute, 1)
Query = ComboBoxGadget(#PB_Any, 70, 10, 410, 25, #PB_ComboBox_Editable)
GadgetToolTip(Query, "Database query")
DisableGadget(Query, 1)
EndProcedure
Procedure ResizeGadgetsWindowMain()
Protected FormWindowWidth, FormWindowHeight
FormWindowWidth = WindowWidth(WindowMain)
FormWindowHeight = WindowHeight(WindowMain)
ResizeGadget(Output, 10, 50, FormWindowWidth - 20, FormWindowHeight - 60)
ResizeGadget(ButtonExecute, FormWindowWidth - 110, 10, 100, 25)
ResizeGadget(Query, 70, 10, FormWindowWidth - 190, 25)
EndProcedure
Procedure WindowMain_Events(event)
Select event
Case #PB_Event_SizeWindow
ResizeGadgetsWindowMain()
Case #PB_Event_CloseWindow
ProcedureReturn #False
Case #PB_Event_Menu
Select EventMenu()
EndSelect
Case #PB_Event_Gadget
Select EventGadget()
EndSelect
EndSelect
ProcedureReturn #True
EndProcedure