Simple Program with additional Form Designer Code
Posted: Mon Jul 27, 2020 12:07 am
Simple Program with additional Form Designer Code
Form Designer Code :
Form Designer Code :
Code: Select all
;
; 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 W1
Global CT1, TX1, T1, G1, T2, G2, T3, G3, T4, G4, T5, G5, TX2, G6
Enumeration FormMenu
#MenuItem_0
EndEnumeration
Enumeration FormFont
#Font_W1_0
#Font_W1_1
#Font_W1_2
#Font_W1_3
EndEnumeration
LoadFont(#Font_W1_0,"Verdana", 11, #PB_Font_Bold | #PB_Font_Italic)
LoadFont(#Font_W1_1,"Tahoma", 10)
LoadFont(#Font_W1_2,"Verdana", 9)
LoadFont(#Font_W1_3,"Verdana", 10, #PB_Font_Bold)
Procedure OpenW1(x = 0, y = 0, width = 625, height = 115)
W1 = OpenWindow(#PB_Any, x, y, width, height, "", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_ScreenCentered)
SetWindowColor(W1, RGB(150,150,150))
CreateMenu(0, WindowID(W1))
MenuTitle("Quit")
MenuItem(#MenuItem_0, "Quit Program")
MenuTitle("Calculate")
MenuTitle("Clear")
CT1 = ContainerGadget(#PB_Any, 4, 4, 618, 87, #PB_Container_Raised)
SetGadgetColor(CT1, #PB_Gadget_BackColor,RGB(192,192,192))
TX1 = TextGadget(#PB_Any, 2, 1, 200, 22, " ET Factor Calculator")
SetGadgetColor(TX1, #PB_Gadget_FrontColor,RGB(0,0,128))
SetGadgetColor(TX1, #PB_Gadget_BackColor,RGB(192,192,192))
SetGadgetFont(TX1, FontID(#Font_W1_0))
T1 = TextGadget(#PB_Any, 2, 25, 90, 18, " Initial Distance")
SetGadgetColor(T1, #PB_Gadget_FrontColor,RGB(0,0,0))
SetGadgetColor(T1, #PB_Gadget_BackColor,RGB(240,240,240))
SetGadgetFont(T1, FontID(#Font_W1_1))
G1 = StringGadget(#PB_Any, 92, 24, 110, 20, "")
SetGadgetColor(G1, #PB_Gadget_FrontColor,RGB(0,0,0))
SetGadgetColor(G1, #PB_Gadget_BackColor,RGB(255,255,255))
SetGadgetFont(G1, FontID(#Font_W1_2))
T2 = TextGadget(#PB_Any, 206, 25, 90, 18, " Initial ET")
SetGadgetColor(T2, #PB_Gadget_FrontColor,RGB(0,0,0))
SetGadgetColor(T2, #PB_Gadget_BackColor,RGB(240,240,240))
SetGadgetFont(T2, FontID(#Font_W1_1))
G2 = StringGadget(#PB_Any, 296, 24, 110, 20, "")
SetGadgetColor(G2, #PB_Gadget_FrontColor,RGB(0,0,0))
SetGadgetColor(G2, #PB_Gadget_BackColor,RGB(255,255,255))
SetGadgetFont(G2, FontID(#Font_W1_2))
T3 = TextGadget(#PB_Any, 410, 25, 90, 18, " Initial MPH")
SetGadgetColor(T3, #PB_Gadget_FrontColor,RGB(0,0,0))
SetGadgetColor(T3, #PB_Gadget_BackColor,RGB(240,240,240))
SetGadgetFont(T3, FontID(#Font_W1_1))
G3 = StringGadget(#PB_Any, 500, 24, 110, 20, "")
SetGadgetColor(G3, #PB_Gadget_FrontColor,RGB(0,0,0))
SetGadgetColor(G3, #PB_Gadget_BackColor,RGB(255,255,255))
SetGadgetFont(G3, FontID(#Font_W1_2))
T4 = TextGadget(#PB_Any, 2, 45, 90, 18, " Final Distance")
SetGadgetColor(T4, #PB_Gadget_FrontColor,RGB(0,0,0))
SetGadgetColor(T4, #PB_Gadget_BackColor,RGB(240,240,240))
SetGadgetFont(T4, FontID(#Font_W1_1))
G4 = StringGadget(#PB_Any, 92, 44, 110, 20, "")
SetGadgetColor(G4, #PB_Gadget_FrontColor,RGB(0,0,0))
SetGadgetColor(G4, #PB_Gadget_BackColor,RGB(255,255,255))
SetGadgetFont(G4, FontID(#Font_W1_2))
T5 = TextGadget(#PB_Any, 206, 45, 90, 18, " Final ET")
SetGadgetColor(T5, #PB_Gadget_FrontColor,RGB(0,0,0))
SetGadgetColor(T5, #PB_Gadget_BackColor,RGB(240,240,240))
SetGadgetFont(T5, FontID(#Font_W1_1))
G5 = StringGadget(#PB_Any, 296, 44, 110, 20, "")
SetGadgetColor(G5, #PB_Gadget_FrontColor,RGB(0,0,0))
SetGadgetColor(G5, #PB_Gadget_BackColor,RGB(255,255,255))
SetGadgetFont(G5, FontID(#Font_W1_2))
TX2 = TextGadget(#PB_Any, 410, 45, 90, 18, " ET Factor")
SetGadgetColor(TX2, #PB_Gadget_FrontColor,RGB(0,0,128))
SetGadgetColor(TX2, #PB_Gadget_BackColor,RGB(240,240,240))
SetGadgetFont(TX2, FontID(#Font_W1_3))
G6 = StringGadget(#PB_Any, 500, 44, 110, 20, "")
SetGadgetColor(G6, #PB_Gadget_FrontColor,RGB(0,0,0))
SetGadgetColor(G6, #PB_Gadget_BackColor,RGB(255,255,255))
SetGadgetFont(G6, FontID(#Font_W1_2))
CloseGadgetList()
EndProcedure
Procedure W1_Events(event)
Select event
Case #PB_Event_CloseWindow
ProcedureReturn #False
Case #PB_Event_Menu
Select EventMenu()
Case #MenuItem_0
EndSelect
Case #PB_Event_Gadget
Select EventGadget()
EndSelect
EndSelect
ProcedureReturn #True
EndProcedure
OpenW1()
Repeat
event = WaitWindowEvent()
Until W1_Events(event) = #False
End