sqlite3-cc-gui.nut 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725
  1. class Sqlite3cc_Window extends Fl_Double_Window {
  2. // Declaration of class members
  3. menuBar : Fl_Menu_Bar;
  4. menu_file_new : Submenu;
  5. menu_file_open : Submenu;
  6. menu_file_reopen : Submenu;
  7. menu_file_attach : Submenu;
  8. menu_file_close : Submenu;
  9. menu_file_open_csv : Submenu;
  10. menu_file_execute : Submenu;
  11. menu_file_exit : Submenu;
  12. menu_settings_encoding : Submenu;
  13. menu_settings_preferences : Submenu;
  14. menu_help_about : Submenu;
  15. menu_squilu_edit : Submenu;
  16. tile : Fl_Tile;
  17. group_db_tables : Fl_Group;
  18. grid_tables : Fl_Data_Table;
  19. iTablesFilter : Fl_Input;
  20. chkSytemTables : Fl_Check_Button;
  21. group_sql : Fl_Group;
  22. group_buttons : Fl_Group;
  23. iMaxRows : Fl_Input;
  24. option_query : Fl_Choice;
  25. menu_sql_select : MenuItem;
  26. menu_sql_insert : MenuItem;
  27. menu_sql_update : MenuItem;
  28. menu_sql_delete : MenuItem;
  29. menu_sql_schema_update : MenuItem;
  30. menu_sql_schema_update_norefs : MenuItem;
  31. menu_sql_sqlite_master_update : MenuItem;
  32. menu_sql_drop_table : MenuItem;
  33. menu_sql_dump_table : MenuItem;
  34. menu_sql_create_index : MenuItem;
  35. menu_sql_create_trigger : MenuItem;
  36. menu_sql_references : MenuItem;
  37. menu_sql_search_all_tables : MenuItem;
  38. menu_sql_macros : MenuItem;
  39. menu_sql_macros_base : MenuItem;
  40. menu_sql_macros_sql : MenuItem;
  41. menu_sql_macros_insert : MenuItem;
  42. menu_sql_macros_update : MenuItem;
  43. menu_sql_update_metadata : MenuItem;
  44. btnCreateQuery : Fl_Button;
  45. btnExecute : Fl_Button;
  46. btnLoad : Fl_Button;
  47. btnSave : Fl_Button;
  48. edit_queries : Fl_Text_Editor_Buffered;
  49. group_log : Fl_Group;
  50. tabsLog : Fl_Tabs;
  51. groupMessages : Fl_Group;
  52. output_messages : Fl_Output;
  53. groupHistory : Fl_Group;
  54. browser_history : Fl_Browser;
  55. group_bottom : Fl_Group;
  56. tabView : Fl_Tabs;
  57. groupData : Fl_Group;
  58. grid_data : Fl_Data_Table;
  59. groupRecord : Fl_Group;
  60. edit_record : Fl_Text_Editor_Buffered;
  61. viewFields : Fl_Group;
  62. grid_fields : Fl_Data_Table;
  63. viewIndexes : Fl_Group;
  64. gridIndexes : Fl_Data_Table;
  65. viewTriggers : Fl_Group;
  66. gridTriggers : Fl_Data_Table;
  67. groupSchema : Fl_Group;
  68. edit_schema : Fl_Text_Editor_Buffered;
  69. groupReferences : Fl_Group;
  70. edit_references : Fl_Text_Editor_Buffered;
  71. tabDefaults : Fl_Group;
  72. iDefaultHash : Fl_Input;
  73. iDefaultRubyStyle : Fl_Check_Button;
  74. iDefaultWithNL : Fl_Check_Button;
  75. iDefaultFieldPrefix : Fl_Input;
  76. iDefaultFieldSufix : Fl_Input;
  77. iDefaultStrip : Fl_Check_Button;
  78. iDefaultEscapeSQL : Fl_Check_Button;
  79. iDefaultFieldConvert : Fl_Check_Button;
  80. constructor(px=218, py=131, pw=780, ph=520, pl=_tr("SQLiteCC")){
  81. base.constructor(px, py, pw, ph, pl);
  82. // Create member functions and widgets
  83. {
  84. local o = Fl_Menu_Bar(0, 0, 780, 25);
  85. menuBar = o;
  86. o.textsize(16);
  87. o.labelsize(16);
  88. {
  89. //menu_file File
  90. menu_file_new = o.add(_tr("File/New DB"), 262254);
  91. menu_file_open = o.add(_tr("File/Open DB"), 0);
  92. menu_file_reopen = o.add(_tr("File/Reopen DB"), 0);
  93. menu_file_attach = o.add(_tr("File/Attach DB"), 0);
  94. menu_file_close = o.add(_tr("File/Close DB"), 0, null, null, 128);
  95. menu_file_open_csv = o.add(_tr("File/Open CSV"), 0, null, null, 128);
  96. menu_file_execute = o.add(_tr("File/Execute"), 0, null, null, 128);
  97. menu_file_exit = o.add(_tr("File/Exit"), 0);
  98. //menu_settings Settings
  99. //menu_settings_encoding Settings/Encoding
  100. menu_settings_encoding = o.add(_tr("Settings/Encoding/Unicode UTF-8"), 0, null, null, 12);
  101. menu_settings_encoding = o.add(_tr("Settings/Encoding/Unicode UTF-16"), 0, null, null, 8);
  102. menu_settings_encoding = o.add(_tr("Settings/Encoding/ISO Latin2"), 0, null, null, 8);
  103. menu_settings_encoding = o.add(_tr("Settings/Encoding/Windows 1251"), 0, null, null, 8);
  104. menu_settings_preferences = o.add(_tr("Settings/Preferences"), 0);
  105. //menu_help Help
  106. menu_help_about = o.add(_tr("Help/About"), 0);
  107. menu_squilu_edit = o.add(_tr("Help/SquiLu Edit"), 0);
  108. }
  109. }
  110. {
  111. local o = Fl_Tile(0, 25, 780, 495);
  112. tile = o;
  113. {
  114. {
  115. local o = Fl_Group(5, 25, 160, 280);
  116. group_db_tables = o;
  117. o.labeltype(FL_NO_LABEL);
  118. {
  119. {
  120. local o = Fl_Data_Table(5, 25, 160, 255);
  121. grid_tables = o;
  122. o.textsize(16);
  123. o.labelsize(16);
  124. o.end();
  125. Fl_Group.current().resizable(o);
  126. }
  127. {
  128. local o = Fl_Group(5, 280, 160, 25);
  129. {
  130. {
  131. local o = Fl_Input(5, 280, 140, 25, _tr("Filter:"));
  132. iTablesFilter = o;
  133. o.labeltype(FL_NO_LABEL);
  134. o.when(1);
  135. Fl_Group.current().resizable(o);
  136. }
  137. {
  138. local o = Fl_Check_Button(147, 281, 18, 24, _tr("System tables"));
  139. chkSytemTables = o;
  140. o.labeltype(FL_NO_LABEL);
  141. o.down_box(FL_DOWN_BOX);
  142. }
  143. }
  144. o.end();
  145. }
  146. }
  147. o.end();
  148. }
  149. {
  150. local o = Fl_Group(165, 25, 615, 280);
  151. {
  152. {
  153. local o = Fl_Group(165, 25, 615, 170);
  154. group_sql = o;
  155. o.box(FL_DOWN_BOX);
  156. o.labelsize(16);
  157. o.labeltype(FL_NO_LABEL);
  158. {
  159. {
  160. local o = Fl_Group(165, 25, 615, 35);
  161. group_buttons = o;
  162. o.box(FL_DOWN_FRAME);
  163. o.labelsize(16);
  164. {
  165. {
  166. local o = Fl_Int_Input(265, 30, 49, 25, _tr("Max Rows"));
  167. iMaxRows = o;
  168. o.textsize(16);
  169. o.labelsize(16);
  170. o->value("50");
  171. }
  172. {
  173. local o = Fl_Choice(370, 30, 120, 25, _tr("Query"));
  174. option_query = o;
  175. o.textsize(16);
  176. o.labelsize(16);
  177. o.down_box(FL_BORDER_BOX);
  178. {
  179. menu_sql_select = o.add(_tr("select"), 0);
  180. menu_sql_insert = o.add(_tr("insert"), 0);
  181. menu_sql_update = o.add(_tr("update"), 0);
  182. menu_sql_delete = o.add(_tr("delete"), 0);
  183. menu_sql_schema_update = o.add(_tr("schema update"), 0);
  184. menu_sql_schema_update_norefs = o.add(_tr("schema update norefs"), 0);
  185. menu_sql_sqlite_master_update = o.add(_tr("sqlite_master update"), 0);
  186. menu_sql_drop_table = o.add(_tr("drop table"), 0);
  187. menu_sql_dump_table = o.add(_tr("dump table"), 0);
  188. menu_sql_create_index = o.add(_tr("create index"), 0);
  189. menu_sql_create_trigger = o.add(_tr("create trigger"), 0);
  190. menu_sql_references = o.add(_tr("references"), 0);
  191. menu_sql_search_all_tables = o.add(_tr("search all tables"), 0);
  192. menu_sql_macros = o.add(_tr("sql macros"), 0);
  193. menu_sql_macros_base = o.add(_tr("sql macros base"), 0);
  194. menu_sql_macros_sql = o.add(_tr("sql macros sql"), 0);
  195. menu_sql_macros_insert = o.add(_tr("sql macros insert"), 0);
  196. menu_sql_macros_update = o.add(_tr("sql macros update"), 0);
  197. menu_sql_update_metadata = o.add(_tr("sql update metadata"), 0);
  198. }
  199. }
  200. {
  201. local o = Fl_Button(500, 30, 25, 25, _tr("@->"));
  202. btnCreateQuery = o;
  203. o.labelsize(16);
  204. }
  205. {
  206. local o = Fl_Button(535, 30, 75, 25, _tr("Execute"));
  207. btnExecute = o;
  208. o.labelsize(16);
  209. }
  210. {
  211. local o = Fl_Button(620, 30, 70, 25, _tr("Load"));
  212. btnLoad = o;
  213. o.labelsize(16);
  214. }
  215. {
  216. local o = Fl_Button(700, 30, 70, 25, _tr("Save"));
  217. btnSave = o;
  218. o.labelsize(16);
  219. }
  220. }
  221. o.end();
  222. }
  223. {
  224. local o = Fl_Text_Editor_Buffered(165, 60, 610, 135);
  225. edit_queries = o;
  226. o.textsize(16);
  227. o.box(FL_NO_BOX);
  228. o.labelsize(15);
  229. Fl_Group.current().resizable(o);
  230. }
  231. }
  232. o.end();
  233. Fl_Group.current().resizable(o);
  234. }
  235. {
  236. local o = Fl_Group(165, 195, 615, 110);
  237. group_log = o;
  238. o.box(FL_DOWN_BOX);
  239. {
  240. {
  241. local o = Fl_Tabs(165, 195, 610, 110);
  242. tabsLog = o;
  243. o.align(2);
  244. o.labelsize(16);
  245. {
  246. {
  247. local o = Fl_Group(165, 220, 610, 85, _tr("Messages"));
  248. groupMessages = o;
  249. o.labelsize(16);
  250. {
  251. {
  252. local o = Fl_Multiline_Output(165, 220, 610, 85);
  253. output_messages = o;
  254. o.textsize(16);
  255. o.labelsize(16);
  256. }
  257. }
  258. o.end();
  259. Fl_Group.current().resizable(o);
  260. }
  261. {
  262. local o = Fl_Group(165, 220, 610, 85, _tr("History"));
  263. groupHistory = o;
  264. o.labelsize(16);
  265. {
  266. {
  267. local o = Fl_Hold_Browser(165, 220, 610, 85);
  268. browser_history = o;
  269. o.textsize(16);
  270. o.labelsize(16);
  271. o.callback(function(sender, udata){
  272. dispatch_func(history_to_edit_query, self)
  273. });
  274. o.end();
  275. }
  276. }
  277. o.end();
  278. }
  279. }
  280. o.end();
  281. }
  282. }
  283. o.end();
  284. }
  285. }
  286. o.end();
  287. }
  288. {
  289. local o = Fl_Group(0, 305, 780, 215);
  290. group_bottom = o;
  291. o.box(FL_DOWN_BOX);
  292. {
  293. {
  294. local o = Fl_Tabs(0, 305, 780, 215);
  295. tabView = o;
  296. o.labelsize(16);
  297. {
  298. {
  299. local o = Fl_Group(0, 333, 780, 187, _tr("Data"));
  300. groupData = o;
  301. o.labelsize(16);
  302. {
  303. {
  304. local o = Fl_Data_Table(0, 333, 780, 187);
  305. grid_data = o;
  306. o.textsize(16);
  307. o.labelsize(16);
  308. o.end();
  309. }
  310. }
  311. o.end();
  312. Fl_Group.current().resizable(o);
  313. }
  314. {
  315. local o = Fl_Group(0, 333, 780, 187, _tr("Record"));
  316. groupRecord = o;
  317. o.labelsize(16);
  318. {
  319. {
  320. local o = Fl_Text_Editor_Buffered(5, 333, 770, 185);
  321. edit_record = o;
  322. o.textsize(16);
  323. o.labelsize(16);
  324. }
  325. }
  326. o.end();
  327. }
  328. {
  329. local o = Fl_Group(0, 333, 780, 187, _tr("Fields"));
  330. viewFields = o;
  331. o.labelsize(16);
  332. {
  333. {
  334. local o = Fl_Data_Table(0, 333, 780, 187);
  335. grid_fields = o;
  336. o.textsize(16);
  337. o.labelsize(16);
  338. o.end();
  339. }
  340. }
  341. o.end();
  342. }
  343. {
  344. local o = Fl_Group(0, 333, 780, 187, _tr("Indexes"));
  345. viewIndexes = o;
  346. o.labelsize(16);
  347. {
  348. {
  349. local o = Fl_Data_Table(0, 333, 780, 187);
  350. gridIndexes = o;
  351. o.textsize(16);
  352. o.labelsize(16);
  353. o.end();
  354. }
  355. }
  356. o.end();
  357. }
  358. {
  359. local o = Fl_Group(0, 333, 780, 187, _tr("Triggers"));
  360. viewTriggers = o;
  361. o.labelsize(16);
  362. {
  363. {
  364. local o = Fl_Data_Table(0, 333, 780, 187);
  365. gridTriggers = o;
  366. o.textsize(16);
  367. o.labelsize(16);
  368. o.end();
  369. }
  370. }
  371. o.end();
  372. }
  373. {
  374. local o = Fl_Group(0, 333, 780, 187, _tr("Schema"));
  375. groupSchema = o;
  376. o.labelsize(16);
  377. {
  378. {
  379. local o = Fl_Text_Editor_Buffered(5, 333, 770, 185);
  380. edit_schema = o;
  381. o.textsize(16);
  382. o.labelsize(16);
  383. }
  384. }
  385. o.end();
  386. }
  387. {
  388. local o = Fl_Group(0, 333, 780, 187, _tr("References"));
  389. groupReferences = o;
  390. o.labelsize(16);
  391. {
  392. {
  393. local o = Fl_Text_Editor_Buffered(5, 333, 770, 185);
  394. edit_references = o;
  395. o.textsize(16);
  396. o.labelsize(16);
  397. }
  398. }
  399. o.end();
  400. }
  401. {
  402. local o = Fl_Group(0, 333, 780, 187, _tr("Defaults"));
  403. tabDefaults = o;
  404. o.labelsize(16);
  405. {
  406. {
  407. local o = Fl_Input(145, 375, 135, 24, _tr("Hash for queries"));
  408. iDefaultHash = o;
  409. o.textsize(16);
  410. o.labelsize(16);
  411. }
  412. {
  413. local o = Fl_Check_Button(145, 414, 135, 25, _tr("Ruby Style"));
  414. iDefaultRubyStyle = o;
  415. o.labelsize(16);
  416. o.down_box(FL_DOWN_BOX);
  417. }
  418. {
  419. local o = Fl_Check_Button(145, 439, 135, 25, _tr("Use new lines"));
  420. iDefaultWithNL = o;
  421. o.labelsize(16);
  422. o.down_box(FL_DOWN_BOX);
  423. }
  424. {
  425. local o = Fl_Input(410, 375, 135, 25, _tr("Field prefix"));
  426. iDefaultFieldPrefix = o;
  427. o.textsize(15);
  428. o.labelsize(16);
  429. }
  430. {
  431. local o = Fl_Input(410, 405, 135, 25, _tr("Field sufix"));
  432. iDefaultFieldSufix = o;
  433. o.textsize(16);
  434. o.labelsize(16);
  435. }
  436. {
  437. local o = Fl_Check_Button(410, 435, 135, 25, _tr("strip"));
  438. iDefaultStrip = o;
  439. o.labelsize(16);
  440. o.down_box(FL_DOWN_BOX);
  441. }
  442. {
  443. local o = Fl_Check_Button(410, 459, 135, 25, _tr("escape sql"));
  444. iDefaultEscapeSQL = o;
  445. o.labelsize(16);
  446. o.down_box(FL_DOWN_BOX);
  447. }
  448. {
  449. local o = Fl_Check_Button(410, 485, 135, 25, _tr("convert (to_i)"));
  450. iDefaultFieldConvert = o;
  451. o.labelsize(16);
  452. o.down_box(FL_DOWN_BOX);
  453. }
  454. }
  455. o.end();
  456. }
  457. }
  458. o.end();
  459. Fl_Group.current().resizable(o);
  460. }
  461. }
  462. o.end();
  463. }
  464. }
  465. o.end();
  466. }
  467. end();
  468. }
  469. }
  470. class SquiLuEditWindow extends Fl_Double_Window {
  471. // Declaration of class members
  472. code_editor : Fl_Text_Editor_Buffered;
  473. words_to_search : Fl_Input;
  474. btnSearch : Fl_Button;
  475. btnSavehelp : Fl_Button;
  476. btnRun : Fl_Button;
  477. output_editor : Fl_Text_Editor_Buffered;
  478. constructor(px=286, py=113, pw=565, ph=540, pl=_tr("SquiLu Edit")){
  479. base.constructor(px, py, pw, ph, pl);
  480. // Create member functions and widgets
  481. {
  482. local o = Fl_Text_Editor_Buffered(10, 10, 550, 308);
  483. code_editor = o;
  484. o.textsize(18);
  485. o.labelsize(18);
  486. }
  487. {
  488. local o = Fl_Group(10, 350, 549, 35);
  489. {
  490. {
  491. local o = Fl_Input(10, 350, 150, 33, _tr("Words to search"));
  492. words_to_search = o;
  493. o.textsize(18);
  494. o.align(5);
  495. o.labelsize(18);
  496. Fl_Group.current().resizable(o);
  497. }
  498. {
  499. local o = Fl_Button(170, 350, 115, 33, _tr("Search"));
  500. btnSearch = o;
  501. o.labelsize(16);
  502. }
  503. {
  504. local o = Fl_Button(444, 350, 115, 33, _tr("Save"));
  505. btnSavehelp = o;
  506. o.labelsize(16);
  507. }
  508. {
  509. local o = Fl_Button(310, 350, 115, 33, _tr("Run"));
  510. btnRun = o;
  511. o.labelsize(16);
  512. }
  513. }
  514. o.end();
  515. }
  516. {
  517. local o = Fl_Text_Editor_Buffered(10, 397, 550, 133);
  518. output_editor = o;
  519. o.textsize(18);
  520. o.labelsize(18);
  521. Fl_Group.current().resizable(o);
  522. }
  523. end();
  524. }
  525. }
  526. class CreateTableWindow extends Fl_Double_Window {
  527. // Declaration of class members
  528. choice_database : Fl_Choice;
  529. table_name : Fl_Input;
  530. grid_fields : Fl_Data_Table;
  531. btnAddColumn : Fl_Button;
  532. btnDeleteColumn : Fl_Button;
  533. btnEditColumn : Fl_Button;
  534. btnUpColumn : Fl_Button;
  535. btnDownColumn : Fl_Button;
  536. table_constraints : Fl_Input;
  537. btnCheck : Fl_Button;
  538. btnOk : Fl_Button;
  539. btnCancel : Fl_Button;
  540. output_editor : Fl_Text_Editor_Buffered;
  541. constructor(px=648, py=270, pw=565, ph=455, pl=_tr("Create Table")){
  542. base.constructor(px, py, pw, ph, pl);
  543. // Create member functions and widgets
  544. {
  545. local o = Fl_Choice(105, 5, 170, 25, _tr("Database:"));
  546. choice_database = o;
  547. o.down_box(FL_BORDER_BOX);
  548. }
  549. {
  550. local o = Fl_Input(330, 5, 230, 25, _tr("Table:"));
  551. table_name = o;
  552. }
  553. {
  554. local o = Fl_Data_Table(5, 35, 425, 195);
  555. grid_fields = o;
  556. o.textsize(16);
  557. o.labeltype(FL_NO_LABEL);
  558. o.labelsize(16);
  559. o.end();
  560. Fl_Group.current().resizable(o);
  561. }
  562. {
  563. local o = Fl_Button(435, 37, 125, 33, _tr("Add Column"));
  564. btnAddColumn = o;
  565. o.labelsize(16);
  566. }
  567. {
  568. local o = Fl_Button(435, 77, 125, 33, _tr("Delete Column"));
  569. btnDeleteColumn = o;
  570. o.labelsize(16);
  571. }
  572. {
  573. local o = Fl_Button(435, 117, 125, 33, _tr("Edit Column"));
  574. btnEditColumn = o;
  575. o.labelsize(16);
  576. }
  577. {
  578. local o = Fl_Button(435, 157, 125, 33, _tr("Up"));
  579. btnUpColumn = o;
  580. o.labelsize(16);
  581. }
  582. {
  583. local o = Fl_Button(435, 197, 125, 33, _tr("Down"));
  584. btnDownColumn = o;
  585. o.labelsize(16);
  586. }
  587. {
  588. local o = Fl_Multiline_Input(5, 255, 555, 75, _tr("Table Constraints"));
  589. table_constraints = o;
  590. o.align(5);
  591. }
  592. {
  593. local o = Fl_Group(5, 336, 554, 39);
  594. o.box(FL_ENGRAVED_BOX);
  595. o.labeltype(FL_NO_LABEL);
  596. {
  597. {
  598. local o = Fl_Button(10, 340, 115, 30, _tr("Check"));
  599. btnCheck = o;
  600. o.labelsize(16);
  601. }
  602. {
  603. local o = Fl_Button(310, 340, 115, 30, _tr("OK"));
  604. btnOk = o;
  605. o.labelsize(16);
  606. }
  607. {
  608. local o = Fl_Button(435, 340, 115, 30, _tr("Cancel"));
  609. btnCancel = o;
  610. o.labelsize(16);
  611. }
  612. }
  613. o.end();
  614. }
  615. {
  616. local o = Fl_Text_Editor_Buffered(5, 382, 555, 71);
  617. output_editor = o;
  618. o.textsize(18);
  619. o.labelsize(18);
  620. }
  621. end();
  622. }
  623. }
  624. class CreateTableFieldWindow extends Fl_Double_Window {
  625. // Declaration of class members
  626. field_name : Fl_Input;
  627. field_type : Fl_Choice;
  628. group_constraints : Fl_Group;
  629. field_primary_key : Fl_Check_Button;
  630. field_unique : Fl_Check_Button;
  631. field_not_null : Fl_Check_Button;
  632. field_default : Fl_Check_Button;
  633. field_default_value : Fl_Input;
  634. field_check : Fl_Input;
  635. field_collate : Fl_Choice;
  636. btnOk : Fl_Button;
  637. btnCancel : Fl_Button;
  638. constructor(px=665, py=216, pw=330, ph=375, pl=_tr("Create/Edit Table Field")){
  639. base.constructor(px, py, pw, ph, pl);
  640. // Create member functions and widgets
  641. {
  642. local o = Fl_Input(90, 10, 230, 25, _tr("Name:"));
  643. field_name = o;
  644. }
  645. {
  646. local o = Fl_Choice(90, 40, 230, 25, _tr("Data type:"));
  647. field_type = o;
  648. o.down_box(FL_BORDER_BOX);
  649. }
  650. {
  651. local o = Fl_Group(5, 90, 320, 240, _tr("Constraints"));
  652. group_constraints = o;
  653. o.box(FL_ENGRAVED_BOX);
  654. o.align(5);
  655. {
  656. {
  657. local o = Fl_Check_Button(10, 95, 110, 25, _tr("Primary Key"));
  658. field_primary_key = o;
  659. o.down_box(FL_DOWN_BOX);
  660. }
  661. {
  662. local o = Fl_Check_Button(10, 120, 110, 25, _tr("Unique"));
  663. field_unique = o;
  664. o.down_box(FL_DOWN_BOX);
  665. }
  666. {
  667. local o = Fl_Check_Button(10, 145, 110, 25, _tr("Not Null"));
  668. field_not_null = o;
  669. o.down_box(FL_DOWN_BOX);
  670. }
  671. {
  672. local o = Fl_Check_Button(10, 170, 110, 25, _tr("Default"));
  673. field_default = o;
  674. o.down_box(FL_DOWN_BOX);
  675. }
  676. {
  677. local o = Fl_Input(85, 170, 230, 25);
  678. field_default_value = o;
  679. o.labeltype(FL_NO_LABEL);
  680. }
  681. {
  682. local o = Fl_Input(85, 200, 230, 25, _tr("Check:"));
  683. field_check = o;
  684. }
  685. {
  686. local o = Fl_Choice(85, 230, 230, 25, _tr("Collate:"));
  687. field_collate = o;
  688. o.down_box(FL_BORDER_BOX);
  689. }
  690. }
  691. o.end();
  692. }
  693. {
  694. local o = Fl_Group(5, 336, 320, 39);
  695. o.box(FL_ENGRAVED_BOX);
  696. o.labeltype(FL_NO_LABEL);
  697. {
  698. {
  699. local o = Fl_Button(10, 340, 115, 30, _tr("OK"));
  700. btnOk = o;
  701. o.labelsize(16);
  702. }
  703. {
  704. local o = Fl_Button(205, 340, 115, 30, _tr("Cancel"));
  705. btnCancel = o;
  706. o.labelsize(16);
  707. }
  708. }
  709. o.end();
  710. }
  711. end();
  712. }
  713. }