~ubuntu-branches/ubuntu/dapper/fpc/dapper

« back to all changes in this revision

Viewing changes to utils/fpdoc/fpde/frmnewnode.pp

  • Committer: Bazaar Package Importer
  • Author(s): Carlos Laviola
  • Date: 2004-08-12 16:29:37 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20040812162937-moo8ulvysp1ln771
Tags: 1.9.4-5
fp-compiler: needs ld, adding dependency on binutils.  (Closes: #265265)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
{$mode objfpc}
 
2
{$h+}
 
3
 
 
4
unit frmnewnode;
 
5
 
 
6
interface
 
7
 
 
8
uses fpgtk,gtk,classes,sysutils;
 
9
 
 
10
Type
 
11
  TNewNodeForm = Class (TFPGtkWindow)
 
12
    FTable : TFPGtkTable;
 
13
    FLENodeName : TFPGtkLabel;
 
14
    FENodeName : TFPGtkEntry;
 
15
    FSeparator : TFPGtkHSeparator;
 
16
    FVBox : TFPgtkVBox;
 
17
    FOK,
 
18
    FCancel : TFPGtkButton;
 
19
    FButtonBox: TFPgtkHBox;
 
20
    Constructor Create;
 
21
    Procedure CreateWindow;
 
22
    Procedure OnShow(Sender : TFpGtkObject;Data : Pointer);
 
23
  end;
 
24
  
 
25
Implementation
 
26
 
 
27
uses 
 
28
  fpdemsg;
 
29
  
 
30
Constructor TNewNodeForm.Create;
 
31
 
 
32
begin
 
33
  Inherited Create(GTK_WINDOW_DIALOG);
 
34
  CreateWindow;
 
35
end;
 
36
 
 
37
Procedure TNewNodeForm.CreateWindow;
 
38
 
 
39
Var
 
40
  OH,OV : TgtkAttachOPtions;
 
41
  
 
42
begin
 
43
  FVBox:=TFPGtkVBox.Create;
 
44
  FVBox.Spacing:=4;
 
45
  FVBox.Border:=8;
 
46
  Add(FVBox);
 
47
  // Table area
 
48
  FTable:=TFPGtkTable.Create(1,1);
 
49
  FLENodeName:=TFPGtkLabel.Create(SName);
 
50
  FLENodeName.Justify:=GTK_JUSTIFY_RIGHT;
 
51
  FENodeName:=TFPgtkEntry.Create;
 
52
  FENodeName.GrabFocus;
 
53
  OH:=GTK_EXPAND or GTK_FILL;
 
54
  FTable.Attach(FLENodeName,0,1,0,1,0,GTK_FILL,4,4);
 
55
  FTable.Attach(FENodeName,1,2,0,1,OH,0,4,4);
 
56
  // button area
 
57
  FOK:=TFpGtkButton.CreateWithLabel(SOK);
 
58
  FOK.ConnectClicked(@CloseWithResult,IntToPointer(drOK));
 
59
  FCancel:=TFPgtkButton.CreateWithLabel(SCancel);
 
60
  FCancel.ConnectCLicked(@CloseWithResult,IntToPointer(drCancel));
 
61
  FSeparator:=TFPgtkHSeparator.Create;
 
62
  FButtonBox:=TfpGtkHBox.Create;
 
63
  FButtonBox.Spacing:=4;
 
64
  FButtonBox.PackEnd(FOK,false,false,4);
 
65
  FButtonBox.PackEnd(FCancel,false,false,4);
 
66
  // Add to window
 
67
  FVBox.PackStart(FTable,False,False,0);
 
68
  FVBox.PackStart(FSeparator,False,False,4);
 
69
  FVBox.PackStart(FButtonBox,false,false,0);
 
70
  // Some events;
 
71
  ConnectShow(@OnShow,Nil);
 
72
end;
 
73
 
 
74
Procedure TNewNodeForm.OnShow(Sender : TFpgtkObject; Data : Pointer);
 
75
 
 
76
begin
 
77
  FocusedWidget(FENodeName);
 
78
end;
 
79
 
 
80
 
 
81
end.  
 
 
b'\\ No newline at end of file'