ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/JDesigner/uColorOpts.pas
Revision: 1.1.1.1 (vendor branch)
Committed: Mon Dec 10 19:29:11 2001 UTC (14 years, 9 months ago) by hsauro
Branch: MAIN, hsauro
CVS Tags: V10, HEAD_NEW, HEAD
Changes since 1.1: +0 -0 lines
Log Message:
no message

Line File contents
1 unit uColorOpts;
2
3 interface
4
5 uses
6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
7 StdCtrls, ColCombo, Buttons;
8
9 type
10 TfrmColorOpts = class(TForm)
11 BtnOK: TButton;
12 BtnCancel: TButton;
13 GroupBox1: TGroupBox;
14 Label1: TLabel;
15 Label2: TLabel;
16 ccboGlobalFloatingSpeciesColor: TColorCombo;
17 ccboGlobalBoundarySpeciesColor: TColorCombo;
18 Label3: TLabel;
19 GroupBox2: TGroupBox;
20 cboFloatingSpecies: TComboBox;
21 ccboFloating: TColorCombo;
22 ccboBoundary: TColorCombo;
23 cboBoundarySpecies: TComboBox;
24 Label4: TLabel;
25 ccboGlobalReactionsColor: TColorCombo;
26 cboReactions: TComboBox;
27 Label5: TLabel;
28 Label6: TLabel;
29 Label7: TLabel;
30 ccboReactions: TColorCombo;
31 Label8: TLabel;
32 ccboBackground: TColorCombo;
33 Label9: TLabel;
34 BtnFont: TSpeedButton;
35 FontDialog: TFontDialog;
36 procedure cboFloatingSpeciesChange(Sender: TObject);
37 procedure FormShow(Sender: TObject);
38 procedure cboBoundarySpeciesChange(Sender: TObject);
39 procedure cboReactionsChange(Sender: TObject);
40 procedure ccboFloatingChange(Sender: TObject);
41 procedure ccboBoundaryChange(Sender: TObject);
42 procedure ccboReactionsChange(Sender: TObject);
43 procedure ccboBackgroundChange(Sender: TObject);
44 procedure ccboGlobalReactionsColorChange(Sender: TObject);
45 procedure ccboGlobalBoundarySpeciesColorChange(Sender: TObject);
46 procedure ccboGlobalFloatingSpeciesColorChange(Sender: TObject);
47 procedure BtnFontClick(Sender: TObject);
48 private
49 { Private declarations }
50 public
51 { Public declarations }
52 end;
53
54 var
55 frmColorOpts: TfrmColorOpts;
56
57 implementation
58
59 Uses uNodeList, uEdgeList, ufJDesigner;
60
61 {$R *.DFM}
62
63 procedure TfrmColorOpts.cboFloatingSpeciesChange(Sender: TObject);
64 var cbo : TComboBox;
65 begin
66 cbo := Sender as TComboBox;
67 ccboFloating.Color := TNode (cbo.Items.Objects[cbo.ItemIndex]).EdgeColor;
68 end;
69
70
71 procedure TfrmColorOpts.FormShow(Sender: TObject);
72 begin
73 if cboFloatingSpecies.ItemIndex <> -1 then
74 ccboFloating.Color := TNode (cboFloatingSpecies.Items.Objects[cboFloatingSpecies.ItemIndex]).EdgeColor;
75 if cboBoundarySpecies.ItemIndex <> -1 then
76 ccboBoundary.Color := TNode (cboBoundarySpecies.Items.Objects[cboBoundarySpecies.ItemIndex]).EdgeColor;
77 if cboReactions.ItemIndex <> -1 then
78 ccboReactions.Color := TEdge (cboReactions.Items.Objects[cboReactions.ItemIndex]).LineColor;
79 end;
80
81
82 procedure TfrmColorOpts.cboBoundarySpeciesChange(Sender: TObject);
83 var cbo : TComboBox;
84 begin
85 cbo := Sender as TComboBox;
86 ccboBoundary.Color := TNode (cbo.Items.Objects[cbo.ItemIndex]).EdgeColor;
87 end;
88
89 procedure TfrmColorOpts.cboReactionsChange(Sender: TObject);
90 var cbo : TComboBox;
91 begin
92 cbo := Sender as TComboBox;
93 ccboReactions.Color := TEdge (cbo.Items.Objects[cbo.ItemIndex]).LineColor;
94 end;
95
96 procedure TfrmColorOpts.ccboFloatingChange(Sender: TObject);
97 begin
98 TNode (cboFloatingSpecies.Items.Objects[cboFloatingSpecies.ItemIndex]).EdgeColor := ccboFloating.Color;
99 frmNetworkEd.NetPanel.Paint;
100 end;
101
102 procedure TfrmColorOpts.ccboBoundaryChange(Sender: TObject);
103 begin
104 TNode (cboBoundarySpecies.Items.Objects[cboBoundarySpecies.ItemIndex]).EdgeColor := ccboBoundary.Color;
105 frmNetworkEd.NetPanel.Paint;
106 end;
107
108 procedure TfrmColorOpts.ccboReactionsChange(Sender: TObject);
109 begin
110 TEdge (cboReactions.Items.Objects[cboReactions.ItemIndex]).LineColor := ccboReactions.Color;
111 frmNetworkEd.NetPanel.Paint;
112 end;
113
114 procedure TfrmColorOpts.ccboBackgroundChange(Sender: TObject);
115 begin
116 frmNetworkEd.Netpanel.Network.BackGroundColor := ccboBackGround.Color;
117 frmNetworkEd.NetPanel.Paint;
118 end;
119
120 procedure TfrmColorOpts.ccboGlobalReactionsColorChange(Sender: TObject);
121 begin
122 frmNetworkEd.NetPanel.Network.GlobalArcColor := ccboGlobalReactionsColor.Color;
123 frmNetworkEd.NetPanel.Paint;
124 end;
125
126 procedure TfrmColorOpts.ccboGlobalBoundarySpeciesColorChange(Sender: TObject);
127 begin
128 frmNetworkEd.NetPanel.Network.GlobalBoundaryNodeColor := ccboGlobalBoundarySpeciesColor.Color;
129 frmNetworkEd.NetPanel.Paint;
130 end;
131
132 procedure TfrmColorOpts.ccboGlobalFloatingSpeciesColorChange(Sender: TObject);
133 begin
134 frmNetworkEd.NetPanel.Network.GlobalFloatingNodeColor := ccboGlobalFloatingSpeciesColor.Color;
135 frmNetworkEd.NetPanel.Paint;
136 end;
137
138 procedure TfrmColorOpts.BtnFontClick(Sender: TObject);
139 begin
140 FontDialog.Font.Color := frmNetworkEd.Netpanel.Network.NodeList.GetGlobalTextColor;
141 if FontDialog.Execute then
142 frmNetworkEd.NetPanel.Network.SetGlobalFont (PChar (FontDialog.Font.Name), FontDialog.Font.Size, FontDialog.Font.Color);
143 frmNetworkEd.NetPanel.Paint;
144 end;
145
146 end.