goodies.pp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. Program goodies;
  2. { This demo program uses the routines in the
  3. goodies section, that help you create easy
  4. forms in an even easier way.
  5. }
  6. uses xforms,strings;
  7. var
  8. choice : Longint;
  9. str1,str2 : string[100];
  10. s : pchar;
  11. begin
  12. fl_initialize(@argc, argv, 'FormDemo', nil, 0);
  13. fl_set_resource(FLOKLabel,'Go');
  14. if (fl_show_question('Do you want bold font ?',1)<>0) then
  15. fl_set_goodies_font(FL_BOLD_STYLE,FL_NORMAL_SIZE);
  16. fl_show_messages('This is a test program for the goodies of the forms library');
  17. fl_show_alert('Alert', 'Alert form can be used to inform',
  18. 'recoverable errors', 0);
  19. if (fl_show_question('Do you want to quit?', 0)<>0) then
  20. halt(0);
  21. s:=fl_show_input('Give a string:','');
  22. if s<>nil then strcopy(@str1[1],s);
  23. fl_show_message('You typed:','',@str1[1]);
  24. choice := fl_show_choices('Pick a choice',3,'One','Two','Three',2);
  25. case choice of
  26. 1: fl_show_message('You typed: One','','');
  27. 2: fl_show_message('You typed: Two','','');
  28. 3: fl_show_message('You typed: Three','','');
  29. else
  30. begin
  31. fl_show_message('An error occurred!','','');
  32. end
  33. end;
  34. str1:='<Cancel>'#0;
  35. s:=fl_show_input('Give another string:',@str1[1]);
  36. if s<>nil then s:=@str1[1];
  37. fl_show_message('You typed:','',s);
  38. fl_show_messages('Good Bye');
  39. end.