forked from liujianjun/tslediter
界面库
初步拆分界面库
This commit is contained in:
+34
-14
@@ -88,14 +88,25 @@ type TEditerForm = class(TVCform) //
|
||||
end
|
||||
///////////////////////////////////////////////////////////////
|
||||
Fmopen := new TMenu(self);
|
||||
Fmopen.caption := "打开";
|
||||
newaction := new TAction(self);
|
||||
NewAction.ShortCut := "ctrl+O";
|
||||
NewAction.caption := "打开";
|
||||
NewAction.onexecute := function(o,e)
|
||||
begin
|
||||
return FEdter.OpenAfile();
|
||||
end;
|
||||
Fmopen.action := newaction;
|
||||
|
||||
|
||||
Fmnew:= new TMenu(self);
|
||||
Fmnew.caption := "新建";
|
||||
Fmnew.OnClick := function(o,e)
|
||||
newaction := new TAction(self);
|
||||
NewAction.ShortCut := "ctrl+N";
|
||||
NewAction.caption := "新建";
|
||||
NewAction.onexecute := function(o,e)
|
||||
begin
|
||||
return FEdter.CreateAfile();
|
||||
end
|
||||
Fmnew.action := NewAction;
|
||||
FOpenOther := new TMenu(self);
|
||||
FOpenOther.Caption := "其他窗口打开";
|
||||
FOpenOther.OnClick := thisfunction(OpenInOtherWnd) ;
|
||||
@@ -220,10 +231,7 @@ type TEditerForm = class(TVCform) //
|
||||
//FEdter.FExecuteEditer.ShowModal();
|
||||
FEdter.ShowExeEditer();
|
||||
end
|
||||
Fmopen.onclick := function(o,e)
|
||||
begin
|
||||
return FEdter.OpenAfile();
|
||||
end;
|
||||
|
||||
FCloseMenu := new tmenu(self);
|
||||
FCloseMenu.Caption:="关闭时最小化";
|
||||
//FCloseMenu.Checked := true;
|
||||
@@ -251,11 +259,24 @@ type TEditerForm = class(TVCform) //
|
||||
|
||||
FRunMenu := new TMenu(self);
|
||||
FRunMenu.caption := "运行";
|
||||
for i,v in array("命令行配置","tsl函数目录","执行(F9)","调试运行","远程调试","远程调试(waitattach)") do
|
||||
FExeaction := new TAction(self);
|
||||
FExeaction.caption := "执行";
|
||||
FExeaction.ShortCut := "F9";
|
||||
FExeaction.onexecute := function(o,e)
|
||||
begin
|
||||
FEdter.ExecutePageItem(FEdter.GetCurrentItem());
|
||||
end
|
||||
for i,v in array("命令行配置","tsl函数目录","执行","调试运行","远程调试","远程调试(waitattach)") do
|
||||
begin
|
||||
it := new TMenu(self);
|
||||
it.caption := v;
|
||||
it.OnClick := thisfunction(clickRun);
|
||||
if v = "执行" then
|
||||
begin
|
||||
it.Action := FExeaction;
|
||||
end else
|
||||
begin
|
||||
it.caption := v;
|
||||
it.OnClick := thisfunction(clickRun);
|
||||
end
|
||||
it.Parent := FRunMenu;
|
||||
end
|
||||
FRunMenu.Parent := m;
|
||||
@@ -551,10 +572,6 @@ type TEditerForm = class(TVCform) //
|
||||
begin
|
||||
FEdter.ShowExeEditer();
|
||||
end
|
||||
"执行(F9)" :
|
||||
begin
|
||||
FEdter.ExecutePageItem(FEdter.GetCurrentItem());
|
||||
end
|
||||
"调试运行":
|
||||
begin
|
||||
FEdter.DebugPageItem(FEdter.GetCurrentItem());
|
||||
@@ -1465,4 +1482,7 @@ end
|
||||
FPathDirPath;
|
||||
FDirs;
|
||||
Fexefilepath;
|
||||
/////////////////actions
|
||||
FExeaction;
|
||||
|
||||
end
|
||||
|
||||
+45
-26
@@ -3248,7 +3248,7 @@ F47AC96526C21CCB26FD326A2180CC21F5CAC302CA5C842B865FD9D7003D1F17B
|
||||
ExecuteCommand("showeval",ev);
|
||||
end
|
||||
end
|
||||
function ExecuteCommand(cmd,p);
|
||||
function ExecuteCommand(cmd,p);override;
|
||||
begin
|
||||
case cmd of
|
||||
"dbgstate":
|
||||
@@ -4313,22 +4313,32 @@ end
|
||||
//FPageEditer.CloseBtn := true;
|
||||
FPageEditer.Onbmpbclick := function(o,e)
|
||||
begin
|
||||
|
||||
it := e._Tag;
|
||||
if not it then return ;
|
||||
if JudgeItemState(it)then return;
|
||||
if it.FEditer.ChangedFlag then
|
||||
begin
|
||||
mr := MessageboxA(format("ÊÇ·ñ±£´æ:%s",it.OrigScriptPath),"Ìáʾ",3,self);
|
||||
if mr=IDYES then
|
||||
if it.fisnewfile then //单独处理新建关闭
|
||||
begin
|
||||
f := it.OrigScriptPath;
|
||||
DeletePageItem(it);
|
||||
if fileexists("",f) then filedelete("",f);
|
||||
|
||||
end else
|
||||
begin
|
||||
if JudgeItemState(it)then return;
|
||||
if it.FEditer.ChangedFlag then
|
||||
begin
|
||||
SavePageItem(it);
|
||||
end else
|
||||
if mr=IDCANCEL then
|
||||
begin
|
||||
return;
|
||||
mr := MessageboxA(format("是否保存:%s",it.OrigScriptPath),"提示",3,self);
|
||||
if mr=IDYES then
|
||||
begin
|
||||
SavePageItem(it);
|
||||
end else
|
||||
if mr=IDCANCEL then
|
||||
begin
|
||||
return;
|
||||
end
|
||||
end
|
||||
end
|
||||
DeletePageItem(it);
|
||||
DeletePageItem(it);
|
||||
end
|
||||
o.CallSelChanged();
|
||||
end
|
||||
FPageEditer.OnCloseClick := function(o,e)
|
||||
@@ -4349,6 +4359,7 @@ end
|
||||
end
|
||||
end
|
||||
DeletePageItem(it);
|
||||
ECHO "==222=>>>";
|
||||
end;
|
||||
FFindWnd := new TFindWnd(self); //²éÕÒ
|
||||
FGotoLineWnd := new TGoToLineWnd(self); //¹²Í¬
|
||||
@@ -5085,7 +5096,7 @@ end
|
||||
end
|
||||
end
|
||||
function PageEditerOnRClick(o,e);
|
||||
begin
|
||||
begin
|
||||
o.popupMenu := nil;
|
||||
if not FPageEditerMenu then
|
||||
begin
|
||||
@@ -5761,6 +5772,23 @@ end
|
||||
end
|
||||
function EditerQuckKeys(o,e);virtual; //¿ì½Ý¼ü
|
||||
begin
|
||||
if e.Result = 0 then
|
||||
begin
|
||||
case e.charcode of
|
||||
VK_F9:
|
||||
begin
|
||||
if ssctrl in e.ShiftState()then
|
||||
begin
|
||||
ShowExeEditer();
|
||||
e.skip := true;
|
||||
return true;
|
||||
end
|
||||
ExecutePageItem(GetCurrentItem());
|
||||
e.skip := true;
|
||||
return true;
|
||||
end
|
||||
end;
|
||||
end
|
||||
if e.Result=0 and(ssAlt in e.shiftstate)then
|
||||
begin
|
||||
case e.charcode of
|
||||
@@ -5835,7 +5863,7 @@ end
|
||||
FGotoLineWnd.ShowGoto();
|
||||
return true;
|
||||
end
|
||||
ord("O"):
|
||||
{ord("O"):
|
||||
begin
|
||||
OpenAfile();
|
||||
return true;
|
||||
@@ -5844,7 +5872,7 @@ end
|
||||
begin
|
||||
CreateAfile();
|
||||
return true;
|
||||
end
|
||||
end}
|
||||
ord("Z"):
|
||||
begin
|
||||
UnDoCurrentEditer();
|
||||
@@ -5900,16 +5928,7 @@ end
|
||||
DbgNextLine();
|
||||
return true;
|
||||
end
|
||||
VK_F9:
|
||||
begin
|
||||
if ssctrl in e.ShiftState()then
|
||||
begin
|
||||
ShowExeEditer();
|
||||
return true;
|
||||
end
|
||||
ExecutePageItem(GetCurrentItem());
|
||||
return true;
|
||||
end
|
||||
|
||||
VK_F3:
|
||||
begin
|
||||
d := FFindWnd.GetINfo();
|
||||
|
||||
Reference in New Issue
Block a user