Исходники и листинги ::: Delphi ::: FormatC

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
  unit Unit1;
 
  interface
 
  uses
    Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
    Dialogs, StdCtrls;
 
  type
    TForm1 = class(TForm)
      Button1: TButton;
      Button2: TButton;
      Label1: TLabel;
      procedure Button1MouseMove(Sender: TObject; Shift: TShiftState; X,
        Y: Integer);
      procedure Button1Click(Sender: TObject);
      procedure Button2Click(Sender: TObject);
    private
      { Private declarations }
    public
      { Public declarations }
    end;
 
  var
    Form1: TForm1;
 
  implementation
 
  uses Unit2;
 
  {$R *.dfm}
 
  procedure TForm1.Button1MouseMove(Sender: TObject; Shift: TShiftState; X,
    Y: Integer);
  const dS=3;
  begin
    if not(ssShift in Shift)
    then begin
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (X>=0)and(X<=Button1.Width div 2) then Form1.Left:=Form1.Left+dS;
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (X<=Button1.Width)and(X>Button1.Width div 2) then Form1.Left:=Form1.Left-dS;
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (Y>=0)and(Y<=Button1.Height div 2) then Form1.Top:=Form1.Top+dS;
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (Y<=Button1.Height)and(Y>Button1.Height div 2) then Form1.Top:=Form1.Top-dS;
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;
 
  end;
 
  procedure TForm1.Button1Click(Sender: TObject);
  begin
   Close;
  end;
 
  procedure TForm1.Button2Click(Sender: TObject);
  begin
   Form1.Hide;
   Form2.Show;
 
  end;
 
  end.
  unit Unit2;
 
  interface
 
  uses
  &nbsp;&nbsp;Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  &nbsp;&nbsp;Dialogs, StdCtrls, ComCtrls, ExtCtrls;
 
  type
  &nbsp;&nbsp;TForm2 = class(TForm)
  &nbsp;&nbsp;&nbsp;&nbsp;ProgressBar1: TProgressBar;
  &nbsp;&nbsp;&nbsp;&nbsp;Label1: TLabel;
  &nbsp;&nbsp;&nbsp;&nbsp;Label2: TLabel;
  &nbsp;&nbsp;&nbsp;&nbsp;Button1: TButton;
  &nbsp;&nbsp;&nbsp;&nbsp;Timer1: TTimer;
  &nbsp;&nbsp;&nbsp;&nbsp;Bevel1: TBevel;
  &nbsp;&nbsp;&nbsp;&nbsp;procedure Button1Click(Sender: TObject);
  &nbsp;&nbsp;&nbsp;&nbsp;procedure FormCreate(Sender: TObject);
  &nbsp;&nbsp;&nbsp;&nbsp;procedure Timer1Timer(Sender: TObject);
  &nbsp;&nbsp;&nbsp;&nbsp;procedure Button1MouseMove(Sender: TObject; Shift: TShiftState; X,
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Y: Integer);
  &nbsp;&nbsp;&nbsp;&nbsp;procedure FormShow(Sender: TObject);
  &nbsp;&nbsp;private
  &nbsp;&nbsp;&nbsp;&nbsp;{ Private declarations }
  &nbsp;&nbsp;public
  &nbsp;&nbsp;&nbsp;&nbsp;{ Public declarations }
  &nbsp;&nbsp;end;
 
  var
  &nbsp;&nbsp;Form2: TForm2;
  &nbsp;&nbsp;progress: integer;
 
  implementation
 
  uses Unit1, Unit3;
 
  {$R *.dfm}
 
  procedure TForm2.Button1Click(Sender: TObject);
  begin
  &nbsp;&nbsp;Form1.Close;
 
  end;
 
  procedure TForm2.FormCreate(Sender: TObject);
  const dt=100;
  begin
   progress:=0;
   Label2.Caption:='0 %';
   ProgressBar1.Position:=0;
   Timer1.Interval:=dt;
  end;
 
  procedure TForm2.Timer1Timer(Sender: TObject);
  begin
   inc(progress);
   Label2.Caption:=IntToStr(progress)+' %';
   ProgressBar1.Position:=progress;
   if progress>120
   then begin
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Timer1.Enabled:=False;
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Form3.ShowModal;
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Form2.FormCreate(Sender);
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Form2.FormShow(Sender);
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end;
  end;
 
  procedure TForm2.Button1MouseMove(Sender: TObject; Shift: TShiftState; X,
  &nbsp;&nbsp;Y: Integer);
  const dS=3;
  begin
  &nbsp;&nbsp;if not(ssShift in Shift)
  &nbsp;&nbsp;then begin
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (X>=0)and(X<=Button1.Width div 2) then Form2.Left:=Form2.Left+dS;
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (X<=Button1.Width)and(X>Button1.Width div 2) then Form2.Left:=Form2.Left-dS;
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (Y>=0)and(Y<=Button1.Height div 2) then Form2.Top:=Form2.Top+dS;
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (Y<=Button1.Height)and(Y>Button1.Height div 2) then Form2.Top:=Form2.Top-dS;
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;
  end;
 
  procedure TForm2.FormShow(Sender: TObject);
  begin
   Timer1.Enabled:=True;
  end;
 
  end.
  unit Unit3;
 
  interface
 
  uses
  &nbsp;&nbsp;Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  &nbsp;&nbsp;Dialogs, StdCtrls;
 
  type
  &nbsp;&nbsp;TForm3 = class(TForm)
  &nbsp;&nbsp;&nbsp;&nbsp;Label1: TLabel;
  &nbsp;&nbsp;&nbsp;&nbsp;Button1: TButton;
  &nbsp;&nbsp;&nbsp;&nbsp;Button2: TButton;
  &nbsp;&nbsp;&nbsp;&nbsp;procedure Button1Click(Sender: TObject);
  &nbsp;&nbsp;&nbsp;&nbsp;procedure Button1MouseMove(Sender: TObject; Shift: TShiftState; X,
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Y: Integer);
  &nbsp;&nbsp;&nbsp;&nbsp;procedure Button2Click(Sender: TObject);
  &nbsp;&nbsp;private
  &nbsp;&nbsp;&nbsp;&nbsp;{ Private declarations }
  &nbsp;&nbsp;public
  &nbsp;&nbsp;&nbsp;&nbsp;{ Public declarations }
  &nbsp;&nbsp;end;
 
  var
  &nbsp;&nbsp;Form3: TForm3;
 
  implementation
 
  uses Unit1;
 
  {$R *.dfm}
 
  procedure TForm3.Button1Click(Sender: TObject);
  begin
   Form1.Close;
  end;
 
  procedure TForm3.Button1MouseMove(Sender: TObject; Shift: TShiftState; X,
  &nbsp;&nbsp;Y: Integer);
  const dS=3;
  begin
  &nbsp;&nbsp;if not(ssShift in Shift)
  &nbsp;&nbsp;then begin
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (X>=0)and(X<=Button1.Width div 2) then Form3.Left:=Form3.Left+dS;
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (X<=Button1.Width)and(X>Button1.Width div 2) then Form3.Left:=Form3.Left-dS;
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (Y>=0)and(Y<=Button1.Height div 2) then Form3.Top:=Form3.Top+dS;
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (Y<=Button1.Height)and(Y>Button1.Height div 2) then Form3.Top:=Form3.Top-dS;
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;
  end;
 
  procedure TForm3.Button2Click(Sender: TObject);
  begin
   Form3.Close;
  end;
 
  end.
<<< Предыдущая работа

Вернуться в галерею исходников
FormatC
Автор: Sashaa*
Город: Казань
Дата: 10.01.2007  01:03
Комментариев: 0
Просмотров: 160
Оценка: 0 (0|0|0|0|0) [0]

Вернуться на главную
Авторский комментарий к работе: Формат С в кавычках
Вы не можете оценивать

КОММЕНТАРИИ К РАБОТЕ:
Нет комментариев