diff options
author | danglassey <danglassey> | 2002-08-14 09:57:17 +0000 |
---|---|---|
committer | danglassey <danglassey> | 2002-08-14 09:57:17 +0000 |
commit | c9458897ebbb739d8db83c80e06512d8a612f743 (patch) | |
tree | f8c5381045887e34388cc6b26cfccc254bf766dc /bindings/clx/test1 | |
download | sword-sf-cvs-c9458897ebbb739d8db83c80e06512d8a612f743.tar.gz |
*** empty log message ***
Diffstat (limited to 'bindings/clx/test1')
-rw-r--r-- | bindings/clx/test1/MainFrm.pas | 116 | ||||
-rw-r--r-- | bindings/clx/test1/MainFrm.xfm | 90 | ||||
-rw-r--r-- | bindings/clx/test1/test1.conf | 36 | ||||
-rw-r--r-- | bindings/clx/test1/test1.dpr | 14 | ||||
-rw-r--r-- | bindings/clx/test1/test1.kof | 61 | ||||
-rw-r--r-- | bindings/clx/test1/test1.res | bin | 0 -> 32 bytes | |||
-rw-r--r-- | bindings/clx/test1/test1g.bpg | 15 |
7 files changed, 332 insertions, 0 deletions
diff --git a/bindings/clx/test1/MainFrm.pas b/bindings/clx/test1/MainFrm.pas new file mode 100644 index 0000000..2d28a7f --- /dev/null +++ b/bindings/clx/test1/MainFrm.pas @@ -0,0 +1,116 @@ +unit MainFrm; + +interface + +uses + SysUtils, Types, Classes, Variants, QGraphics, QControls, QForms, QDialogs, + QStdCtrls, QComCtrls, QExtCtrls, Sword; + +type + TForm1 = class(TForm) + Panel1: TPanel; + Panel2: TPanel; + Panel3: TPanel; + TreeView1: TTreeView; + Button1: TButton; + Edit1: TEdit; + Label1: TLabel; + TextBrowser1: TTextBrowser; + procedure Edit1Change(Sender: TObject); + procedure TreeView1Change(Sender: TObject; Node: TTreeNode); + procedure Button1Click(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure FormShow(Sender: TObject); + private + procedure lookup(); + public + { Public declarations } + end; + +var + Form1: TForm1; + mgr : SWMgr; + +implementation + +{$R *.xfm} + +procedure TForm1.Edit1Change(Sender: TObject); +begin + lookup(); +end; + +procedure TForm1.lookup(); +var + module : SWModule; + node : TTreeNode; + +begin + node := TreeView1.Selected; + if (node <> nil) then + begin + module := mgr.getModuleByName(node.Text); + if (module <> nil) then + begin + module.setKeyText(Edit1.Text); + + TextBrowser1.Text := + '<HTML><BODY>' + + '<small><b>' + module.getKeyText() + '<b></small> ' + + module.getRenderText() + + '</BODY></HTML>'; + + Label1.Caption := ': ' + module.getKeyText(); + end; + end; +end; + +procedure TForm1.TreeView1Change(Sender: TObject; Node: TTreeNode); +begin + lookup(); +end; + +procedure TForm1.Button1Click(Sender: TObject); +begin + Application.Terminate; +end; + +procedure TForm1.FormCreate(Sender: TObject); +begin + mgr := SWMgr.Create; +end; + +procedure TForm1.FormShow(Sender: TObject); +var + root, node : TTreeNode; + module : SWModule; + modIt : ModIterator; + found : Boolean; + +begin +// root := TreeView1.TopItem; +// root := TreeView1.Items.AddChild(TreeView1.TopItem, 'Modules'); + + modIt := mgr.getModulesIterator; + module := modIt.getValue; + while (module <> nil) do + begin + node := TreeView1.Items.GetFirstNode; + found := false; + while ((node <> nil) AND (NOT found)) do + begin + if (node.Text = module.getType) then + found := true + else node := node.getNextSibling; + end; + if (node = nil) then + node := TreeView1.Items.AddChild(TreeView1.TopItem, module.GetType()); + + TreeView1.Items.AddChild(node, module.GetName()); + + modIt.Next; + module := modIt.getValue; + end; +end; + +end. diff --git a/bindings/clx/test1/MainFrm.xfm b/bindings/clx/test1/MainFrm.xfm new file mode 100644 index 0000000..ce77f46 --- /dev/null +++ b/bindings/clx/test1/MainFrm.xfm @@ -0,0 +1,90 @@ +object Form1: TForm1 + Left = 260 + Top = 148 + Width = 592 + Height = 487 + HorzScrollBar.Range = 185 + VertScrollBar.Range = 41 + Caption = 'Form1' + Color = clBackground + OnCreate = FormCreate + OnShow = FormShow + PixelsPerInch = 108 + TextHeight = 20 + TextWidth = 8 + object Panel1: TPanel + Left = 0 + Top = 41 + Width = 185 + Height = 446 + Align = alLeft + Caption = 'Panel1' + TabOrder = 0 + object TreeView1: TTreeView + Left = 1 + Top = 1 + Width = 183 + Height = 444 + Align = alClient + Columns = <> + TabOrder = 0 + OnChange = TreeView1Change + end + end + object Panel2: TPanel + Left = 185 + Top = 41 + Width = 407 + Height = 446 + Align = alClient + Caption = 'Panel2' + TabOrder = 1 + object TextBrowser1: TTextBrowser + Left = 1 + Top = 1 + Width = 405 + Height = 444 + Align = alClient + TabOrder = 0 + TextFormat = tfText + end + end + object Panel3: TPanel + Left = 0 + Top = 0 + Width = 592 + Height = 41 + Align = alTop + TabOrder = 2 + object Button1: TButton + Left = 509 + Top = 8 + Width = 75 + Height = 25 + Anchors = [akTop, akRight] + Caption = 'Exit' + TabOrder = 0 + OnClick = Button1Click + end + object Edit1: TEdit + Left = 136 + Top = 8 + Width = 177 + Height = 28 + TabOrder = 1 + OnChange = Edit1Change + end + object Label1: TLabel + Left = 328 + Top = 12 + Width = 1 + Height = 20 + Font.Color = clBlack + Font.Height = 17 + Font.Name = 'Helvetica' + Font.Pitch = fpVariable + Font.Style = [fsBold] + ParentFont = False + end + end +end diff --git a/bindings/clx/test1/test1.conf b/bindings/clx/test1/test1.conf new file mode 100644 index 0000000..b6fb6e7 --- /dev/null +++ b/bindings/clx/test1/test1.conf @@ -0,0 +1,36 @@ +-$A8 +-$B- +-$C+ +-$D+ +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J- +-$K- +-$L+ +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$YD +-$Z1 +-cg +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-U"../" +-O"../" +-I"../" +-R"../" diff --git a/bindings/clx/test1/test1.dpr b/bindings/clx/test1/test1.dpr new file mode 100644 index 0000000..7b18af9 --- /dev/null +++ b/bindings/clx/test1/test1.dpr @@ -0,0 +1,14 @@ +program test1; + +uses + QForms, + MainFrm in 'MainFrm.pas' {Form1}, + Sword in '../Sword.pas'; + +{$R *.res} + +begin + Application.Initialize; + Application.CreateForm(TForm1, Form1); + Application.Run; +end. diff --git a/bindings/clx/test1/test1.kof b/bindings/clx/test1/test1.kof new file mode 100644 index 0000000..99b034e --- /dev/null +++ b/bindings/clx/test1/test1.kof @@ -0,0 +1,61 @@ +[Compiler] +A=8 +B=0 +C=1 +D=1 +E=0 +F=0 +G=1 +H=1 +I=1 +J=0 +K=0 +L=1 +M=0 +N=1 +O=1 +P=1 +Q=0 +R=0 +S=0 +T=0 +U=0 +V=1 +W=0 +X=1 +Y=1 +Z=1 +ShowHints=1 +ShowWarnings=1 +UnitAliases= + +[Linker] +MapFile=0 +OutputObjs=0 +ConsoleApp=1 +DebugInfo=0 +RemoteSymbols=0 +MinStackSize=16384 +MaxStackSize=1048576 +ImageBase=4194304 +ExeDescription= +DynamicLoader=/lib/ld-linux.so.2 + +[Directories] +OutputDir= +UnitOutputDir= +PackageDLLOutputDir= +PackageDCPOutputDir= +SearchPath=../ +Packages=baseclx:visualclx +Conditionals= +DebugSourceDirs= +UsePackages=0 + +[Parameters] +RunParams= +HostApplication= +Launcher=/usr/X11R6/bin/xterm -T KylixDebuggerOutput -e bash -i -c %debuggee% +UseLauncher=0 +DebugCWD= + diff --git a/bindings/clx/test1/test1.res b/bindings/clx/test1/test1.res Binary files differnew file mode 100644 index 0000000..36f26e2 --- /dev/null +++ b/bindings/clx/test1/test1.res diff --git a/bindings/clx/test1/test1g.bpg b/bindings/clx/test1/test1g.bpg new file mode 100644 index 0000000..db19a61 --- /dev/null +++ b/bindings/clx/test1/test1g.bpg @@ -0,0 +1,15 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.02.5 +#------------------------------------------------------------------------------ +MAKE = make -$(MAKEFLAGS) -f$** +DCC =dcc $< +#------------------------------------------------------------------------------ +PROJECTS = test1 +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +test1: test1.dpr + $(DCC) + + |