test-fltk-6.nut 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  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 Fl_Box_ClearLabel extends Fl_Box {
  10. constructor(px, py, pw, ph, pl=""){
  11. base.constructor(px, py, pw, ph, pl);
  12. }
  13. }
  14. class Flu_Combo_List extends Fl_Box {
  15. constructor(px, py, pw, ph, pl=""){
  16. base.constructor(px, py, pw, ph, pl);
  17. }
  18. }
  19. class Fl_Image_Box extends Fl_Box {
  20. constructor(px, py, pw, ph, pl=""){
  21. base.constructor(px, py, pw, ph, pl);
  22. }
  23. }
  24. class Fl_Choice_Int extends Fl_Button {
  25. constructor(px, py, pw, ph, pl=""){
  26. base.constructor(px, py, pw, ph, pl);
  27. }
  28. }
  29. class Fl_Float_Input_Fmt extends Fl_Float_Input {
  30. constructor(px, py, pw, ph, pl=""){
  31. base.constructor(px, py, pw, ph, pl);
  32. }
  33. }
  34. class My_Fl_Float_Input extends Fl_Float_Input {
  35. constructor(px, py, pw, ph, pl=""){
  36. base.constructor(px, py, pw, ph, pl);
  37. }
  38. }
  39. class My_Fl_Return_Button extends Fl_Button {
  40. constructor(px, py, pw, ph, pl=""){
  41. base.constructor(px, py, pw, ph, pl);
  42. }
  43. }
  44. class Fl_Choice_Str extends Fl_Button {
  45. constructor(px, py, pw, ph, pl=""){
  46. base.constructor(px, py, pw, ph, pl);
  47. }
  48. }
  49. class Flu_Combo_Box extends Fl_Button {
  50. constructor(px, py, pw, ph, pl=""){
  51. base.constructor(px, py, pw, ph, pl);
  52. }
  53. }
  54. function add_input_field_to_map(tbl, fldname, fld){
  55. }
  56. //class BaseReportA4 extends Fl_Group {
  57. class BaseReportA4 extends Fl_Window {
  58. topGroup=null;
  59. group_filter=null;
  60. query_limit=null;
  61. btnNotes=null;
  62. middleGroup=null;
  63. grid=null;
  64. bottomGroup=null;
  65. pack_search_options=null;
  66. search_str=null;
  67. btnSearch=null;
  68. btnSelect=null;
  69. btnUpdate=null;
  70. btnInsert=null;
  71. btnThumbImage=null;
  72. pack_search_options2=null;
  73. constructor() {
  74. base.constructor(10, 50, 800, 560, _tr("Edit Order"));
  75. begin();
  76. this->box(FL_FLAT_BOX);
  77. this->color(FL_BACKGROUND_COLOR);
  78. this->selection_color(FL_BACKGROUND_COLOR);
  79. this->labeltype(FL_NO_LABEL);
  80. this->labelfont(0);
  81. this->labelsize(16);
  82. this->labelcolor(FL_FOREGROUND_COLOR);
  83. this->align((FL_ALIGN_TOP));
  84. this->when(FL_WHEN_RELEASE);
  85. { topGroup = new Fl_Group(0, 0, 800, 35);
  86. topGroup->labelsize(16);
  87. { group_filter = new Flu_Combo_Box(5, 5, 675, 25);
  88. group_filter->resize(5, 5, 675, 25);
  89. group_filter->box(FL_DOWN_BOX);
  90. group_filter->color(FL_BACKGROUND2_COLOR);
  91. group_filter->selection_color(FL_SELECTION_COLOR);
  92. group_filter->labeltype(FL_NO_LABEL);
  93. group_filter->labelfont(0);
  94. group_filter->labelsize(16);
  95. group_filter->labelcolor(FL_FOREGROUND_COLOR);
  96. group_filter->textsize(16);
  97. group_filter->align((FL_ALIGN_LEFT));
  98. group_filter->when(FL_WHEN_RELEASE);
  99. } // Flu_Combo_Box* group_filter
  100. { local o = query_limit = new Fl_Int_Input(690, 6, 60, 25);
  101. query_limit->type(2);
  102. query_limit->labeltype(FL_NO_LABEL);
  103. query_limit->labelsize(16);
  104. query_limit->textsize(16);
  105. o->value("50");
  106. } // Fl_Int_Input* query_limit
  107. { btnNotes = new Fl_Button(760, 6, 35, 25, _tr("?"));
  108. btnNotes->labelsize(16);
  109. } // Fl_Button* btnNotes
  110. topGroup->end();
  111. } // Fl_Group* topGroup
  112. { middleGroup = new Fl_Group(0, 41, 800, 409);
  113. middleGroup->labelsize(16);
  114. { grid = new Fl_Data_Table(5, 41, 790, 389);
  115. grid->resize(5, 41, 790, 389);
  116. grid->type(3);
  117. grid->box(FL_NO_BOX);
  118. grid->color(FL_BACKGROUND2_COLOR);
  119. grid->selection_color(FL_SELECTION_COLOR);
  120. grid->labeltype(FL_NO_LABEL);
  121. grid->labelfont(0);
  122. grid->labelsize(16);
  123. grid->labelcolor(FL_FOREGROUND_COLOR);
  124. grid->textsize(16);
  125. grid->align((FL_ALIGN_BOTTOM));
  126. grid->when(FL_WHEN_RELEASE_ALWAYS);
  127. Fl_Group.current()->resizable(grid);
  128. } // Fl_Data_Table* grid
  129. middleGroup->end();
  130. Fl_Group.current()->resizable(middleGroup);
  131. } // Fl_Group* middleGroup
  132. { bottomGroup = new Fl_Group(4, 440, 790, 115);
  133. bottomGroup->box(FL_ENGRAVED_BOX);
  134. bottomGroup->color(246);
  135. bottomGroup->labelsize(16);
  136. { local o = pack_search_options = new Fl_Pack(14, 450, 320, 25);
  137. pack_search_options->type(1);
  138. pack_search_options->labelsize(16);
  139. o->spacing(10);
  140. pack_search_options->end();
  141. } // Fl_Pack* pack_search_options
  142. { search_str = new Fl_Input(35, 485, 299, 25, _tr("@search"));
  143. search_str->resize(35, 485, 299, 25);
  144. search_str->label(_tr("@search"));
  145. search_str->labelsize(16);
  146. search_str->textsize(16);
  147. search_str->callback(cb_search_str);
  148. search_str->when(FL_WHEN_ENTER_KEY);
  149. } // Fl_Input* search_str
  150. { btnSearch = new Fl_Button(345, 485, 100, 25, _tr("Search"));
  151. btnSearch->labelsize(16);
  152. btnSearch->callback(cb_btnSearch);
  153. } // Fl_Button* btnSearch
  154. { btnSelect = new Fl_Button(14, 520, 100, 25, _tr("Select"));
  155. btnSelect->labelsize(16);
  156. btnSelect->callback(cb_btnSelect);
  157. } // Fl_Button* btnSelect
  158. { btnUpdate = new Fl_Button(124, 520, 100, 25, _tr("Update"));
  159. btnUpdate->labelsize(16);
  160. btnUpdate->callback(cb_btnUpdate);
  161. } // Fl_Button* btnUpdate
  162. { btnInsert = new Fl_Button(234, 520, 100, 25, _tr("Insert"));
  163. btnInsert->labelsize(16);
  164. btnInsert->callback(cb_btnInsert);
  165. } // Fl_Button* btnInsert
  166. { btnThumbImage = new Fl_Image_Box(663, 445, 125, 105);
  167. btnThumbImage->box(FL_NO_BOX);
  168. btnThumbImage->color(FL_BACKGROUND_COLOR);
  169. btnThumbImage->selection_color(FL_BACKGROUND_COLOR);
  170. btnThumbImage->labeltype(FL_NORMAL_LABEL);
  171. btnThumbImage->labelfont(0);
  172. btnThumbImage->labelsize(14);
  173. btnThumbImage->labelcolor(FL_FOREGROUND_COLOR);
  174. btnThumbImage->align((FL_ALIGN_CLIP|FL_ALIGN_INSIDE));
  175. btnThumbImage->when(FL_WHEN_RELEASE);
  176. } // Fl_Image_Box* btnThumbImage
  177. { local o = new Fl_Box(650, 445, 5, 105);
  178. o->labeltype(FL_NO_LABEL);
  179. o->labelsize(16);
  180. o->align((FL_ALIGN_CLIP|FL_ALIGN_INSIDE));
  181. Fl_Group.current()->resizable(o);
  182. } // Fl_Box* o
  183. { local o = pack_search_options2 = new Fl_Pack(345, 520, 300, 25);
  184. pack_search_options2->type(1);
  185. pack_search_options2->labelsize(16);
  186. o->spacing(10);
  187. pack_search_options2->end();
  188. } // Fl_Pack* pack_search_options2
  189. bottomGroup->end();
  190. } // Fl_Group* bottomGroup
  191. group_filter->textfont(group_filter->labelfont());
  192. group_filter->textsize(group_filter->labelsize());
  193. end();
  194. }
  195. function cb_search_str(){}
  196. function cb_btnSearch(){}
  197. function cb_btnSelect(){}
  198. function cb_btnUpdate(){}
  199. function cb_btnInsert(){}
  200. }
  201. //local win = new MainWindow(10, 50, 330, 320, "OURBIZ");
  202. local win = new BaseReportA4();
  203. win->resizable(win);
  204. win->show_main();
  205. math.number_format_set_dec_point(",");
  206. math.number_format_set_thousand_sep(".");
  207. Fl_Input.default_number_format("\0x02,.");
  208. //Fl:scheme("plastic");
  209. Fl.scheme("gtk+");
  210. //use partial match to find verdana font
  211. Fl.visual(FL_RGB);
  212. //allow arrow keys navigation
  213. Fl.option(Fl.OPTION_ARROW_FOCUS, true);
  214. Fl.run();