~ubuntu-branches/debian/squeeze/sword/squeeze

« back to all changes in this revision

Viewing changes to bindings/clx/test1/MainFrm.pas

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Marsden, Jonathan Marsden, Dmitrijs Ledkovs, Closed Bugs
  • Date: 2009-05-30 11:55:55 UTC
  • mfrom: (1.3.1 upstream) (6.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20090530115555-r427zsn3amivdpfu
Tags: 1.6.0+dfsg-1
[ Jonathan Marsden ]
* New upstream release. (Closes: #507960) (LP: #320558)
* debian/patches/02_libver.diff:
  - Bump SONAME to 8 -- SWORD 1.6 is not backward compatible with 1.5.11.
* debian/patches/series:
  - Remove 10_diatheke.diff -- included in upstream source.
* debian/patches/:
  - Remove several old unused .diff files.
  - Add 11_regex_only_when_needed.diff to conditionally include regex lib.
  - Add 12_fix_compiler_warnings.diff to remove all compiler warnings.
  - Add 13_fix_osis2mod_compression_default.diff from upstream svn.
  - Add 14_closing_section_not_chapter.diff from upstream svn.
* debian/libsword7.*: 
  - Rename to libsword8.*
  - Change libsword7 to libsword8 within files.
* debian/rules: 
  - SONAME bump to 8.
  - Set library version check to >= 1.6
* debian/control:
  - Change libsword7 to libsword8.
  - Add libsword7 to Conflicts.
  - Fix case of sword to SWORD in package descriptions.
  - Bump Standards-Version to 3.8.1 (no changes needed).
  - Fix section for libsword-dbg to avoid lintian warning.
* debian/rules:
  - Add DFSG get-orig-source target.
* debian/copyright:
  - Fix various mistakes in initial attempt to document copyrights.

[ Dmitrijs Ledkovs ]
* debian/rules: Added utils.mk to use missing-files target and call it on
  each build.
* debian/libsword-dev.install: Added libsword.la, previously missing.
* debian/libsword7.install: Added missing libicu translit files.
* debian/control:
  - Updated all uses of SWORD version to 1.6
  - Added libsword-dbg package
* debian/watch: Fixed a small mistake which was resulting in extra "."
  in final version name.
* debian/rules: simplified manpage processing.
* debian/libsword8.lintian-overrides: added override for module
  installation directory.
* debian/copyright: Updated with information about everyfile.
  Closes: #513448 LP: #322638
* debian/diatheke.examples: moved examples here from the diatheke.install
* debian/rules:
  - enabled shell script based testsuite
  - added commented out cppunit testsuite
* debian/patches/40_missing_includes.diff: 
  - added several missing stdio.h includes to prevent FTBFS of testsuite.

[ Closed Bugs ]
* FTBFS on intrepid (LP: #305172)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
unit MainFrm;
 
2
 
 
3
interface
 
4
 
 
5
uses
 
6
  SysUtils, Types, Classes, Variants, QGraphics, QControls, QForms, QDialogs,
 
7
  QStdCtrls, QComCtrls, QExtCtrls, Sword;
 
8
 
 
9
type
 
10
  TForm1 = class(TForm)
 
11
    Panel1: TPanel;
 
12
    Panel2: TPanel;
 
13
    Panel3: TPanel;
 
14
    TreeView1: TTreeView;
 
15
    Button1: TButton;
 
16
    Edit1: TEdit;
 
17
    Label1: TLabel;
 
18
    TextBrowser1: TTextBrowser;
 
19
    procedure Edit1Change(Sender: TObject);
 
20
    procedure TreeView1Change(Sender: TObject; Node: TTreeNode);
 
21
    procedure Button1Click(Sender: TObject);
 
22
    procedure FormCreate(Sender: TObject);
 
23
    procedure FormShow(Sender: TObject);
 
24
  private
 
25
    procedure lookup();
 
26
  public
 
27
    { Public declarations }
 
28
  end;
 
29
 
 
30
var
 
31
   Form1: TForm1;
 
32
   mgr : SWMgr;
 
33
   
 
34
implementation
 
35
 
 
36
{$R *.xfm}
 
37
 
 
38
procedure TForm1.Edit1Change(Sender: TObject);
 
39
begin
 
40
   lookup();
 
41
end;
 
42
 
 
43
procedure TForm1.lookup();
 
44
var
 
45
   module : SWModule;
 
46
   node : TTreeNode;
 
47
   
 
48
begin
 
49
   node := TreeView1.Selected;
 
50
   if (node <> nil) then
 
51
   begin
 
52
      module := mgr.getModuleByName(node.Text);
 
53
      if (module <> nil) then
 
54
      begin
 
55
         module.setKeyText(Edit1.Text);
 
56
 
 
57
         TextBrowser1.Text := 
 
58
            '<HTML><BODY>' +
 
59
               '<small><b>' + module.getKeyText() + '<b></small> ' +
 
60
               module.getRenderText() +
 
61
            '</BODY></HTML>';
 
62
            
 
63
         Label1.Caption := ': ' + module.getKeyText();
 
64
      end;
 
65
   end;
 
66
end;
 
67
 
 
68
procedure TForm1.TreeView1Change(Sender: TObject; Node: TTreeNode);
 
69
begin
 
70
        lookup();
 
71
end;
 
72
 
 
73
procedure TForm1.Button1Click(Sender: TObject);
 
74
begin
 
75
   Application.Terminate;
 
76
end;
 
77
 
 
78
procedure TForm1.FormCreate(Sender: TObject);
 
79
begin
 
80
   mgr := SWMgr.Create;
 
81
end;
 
82
 
 
83
procedure TForm1.FormShow(Sender: TObject);
 
84
var
 
85
   root, node : TTreeNode;
 
86
   module : SWModule;
 
87
   modIt : ModIterator;
 
88
   found : Boolean;
 
89
   
 
90
begin
 
91
//   root := TreeView1.TopItem;
 
92
//   root := TreeView1.Items.AddChild(TreeView1.TopItem, 'Modules');
 
93
 
 
94
   modIt := mgr.getModulesIterator;
 
95
   module := modIt.getValue;
 
96
   while (module <> nil) do
 
97
   begin
 
98
        node := TreeView1.Items.GetFirstNode;
 
99
        found := false;
 
100
        while ((node <> nil) AND (NOT found)) do
 
101
        begin
 
102
           if (node.Text = module.getType) then
 
103
                found := true
 
104
           else node := node.getNextSibling;
 
105
        end;
 
106
        if (node = nil) then
 
107
           node := TreeView1.Items.AddChild(TreeView1.TopItem, module.GetType());
 
108
 
 
109
        TreeView1.Items.AddChild(node, module.GetName());
 
110
        
 
111
        modIt.Next;
 
112
        module := modIt.getValue;
 
113
   end;
 
114
end;
 
115
 
 
116
end.