mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-24 15:09:13 +02:00
Save All is enabled and disabled as requiered
This commit is contained in:
parent
29ee863e8f
commit
69d552415a
@ -1039,6 +1039,7 @@ procedure TIDEApp.InitMenuBar;
|
|||||||
begin
|
begin
|
||||||
LoadMenuBar;
|
LoadMenuBar;
|
||||||
DisableCommands(EditorCmds+SourceCmds+CompileCmds);
|
DisableCommands(EditorCmds+SourceCmds+CompileCmds);
|
||||||
|
SetCmdState([cmTile,cmCascade],false);
|
||||||
// Update; Desktop is still nil at that point ...
|
// Update; Desktop is still nil at that point ...
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1624,7 +1625,7 @@ procedure TIDEApp.Update;
|
|||||||
begin
|
begin
|
||||||
SetCmdState([cmSaveAll],IsThereAnyEditor);
|
SetCmdState([cmSaveAll],IsThereAnyEditor);
|
||||||
SetCmdState([cmCloseAll,cmWindowList],IsThereAnyWindow);
|
SetCmdState([cmCloseAll,cmWindowList],IsThereAnyWindow);
|
||||||
SetCmdState([cmTile,cmCascade],IsThereAnyVisibleWindow);
|
SetCmdState([cmTile,cmCascade],IsThereAnyVisibleEditorWindow);
|
||||||
SetCmdState([cmFindProcedure,cmObjects,cmModules,cmGlobals,cmSymbol],IsSymbolInfoAvailable);
|
SetCmdState([cmFindProcedure,cmObjects,cmModules,cmGlobals,cmSymbol],IsSymbolInfoAvailable);
|
||||||
{$ifndef NODEBUG}
|
{$ifndef NODEBUG}
|
||||||
SetCmdState([cmResetDebugger,cmUntilReturn],assigned(debugger) and debugger^.debuggee_started);
|
SetCmdState([cmResetDebugger,cmUntilReturn],assigned(debugger) and debugger^.debuggee_started);
|
||||||
|
@ -192,6 +192,8 @@ type
|
|||||||
function GetPalette: PPalette; virtual;
|
function GetPalette: PPalette; virtual;
|
||||||
constructor Load(var S: TStream);
|
constructor Load(var S: TStream);
|
||||||
procedure Store(var S: TStream);
|
procedure Store(var S: TStream);
|
||||||
|
procedure Show; virtual;
|
||||||
|
procedure Hide; virtual;
|
||||||
procedure Close; virtual;
|
procedure Close; virtual;
|
||||||
destructor Done; virtual;
|
destructor Done; virtual;
|
||||||
end;
|
end;
|
||||||
@ -446,6 +448,7 @@ function IsWindow(P: PView): boolean;
|
|||||||
function IsThereAnyEditor: boolean;
|
function IsThereAnyEditor: boolean;
|
||||||
function IsThereAnyWindow: boolean;
|
function IsThereAnyWindow: boolean;
|
||||||
function IsThereAnyVisibleWindow: boolean;
|
function IsThereAnyVisibleWindow: boolean;
|
||||||
|
function IsThereAnyVisibleEditorWindow: boolean; {any visible Source Editor, including Clipboard}
|
||||||
function IsThereAnyNumberedWindow: boolean;
|
function IsThereAnyNumberedWindow: boolean;
|
||||||
function FirstEditorWindow: PSourceWindow;
|
function FirstEditorWindow: PSourceWindow;
|
||||||
function EditorWindowFile(const Name : String): PSourceWindow;
|
function EditorWindowFile(const Name : String): PSourceWindow;
|
||||||
@ -803,6 +806,15 @@ begin
|
|||||||
IsThereAnyVisibleWindow:=Desktop^.FirstThat(@CheckIt)<>nil;
|
IsThereAnyVisibleWindow:=Desktop^.FirstThat(@CheckIt)<>nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function IsThereAnyVisibleEditorWindow: boolean;
|
||||||
|
function EditorWindow(P: PView): boolean;
|
||||||
|
begin
|
||||||
|
EditorWindow:=((P^.HelpCtx=hcSourceWindow) or (P^.HelpCtx=hcClipboardWindow)) and P^.GetState(sfVisible);
|
||||||
|
end;
|
||||||
|
begin
|
||||||
|
IsThereAnyVisibleEditorWindow:=Desktop^.FirstThat(@EditorWindow)<>nil;
|
||||||
|
end;
|
||||||
|
|
||||||
function FirstEditorWindow: PSourceWindow;
|
function FirstEditorWindow: PSourceWindow;
|
||||||
function EditorWindow(P: PView): boolean;
|
function EditorWindow(P: PView): boolean;
|
||||||
begin
|
begin
|
||||||
@ -2323,7 +2335,7 @@ begin
|
|||||||
SetCmdState(SourceCmds+CompileCmds,Active);
|
SetCmdState(SourceCmds+CompileCmds,Active);
|
||||||
SetCmdState(EditorCmds,Active);
|
SetCmdState(EditorCmds,Active);
|
||||||
end;
|
end;
|
||||||
SetCmdState(ToClipCmds+FromClipCmds+NulClipCmds+UndoCmd+RedoCmd,Active);
|
SetCmdState(ToClipCmds+FromClipCmds+NulClipCmds+UndoCmd+RedoCmd+[cmHide],Active);
|
||||||
Message(Application,evBroadcast,cmCommandSetChanged,nil);
|
Message(Application,evBroadcast,cmCommandSetChanged,nil);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -2364,6 +2376,17 @@ begin
|
|||||||
PopStatus;
|
PopStatus;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TSourceWindow.Show;
|
||||||
|
begin
|
||||||
|
inherited Show;
|
||||||
|
IDEApp.SetCmdState([cmTile,cmCascade],true);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TSourceWindow.Hide;
|
||||||
|
begin
|
||||||
|
inherited Hide;
|
||||||
|
IDEApp.SetCmdState([cmTile,cmCascade],IsThereAnyVisibleEditorWindow);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TSourceWindow.Close;
|
procedure TSourceWindow.Close;
|
||||||
begin
|
begin
|
||||||
@ -3931,6 +3954,10 @@ begin
|
|||||||
{ this makes loading a lot slower and is not needed as far as I can see (FK)
|
{ this makes loading a lot slower and is not needed as far as I can see (FK)
|
||||||
Message(Application,evBroadcast,cmUpdate,nil);
|
Message(Application,evBroadcast,cmUpdate,nil);
|
||||||
}
|
}
|
||||||
|
if ShowIt then
|
||||||
|
W^.SetCmdState([cmTile,cmCascade,cmSaveAll],true)
|
||||||
|
else
|
||||||
|
W^.SetCmdState([cmSaveAll],true);
|
||||||
end;
|
end;
|
||||||
PopStatus;
|
PopStatus;
|
||||||
IOpenEditorWindow:=W;
|
IOpenEditorWindow:=W;
|
||||||
|
Loading…
Reference in New Issue
Block a user