📄 sesytemmdi.pas
字号:
unit SESytemMDI;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Menus, ExtCtrls, jpeg, StdCtrls, Buttons, ComCtrls, ToolWin;
type
TSESystemMDIForm = class(TForm)
SESystemMenu: TMainMenu;
SESystemMenuFile: TMenuItem;
SESystemMenuHelp: TMenuItem;
SESystemMenuOptiion: TMenuItem;
SESystemMenuAbout: TMenuItem;
SESystemMenuNew: TMenuItem;
SESystemMenuExit: TMenuItem;
CommandCoolBar:TCoolBar;
CommandRichEdit: TRichEdit;
CommandEdit: TEdit;
procedure SESystemMenuExitClick(Sender: TObject);
procedure SESystemMenuNewClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure SESystemMenuOptiionClick(Sender: TObject);
procedure CommandEditKeyPress(Sender: TObject; var Key: Char);
procedure SESystemMenuAboutClick(Sender: TObject);
private
{ Private declarations }
public
end;
var SESystemMDIForm: TSESystemMDIForm;
implementation
{$R *.dfm}
uses New,Balance, Analog, Improve,about, Gas, InHeat, OutHeat, Regenerator,
Operation, Burning,Declare;
procedure TSESystemMDIForm.SESystemMenuExitClick(Sender: TObject);
begin
CommandRichEdit.Lines.Add('命令:退出X'+chr(13));
Close;
end;
procedure TSESystemMDIForm.SESystemMenuNewClick(Sender: TObject);
var pop:TNewForm;
begin
CommandRichEdit.Lines.Add('命令:新建工程N'+chr(13));
pop:=TNewForm.Create(Self);
pop.Show;
end;
procedure TSESystemMDIForm.FormCreate(Sender: TObject);
var pop:TNewForm;
begin
InitialSESystem;
WriteSESystemFile(ExtractFilePath(Application.ExeName)+'\data\sesystem.hsd');
CommandRichEdit.Lines.Add('命令:新建工程N'+chr(13));
pop:=TNewForm.Create(Self);
pop.Show;
end;
procedure TSESystemMDIForm.SESystemMenuOptiionClick(Sender: TObject);
begin
CommandRichEdit.Lines.Add('命令:帮助HLP'+chr(13));
Application.HelpFile:=ExtractFilePath(Application.ExeName)+'\hlp\SESystem.hlp';
Application.HelpCommand(HELP_FINDER,0);
end;
procedure TSESystemMDIForm.CommandEditKeyPress(Sender: TObject; var Key: Char);
var
commandbuffer:PChar;
new:TNewForm;
about:TAboutForm;
i ,size: Integer;
begin
if key=chr(13) then
begin
commandedit.SelectAll;
size:=CommandEdit.SelLength;
Inc(size);
GetMem(commandbuffer, size);
CommandEdit.GetSelTextBuf(commandbuffer,size);
for i := 0 to Length(commandbuffer)-1 do
commandbuffer[i] := upcase(commandbuffer[i]);
if strcomp(commandbuffer,'N')=0 then
begin
CommandRichEdit.Lines.Add('命令:新建工程'+commandbuffer+chr(13));
new:=TNewForm.Create(Self);
new.Show;
end
else if strcomp(commandbuffer,'X')=0 then
begin
CommandRichEdit.Lines.Add('命令:退出'+commandbuffer+chr(13));
Close;
end
else if strcomp(commandbuffer,'BAL')=0 then
begin
CommandRichEdit.Lines.Add('命令:热平衡'+commandbuffer+chr(13));
BalanceForm:=TBalanceForm.Create(Self);
end
else if strcomp(commandbuffer,'ANA')=0 then
begin
CommandRichEdit.Lines.Add('命令:热模拟'+commandbuffer+chr(13));
AnalogForm:=TAnalogForm.Create(Self);
end
else if strcomp(commandbuffer,'GAS')=0 then
begin
CommandRichEdit.Lines.Add('命令:气体成分'+commandbuffer+chr(13));
GasForm:=TGasForm.Create(Self);
GasForm.ShowModal;
end
else if strcomp(commandbuffer,'IN')=0 then
begin
CommandRichEdit.Lines.Add('命令:热收入参数'+commandbuffer+chr(13));
InHeatForm:=TInHeatForm.Create(Self);
InHeatForm.ShowModal;
end
else if strcomp(commandbuffer,'OUT')=0 then
begin
CommandRichEdit.Lines.Add('命令:热支出参数'+commandbuffer+chr(13));
OutHeatForm:=TOutHeatForm.Create(Self);
OutHeatform.ShowModal;
end
else if strcomp(commandbuffer,'COMPUTE')=0 then
begin
CommandRichEdit.Lines.Add('命令:热平衡计算COMPUTE'+chr(13));
end
else if strcomp(commandbuffer,'IMP')=0 then
begin
CommandRichEdit.Lines.Add('命令:热优化'+commandbuffer+chr(13));
ImproveForm:=TImproveForm.Create(Self);
end
else if strcomp(commandbuffer, 'HLP')=0 then
begin
CommandRichEdit.Lines.Add('命令:帮助'+commandbuffer+chr(13));
Application.HelpFile:=ExtractFilePath(Application.ExeName)+'\hlp\SESystem.hlp';
Application.HelpCommand(HELP_FINDER,0);
end
else if strcomp(commandbuffer, 'ABOUT')=0 then
begin
CommandRichEdit.Lines.Add('命令:关于ABOUT'+chr(13));
about:=TAboutForm.Create(Self);
about.Show;
end
else if strcomp(commandbuffer, 'REGENERATOR')=0 then
begin
CommandRichEdit.Lines.Add('命令:蓄热体参数REGENERATOR'+chr(13));
RegeneratorForm:=TRegeneratorForm.Create(Self);
RegeneratorForm.ShowModal;
end
else if strcomp(commandbuffer, 'SIMULATE')=0 then
begin
CommandRichEdit.Lines.Add('命令:模拟SIMULATE'+chr(13));
end
else if strcomp(commandbuffer, 'OPERATION')=0 then
begin
CommandRichEdit.Lines.Add('命令:操作优化OPERATION'+chr(13));
OperationForm:=TOperationForm.Create(Self);
OperationForm.ShowModal;
end
else if strcomp(commandbuffer, 'BURNING')=0 then
begin
CommandRichEdit.Lines.Add('命令:燃烧优化BURNING'+chr(13));
BurningForm:=TBurningForm.Create(Self);
BurningForm.ShowModal;
end
else if strcomp(commandbuffer,'CLOSE')=0 then
begin
if ActiveMDIChild=nil then
begin
CommandRichEdit.Lines.Add('错误命令:没有新建工程!'+chr(13));
end
else if ActiveMDIChild<>nil then
begin
CommandRichEdit.Lines.Add('命令:关闭'+commandbuffer+chr(13));
ActiveMDIChild.Close;
end
end
else
CommandRichEdit.Lines.Add('错误命令:'+commandbuffer+chr(13));
FreeMem(commandbuffer, size);
end;
end;
procedure TSESystemMDIForm.SESystemMenuAboutClick(Sender: TObject);
var pop:TAboutForm;
begin
CommandRichEdit.Lines.Add('命令:关于ABOUT'+chr(13));
pop:=TAboutForm.Create(Self);
pop.ShowModal;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -