Procházet zdrojové kódy

Added some test program fro fltk

mingodad před 13 roky
rodič
revize
20c8359339

+ 447 - 0
samples/test-fltk-2.nut

@@ -0,0 +1,447 @@
+function _tr(str){ return str;}
+
+class Fl_Data_Table extends Flv_Table {
+	constructor(px, py, pw, ph, pl=""){
+		base.constructor(px, py, pw, ph, pl);
+	}
+}
+	
+class SalesTaxRatesEditWindow extends Fl_Window {
+	grid=null;
+	editGroup=null;
+	db_sales_tax_rates_id=null;
+	db_sales_tax_rates_cdate=null;
+	db_sales_tax_rates_mdate=null;
+	db_sales_tax_rates_rate1=null;
+	db_sales_tax_rates_rate2=null;
+	db_sales_tax_rates_is_active=null;
+	db_sales_tax_rates_description=null;
+	dbAction=null;
+	btnDbAction= null;
+	
+constructor() {
+	base.constructor(10, 50, 500, 385, _tr("Sales Tax Rates List / Edit"));
+	dbAction = new Fl_Button(0, 0, 100, 25, _tr("Action"));
+	btnDbAction = new Fl_Button(0, 0, 100, 25, _tr("Action"));
+	begin();
+	this->box(FL_FLAT_BOX);
+	this->color(FL_BACKGROUND_COLOR);
+	this->selection_color(FL_BACKGROUND_COLOR);
+	this->labeltype(FL_NO_LABEL);
+	this->labelfont(0);
+	this->labelsize(16);
+	this->labelcolor(FL_FOREGROUND_COLOR);
+	this->align((FL_ALIGN_TOP));
+	this->when(FL_WHEN_RELEASE);
+	{ grid = new Fl_Data_Table(5, 5, 490, 200);
+	  grid->tooltip(_tr("List of available sales tax"));
+	  grid->type(3);
+	  grid->box(FL_NO_BOX);
+	  grid->color(FL_BACKGROUND2_COLOR);
+	  grid->selection_color(FL_SELECTION_COLOR);
+	  grid->labeltype(FL_NO_LABEL);
+	  grid->labelfont(0);
+	  grid->labelsize(16);
+	  grid->labelcolor(FL_FOREGROUND_COLOR);
+	  grid->textsize(16);
+	  grid->align((FL_ALIGN_BOTTOM));
+	  grid->when(FL_WHEN_RELEASE_ALWAYS);
+	  Fl_Group.current()->resizable(grid);
+	} // Fl_Data_Table* grid
+	{ editGroup = new Fl_Group(5, 215, 490, 165);
+	  editGroup->box(FL_ENGRAVED_BOX);
+	  editGroup->color(246);
+	  editGroup->labelsize(16);
+	  editGroup->align((FL_ALIGN_RIGHT));
+	  { db_sales_tax_rates_id = new Fl_Output(15, 240, 82, 26, _tr("ID"));
+	    db_sales_tax_rates_id->tooltip(_tr("The unique identifier"));
+	    db_sales_tax_rates_id->labelsize(16);
+	    db_sales_tax_rates_id->textsize(16);
+	    db_sales_tax_rates_id->align((FL_ALIGN_TOP_LEFT));
+	    add_input_field_to_map("sales_tax_rates", "id", db_sales_tax_rates_id);
+	  } // Fl_Output* db_sales_tax_rates_id
+	  { db_sales_tax_rates_cdate = new Fl_Output(115, 240, 120, 25, _tr("CDate"));
+	    db_sales_tax_rates_cdate->tooltip(_tr("The creation date"));
+	    db_sales_tax_rates_cdate->labelsize(16);
+	    db_sales_tax_rates_cdate->textsize(16);
+	    db_sales_tax_rates_cdate->align((FL_ALIGN_TOP_LEFT));
+	    add_input_field_to_map("sales_tax_rates", "cdate", db_sales_tax_rates_cdate);
+	  } // Fl_Output* db_sales_tax_rates_cdate
+	  { db_sales_tax_rates_mdate = new Fl_Output(255, 240, 120, 25, _tr("MDate"));
+	    db_sales_tax_rates_mdate->tooltip(_tr("The modification date"));
+	    db_sales_tax_rates_mdate->labelsize(16);
+	    db_sales_tax_rates_mdate->textsize(16);
+	    db_sales_tax_rates_mdate->align((FL_ALIGN_TOP_LEFT));
+	    add_input_field_to_map("sales_tax_rates", "mdate", db_sales_tax_rates_mdate);
+	  } // Fl_Output* db_sales_tax_rates_mdate
+	  { db_sales_tax_rates_rate1 = new Fl_Float_Input(15, 295, 82, 25, _tr("V.A.T. %"));
+	    db_sales_tax_rates_rate1->tooltip(_tr("Main sales tax percentage"));
+	    db_sales_tax_rates_rate1->type(1);
+	    db_sales_tax_rates_rate1->labelsize(16);
+	    db_sales_tax_rates_rate1->textfont(1);
+	    db_sales_tax_rates_rate1->textsize(16);
+	    db_sales_tax_rates_rate1->align((FL_ALIGN_TOP_LEFT));
+	    add_input_field_to_map("sales_tax_rates", "rate1", db_sales_tax_rates_rate1);
+	  } // Fl_Float_Input* db_sales_tax_rates_rate1
+	  { db_sales_tax_rates_rate2 = new Fl_Float_Input(115, 295, 82, 25, _tr("R.E. %"));
+	    db_sales_tax_rates_rate2->tooltip(_tr("Secondary sales tax percentage"));
+	    db_sales_tax_rates_rate2->type(1);
+	    db_sales_tax_rates_rate2->labelsize(16);
+	    db_sales_tax_rates_rate2->textfont(1);
+	    db_sales_tax_rates_rate2->textsize(16);
+	    db_sales_tax_rates_rate2->align((FL_ALIGN_TOP_LEFT));
+	    add_input_field_to_map("sales_tax_rates", "rate2", db_sales_tax_rates_rate2);
+	  } // Fl_Float_Input* db_sales_tax_rates_rate2
+	  { db_sales_tax_rates_is_active = new Fl_Check_Button(255, 294, 100, 23, _tr("Active"));
+	    db_sales_tax_rates_is_active->tooltip(_tr("We can deactivate instead of delete it"));
+	    db_sales_tax_rates_is_active->down_box(FL_DOWN_BOX);
+	    db_sales_tax_rates_is_active->labelsize(16);
+	    add_input_field_to_map("sales_tax_rates", "is_active", db_sales_tax_rates_is_active);
+	  } // Fl_Check_Button* db_sales_tax_rates_is_active
+	  { db_sales_tax_rates_description = new Fl_Input(15, 345, 350, 25, _tr("Description"));
+	    db_sales_tax_rates_description->tooltip(_tr("A friendly description to identify this tax"));
+	    db_sales_tax_rates_description->labelsize(16);
+	    db_sales_tax_rates_description->textfont(1);
+	    db_sales_tax_rates_description->textsize(16);
+	    db_sales_tax_rates_description->align((FL_ALIGN_TOP_LEFT));
+	    add_input_field_to_map("sales_tax_rates", "description", db_sales_tax_rates_description);
+	  } // Fl_Input* db_sales_tax_rates_description
+	  { 
+	    Fl_Group.current()->add(dbAction);
+	    dbAction->resize(380, 310, 105, 25);
+	    dbAction->down_box(FL_BORDER_BOX);
+	    dbAction->labeltype(FL_NO_LABEL);
+	    dbAction->labelsize(16);
+	    dbAction->textsize(16);
+	  } // Fl_Choice* dbAction
+	  { 
+	    Fl_Group.current()->add(btnDbAction);
+	    btnDbAction->resize(380, 345, 105, 25);
+	    btnDbAction->label(_tr("Action"));
+	    btnDbAction->labelsize(16);
+	  } // Fl_Button* btnDbAction
+	  editGroup->end();
+	} // Fl_Group* editGroup
+	end();
+}
+
+function add_input_field_to_map(tbl, fldname, fld){}
+}
+
+
+class MainWindow extends Fl_Window {
+	tabs=null;
+	tabSales=null;
+	btnOrdersSales=null;
+	btnPaymentsSales=null;
+	btnEntitiesSales=null;
+	btnProductsSales=null;
+	tabBuys=null;
+	btnOrdersBuys=null;
+	btnPaymentsBuys=null;
+	btnProductsBuys=null;
+	btnEntitiesBuys=null;
+	tabAll=null;
+	btnOrders=null;
+	btnPayments=null;
+	btnEntities=null;
+	btnProducts=null;
+	tabGL=null;
+	btnGLGroups=null;
+	btnGLChart=null;
+	btnGLTransactions=null;
+	tabConfig=null;
+	config_scroll=null;
+	config_pack=null;
+	btnOrdersSum=null;
+	btnSalesTaxRates=null;
+	btnOrderTypes=null;
+	btnPaymentTypes=null;
+	btnMeasureUnits=null;
+	btnWarrantyTypes=null;
+	btnImages=null;
+	btnProductGroups=null;
+	btnEntityGroups=null;
+	btnConfig=null;
+	btnOpenDB=null;
+	btnTranslations=null;
+	btnAppUsers=null;
+	btnAskForPrinter=null;
+	btnWebServer=null;
+
+constructor(px, py, pw, ph, pl) {
+	base.constructor(px, py, pw, ph, pl);
+	begin();
+	this->box(FL_FLAT_BOX);
+	this->color(FL_BACKGROUND_COLOR);
+	this->selection_color(FL_BACKGROUND_COLOR);
+	this->labeltype(FL_NO_LABEL);
+	this->labelfont(0);
+	this->labelsize(16);
+	this->labelcolor(FL_FOREGROUND_COLOR);
+	this->align(FL_ALIGN_TOP);
+	this->when(FL_WHEN_RELEASE);
+	reset_all_child_windows_ptr();
+	{ tabs = new Fl_Tabs(5, 5, 320, 310);
+	  tabs->selection_color(4);
+	  tabs->labelsize(16);
+	  tabs->labelcolor(FL_BACKGROUND2_COLOR);
+	  { tabSales = new Fl_Group(5, 35, 320, 280, _tr("Sales"));
+	    tabSales->color(127);
+	    tabSales->labelsize(16);
+	    { btnOrdersSales = new Fl_Button(30, 50, 275, 55, _tr("Sales"));
+	      btnOrdersSales->labeltype(FL_SHADOW_LABEL);
+	      btnOrdersSales->labelfont(3);
+	      btnOrdersSales->labelsize(34);
+	      btnOrdersSales->labelcolor(FL_INACTIVE_COLOR);
+	      btnOrdersSales->callback(cb_btnOrdersSales);
+	      btnOrdersSales->align(FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
+	    } // Fl_Button* btnOrdersSales
+	    { btnPaymentsSales = new Fl_Button(30, 116, 275, 55, _tr("Payments"));
+	      btnPaymentsSales->labeltype(FL_SHADOW_LABEL);
+	      btnPaymentsSales->labelfont(3);
+	      btnPaymentsSales->labelsize(34);
+	      btnPaymentsSales->labelcolor(FL_INACTIVE_COLOR);
+	      btnPaymentsSales->callback(cb_btnPaymentsSales);
+	    } // Fl_Button* btnPaymentsSales
+	    { btnEntitiesSales = new Fl_Button(30, 183, 275, 55, _tr("Customers"));
+	      btnEntitiesSales->labeltype(FL_SHADOW_LABEL);
+	      btnEntitiesSales->labelfont(3);
+	      btnEntitiesSales->labelsize(34);
+	      btnEntitiesSales->labelcolor(FL_INACTIVE_COLOR);
+	      btnEntitiesSales->callback(cb_btnEntitiesSales);
+	    } // Fl_Button* btnEntitiesSales
+	    { btnProductsSales = new Fl_Button(30, 250, 275, 55, _tr("Products"));
+	      btnProductsSales->labeltype(FL_SHADOW_LABEL);
+	      btnProductsSales->labelfont(3);
+	      btnProductsSales->labelsize(34);
+	      btnProductsSales->labelcolor(FL_INACTIVE_COLOR);
+	      btnProductsSales->callback(cb_btnProductsSales);
+	    } // Fl_Button* btnProductsSales
+	    tabSales->end();
+	  } // Fl_Group* tabSales
+	  { tabBuys = new Fl_Group(5, 35, 320, 280, _tr("Buys"));
+	    tabBuys->color(174);
+	    tabBuys->labelsize(16);
+	    tabBuys->hide();
+	    { btnOrdersBuys = new Fl_Button(30, 50, 275, 55, _tr("Buys"));
+	      btnOrdersBuys->labeltype(FL_SHADOW_LABEL);
+	      btnOrdersBuys->labelfont(3);
+	      btnOrdersBuys->labelsize(34);
+	      btnOrdersBuys->labelcolor(FL_INACTIVE_COLOR);
+	      btnOrdersBuys->callback(cb_btnOrdersBuys);
+	      btnOrdersBuys->align((FL_ALIGN_CENTER|FL_ALIGN_INSIDE));
+	    } // Fl_Button* btnOrdersBuys
+	    { btnPaymentsBuys = new Fl_Button(30, 115, 275, 55, _tr("Payments"));
+	      btnPaymentsBuys->labeltype(FL_SHADOW_LABEL);
+	      btnPaymentsBuys->labelfont(3);
+	      btnPaymentsBuys->labelsize(34);
+	      btnPaymentsBuys->labelcolor(FL_INACTIVE_COLOR);
+	      btnPaymentsBuys->callback(cb_btnPaymentsBuys);
+	    } // Fl_Button* btnPaymentsBuys
+	    { btnProductsBuys = new Fl_Button(30, 250, 275, 55, _tr("Products"));
+	      btnProductsBuys->labeltype(FL_SHADOW_LABEL);
+	      btnProductsBuys->labelfont(3);
+	      btnProductsBuys->labelsize(34);
+	      btnProductsBuys->labelcolor(FL_INACTIVE_COLOR);
+	      btnProductsBuys->callback(cb_btnProductsBuys);
+	    } // Fl_Button* btnProductsBuys
+	    { btnEntitiesBuys = new Fl_Button(30, 183, 275, 55, _tr("Suppliers"));
+	      btnEntitiesBuys->labeltype(FL_SHADOW_LABEL);
+	      btnEntitiesBuys->labelfont(3);
+	      btnEntitiesBuys->labelsize(34);
+	      btnEntitiesBuys->labelcolor(FL_INACTIVE_COLOR);
+	      btnEntitiesBuys->callback(cb_btnEntitiesBuys);
+	    } // Fl_Button* btnEntitiesBuys
+	    tabBuys->end();
+	  } // Fl_Group* tabBuys
+	  { tabAll = new Fl_Group(5, 35, 320, 280, _tr("All"));
+	    tabAll->color(239);
+	    tabAll->labelsize(16);
+	    tabAll->hide();
+	    { btnOrders = new Fl_Button(30, 50, 275, 55, _tr("Orders"));
+	      btnOrders->labeltype(FL_SHADOW_LABEL);
+	      btnOrders->labelfont(3);
+	      btnOrders->labelsize(34);
+	      btnOrders->labelcolor(FL_INACTIVE_COLOR);
+	      btnOrders->callback(cb_btnOrders);
+	      btnOrders->align((FL_ALIGN_CENTER|FL_ALIGN_INSIDE));
+	    } // Fl_Button* btnOrders
+	    { btnPayments = new Fl_Button(30, 116, 275, 55, _tr("Payments"));
+	      btnPayments->labeltype(FL_SHADOW_LABEL);
+	      btnPayments->labelfont(3);
+	      btnPayments->labelsize(34);
+	      btnPayments->labelcolor(FL_INACTIVE_COLOR);
+	      btnPayments->callback(cb_btnPayments);
+	    } // Fl_Button* btnPayments
+	    { btnEntities = new Fl_Button(30, 183, 275, 55, _tr("Entities"));
+	      btnEntities->labeltype(FL_SHADOW_LABEL);
+	      btnEntities->labelfont(3);
+	      btnEntities->labelsize(34);
+	      btnEntities->labelcolor(FL_INACTIVE_COLOR);
+	      btnEntities->callback(cb_btnEntities);
+	    } // Fl_Button* btnEntities
+	    { btnProducts = new Fl_Button(30, 250, 275, 55, _tr("Products"));
+	      btnProducts->labeltype(FL_SHADOW_LABEL);
+	      btnProducts->labelfont(3);
+	      btnProducts->labelsize(34);
+	      btnProducts->labelcolor(FL_INACTIVE_COLOR);
+	      btnProducts->callback(cb_btnProducts);
+	    } // Fl_Button* btnProducts
+	    tabAll->end();
+	    Fl_Group.current()->resizable(tabAll);
+	  } // Fl_Group* tabAll
+	  { tabGL = new Fl_Group(5, 35, 320, 280, _tr("GL"));
+	    tabGL->color(132);
+	    tabGL->labelsize(16);
+	    tabGL->hide();
+	    { btnGLGroups = new Fl_Button(30, 50, 275, 55, _tr("Groups"));
+	      btnGLGroups->labeltype(FL_SHADOW_LABEL);
+	      btnGLGroups->labelfont(3);
+	      btnGLGroups->labelsize(34);
+	      btnGLGroups->labelcolor(FL_INACTIVE_COLOR);
+	      btnGLGroups->callback(cb_btnGLGroups);
+	      btnGLGroups->align((FL_ALIGN_CENTER|FL_ALIGN_INSIDE));
+	    } // Fl_Button* btnGLGroups
+	    { btnGLChart = new Fl_Button(30, 115, 275, 55, _tr("Chart"));
+	      btnGLChart->labeltype(FL_SHADOW_LABEL);
+	      btnGLChart->labelfont(3);
+	      btnGLChart->labelsize(34);
+	      btnGLChart->labelcolor(FL_INACTIVE_COLOR);
+	      btnGLChart->callback(cb_btnGLChart);
+	    } // Fl_Button* btnGLChart
+	    { btnGLTransactions = new Fl_Button(30, 180, 275, 55, _tr("Transactions"));
+	      btnGLTransactions->labeltype(FL_SHADOW_LABEL);
+	      btnGLTransactions->labelfont(3);
+	      btnGLTransactions->labelsize(34);
+	      btnGLTransactions->labelcolor(FL_INACTIVE_COLOR);
+	      btnGLTransactions->callback(cb_btnGLTransactions);
+	    } // Fl_Button* btnGLTransactions
+	    tabGL->end();
+	  } // Fl_Group* tabGL
+	  { tabConfig = new Fl_Group(5, 35, 320, 280, _tr("Config"));
+	    tabConfig->labelsize(16);
+	    tabConfig->hide();
+	    { config_scroll = new Fl_Scroll(10, 45, 310, 265);
+	      config_scroll->labelsize(16);
+	      { local o = config_pack = new Fl_Pack(30, 45, 270, 260);
+		config_pack->labelsize(16);
+		{ btnOrdersSum = new Fl_Button(65, 55, 64, 30, _tr("Orders Sum"));
+		  btnOrdersSum->labelsize(16);
+		  btnOrdersSum->callback(cb_btnOrdersSum);
+		} // Fl_Button* btnOrdersSum
+		{ btnSalesTaxRates = new Fl_Button(55, 45, 64, 30, _tr("Sales Tax Rates"));
+		  btnSalesTaxRates->labelsize(16);
+		  btnSalesTaxRates->callback(cb_btnSalesTaxRates);
+		} // Fl_Button* btnSalesTaxRates
+		{ btnOrderTypes = new Fl_Button(65, 80, 64, 30, _tr("Order Types"));
+		  btnOrderTypes->labelsize(16);
+		  btnOrderTypes->callback(cb_btnOrderTypes);
+		} // Fl_Button* btnOrderTypes
+		{ btnPaymentTypes = new Fl_Button(105, 148, 64, 30, _tr("Payment Types"));
+		  btnPaymentTypes->labelsize(16);
+		  btnPaymentTypes->callback(cb_btnPaymentTypes);
+		} // Fl_Button* btnPaymentTypes
+		{ btnMeasureUnits = new Fl_Button(115, 158, 64, 30, _tr("Measure Units"));
+		  btnMeasureUnits->labelsize(16);
+		  btnMeasureUnits->callback(cb_btnMeasureUnits);
+		} // Fl_Button* btnMeasureUnits
+		{ btnWarrantyTypes = new Fl_Button(125, 168, 64, 30, _tr("Warranty Types"));
+		  btnWarrantyTypes->labelsize(16);
+		  btnWarrantyTypes->callback(cb_btnWarrantyTypes);
+		} // Fl_Button* btnWarrantyTypes
+		{ btnImages = new Fl_Button(75, 118, 64, 30, _tr("Images"));
+		  btnImages->labelsize(16);
+		  btnImages->callback(cb_btnImages);
+		} // Fl_Button* btnImages
+		{ btnProductGroups = new Fl_Button(85, 128, 64, 30, _tr("Product Groups"));
+		  btnProductGroups->labelsize(16);
+		  btnProductGroups->callback(cb_btnProductGroups);
+		} // Fl_Button* btnProductGroups
+		{ btnEntityGroups = new Fl_Button(95, 138, 64, 30, _tr("Entity Groups"));
+		  btnEntityGroups->labelsize(16);
+		  btnEntityGroups->callback(cb_btnEntityGroups);
+		} // Fl_Button* btnEntityGroups
+		{ btnConfig = new Fl_Button(105, 148, 64, 30, _tr("App Config"));
+		  btnConfig->labelsize(16);
+		  btnConfig->callback(cb_btnConfig);
+		} // Fl_Button* btnConfig
+		{ btnOpenDB = new Fl_Button(115, 158, 64, 30, _tr("Open Database"));
+		  btnOpenDB->tooltip(_tr("Open a database file"));
+		  btnOpenDB->labelsize(16);
+		  btnOpenDB->callback(cb_btnOpenDB);
+		} // Fl_Button* btnOpenDB
+		{ btnTranslations = new Fl_Button(115, 158, 64, 30, _tr("Translations"));
+		  btnTranslations->labelsize(16);
+		  btnTranslations->callback(cb_btnTranslations);
+		} // Fl_Button* btnTranslations
+		{ btnAppUsers = new Fl_Button(75, 65, 64, 30, _tr("App Users"));
+		  btnAppUsers->labelsize(16);
+		  btnAppUsers->callback(cb_btnAppUsers);
+		} // Fl_Button* btnAppUsers
+		{ btnAskForPrinter = new Fl_Check_Button(55, 70, 64, 15, _tr("Ask for Printer"));
+		  btnAskForPrinter->down_box(FL_DOWN_BOX);
+		} // Fl_Check_Button* btnAskForPrinter
+		{ btnWebServer = new Fl_Check_Button(65, 80, 64, 15, _tr("Web Server"));
+		  btnWebServer->down_box(FL_DOWN_BOX);
+		} // Fl_Check_Button* btnWebServer
+		o->spacing(5);
+		config_pack->end();
+	      } // Fl_Pack* config_pack
+	      config_scroll->end();
+	    } // Fl_Scroll* config_scroll
+	    tabConfig->end();
+	  } // Fl_Group* tabConfig
+	  tabs->end();
+	} // Fl_Tabs* tabs
+	end();
+}
+function cb_btnEntitiesSales(){print(__LINE__);}
+function cb_btnPaymentsSales(){print(__LINE__);}
+function cb_btnOrdersSales(sender, udata){print(__LINE__, sender, udata);}
+function cb_btnProductsSales(){print(__LINE__);}
+function cb_btnOrdersBuys(){print(__LINE__);}
+function cb_btnPaymentsBuys(){print(__LINE__);}
+function cb_btnProductsBuys(){print(__LINE__);}
+function cb_btnEntitiesBuys(){print(__LINE__);}
+function cb_btnOrders(){print(__LINE__);}
+function cb_btnPayments(){print(__LINE__);}
+function cb_btnEntities(){print(__LINE__);}
+function cb_btnProducts(){print(__LINE__);}
+function cb_btnGLGroups(){print(__LINE__);}
+function cb_btnGLChart(){print(__LINE__);}
+function cb_btnGLTransactions(){print(__LINE__);}
+function cb_btnOrdersSum(){print(__LINE__);}
+function cb_btnSalesTaxRates(sender, udata){
+	local win = new SalesTaxRatesEditWindow();
+	win.show();
+}
+function cb_btnOrderTypes(){print(__LINE__);}
+function cb_btnPaymentTypes(){print(__LINE__);}
+function cb_btnMeasureUnits(){print(__LINE__);}
+function cb_btnWarrantyTypes(){print(__LINE__);}
+function cb_btnImages(){print(__LINE__);}
+function cb_btnProductGroups(){print(__LINE__);}
+function cb_btnEntityGroups(){print(__LINE__);}
+function cb_btnConfig(){print(__LINE__);}
+function cb_btnOpenDB(){print(__LINE__);}
+function cb_btnTranslations(){print(__LINE__);}
+function cb_btnAppUsers(){print(__LINE__);}
+function reset_all_child_windows_ptr(){print(__LINE__);}
+}
+local win = new MainWindow(10, 50, 330, 320, "OURBIZ");
+//local win = new SalesTaxRatesEditWindow();
+win->resizable(win);
+win->show_main();
+
+math.number_format_set_dec_point(",");
+math.number_format_set_thousand_sep(".");
+Fl_Input.default_number_format("\0x02,.");
+//Fl:scheme("plastic");
+Fl.scheme("gtk+");
+//use partial match to find verdana font
+Fl.visual(FL_RGB);
+//allow arrow keys navigation
+Fl.option(Fl.OPTION_ARROW_FOCUS, true);
+
+Fl.run();

+ 92 - 0
samples/test-fltk-3.nut

@@ -0,0 +1,92 @@
+function _tr(str){ return str;}
+
+class Fl_Data_Table extends Flv_Table {
+	_forPrint = null;
+	
+	constructor(px, py, pw, ph, pl=""){
+		base.constructor(px, py, pw, ph, pl);
+		_forPrint=false;
+	}
+}
+	
+//class BaseReportA4 extends Fl_Group {
+class BaseReportA4 extends Fl_Window {
+	rpt_Logo=null;
+	rpt_Title=null;
+	rpt_SubTitle=null;
+	rpt_Body=null;
+	rpt_SubFooter=null;
+	rpt_Footer=null;
+	
+constructor() {
+	base.constructor(10, 50, 420, 594, _tr("BaseReportA4"));
+begin();
+{ rpt_Logo = new Fl_Box(10, 5, 105, 35, _tr("Ourbiz"));
+  rpt_Logo->labeltype(FL_SHADOW_LABEL);
+  rpt_Logo->labelfont(3);
+  rpt_Logo->labelsize(30);
+  rpt_Logo->align((644|FL_ALIGN_INSIDE));
+} // Fl_Box* rpt_Logo
+{ rpt_Title = new Fl_Box(120, 5, 295, 20, _tr("Report Title"));
+  rpt_Title->labelfont(1);
+  rpt_Title->labelsize(16);
+} // Fl_Box* rpt_Title
+{ rpt_SubTitle = new Fl_Box(120, 30, 290, 10, _tr("Date"));
+  rpt_SubTitle->labelsize(8);
+  rpt_SubTitle->align((FL_ALIGN_RIGHT|FL_ALIGN_INSIDE));
+} // Fl_Box* rpt_SubTitle
+{ local o = new Fl_Box(10, 40, 405, 1, _tr("Line"));
+  o->box(FL_FLAT_BOX);
+  o->color(34);
+  o->labeltype(FL_NO_LABEL);
+} // Fl_Box* o
+{ local o = rpt_Body = new Fl_Data_Table(10, 45, 408, 495);
+  rpt_Body->box(FL_NO_BOX);
+  rpt_Body->color(FL_BACKGROUND2_COLOR);
+  rpt_Body->selection_color(FL_SELECTION_COLOR);
+  rpt_Body->labeltype(FL_NORMAL_LABEL);
+  rpt_Body->labelfont(0);
+  rpt_Body->labelsize(8);
+  rpt_Body->labelcolor(FL_FOREGROUND_COLOR);
+  rpt_Body->textsize(8);
+  rpt_Body->align((FL_ALIGN_BOTTOM));
+  rpt_Body->when(FL_WHEN_RELEASE_ALWAYS);
+  Fl_Group.current()->resizable(rpt_Body);
+  o->has_scrollbar(FLVS_NONE);
+  o->feature_remove(FLVF_ROW_SELECT | FLVF_PERSIST_SELECT);
+  o->_forPrint = true;
+} // Fl_Data_Table* rpt_Body
+{ local o = new Fl_Box(10, 545, 405, 1, _tr("Line"));
+  o->box(FL_FLAT_BOX);
+  o->color(34);
+  o->labeltype(FL_NO_LABEL);
+} // Fl_Box* o
+{ rpt_SubFooter = new Fl_Box(10, 547, 405, 10, _tr("Page"));
+  rpt_SubFooter->labelfont(1);
+  rpt_SubFooter->labelsize(8);
+  rpt_SubFooter->align((FL_ALIGN_CENTER|FL_ALIGN_INSIDE));
+} // Fl_Box* rpt_SubFooter
+{ rpt_Footer = new Fl_Box(10, 560, 405, 19, _tr("OURBIZ is an excelente application to manage a business."));
+  rpt_Footer->labelfont(2);
+  rpt_Footer->labelsize(8);
+  rpt_Footer->align((129|FL_ALIGN_INSIDE));
+} // Fl_Box* rpt_Footer
+end();
+}
+}
+//local win = new MainWindow(10, 50, 330, 320, "OURBIZ");
+local win = new BaseReportA4();
+win->resizable(win);
+win->show_main();
+
+math.number_format_set_dec_point(",");
+math.number_format_set_thousand_sep(".");
+Fl_Input.default_number_format("\0x02,.");
+//Fl:scheme("plastic");
+Fl.scheme("gtk+");
+//use partial match to find verdana font
+Fl.visual(FL_RGB);
+//allow arrow keys navigation
+Fl.option(Fl.OPTION_ARROW_FOCUS, true);
+
+Fl.run();

+ 641 - 0
samples/test-fltk-4.nut

@@ -0,0 +1,641 @@
+function _tr(str){ return str;}
+
+class Fl_Data_Table extends Flv_Table {
+	_forPrint = null;
+	
+	constructor(px, py, pw, ph, pl=""){
+		base.constructor(px, py, pw, ph, pl);
+		_forPrint=false;
+	}
+}
+
+class Fl_Box_ClearLabel extends Fl_Box {
+	constructor(px, py, pw, ph, pl=""){
+		base.constructor(px, py, pw, ph, pl);
+	}
+}
+	
+//class BaseReportA4 extends Fl_Group {
+class BaseReportA4 extends Fl_Window {
+	page=null;
+	pageDesignGroup=null;
+	logoGroupH=null;
+	logoH=null;
+	companyBoxH=null;
+	logoGroupV=null;
+	logoV=null;
+	companyBoxHV=null;
+	companyBoxV=null;
+	logoGroupHV=null;
+	logoGroupHV=null;
+	logoHV1=null;
+	logoHV2=null;
+	OrderNumber=null;
+	box_header_number_date=null;
+	box_data_number_date=null;
+	header_date_box=null;
+	box_data_date_box=null;
+	box_to=null;
+	orderLines=null;
+	header_lines_code_box=null;
+	header_lines_description_box=null;
+	header_lines_quantity_box=null;
+	header_lines_price_box=null;
+	header_lines_discount_box=null;
+	header_lines_sales_tax1_box=null;
+	header_lines_sales_tax2_box=null;
+	header_lines_subtotal_box=null;
+	designLinesGroup=null;
+	data_lines_code_box=null;
+	data_lines_description_box=null;
+	data_lines_quantity_box=null;
+	data_tlines_price_box=null;
+	data_lines_discount_box=null;
+	data_lines_sales_tax1_box=null;
+	data_lines_sales_tax2_box=null;
+	data_lines_subtotal_box=null;
+	orderTotals=null;
+	header_PAGENO_box=null;
+	box_data_pageno_box=null;
+	header_totals_subtotal_box=null;
+	data_totals_subtotal_box=null;
+	header_totals_total_sales_tax1_box=null;
+	data_totals_total_sales_tax1_box=null;
+	header_totals_total_sales_tax2_box=null;
+	data_totals_total_sales_tax2_box=null;
+	header_totals_total_box=null;
+	data_totals_total_box=null;
+	notes_box=null;
+	printDataGroup=null;
+	orderTypeBox=null;
+	numberBox=null;
+	dateBox=null;
+	entityBox=null;
+	dataLinesGroup=null;
+	codeBox=null;
+	descriptionBox=null;
+	quantityBox=null;
+	priceBox=null;
+	discountBox=null;
+	sales_tax1Box=null;
+	sales_tax2Box=null;
+	lineTotalBox=null;
+	bottomTotals=null;
+	orderPageBox=null;
+	fisrtTotalBox=null;
+	sales_tax1AmountBox=null;
+	sales_tax2AmountBox=null;
+	totalBox=null;
+	
+constructor() {
+	base.constructor(10, 50, 634, 686, _tr("InvoiceA4"));
+begin();
+this->box(FL_FLAT_BOX);
+this->color(FL_BACKGROUND_COLOR);
+this->selection_color(FL_BACKGROUND_COLOR);
+this->labeltype(FL_NO_LABEL);
+this->labelfont(0);
+this->labelsize(14);
+this->labelcolor(FL_FOREGROUND_COLOR);
+this->align((FL_ALIGN_TOP));
+this->when(FL_WHEN_RELEASE);
+{ page = new Fl_Group(0, 0, 634, 686);
+  page->color(FL_BACKGROUND2_COLOR);
+  { pageDesignGroup = new Fl_Group(2, 0, 630, 686);
+    pageDesignGroup->labeltype(FL_NO_LABEL);
+    { logoGroupH = new Fl_Group(15, 10, 316, 130);
+      logoGroupH->hide();
+      { logoH = new Fl_Box(16, 10, 310, 50, _tr("FLTK"));
+        logoH->labeltype(FL_SHADOW_LABEL);
+        logoH->labelfont(3);
+        logoH->labelsize(40);
+        logoH->align((644|FL_ALIGN_INSIDE));
+      } // Fl_Box* logoH
+      { companyBoxH = new Fl_Box_ClearLabel(16, 65, 308, 75, _tr(@"FLTK (pronounced ""fulltick"") is a cross-platform C++ GUI toolkit for UNIX\
+\302\256/Linux\302\256 (X11), Microsoft\302\256 Windows\302\256, and MacOS\
+\302\256 X. FLTK provides modern GUI functionality without the bloat and suppo\
+rts 3D graphics via OpenGL\302\256 and its built-in GLUT emulation."));
+        companyBoxH->box(FL_NO_BOX);
+        companyBoxH->color(FL_BACKGROUND_COLOR);
+        companyBoxH->selection_color(FL_BACKGROUND_COLOR);
+        companyBoxH->labeltype(FL_NORMAL_LABEL);
+        companyBoxH->labelfont(2);
+        companyBoxH->labelsize(10);
+        companyBoxH->labelcolor(FL_FOREGROUND_COLOR);
+        companyBoxH->align((FL_ALIGN_WRAP|FL_ALIGN_INSIDE));
+        companyBoxH->when(FL_WHEN_RELEASE);
+      } // Fl_Box_ClearLabel* companyBoxH
+      logoGroupH->end();
+    } // Fl_Group* logoGroupH
+    { logoGroupV = new Fl_Group(15, 10, 316, 130);
+      logoGroupV->hide();
+      { logoV = new Fl_Box(16, 10, 100, 130, _tr("FLTK"));
+        logoV->labeltype(FL_SHADOW_LABEL);
+        logoV->labelfont(3);
+        logoV->labelsize(40);
+        logoV->align((644|FL_ALIGN_INSIDE));
+      } // Fl_Box* logoV
+      { companyBoxV = new Fl_Box_ClearLabel(120, 10, 210, 130, _tr(@"FLTK (pronounced ""fulltick"") is a cross-platform C++ GUI toolkit for UNIX\
+\302\256/Linux\302\256 (X11), Microsoft\302\256 Windows\302\256, and MacOS\
+\302\256 X. FLTK provides modern GUI functionality without the bloat and suppo\
+rts 3D graphics via OpenGL\302\256 and its built-in GLUT emulation."));
+        companyBoxV->box(FL_NO_BOX);
+        companyBoxV->color(FL_BACKGROUND_COLOR);
+        companyBoxV->selection_color(FL_BACKGROUND_COLOR);
+        companyBoxV->labeltype(FL_NORMAL_LABEL);
+        companyBoxV->labelfont(2);
+        companyBoxV->labelsize(10);
+        companyBoxV->labelcolor(FL_FOREGROUND_COLOR);
+        companyBoxV->align((FL_ALIGN_WRAP|FL_ALIGN_INSIDE));
+        companyBoxV->when(FL_WHEN_RELEASE);
+      } // Fl_Box_ClearLabel* companyBoxV
+      logoGroupV->end();
+    } // Fl_Group* logoGroupV
+    { logoGroupHV = new Fl_Group(15, 10, 316, 130);
+      { logoHV1 = new Fl_Box(16, 10, 100, 130, _tr("FLTK"));
+        logoHV1->labeltype(FL_SHADOW_LABEL);
+        logoHV1->labelfont(3);
+        logoHV1->labelsize(40);
+        logoHV1->align((644|FL_ALIGN_INSIDE));
+      } // Fl_Box* logoHV1
+      { logoHV2 = new Fl_Box(120, 10, 210, 50, _tr("FLTK"));
+        logoHV2->labeltype(FL_SHADOW_LABEL);
+        logoHV2->labelfont(3);
+        logoHV2->labelsize(40);
+        logoHV2->align((644|FL_ALIGN_INSIDE));
+      } // Fl_Box* logoHV2
+      { companyBoxHV = new Fl_Box_ClearLabel(120, 50, 210, 90, _tr(@"FLTK (pronounced ""fulltick"") is a cross-platform C++ GUI toolkit for UNIX\
+\302\256/Linux\302\256 (X11), Microsoft\302\256 Windows\302\256, and MacOS\
+\302\256 X. FLTK provides modern GUI functionality without the bloat and suppo\
+rts 3D graphics via OpenGL\302\256 and its built-in GLUT emulation."));
+        companyBoxHV->box(FL_NO_BOX);
+        companyBoxHV->color(FL_BACKGROUND_COLOR);
+        companyBoxHV->selection_color(FL_BACKGROUND_COLOR);
+        companyBoxHV->labeltype(FL_NORMAL_LABEL);
+        companyBoxHV->labelfont(2);
+        companyBoxHV->labelsize(9);
+        companyBoxHV->labelcolor(FL_FOREGROUND_COLOR);
+        companyBoxHV->align((FL_ALIGN_WRAP|FL_ALIGN_INSIDE));
+        companyBoxHV->when(FL_WHEN_RELEASE);
+      } // Fl_Box_ClearLabel* companyBoxHV
+      logoGroupHV->end();
+    } // Fl_Group* logoGroupHV
+    { OrderNumber = new Fl_Group(336, 10, 286, 40);
+      OrderNumber->box(FL_FLAT_BOX);
+      OrderNumber->color(FL_DARK3);
+      OrderNumber->labeltype(FL_NO_LABEL);
+      { box_header_number_date = new Fl_Box(337, 11, 142, 18);
+        box_header_number_date->box(FL_FLAT_BOX);
+        box_header_number_date->color(FL_DARK1);
+        box_header_number_date->labeltype(FL_NO_LABEL);
+        box_header_number_date->labelsize(12);
+      } // Fl_Box* box_header_number_date
+      { box_data_number_date = new Fl_Box(337, 30, 142, 19);
+        box_data_number_date->box(FL_FLAT_BOX);
+        box_data_number_date->color(FL_BACKGROUND2_COLOR);
+        box_data_number_date->labeltype(FL_NO_LABEL);
+        box_data_number_date->labelsize(12);
+      } // Fl_Box* box_data_number_date
+      { header_date_box = new Fl_Box(480, 11, 141, 18, _tr("DATE"));
+        header_date_box->box(FL_FLAT_BOX);
+        header_date_box->color(FL_DARK1);
+        header_date_box->labelfont(1);
+        header_date_box->labelsize(12);
+      } // Fl_Box* header_date_box
+      { box_data_date_box = new Fl_Box(480, 30, 141, 19);
+        box_data_date_box->box(FL_FLAT_BOX);
+        box_data_date_box->color(FL_BACKGROUND2_COLOR);
+        box_data_date_box->labeltype(FL_NO_LABEL);
+        box_data_date_box->labelfont(1);
+        box_data_date_box->labelsize(12);
+      } // Fl_Box* box_data_date_box
+      OrderNumber->end();
+    } // Fl_Group* OrderNumber
+    { box_to = new Fl_Box(336, 55, 286, 85);
+      box_to->box(FL_BORDER_FRAME);
+      box_to->color(FL_DARK3);
+      box_to->labelfont(1);
+      box_to->labelsize(16);
+      box_to->align((FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE));
+    } // Fl_Box* box_to
+    { orderLines = new Fl_Group(16, 148, 606, 433);
+      orderLines->box(FL_FLAT_BOX);
+      orderLines->color(FL_DARK3);
+      orderLines->labeltype(FL_NO_LABEL);
+      { header_lines_code_box = new Fl_Box(17, 149, 46, 20, _tr("CODE"));
+        header_lines_code_box->box(FL_FLAT_BOX);
+        header_lines_code_box->color(FL_DARK1);
+        header_lines_code_box->labelfont(1);
+        header_lines_code_box->labelsize(10);
+      } // Fl_Box* header_lines_code_box
+      { header_lines_description_box = new Fl_Box(64, 149, 300, 20, _tr("DESCRIPTION"));
+        header_lines_description_box->box(FL_FLAT_BOX);
+        header_lines_description_box->color(FL_DARK1);
+        header_lines_description_box->labelfont(1);
+        header_lines_description_box->labelsize(10);
+      } // Fl_Box* header_lines_description_box
+      { header_lines_quantity_box = new Fl_Box(365, 149, 40, 20, _tr("QTY."));
+        header_lines_quantity_box->box(FL_FLAT_BOX);
+        header_lines_quantity_box->color(FL_DARK1);
+        header_lines_quantity_box->labelfont(1);
+        header_lines_quantity_box->labelsize(10);
+      } // Fl_Box* header_lines_quantity_box
+      { header_lines_price_box = new Fl_Box(406, 149, 60, 20, _tr("PRICE"));
+        header_lines_price_box->box(FL_FLAT_BOX);
+        header_lines_price_box->color(FL_DARK1);
+        header_lines_price_box->labelfont(1);
+        header_lines_price_box->labelsize(10);
+      } // Fl_Box* header_lines_price_box
+      { header_lines_discount_box = new Fl_Box(467, 149, 30, 20, _tr("DISC. %"));
+        header_lines_discount_box->box(FL_FLAT_BOX);
+        header_lines_discount_box->color(FL_DARK1);
+        header_lines_discount_box->labelfont(1);
+        header_lines_discount_box->labelsize(8);
+        header_lines_discount_box->align((FL_ALIGN_WRAP));
+      } // Fl_Box* header_lines_discount_box
+      { header_lines_sales_tax1_box = new Fl_Box(498, 149, 30, 20, _tr("S.T. I %"));
+        header_lines_sales_tax1_box->box(FL_FLAT_BOX);
+        header_lines_sales_tax1_box->color(FL_DARK1);
+        header_lines_sales_tax1_box->labelfont(1);
+        header_lines_sales_tax1_box->labelsize(8);
+        header_lines_sales_tax1_box->align((FL_ALIGN_WRAP));
+      } // Fl_Box* header_lines_sales_tax1_box
+      { header_lines_sales_tax2_box = new Fl_Box(529, 149, 30, 20, _tr("S.T. II %"));
+        header_lines_sales_tax2_box->box(FL_FLAT_BOX);
+        header_lines_sales_tax2_box->color(FL_DARK1);
+        header_lines_sales_tax2_box->labelfont(1);
+        header_lines_sales_tax2_box->labelsize(8);
+        header_lines_sales_tax2_box->align((FL_ALIGN_WRAP));
+      } // Fl_Box* header_lines_sales_tax2_box
+      { header_lines_subtotal_box = new Fl_Box(560, 149, 61, 20, _tr("SUBTOTAL"));
+        header_lines_subtotal_box->box(FL_FLAT_BOX);
+        header_lines_subtotal_box->color(FL_DARK1);
+        header_lines_subtotal_box->labelfont(1);
+        header_lines_subtotal_box->labelsize(10);
+      } // Fl_Box* header_lines_subtotal_box
+      { designLinesGroup = new Fl_Group(17, 170, 604, 410);
+        designLinesGroup->labeltype(FL_NO_LABEL);
+        { data_lines_code_box = new Fl_Box(17, 170, 46, 410);
+          data_lines_code_box->box(FL_FLAT_BOX);
+          data_lines_code_box->color(FL_BACKGROUND2_COLOR);
+          data_lines_code_box->labeltype(FL_NO_LABEL);
+          data_lines_code_box->labelfont(1);
+          data_lines_code_box->labelsize(10);
+        } // Fl_Box* data_lines_code_box
+        { data_lines_description_box = new Fl_Box(64, 170, 300, 410);
+          data_lines_description_box->box(FL_FLAT_BOX);
+          data_lines_description_box->color(FL_BACKGROUND2_COLOR);
+          data_lines_description_box->labeltype(FL_NO_LABEL);
+          data_lines_description_box->labelfont(1);
+          data_lines_description_box->labelsize(10);
+        } // Fl_Box* data_lines_description_box
+        { data_lines_quantity_box = new Fl_Box(365, 170, 40, 410);
+          data_lines_quantity_box->box(FL_FLAT_BOX);
+          data_lines_quantity_box->color(FL_BACKGROUND2_COLOR);
+          data_lines_quantity_box->labeltype(FL_NO_LABEL);
+          data_lines_quantity_box->labelfont(1);
+          data_lines_quantity_box->labelsize(10);
+        } // Fl_Box* data_lines_quantity_box
+        { data_tlines_price_box = new Fl_Box(406, 170, 60, 410);
+          data_tlines_price_box->box(FL_FLAT_BOX);
+          data_tlines_price_box->color(FL_BACKGROUND2_COLOR);
+          data_tlines_price_box->labeltype(FL_NO_LABEL);
+          data_tlines_price_box->labelfont(1);
+          data_tlines_price_box->labelsize(10);
+        } // Fl_Box* data_tlines_price_box
+        { data_lines_discount_box = new Fl_Box(467, 170, 30, 410);
+          data_lines_discount_box->box(FL_FLAT_BOX);
+          data_lines_discount_box->color(FL_BACKGROUND2_COLOR);
+          data_lines_discount_box->labeltype(FL_NO_LABEL);
+          data_lines_discount_box->labelfont(1);
+          data_lines_discount_box->labelsize(10);
+        } // Fl_Box* data_lines_discount_box
+        { data_lines_sales_tax1_box = new Fl_Box(498, 170, 30, 410);
+          data_lines_sales_tax1_box->box(FL_FLAT_BOX);
+          data_lines_sales_tax1_box->color(FL_BACKGROUND2_COLOR);
+          data_lines_sales_tax1_box->labeltype(FL_NO_LABEL);
+          data_lines_sales_tax1_box->labelfont(1);
+          data_lines_sales_tax1_box->labelsize(10);
+        } // Fl_Box* data_lines_sales_tax1_box
+        { data_lines_sales_tax2_box = new Fl_Box(529, 170, 30, 410);
+          data_lines_sales_tax2_box->box(FL_FLAT_BOX);
+          data_lines_sales_tax2_box->color(FL_BACKGROUND2_COLOR);
+          data_lines_sales_tax2_box->labeltype(FL_NO_LABEL);
+          data_lines_sales_tax2_box->labelfont(1);
+          data_lines_sales_tax2_box->labelsize(10);
+        } // Fl_Box* data_lines_sales_tax2_box
+        { data_lines_subtotal_box = new Fl_Box(560, 170, 61, 410);
+          data_lines_subtotal_box->box(FL_FLAT_BOX);
+          data_lines_subtotal_box->color(FL_BACKGROUND2_COLOR);
+          data_lines_subtotal_box->labeltype(FL_NO_LABEL);
+          data_lines_subtotal_box->labelfont(1);
+          data_lines_subtotal_box->labelsize(10);
+        } // Fl_Box* data_lines_subtotal_box
+        designLinesGroup->end();
+        Fl_Group.current()->resizable(designLinesGroup);
+      } // Fl_Group* designLinesGroup
+      orderLines->end();
+      Fl_Group.current()->resizable(orderLines);
+    } // Fl_Group* orderLines
+    { orderTotals = new Fl_Group(16, 585, 606, 46);
+      orderTotals->box(FL_FLAT_BOX);
+      orderTotals->color(FL_DARK3);
+      orderTotals->labeltype(FL_NO_LABEL);
+      { header_PAGENO_box = new Fl_Box(17, 586, 65, 20, _tr("PAGE"));
+        header_PAGENO_box->box(FL_FLAT_BOX);
+        header_PAGENO_box->color(FL_DARK1);
+        header_PAGENO_box->labelfont(1);
+        header_PAGENO_box->labelsize(12);
+      } // Fl_Box* header_PAGENO_box
+      { box_data_pageno_box = new Fl_Box(17, 607, 65, 23);
+        box_data_pageno_box->box(FL_FLAT_BOX);
+        box_data_pageno_box->color(FL_BACKGROUND2_COLOR);
+        box_data_pageno_box->labeltype(FL_NO_LABEL);
+        box_data_pageno_box->labelfont(1);
+        box_data_pageno_box->labelsize(12);
+      } // Fl_Box* box_data_pageno_box
+      { header_totals_subtotal_box = new Fl_Box(83, 586, 150, 20, _tr("SUBTOTAL"));
+        header_totals_subtotal_box->box(FL_FLAT_BOX);
+        header_totals_subtotal_box->color(FL_DARK1);
+        header_totals_subtotal_box->labelfont(1);
+        header_totals_subtotal_box->labelsize(12);
+      } // Fl_Box* header_totals_subtotal_box
+      { data_totals_subtotal_box = new Fl_Box(83, 607, 150, 23);
+        data_totals_subtotal_box->box(FL_FLAT_BOX);
+        data_totals_subtotal_box->color(FL_BACKGROUND2_COLOR);
+        data_totals_subtotal_box->labeltype(FL_NO_LABEL);
+        data_totals_subtotal_box->labelfont(1);
+        data_totals_subtotal_box->labelsize(12);
+      } // Fl_Box* data_totals_subtotal_box
+      { header_totals_total_sales_tax1_box = new Fl_Box(234, 586, 120, 20, _tr("Sales Tax I"));
+        header_totals_total_sales_tax1_box->box(FL_FLAT_BOX);
+        header_totals_total_sales_tax1_box->color(FL_DARK1);
+        header_totals_total_sales_tax1_box->labelfont(1);
+        header_totals_total_sales_tax1_box->labelsize(12);
+      } // Fl_Box* header_totals_total_sales_tax1_box
+      { data_totals_total_sales_tax1_box = new Fl_Box(234, 607, 120, 23);
+        data_totals_total_sales_tax1_box->box(FL_FLAT_BOX);
+        data_totals_total_sales_tax1_box->color(FL_BACKGROUND2_COLOR);
+        data_totals_total_sales_tax1_box->labeltype(FL_NO_LABEL);
+        data_totals_total_sales_tax1_box->labelfont(1);
+        data_totals_total_sales_tax1_box->labelsize(12);
+      } // Fl_Box* data_totals_total_sales_tax1_box
+      { header_totals_total_sales_tax2_box = new Fl_Box(355, 586, 115, 20, _tr("Sales Tax II"));
+        header_totals_total_sales_tax2_box->box(FL_FLAT_BOX);
+        header_totals_total_sales_tax2_box->color(FL_DARK1);
+        header_totals_total_sales_tax2_box->labelfont(1);
+        header_totals_total_sales_tax2_box->labelsize(12);
+      } // Fl_Box* header_totals_total_sales_tax2_box
+      { data_totals_total_sales_tax2_box = new Fl_Box(355, 607, 115, 23);
+        data_totals_total_sales_tax2_box->box(FL_FLAT_BOX);
+        data_totals_total_sales_tax2_box->color(FL_BACKGROUND2_COLOR);
+        data_totals_total_sales_tax2_box->labeltype(FL_NO_LABEL);
+        data_totals_total_sales_tax2_box->labelfont(1);
+        data_totals_total_sales_tax2_box->labelsize(12);
+      } // Fl_Box* data_totals_total_sales_tax2_box
+      { header_totals_total_box = new Fl_Box(471, 586, 150, 20, _tr("TOTAL"));
+        header_totals_total_box->box(FL_FLAT_BOX);
+        header_totals_total_box->color(FL_DARK1);
+        header_totals_total_box->labelfont(1);
+        header_totals_total_box->labelsize(12);
+      } // Fl_Box* header_totals_total_box
+      { data_totals_total_box = new Fl_Box(471, 607, 150, 23);
+        data_totals_total_box->box(FL_FLAT_BOX);
+        data_totals_total_box->color(FL_BACKGROUND2_COLOR);
+        data_totals_total_box->labeltype(FL_NO_LABEL);
+        data_totals_total_box->labelfont(1);
+        data_totals_total_box->labelsize(12);
+      } // Fl_Box* data_totals_total_box
+      orderTotals->end();
+    } // Fl_Group* orderTotals
+    { notes_box = new Fl_Box_ClearLabel(17, 638, 606, 37, _tr(@"FLTK is provided under the terms of the GNU Library Public License, Version 2\
+ with exceptions that allow for static linking."));
+      notes_box->box(FL_NO_BOX);
+      notes_box->color(FL_BACKGROUND_COLOR);
+      notes_box->selection_color(FL_BACKGROUND_COLOR);
+      notes_box->labeltype(FL_NORMAL_LABEL);
+      notes_box->labelfont(2);
+      notes_box->labelsize(9);
+      notes_box->labelcolor(FL_FOREGROUND_COLOR);
+      notes_box->align((FL_ALIGN_WRAP|FL_ALIGN_INSIDE));
+      notes_box->when(FL_WHEN_RELEASE);
+    } // Fl_Box_ClearLabel* notes_box
+    pageDesignGroup->end();
+  } // Fl_Group* pageDesignGroup
+  { printDataGroup = new Fl_Group(3, 0, 628, 637);
+    printDataGroup->labeltype(FL_NO_LABEL);
+    { orderTypeBox = new Fl_Box(338, 10, 139, 20);
+      orderTypeBox->labelfont(1);
+      orderTypeBox->labelsize(12);
+    } // Fl_Box* orderTypeBox
+    { numberBox = new Fl_Box_ClearLabel(338, 33, 139, 16);
+      numberBox->box(FL_NO_BOX);
+      numberBox->color(FL_BACKGROUND_COLOR);
+      numberBox->selection_color(FL_BACKGROUND_COLOR);
+      numberBox->labeltype(FL_NORMAL_LABEL);
+      numberBox->labelfont(5);
+      numberBox->labelsize(15);
+      numberBox->labelcolor(FL_FOREGROUND_COLOR);
+      numberBox->align((FL_ALIGN_CENTER|FL_ALIGN_INSIDE));
+      numberBox->when(FL_WHEN_RELEASE);
+    } // Fl_Box_ClearLabel* numberBox
+    { dateBox = new Fl_Box_ClearLabel(484, 32, 133, 16);
+      dateBox->box(FL_NO_BOX);
+      dateBox->color(FL_BACKGROUND_COLOR);
+      dateBox->selection_color(FL_BACKGROUND_COLOR);
+      dateBox->labeltype(FL_NORMAL_LABEL);
+      dateBox->labelfont(5);
+      dateBox->labelsize(15);
+      dateBox->labelcolor(FL_FOREGROUND_COLOR);
+      dateBox->align((FL_ALIGN_CENTER|FL_ALIGN_INSIDE));
+      dateBox->when(FL_WHEN_RELEASE);
+    } // Fl_Box_ClearLabel* dateBox
+    { entityBox = new Fl_Box_ClearLabel(338, 57, 282, 82);
+      entityBox->box(FL_NO_BOX);
+      entityBox->color(FL_BACKGROUND_COLOR);
+      entityBox->selection_color(FL_BACKGROUND_COLOR);
+      entityBox->labeltype(FL_NORMAL_LABEL);
+      entityBox->labelfont(0);
+      entityBox->labelsize(12);
+      entityBox->labelcolor(FL_FOREGROUND_COLOR);
+      entityBox->align((69|FL_ALIGN_INSIDE));
+      entityBox->when(FL_WHEN_RELEASE);
+    } // Fl_Box_ClearLabel* entityBox
+    { dataLinesGroup = new Fl_Group(16, 169, 605, 412);
+      dataLinesGroup->labeltype(FL_NO_LABEL);
+      dataLinesGroup->align((FL_ALIGN_CENTER|FL_ALIGN_INSIDE));
+      { codeBox = new Fl_Box_ClearLabel(16, 174, 46, 404);
+        codeBox->box(FL_NO_BOX);
+        codeBox->color(FL_BACKGROUND_COLOR);
+        codeBox->selection_color(FL_BACKGROUND_COLOR);
+        codeBox->labeltype(FL_NORMAL_LABEL);
+        codeBox->labelfont(0);
+        codeBox->labelsize(11);
+        codeBox->labelcolor(FL_FOREGROUND_COLOR);
+        codeBox->align((FL_ALIGN_TOP_RIGHT|FL_ALIGN_INSIDE));
+        codeBox->when(FL_WHEN_RELEASE);
+      } // Fl_Box_ClearLabel* codeBox
+      { descriptionBox = new Fl_Box_ClearLabel(64, 174, 300, 404);
+        descriptionBox->box(FL_NO_BOX);
+        descriptionBox->color(FL_BACKGROUND_COLOR);
+        descriptionBox->selection_color(FL_BACKGROUND_COLOR);
+        descriptionBox->labeltype(FL_NORMAL_LABEL);
+        descriptionBox->labelfont(0);
+        descriptionBox->labelsize(11);
+        descriptionBox->labelcolor(FL_FOREGROUND_COLOR);
+        descriptionBox->align((69|FL_ALIGN_INSIDE));
+        descriptionBox->when(FL_WHEN_RELEASE);
+      } // Fl_Box_ClearLabel* descriptionBox
+      { quantityBox = new Fl_Box_ClearLabel(365, 174, 40, 404);
+        quantityBox->box(FL_NO_BOX);
+        quantityBox->color(FL_BACKGROUND_COLOR);
+        quantityBox->selection_color(FL_BACKGROUND_COLOR);
+        quantityBox->labeltype(FL_NORMAL_LABEL);
+        quantityBox->labelfont(0);
+        quantityBox->labelsize(11);
+        quantityBox->labelcolor(FL_FOREGROUND_COLOR);
+        quantityBox->align((FL_ALIGN_TOP_RIGHT|FL_ALIGN_INSIDE));
+        quantityBox->when(FL_WHEN_RELEASE);
+      } // Fl_Box_ClearLabel* quantityBox
+      { priceBox = new Fl_Box_ClearLabel(406, 174, 60, 404);
+        priceBox->box(FL_NO_BOX);
+        priceBox->color(FL_BACKGROUND_COLOR);
+        priceBox->selection_color(FL_BACKGROUND_COLOR);
+        priceBox->labeltype(FL_NORMAL_LABEL);
+        priceBox->labelfont(0);
+        priceBox->labelsize(11);
+        priceBox->labelcolor(FL_FOREGROUND_COLOR);
+        priceBox->align((FL_ALIGN_TOP_RIGHT|FL_ALIGN_INSIDE));
+        priceBox->when(FL_WHEN_RELEASE);
+      } // Fl_Box_ClearLabel* priceBox
+      { discountBox = new Fl_Box_ClearLabel(467, 174, 30, 404);
+        discountBox->box(FL_NO_BOX);
+        discountBox->color(FL_BACKGROUND_COLOR);
+        discountBox->selection_color(FL_BACKGROUND_COLOR);
+        discountBox->labeltype(FL_NORMAL_LABEL);
+        discountBox->labelfont(0);
+        discountBox->labelsize(11);
+        discountBox->labelcolor(FL_FOREGROUND_COLOR);
+        discountBox->align((FL_ALIGN_TOP_RIGHT|FL_ALIGN_INSIDE));
+        discountBox->when(FL_WHEN_RELEASE);
+      } // Fl_Box_ClearLabel* discountBox
+      { sales_tax1Box = new Fl_Box_ClearLabel(498, 174, 30, 404);
+        sales_tax1Box->box(FL_NO_BOX);
+        sales_tax1Box->color(FL_BACKGROUND_COLOR);
+        sales_tax1Box->selection_color(FL_BACKGROUND_COLOR);
+        sales_tax1Box->labeltype(FL_NORMAL_LABEL);
+        sales_tax1Box->labelfont(0);
+        sales_tax1Box->labelsize(11);
+        sales_tax1Box->labelcolor(FL_FOREGROUND_COLOR);
+        sales_tax1Box->align((FL_ALIGN_TOP_RIGHT|FL_ALIGN_INSIDE));
+        sales_tax1Box->when(FL_WHEN_RELEASE);
+      } // Fl_Box_ClearLabel* sales_tax1Box
+      { sales_tax2Box = new Fl_Box_ClearLabel(529, 174, 30, 404);
+        sales_tax2Box->box(FL_NO_BOX);
+        sales_tax2Box->color(FL_BACKGROUND_COLOR);
+        sales_tax2Box->selection_color(FL_BACKGROUND_COLOR);
+        sales_tax2Box->labeltype(FL_NORMAL_LABEL);
+        sales_tax2Box->labelfont(0);
+        sales_tax2Box->labelsize(11);
+        sales_tax2Box->labelcolor(FL_FOREGROUND_COLOR);
+        sales_tax2Box->align((FL_ALIGN_TOP_RIGHT|FL_ALIGN_INSIDE));
+        sales_tax2Box->when(FL_WHEN_RELEASE);
+      } // Fl_Box_ClearLabel* sales_tax2Box
+      { lineTotalBox = new Fl_Box_ClearLabel(560, 174, 61, 404);
+        lineTotalBox->box(FL_NO_BOX);
+        lineTotalBox->color(FL_BACKGROUND_COLOR);
+        lineTotalBox->selection_color(FL_BACKGROUND_COLOR);
+        lineTotalBox->labeltype(FL_NORMAL_LABEL);
+        lineTotalBox->labelfont(0);
+        lineTotalBox->labelsize(11);
+        lineTotalBox->labelcolor(FL_FOREGROUND_COLOR);
+        lineTotalBox->align((FL_ALIGN_TOP_RIGHT|FL_ALIGN_INSIDE));
+        lineTotalBox->when(FL_WHEN_RELEASE);
+      } // Fl_Box_ClearLabel* lineTotalBox
+      dataLinesGroup->end();
+      Fl_Group.current()->resizable(dataLinesGroup);
+    } // Fl_Group* dataLinesGroup
+    { bottomTotals = new Fl_Group(16, 585, 605, 48);
+      bottomTotals->labeltype(FL_NO_LABEL);
+      { orderPageBox = new Fl_Box_ClearLabel(16, 608, 65, 25);
+        orderPageBox->box(FL_NO_BOX);
+        orderPageBox->color(FL_BACKGROUND_COLOR);
+        orderPageBox->selection_color(FL_BACKGROUND_COLOR);
+        orderPageBox->labeltype(FL_NORMAL_LABEL);
+        orderPageBox->labelfont(5);
+        orderPageBox->labelsize(15);
+        orderPageBox->labelcolor(FL_FOREGROUND_COLOR);
+        orderPageBox->align((FL_ALIGN_CENTER));
+        orderPageBox->when(FL_WHEN_RELEASE);
+      } // Fl_Box_ClearLabel* orderPageBox
+      { fisrtTotalBox = new Fl_Box_ClearLabel(83, 608, 150, 25);
+        fisrtTotalBox->box(FL_NO_BOX);
+        fisrtTotalBox->color(FL_BACKGROUND_COLOR);
+        fisrtTotalBox->selection_color(FL_BACKGROUND_COLOR);
+        fisrtTotalBox->labeltype(FL_NORMAL_LABEL);
+        fisrtTotalBox->labelfont(5);
+        fisrtTotalBox->labelsize(15);
+        fisrtTotalBox->labelcolor(FL_FOREGROUND_COLOR);
+        fisrtTotalBox->align((FL_ALIGN_CENTER));
+        fisrtTotalBox->when(FL_WHEN_RELEASE);
+      } // Fl_Box_ClearLabel* fisrtTotalBox
+      { sales_tax1AmountBox = new Fl_Box_ClearLabel(234, 608, 120, 25);
+        sales_tax1AmountBox->box(FL_NO_BOX);
+        sales_tax1AmountBox->color(FL_BACKGROUND_COLOR);
+        sales_tax1AmountBox->selection_color(FL_BACKGROUND_COLOR);
+        sales_tax1AmountBox->labeltype(FL_NORMAL_LABEL);
+        sales_tax1AmountBox->labelfont(5);
+        sales_tax1AmountBox->labelsize(15);
+        sales_tax1AmountBox->labelcolor(FL_FOREGROUND_COLOR);
+        sales_tax1AmountBox->align((FL_ALIGN_CENTER));
+        sales_tax1AmountBox->when(FL_WHEN_RELEASE);
+      } // Fl_Box_ClearLabel* sales_tax1AmountBox
+      { sales_tax2AmountBox = new Fl_Box_ClearLabel(355, 608, 115, 25);
+        sales_tax2AmountBox->box(FL_NO_BOX);
+        sales_tax2AmountBox->color(FL_BACKGROUND_COLOR);
+        sales_tax2AmountBox->selection_color(FL_BACKGROUND_COLOR);
+        sales_tax2AmountBox->labeltype(FL_NORMAL_LABEL);
+        sales_tax2AmountBox->labelfont(5);
+        sales_tax2AmountBox->labelsize(15);
+        sales_tax2AmountBox->labelcolor(FL_FOREGROUND_COLOR);
+        sales_tax2AmountBox->align((FL_ALIGN_CENTER));
+        sales_tax2AmountBox->when(FL_WHEN_RELEASE);
+      } // Fl_Box_ClearLabel* sales_tax2AmountBox
+      { totalBox = new Fl_Box_ClearLabel(500, 608, 121, 25);
+        totalBox->box(FL_NO_BOX);
+        totalBox->color(FL_BACKGROUND_COLOR);
+        totalBox->selection_color(FL_BACKGROUND_COLOR);
+        totalBox->labeltype(FL_NORMAL_LABEL);
+        totalBox->labelfont(5);
+        totalBox->labelsize(15);
+        totalBox->labelcolor(FL_FOREGROUND_COLOR);
+        totalBox->align((FL_ALIGN_CENTER));
+        totalBox->when(FL_WHEN_RELEASE);
+      } // Fl_Box_ClearLabel* totalBox
+      bottomTotals->end();
+    } // Fl_Group* bottomTotals
+    printDataGroup->end();
+    Fl_Group.current()->resizable(printDataGroup);
+  } // Fl_Group* printDataGroup
+  page->end();
+} // Fl_Group* page
+end();
+resizable(this);
+}
+}
+//local win = new MainWindow(10, 50, 330, 320, "OURBIZ");
+local win = new BaseReportA4();
+win->resizable(win);
+win->show_main();
+
+math.number_format_set_dec_point(",");
+math.number_format_set_thousand_sep(".");
+Fl_Input.default_number_format("\0x02,.");
+//Fl:scheme("plastic");
+Fl.scheme("gtk+");
+//use partial match to find verdana font
+Fl.visual(FL_RGB);
+//allow arrow keys navigation
+Fl.option(Fl.OPTION_ARROW_FOCUS, true);
+
+Fl.run();

+ 1353 - 0
samples/test-fltk-5.nut

@@ -0,0 +1,1353 @@
+function _tr(str){ return str;}
+
+class Fl_Data_Table extends Flv_Table {
+	_forPrint = null;
+	
+	constructor(px, py, pw, ph, pl=""){
+		base.constructor(px, py, pw, ph, pl);
+		_forPrint=false;
+	}
+}
+
+class Fl_Box_ClearLabel extends Fl_Box {
+	constructor(px, py, pw, ph, pl=""){
+		base.constructor(px, py, pw, ph, pl);
+	}
+}
+
+class Flu_Combo_List extends Fl_Box {
+	constructor(px, py, pw, ph, pl=""){
+		base.constructor(px, py, pw, ph, pl);
+	}
+}
+
+class Fl_Choice_Int extends Fl_Button {
+	constructor(px, py, pw, ph, pl=""){
+		base.constructor(px, py, pw, ph, pl);
+	}
+}
+
+class Fl_Float_Input_Fmt extends Fl_Float_Input {
+	constructor(px, py, pw, ph, pl=""){
+		base.constructor(px, py, pw, ph, pl);
+	}
+}
+
+class My_Fl_Float_Input extends Fl_Float_Input {
+	constructor(px, py, pw, ph, pl=""){
+		base.constructor(px, py, pw, ph, pl);
+	}
+}
+
+
+class My_Fl_Return_Button extends Fl_Button {
+	constructor(px, py, pw, ph, pl=""){
+		base.constructor(px, py, pw, ph, pl);
+	}
+}
+
+class Fl_Choice_Str extends Fl_Button {
+	constructor(px, py, pw, ph, pl=""){
+		base.constructor(px, py, pw, ph, pl);
+	}
+}
+
+
+
+function add_input_field_to_map(tbl, fldname, fld){
+}
+	
+//class BaseReportA4 extends Fl_Group {
+class BaseReportA4 extends Fl_Window {
+	delivery_calc_window = 0;
+	entities_list_window = 0;
+	products_list_window = 0;
+	calendar_window = 0;
+	db_orders_mdate=null;
+	pack_line2=null;
+	db_orders_series=null;
+	db_orders_order_number=null;
+	db_orders_entity_id=null;
+	db_orders_entity_name=null;
+	btnSearchEntity=null;
+	db_orders_entity_order_number=null;
+	tabs=null;
+	tabMain=null;
+	pack_line3=null;
+	out_lines=null;
+	db_orders_weight_total=null;
+	btnCalcDelivery=null;
+	db_orders_payment_type_id=null;
+	btnSortLines=null;
+	db_orders_order_date=null;
+	btnShowCalendar=null;
+	group_totals=null;
+	db_orders_discount_amt=null;
+	db_orders_subtotal_amt=null;
+	db_orders_sales_tax1_amt=null;
+	db_orders_sales_tax2_amt=null;
+	db_orders_irpf_amt=null;
+	db_orders_total_amt=null;
+	db_orders_cash=null;
+	cash_return=null;
+	linesTab=null;
+	group_lines=null;
+	db_orders_lines_batch_order_line_quantity=null;
+	db_orders_lines_batch_order_line_id=null;
+	btnSearchBatchOrderLineId=null;
+	db_orders_lines_xref_order_line_quantity=null;
+	db_orders_lines_xref_order_line_id=null;
+	btnSearchXrefOrderLineId=null;
+	db_orders_lines_product_id=null;
+	db_orders_lines_description=null;
+	btnSearchProduct=null;
+	db_orders_lines_price_decimals=null;
+	db_orders_lines_first_total=null;
+	db_orders_lines_discount_amt=null;
+	db_orders_lines_line_subtotal=null;
+	db_orders_lines_sales_tax2_pct=null;
+	db_orders_lines_sales_tax1_pct=null;
+	db_orders_lines_sales_tax1_amt=null;
+	db_orders_lines_line_total=null;
+	tabLineNotes=null;
+	db_orders_lines_notes=null;
+	tabDues=null;
+	grid_dues=null;
+	due_id=null;
+	due_date=null;
+	btnShowCalendarDueDate=null;
+	due_pct=null;
+	due_amount=null;
+	tabPayments=null;
+	grid_payments=null;
+	payment_id=null;
+	payment_date=null;
+	btnShowCalendarPaymentDate=null;
+	payemnt_amount=null;
+	tabDelivery=null;
+	db_orders_entity_address=null;
+	db_orders_entity_zip=null;
+	db_orders_entity_city=null;
+	db_orders_entity_state=null;
+	db_orders_entity_country=null;
+	db_orders_entity_phone=null;
+	db_orders_entity_tax_number=null;
+	db_orders_order_valid_till_date=null;
+	btnShowCalendarValidTill=null;
+	db_orders_entity_use_sales_tax2=null;
+	db_orders_entity_sales_tax_exempt=null;
+	db_orders_notes=null;
+	db_orders_irpf_pct_retention=null;
+	tabOptions=null;
+	opt_ask_for_printer=null;
+	opt_print_only_data=null;
+	opt_print_to_pdf=null;
+	opt_print_page_format=null;
+	btnOptPrint=null;
+	opt_email_program=null;
+	opt_email_program_command=null;
+	btnOptSendEmail=null;
+	opt_print_order_company_info=null;
+	opt_print_order_bottom_info=null;
+	tabChartStatistics=null;
+	tabHistory=null;
+	tabPrintPreview=null;
+	tabTotals=null;
+	totals_balance=null;
+	db_totals_overview_sales_quoted=null;
+	db_totals_overview_sales_ordered=null;
+	db_totals_overview_sales_delivered=null;
+	db_totals_overview_sales_invoiced=null;
+	db_totals_overview_sales_discount=null;
+	db_totals_overview_sales_tax1=null;
+	db_totals_overview_sales_tax2=null;
+	db_totals_overview_sales_paid=null;
+	db_totals_overview_buys_quoted=null;
+	db_totals_overview_buys_ordered=null;
+	db_totals_overview_buys_received=null;
+	db_totals_overview_buys_invoiced=null;
+	db_totals_overview_buys_discount=null;
+	db_totals_overview_buys_tax1=null;
+	db_totals_overview_buys_tax2=null;
+	db_totals_overview_buys_paid=null;
+	db_orders_order_type_id=null;
+	grid_lines=null;
+	btnPrint=null;
+	db_orders_lines_quantity=null;
+	db_orders_lines_price=null;
+	db_orders_lines_weight=null;
+	db_orders_lines_discount_pct=null;
+	btnSaveLine=null;
+	btnDueSave=null;
+	btnPaymentSave=null;
+	btnNumberOrder=null;
+	dbAction=null;
+	btnDbAction=null;
+	btnRefreshTotals=null;
+	
+constructor() {
+	base.constructor(10, 50, 800, 560, _tr("Edit Order"));
+begin();
+this->box(FL_FLAT_BOX);
+this->color(FL_BACKGROUND_COLOR);
+this->selection_color(FL_BACKGROUND_COLOR);
+this->labeltype(FL_NO_LABEL);
+this->labelfont(0);
+this->labelsize(16);
+this->labelcolor(FL_FOREGROUND_COLOR);
+this->align((FL_ALIGN_TOP));
+this->when(FL_WHEN_RELEASE);
+delivery_calc_window = 0;
+entities_list_window = 0;
+products_list_window = 0;
+calendar_window = 0;
+{ local o = new Fl_Group(5, 1, 792, 62);
+  { db_orders_mdate = new Fl_Output(670, 5, 125, 25);
+    db_orders_mdate->labeltype(FL_NO_LABEL);
+    db_orders_mdate->labelsize(16);
+    db_orders_mdate->textsize(16);
+    add_input_field_to_map("orders", "mdate", db_orders_mdate);
+  } // Fl_Output* db_orders_mdate
+  { db_orders_order_type_id = new Flu_Combo_List(5, 5, 655, 25);
+    db_orders_order_type_id->tooltip(_tr("Selection of the order type"));
+    db_orders_order_type_id->box(FL_DOWN_BOX);
+    db_orders_order_type_id->color(FL_BACKGROUND_COLOR);
+    db_orders_order_type_id->selection_color(FL_BACKGROUND_COLOR);
+    db_orders_order_type_id->labeltype(FL_NO_LABEL);
+    db_orders_order_type_id->labelfont(1);
+    db_orders_order_type_id->labelsize(16);
+    db_orders_order_type_id->labelcolor(FL_FOREGROUND_COLOR);
+    db_orders_order_type_id->align((FL_ALIGN_CENTER));
+    db_orders_order_type_id->when(FL_WHEN_RELEASE);
+    add_input_field_to_map("orders", "order_type_id", db_orders_order_type_id);
+  } // Flu_Combo_List* db_orders_order_type_id
+  { local o = pack_line2 = new Fl_Pack(5, 35, 790, 25);
+    pack_line2->type(1);
+    pack_line2->labelsize(16);
+    { db_orders_series = new Fl_Input(55, 35, 45, 25, _tr("Series"));
+      db_orders_series->labelsize(16);
+      db_orders_series->textsize(16);
+      add_input_field_to_map("orders", "series", db_orders_series);
+    } // Fl_Input* db_orders_series
+    { local o = db_orders_order_number = new Fl_Int_Input(172, 35, 95, 25, _tr("Number"));
+      db_orders_order_number->type(2);
+      db_orders_order_number->labelsize(16);
+      db_orders_order_number->textsize(16);
+      add_input_field_to_map("orders", "order_number", db_orders_order_number);
+      o->use_numeric_format(0);
+    } // Fl_Int_Input* db_orders_order_number
+    { db_orders_entity_id = new Fl_Int_Input(319, 35, 95, 25, _tr("Entity"));
+      db_orders_entity_id->type(2);
+      db_orders_entity_id->labelsize(16);
+      db_orders_entity_id->textsize(16);
+      add_input_field_to_map("orders", "entity_id", db_orders_entity_id);
+    } // Fl_Int_Input* db_orders_entity_id
+    { db_orders_entity_name = new Fl_Input(420, 35, 335, 25);
+      db_orders_entity_name->tooltip(_tr("Type partal description to search on availlable entities"));
+      db_orders_entity_name->labeltype(FL_NO_LABEL);
+      db_orders_entity_name->labelsize(16);
+      db_orders_entity_name->textfont(1);
+      db_orders_entity_name->textsize(16);
+      Fl_Group.current()->resizable(db_orders_entity_name);
+      add_input_field_to_map("orders", "entity_name", db_orders_entity_name);
+    } // Fl_Input* db_orders_entity_name
+    { btnSearchEntity = new Fl_Button(765, 35, 30, 25, _tr("@<->"));
+      btnSearchEntity->tooltip(_tr("Show entities search window"));
+      btnSearchEntity->labelsize(18);
+      btnSearchEntity->labelcolor(22);
+    } // Fl_Button* btnSearchEntity
+    o->spacing(5);
+    o->with_label(1);
+    pack_line2->end();
+  } // Fl_Pack* pack_line2
+  o->end();
+} // Fl_Group* o
+{ db_orders_entity_order_number = new Fl_Input(585, 65, 210, 25, _tr("Their Nº"));
+  db_orders_entity_order_number->labelsize(16);
+  db_orders_entity_order_number->textsize(16);
+  add_input_field_to_map("orders", "entity_order_number", db_orders_entity_order_number);
+} // Fl_Input* db_orders_entity_order_number
+{ tabs = new Fl_Tabs(5, 68, 790, 487);
+  tabs->selection_color(4);
+  tabs->labelsize(16);
+  tabs->labelcolor(FL_BACKGROUND2_COLOR);
+  { tabMain = new Fl_Group(5, 95, 790, 460, _tr("Main"));
+    tabMain->color(246);
+    tabMain->labelfont(2);
+    tabMain->labelsize(16);
+    { local o = pack_line3 = new Fl_Pack(11, 105, 780, 25);
+      pack_line3->type(1);
+      pack_line3->labelsize(16);
+      { local o = out_lines = new Fl_Output(57, 105, 69, 25, _tr("Lines"));
+        out_lines->labelsize(16);
+        out_lines->textsize(16);
+        o->right_to_left(1);
+      } // Fl_Output* out_lines
+      { local o = db_orders_weight_total = new Fl_Output(189, 105, 110, 25, _tr("Weight"));
+        db_orders_weight_total->labelsize(16);
+        db_orders_weight_total->textsize(16);
+        o->right_to_left(1);
+        o->decimal_places(-2);
+        o->use_numeric_format(1);
+      } // Fl_Output* db_orders_weight_total
+      { btnCalcDelivery = new Fl_Button(309, 105, 30, 25, _tr("@<->"));
+        btnCalcDelivery->tooltip(_tr("Show delivery calc window"));
+        btnCalcDelivery->labelsize(18);
+        btnCalcDelivery->labelcolor(22);
+      } // Fl_Button* btnCalcDelivery
+      { db_orders_payment_type_id = new Fl_Choice_Int(345, 105, 235, 25);
+        db_orders_payment_type_id->box(FL_FLAT_BOX);
+        db_orders_payment_type_id->down_box(FL_BORDER_BOX);
+        db_orders_payment_type_id->color(FL_BACKGROUND_COLOR);
+        db_orders_payment_type_id->selection_color(FL_SELECTION_COLOR);
+        db_orders_payment_type_id->labeltype(FL_NO_LABEL);
+        db_orders_payment_type_id->labelfont(0);
+        db_orders_payment_type_id->labelsize(16);
+        db_orders_payment_type_id->labelcolor(FL_FOREGROUND_COLOR);
+        db_orders_payment_type_id->textfont(1);
+        db_orders_payment_type_id->textsize(16);
+        db_orders_payment_type_id->align((FL_ALIGN_LEFT));
+        db_orders_payment_type_id->when(FL_WHEN_RELEASE);
+        Fl_Group.current()->resizable(db_orders_payment_type_id);
+        add_input_field_to_map("orders", "payment_type_id", db_orders_payment_type_id);
+      } // Fl_Choice_Int* db_orders_payment_type_id
+      { btnSortLines = new Fl_Button(590, 105, 30, 25, _tr("@2"));
+        btnSortLines->tooltip(_tr("Sort lines by description"));
+        btnSortLines->labelsize(18);
+        btnSortLines->labelcolor(22);
+      } // Fl_Button* btnSortLines
+      { db_orders_order_date = new Fl_Input(629, 105, 120, 25);
+        db_orders_order_date->labeltype(FL_NO_LABEL);
+        db_orders_order_date->labelsize(16);
+        db_orders_order_date->textfont(1);
+        db_orders_order_date->textsize(16);
+        add_input_field_to_map("orders", "order_date", db_orders_order_date);
+      } // Fl_Input* db_orders_order_date
+      { btnShowCalendar = new Fl_Button(760, 105, 30, 25, _tr("@<->"));
+        btnShowCalendar->tooltip(_tr("Show calendar"));
+        btnShowCalendar->labelsize(18);
+        btnShowCalendar->labelcolor(22);
+      } // Fl_Button* btnShowCalendar
+      o->spacing(5);
+      o->with_label(1);
+      pack_line3->end();
+    } // Fl_Pack* pack_line3
+    { grid_lines = new Fl_Data_Table(10, 135, 780, 150);
+      grid_lines->resize(10, 135, 780, 150);
+      grid_lines->box(FL_NO_BOX);
+      grid_lines->color(FL_BACKGROUND2_COLOR);
+      grid_lines->selection_color(FL_SELECTION_COLOR);
+      grid_lines->labeltype(FL_NORMAL_LABEL);
+      grid_lines->labelfont(0);
+      grid_lines->labelsize(16);
+      grid_lines->labelcolor(FL_FOREGROUND_COLOR);
+      grid_lines->textsize(16);
+      grid_lines->align((FL_ALIGN_BOTTOM));
+      grid_lines->when(FL_WHEN_RELEASE_ALWAYS);
+      Fl_Group.current()->resizable(grid_lines);
+    } // Fl_Data_Table* grid_lines
+    { local o = new Fl_Group(10, 290, 781, 260);
+      { group_totals = new Fl_Group(600, 291, 190, 259);
+        group_totals->box(FL_UP_BOX);
+        group_totals->color(174);
+        { local o = db_orders_discount_amt = new Fl_Output(685, 297, 100, 25, _tr("Discount"));
+          db_orders_discount_amt->labelsize(16);
+          db_orders_discount_amt->textsize(16);
+          o->right_to_left(1);
+          o->use_numeric_format(1);
+          add_input_field_to_map("orders", "discount_amt", db_orders_discount_amt);
+        } // Fl_Output* db_orders_discount_amt
+        { local o = db_orders_subtotal_amt = new Fl_Output(684, 326, 100, 25, _tr("Subtotal"));
+          db_orders_subtotal_amt->labelsize(16);
+          db_orders_subtotal_amt->textsize(16);
+          o->right_to_left(1);
+          o->use_numeric_format(1);
+          add_input_field_to_map("orders", "subtotal_amt", db_orders_subtotal_amt);
+        } // Fl_Output* db_orders_subtotal_amt
+        { local o = db_orders_sales_tax1_amt = new Fl_Output(685, 356, 100, 25, _tr("V.A.T."));
+          db_orders_sales_tax1_amt->labelsize(16);
+          db_orders_sales_tax1_amt->textsize(16);
+          o->right_to_left(1);
+          o->use_numeric_format(1);
+          add_input_field_to_map("orders", "sales_tax1_amt", db_orders_sales_tax1_amt);
+        } // Fl_Output* db_orders_sales_tax1_amt
+        { local o = db_orders_sales_tax2_amt = new Fl_Output(684, 386, 100, 25, _tr("R.E."));
+          db_orders_sales_tax2_amt->labelsize(16);
+          db_orders_sales_tax2_amt->textsize(16);
+          o->right_to_left(1);
+          o->use_numeric_format(1);
+          add_input_field_to_map("orders", "sales_tax2_amt", db_orders_sales_tax2_amt);
+        } // Fl_Output* db_orders_sales_tax2_amt
+        { local o = db_orders_irpf_amt = new Fl_Output(685, 416, 100, 25, _tr("I.R.P.F."));
+          db_orders_irpf_amt->labelsize(16);
+          db_orders_irpf_amt->textsize(16);
+          o->right_to_left(1);
+          o->use_numeric_format(1);
+          add_input_field_to_map("orders", "irpf_amt", db_orders_irpf_amt);
+        } // Fl_Output* db_orders_irpf_amt
+        { local o = db_orders_total_amt = new Fl_Output(610, 453, 174, 33, _tr("Total"));
+          db_orders_total_amt->color(119);
+          db_orders_total_amt->labelfont(1);
+          db_orders_total_amt->textfont(1);
+          db_orders_total_amt->textsize(30);
+          db_orders_total_amt->align((FL_ALIGN_TOP_LEFT));
+          o->right_to_left(1);
+          o->use_numeric_format(1);
+          add_input_field_to_map("orders", "total_amt", db_orders_total_amt);
+        } // Fl_Output* db_orders_total_amt
+        { db_orders_cash = new Fl_Float_Input_Fmt(685, 490, 100, 25, _tr("Cash"));
+          db_orders_cash->type(1);
+          db_orders_cash->box(FL_DOWN_BOX);
+          db_orders_cash->color(FL_BACKGROUND2_COLOR);
+          db_orders_cash->selection_color(FL_SELECTION_COLOR);
+          db_orders_cash->labeltype(FL_NORMAL_LABEL);
+          db_orders_cash->labelfont(1);
+          db_orders_cash->labelsize(16);
+          db_orders_cash->labelcolor(FL_FOREGROUND_COLOR);
+          db_orders_cash->textfont(1);
+          db_orders_cash->textsize(16);
+          db_orders_cash->align((FL_ALIGN_LEFT));
+          db_orders_cash->when(FL_WHEN_RELEASE);
+          add_input_field_to_map("orders", "cash", db_orders_cash);
+        } // Fl_Float_Input_Fmt* db_orders_cash
+        { local o = cash_return = new Fl_Output(685, 520, 100, 25, _tr("Return"));
+          cash_return->labelfont(1);
+          cash_return->labelsize(16);
+          cash_return->textfont(1);
+          cash_return->textsize(16);
+          o->right_to_left(1);
+          o->use_numeric_format(1);
+        } // Fl_Output* cash_return
+        group_totals->end();
+      } // Fl_Group* group_totals
+      { btnPrint = new My_Fl_Return_Button(485, 525, 100, 25, _tr("Print"));
+        btnPrint->box(FL_UP_BOX);
+        btnPrint->color(FL_BACKGROUND_COLOR);
+        btnPrint->selection_color(FL_BACKGROUND_COLOR);
+        btnPrint->labeltype(FL_NORMAL_LABEL);
+        btnPrint->labelfont(0);
+        btnPrint->labelsize(16);
+        btnPrint->labelcolor(FL_FOREGROUND_COLOR);
+        btnPrint->align((FL_ALIGN_CENTER));
+        btnPrint->when(FL_WHEN_RELEASE);
+      } // My_Fl_Return_Button* btnPrint
+      { linesTab = new Fl_Tabs(10, 290, 585, 230);
+        linesTab->selection_color(4);
+        linesTab->labelfont(2);
+        linesTab->labelsize(16);
+        linesTab->labelcolor(FL_BACKGROUND2_COLOR);
+        { group_lines = new Fl_Group(10, 321, 585, 199, _tr("Line Edit"));
+          group_lines->box(FL_UP_BOX);
+          group_lines->color(166);
+          group_lines->labelfont(2);
+          group_lines->labelsize(16);
+          { local o = db_orders_lines_batch_order_line_quantity = new Fl_Output(265, 330, 110, 25, _tr("Batch Qty."));
+            db_orders_lines_batch_order_line_quantity->labelsize(16);
+            db_orders_lines_batch_order_line_quantity->textsize(16);
+            o->right_to_left(1);
+            add_input_field_to_map("orders_lines", "batch_order_line_quantity", db_orders_lines_batch_order_line_quantity);
+          } // Fl_Output* db_orders_lines_batch_order_line_quantity
+          { db_orders_lines_batch_order_line_id = new Fl_Int_Input(435, 329, 110, 25, _tr("Batch #"));
+            db_orders_lines_batch_order_line_id->type(2);
+            db_orders_lines_batch_order_line_id->labelsize(16);
+            db_orders_lines_batch_order_line_id->textsize(16);
+            add_input_field_to_map("orders_lines", "batch_order_line_id", db_orders_lines_batch_order_line_id);
+          } // Fl_Int_Input* db_orders_lines_batch_order_line_id
+          { btnSearchBatchOrderLineId = new Fl_Button(555, 329, 30, 25, _tr("@<->"));
+            btnSearchBatchOrderLineId->tooltip(_tr("Show products search window"));
+            btnSearchBatchOrderLineId->labelsize(18);
+            btnSearchBatchOrderLineId->labelcolor(22);
+          } // Fl_Button* btnSearchBatchOrderLineId
+          { local o = db_orders_lines_xref_order_line_quantity = new Fl_Output(265, 360, 110, 25, _tr("XRef. Qty."));
+            db_orders_lines_xref_order_line_quantity->labelsize(16);
+            db_orders_lines_xref_order_line_quantity->textsize(16);
+            o->right_to_left(1);
+            add_input_field_to_map("orders_lines", "xref_order_line_quantity", db_orders_lines_xref_order_line_quantity);
+          } // Fl_Output* db_orders_lines_xref_order_line_quantity
+          { db_orders_lines_xref_order_line_id = new Fl_Int_Input(435, 359, 110, 25, _tr("XRef #"));
+            db_orders_lines_xref_order_line_id->type(2);
+            db_orders_lines_xref_order_line_id->labelsize(16);
+            db_orders_lines_xref_order_line_id->textsize(16);
+            add_input_field_to_map("orders_lines", "xref_order_line_id", db_orders_lines_xref_order_line_id);
+          } // Fl_Int_Input* db_orders_lines_xref_order_line_id
+          { btnSearchXrefOrderLineId = new Fl_Button(555, 359, 30, 25, _tr("@<->"));
+            btnSearchXrefOrderLineId->tooltip(_tr("Show products search window"));
+            btnSearchXrefOrderLineId->labelsize(18);
+            btnSearchXrefOrderLineId->labelcolor(22);
+          } // Fl_Button* btnSearchXrefOrderLineId
+          { db_orders_lines_product_id = new Fl_Int_Input(21, 387, 70, 25, _tr("Code"));
+            db_orders_lines_product_id->type(2);
+            db_orders_lines_product_id->labelsize(16);
+            db_orders_lines_product_id->textsize(16);
+            db_orders_lines_product_id->align((FL_ALIGN_TOP_LEFT));
+            add_input_field_to_map("orders_lines", "product_id", db_orders_lines_product_id);
+          } // Fl_Int_Input* db_orders_lines_product_id
+          { db_orders_lines_description = new Fl_Input(101, 387, 444, 25, _tr("Description"));
+            db_orders_lines_description->tooltip(_tr("Type partal description to search on availlable products"));
+            db_orders_lines_description->labelsize(16);
+            db_orders_lines_description->textfont(1);
+            db_orders_lines_description->textsize(16);
+            db_orders_lines_description->align((FL_ALIGN_TOP_LEFT));
+            add_input_field_to_map("orders_lines", "description", db_orders_lines_description);
+          } // Fl_Input* db_orders_lines_description
+          { btnSearchProduct = new Fl_Button(555, 387, 30, 25, _tr("@<->"));
+            btnSearchProduct->tooltip(_tr("Show products search window"));
+            btnSearchProduct->labelsize(18);
+            btnSearchProduct->labelcolor(22);
+          } // Fl_Button* btnSearchProduct
+          { local o = db_orders_lines_quantity = new My_Fl_Float_Input(21, 435, 84, 25, _tr("Quantity"));
+            db_orders_lines_quantity->type(1);
+            db_orders_lines_quantity->box(FL_DOWN_BOX);
+            db_orders_lines_quantity->color(FL_BACKGROUND2_COLOR);
+            db_orders_lines_quantity->selection_color(FL_SELECTION_COLOR);
+            db_orders_lines_quantity->labeltype(FL_NORMAL_LABEL);
+            db_orders_lines_quantity->labelfont(1);
+            db_orders_lines_quantity->labelsize(16);
+            db_orders_lines_quantity->labelcolor(FL_FOREGROUND_COLOR);
+            db_orders_lines_quantity->textfont(1);
+            db_orders_lines_quantity->textsize(16);
+            db_orders_lines_quantity->align((FL_ALIGN_TOP_LEFT));
+            db_orders_lines_quantity->when(FL_WHEN_RELEASE);
+            o->decimal_places(-6);
+            add_input_field_to_map("orders_lines", "quantity", db_orders_lines_quantity);
+          } // My_Fl_Float_Input* db_orders_lines_quantity
+          { db_orders_lines_price = new My_Fl_Float_Input(115, 435, 108, 25, _tr("Price"));
+            db_orders_lines_price->type(1);
+            db_orders_lines_price->box(FL_DOWN_BOX);
+            db_orders_lines_price->color(FL_BACKGROUND2_COLOR);
+            db_orders_lines_price->selection_color(FL_SELECTION_COLOR);
+            db_orders_lines_price->labeltype(FL_NORMAL_LABEL);
+            db_orders_lines_price->labelfont(1);
+            db_orders_lines_price->labelsize(16);
+            db_orders_lines_price->labelcolor(FL_FOREGROUND_COLOR);
+            db_orders_lines_price->textfont(1);
+            db_orders_lines_price->textsize(16);
+            db_orders_lines_price->align((FL_ALIGN_TOP_LEFT));
+            db_orders_lines_price->when(FL_WHEN_RELEASE);
+            add_input_field_to_map("orders_lines", "price", db_orders_lines_price);
+          } // My_Fl_Float_Input* db_orders_lines_price
+          { db_orders_lines_price_decimals = new Fl_Int_Input(230, 435, 20, 25, _tr("(.)"));
+            db_orders_lines_price_decimals->tooltip(_tr("Number of decimals to use on calculations"));
+            db_orders_lines_price_decimals->type(2);
+            db_orders_lines_price_decimals->labelsize(16);
+            db_orders_lines_price_decimals->textsize(16);
+            db_orders_lines_price_decimals->align((FL_ALIGN_TOP));
+            add_input_field_to_map("orders_lines", "price_decimals", db_orders_lines_price_decimals);
+          } // Fl_Int_Input* db_orders_lines_price_decimals
+          { local o = db_orders_lines_weight = new My_Fl_Float_Input(255, 435, 70, 25, _tr("Weight"));
+            db_orders_lines_weight->type(1);
+            db_orders_lines_weight->box(FL_DOWN_BOX);
+            db_orders_lines_weight->color(FL_BACKGROUND2_COLOR);
+            db_orders_lines_weight->selection_color(FL_SELECTION_COLOR);
+            db_orders_lines_weight->labeltype(FL_NORMAL_LABEL);
+            db_orders_lines_weight->labelfont(0);
+            db_orders_lines_weight->labelsize(16);
+            db_orders_lines_weight->labelcolor(FL_FOREGROUND_COLOR);
+            db_orders_lines_weight->textsize(16);
+            db_orders_lines_weight->align((FL_ALIGN_TOP_LEFT));
+            db_orders_lines_weight->when(FL_WHEN_RELEASE);
+            o->decimal_places(-6);
+            add_input_field_to_map("orders_lines", "weight", db_orders_lines_weight);
+          } // My_Fl_Float_Input* db_orders_lines_weight
+          { db_orders_lines_first_total = new Fl_Float_Input_Fmt(330, 435, 100, 25, _tr("1st total"));
+            db_orders_lines_first_total->type(1);
+            db_orders_lines_first_total->box(FL_DOWN_BOX);
+            db_orders_lines_first_total->color(FL_BACKGROUND2_COLOR);
+            db_orders_lines_first_total->selection_color(FL_SELECTION_COLOR);
+            db_orders_lines_first_total->labeltype(FL_NORMAL_LABEL);
+            db_orders_lines_first_total->labelfont(0);
+            db_orders_lines_first_total->labelsize(16);
+            db_orders_lines_first_total->labelcolor(FL_FOREGROUND_COLOR);
+            db_orders_lines_first_total->textsize(16);
+            db_orders_lines_first_total->align((FL_ALIGN_TOP_LEFT));
+            db_orders_lines_first_total->when(FL_WHEN_RELEASE);
+            add_input_field_to_map("orders_lines", "first_total", db_orders_lines_first_total);
+          } // Fl_Float_Input_Fmt* db_orders_lines_first_total
+          { db_orders_lines_discount_pct = new My_Fl_Float_Input(435, 435, 60, 25, _tr("Disc. %"));
+            db_orders_lines_discount_pct->type(1);
+            db_orders_lines_discount_pct->box(FL_DOWN_BOX);
+            db_orders_lines_discount_pct->color(FL_BACKGROUND2_COLOR);
+            db_orders_lines_discount_pct->selection_color(FL_SELECTION_COLOR);
+            db_orders_lines_discount_pct->labeltype(FL_NORMAL_LABEL);
+            db_orders_lines_discount_pct->labelfont(0);
+            db_orders_lines_discount_pct->labelsize(16);
+            db_orders_lines_discount_pct->labelcolor(FL_FOREGROUND_COLOR);
+            db_orders_lines_discount_pct->textsize(16);
+            db_orders_lines_discount_pct->align((FL_ALIGN_TOP_LEFT));
+            db_orders_lines_discount_pct->when(FL_WHEN_RELEASE);
+            add_input_field_to_map("orders_lines", "discount_pct", db_orders_lines_discount_pct);
+          } // My_Fl_Float_Input* db_orders_lines_discount_pct
+          { db_orders_lines_discount_amt = new Fl_Float_Input_Fmt(505, 435, 80, 25, _tr("Disc. $"));
+            db_orders_lines_discount_amt->type(1);
+            db_orders_lines_discount_amt->box(FL_DOWN_BOX);
+            db_orders_lines_discount_amt->color(FL_BACKGROUND2_COLOR);
+            db_orders_lines_discount_amt->selection_color(FL_SELECTION_COLOR);
+            db_orders_lines_discount_amt->labeltype(FL_NORMAL_LABEL);
+            db_orders_lines_discount_amt->labelfont(0);
+            db_orders_lines_discount_amt->labelsize(16);
+            db_orders_lines_discount_amt->labelcolor(FL_FOREGROUND_COLOR);
+            db_orders_lines_discount_amt->textsize(16);
+            db_orders_lines_discount_amt->align((FL_ALIGN_TOP_LEFT));
+            db_orders_lines_discount_amt->when(FL_WHEN_RELEASE);
+            add_input_field_to_map("orders_lines", "discount_amt", db_orders_lines_discount_amt);
+          } // Fl_Float_Input_Fmt* db_orders_lines_discount_amt
+          { db_orders_lines_line_subtotal = new Fl_Float_Input_Fmt(21, 485, 108, 25, _tr("Subtotal"));
+            db_orders_lines_line_subtotal->type(1);
+            db_orders_lines_line_subtotal->box(FL_DOWN_BOX);
+            db_orders_lines_line_subtotal->color(FL_BACKGROUND2_COLOR);
+            db_orders_lines_line_subtotal->selection_color(FL_SELECTION_COLOR);
+            db_orders_lines_line_subtotal->labeltype(FL_NORMAL_LABEL);
+            db_orders_lines_line_subtotal->labelfont(0);
+            db_orders_lines_line_subtotal->labelsize(16);
+            db_orders_lines_line_subtotal->labelcolor(FL_FOREGROUND_COLOR);
+            db_orders_lines_line_subtotal->textsize(16);
+            db_orders_lines_line_subtotal->align((FL_ALIGN_TOP_LEFT));
+            db_orders_lines_line_subtotal->when(FL_WHEN_RELEASE);
+            add_input_field_to_map("orders_lines", "line_subtotal", db_orders_lines_line_subtotal);
+          } // Fl_Float_Input_Fmt* db_orders_lines_line_subtotal
+          { db_orders_lines_sales_tax2_pct = new Fl_Float_Input_Fmt(139, 485, 64, 25, _tr("R.E. %"));
+            db_orders_lines_sales_tax2_pct->type(1);
+            db_orders_lines_sales_tax2_pct->box(FL_DOWN_BOX);
+            db_orders_lines_sales_tax2_pct->color(FL_BACKGROUND2_COLOR);
+            db_orders_lines_sales_tax2_pct->selection_color(FL_SELECTION_COLOR);
+            db_orders_lines_sales_tax2_pct->labeltype(FL_NORMAL_LABEL);
+            db_orders_lines_sales_tax2_pct->labelfont(0);
+            db_orders_lines_sales_tax2_pct->labelsize(16);
+            db_orders_lines_sales_tax2_pct->labelcolor(FL_FOREGROUND_COLOR);
+            db_orders_lines_sales_tax2_pct->textsize(16);
+            db_orders_lines_sales_tax2_pct->align((FL_ALIGN_TOP_LEFT));
+            db_orders_lines_sales_tax2_pct->when(FL_WHEN_RELEASE);
+            add_input_field_to_map("orders_lines", "sales_tax2_pct", db_orders_lines_sales_tax2_pct);
+          } // Fl_Float_Input_Fmt* db_orders_lines_sales_tax2_pct
+          { db_orders_lines_sales_tax1_pct = new Fl_Float_Input_Fmt(213, 485, 64, 25, _tr("V.A.T. %"));
+            db_orders_lines_sales_tax1_pct->type(1);
+            db_orders_lines_sales_tax1_pct->box(FL_DOWN_BOX);
+            db_orders_lines_sales_tax1_pct->color(FL_BACKGROUND2_COLOR);
+            db_orders_lines_sales_tax1_pct->selection_color(FL_SELECTION_COLOR);
+            db_orders_lines_sales_tax1_pct->labeltype(FL_NORMAL_LABEL);
+            db_orders_lines_sales_tax1_pct->labelfont(0);
+            db_orders_lines_sales_tax1_pct->labelsize(16);
+            db_orders_lines_sales_tax1_pct->labelcolor(FL_FOREGROUND_COLOR);
+            db_orders_lines_sales_tax1_pct->textsize(16);
+            db_orders_lines_sales_tax1_pct->align((FL_ALIGN_TOP_LEFT));
+            db_orders_lines_sales_tax1_pct->when(FL_WHEN_RELEASE);
+            add_input_field_to_map("orders_lines", "sales_tax1_pct", db_orders_lines_sales_tax1_pct);
+          } // Fl_Float_Input_Fmt* db_orders_lines_sales_tax1_pct
+          { db_orders_lines_sales_tax1_amt = new Fl_Float_Input_Fmt(287, 485, 87, 25, _tr("V.A.T. $"));
+            db_orders_lines_sales_tax1_amt->type(1);
+            db_orders_lines_sales_tax1_amt->box(FL_DOWN_BOX);
+            db_orders_lines_sales_tax1_amt->color(FL_BACKGROUND2_COLOR);
+            db_orders_lines_sales_tax1_amt->selection_color(FL_SELECTION_COLOR);
+            db_orders_lines_sales_tax1_amt->labeltype(FL_NORMAL_LABEL);
+            db_orders_lines_sales_tax1_amt->labelfont(0);
+            db_orders_lines_sales_tax1_amt->labelsize(16);
+            db_orders_lines_sales_tax1_amt->labelcolor(FL_FOREGROUND_COLOR);
+            db_orders_lines_sales_tax1_amt->textsize(16);
+            db_orders_lines_sales_tax1_amt->align((FL_ALIGN_TOP_LEFT));
+            db_orders_lines_sales_tax1_amt->when(FL_WHEN_RELEASE);
+            add_input_field_to_map("orders_lines", "sales_tax1_amt", db_orders_lines_sales_tax1_amt);
+          } // Fl_Float_Input_Fmt* db_orders_lines_sales_tax1_amt
+          { btnSaveLine = new My_Fl_Return_Button(384, 485, 83, 25, _tr("Save"));
+            btnSaveLine->tooltip(_tr("Save the line currently edited"));
+            btnSaveLine->box(FL_UP_BOX);
+            btnSaveLine->color(FL_BACKGROUND_COLOR);
+            btnSaveLine->selection_color(FL_BACKGROUND_COLOR);
+            btnSaveLine->labeltype(FL_NORMAL_LABEL);
+            btnSaveLine->labelfont(1);
+            btnSaveLine->labelsize(16);
+            btnSaveLine->labelcolor(FL_FOREGROUND_COLOR);
+            btnSaveLine->align((FL_ALIGN_CENTER));
+            btnSaveLine->when(FL_WHEN_RELEASE);
+          } // My_Fl_Return_Button* btnSaveLine
+          { db_orders_lines_line_total = new Fl_Float_Input_Fmt(477, 485, 108, 25, _tr("Total"));
+            db_orders_lines_line_total->type(1);
+            db_orders_lines_line_total->box(FL_DOWN_BOX);
+            db_orders_lines_line_total->color(FL_BACKGROUND2_COLOR);
+            db_orders_lines_line_total->selection_color(FL_SELECTION_COLOR);
+            db_orders_lines_line_total->labeltype(FL_NORMAL_LABEL);
+            db_orders_lines_line_total->labelfont(1);
+            db_orders_lines_line_total->labelsize(16);
+            db_orders_lines_line_total->labelcolor(FL_FOREGROUND_COLOR);
+            db_orders_lines_line_total->textfont(1);
+            db_orders_lines_line_total->textsize(16);
+            db_orders_lines_line_total->align((FL_ALIGN_TOP_LEFT));
+            db_orders_lines_line_total->when(FL_WHEN_RELEASE);
+            add_input_field_to_map("orders_lines", "line_total", db_orders_lines_line_total);
+          } // Fl_Float_Input_Fmt* db_orders_lines_line_total
+          group_lines->end();
+        } // Fl_Group* group_lines
+        { tabLineNotes = new Fl_Group(10, 320, 585, 200, _tr("Line Notes"));
+          tabLineNotes->labelfont(2);
+          tabLineNotes->labelsize(16);
+          tabLineNotes->hide();
+          { db_orders_lines_notes = new Fl_Input(80, 330, 505, 180, _tr("Notes"));
+            db_orders_lines_notes->tooltip(_tr("Type partal description to search on availlable products"));
+            db_orders_lines_notes->type(4);
+            db_orders_lines_notes->labelsize(16);
+            db_orders_lines_notes->textsize(16);
+            add_input_field_to_map("orders_lines", "notes", db_orders_lines_notes);
+          } // Fl_Input* db_orders_lines_notes
+          tabLineNotes->end();
+        } // Fl_Group* tabLineNotes
+        { tabDues = new Fl_Group(10, 320, 585, 200, _tr("Dues"));
+          tabDues->labelfont(2);
+          tabDues->labelsize(16);
+          tabDues->hide();
+          { grid_dues = new Fl_Data_Table(15, 330, 575, 130);
+            grid_dues->box(FL_NO_BOX);
+            grid_dues->color(FL_BACKGROUND2_COLOR);
+            grid_dues->selection_color(FL_SELECTION_COLOR);
+            grid_dues->labeltype(FL_NORMAL_LABEL);
+            grid_dues->labelfont(0);
+            grid_dues->labelsize(16);
+            grid_dues->labelcolor(FL_FOREGROUND_COLOR);
+            grid_dues->textsize(16);
+            grid_dues->align((FL_ALIGN_BOTTOM));
+            grid_dues->when(FL_WHEN_RELEASE_ALWAYS);
+          } // Fl_Data_Table* grid_dues
+          { local o = due_id = new Fl_Output(15, 485, 80, 25, _tr("ID"));
+            due_id->labelsize(16);
+            due_id->textsize(16);
+            due_id->align((FL_ALIGN_TOP_LEFT));
+            o->right_to_left(1);
+          } // Fl_Output* due_id
+          { due_date = new Fl_Input(100, 485, 125, 25, _tr("Due"));
+            due_date->labelsize(16);
+            due_date->textfont(1);
+            due_date->textsize(16);
+            due_date->align((FL_ALIGN_TOP_LEFT));
+          } // Fl_Input* due_date
+          { btnShowCalendarDueDate = new Fl_Button(230, 485, 30, 25, _tr("@<->"));
+            btnShowCalendarDueDate->tooltip(_tr("Show calendar"));
+            btnShowCalendarDueDate->labelsize(18);
+            btnShowCalendarDueDate->labelcolor(22);
+          } // Fl_Button* btnShowCalendarDueDate
+          { due_pct = new Fl_Float_Input_Fmt(270, 485, 80, 25, _tr("Pct. %"));
+            due_pct->type(1);
+            due_pct->box(FL_DOWN_BOX);
+            due_pct->color(FL_BACKGROUND2_COLOR);
+            due_pct->selection_color(FL_SELECTION_COLOR);
+            due_pct->labeltype(FL_NORMAL_LABEL);
+            due_pct->labelfont(1);
+            due_pct->labelsize(16);
+            due_pct->labelcolor(FL_FOREGROUND_COLOR);
+            due_pct->textfont(1);
+            due_pct->textsize(16);
+            due_pct->align((FL_ALIGN_TOP_LEFT));
+            due_pct->when(FL_WHEN_RELEASE);
+          } // Fl_Float_Input_Fmt* due_pct
+          { due_amount = new Fl_Float_Input_Fmt(355, 485, 120, 25, _tr("Amount"));
+            due_amount->type(1);
+            due_amount->box(FL_DOWN_BOX);
+            due_amount->color(FL_BACKGROUND2_COLOR);
+            due_amount->selection_color(FL_SELECTION_COLOR);
+            due_amount->labeltype(FL_NORMAL_LABEL);
+            due_amount->labelfont(1);
+            due_amount->labelsize(16);
+            due_amount->labelcolor(FL_FOREGROUND_COLOR);
+            due_amount->textfont(1);
+            due_amount->textsize(16);
+            due_amount->align((FL_ALIGN_TOP_LEFT));
+            due_amount->when(FL_WHEN_RELEASE);
+          } // Fl_Float_Input_Fmt* due_amount
+          { btnDueSave = new My_Fl_Return_Button(485, 485, 100, 25, _tr("Save"));
+            btnDueSave->box(FL_UP_BOX);
+            btnDueSave->color(FL_BACKGROUND_COLOR);
+            btnDueSave->selection_color(FL_BACKGROUND_COLOR);
+            btnDueSave->labeltype(FL_NORMAL_LABEL);
+            btnDueSave->labelfont(0);
+            btnDueSave->labelsize(16);
+            btnDueSave->labelcolor(FL_FOREGROUND_COLOR);
+            btnDueSave->align((FL_ALIGN_CENTER));
+            btnDueSave->when(FL_WHEN_RELEASE);
+          } // My_Fl_Return_Button* btnDueSave
+          tabDues->end();
+        } // Fl_Group* tabDues
+        { tabPayments = new Fl_Group(10, 320, 585, 200, _tr("Payments"));
+          tabPayments->labelfont(2);
+          tabPayments->labelsize(16);
+          tabPayments->hide();
+          { grid_payments = new Fl_Data_Table(15, 330, 575, 130);
+            grid_payments->box(FL_NO_BOX);
+            grid_payments->color(FL_BACKGROUND2_COLOR);
+            grid_payments->selection_color(FL_SELECTION_COLOR);
+            grid_payments->labeltype(FL_NORMAL_LABEL);
+            grid_payments->labelfont(0);
+            grid_payments->labelsize(16);
+            grid_payments->labelcolor(FL_FOREGROUND_COLOR);
+            grid_payments->textsize(16);
+            grid_payments->align((FL_ALIGN_BOTTOM));
+            grid_payments->when(FL_WHEN_RELEASE_ALWAYS);
+          } // Fl_Data_Table* grid_payments
+          { local o = payment_id = new Fl_Output(15, 485, 80, 25, _tr("ID"));
+            payment_id->labelsize(16);
+            payment_id->textsize(16);
+            payment_id->align((FL_ALIGN_TOP_LEFT));
+            o->right_to_left(1);
+          } // Fl_Output* payment_id
+          { payment_date = new Fl_Input(100, 485, 125, 25, _tr("Date"));
+            payment_date->labelsize(16);
+            payment_date->textfont(1);
+            payment_date->textsize(16);
+            payment_date->align((FL_ALIGN_TOP_LEFT));
+          } // Fl_Input* payment_date
+          { btnShowCalendarPaymentDate = new Fl_Button(230, 485, 30, 25, _tr("@<->"));
+            btnShowCalendarPaymentDate->tooltip(_tr("Show calendar"));
+            btnShowCalendarPaymentDate->labelsize(18);
+            btnShowCalendarPaymentDate->labelcolor(22);
+          } // Fl_Button* btnShowCalendarPaymentDate
+          { payemnt_amount = new Fl_Float_Input_Fmt(270, 485, 120, 25, _tr("Amount"));
+            payemnt_amount->type(1);
+            payemnt_amount->box(FL_DOWN_BOX);
+            payemnt_amount->color(FL_BACKGROUND2_COLOR);
+            payemnt_amount->selection_color(FL_SELECTION_COLOR);
+            payemnt_amount->labeltype(FL_NORMAL_LABEL);
+            payemnt_amount->labelfont(1);
+            payemnt_amount->labelsize(16);
+            payemnt_amount->labelcolor(FL_FOREGROUND_COLOR);
+            payemnt_amount->textfont(1);
+            payemnt_amount->textsize(16);
+            payemnt_amount->align((FL_ALIGN_TOP_LEFT));
+            payemnt_amount->when(FL_WHEN_RELEASE);
+          } // Fl_Float_Input_Fmt* payemnt_amount
+          { btnPaymentSave = new My_Fl_Return_Button(395, 485, 100, 25, _tr("Save"));
+            btnPaymentSave->box(FL_UP_BOX);
+            btnPaymentSave->color(FL_BACKGROUND_COLOR);
+            btnPaymentSave->selection_color(FL_BACKGROUND_COLOR);
+            btnPaymentSave->labeltype(FL_NORMAL_LABEL);
+            btnPaymentSave->labelfont(0);
+            btnPaymentSave->labelsize(16);
+            btnPaymentSave->labelcolor(FL_FOREGROUND_COLOR);
+            btnPaymentSave->align((FL_ALIGN_CENTER));
+            btnPaymentSave->when(FL_WHEN_RELEASE);
+          } // My_Fl_Return_Button* btnPaymentSave
+          tabPayments->end();
+        } // Fl_Group* tabPayments
+        linesTab->end();
+      } // Fl_Tabs* linesTab
+      o->end();
+    } // Fl_Group* o
+    { btnNumberOrder = new My_Fl_Return_Button(230, 525, 82, 25, _tr("Number"));
+      btnNumberOrder->box(FL_UP_BOX);
+      btnNumberOrder->color(FL_BACKGROUND_COLOR);
+      btnNumberOrder->selection_color(FL_BACKGROUND_COLOR);
+      btnNumberOrder->labeltype(FL_NORMAL_LABEL);
+      btnNumberOrder->labelfont(0);
+      btnNumberOrder->labelsize(16);
+      btnNumberOrder->labelcolor(FL_FOREGROUND_COLOR);
+      btnNumberOrder->align((FL_ALIGN_CENTER));
+      btnNumberOrder->when(FL_WHEN_RELEASE);
+    } // My_Fl_Return_Button* btnNumberOrder
+    { dbAction = new Fl_Button(10, 525, 119, 25);
+      dbAction->resize(9, 525, 119, 25);
+      dbAction->down_box(FL_BORDER_BOX);
+      dbAction->labeltype(FL_NO_LABEL);
+      dbAction->labelsize(16);
+      dbAction->textsize(16);
+    } // Fl_Choice* dbAction
+    { btnDbAction = new My_Fl_Return_Button(138, 525, 82, 25, _tr("Action"));
+      btnDbAction->resize(138, 525, 82, 25);
+      btnDbAction->label(_tr("Action"));
+      btnDbAction->tooltip(_tr("Perform the selected action on this order"));
+      btnDbAction->box(FL_UP_BOX);
+      btnDbAction->color(FL_BACKGROUND_COLOR);
+      btnDbAction->selection_color(FL_BACKGROUND_COLOR);
+      btnDbAction->labeltype(FL_NORMAL_LABEL);
+      btnDbAction->labelfont(1);
+      btnDbAction->labelsize(16);
+      btnDbAction->labelcolor(FL_FOREGROUND_COLOR);
+      btnDbAction->align((FL_ALIGN_CENTER));
+      btnDbAction->when(FL_WHEN_RELEASE);
+    } // My_Fl_Return_Button* btnDbAction
+    tabMain->end();
+    Fl_Group.current()->resizable(tabMain);
+  } // Fl_Group* tabMain
+  { tabDelivery = new Fl_Group(5, 95, 790, 460, _tr("Delivery"));
+    tabDelivery->color(246);
+    tabDelivery->labelfont(2);
+    tabDelivery->labelsize(16);
+    tabDelivery->hide();
+    { db_orders_entity_address = new Fl_Input(91, 105, 694, 25, _tr("Address"));
+      db_orders_entity_address->labelsize(16);
+      db_orders_entity_address->textsize(16);
+      add_input_field_to_map("orders", "entity_address", db_orders_entity_address);
+    } // Fl_Input* db_orders_entity_address
+    { db_orders_entity_zip = new Fl_Input(91, 135, 95, 25, _tr("ZIP"));
+      db_orders_entity_zip->labelsize(16);
+      db_orders_entity_zip->textsize(16);
+      add_input_field_to_map("orders", "entity_zip", db_orders_entity_zip);
+    } // Fl_Input* db_orders_entity_zip
+    { db_orders_entity_city = new Fl_Input(288, 135, 497, 25, _tr("City"));
+      db_orders_entity_city->labelsize(16);
+      db_orders_entity_city->textsize(16);
+      add_input_field_to_map("orders", "entity_city", db_orders_entity_city);
+    } // Fl_Input* db_orders_entity_city
+    { db_orders_entity_state = new Fl_Input(91, 165, 407, 25, _tr("State"));
+      db_orders_entity_state->labelsize(16);
+      db_orders_entity_state->textsize(16);
+      add_input_field_to_map("orders", "entity_state", db_orders_entity_state);
+    } // Fl_Input* db_orders_entity_state
+    { db_orders_entity_country = new Fl_Input(585, 165, 201, 25, _tr("Country"));
+      db_orders_entity_country->labelsize(16);
+      db_orders_entity_country->textsize(16);
+      add_input_field_to_map("orders", "entity_country", db_orders_entity_country);
+    } // Fl_Input* db_orders_entity_country
+    { db_orders_entity_phone = new Fl_Input(91, 195, 201, 25, _tr("Phone"));
+      db_orders_entity_phone->labelsize(16);
+      db_orders_entity_phone->textsize(16);
+      add_input_field_to_map("orders", "entity_phone", db_orders_entity_phone);
+    } // Fl_Input* db_orders_entity_phone
+    { db_orders_entity_tax_number = new Fl_Input(585, 195, 200, 25, _tr("Tax Num."));
+      db_orders_entity_tax_number->labelsize(16);
+      db_orders_entity_tax_number->textsize(16);
+      add_input_field_to_map("orders", "entity_tax_number", db_orders_entity_tax_number);
+    } // Fl_Input* db_orders_entity_tax_number
+    { db_orders_order_valid_till_date = new Fl_Input(90, 225, 121, 25, _tr("Valid till"));
+      db_orders_order_valid_till_date->labelsize(16);
+      db_orders_order_valid_till_date->textsize(16);
+      add_input_field_to_map("orders", "order_valid_till_date", db_orders_order_valid_till_date);
+    } // Fl_Input* db_orders_order_valid_till_date
+    { btnShowCalendarValidTill = new Fl_Button(221, 225, 30, 25, _tr("@<->"));
+      btnShowCalendarValidTill->tooltip(_tr("Show calendar"));
+      btnShowCalendarValidTill->labelsize(18);
+      btnShowCalendarValidTill->labelcolor(22);
+    } // Fl_Button* btnShowCalendarValidTill
+    { db_orders_entity_use_sales_tax2 = new Fl_Check_Button(585, 225, 155, 25, _tr("Use Sales Tax II"));
+      db_orders_entity_use_sales_tax2->down_box(FL_DOWN_BOX);
+      db_orders_entity_use_sales_tax2->labelsize(16);
+      add_input_field_to_map("orders", "entity_use_sales_tax2", db_orders_entity_use_sales_tax2);
+    } // Fl_Check_Button* db_orders_entity_use_sales_tax2
+    { db_orders_entity_sales_tax_exempt = new Fl_Check_Button(585, 255, 155, 25, _tr("Sales Tax Exempt"));
+      db_orders_entity_sales_tax_exempt->down_box(FL_DOWN_BOX);
+      db_orders_entity_sales_tax_exempt->labelsize(16);
+      add_input_field_to_map("orders", "entity_sales_tax_exempt", db_orders_entity_sales_tax_exempt);
+    } // Fl_Check_Button* db_orders_entity_sales_tax_exempt
+    { db_orders_notes = new Fl_Text_Editor_Buffered(15, 395, 770, 150, _tr("Notes"));
+      db_orders_notes->box(FL_DOWN_FRAME);
+      db_orders_notes->color(FL_BACKGROUND2_COLOR);
+      db_orders_notes->selection_color(FL_SELECTION_COLOR);
+      db_orders_notes->labeltype(FL_NORMAL_LABEL);
+      db_orders_notes->labelfont(0);
+      db_orders_notes->labelsize(16);
+      db_orders_notes->labelcolor(FL_FOREGROUND_COLOR);
+      db_orders_notes->textsize(16);
+      db_orders_notes->align((FL_ALIGN_TOP_LEFT));
+      db_orders_notes->when(FL_WHEN_RELEASE);
+      Fl_Group.current()->resizable(db_orders_notes);
+      add_input_field_to_map("orders", "notes", db_orders_notes);
+    } // Fl_Text_Editor_Buffered* db_orders_notes
+    { local o = new Fl_Check_Button(125, 375, 125, 25, _tr("Wrap lines"));
+      o->down_box(FL_DOWN_BOX);
+      o->value(1);
+      o->labelsize(16);
+      o->callback(cb_Wrap);
+    } // Fl_Check_Button* o
+    { db_orders_irpf_pct_retention = new Fl_Float_Input_Fmt(585, 285, 70, 25, _tr("I.R.P.F. %"));
+      db_orders_irpf_pct_retention->type(1);
+      db_orders_irpf_pct_retention->box(FL_DOWN_BOX);
+      db_orders_irpf_pct_retention->color(FL_BACKGROUND2_COLOR);
+      db_orders_irpf_pct_retention->selection_color(FL_SELECTION_COLOR);
+      db_orders_irpf_pct_retention->labeltype(FL_NORMAL_LABEL);
+      db_orders_irpf_pct_retention->labelfont(0);
+      db_orders_irpf_pct_retention->labelsize(16);
+      db_orders_irpf_pct_retention->labelcolor(FL_FOREGROUND_COLOR);
+      db_orders_irpf_pct_retention->textsize(16);
+      db_orders_irpf_pct_retention->align((FL_ALIGN_RIGHT));
+      db_orders_irpf_pct_retention->when(FL_WHEN_RELEASE);
+      add_input_field_to_map("orders", "irpf_pct_retention", db_orders_irpf_pct_retention);
+    } // Fl_Float_Input_Fmt* db_orders_irpf_pct_retention
+    tabDelivery->end();
+  } // Fl_Group* tabDelivery
+  { tabOptions = new Fl_Group(5, 95, 790, 460, _tr("Options"));
+    tabOptions->color(246);
+    tabOptions->labelfont(2);
+    tabOptions->labelsize(16);
+    tabOptions->hide();
+    { opt_ask_for_printer = new Fl_Check_Button(20, 115, 155, 25, _tr("Ask for printer"));
+      opt_ask_for_printer->down_box(FL_DOWN_BOX);
+      opt_ask_for_printer->labelsize(16);
+    } // Fl_Check_Button* opt_ask_for_printer
+    { opt_print_only_data = new Fl_Check_Button(20, 150, 155, 25, _tr("Print only data"));
+      opt_print_only_data->down_box(FL_DOWN_BOX);
+      opt_print_only_data->labelsize(16);
+    } // Fl_Check_Button* opt_print_only_data
+    { opt_print_to_pdf = new Fl_Check_Button(20, 180, 155, 25, _tr("Print to PDF"));
+      opt_print_to_pdf->down_box(FL_DOWN_BOX);
+      opt_print_to_pdf->labelsize(16);
+    } // Fl_Check_Button* opt_print_to_pdf
+    { opt_print_page_format = new Fl_Choice_Str(20, 215, 130, 25);
+      opt_print_page_format->box(FL_FLAT_BOX);
+      opt_print_page_format->down_box(FL_BORDER_BOX);
+      opt_print_page_format->color(FL_BACKGROUND_COLOR);
+      opt_print_page_format->selection_color(FL_SELECTION_COLOR);
+      opt_print_page_format->labeltype(FL_NO_LABEL);
+      opt_print_page_format->labelfont(0);
+      opt_print_page_format->labelsize(16);
+      opt_print_page_format->labelcolor(FL_FOREGROUND_COLOR);
+      opt_print_page_format->textsize(16);
+      opt_print_page_format->align((FL_ALIGN_LEFT));
+      opt_print_page_format->when(FL_WHEN_RELEASE);
+    } // Fl_Choice_Str* opt_print_page_format
+    { btnOptPrint = new Fl_Button(20, 250, 130, 25, _tr("Print"));
+      btnOptPrint->tooltip(_tr("Print the current order"));
+      btnOptPrint->labelsize(16);
+    } // Fl_Button* btnOptPrint
+    { opt_email_program = new Fl_Input(260, 145, 520, 25, _tr("Email program"));
+      opt_email_program->tooltip(_tr("Type partal description to search on availlable entities"));
+      opt_email_program->labelsize(16);
+      opt_email_program->textsize(16);
+      opt_email_program->align((FL_ALIGN_TOP_LEFT));
+    } // Fl_Input* opt_email_program
+    { opt_email_program_command = new Fl_Input(260, 210, 520, 25, _tr("Email program parameters"));
+      opt_email_program_command->tooltip(_tr("Type partal description to search on availlable entities"));
+      opt_email_program_command->labelsize(16);
+      opt_email_program_command->textsize(16);
+      opt_email_program_command->align((FL_ALIGN_TOP_LEFT));
+    } // Fl_Input* opt_email_program_command
+    { btnOptSendEmail = new Fl_Button(260, 250, 130, 25, _tr("Send as email"));
+      btnOptSendEmail->tooltip(_tr("Print the current order"));
+      btnOptSendEmail->labelsize(16);
+    } // Fl_Button* btnOptSendEmail
+    { opt_print_order_company_info = new Fl_Text_Editor_Buffered(20, 350, 375, 200, _tr("Company Info"));
+      opt_print_order_company_info->box(FL_DOWN_FRAME);
+      opt_print_order_company_info->color(FL_BACKGROUND2_COLOR);
+      opt_print_order_company_info->selection_color(FL_SELECTION_COLOR);
+      opt_print_order_company_info->labeltype(FL_NORMAL_LABEL);
+      opt_print_order_company_info->labelfont(0);
+      opt_print_order_company_info->labelsize(16);
+      opt_print_order_company_info->labelcolor(FL_FOREGROUND_COLOR);
+      opt_print_order_company_info->textsize(16);
+      opt_print_order_company_info->align((FL_ALIGN_TOP_LEFT));
+      opt_print_order_company_info->when(FL_WHEN_RELEASE);
+    } // Fl_Text_Editor_Buffered* opt_print_order_company_info
+    { local o = new Fl_Check_Button(200, 330, 125, 25, _tr("Wrap lines"));
+      o->down_box(FL_DOWN_BOX);
+      o->value(1);
+      o->labelsize(16);
+      o->callback(cb_Wrap1);
+    } // Fl_Check_Button* o
+    { opt_print_order_bottom_info = new Fl_Text_Editor_Buffered(405, 350, 375, 200, _tr("Company Info"));
+      opt_print_order_bottom_info->box(FL_DOWN_FRAME);
+      opt_print_order_bottom_info->color(FL_BACKGROUND2_COLOR);
+      opt_print_order_bottom_info->selection_color(FL_SELECTION_COLOR);
+      opt_print_order_bottom_info->labeltype(FL_NORMAL_LABEL);
+      opt_print_order_bottom_info->labelfont(0);
+      opt_print_order_bottom_info->labelsize(16);
+      opt_print_order_bottom_info->labelcolor(FL_FOREGROUND_COLOR);
+      opt_print_order_bottom_info->textsize(16);
+      opt_print_order_bottom_info->align((FL_ALIGN_TOP_LEFT));
+      opt_print_order_bottom_info->when(FL_WHEN_RELEASE);
+      Fl_Group.current()->resizable(opt_print_order_bottom_info);
+    } // Fl_Text_Editor_Buffered* opt_print_order_bottom_info
+    { local o = new Fl_Check_Button(590, 330, 125, 25, _tr("Wrap lines"));
+      o->down_box(FL_DOWN_BOX);
+      o->value(1);
+      o->labelsize(16);
+      o->callback(cb_Wrap2);
+    } // Fl_Check_Button* o
+    tabOptions->end();
+  } // Fl_Group* tabOptions
+  { tabChartStatistics = new Fl_Group(5, 95, 790, 460, _tr("Statistics"));
+    tabChartStatistics->color(246);
+    tabChartStatistics->labelfont(2);
+    tabChartStatistics->labelsize(16);
+    tabChartStatistics->hide();
+    tabChartStatistics->end();
+  } // Fl_Group* tabChartStatistics
+  { tabHistory = new Fl_Group(5, 95, 790, 460, _tr("History"));
+    tabHistory->color(246);
+    tabHistory->labelfont(2);
+    tabHistory->labelsize(16);
+    tabHistory->hide();
+    tabHistory->end();
+  } // Fl_Group* tabHistory
+  { tabPrintPreview = new Fl_Group(5, 95, 790, 460, _tr("Preview"));
+    tabPrintPreview->color(246);
+    tabPrintPreview->labelfont(2);
+    tabPrintPreview->labelsize(16);
+    tabPrintPreview->hide();
+    tabPrintPreview->end();
+  } // Fl_Group* tabPrintPreview
+  { tabTotals = new Fl_Group(5, 95, 790, 460, _tr("Totals"));
+    tabTotals->color(246);
+    tabTotals->labelfont(2);
+    tabTotals->labelsize(16);
+    tabTotals->hide();
+    { totals_balance = new Fl_Float_Input_Fmt(145, 155, 110, 25, _tr("Balance"));
+      totals_balance->type(1);
+      totals_balance->box(FL_DOWN_BOX);
+      totals_balance->color(FL_BACKGROUND2_COLOR);
+      totals_balance->selection_color(FL_SELECTION_COLOR);
+      totals_balance->labeltype(FL_NORMAL_LABEL);
+      totals_balance->labelfont(0);
+      totals_balance->labelsize(16);
+      totals_balance->labelcolor(FL_FOREGROUND_COLOR);
+      totals_balance->textsize(16);
+      totals_balance->align((FL_ALIGN_LEFT));
+      totals_balance->when(FL_WHEN_RELEASE);
+    } // Fl_Float_Input_Fmt* totals_balance
+    { db_totals_overview_sales_quoted = new Fl_Float_Input_Fmt(145, 200, 110, 25, _tr("Sales Quoted"));
+      db_totals_overview_sales_quoted->type(1);
+      db_totals_overview_sales_quoted->box(FL_DOWN_BOX);
+      db_totals_overview_sales_quoted->color(FL_BACKGROUND2_COLOR);
+      db_totals_overview_sales_quoted->selection_color(FL_SELECTION_COLOR);
+      db_totals_overview_sales_quoted->labeltype(FL_NORMAL_LABEL);
+      db_totals_overview_sales_quoted->labelfont(0);
+      db_totals_overview_sales_quoted->labelsize(16);
+      db_totals_overview_sales_quoted->labelcolor(FL_FOREGROUND_COLOR);
+      db_totals_overview_sales_quoted->textsize(16);
+      db_totals_overview_sales_quoted->align((FL_ALIGN_LEFT));
+      db_totals_overview_sales_quoted->when(FL_WHEN_RELEASE);
+      add_input_field_to_map("totals_overview", "sales_quoted", db_totals_overview_sales_quoted);
+    } // Fl_Float_Input_Fmt* db_totals_overview_sales_quoted
+    { db_totals_overview_sales_ordered = new Fl_Float_Input_Fmt(145, 235, 110, 25, _tr("Sales Ordered"));
+      db_totals_overview_sales_ordered->type(1);
+      db_totals_overview_sales_ordered->box(FL_DOWN_BOX);
+      db_totals_overview_sales_ordered->color(FL_BACKGROUND2_COLOR);
+      db_totals_overview_sales_ordered->selection_color(FL_SELECTION_COLOR);
+      db_totals_overview_sales_ordered->labeltype(FL_NORMAL_LABEL);
+      db_totals_overview_sales_ordered->labelfont(0);
+      db_totals_overview_sales_ordered->labelsize(16);
+      db_totals_overview_sales_ordered->labelcolor(FL_FOREGROUND_COLOR);
+      db_totals_overview_sales_ordered->textsize(16);
+      db_totals_overview_sales_ordered->align((FL_ALIGN_LEFT));
+      db_totals_overview_sales_ordered->when(FL_WHEN_RELEASE);
+      add_input_field_to_map("totals_overview", "sales_ordered", db_totals_overview_sales_ordered);
+    } // Fl_Float_Input_Fmt* db_totals_overview_sales_ordered
+    { db_totals_overview_sales_delivered = new Fl_Float_Input_Fmt(145, 270, 110, 25, _tr("Sales Delivered"));
+      db_totals_overview_sales_delivered->type(1);
+      db_totals_overview_sales_delivered->box(FL_DOWN_BOX);
+      db_totals_overview_sales_delivered->color(FL_BACKGROUND2_COLOR);
+      db_totals_overview_sales_delivered->selection_color(FL_SELECTION_COLOR);
+      db_totals_overview_sales_delivered->labeltype(FL_NORMAL_LABEL);
+      db_totals_overview_sales_delivered->labelfont(0);
+      db_totals_overview_sales_delivered->labelsize(16);
+      db_totals_overview_sales_delivered->labelcolor(FL_FOREGROUND_COLOR);
+      db_totals_overview_sales_delivered->textsize(16);
+      db_totals_overview_sales_delivered->align((FL_ALIGN_LEFT));
+      db_totals_overview_sales_delivered->when(FL_WHEN_RELEASE);
+      add_input_field_to_map("totals_overview", "sales_delivered", db_totals_overview_sales_delivered);
+    } // Fl_Float_Input_Fmt* db_totals_overview_sales_delivered
+    { db_totals_overview_sales_invoiced = new Fl_Float_Input_Fmt(145, 305, 110, 25, _tr("Sales Invoiced"));
+      db_totals_overview_sales_invoiced->type(1);
+      db_totals_overview_sales_invoiced->box(FL_DOWN_BOX);
+      db_totals_overview_sales_invoiced->color(FL_BACKGROUND2_COLOR);
+      db_totals_overview_sales_invoiced->selection_color(FL_SELECTION_COLOR);
+      db_totals_overview_sales_invoiced->labeltype(FL_NORMAL_LABEL);
+      db_totals_overview_sales_invoiced->labelfont(0);
+      db_totals_overview_sales_invoiced->labelsize(16);
+      db_totals_overview_sales_invoiced->labelcolor(FL_FOREGROUND_COLOR);
+      db_totals_overview_sales_invoiced->textsize(16);
+      db_totals_overview_sales_invoiced->align((FL_ALIGN_LEFT));
+      db_totals_overview_sales_invoiced->when(FL_WHEN_RELEASE);
+      add_input_field_to_map("totals_overview", "sales_invoiced", db_totals_overview_sales_invoiced);
+    } // Fl_Float_Input_Fmt* db_totals_overview_sales_invoiced
+    { db_totals_overview_sales_discount = new Fl_Float_Input_Fmt(145, 340, 110, 25, _tr("Sales Discount"));
+      db_totals_overview_sales_discount->type(1);
+      db_totals_overview_sales_discount->box(FL_DOWN_BOX);
+      db_totals_overview_sales_discount->color(FL_BACKGROUND2_COLOR);
+      db_totals_overview_sales_discount->selection_color(FL_SELECTION_COLOR);
+      db_totals_overview_sales_discount->labeltype(FL_NORMAL_LABEL);
+      db_totals_overview_sales_discount->labelfont(0);
+      db_totals_overview_sales_discount->labelsize(16);
+      db_totals_overview_sales_discount->labelcolor(FL_FOREGROUND_COLOR);
+      db_totals_overview_sales_discount->textsize(16);
+      db_totals_overview_sales_discount->align((FL_ALIGN_LEFT));
+      db_totals_overview_sales_discount->when(FL_WHEN_RELEASE);
+      add_input_field_to_map("totals_overview", "sales_discount", db_totals_overview_sales_discount);
+    } // Fl_Float_Input_Fmt* db_totals_overview_sales_discount
+    { db_totals_overview_sales_tax1 = new Fl_Float_Input_Fmt(145, 375, 110, 25, _tr("Sales Tax1"));
+      db_totals_overview_sales_tax1->type(1);
+      db_totals_overview_sales_tax1->box(FL_DOWN_BOX);
+      db_totals_overview_sales_tax1->color(FL_BACKGROUND2_COLOR);
+      db_totals_overview_sales_tax1->selection_color(FL_SELECTION_COLOR);
+      db_totals_overview_sales_tax1->labeltype(FL_NORMAL_LABEL);
+      db_totals_overview_sales_tax1->labelfont(0);
+      db_totals_overview_sales_tax1->labelsize(16);
+      db_totals_overview_sales_tax1->labelcolor(FL_FOREGROUND_COLOR);
+      db_totals_overview_sales_tax1->textsize(16);
+      db_totals_overview_sales_tax1->align((FL_ALIGN_LEFT));
+      db_totals_overview_sales_tax1->when(FL_WHEN_RELEASE);
+      add_input_field_to_map("totals_overview", "sales_tax1", db_totals_overview_sales_tax1);
+    } // Fl_Float_Input_Fmt* db_totals_overview_sales_tax1
+    { db_totals_overview_sales_tax2 = new Fl_Float_Input_Fmt(145, 410, 110, 25, _tr("Sales Tax2"));
+      db_totals_overview_sales_tax2->type(1);
+      db_totals_overview_sales_tax2->box(FL_DOWN_BOX);
+      db_totals_overview_sales_tax2->color(FL_BACKGROUND2_COLOR);
+      db_totals_overview_sales_tax2->selection_color(FL_SELECTION_COLOR);
+      db_totals_overview_sales_tax2->labeltype(FL_NORMAL_LABEL);
+      db_totals_overview_sales_tax2->labelfont(0);
+      db_totals_overview_sales_tax2->labelsize(16);
+      db_totals_overview_sales_tax2->labelcolor(FL_FOREGROUND_COLOR);
+      db_totals_overview_sales_tax2->textsize(16);
+      db_totals_overview_sales_tax2->align((FL_ALIGN_LEFT));
+      db_totals_overview_sales_tax2->when(FL_WHEN_RELEASE);
+      add_input_field_to_map("totals_overview", "sales_tax2", db_totals_overview_sales_tax2);
+    } // Fl_Float_Input_Fmt* db_totals_overview_sales_tax2
+    { db_totals_overview_sales_paid = new Fl_Float_Input_Fmt(145, 445, 110, 25, _tr("Sales Paid"));
+      db_totals_overview_sales_paid->type(1);
+      db_totals_overview_sales_paid->box(FL_DOWN_BOX);
+      db_totals_overview_sales_paid->color(FL_BACKGROUND2_COLOR);
+      db_totals_overview_sales_paid->selection_color(FL_SELECTION_COLOR);
+      db_totals_overview_sales_paid->labeltype(FL_NORMAL_LABEL);
+      db_totals_overview_sales_paid->labelfont(0);
+      db_totals_overview_sales_paid->labelsize(16);
+      db_totals_overview_sales_paid->labelcolor(FL_FOREGROUND_COLOR);
+      db_totals_overview_sales_paid->textsize(16);
+      db_totals_overview_sales_paid->align((FL_ALIGN_LEFT));
+      db_totals_overview_sales_paid->when(FL_WHEN_RELEASE);
+      add_input_field_to_map("totals_overview", "sales_paid", db_totals_overview_sales_paid);
+    } // Fl_Float_Input_Fmt* db_totals_overview_sales_paid
+    { btnRefreshTotals = new My_Fl_Return_Button(415, 155, 110, 25, _tr("Refresh"));
+      btnRefreshTotals->box(FL_UP_BOX);
+      btnRefreshTotals->color(FL_BACKGROUND_COLOR);
+      btnRefreshTotals->selection_color(FL_BACKGROUND_COLOR);
+      btnRefreshTotals->labeltype(FL_NORMAL_LABEL);
+      btnRefreshTotals->labelfont(0);
+      btnRefreshTotals->labelsize(16);
+      btnRefreshTotals->labelcolor(FL_FOREGROUND_COLOR);
+      btnRefreshTotals->align((FL_ALIGN_CENTER));
+      btnRefreshTotals->when(FL_WHEN_RELEASE);
+    } // My_Fl_Return_Button* btnRefreshTotals
+    { db_totals_overview_buys_quoted = new Fl_Float_Input_Fmt(415, 200, 110, 25, _tr("Buys Quoted"));
+      db_totals_overview_buys_quoted->type(1);
+      db_totals_overview_buys_quoted->box(FL_DOWN_BOX);
+      db_totals_overview_buys_quoted->color(FL_BACKGROUND2_COLOR);
+      db_totals_overview_buys_quoted->selection_color(FL_SELECTION_COLOR);
+      db_totals_overview_buys_quoted->labeltype(FL_NORMAL_LABEL);
+      db_totals_overview_buys_quoted->labelfont(0);
+      db_totals_overview_buys_quoted->labelsize(16);
+      db_totals_overview_buys_quoted->labelcolor(FL_FOREGROUND_COLOR);
+      db_totals_overview_buys_quoted->textsize(16);
+      db_totals_overview_buys_quoted->align((FL_ALIGN_LEFT));
+      db_totals_overview_buys_quoted->when(FL_WHEN_RELEASE);
+      add_input_field_to_map("totals_overview", "buys_quoted", db_totals_overview_buys_quoted);
+    } // Fl_Float_Input_Fmt* db_totals_overview_buys_quoted
+    { db_totals_overview_buys_ordered = new Fl_Float_Input_Fmt(415, 235, 110, 25, _tr("Buys Ordered"));
+      db_totals_overview_buys_ordered->type(1);
+      db_totals_overview_buys_ordered->box(FL_DOWN_BOX);
+      db_totals_overview_buys_ordered->color(FL_BACKGROUND2_COLOR);
+      db_totals_overview_buys_ordered->selection_color(FL_SELECTION_COLOR);
+      db_totals_overview_buys_ordered->labeltype(FL_NORMAL_LABEL);
+      db_totals_overview_buys_ordered->labelfont(0);
+      db_totals_overview_buys_ordered->labelsize(16);
+      db_totals_overview_buys_ordered->labelcolor(FL_FOREGROUND_COLOR);
+      db_totals_overview_buys_ordered->textsize(16);
+      db_totals_overview_buys_ordered->align((FL_ALIGN_LEFT));
+      db_totals_overview_buys_ordered->when(FL_WHEN_RELEASE);
+      add_input_field_to_map("totals_overview", "buys_ordered", db_totals_overview_buys_ordered);
+    } // Fl_Float_Input_Fmt* db_totals_overview_buys_ordered
+    { db_totals_overview_buys_received = new Fl_Float_Input_Fmt(415, 270, 110, 25, _tr("Buys Received"));
+      db_totals_overview_buys_received->type(1);
+      db_totals_overview_buys_received->box(FL_DOWN_BOX);
+      db_totals_overview_buys_received->color(FL_BACKGROUND2_COLOR);
+      db_totals_overview_buys_received->selection_color(FL_SELECTION_COLOR);
+      db_totals_overview_buys_received->labeltype(FL_NORMAL_LABEL);
+      db_totals_overview_buys_received->labelfont(0);
+      db_totals_overview_buys_received->labelsize(16);
+      db_totals_overview_buys_received->labelcolor(FL_FOREGROUND_COLOR);
+      db_totals_overview_buys_received->textsize(16);
+      db_totals_overview_buys_received->align((FL_ALIGN_LEFT));
+      db_totals_overview_buys_received->when(FL_WHEN_RELEASE);
+      add_input_field_to_map("totals_overview", "buys_received", db_totals_overview_buys_received);
+    } // Fl_Float_Input_Fmt* db_totals_overview_buys_received
+    { db_totals_overview_buys_invoiced = new Fl_Float_Input_Fmt(415, 305, 110, 25, _tr("Buys Invoiced"));
+      db_totals_overview_buys_invoiced->type(1);
+      db_totals_overview_buys_invoiced->box(FL_DOWN_BOX);
+      db_totals_overview_buys_invoiced->color(FL_BACKGROUND2_COLOR);
+      db_totals_overview_buys_invoiced->selection_color(FL_SELECTION_COLOR);
+      db_totals_overview_buys_invoiced->labeltype(FL_NORMAL_LABEL);
+      db_totals_overview_buys_invoiced->labelfont(0);
+      db_totals_overview_buys_invoiced->labelsize(16);
+      db_totals_overview_buys_invoiced->labelcolor(FL_FOREGROUND_COLOR);
+      db_totals_overview_buys_invoiced->textsize(16);
+      db_totals_overview_buys_invoiced->align((FL_ALIGN_LEFT));
+      db_totals_overview_buys_invoiced->when(FL_WHEN_RELEASE);
+      add_input_field_to_map("totals_overview", "buys_invoiced", db_totals_overview_buys_invoiced);
+    } // Fl_Float_Input_Fmt* db_totals_overview_buys_invoiced
+    { db_totals_overview_buys_discount = new Fl_Float_Input_Fmt(415, 340, 110, 25, _tr("Buys Discount"));
+      db_totals_overview_buys_discount->type(1);
+      db_totals_overview_buys_discount->box(FL_DOWN_BOX);
+      db_totals_overview_buys_discount->color(FL_BACKGROUND2_COLOR);
+      db_totals_overview_buys_discount->selection_color(FL_SELECTION_COLOR);
+      db_totals_overview_buys_discount->labeltype(FL_NORMAL_LABEL);
+      db_totals_overview_buys_discount->labelfont(0);
+      db_totals_overview_buys_discount->labelsize(16);
+      db_totals_overview_buys_discount->labelcolor(FL_FOREGROUND_COLOR);
+      db_totals_overview_buys_discount->textsize(16);
+      db_totals_overview_buys_discount->align((FL_ALIGN_LEFT));
+      db_totals_overview_buys_discount->when(FL_WHEN_RELEASE);
+      add_input_field_to_map("totals_overview", "buys_discount", db_totals_overview_buys_discount);
+    } // Fl_Float_Input_Fmt* db_totals_overview_buys_discount
+    { db_totals_overview_buys_tax1 = new Fl_Float_Input_Fmt(415, 375, 110, 25, _tr("Buys Tax1"));
+      db_totals_overview_buys_tax1->type(1);
+      db_totals_overview_buys_tax1->box(FL_DOWN_BOX);
+      db_totals_overview_buys_tax1->color(FL_BACKGROUND2_COLOR);
+      db_totals_overview_buys_tax1->selection_color(FL_SELECTION_COLOR);
+      db_totals_overview_buys_tax1->labeltype(FL_NORMAL_LABEL);
+      db_totals_overview_buys_tax1->labelfont(0);
+      db_totals_overview_buys_tax1->labelsize(16);
+      db_totals_overview_buys_tax1->labelcolor(FL_FOREGROUND_COLOR);
+      db_totals_overview_buys_tax1->textsize(16);
+      db_totals_overview_buys_tax1->align((FL_ALIGN_LEFT));
+      db_totals_overview_buys_tax1->when(FL_WHEN_RELEASE);
+      add_input_field_to_map("totals_overview", "buys_tax1", db_totals_overview_buys_tax1);
+    } // Fl_Float_Input_Fmt* db_totals_overview_buys_tax1
+    { db_totals_overview_buys_tax2 = new Fl_Float_Input_Fmt(415, 410, 110, 25, _tr("Buys Tax2"));
+      db_totals_overview_buys_tax2->type(1);
+      db_totals_overview_buys_tax2->box(FL_DOWN_BOX);
+      db_totals_overview_buys_tax2->color(FL_BACKGROUND2_COLOR);
+      db_totals_overview_buys_tax2->selection_color(FL_SELECTION_COLOR);
+      db_totals_overview_buys_tax2->labeltype(FL_NORMAL_LABEL);
+      db_totals_overview_buys_tax2->labelfont(0);
+      db_totals_overview_buys_tax2->labelsize(16);
+      db_totals_overview_buys_tax2->labelcolor(FL_FOREGROUND_COLOR);
+      db_totals_overview_buys_tax2->textsize(16);
+      db_totals_overview_buys_tax2->align((FL_ALIGN_LEFT));
+      db_totals_overview_buys_tax2->when(FL_WHEN_RELEASE);
+      add_input_field_to_map("totals_overview", "buys_tax2", db_totals_overview_buys_tax2);
+    } // Fl_Float_Input_Fmt* db_totals_overview_buys_tax2
+    { db_totals_overview_buys_paid = new Fl_Float_Input_Fmt(415, 445, 110, 25, _tr("Buys Paid"));
+      db_totals_overview_buys_paid->type(1);
+      db_totals_overview_buys_paid->box(FL_DOWN_BOX);
+      db_totals_overview_buys_paid->color(FL_BACKGROUND2_COLOR);
+      db_totals_overview_buys_paid->selection_color(FL_SELECTION_COLOR);
+      db_totals_overview_buys_paid->labeltype(FL_NORMAL_LABEL);
+      db_totals_overview_buys_paid->labelfont(0);
+      db_totals_overview_buys_paid->labelsize(16);
+      db_totals_overview_buys_paid->labelcolor(FL_FOREGROUND_COLOR);
+      db_totals_overview_buys_paid->textsize(16);
+      db_totals_overview_buys_paid->align((FL_ALIGN_LEFT));
+      db_totals_overview_buys_paid->when(FL_WHEN_RELEASE);
+      add_input_field_to_map("totals_overview", "buys_paid", db_totals_overview_buys_paid);
+    } // Fl_Float_Input_Fmt* db_totals_overview_buys_paid
+    tabTotals->end();
+  } // Fl_Group* tabTotals
+  tabs->end();
+  Fl_Group.current()->resizable(tabs);
+} // Fl_Tabs* tabs
+db_orders_order_type_id->textfont(db_orders_order_type_id->labelfont());
+db_orders_order_type_id->textsize(db_orders_order_type_id->labelsize());
+end();
+}
+
+function cb_Wrap(){}
+function cb_Wrap1(){}
+function cb_Wrap2(){}
+}
+//local win = new MainWindow(10, 50, 330, 320, "OURBIZ");
+local win = new BaseReportA4();
+win->resizable(win);
+win->show_main();
+
+math.number_format_set_dec_point(",");
+math.number_format_set_thousand_sep(".");
+Fl_Input.default_number_format("\0x02,.");
+//Fl:scheme("plastic");
+Fl.scheme("gtk+");
+//use partial match to find verdana font
+Fl.visual(FL_RGB);
+//allow arrow keys navigation
+Fl.option(Fl.OPTION_ARROW_FOCUS, true);
+
+Fl.run();

+ 234 - 0
samples/test-fltk-6.nut

@@ -0,0 +1,234 @@
+function _tr(str){ return str;}
+
+class Fl_Data_Table extends Flv_Table {
+	_forPrint = null;
+	
+	constructor(px, py, pw, ph, pl=""){
+		base.constructor(px, py, pw, ph, pl);
+		_forPrint=false;
+	}
+}
+
+class Fl_Box_ClearLabel extends Fl_Box {
+	constructor(px, py, pw, ph, pl=""){
+		base.constructor(px, py, pw, ph, pl);
+	}
+}
+
+class Flu_Combo_List extends Fl_Box {
+	constructor(px, py, pw, ph, pl=""){
+		base.constructor(px, py, pw, ph, pl);
+	}
+}
+
+class Fl_Image_Box extends Fl_Box {
+	constructor(px, py, pw, ph, pl=""){
+		base.constructor(px, py, pw, ph, pl);
+	}
+}
+
+
+class Fl_Choice_Int extends Fl_Button {
+	constructor(px, py, pw, ph, pl=""){
+		base.constructor(px, py, pw, ph, pl);
+	}
+}
+
+class Fl_Float_Input_Fmt extends Fl_Float_Input {
+	constructor(px, py, pw, ph, pl=""){
+		base.constructor(px, py, pw, ph, pl);
+	}
+}
+
+class My_Fl_Float_Input extends Fl_Float_Input {
+	constructor(px, py, pw, ph, pl=""){
+		base.constructor(px, py, pw, ph, pl);
+	}
+}
+
+
+class My_Fl_Return_Button extends Fl_Button {
+	constructor(px, py, pw, ph, pl=""){
+		base.constructor(px, py, pw, ph, pl);
+	}
+}
+
+class Fl_Choice_Str extends Fl_Button {
+	constructor(px, py, pw, ph, pl=""){
+		base.constructor(px, py, pw, ph, pl);
+	}
+}
+
+class Flu_Combo_Box extends Fl_Button {
+	constructor(px, py, pw, ph, pl=""){
+		base.constructor(px, py, pw, ph, pl);
+	}
+}
+
+
+function add_input_field_to_map(tbl, fldname, fld){
+}
+	
+//class BaseReportA4 extends Fl_Group {
+class BaseReportA4 extends Fl_Window {
+	topGroup=null;
+	group_filter=null;
+	query_limit=null;
+	btnNotes=null;
+	middleGroup=null;
+	grid=null;
+	bottomGroup=null;
+	pack_search_options=null;
+	search_str=null;
+	btnSearch=null;
+	btnSelect=null;
+	btnUpdate=null;
+	btnInsert=null;
+	btnThumbImage=null;
+	pack_search_options2=null;
+	
+constructor() {
+	base.constructor(10, 50, 800, 560, _tr("Edit Order"));
+begin();
+this->box(FL_FLAT_BOX);
+this->color(FL_BACKGROUND_COLOR);
+this->selection_color(FL_BACKGROUND_COLOR);
+this->labeltype(FL_NO_LABEL);
+this->labelfont(0);
+this->labelsize(16);
+this->labelcolor(FL_FOREGROUND_COLOR);
+this->align((FL_ALIGN_TOP));
+this->when(FL_WHEN_RELEASE);
+{ topGroup = new Fl_Group(0, 0, 800, 35);
+  topGroup->labelsize(16);
+  { group_filter = new Flu_Combo_Box(5, 5, 675, 25);
+    group_filter->resize(5, 5, 675, 25);
+    group_filter->box(FL_DOWN_BOX);
+    group_filter->color(FL_BACKGROUND2_COLOR);
+    group_filter->selection_color(FL_SELECTION_COLOR);
+    group_filter->labeltype(FL_NO_LABEL);
+    group_filter->labelfont(0);
+    group_filter->labelsize(16);
+    group_filter->labelcolor(FL_FOREGROUND_COLOR);
+    group_filter->textsize(16);
+    group_filter->align((FL_ALIGN_LEFT));
+    group_filter->when(FL_WHEN_RELEASE);
+  } // Flu_Combo_Box* group_filter
+  { local o = query_limit = new Fl_Int_Input(690, 6, 60, 25);
+    query_limit->type(2);
+    query_limit->labeltype(FL_NO_LABEL);
+    query_limit->labelsize(16);
+    query_limit->textsize(16);
+    o->value("50");
+  } // Fl_Int_Input* query_limit
+  { btnNotes = new Fl_Button(760, 6, 35, 25, _tr("?"));
+    btnNotes->labelsize(16);
+  } // Fl_Button* btnNotes
+  topGroup->end();
+} // Fl_Group* topGroup
+{ middleGroup = new Fl_Group(0, 41, 800, 409);
+  middleGroup->labelsize(16);
+  { grid = new Fl_Data_Table(5, 41, 790, 389);
+    grid->resize(5, 41, 790, 389);
+    grid->type(3);
+    grid->box(FL_NO_BOX);
+    grid->color(FL_BACKGROUND2_COLOR);
+    grid->selection_color(FL_SELECTION_COLOR);
+    grid->labeltype(FL_NO_LABEL);
+    grid->labelfont(0);
+    grid->labelsize(16);
+    grid->labelcolor(FL_FOREGROUND_COLOR);
+    grid->textsize(16);
+    grid->align((FL_ALIGN_BOTTOM));
+    grid->when(FL_WHEN_RELEASE_ALWAYS);
+    Fl_Group.current()->resizable(grid);
+  } // Fl_Data_Table* grid
+  middleGroup->end();
+  Fl_Group.current()->resizable(middleGroup);
+} // Fl_Group* middleGroup
+{ bottomGroup = new Fl_Group(4, 440, 790, 115);
+  bottomGroup->box(FL_ENGRAVED_BOX);
+  bottomGroup->color(246);
+  bottomGroup->labelsize(16);
+  { local o = pack_search_options = new Fl_Pack(14, 450, 320, 25);
+    pack_search_options->type(1);
+    pack_search_options->labelsize(16);
+    o->spacing(10);
+    pack_search_options->end();
+  } // Fl_Pack* pack_search_options
+  { search_str = new Fl_Input(35, 485, 299, 25, _tr("@search"));
+    search_str->resize(35, 485, 299, 25);
+    search_str->label(_tr("@search"));
+    search_str->labelsize(16);
+    search_str->textsize(16);
+    search_str->callback(cb_search_str);
+    search_str->when(FL_WHEN_ENTER_KEY);
+  } // Fl_Input* search_str
+  { btnSearch = new Fl_Button(345, 485, 100, 25, _tr("Search"));
+    btnSearch->labelsize(16);
+    btnSearch->callback(cb_btnSearch);
+  } // Fl_Button* btnSearch
+  { btnSelect = new Fl_Button(14, 520, 100, 25, _tr("Select"));
+    btnSelect->labelsize(16);
+    btnSelect->callback(cb_btnSelect);
+  } // Fl_Button* btnSelect
+  { btnUpdate = new Fl_Button(124, 520, 100, 25, _tr("Update"));
+    btnUpdate->labelsize(16);
+    btnUpdate->callback(cb_btnUpdate);
+  } // Fl_Button* btnUpdate
+  { btnInsert = new Fl_Button(234, 520, 100, 25, _tr("Insert"));
+    btnInsert->labelsize(16);
+    btnInsert->callback(cb_btnInsert);
+  } // Fl_Button* btnInsert
+  { btnThumbImage = new Fl_Image_Box(663, 445, 125, 105);
+    btnThumbImage->box(FL_NO_BOX);
+    btnThumbImage->color(FL_BACKGROUND_COLOR);
+    btnThumbImage->selection_color(FL_BACKGROUND_COLOR);
+    btnThumbImage->labeltype(FL_NORMAL_LABEL);
+    btnThumbImage->labelfont(0);
+    btnThumbImage->labelsize(14);
+    btnThumbImage->labelcolor(FL_FOREGROUND_COLOR);
+    btnThumbImage->align((FL_ALIGN_CLIP|FL_ALIGN_INSIDE));
+    btnThumbImage->when(FL_WHEN_RELEASE);
+  } // Fl_Image_Box* btnThumbImage
+  { local o = new Fl_Box(650, 445, 5, 105);
+    o->labeltype(FL_NO_LABEL);
+    o->labelsize(16);
+    o->align((FL_ALIGN_CLIP|FL_ALIGN_INSIDE));
+    Fl_Group.current()->resizable(o);
+  } // Fl_Box* o
+  { local o = pack_search_options2 = new Fl_Pack(345, 520, 300, 25);
+    pack_search_options2->type(1);
+    pack_search_options2->labelsize(16);
+    o->spacing(10);
+    pack_search_options2->end();
+  } // Fl_Pack* pack_search_options2
+  bottomGroup->end();
+} // Fl_Group* bottomGroup
+group_filter->textfont(group_filter->labelfont());
+group_filter->textsize(group_filter->labelsize());
+end();
+}
+
+function cb_search_str(){}
+function cb_btnSearch(){}
+function cb_btnSelect(){}
+function cb_btnUpdate(){}
+function cb_btnInsert(){}
+}
+//local win = new MainWindow(10, 50, 330, 320, "OURBIZ");
+local win = new BaseReportA4();
+win->resizable(win);
+win->show_main();
+
+math.number_format_set_dec_point(",");
+math.number_format_set_thousand_sep(".");
+Fl_Input.default_number_format("\0x02,.");
+//Fl:scheme("plastic");
+Fl.scheme("gtk+");
+//use partial match to find verdana font
+Fl.visual(FL_RGB);
+//allow arrow keys navigation
+Fl.option(Fl.OPTION_ARROW_FOCUS, true);
+
+Fl.run();

+ 793 - 0
samples/test-fltk-7.nut

@@ -0,0 +1,793 @@
+function _tr(str){ return str;}
+
+class Fl_Data_Table extends Flv_Table {
+	_forPrint = null;
+	
+	constructor(px, py, pw, ph, pl=""){
+		base.constructor(px, py, pw, ph, pl);
+		_forPrint=false;
+	}
+}
+
+class Flu_Tree_Browser extends Flv_Table {
+	_forPrint = null;
+	
+	constructor(px, py, pw, ph, pl=""){
+		base.constructor(px, py, pw, ph, pl);
+		_forPrint=false;
+	}
+}
+
+
+class Fl_Box_ClearLabel extends Fl_Box {
+	constructor(px, py, pw, ph, pl=""){
+		base.constructor(px, py, pw, ph, pl);
+	}
+}
+
+class Flu_Combo_List extends Fl_Box {
+	constructor(px, py, pw, ph, pl=""){
+		base.constructor(px, py, pw, ph, pl);
+	}
+}
+
+class Fl_Image_Box extends Fl_Box {
+	constructor(px, py, pw, ph, pl=""){
+		base.constructor(px, py, pw, ph, pl);
+	}
+}
+
+
+class Fl_Choice_Int extends Fl_Button {
+	constructor(px, py, pw, ph, pl=""){
+		base.constructor(px, py, pw, ph, pl);
+	}
+}
+
+class Fl_Float_Input_Fmt extends Fl_Float_Input {
+	constructor(px, py, pw, ph, pl=""){
+		base.constructor(px, py, pw, ph, pl);
+	}
+}
+
+class My_Fl_Float_Input extends Fl_Float_Input {
+	constructor(px, py, pw, ph, pl=""){
+		base.constructor(px, py, pw, ph, pl);
+	}
+}
+
+
+class My_Fl_Return_Button extends Fl_Button {
+	constructor(px, py, pw, ph, pl=""){
+		base.constructor(px, py, pw, ph, pl);
+	}
+}
+
+class Fl_Choice_Str extends Fl_Button {
+	constructor(px, py, pw, ph, pl=""){
+		base.constructor(px, py, pw, ph, pl);
+	}
+}
+
+class Flu_Combo_Box extends Fl_Button {
+	constructor(px, py, pw, ph, pl=""){
+		base.constructor(px, py, pw, ph, pl);
+	}
+}
+
+
+function add_input_field_to_map(tbl, fldname, fld){
+}
+	
+//class BaseReportA4 extends Fl_Group {
+class BaseReportA4 extends Fl_Window {
+	db_products_id=null;
+	db_products_description_ro=null;
+	db_products_mdate=null;
+	db_products_cdate=null;
+	tabs=null;
+	tabMain=null;
+	db_products_reference_code=null;
+	db_products_supplier_code=null;
+	db_products_bar_code=null;
+	db_products_sell_description=null;
+	db_products_buy_description=null;
+	db_products_sell_price=null;
+	db_products_measure_unit_id=null;
+	db_products_sales_tax_id=null;
+	db_products_warranty_id=null;
+	db_products_sell_quantity_min=null;
+	db_products_units_by_package=null;
+	db_products_weight=null;
+	db_products_sell_without_stock=null;
+	db_products_is_active=null;
+	db_products_show_on_sales=null;
+	db_products_show_on_buys=null;
+	db_products_show_on_web=null;
+	db_products_show_price_on_web=null;
+	tabNotes=null;
+	db_products_sell_notes=null;
+	tabNotesSupplier=null;
+	db_products_buy_notes=null;
+	tabTags=null;
+	db_products_tags=null;
+	tabGroups=null;
+	btnImage=null;
+	db_products_quantity_onhand=null;
+	tabPrices=null;
+	db_products_buy_price=null;
+	db_products_buy_discount=null;
+	db_products_buy_other_costs=null;
+	db_products_sell_markup=null;
+	markup_to_discount=null;
+	db_products_sell_price_ro=null;
+	db_products_price_decimals=null;
+	btnSaveProrduct=null;
+	db_products_stock_min=null;
+	db_products_stock_max=null;
+	db_products_buy_quantity_min=null;
+	db_products_price_formula=null;
+	db_products_price_date=null;
+	productPrices=null;
+	tabKit=null;
+	tabChartStatistics=null;
+	tabHistory=null;
+	tabReports=null;
+	grpExportImport=null;
+	btnProductsExport=null;
+	btnProductsImport=null;
+	chkWithoutPrices=null;
+	chkWebOnly=null;
+	boxExportImportCount=null;
+	btnProductGroupsExport=null;
+	btnProductGroupsImport=null;
+	btnUpdateWeb=null;
+	grpPrintPriceList=null;
+	chkPriceListWithVAT=null;
+	chkPriceListSellOnWeb=null;
+	btnPrintPriceList=null;
+	chkPriceListSellSales=null;
+	chkPriceListSellPDF=null;
+	tabTotals=null;
+	db_products_quantity_quoted_sales=null;
+	db_products_quantity_ordered_sales=null;
+	db_products_quantity_delivered=null;
+	db_products_quantity_invoiced_sales=null;
+	db_products_quantity_lost=null;
+	db_products_quantity_quoted_buys=null;
+	db_products_quantity_ordered_buys=null;
+	db_products_quantity_received=null;
+	db_products_quantity_invoiced_buys=null;
+	dbAction=null;
+	btnDbAction=null;
+	db_products_group_id=null;
+	
+constructor() {
+	base.constructor(10, 50, 800, 560, _tr("Edit Products"));
+begin();
+this->box(FL_FLAT_BOX);
+this->color(FL_BACKGROUND_COLOR);
+this->selection_color(FL_BACKGROUND_COLOR);
+this->labeltype(FL_NO_LABEL);
+this->labelfont(0);
+this->labelsize(14);
+this->labelcolor(FL_FOREGROUND_COLOR);
+this->align((FL_ALIGN_TOP));
+this->when(FL_WHEN_RELEASE);
+{ db_products_id =new Fl_Output(5, 5, 96, 25);
+  db_products_id->labeltype(FL_NO_LABEL);
+  db_products_id->labelsize(16);
+  db_products_id->textsize(16);
+  add_input_field_to_map("products", "id", db_products_id);
+} // Fl_Output* db_products_id
+{ db_products_description_ro =new Fl_Output(110, 5, 545, 25);
+  db_products_description_ro->labeltype(FL_NO_LABEL);
+  db_products_description_ro->labelsize(16);
+  db_products_description_ro->textsize(16);
+} // Fl_Output* db_products_description_ro
+{ db_products_mdate =new Fl_Output(666, 5, 130, 25);
+  db_products_mdate->labeltype(FL_NO_LABEL);
+  db_products_mdate->labelsize(16);
+  db_products_mdate->textsize(16);
+  add_input_field_to_map("products", "mdate", db_products_mdate);
+} // Fl_Output* db_products_mdate
+{ db_products_cdate =new Fl_Output(665, 35, 130, 25);
+  db_products_cdate->labeltype(FL_NO_LABEL);
+  db_products_cdate->labelsize(16);
+  db_products_cdate->textsize(16);
+  add_input_field_to_map("products", "cdate", db_products_cdate);
+} // Fl_Output* db_products_cdate
+{ tabs =new Fl_Tabs(5, 35, 790, 520);
+  tabs->selection_color(4);
+  tabs->labelsize(16);
+  tabs->labelcolor(FL_BACKGROUND2_COLOR);
+  { tabMain =new Fl_Group(5, 60, 790, 495, _tr("Main"));
+    tabMain->color(246);
+    tabMain->labelsize(16);
+    { db_products_reference_code =new Fl_Input(115, 70, 165, 25, _tr("Reference"));
+      db_products_reference_code->labelsize(16);
+      db_products_reference_code->textsize(16);
+      add_input_field_to_map("products", "reference_code", db_products_reference_code);
+    } // Fl_Input* db_products_reference_code
+    { db_products_supplier_code =new Fl_Input(380, 70, 165, 25, _tr("Ref. Supp."));
+      db_products_supplier_code->labelsize(16);
+      db_products_supplier_code->textsize(16);
+      add_input_field_to_map("products", "supplier_code", db_products_supplier_code);
+    } // Fl_Input* db_products_supplier_code
+    { db_products_bar_code =new Fl_Input(620, 70, 165, 25, _tr("Barcode"));
+      db_products_bar_code->labelsize(16);
+      db_products_bar_code->textsize(16);
+      add_input_field_to_map("products", "bar_code", db_products_bar_code);
+    } // Fl_Input* db_products_bar_code
+    { db_products_sell_description =new Fl_Input(115, 100, 670, 25, _tr("Description"));
+      db_products_sell_description->labelsize(16);
+      db_products_sell_description->textsize(16);
+      add_input_field_to_map("products", "sell_description", db_products_sell_description);
+    } // Fl_Input* db_products_sell_description
+    { db_products_buy_description =new Fl_Input(115, 130, 670, 25, _tr("Desc. Supp."));
+      db_products_buy_description->labelsize(16);
+      db_products_buy_description->textsize(16);
+      add_input_field_to_map("products", "buy_description", db_products_buy_description);
+    } // Fl_Input* db_products_buy_description
+    { db_products_sell_price =new Fl_Float_Input_Fmt(115, 160, 110, 25, _tr("Sales Price"));
+      db_products_sell_price->type(1);
+      db_products_sell_price->box(FL_DOWN_BOX);
+      db_products_sell_price->color(FL_BACKGROUND2_COLOR);
+      db_products_sell_price->selection_color(FL_SELECTION_COLOR);
+      db_products_sell_price->labeltype(FL_NORMAL_LABEL);
+      db_products_sell_price->labelfont(0);
+      db_products_sell_price->labelsize(16);
+      db_products_sell_price->labelcolor(FL_FOREGROUND_COLOR);
+      db_products_sell_price->textsize(16);
+      db_products_sell_price->align((FL_ALIGN_LEFT));
+      db_products_sell_price->when(FL_WHEN_RELEASE);
+      add_input_field_to_map("products", "sell_price", db_products_sell_price);
+    } // Fl_Float_Input_Fmt* db_products_sell_price
+    { db_products_measure_unit_id =new Fl_Choice_Int(370, 160, 110, 25, _tr("Measure Unit"));
+      db_products_measure_unit_id->box(FL_FLAT_BOX);
+      db_products_measure_unit_id->down_box(FL_BORDER_BOX);
+      db_products_measure_unit_id->color(FL_BACKGROUND_COLOR);
+      db_products_measure_unit_id->selection_color(FL_SELECTION_COLOR);
+      db_products_measure_unit_id->labeltype(FL_NORMAL_LABEL);
+      db_products_measure_unit_id->labelfont(0);
+      db_products_measure_unit_id->labelsize(16);
+      db_products_measure_unit_id->labelcolor(FL_FOREGROUND_COLOR);
+      db_products_measure_unit_id->textsize(16);
+      db_products_measure_unit_id->align((FL_ALIGN_LEFT));
+      db_products_measure_unit_id->when(FL_WHEN_RELEASE);
+      add_input_field_to_map("products", "measure_unit_id", db_products_measure_unit_id);
+    } // Fl_Choice_Int* db_products_measure_unit_id
+    { db_products_sales_tax_id =new Fl_Choice_Int(115, 190, 110, 25, _tr("V.A.T."));
+      db_products_sales_tax_id->box(FL_FLAT_BOX);
+      db_products_sales_tax_id->down_box(FL_BORDER_BOX);
+      db_products_sales_tax_id->color(FL_BACKGROUND_COLOR);
+      db_products_sales_tax_id->selection_color(FL_SELECTION_COLOR);
+      db_products_sales_tax_id->labeltype(FL_NORMAL_LABEL);
+      db_products_sales_tax_id->labelfont(0);
+      db_products_sales_tax_id->labelsize(16);
+      db_products_sales_tax_id->labelcolor(FL_FOREGROUND_COLOR);
+      db_products_sales_tax_id->textsize(16);
+      db_products_sales_tax_id->align((FL_ALIGN_LEFT));
+      db_products_sales_tax_id->when(FL_WHEN_RELEASE);
+      add_input_field_to_map("products", "sales_tax_id", db_products_sales_tax_id);
+    } // Fl_Choice_Int* db_products_sales_tax_id
+    { db_products_warranty_id =new Fl_Choice_Int(370, 190, 110, 25, _tr("Warranty"));
+      db_products_warranty_id->box(FL_FLAT_BOX);
+      db_products_warranty_id->down_box(FL_BORDER_BOX);
+      db_products_warranty_id->color(FL_BACKGROUND_COLOR);
+      db_products_warranty_id->selection_color(FL_SELECTION_COLOR);
+      db_products_warranty_id->labeltype(FL_NORMAL_LABEL);
+      db_products_warranty_id->labelfont(0);
+      db_products_warranty_id->labelsize(16);
+      db_products_warranty_id->labelcolor(FL_FOREGROUND_COLOR);
+      db_products_warranty_id->textsize(16);
+      db_products_warranty_id->align((FL_ALIGN_LEFT));
+      db_products_warranty_id->when(FL_WHEN_RELEASE);
+      add_input_field_to_map("products", "warranty_id", db_products_warranty_id);
+    } // Fl_Choice_Int* db_products_warranty_id
+    { local o = db_products_sell_quantity_min =new Fl_Float_Input(370, 250, 110, 25, _tr("Sell Min. Qty."));
+      db_products_sell_quantity_min->type(1);
+      db_products_sell_quantity_min->labelsize(16);
+      db_products_sell_quantity_min->textsize(16);
+      o->decimal_places(-6);
+      add_input_field_to_map("products", "sell_quantity_min", db_products_sell_quantity_min);
+    } // Fl_Float_Input* db_products_sell_quantity_min
+    { local o = db_products_units_by_package =new Fl_Float_Input(370, 280, 110, 25, _tr("Units by Pack."));
+      db_products_units_by_package->type(1);
+      db_products_units_by_package->labelsize(16);
+      db_products_units_by_package->textsize(16);
+      o->decimal_places(-6);
+      add_input_field_to_map("products", "units_by_package", db_products_units_by_package);
+    } // Fl_Float_Input* db_products_units_by_package
+    { local o = db_products_weight =new Fl_Float_Input(370, 220, 110, 25, _tr("Weight"));
+      db_products_weight->type(1);
+      db_products_weight->labelsize(16);
+      db_products_weight->textsize(16);
+      o->decimal_places(-6);
+      add_input_field_to_map("products", "weight", db_products_weight);
+    } // Fl_Float_Input* db_products_weight
+    { db_products_sell_without_stock =new Fl_Check_Button(10, 250, 215, 25, _tr("Sell without stock"));
+      db_products_sell_without_stock->down_box(FL_DOWN_BOX);
+      db_products_sell_without_stock->labelsize(16);
+      add_input_field_to_map("products", "sell_without_stock", db_products_sell_without_stock);
+    } // Fl_Check_Button* db_products_sell_without_stock
+    { db_products_is_active =new Fl_Check_Button(10, 280, 110, 25, _tr("Active"));
+      db_products_is_active->down_box(FL_DOWN_BOX);
+      db_products_is_active->labelsize(16);
+      add_input_field_to_map("products", "is_active", db_products_is_active);
+    } // Fl_Check_Button* db_products_is_active
+    { db_products_show_on_sales =new Fl_Check_Button(10, 310, 105, 25, _tr("Sales"));
+      db_products_show_on_sales->down_box(FL_DOWN_BOX);
+      db_products_show_on_sales->labelsize(16);
+      add_input_field_to_map("products", "show_on_sales", db_products_show_on_sales);
+    } // Fl_Check_Button* db_products_show_on_sales
+    { db_products_show_on_buys =new Fl_Check_Button(10, 340, 95, 25, _tr("Buys"));
+      db_products_show_on_buys->down_box(FL_DOWN_BOX);
+      db_products_show_on_buys->labelsize(16);
+      add_input_field_to_map("products", "show_on_buys", db_products_show_on_buys);
+    } // Fl_Check_Button* db_products_show_on_buys
+    { db_products_show_on_web =new Fl_Check_Button(115, 310, 120, 25, _tr("Web"));
+      db_products_show_on_web->down_box(FL_DOWN_BOX);
+      db_products_show_on_web->labelsize(16);
+      add_input_field_to_map("products", "show_on_web", db_products_show_on_web);
+    } // Fl_Check_Button* db_products_show_on_web
+    { db_products_show_price_on_web =new Fl_Check_Button(115, 340, 100, 25, _tr("Web price"));
+      db_products_show_price_on_web->down_box(FL_DOWN_BOX);
+      db_products_show_price_on_web->labelsize(16);
+      add_input_field_to_map("products", "show_price_on_web", db_products_show_price_on_web);
+    } // Fl_Check_Button* db_products_show_price_on_web
+    { local o =new Fl_Group(675, 402, 110, 143);
+      { local o =new Fl_Box(675, 402, 110, 68, _tr("Spacer"));
+        o->labeltype(FL_NO_LABEL);
+        Fl_Group.current()->resizable(o);
+      } // Fl_Box* o
+      { dbAction = new Fl_Button(675, 520, 110, 25);
+        dbAction->label(_tr("Action"));
+        dbAction->down_box(FL_BORDER_BOX);
+        dbAction->labelsize(16);
+        dbAction->textsize(16);
+        dbAction->align((FL_ALIGN_TOP));
+      } // Fl_Choice* dbAction
+      { btnDbAction = new My_Fl_Return_Button(675, 470, 110, 25, _tr("Action"));
+        btnDbAction->labelsize(16);
+      } // Fl_Button* btnDbAction
+      o->end();
+    } // Fl_Group* o
+    { local o =new Fl_Tabs(10, 370, 650, 181);
+      o->selection_color(4);
+      o->labelsize(16);
+      o->labelcolor(FL_BACKGROUND2_COLOR);
+      { tabNotes =new Fl_Group(10, 400, 650, 150, _tr("Notes"));
+        tabNotes->labelsize(16);
+        { db_products_sell_notes =new Fl_Text_Editor_Buffered(10, 400, 650, 150);
+          db_products_sell_notes->type(4);
+          db_products_sell_notes->box(FL_DOWN_BOX);
+          db_products_sell_notes->color(FL_BACKGROUND2_COLOR);
+          db_products_sell_notes->selection_color(FL_SELECTION_COLOR);
+          db_products_sell_notes->labeltype(FL_NO_LABEL);
+          db_products_sell_notes->labelfont(0);
+          db_products_sell_notes->labelsize(16);
+          db_products_sell_notes->labelcolor(FL_FOREGROUND_COLOR);
+          db_products_sell_notes->textsize(16);
+          db_products_sell_notes->align((FL_ALIGN_TOP_LEFT));
+          db_products_sell_notes->when(FL_WHEN_RELEASE);
+          Fl_Group.current()->resizable(db_products_sell_notes);
+          add_input_field_to_map("products", "sell_notes", db_products_sell_notes);
+        } // Fl_Text_Editor_Buffered* db_products_sell_notes
+        tabNotes->end();
+      } // Fl_Group* tabNotes
+      { tabNotesSupplier =new Fl_Group(10, 400, 650, 150, _tr("Notes Supplier"));
+        tabNotesSupplier->labelsize(16);
+        tabNotesSupplier->hide();
+        { db_products_buy_notes =new Fl_Text_Editor_Buffered(10, 400, 650, 150);
+          db_products_buy_notes->type(4);
+          db_products_buy_notes->box(FL_DOWN_BOX);
+          db_products_buy_notes->color(FL_BACKGROUND2_COLOR);
+          db_products_buy_notes->selection_color(FL_SELECTION_COLOR);
+          db_products_buy_notes->labeltype(FL_NO_LABEL);
+          db_products_buy_notes->labelfont(0);
+          db_products_buy_notes->labelsize(16);
+          db_products_buy_notes->labelcolor(FL_FOREGROUND_COLOR);
+          db_products_buy_notes->textsize(16);
+          db_products_buy_notes->align((FL_ALIGN_TOP_LEFT));
+          db_products_buy_notes->when(FL_WHEN_RELEASE);
+          Fl_Group.current()->resizable(db_products_buy_notes);
+          add_input_field_to_map("products", "buy_notes", db_products_buy_notes);
+        } // Fl_Text_Editor_Buffered* db_products_buy_notes
+        tabNotesSupplier->end();
+      } // Fl_Group* tabNotesSupplier
+      { tabTags =new Fl_Group(10, 400, 650, 150, _tr("Tags"));
+        tabTags->labelsize(16);
+        tabTags->hide();
+        { db_products_tags =new Fl_Text_Editor_Buffered(10, 400, 650, 150);
+          db_products_tags->type(4);
+          db_products_tags->box(FL_DOWN_BOX);
+          db_products_tags->color(FL_BACKGROUND2_COLOR);
+          db_products_tags->selection_color(FL_SELECTION_COLOR);
+          db_products_tags->labeltype(FL_NO_LABEL);
+          db_products_tags->labelfont(0);
+          db_products_tags->labelsize(16);
+          db_products_tags->labelcolor(FL_FOREGROUND_COLOR);
+          db_products_tags->textsize(16);
+          db_products_tags->align((FL_ALIGN_TOP_LEFT));
+          db_products_tags->when(FL_WHEN_RELEASE);
+          Fl_Group.current()->resizable(db_products_tags);
+          add_input_field_to_map("products", "tags", db_products_tags);
+        } // Fl_Text_Editor_Buffered* db_products_tags
+        tabTags->end();
+      } // Fl_Group* tabTags
+      { tabGroups =new Fl_Group(10, 395, 650, 156, _tr("Groups"));
+        tabGroups->hide();
+        { db_products_group_id = new Flu_Tree_Browser(10, 400, 650, 150);
+          db_products_group_id->box(FL_DOWN_BOX);
+          db_products_group_id->color(FL_BACKGROUND2_COLOR);
+          db_products_group_id->selection_color(FL_SELECTION_COLOR);
+          db_products_group_id->labeltype(FL_NORMAL_LABEL);
+          db_products_group_id->labelfont(0);
+          db_products_group_id->labelsize(16);
+          db_products_group_id->labelcolor(FL_FOREGROUND_COLOR);
+          db_products_group_id->align((FL_ALIGN_TOP));
+          db_products_group_id->when(FL_WHEN_CHANGED);
+          add_input_field_to_map("products", "group_id", db_products_group_id);
+        } // Flu_Tree_Browser* db_products_group_id
+        tabGroups->end();
+      } // Fl_Group* tabGroups
+      o->end();
+    } // Fl_Tabs* o
+    { btnImage =new Fl_Image_Box(485, 158, 300, 232);
+      btnImage->box(FL_ENGRAVED_BOX);
+      btnImage->color(FL_BACKGROUND2_COLOR);
+      btnImage->selection_color(FL_BACKGROUND_COLOR);
+      btnImage->labeltype(FL_NORMAL_LABEL);
+      btnImage->labelfont(0);
+      btnImage->labelsize(14);
+      btnImage->labelcolor(FL_FOREGROUND_COLOR);
+      btnImage->align((FL_ALIGN_CLIP|FL_ALIGN_INSIDE));
+      btnImage->when(FL_WHEN_RELEASE);
+    } // Fl_Image_Box* btnImage
+    { local o =new Fl_Check_Button(370, 375, 102, 25, _tr("Wrap lines"));
+      o->down_box(FL_DOWN_BOX);
+      o->value(1);
+      o->labelsize(16);
+      o->callback(cb_Wrap);
+    } // Fl_Check_Button* o
+    { local o = db_products_quantity_onhand =new Fl_Float_Input(115, 220, 110, 25, _tr("Onhand"));
+      db_products_quantity_onhand->type(1);
+      db_products_quantity_onhand->labelsize(16);
+      db_products_quantity_onhand->textsize(16);
+      o->decimal_places(-6);
+      add_input_field_to_map("products", "quantity_onhand", db_products_quantity_onhand);
+    } // Fl_Float_Input* db_products_quantity_onhand
+    tabMain->end();
+    Fl_Group.current()->resizable(tabMain);
+  } // Fl_Group* tabMain
+  { tabPrices =new Fl_Group(5, 60, 790, 495, _tr("Prices"));
+    tabPrices->color(246);
+    tabPrices->labelsize(16);
+    tabPrices->hide();
+    { local o =new Fl_Group(15, 88, 770, 201, _tr("Sales Price"));
+      o->box(FL_UP_BOX);
+      o->color(166);
+      o->labelsize(16);
+      { db_products_buy_price =new Fl_Float_Input_Fmt(25, 115, 115, 25, _tr("Buy $"));
+        db_products_buy_price->type(1);
+        db_products_buy_price->box(FL_DOWN_BOX);
+        db_products_buy_price->color(FL_BACKGROUND2_COLOR);
+        db_products_buy_price->selection_color(FL_SELECTION_COLOR);
+        db_products_buy_price->labeltype(FL_NORMAL_LABEL);
+        db_products_buy_price->labelfont(0);
+        db_products_buy_price->labelsize(16);
+        db_products_buy_price->labelcolor(FL_FOREGROUND_COLOR);
+        db_products_buy_price->textsize(16);
+        db_products_buy_price->align((FL_ALIGN_TOP_LEFT));
+        db_products_buy_price->when(FL_WHEN_RELEASE);
+        add_input_field_to_map("products", "buy_price", db_products_buy_price);
+      } // Fl_Float_Input_Fmt* db_products_buy_price
+      { local o = db_products_buy_discount =new Fl_Float_Input_Fmt(151, 115, 115, 25, _tr("Buy Disc. %"));
+        db_products_buy_discount->type(1);
+        db_products_buy_discount->box(FL_DOWN_BOX);
+        db_products_buy_discount->color(FL_BACKGROUND2_COLOR);
+        db_products_buy_discount->selection_color(FL_SELECTION_COLOR);
+        db_products_buy_discount->labeltype(FL_NORMAL_LABEL);
+        db_products_buy_discount->labelfont(0);
+        db_products_buy_discount->labelsize(16);
+        db_products_buy_discount->labelcolor(FL_FOREGROUND_COLOR);
+        db_products_buy_discount->textsize(16);
+        db_products_buy_discount->align((FL_ALIGN_TOP_LEFT));
+        db_products_buy_discount->when(FL_WHEN_RELEASE);
+        add_input_field_to_map("products", "buy_discount", db_products_buy_discount);
+        o->decimal_places(-6);
+      } // Fl_Float_Input_Fmt* db_products_buy_discount
+      { db_products_buy_other_costs =new Fl_Float_Input_Fmt(278, 115, 115, 25, _tr("Other Costs $"));
+        db_products_buy_other_costs->type(1);
+        db_products_buy_other_costs->box(FL_DOWN_BOX);
+        db_products_buy_other_costs->color(FL_BACKGROUND2_COLOR);
+        db_products_buy_other_costs->selection_color(FL_SELECTION_COLOR);
+        db_products_buy_other_costs->labeltype(FL_NORMAL_LABEL);
+        db_products_buy_other_costs->labelfont(0);
+        db_products_buy_other_costs->labelsize(16);
+        db_products_buy_other_costs->labelcolor(FL_FOREGROUND_COLOR);
+        db_products_buy_other_costs->textsize(16);
+        db_products_buy_other_costs->align((FL_ALIGN_TOP_LEFT));
+        db_products_buy_other_costs->when(FL_WHEN_RELEASE);
+        add_input_field_to_map("products", "buy_other_costs", db_products_buy_other_costs);
+      } // Fl_Float_Input_Fmt* db_products_buy_other_costs
+      { local o = db_products_sell_markup =new Fl_Float_Input_Fmt(404, 115, 115, 25, _tr("Markup %"));
+        db_products_sell_markup->type(1);
+        db_products_sell_markup->box(FL_DOWN_BOX);
+        db_products_sell_markup->color(FL_BACKGROUND2_COLOR);
+        db_products_sell_markup->selection_color(FL_SELECTION_COLOR);
+        db_products_sell_markup->labeltype(FL_NORMAL_LABEL);
+        db_products_sell_markup->labelfont(0);
+        db_products_sell_markup->labelsize(16);
+        db_products_sell_markup->labelcolor(FL_FOREGROUND_COLOR);
+        db_products_sell_markup->textsize(16);
+        db_products_sell_markup->align((FL_ALIGN_TOP_LEFT));
+        db_products_sell_markup->when(FL_WHEN_RELEASE);
+        add_input_field_to_map("products", "sell_markup", db_products_sell_markup);
+        //o->decimal_places(-6);
+      } // Fl_Float_Input_Fmt* db_products_sell_markup
+      { local o = markup_to_discount =new Fl_Float_Input_Fmt(531, 115, 115, 25, _tr("Margin %"));
+        markup_to_discount->type(1);
+        markup_to_discount->box(FL_DOWN_BOX);
+        markup_to_discount->color(FL_BACKGROUND2_COLOR);
+        markup_to_discount->selection_color(FL_SELECTION_COLOR);
+        markup_to_discount->labeltype(FL_NORMAL_LABEL);
+        markup_to_discount->labelfont(0);
+        markup_to_discount->labelsize(16);
+        markup_to_discount->labelcolor(FL_FOREGROUND_COLOR);
+        markup_to_discount->textsize(16);
+        markup_to_discount->align((FL_ALIGN_TOP_LEFT));
+        markup_to_discount->when(FL_WHEN_RELEASE);
+        //o->decimal_places(-6);
+      } // Fl_Float_Input_Fmt* markup_to_discount
+      { db_products_sell_price_ro =new Fl_Float_Input_Fmt(658, 115, 115, 25, _tr("Sales $"));
+        db_products_sell_price_ro->type(1);
+        db_products_sell_price_ro->box(FL_DOWN_BOX);
+        db_products_sell_price_ro->color(FL_BACKGROUND2_COLOR);
+        db_products_sell_price_ro->selection_color(FL_SELECTION_COLOR);
+        db_products_sell_price_ro->labeltype(FL_NORMAL_LABEL);
+        db_products_sell_price_ro->labelfont(0);
+        db_products_sell_price_ro->labelsize(16);
+        db_products_sell_price_ro->labelcolor(FL_FOREGROUND_COLOR);
+        db_products_sell_price_ro->textsize(16);
+        db_products_sell_price_ro->align((FL_ALIGN_TOP_LEFT));
+        db_products_sell_price_ro->when(FL_WHEN_RELEASE);
+      } // Fl_Float_Input_Fmt* db_products_sell_price_ro
+      { local o = db_products_price_decimals =new Fl_Int_Input(530, 150, 30, 25, _tr("Decimals for calculation"));
+        db_products_price_decimals->type(2);
+        db_products_price_decimals->labelfont(1);
+        db_products_price_decimals->labelsize(16);
+        db_products_price_decimals->textfont(1);
+        db_products_price_decimals->textsize(16);
+        add_input_field_to_map("products", "price_decimals", db_products_price_decimals);
+        //o->decimal_places(-6);
+      } // Fl_Int_Input* db_products_price_decimals
+      { btnSaveProrduct =new Fl_Button(662, 150, 111, 25, _tr("Save"));
+        btnSaveProrduct->labelsize(16);
+      } // Fl_Button* btnSaveProrduct
+      { local o = db_products_stock_min =new Fl_Float_Input(665, 195, 110, 25, _tr("Stock Min."));
+        db_products_stock_min->type(1);
+        db_products_stock_min->labelsize(16);
+        db_products_stock_min->textsize(16);
+        add_input_field_to_map("products", "stock_min", db_products_stock_min);
+        o->decimal_places(-6);
+      } // Fl_Float_Input* db_products_stock_min
+      { local o = db_products_stock_max =new Fl_Float_Input(665, 225, 110, 25, _tr("Stock Max."));
+        db_products_stock_max->type(1);
+        db_products_stock_max->labelsize(16);
+        db_products_stock_max->textsize(16);
+        add_input_field_to_map("products", "stock_max", db_products_stock_max);
+        o->decimal_places(-6);
+      } // Fl_Float_Input* db_products_stock_max
+      { local o = db_products_buy_quantity_min =new Fl_Float_Input(665, 255, 110, 25, _tr("Buy Min. Qty."));
+        db_products_buy_quantity_min->type(1);
+        db_products_buy_quantity_min->labelsize(16);
+        db_products_buy_quantity_min->textsize(16);
+        add_input_field_to_map("products", "buy_quantity_min", db_products_buy_quantity_min);
+        o->decimal_places(-6);
+      } // Fl_Float_Input* db_products_buy_quantity_min
+      { db_products_price_formula =new Fl_Input(25, 197, 495, 83, _tr("Price formula"));
+        db_products_price_formula->type(4);
+        db_products_price_formula->labelsize(16);
+        db_products_price_formula->textsize(16);
+        db_products_price_formula->align((FL_ALIGN_TOP_LEFT));
+        add_input_field_to_map("products", "price_formula", db_products_price_formula);
+      } // Fl_Input* db_products_price_formula
+      { db_products_price_date =new Fl_Output(25, 150, 130, 25, _tr("Last Update"));
+        db_products_price_date->labelsize(16);
+        db_products_price_date->textsize(16);
+        db_products_price_date->align((FL_ALIGN_RIGHT));
+      } // Fl_Output* db_products_price_date
+      o->end();
+    } // Fl_Group* o
+    { local o =new Fl_Box(15, 290, 770, 40, _tr("Spacer"));
+      o->labeltype(FL_NO_LABEL);
+      Fl_Group.current()->resizable(o);
+    } // Fl_Box* o
+    { productPrices =new Fl_Group(15, 332, 770, 212);
+      productPrices->box(FL_UP_BOX);
+      productPrices->color(166);
+      productPrices->labeltype(FL_NO_LABEL);
+      productPrices->labelsize(16);
+      productPrices->end();
+    } // Fl_Group* productPrices
+    tabPrices->end();
+  } // Fl_Group* tabPrices
+  { tabKit =new Fl_Group(5, 59, 790, 495, _tr("Kit"));
+    tabKit->color(246);
+    tabKit->labelsize(16);
+    tabKit->hide();
+    tabKit->end();
+  } // Fl_Group* tabKit
+  { tabChartStatistics =new Fl_Group(5, 60, 790, 495, _tr("Statistics"));
+    tabChartStatistics->color(246);
+    tabChartStatistics->labelsize(16);
+    tabChartStatistics->hide();
+    tabChartStatistics->end();
+  } // Fl_Group* tabChartStatistics
+  { tabHistory =new Fl_Group(5, 60, 790, 495, _tr("History"));
+    tabHistory->color(246);
+    tabHistory->labelsize(16);
+    tabHistory->hide();
+    tabHistory->end();
+  } // Fl_Group* tabHistory
+  { tabReports =new Fl_Group(5, 60, 790, 495, _tr("Reports"));
+    tabReports->box(FL_UP_BOX);
+    tabReports->color(246);
+    tabReports->labelsize(16);
+    tabReports->hide();
+    { grpExportImport =new Fl_Group(15, 465, 770, 80, _tr("Export / Import"));
+      grpExportImport->box(FL_ENGRAVED_FRAME);
+      grpExportImport->labelsize(16);
+      { btnProductsExport =new Fl_Button(25, 475, 175, 25, _tr("Products Export"));
+        btnProductsExport->labelsize(16);
+      } // Fl_Button* btnProductsExport
+      { btnProductsImport =new Fl_Button(25, 510, 175, 25, _tr("Products Import"));
+        btnProductsImport->labelsize(16);
+      } // Fl_Button* btnProductsImport
+      { chkWithoutPrices =new Fl_Check_Button(225, 480, 150, 25, _tr("Withouth Prices"));
+        chkWithoutPrices->down_box(FL_DOWN_BOX);
+        chkWithoutPrices->labelsize(16);
+      } // Fl_Check_Button* chkWithoutPrices
+      { chkWebOnly =new Fl_Check_Button(225, 510, 150, 25, _tr("WEB Only"));
+        chkWebOnly->down_box(FL_DOWN_BOX);
+        chkWebOnly->labelsize(16);
+      } // Fl_Check_Button* chkWebOnly
+      { boxExportImportCount =new Fl_Box(405, 499, 42, 25, _tr("0"));
+        boxExportImportCount->labelsize(16);
+      } // Fl_Box* boxExportImportCount
+      { btnProductGroupsExport =new Fl_Button(555, 475, 220, 25, _tr("Product Groups Export"));
+        btnProductGroupsExport->labelsize(16);
+      } // Fl_Button* btnProductGroupsExport
+      { btnProductGroupsImport =new Fl_Button(555, 510, 220, 25, _tr("Product Groups import"));
+        btnProductGroupsImport->labelsize(16);
+      } // Fl_Button* btnProductGroupsImport
+      grpExportImport->end();
+    } // Fl_Group* grpExportImport
+    { btnUpdateWeb =new Fl_Button(610, 70, 175, 25, _tr("Update WEB"));
+      btnUpdateWeb->labelsize(16);
+    } // Fl_Button* btnUpdateWeb
+    { grpPrintPriceList =new Fl_Group(10, 85, 195, 165, _tr("Price List"));
+      grpPrintPriceList->box(FL_ENGRAVED_FRAME);
+      grpPrintPriceList->labelsize(16);
+      { chkPriceListWithVAT =new Fl_Check_Button(20, 95, 175, 25, _tr("With V.A.T."));
+        chkPriceListWithVAT->down_box(FL_DOWN_BOX);
+        chkPriceListWithVAT->labelsize(16);
+      } // Fl_Check_Button* chkPriceListWithVAT
+      { chkPriceListSellOnWeb =new Fl_Check_Button(20, 125, 170, 25, _tr("Sell on WEB"));
+        chkPriceListSellOnWeb->down_box(FL_DOWN_BOX);
+        chkPriceListSellOnWeb->labelsize(16);
+      } // Fl_Check_Button* chkPriceListSellOnWeb
+      { btnPrintPriceList =new Fl_Button(20, 215, 175, 25, _tr("Print"));
+        btnPrintPriceList->labelsize(16);
+      } // Fl_Button* btnPrintPriceList
+      { chkPriceListSellSales =new Fl_Check_Button(20, 155, 175, 25, _tr("Sales"));
+        chkPriceListSellSales->down_box(FL_DOWN_BOX);
+        chkPriceListSellSales->labelsize(16);
+      } // Fl_Check_Button* chkPriceListSellSales
+      { chkPriceListSellPDF =new Fl_Check_Button(20, 185, 175, 25, _tr("PDF"));
+        chkPriceListSellPDF->down_box(FL_DOWN_BOX);
+        chkPriceListSellPDF->labelsize(16);
+      } // Fl_Check_Button* chkPriceListSellPDF
+      grpPrintPriceList->end();
+    } // Fl_Group* grpPrintPriceList
+    tabReports->end();
+  } // Fl_Group* tabReports
+  { tabTotals =new Fl_Group(5, 60, 790, 495, _tr("Totals"));
+    tabTotals->color(246);
+    tabTotals->labelsize(16);
+    tabTotals->hide();
+    { local o = db_products_quantity_quoted_sales =new Fl_Float_Input(220, 80, 110, 25, _tr("Quantity quoted sales"));
+      db_products_quantity_quoted_sales->type(1);
+      db_products_quantity_quoted_sales->labelsize(16);
+      db_products_quantity_quoted_sales->textsize(16);
+      o->decimal_places(-6);
+      add_input_field_to_map("products", "quantity_quoted_sales", db_products_quantity_quoted_sales);
+    } // Fl_Float_Input* db_products_quantity_quoted_sales
+    { local o = db_products_quantity_ordered_sales =new Fl_Float_Input(220, 115, 110, 25, _tr("Quantity ordered sales"));
+      db_products_quantity_ordered_sales->type(1);
+      db_products_quantity_ordered_sales->labelsize(16);
+      db_products_quantity_ordered_sales->textsize(16);
+      o->decimal_places(-6);
+      add_input_field_to_map("products", "quantity_ordered_sales", db_products_quantity_ordered_sales);
+    } // Fl_Float_Input* db_products_quantity_ordered_sales
+    { local o = db_products_quantity_delivered =new Fl_Float_Input(220, 150, 110, 25, _tr("Quantity delivered"));
+      db_products_quantity_delivered->type(1);
+      db_products_quantity_delivered->labelsize(16);
+      db_products_quantity_delivered->textsize(16);
+      o->decimal_places(-6);
+      add_input_field_to_map("products", "quantity_delivered", db_products_quantity_delivered);
+    } // Fl_Float_Input* db_products_quantity_delivered
+    { local o = db_products_quantity_invoiced_sales =new Fl_Float_Input(220, 185, 110, 25, _tr("Quantity invoiced sales"));
+      db_products_quantity_invoiced_sales->type(1);
+      db_products_quantity_invoiced_sales->labelsize(16);
+      db_products_quantity_invoiced_sales->textsize(16);
+      o->decimal_places(-6);
+      add_input_field_to_map("products", "quantity_invoiced_sales", db_products_quantity_invoiced_sales);
+    } // Fl_Float_Input* db_products_quantity_invoiced_sales
+    { local o = db_products_quantity_lost =new Fl_Float_Input(220, 220, 110, 25, _tr("Quantity lost"));
+      db_products_quantity_lost->type(1);
+      db_products_quantity_lost->labelsize(16);
+      db_products_quantity_lost->textsize(16);
+      o->decimal_places(-6);
+      add_input_field_to_map("products", "quantity_lost", db_products_quantity_lost);
+    } // Fl_Float_Input* db_products_quantity_lost
+    { local o = db_products_quantity_quoted_buys =new Fl_Float_Input(665, 85, 110, 25, _tr("Quantity quoted buys"));
+      db_products_quantity_quoted_buys->type(1);
+      db_products_quantity_quoted_buys->labelsize(16);
+      db_products_quantity_quoted_buys->textsize(16);
+      o->decimal_places(-6);
+      add_input_field_to_map("products", "quantity_quoted_buys", db_products_quantity_quoted_buys);
+    } // Fl_Float_Input* db_products_quantity_quoted_buys
+    { local o = db_products_quantity_ordered_buys =new Fl_Float_Input(665, 120, 110, 25, _tr("Quantity ordered buys"));
+      db_products_quantity_ordered_buys->type(1);
+      db_products_quantity_ordered_buys->labelsize(16);
+      db_products_quantity_ordered_buys->textsize(16);
+      o->decimal_places(-6);
+      add_input_field_to_map("products", "quantity_ordered_buys", db_products_quantity_ordered_buys);
+    } // Fl_Float_Input* db_products_quantity_ordered_buys
+    { local o = db_products_quantity_received =new Fl_Float_Input(665, 155, 110, 25, _tr("Quantity received"));
+      db_products_quantity_received->type(1);
+      db_products_quantity_received->labelsize(16);
+      db_products_quantity_received->textsize(16);
+      o->decimal_places(-6);
+      add_input_field_to_map("products", "quantity_received", db_products_quantity_received);
+    } // Fl_Float_Input* db_products_quantity_received
+    { local o = db_products_quantity_invoiced_buys =new Fl_Float_Input(665, 190, 110, 25, _tr("Quantity invoiced buys"));
+      db_products_quantity_invoiced_buys->type(1);
+      db_products_quantity_invoiced_buys->labelsize(16);
+      db_products_quantity_invoiced_buys->textsize(16);
+      o->decimal_places(-6);
+      add_input_field_to_map("products", "quantity_invoiced_buys", db_products_quantity_invoiced_buys);
+    } // Fl_Float_Input* db_products_quantity_invoiced_buys
+    tabTotals->end();
+  } // Fl_Group* tabTotals
+  tabs->end();
+  Fl_Group.current()->resizable(tabs);
+} // Fl_Tabs* tabs
+end();
+}
+
+function cb_Wrap(){}
+function cb_btnSearch(){}
+function cb_btnSelect(){}
+function cb_btnUpdate(){}
+function cb_btnInsert(){}
+}
+//local win = new MainWindow(10, 50, 330, 320, "OURBIZ");
+local win = new BaseReportA4();
+win->resizable(win);
+win->show_main();
+
+math.number_format_set_dec_point(",");
+math.number_format_set_thousand_sep(".");
+Fl_Input.default_number_format("\0x02,.");
+//Fl:scheme("plastic");
+Fl.scheme("gtk+");
+//use partial match to find verdana font
+Fl.visual(FL_RGB);
+//allow arrow keys navigation
+Fl.option(Fl.OPTION_ARROW_FOCUS, true);
+
+Fl.run();

+ 189 - 0
samples/test-fltk.nut

@@ -0,0 +1,189 @@
+function setAppFont(fontName)
+{
+    local my_font, numfonts, font1, font2;
+ 
+    numfonts=Fl.set_fonts();
+ 
+    for(local i=0; i < numfonts; ++i)
+    {
+        my_font=Fl.get_font(i); // get the name of the current font
+        if( my_font )
+        {
+            local font = Fl.get_font_name(i);
+            //print(my_font_name, my_font_attr)
+            if( font.name )
+            {
+                if( font.name.find(fontName) )
+                {
+                    if( font.attributes != 0 )
+                    {
+                        if (( font.attributes & FL_BOLD) &&
+                                ( font.attributes & FL_ITALIC))
+                        {
+                            font1 = FL_HELVETICA_BOLD_ITALIC;
+                            font2 = FL_TIMES_BOLD_ITALIC;
+                        }
+                        else if(  font.attributes & FL_BOLD )
+                        {
+                            font1 = FL_HELVETICA_BOLD;
+                            font2 = FL_TIMES_BOLD;
+                        }
+                        else if(  font.attributes & FL_ITALIC )
+                        {
+                            font1 = FL_HELVETICA_ITALIC;
+                            font2 = FL_TIMES_ITALIC;
+                        }
+                    }
+                    else
+                    {
+                        font1 = FL_HELVETICA;
+                        font2 = FL_TIMES;
+                    }
+                    //print(bit.band(my_font_attr, FL_BOLD), my_font_attr, font1, font2)
+                    Fl.set_font(font1, i);
+                    Fl.set_font(font2, i);
+                    //break
+                }
+            }
+        }
+    }
+}
+
+function widget_focus_changing_Match(widget){
+	if (widget){
+		local ttype = widget.classId();
+		print(ttype);
+		if (ttype.find("_Input")) return 1;
+		if (ttype.find("_Browser")) return 2;
+		if (ttype.find("_Tree")) return false;
+		if (ttype.find("_Editor")) return 3;
+		local parent = widget.parent();
+		if (parent && parent.classId().find("_Choice")){
+			return 3;
+		}
+	}
+	return false;
+}
+		
+function fltk_focus_changing(wfrom, wto){
+	//print(wfrom.classId(), wto.classId());
+	//print(wfrom, wto);
+	
+	if (widget_focus_changing_Match(wfrom)){
+		wfrom.color(FL_WHITE);
+		wfrom.redraw();
+	}
+	local wt = widget_focus_changing_Match(wto);
+	if (wt) {
+		wto.color(FL_YELLOW);
+		wto.redraw();
+		if (wt == 1) wto.position(0,10000);
+	}
+	
+	return 0;
+}
+
+math.number_format_set_dec_point(",");
+math.number_format_set_thousand_sep(".");
+Fl_Input.default_number_format("\0x02,.");
+//Fl:scheme("plastic");
+Fl.scheme("gtk+");
+//use partial match to find verdana font
+Fl.visual(FL_RGB);
+//allow arrow keys navigation
+Fl.option(Fl.OPTION_ARROW_FOCUS, true);
+setAppFont("erdana");
+//Fl.add_focus_changing_handler(fltk_focus_changing);
+
+local myWindows = [];
+
+
+class MyWindow extends Fl_Window {
+	constructor(px, py, pw, ph, pl){
+		base.constructor(px, py, pw, ph, pl);
+	}
+	function hide(){
+		print("Before base hide");
+		base.hide();
+		Fl.delete_widget(this);
+		print("After base hide");
+	}
+	function on_close(){
+		print("on_close");
+	}
+}
+
+class MyInput extends Fl_Input {
+	constructor(px, py, pw, ph, pl){
+		base.constructor(px, py, pw, ph, pl);
+	}
+	function handle(event){
+		local rc = base.handle(event);
+		print("After base event", rc, event);
+		return rc;
+	}
+}
+
+
+function MyNewWin(){
+	//local win = Fl_Double_Window(100, 100, 200,400, "My FLTK Window");
+	local win = new MyWindow(100, 100, 200,400, "My FLTK Window");
+	//local win = Fl_Window(100, 100, 200,400, "My FLTK Window");
+/*
+	win.callback(function(sender, uwin){ 
+			print("mycb", sender, uwin);
+			//myWindows.push(MyNewWin());
+			//uwin.hide();
+		}, win);
+*/
+	local btnNew = new Fl_Button(50,20, 80,25, "New Win");
+
+	btnNew.callback(function(sender, udata){ 
+			//print("mycb", sender, udata);
+			myWindows.push(MyNewWin());
+			Fl.add_timeout(1, @(p) print(p), "I'm timeout");
+		}, "dad");
+
+	local btnClose = Fl_Button(50,55, 80,25, "Close Win");
+
+	btnClose.callback(function(sender, uwin){ 
+			print("mycb", sender, uwin, sender.x());
+			//myWindows.push(MyNewWin());
+			uwin.hide();
+		}, win);
+
+	//local input = MyInput(50,85, 80,25, "Name");
+	local input = Fl_Input(50,85, 80,25, "Name");
+	local int_input = Fl_Int_Input(50,115, 80,25, "Age");
+	int_input->color(FL_RED);
+	//local box = Fl_Box(50,145, 80,25, "Img");
+	//box.color(FL_RED);
+	
+	local editor = Fl_Text_Editor_Buffered(10,200, 180,100, "Notes");
+	editor->value("Hello everybody here we are !");
+	local btnText = Fl_Button(50,145, 80,25, "Text");
+	btnText.callback(function(sender, uwin){
+		print(input.value());
+		});
+
+	local tabs = Fl_Tabs(10,320, 180,40, "Tabs");
+	local grp = Fl_Group(10,345, 180,20, "Tab1");
+	grp.end()
+	grp = Fl_Group(10,345, 180,20, "Tab2");
+	grp.end()
+	grp = Fl_Group(10,345, 180,20, "Tab3");
+	grp.end()
+	tabs.end();
+
+	win->end();
+	win->resizable(win);
+	win->show_main();
+	return win;
+}
+
+MyNewWin();
+
+//Fl.add_idle(@(p) print(p), "I'm idle !");
+
+Fl.run()
+