In this lesson we want to make a new window with folder tabs.
Start by creating a folder.per with: DATABASE FORMONLY
LAYOUT
FOLDER PAGE(text=”Information”) GRID {
Name: [mx1 ] Last Name: [mx2 ] Age: [mx3 ] Birth: [mx4 ]
} END END
PAGE(text=”Adress”) VBOX GRID {
Street: [mx5 ] City: [mx6 ] Zipcode: [mx7 ] Country: [mx8 ]
} END END END END
ATTRIBUTES
mx1 = FORMONLY.name; mx2 = FORMONLY.lname; mx3 = FORMONLY.age; mx4 = FORMONLY.birth; mx5 = FORMONLY.street; mx6 = FORMONLY.city; mx7 = FORMONLY.zipcode; mx8 = FORMONLY.country; Now we have two new commands “FOLDER” and “PAGE” FOLDER creates our new tabs and PAGE declares the name for the new tabs.
Compile this form with “fcompile -xml folder.per” The next step is to create our main program folder.4gl MAIN
DEFINE name CHAR(50), lname CHAR(50), age CHAR(50), birth CHAR(50), street CHAR(255), city CHAR(255), zipcode CHAR(255), country CHAR(255)
CALL ui.Interface.loadActionDefaults(”default”)
CALL ui.Interface.LoadStyles(”default”)
CLOSE WINDOW screen
OPEN WINDOW w_1 WITH FORM “m_folder”
CALL ui.Interface.setText(”Folder example”)
MENU “Navigation”
COMMAND “Ok”
COMMAND “Edit”
CALL edit()
COMMAND “Exit”
EXIT MENU
END MENU
END MAIN
FUNCTION edit() DEFINE name CHAR(50), lname CHAR(50), age CHAR(50), birth CHAR(50), street CHAR(255), city CHAR(255), zipcode CHAR(255), country CHAR(255)
OPTIONS INPUT WRAP
INPUT BY NAME name,
lname,
age,
birth,
street,
city,
zipcode,
country
END FUNCTION Our folder window is now finished. You can compile this example with “4glpc folder.4gl -o folder.4ae”