test-fltk-3.nut 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. function _tr(str){ return str;}
  2. class Fl_Data_Table extends Flv_Table {
  3. _forPrint = null;
  4. constructor(px, py, pw, ph, pl=""){
  5. base.constructor(px, py, pw, ph, pl);
  6. _forPrint=false;
  7. }
  8. }
  9. //class BaseReportA4 extends Fl_Group {
  10. class BaseReportA4 extends Fl_Window {
  11. rpt_Logo=null;
  12. rpt_Title=null;
  13. rpt_SubTitle=null;
  14. rpt_Body=null;
  15. rpt_SubFooter=null;
  16. rpt_Footer=null;
  17. constructor() {
  18. base.constructor(10, 50, 420, 594, _tr("BaseReportA4"));
  19. begin();
  20. { rpt_Logo = new Fl_Box(10, 5, 105, 35, _tr("Ourbiz"));
  21. rpt_Logo->labeltype(FL_SHADOW_LABEL);
  22. rpt_Logo->labelfont(3);
  23. rpt_Logo->labelsize(30);
  24. rpt_Logo->align((644|FL_ALIGN_INSIDE));
  25. } // Fl_Box* rpt_Logo
  26. { rpt_Title = new Fl_Box(120, 5, 295, 20, _tr("Report Title"));
  27. rpt_Title->labelfont(1);
  28. rpt_Title->labelsize(16);
  29. } // Fl_Box* rpt_Title
  30. { rpt_SubTitle = new Fl_Box(120, 30, 290, 10, _tr("Date"));
  31. rpt_SubTitle->labelsize(8);
  32. rpt_SubTitle->align((FL_ALIGN_RIGHT|FL_ALIGN_INSIDE));
  33. } // Fl_Box* rpt_SubTitle
  34. { local o = new Fl_Box(10, 40, 405, 1, _tr("Line"));
  35. o->box(FL_FLAT_BOX);
  36. o->color(34);
  37. o->labeltype(FL_NO_LABEL);
  38. } // Fl_Box* o
  39. { local o = rpt_Body = new Fl_Data_Table(10, 45, 408, 495);
  40. rpt_Body->box(FL_NO_BOX);
  41. rpt_Body->color(FL_BACKGROUND2_COLOR);
  42. rpt_Body->selection_color(FL_SELECTION_COLOR);
  43. rpt_Body->labeltype(FL_NORMAL_LABEL);
  44. rpt_Body->labelfont(0);
  45. rpt_Body->labelsize(8);
  46. rpt_Body->labelcolor(FL_FOREGROUND_COLOR);
  47. rpt_Body->textsize(8);
  48. rpt_Body->align((FL_ALIGN_BOTTOM));
  49. rpt_Body->when(FL_WHEN_RELEASE_ALWAYS);
  50. Fl_Group.current()->resizable(rpt_Body);
  51. o->has_scrollbar(FLVS_NONE);
  52. o->feature_remove(FLVF_ROW_SELECT | FLVF_PERSIST_SELECT);
  53. o->_forPrint = true;
  54. } // Fl_Data_Table* rpt_Body
  55. { local o = new Fl_Box(10, 545, 405, 1, _tr("Line"));
  56. o->box(FL_FLAT_BOX);
  57. o->color(34);
  58. o->labeltype(FL_NO_LABEL);
  59. } // Fl_Box* o
  60. { rpt_SubFooter = new Fl_Box(10, 547, 405, 10, _tr("Page"));
  61. rpt_SubFooter->labelfont(1);
  62. rpt_SubFooter->labelsize(8);
  63. rpt_SubFooter->align((FL_ALIGN_CENTER|FL_ALIGN_INSIDE));
  64. } // Fl_Box* rpt_SubFooter
  65. { rpt_Footer = new Fl_Box(10, 560, 405, 19, _tr("OURBIZ is an excelente application to manage a business."));
  66. rpt_Footer->labelfont(2);
  67. rpt_Footer->labelsize(8);
  68. rpt_Footer->align((129|FL_ALIGN_INSIDE));
  69. } // Fl_Box* rpt_Footer
  70. end();
  71. }
  72. }
  73. //local win = new MainWindow(10, 50, 330, 320, "OURBIZ");
  74. local win = new BaseReportA4();
  75. win->resizable(win);
  76. win->show_main();
  77. math.number_format_set_dec_point(",");
  78. math.number_format_set_thousand_sep(".");
  79. Fl_Input.default_number_format("\0x02,.");
  80. //Fl:scheme("plastic");
  81. Fl.scheme("gtk+");
  82. //use partial match to find verdana font
  83. Fl.visual(FL_RGB);
  84. //allow arrow keys navigation
  85. Fl.option(Fl.OPTION_ARROW_FOCUS, true);
  86. Fl.run();