' *************************************************************************************
' Application Constants and Declares
' *************************************************************************************
' add any custom constants here
' add any custom declares here
DECLARE SUB Form1_Display(BYVAL Parent$)
DECLARE SUB Form1_Design()
DECLARE SUB Form1_Events(CID&, CMsg&, CVal&, Cancel&)
' ------------------------------------------------
' ----------------------------------------------------------
%FORM1_FILE = 4000
' ----------------------------------------------------------
%FORM1_NEWFILE = 4005
%FORM1_OPENFILE = 4010
%FORM1_SAVEFILE = 4015
%FORM1_SAVEAS = 4020
%FORM1_SEPARATOR_4025 = 4025
%FORM1_EXIT = 4030
' ----------------------------------------------------------
%FORM1_EDIT = 4100
' ----------------------------------------------------------
%FORM1_CUT = 4105
%FORM1_COPY = 4110
%FORM1_PASTE = 4115
' ----------------------------------------------------------
%FORM1_HELP = 4200
' ----------------------------------------------------------
%FORM1_HELP1 = 4205
%FORM1_BUTTON1 = 100
%FORM1_CHECK1 = 105
%FORM1_RADIO1 = 110
%FORM1_TEXT1 = 115
%FORM1_LISTBOX1 = 120
%FORM1_COMBOBOX1 = 125
%FORM1_VSCROLL1 = 130
%FORM1_HSCROLL1 = 135
%FORM1_LABEL1 = 140
%FORM1_PROGRESS1 = 145
%FORM1_UPDOWN1 = 150
%FORM1_RICHTEXTONE1 = 155
%FORM1_LISTVIEW1 = 160
%FORM1_TREEVIEW1 = 165
%FORM1_HTRACKBAR1 = 170
%FORM1_DATETIME1 = 175
%FORM1_FRAME1 = 180
%FORM1_TAB1 = 185
' ------------------------------------------------
DECLARE SUB FORM1_FILE_Select()
DECLARE SUB FORM1_NEWFILE_Select()
DECLARE SUB FORM1_OPENFILE_Select()
DECLARE SUB FORM1_SAVEFILE_Select()
DECLARE SUB FORM1_SAVEAS_Select()
DECLARE SUB FORM1_EXIT_Select()
DECLARE SUB FORM1_EDIT_Select()
DECLARE SUB FORM1_CUT_Select()
DECLARE SUB FORM1_COPY_Select()
DECLARE SUB FORM1_PASTE_Select()
DECLARE SUB FORM1_HELP_Select()
DECLARE SUB FORM1_HELP1_Select()
DECLARE SUB FORM1_BUTTON1_Click()
DECLARE SUB FORM1_CHECK1_Click()
DECLARE SUB FORM1_RADIO1_Click()
DECLARE SUB FORM1_TEXT1_Change()
DECLARE SUB FORM1_LISTBOX1_Change(BYVAL CVal&)
DECLARE SUB FORM1_COMBOBOX1_Change(BYVAL CVal&)
DECLARE SUB FORM1_VSCROLL1_Change(BYVAL CVal&)
DECLARE SUB FORM1_HSCROLL1_Change(BYVAL CVal&)
DECLARE SUB FORM1_UPDOWN1_Change(BYVAL CVal&)
DECLARE SUB FORM1_RICHTEXTONE1_Load(BYVAL Mode&, BYVAL D$)
DECLARE SUB FORM1_RICHTEXTONE1_Change()
DECLARE SUB FORM1_LISTVIEW1_Fill(BYVAL Mode&)
DECLARE SUB FORM1_LISTVIEW1_Change(BYVAL CVal&)
DECLARE SUB FORM1_LISTVIEW1_Select(BYVAL CVal&)
DECLARE SUB FORM1_TREEVIEW1_Fill(BYVAL Mode&)
DECLARE SUB FORM1_TREEVIEW1_Select(BYVAL CVal&)
DECLARE SUB FORM1_HTRACKBAR1_Change(BYVAL CVal&)
DECLARE SUB FORM1_DATETIME1_Change()
DECLARE SUB FORM1_TAB1_Change(BYVAL CVal&)
' *************************************************************************************
' Application Global Variables and Types
' *************************************************************************************
' add any globals here
' Global Handles for menus
GLOBAL FORM1_hMenu0&
GLOBAL FORM1_hMenu1&
GLOBAL FORM1_hMenu2&
GLOBAL FORM1_hMenu3&
' Note: Do NOT change the names of the EZGUI Callback Procedures !
' --------------------
#INCLUDE "C:\ezgui30\includes\ezwmain.inc" ' EZGUI Include file for WinMain
' --------------------
' *************************************************************************************
' EZGUI Program Control Functions
' *************************************************************************************
SUB EZ_Main(VerNum&)
' VerNum& = Version number (ie. 101 = Version 1.01)
EZ_Reg 0, 0 ' use your Customer ID Number and Registration Number here.
EZ_DefFont 6, "Arial", 10, "V"
EZ_DefFont 7, "Courier New", 10, "F"
EZ_DefFont 8, "Times New Roman", 10, "V"
EZ_DefFont 9, "Modern", 10, "V"
Form1_Display ""
END SUB
' -------------------------------------------------------------------------------------
SUB EZ_DesignWindow(FormName$)
' - NOTE: EZGUI passes back Form Name in uppercase letters
SELECT CASE FormName$
CASE "FORM1"
Form1_Design
CASE "{ABORT}"
' add controls to Print Abort Dialog here
CASE ELSE
END SELECT
END SUB
' -------------------------------------------------------------------------------------
SUB EZ_Events(FormName$, CID&, CMsg&, CVal&, Cancel&)
' =============================================================================
' CID& = Control ID or %EZ_Window (0) if Window event
' CMsg& = Control Event Message (Type)
' CVal& = Value: (ie. Scrollbar value)
' Cancel& = is for Closing a Window. Set Cancel& to -1 (True) to stop close
' =============================================================================
' - NOTE: EZGUI passes back Form Name in uppercase letters
' =============================================================================
' - NOTE: EZGUI passes back Form Name in uppercase letters
SELECT CASE FormName$
CASE "FORM1"
Form1_Events CID&, CMsg&, CVal&, Cancel&
CASE "{ABORT}"
CASE "{APP}"
IF CMsg&=%EZ_Terminate THEN
END IF
CASE ELSE
END SELECT
END SUB
' -------------------------------------------------------------------------------------
' add any Library procedures/functions here
' *************************************************************************************
' Put Your Code Here
' *************************************************************************************
SUB Form1_Display(BYVAL Parent$)
FORM1_hMenu0&=EZ_DefMainMenu( %FORM1_FILE, "&File", "")
EZ_Color -1, -1
EZ_Form "FORM1", Parent$, "Your Dialog", 0, 0, 122, 30, "CK"
END SUB
' ------------------------------------------------
GLOBAL Form1_FF&
SUB Form1_Design()
LOCAL FF&
'---------------------------------------------------------------
FF& = 9 ' - Offset for Font Numbers
Form1_FF& = FF& ' Global for ODButtons Draw code
'---------------------------------------------------------------
EZ_AddMenuItem FORM1_hMenu0&, %FORM1_EDIT, 0, "&Edit", ""
EZ_AddMenuItem FORM1_hMenu0&, %FORM1_HELP, 0, "&Help", ""
FORM1_hMenu1&=EZ_DefSubMenu( %FORM1_NEWFILE, "&New File", "")
EZ_SetSubMenu FORM1_hMenu0& , %FORM1_FILE, FORM1_hMenu1&
EZ_AddMenuItem FORM1_hMenu1&, %FORM1_OPENFILE, 0, "&Open File", ""
EZ_AddMenuItem FORM1_hMenu1&, %FORM1_SAVEFILE, 0, "&Save File", ""
EZ_AddMenuItem FORM1_hMenu1&, %FORM1_SAVEAS, 0, "Save File &As", ""
EZ_AddMenuItem FORM1_hMenu1&, %FORM1_SEPARATOR_4025, 0, "-", ""
EZ_AddMenuItem FORM1_hMenu1&, %FORM1_EXIT, 0, "E&xit", ""
FORM1_hMenu2&=EZ_DefSubMenu( %FORM1_CUT, "Cu&t", "")
EZ_SetSubMenu FORM1_hMenu0& , %FORM1_EDIT, FORM1_hMenu2&
EZ_AddMenuItem FORM1_hMenu2&, %FORM1_COPY, 0, "&Copy", ""
EZ_AddMenuItem FORM1_hMenu2&, %FORM1_PASTE, 0, "&Paste", ""
FORM1_hMenu3&=EZ_DefSubMenu( %FORM1_HELP1, "&Contents", "")
EZ_SetSubMenu FORM1_hMenu0& , %FORM1_HELP, FORM1_hMenu3&
' ------------------------------------------------
EZ_Color-1,-1
EZ_UseFont -1
EZ_UseFont 4
EZ_Button %FORM1_BUTTON1, 4, 1, 13, 3, "Button 1", "T"
' --------------------------------------------------------------
EZ_UseFont 4
EZ_CheckBox %FORM1_CHECK1, 25, 1, 17, 2, "Check 1", "T"
' --------------------------------------------------------------
EZ_UseFont 4
EZ_Radio %FORM1_RADIO1, 42, 1, 17, 2, "Radio 1", "T"
' --------------------------------------------------------------
EZ_Color 1, 25
EZ_UseFont 4
EZ_Text %FORM1_TEXT1, 5, 5, 15, 2, "", "EST"
' --------------------------------------------------------------
EZ_Color-1,-1
EZ_UseFont 4
EZ_ListBox %FORM1_LISTBOX1, 4, 8, 14, 4, "Item 1|Item 2|Item 3|Item 4|Item 5|", "SAVT"
' --------------------------------------------------------------
EZ_UseFont 4
EZ_ComboBox %FORM1_COMBOBOX1, 4, 13, 16, 5.25, "Item 1|Item 2|Item 3|Item 4|Item 5|", "SAVT"
EZ_SelectItem "Form1", %FORM1_COMBOBOX1, 0
' --------------------------------------------------------------
EZ_UseFont 4
EZ_VScroll %FORM1_VSCROLL1, 4, 16, 3, 7, ""
EZ_SetVScroll "Form1", %FORM1_VSCROLL1, 0, 100, 50, 1
' --------------------------------------------------------------
EZ_UseFont 4
EZ_HScroll %FORM1_HSCROLL1, 4, 24, 18, 2, ""
EZ_SetHScroll "Form1", %FORM1_HSCROLL1, 0, 100, 50, 1
' --------------------------------------------------------------
EZ_Color 9, 15
EZ_UseFont 4
EZ_Label %FORM1_LABEL1, 11, 16, 14, 2, "Label 1", "C"
' --------------------------------------------------------------
EZ_Color-1,-1
EZ_UseFont 4
EZ_ProgressBar %FORM1_PROGRESS1, 30, 21, 20, 2, ""
EZ_SetPBar "Form1", %FORM1_PROGRESS1, 0, 100, 50
' --------------------------------------------------------------
EZ_UseFont 4
EZ_UpDown %FORM1_UPDOWN1, 31, 24, 2.375, 2, ""
EZ_SetUpDown "Form1", %FORM1_UPDOWN1, 0, 100, 50
' --------------------------------------------------------------
EZ_UseFont 4
EZ_RichText1 %FORM1_RICHTEXTONE1, 59, 4, 24, 5, "STVB"
FORM1_RICHTEXTONE1_Load -1, ""
' --------------------------------------------------------------
EZ_UseFont 4
EZ_ListView %FORM1_LISTVIEW1, 59, 11, 27, 5, "Column 1{15}|Column 2{15}{C}|Column 3{15}{R}|", "SVT"
FORM1_LISTVIEW1_Fill -1
' --------------------------------------------------------------
EZ_UseFont 4
EZ_TreeView %FORM1_TREEVIEW1, 61, 17, 28, 5, "SVT+-"
FORM1_TREEVIEW1_Fill -1
' --------------------------------------------------------------
EZ_UseFont 4
EZ_HTrackBar %FORM1_HTRACKBAR1, 43, 24, 27, 2, ""
EZ_SetTBar "Form1", %FORM1_HTRACKBAR1, 0, 100, 50
' --------------------------------------------------------------
EZ_UseFont 4
EZ_DateTime %FORM1_DATETIME1, 91, 3, 19, 2, "T"
' --------------------------------------------------------------
EZ_UseFont 4
EZ_Frame %FORM1_FRAME1, 29, 7, 11, 5, "Frame 1", ""
' --------------------------------------------------------------
EZ_UseFont 4
EZ_TabControl %FORM1_TAB1, 30, 14, 21, 6, "Tab 1|Tab 2|Tab 3", ""
' --------------------------------------------------------------
END SUB
' ------------------------------------------------
SUB Form1_Events(CID&, CMsg&, CVal&, Cancel&)
SELECT CASE CID&
CASE %EZ_Window
IF CMsg&=%EZ_Close THEN
END IF
CASE %FORM1_FILE
FORM1_FILE_Select
CASE %FORM1_NEWFILE
FORM1_NEWFILE_Select
CASE %FORM1_OPENFILE
FORM1_OPENFILE_Select
CASE %FORM1_SAVEFILE
FORM1_SAVEFILE_Select
CASE %FORM1_SAVEAS
FORM1_SAVEAS_Select
CASE %FORM1_SEPARATOR_4025
CASE %FORM1_EXIT
FORM1_EXIT_Select
CASE %FORM1_EDIT
FORM1_EDIT_Select
CASE %FORM1_CUT
FORM1_CUT_Select
CASE %FORM1_COPY
FORM1_COPY_Select
CASE %FORM1_PASTE
FORM1_PASTE_Select
CASE %FORM1_HELP
FORM1_HELP_Select
CASE %FORM1_HELP1
FORM1_HELP1_Select
CASE %FORM1_BUTTON1
IF CMsg&=%EZ_Click THEN
FORM1_BUTTON1_Click
END IF
CASE %FORM1_CHECK1
IF CMsg&=%EZ_Click THEN
FORM1_CHECK1_Click
END IF
CASE %FORM1_RADIO1
IF CMsg&=%EZ_Click THEN
FORM1_RADIO1_Click
END IF
CASE %FORM1_TEXT1
IF CMsg&=%EZ_Change THEN
FORM1_TEXT1_Change
END IF
CASE %FORM1_LISTBOX1
IF CMsg&=%EZ_Change THEN
FORM1_LISTBOX1_Change CVal&
END IF
CASE %FORM1_COMBOBOX1
IF CMsg&=%EZ_Change THEN
FORM1_COMBOBOX1_Change CVal&
END IF
CASE %FORM1_VSCROLL1
IF CMsg&=%EZ_Change THEN
FORM1_VSCROLL1_Change CVal&
END IF
CASE %FORM1_HSCROLL1
IF CMsg&=%EZ_Change THEN
FORM1_HSCROLL1_Change CVal&
END IF
CASE %FORM1_UPDOWN1
IF CMsg&=%EZ_Change THEN
FORM1_UPDOWN1_Change CVal&
END IF
CASE %FORM1_RICHTEXTONE1
IF CMsg&=%EZ_Change THEN
FORM1_RICHTEXTONE1_Change
END IF
CASE %FORM1_LISTVIEW1
IF CMsg&=%EZ_Change THEN
FORM1_LISTVIEW1_Change CVal&
END IF
IF CMsg&=%EZ_Selected THEN
FORM1_LISTVIEW1_Select CVal&
END IF
CASE %FORM1_TREEVIEW1
IF CMsg&=%EZ_Selected THEN
FORM1_TREEVIEW1_Select CVal&
END IF
CASE %FORM1_HTRACKBAR1
IF CMsg&=%EZ_Change THEN
FORM1_HTRACKBAR1_Change CVal&
END IF
CASE %FORM1_DATETIME1
IF CMsg&=%EZ_Change THEN
FORM1_DATETIME1_Change
END IF
CASE %FORM1_TAB1
IF CMsg&=%EZ_Change THEN
FORM1_TAB1_Change CVal&
END IF
CASE ELSE
END SELECT
END SUB
' ------------------------------------------------
' ------------------------------------------------
SUB FORM1_FILE_Select()
END SUB
' ------------------------------------------------
' ------------------------------------------------
SUB FORM1_NEWFILE_Select()
END SUB
' ------------------------------------------------
' ------------------------------------------------
SUB FORM1_OPENFILE_Select()
END SUB
' ------------------------------------------------
' ------------------------------------------------
SUB FORM1_SAVEFILE_Select()
END SUB
' ------------------------------------------------
' ------------------------------------------------
SUB FORM1_SAVEAS_Select()
END SUB
' ------------------------------------------------
' ------------------------------------------------
SUB FORM1_EXIT_Select()
END SUB
' ------------------------------------------------
' ------------------------------------------------
SUB FORM1_EDIT_Select()
END SUB
' ------------------------------------------------
' ------------------------------------------------
SUB FORM1_CUT_Select()
END SUB
' ------------------------------------------------
' ------------------------------------------------
SUB FORM1_COPY_Select()
END SUB
' ------------------------------------------------
' ------------------------------------------------
SUB FORM1_PASTE_Select()
END SUB
' ------------------------------------------------
' ------------------------------------------------
SUB FORM1_HELP_Select()
END SUB
' ------------------------------------------------
' ------------------------------------------------
SUB FORM1_HELP1_Select()
END SUB
' ------------------------------------------------
' ------------------------------------------------
SUB FORM1_BUTTON1_Click()
END SUB
' ------------------------------------------------
SUB FORM1_CHECK1_Click()
END SUB
' ------------------------------------------------
SUB FORM1_RADIO1_Click()
END SUB
' ------------------------------------------------
SUB FORM1_TEXT1_Change()
END SUB
' ------------------------------------------------
SUB FORM1_LISTBOX1_Change(BYVAL CVal&)
END SUB
' ------------------------------------------------
SUB FORM1_COMBOBOX1_Change(BYVAL CVal&)
END SUB
' ------------------------------------------------
SUB FORM1_VSCROLL1_Change(BYVAL CVal&)
END SUB
' ------------------------------------------------
SUB FORM1_HSCROLL1_Change(BYVAL CVal&)
END SUB
' ------------------------------------------------
SUB FORM1_UPDOWN1_Change(BYVAL CVal&)
END SUB
' ------------------------------------------------
SUB FORM1_RICHTEXTONE1_Load(BYVAL Mode&, BYVAL D$)
END SUB
' ------------------------------------------------
SUB FORM1_RICHTEXTONE1_Change()
END SUB
' ------------------------------------------------
SUB FORM1_LISTVIEW1_Fill(BYVAL Mode&)
LOCAL R&, C&, Tmp$
IF Mode&=-1 THEN ' Initial Data
FOR R&=0 TO 50 ' Rows
FOR C&=0 TO 5 ' Columns
Tmp$="Item "+RIGHT$("00"+LTRIM$(STR$(R&)),2)+","+STR$(C&)
EZ_AddLVItem "Form1", %FORM1_LISTVIEW1, Tmp$, 0, R&, C&, ""
NEXT C&
NEXT R&
END IF
END SUB
' ------------------------------------------------
SUB FORM1_LISTVIEW1_Change(BYVAL CVal&)
END SUB
' ------------------------------------------------
SUB FORM1_LISTVIEW1_Select(BYVAL CVal&)
END SUB
' ------------------------------------------------
SUB FORM1_TREEVIEW1_Fill(BYVAL Mode&)
LOCAL N1&, N2&, hParent&, Prop$, hAfter&, P&
LOCAL TreeHandles&()
IF Mode&=-1 THEN ' Initial Data
DIM TreeHandles&(1 TO 3, 1 TO 3)
FOR N1&=1 TO 3
FOR N2&=1 TO 3
P&=1
hParent&=0
Prop$="{T}{S}+"
IF N2&>1 THEN
hParent&=TreeHandles&(N1&,1)
Prop$="{T}{S}+"
P&=2
END IF
IF N2&>2 THEN
hParent&=Treehandles&(N1&,2)
Prop$="{T}{S}"
P&=2
END IF
hAfter&=0
TreeHandles&(N1&,N2&)=EZ_AddTVItem("Form1", %FORM1_TREEVIEW1, hParent& , hAfter&, "Item"+STR$(N1&)+","+STR$(N2&),P&,0,Prop$)
NEXT N2&
NEXT N1&
END IF
END SUB
' ------------------------------------------------
SUB FORM1_TREEVIEW1_Select(BYVAL CVal&)
END SUB
' ------------------------------------------------
SUB FORM1_HTRACKBAR1_Change(BYVAL CVal&)
END SUB
' ------------------------------------------------
SUB FORM1_DATETIME1_Change()
END SUB
' ------------------------------------------------
SUB FORM1_TAB1_Change(BYVAL CVal&)
EZ_DisplayLayer "Form1", CVal&, 0 OR %EZ_DECtrls
END SUB
EZGUI is event based and it would be nice to be able to do this in a thinbasic module.
Bookmarks