~ubuntu-branches/debian/lenny/fpc/lenny

« back to all changes in this revision

Viewing changes to packages/extra/forms/demo/fbrowse1.pp

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-05-17 17:12:11 UTC
  • mfrom: (3.1.9 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080517171211-9qi33xhd9evfa0kg
Tags: 2.2.0-dfsg1-9
[ Torsten Werner ]
* Add Mazen Neifer to Uploaders field.

[ Mazen Neifer ]
* Moved FPC sources into a version dependent directory from /usr/share/fpcsrc
  to /usr/share/fpcsrc/${FPCVERSION}. This allow installing more than on FPC
  release.
* Fixed far call issue in compiler preventing building huge binearies.
  (closes: #477743)
* Updated building dependencies, recomennded and suggested packages.
* Moved fppkg to fp-utils as it is just a helper tool and is not required by
  compiler.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
{ This demo shows the use of a browser and fl_call_object_callback.  }
2
 
program fbrowse1;
3
 
 
4
 
uses xforms;
5
 
 
6
 
var
7
 
  form : PFL_FORM;
8
 
  br, but : PFL_OBJECT;
9
 
 
10
 
procedure load_file(ob : PFL_OBJECT; arg : longint);export;
11
 
 
12
 
begin
13
 
  if (fl_load_browser(br,fl_show_input('Filename to load',''))<>0) then
14
 
     fl_add_browser_line(br,'NO SUCH FILE!');
15
 
end;
16
 
 
17
 
procedure set_size(ob : PFL_OBJECT; arg : Longint);export;
18
 
 
19
 
begin
20
 
  fl_set_browser_fontsize(br, arg);
21
 
end;
22
 
 
23
 
 
24
 
var obj : PFL_OBJECT;
25
 
 
26
 
begin
27
 
    fl_initialize(@argc, argv, 'FormDemo', nil, 0);
28
 
 
29
 
    form := fl_bgn_form(FL_UP_BOX,130,100);
30
 
     br := fl_add_browser(FL_NORMAL_BROWSER,5,5,95,90,'');
31
 
     but := fl_add_button(FL_NORMAL_BUTTON,105,5,20,8,'Exit');
32
 
     obj := fl_add_button(FL_NORMAL_BUTTON,105,75,20,8,'Load');
33
 
     fl_set_object_callback(obj,PFL_CALLBACKPTR(@load_file),0);
34
 
     obj := fl_add_lightbutton(FL_RADIO_BUTTON,105,60,20,8,'Small');
35
 
     fl_set_object_callback(obj,PFL_CALLBACKPTR(@set_size),FL_SMALL_SIZE);
36
 
     fl_call_object_callback(obj);
37
 
     fl_set_button(obj,1);
38
 
     obj := fl_add_lightbutton(FL_RADIO_BUTTON,105,50,20,8,'Normal');
39
 
     fl_set_object_callback(obj,PFL_CALLBACKPTR(@set_size),FL_NORMAL_SIZE);
40
 
     obj := fl_add_lightbutton(FL_RADIO_BUTTON,105,40,20,8,'Large');
41
 
     fl_set_object_callback(obj,PFL_CALLBACKPTR(@set_size),FL_LARGE_SIZE);
42
 
    fl_end_form();
43
 
 
44
 
  fl_clear_browser(br);
45
 
  fl_add_browser_line(br,'LOAD A FILE.');
46
 
  fl_scale_form(form, 4.0, 4.0);
47
 
 
48
 
  fl_show_form(form,FL_PLACE_FREE,FL_FULLBORDER,'Browser');
49
 
 
50
 
  repeat
51
 
    obj := fl_do_forms;
52
 
  until obj = but;
53
 
  fl_hide_form(form);
54
 
end.
55
 
{
56
 
  $Log: fbrowse1.pp,v $
57
 
  Revision 1.3  2003/10/27 15:48:13  peter
58
 
    * renamed forms unit to xforms to prevent conflict with Forms
59
 
      from the LCL
60
 
 
61
 
  Revision 1.2  2002/09/07 15:42:55  peter
62
 
    * old logs removed and tabs fixed
63
 
 
64
 
  Revision 1.1  2002/01/29 17:55:01  peter
65
 
    * splitted to base and extra
66
 
 
67
 
}