This is an application for creating, browsing, searching, editing and printing article codebook with 1.000.000 records. The codebook uses Serbian Latin language.
Below is the code for creating pages in the application, which are displayed in the following screenshots. You can see in the code that each web UI component is created with a single-function call and its attributes are set in Xbase++ language and style without HTML/CSS. You can find the complete code and the application to run in the attachment. First you have to create the database and then you can browse, search and edit it.
Code: Select all
FUNCTION Cb(oSrv)
**
LOCAL aHClr := {clrBlack,clrSkyBlue,clrDodgerBlue},;
auth := "COBA Systems;www.cobasystems.com;coba@cobasystems.com;" +;
"cobasystems@gmail.com;+381 64 2185522 Coba;***;" +;
"SD-SoftDesign;Alaska Software Technology Partner;" +;
"www.sd-softdesign.com;info@sd-softdesign.com;" +;
"sales@sd-softdesign.com"
**
HSETTEXT(oSrv,"Segoe UI")
HASSNSET(oSrv)
**
RETURN HDOCBGN(,{"files/cbook.js"},,,"Article codebook",,,,,,,HSETGUI(,.T.)) +;
HDLGBGN({,1,"R"},{800,450},"Article coodbook",icoPower,;
{,{,clrBeige},,10},{,,,clrDefBG},,,"C") +;
HHEAD(,,"Article Codebook",,{{"Verdana",30},{clrBlue},,,"C"}) +;
HBTN({20,150},{385,150},;
"CREATE BIG DATA;Create a test.dbf database;with 1.000.000 data records",;
icoDbf,{{,14,"B"},{{clrWhite,clrHgBG,clrMViolet},,,aHClr}},;
{{,,14},{40,40},,clrDefBG},{2,,,10},,,,,"CbDbfClk()") +;
HBTN({410,150},{385,150},;
"BROWSE BIG DATA;Browser with data from test.dbf;and standard database operations",;
icoView,{{,14,"B"},{{clrWhite,clrSeaGreen,clrMGold},,,aHClr}},;
{{,,14},{40,40},,clrDefBG},{2,,,10},,,,,HTTPREDIR("CbBrw",,"B")) +;
HTOOLBAR({20,310},,;
{{"Send mail",icoMail,HTTPREDIR("CbMail",,"B")},;
{"Make QR code",bmpQRCode,"CbQrcClk()"},;
{"Help",icoHelp,HTTPREDIR("CbHelp",,"B")},;
{"Authors",icoAuthor,"MsgInfo('" + auth + "','','Authors')",,;
{,,,,.F.}}},;
{{190,100},{{,14,"B"},{{clrDBlue,clrLBrown,clrMBrown},,,aHClr}},;
{,{32,32},,clrDefBG}}) +;
HDLGPOP(HIMG(,{260,260},,,,,,,{"QrcImg"}),"QRCode COBA SYSTEMS",,,;
{"QrcDlg"},"DlgClose('QrcDlg');") +;
HDLGEND() + HDOCEND()
*============================================================================*
FUNCTION CbBrw(oSrv)
**
LOCAL html, path := HAPATH(oSrv) + "data\",;
aCols := {{"IF(flag_,'files/CheckBox.bmp','')","St",,20,"I"},;
{"mark_","Code",,60},;
{"idname_","Acticle name",,140},;
{"meas_","UoM",,40},;
{"quan_","Stock" + chrLF + "quantity",,100,,"99,999,999,999.999"},;
{"price4_","Retail" + chrLF +"price",,100,,"9,999,999,999.99"},;
{"price0_","Net invoice" + chrLF +"price",,100,,"9,999,999,999.99"},;
{"price1_","Gross invoice" + chrLF +"price",,100,,"9,999,999,999.99"},;
{"price2_","Purchase" + chrLF +"price",,100,,"9,999,999,999.99"},;
{"price3_","Wholesale" + chrLF +"price",,100,,"9,999,999,999.99"},;
{"taxr_","Tax%",,40,,"999.9"},;
{"uuid_","UUID",,280}}
**
IF !FEXISTS(path + "Test.dbf") .OR. !FEXISTS(path + "Test.dbt") .OR. ;
!FEXISTS(path + "Test_s.ntx") .OR. !FEXISTS(path + "Test_n.ntx")
RETURN ""
ENDIF
**
HASSNSET(oSrv,"IsTemp",.F.)
HASSNSET(oSrv,"FltExp","")
HASSNSET(oSrv,"FltCnt",0)
HASSNSET(oSrv,"Temp",UNIQFNAME(path,,"DBF"))
HASSNSET(oSrv,"Path",path)
SET PATH TO (path)
DBOPEN(,{{{"Test"},{"Test_s"}}},,,.T.)
**
html = HDOCBGN(,{"files/cbook.js"},,,"Article codebook") +;
HDLGBGN(,{1200},"Article codebook",icoPower,{,{,clrBeige},,10},;
{,,,clrDefBG},,,"C") +;
HDIVBGN({,1,"R"},{1200,720}) +;
HHEAD({20},,"Browse and edit articles",,{,{"mediumblue"}}) +;
HTOOLBAR({20,110},,;
{{"Find code",,"CbFltClk('C')"},;
{"Find name",,"CbFltClk('N')"},;
{"Find word",,"CbFltClk('W')"},;
{"Filter price-",,"CbFltClk('P-')"},;
{"Filter price+",,"CbFltClk('P+')"},;
{"Filter quantity-",,"CbFltClk('Q-')"},;
{"Filter quantity+",,"CbFltClk('Q+')"},;
{"Filter off",,"CbFltClk('OF')"},;
{"Print",,"CbPrnClk()"},;
{"Reindex",,"CbIndClk()"},;
{"Exit",,HTTPREDIR("CbExit",,"B")}},;
{{120,30},{{,,"B"},{{clrBlack,clrSkyBlue,clrRoyalBlue},,,;
{clrBlue,clrLinen,clrBrown}}}},,{"CbTBar"},"V") +;
HPARAG({180,70},,"Click on an article to display its details.",;
{{,12,"B"},{"brown"}}) +;
HBRWPGN({180,110},{500,510},,aCols,{,,"CbPage"},100,,,{"ArtDetDisp"},,;
{"CbBrw"}) +;
HFORMBGN({710,110},{470,500},,,,{,{,clrWhite},,5,,"A"},{,,clrMBlue},,,;
{"ArtForm"}) +;
HFORMTBL({,-5,"M","R"},;
{{35,"Article code:",{,,12,7},,,,,{,"Code"}},;
{35,"Article name:",{,,30,25},,,,,{,"Name"}},;
{35,"Unit of measure:",{,,5,3},,,,,{,"Meas"}},;
{35,"Stock quanitity:",{,,18,15},,,,,{,"Quan"}},;
{35,"Retail price:",{,,15,13},,,,,{,"Price4"}},;
{35,"Net invoice price:",{,,15,13},,,,,{,"Price0"}},;
{35,"Gross invoice price:",{,,15,13},,,,,{,"Price1"}},;
{35,"Purchase price:",{,,15,13},,,,,{,"Price2"}},;
{35,"Wholesale price:",{,,15,13},,,,,{,"Price3"}},;
{35,"Tax (%):",{,,5,5},,,,,{,"Tax"}},;
{35,"Date of change:",,"D",,,,{,"Date"}},;
{35,"ID:",{,,10,5},,,,,{,"Id"}},;
{35,"UUID:",{,,40,36},,,,,{,"Uuid"}},;
{35,"Flag:",,"2S",,,,{,"Flag"}},;
{120,"Description:",{340,,,5},"ML",,,,{,"Desc"}}},;
{130,350}) +;
HFORMEND() +;
HTOOLBAR({620,660},,;
{{"Add",bmpNewDoc,"ArtAddClk()",,,{"AddBtn"}},;
{"Edit",icoEditText,"ArtEditClk()",,,{"EditBtn"},.T.},;
{"Delete",icoTrash,"ArtDelClk()",,,{"DelBtn"},.T.},;
{"Save",bmpSave,"ArtSaveClk()",,,{"SaveBtn"},.T.},;
{"Cancel",bmpDelete,"ArtCancClk()",,,{"CancBtn"},.T.}},;
{{110,30},,{,,,clrDefBG}}) +;
HEDITDATA(,{{35,"Value: ",{,,20,20},,,,,{"Filter","Filter"}}},;
{50,165},"Filter",,,,{"FltDlg"},"CbFltAct") +;
HEDITDATA(,;
{{35,"From code:",{,,12,7},,,,,{"FrCode","FrCode"}},;
{35,"To code:",{,,12,7},,,,,{"ToCode","ToCode"}}},;
{80,120},"Print",,,,{"PrnDlg"},"CbPrnAct") +;
HEDITDATA(,{{35,"Code: ",{,,12,7},,,,,{"Code_","Code_"}}},;
{50,120},"New code",,,,{"NewDlg"},"ArtNewAct") +;
HSCRP(HSETGUI(.T.,.T.) + " GetDisable(1,14); GetDisable(19);") +;
HDIVEND() + HDLGEND() + HDOCEND()
CLOSE
RETURN html
*============================================================================*