Pachimo Ne U Vidid Form3
Pachimo mne ne u vidid Form3
// Unit 1 pas.
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, fs_ichartrtti, fs_iibxrtti, fs_idbctrlsrtti,
fs_idbrtti, fs_ibdertti, fs_iadortti, fs_iinirtti, fs_imenusrtti,
fs_idialogsrtti, fs_iextctrlsrtti, fs_iformsrtti, fs_igraphicsrtti,
fs_iclassesrtti, fs_ibasic, fs_ijs, fs_icpp, fs_ipascal, fs_iinterpreter,
Menus;
type
TForm1 = class(TForm)
Panel1: TPanel;
Button1: TButton;
Button2: TButton;
Memo1: TMemo;
fsScript1: TfsScript;
fsPascal1: TfsPascal;
fsCPP1: TfsCPP;
fsJScript1: TfsJScript;
fsBasic1: TfsBasic;
fsClassesRTTI1: TfsClassesRTTI;
fsGraphicsRTTI1: TfsGraphicsRTTI;
fsFormsRTTI1: TfsFormsRTTI;
fsExtCtrlsRTTI1: TfsExtCtrlsRTTI;
fsDialogsRTTI1: TfsDialogsRTTI;
fsMenusRTTI1: TfsMenusRTTI;
fsIniRTTI1: TfsIniRTTI;
fsADORTTI1: TfsADORTTI;
fsBDERTTI1: TfsBDERTTI;
fsDBRTTI1: TfsDBRTTI;
fsDBCtrlsRTTI1: TfsDBCtrlsRTTI;
fsIBXRTTI1: TfsIBXRTTI;
fsChartRTTI1: TfsChartRTTI;
MainMenu1: TMainMenu;
Deneme1: TMenuItem;
Deneme2: TMenuItem;
Memo2: TMemo;
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.Button1Click(Sender: TObject);
begin
// Running Script
fsScript1.Clear;
fsScript1.Lines.Clear;
fsGlobalUnit.Clear;
fsGlobalUnit.AddForm(tform(FindComponent('Form2')));
fsGlobalUnit.AddForm(tform(FindComponent('Form3')));
fsScript1.AddClass(TPanel, 'TPanel');
fsScript1.Lines.Add(Memo1.Lines.Text);
fsScript1.Parent := fsGlobalUnit;
if fsScript1.Compile then
Begin
fsScript1.Execute;
end else
Begin
ShowMessage(fsScript1.ErrorMsg + ' : '+fsScript1.ErrorPos);
End;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
// Runtime creating form ot form2
with TForm2.Create(Self) do
begin
Name:='Form2';
Left:=0;
Top:=0;
Show;
end;
with TForm2.Create(Self) do
begin
Name:='Form3';
Left:=0;
Top:=275;
Show;
end;
end;
end.
// Unit 1 DFM
object Form1: TForm1
Left = 268
Top = 122
Width = 870
Height = 500
Caption = 'Form1'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
FormStyle = fsMDIForm
Menu = MainMenu1
OldCreateOrder = False
WindowState = wsMaximized
PixelsPerInch = 96
TextHeight = 13
object Panel1: TPanel
Left = 0
Top = 0
Width = 325
Height = 444
Align = alLeft
TabOrder = 0
object Button1: TButton
Left = 100
Top = 12
Width = 75
Height = 25
Caption = 'Script Run'
TabOrder = 0
OnClick = Button1Click
end
object Button2: TButton
Left = 16
Top = 12
Width = 75
Height = 25
Caption = 'Form create'
TabOrder = 1
OnClick = Button2Click
end
object Memo1: TMemo
Left = 16
Top = 44
Width = 301
Height = 225
Lines.Strings = (
'Begin'
' Form2.Panel1.Visible:=True;'
' Form2.Panel1.caption:=''Form2 - Panel1''; '
' Form2.Panel1.color:=ClGreen; '
' Form2.Caption:=''Deneme - Form2'';'
''
' ShowMessage(''Eto script pokazal panel na Form2, Script ok'');'
''
' Form3.Panel1.Visible:=True;'
' Form3.Panel1.caption:=''Form3 - Panel1''; // Eto ne rabotayt ' +
'pachimota ne naydot coomponent na form3 naydot na form2'
' Form2.Panel1.color:=ClBlue; '
' Form3.Caption:=''Deneme - Form3''; // Eto rabotayt on paminayt ' +
'form3 caption'
' ShowMessage(''Eto script pachimota ne pokazivit panel na form3,' +
' Script ne pravilna rabotayt'');'
'end.')
TabOrder = 2
WordWrap = False
end
object Memo2: TMemo
Left = 16
Top = 276
Width = 301
Height = 153
Lines.Strings = (
'Testing Script'
''
'Snachala najimayti FormCreate'
'Patom script Run'
#13#10#10
''
''
'')
TabOrder = 3
WordWrap = False
end
end
object fsScript1: TfsScript
SyntaxType = 'PascalScript'
Left = 368
Top = 144
end
object fsPascal1: TfsPascal
Left = 420
Top = 160
end
object fsCPP1: TfsCPP
Left = 448
Top = 160
end
object fsJScript1: TfsJScript
Left = 476
Top = 160
end
object fsBasic1: TfsBasic
Left = 504
Top = 160
end
object fsClassesRTTI1: TfsClassesRTTI
Left = 532
Top = 160
end
object fsGraphicsRTTI1: TfsGraphicsRTTI
Left = 560
Top = 160
end
object fsFormsRTTI1: TfsFormsRTTI
Left = 588
Top = 160
end
object fsExtCtrlsRTTI1: TfsExtCtrlsRTTI
Left = 420
Top = 188
end
object fsDialogsRTTI1: TfsDialogsRTTI
Left = 448
Top = 188
end
object fsMenusRTTI1: TfsMenusRTTI
Left = 476
Top = 188
end
object fsIniRTTI1: TfsIniRTTI
Left = 504
Top = 188
end
object fsADORTTI1: TfsADORTTI
Left = 532
Top = 188
end
object fsBDERTTI1: TfsBDERTTI
Left = 560
Top = 188
end
object fsDBRTTI1: TfsDBRTTI
Left = 588
Top = 188
end
object fsDBCtrlsRTTI1: TfsDBCtrlsRTTI
Left = 420
Top = 216
end
object fsIBXRTTI1: TfsIBXRTTI
Left = 448
Top = 216
end
object fsChartRTTI1: TfsChartRTTI
Left = 476
Top = 216
end
object MainMenu1: TMainMenu
Left = 420
Top = 236
object Deneme1: TMenuItem
Caption = 'Deneme'
object Deneme2: TMenuItem
Caption = 'Deneme'
end
end
end
end
// Unit 2 pas
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;
type
TForm2 = class(TForm)
Panel1: TPanel;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
procedure TForm2.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action:=caFree;
end;
end.
// Unit2.DFM
object Form2: TForm2
Left = 356
Top = 201
Width = 316
Height = 286
Caption = 'Form2'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
FormStyle = fsMDIChild
OldCreateOrder = False
Position = poDefault
Visible = True
OnClose = FormClose
PixelsPerInch = 96
TextHeight = 13
object Panel1: TPanel
Left = 12
Top = 8
Width = 278
Height = 221
Caption = 'Panel1'
TabOrder = 0
Visible = False
end
end
Pojalusta pomos ?
// Unit 1 pas.
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, fs_ichartrtti, fs_iibxrtti, fs_idbctrlsrtti,
fs_idbrtti, fs_ibdertti, fs_iadortti, fs_iinirtti, fs_imenusrtti,
fs_idialogsrtti, fs_iextctrlsrtti, fs_iformsrtti, fs_igraphicsrtti,
fs_iclassesrtti, fs_ibasic, fs_ijs, fs_icpp, fs_ipascal, fs_iinterpreter,
Menus;
type
TForm1 = class(TForm)
Panel1: TPanel;
Button1: TButton;
Button2: TButton;
Memo1: TMemo;
fsScript1: TfsScript;
fsPascal1: TfsPascal;
fsCPP1: TfsCPP;
fsJScript1: TfsJScript;
fsBasic1: TfsBasic;
fsClassesRTTI1: TfsClassesRTTI;
fsGraphicsRTTI1: TfsGraphicsRTTI;
fsFormsRTTI1: TfsFormsRTTI;
fsExtCtrlsRTTI1: TfsExtCtrlsRTTI;
fsDialogsRTTI1: TfsDialogsRTTI;
fsMenusRTTI1: TfsMenusRTTI;
fsIniRTTI1: TfsIniRTTI;
fsADORTTI1: TfsADORTTI;
fsBDERTTI1: TfsBDERTTI;
fsDBRTTI1: TfsDBRTTI;
fsDBCtrlsRTTI1: TfsDBCtrlsRTTI;
fsIBXRTTI1: TfsIBXRTTI;
fsChartRTTI1: TfsChartRTTI;
MainMenu1: TMainMenu;
Deneme1: TMenuItem;
Deneme2: TMenuItem;
Memo2: TMemo;
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.Button1Click(Sender: TObject);
begin
// Running Script
fsScript1.Clear;
fsScript1.Lines.Clear;
fsGlobalUnit.Clear;
fsGlobalUnit.AddForm(tform(FindComponent('Form2')));
fsGlobalUnit.AddForm(tform(FindComponent('Form3')));
fsScript1.AddClass(TPanel, 'TPanel');
fsScript1.Lines.Add(Memo1.Lines.Text);
fsScript1.Parent := fsGlobalUnit;
if fsScript1.Compile then
Begin
fsScript1.Execute;
end else
Begin
ShowMessage(fsScript1.ErrorMsg + ' : '+fsScript1.ErrorPos);
End;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
// Runtime creating form ot form2
with TForm2.Create(Self) do
begin
Name:='Form2';
Left:=0;
Top:=0;
Show;
end;
with TForm2.Create(Self) do
begin
Name:='Form3';
Left:=0;
Top:=275;
Show;
end;
end;
end.
// Unit 1 DFM
object Form1: TForm1
Left = 268
Top = 122
Width = 870
Height = 500
Caption = 'Form1'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
FormStyle = fsMDIForm
Menu = MainMenu1
OldCreateOrder = False
WindowState = wsMaximized
PixelsPerInch = 96
TextHeight = 13
object Panel1: TPanel
Left = 0
Top = 0
Width = 325
Height = 444
Align = alLeft
TabOrder = 0
object Button1: TButton
Left = 100
Top = 12
Width = 75
Height = 25
Caption = 'Script Run'
TabOrder = 0
OnClick = Button1Click
end
object Button2: TButton
Left = 16
Top = 12
Width = 75
Height = 25
Caption = 'Form create'
TabOrder = 1
OnClick = Button2Click
end
object Memo1: TMemo
Left = 16
Top = 44
Width = 301
Height = 225
Lines.Strings = (
'Begin'
' Form2.Panel1.Visible:=True;'
' Form2.Panel1.caption:=''Form2 - Panel1''; '
' Form2.Panel1.color:=ClGreen; '
' Form2.Caption:=''Deneme - Form2'';'
''
' ShowMessage(''Eto script pokazal panel na Form2, Script ok'');'
''
' Form3.Panel1.Visible:=True;'
' Form3.Panel1.caption:=''Form3 - Panel1''; // Eto ne rabotayt ' +
'pachimota ne naydot coomponent na form3 naydot na form2'
' Form2.Panel1.color:=ClBlue; '
' Form3.Caption:=''Deneme - Form3''; // Eto rabotayt on paminayt ' +
'form3 caption'
' ShowMessage(''Eto script pachimota ne pokazivit panel na form3,' +
' Script ne pravilna rabotayt'');'
'end.')
TabOrder = 2
WordWrap = False
end
object Memo2: TMemo
Left = 16
Top = 276
Width = 301
Height = 153
Lines.Strings = (
'Testing Script'
''
'Snachala najimayti FormCreate'
'Patom script Run'
#13#10#10
''
''
'')
TabOrder = 3
WordWrap = False
end
end
object fsScript1: TfsScript
SyntaxType = 'PascalScript'
Left = 368
Top = 144
end
object fsPascal1: TfsPascal
Left = 420
Top = 160
end
object fsCPP1: TfsCPP
Left = 448
Top = 160
end
object fsJScript1: TfsJScript
Left = 476
Top = 160
end
object fsBasic1: TfsBasic
Left = 504
Top = 160
end
object fsClassesRTTI1: TfsClassesRTTI
Left = 532
Top = 160
end
object fsGraphicsRTTI1: TfsGraphicsRTTI
Left = 560
Top = 160
end
object fsFormsRTTI1: TfsFormsRTTI
Left = 588
Top = 160
end
object fsExtCtrlsRTTI1: TfsExtCtrlsRTTI
Left = 420
Top = 188
end
object fsDialogsRTTI1: TfsDialogsRTTI
Left = 448
Top = 188
end
object fsMenusRTTI1: TfsMenusRTTI
Left = 476
Top = 188
end
object fsIniRTTI1: TfsIniRTTI
Left = 504
Top = 188
end
object fsADORTTI1: TfsADORTTI
Left = 532
Top = 188
end
object fsBDERTTI1: TfsBDERTTI
Left = 560
Top = 188
end
object fsDBRTTI1: TfsDBRTTI
Left = 588
Top = 188
end
object fsDBCtrlsRTTI1: TfsDBCtrlsRTTI
Left = 420
Top = 216
end
object fsIBXRTTI1: TfsIBXRTTI
Left = 448
Top = 216
end
object fsChartRTTI1: TfsChartRTTI
Left = 476
Top = 216
end
object MainMenu1: TMainMenu
Left = 420
Top = 236
object Deneme1: TMenuItem
Caption = 'Deneme'
object Deneme2: TMenuItem
Caption = 'Deneme'
end
end
end
end
// Unit 2 pas
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;
type
TForm2 = class(TForm)
Panel1: TPanel;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
procedure TForm2.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action:=caFree;
end;
end.
// Unit2.DFM
object Form2: TForm2
Left = 356
Top = 201
Width = 316
Height = 286
Caption = 'Form2'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
FormStyle = fsMDIChild
OldCreateOrder = False
Position = poDefault
Visible = True
OnClose = FormClose
PixelsPerInch = 96
TextHeight = 13
object Panel1: TPanel
Left = 12
Top = 8
Width = 278
Height = 221
Caption = 'Panel1'
TabOrder = 0
Visible = False
end
end
Pojalusta pomos ?
Комментарии