+ VideoMode save/restore

This commit is contained in:
pierre 1999-12-10 13:02:05 +00:00
parent 34ce171c97
commit 5def4fada6
3 changed files with 71 additions and 29 deletions

View File

@ -169,7 +169,9 @@ BEGIN
repeat repeat
MyApp.Run; MyApp.Run;
if (AutoSaveOptions and asEditorFiles)=0 then CanExit:=true else if (AutoSaveOptions and asEditorFiles)=0 then
CanExit:=true
else
CanExit:=MyApp.SaveAll; CanExit:=MyApp.SaveAll;
until CanExit; until CanExit;
@ -198,7 +200,10 @@ BEGIN
END. END.
{ {
$Log$ $Log$
Revision 1.31 1999-09-13 11:43:59 peter Revision 1.32 1999-12-10 13:02:05 pierre
+ VideoMode save/restore
Revision 1.31 1999/09/13 11:43:59 peter
* fixes from gabor, idle event, html fix * fixes from gabor, idle event, html fix
Revision 1.30 1999/08/22 22:24:15 pierre Revision 1.30 1999/08/22 22:24:15 pierre

View File

@ -22,6 +22,7 @@ const
then you should also change this } then you should also change this }
ResDesktopFlags = 'FLAGS'; ResDesktopFlags = 'FLAGS';
ResVideo = 'VIDEOMODE';
ResHistory = 'HISTORY'; ResHistory = 'HISTORY';
ResClipboard = 'CLIPBOARD'; ResClipboard = 'CLIPBOARD';
ResWatches = 'WATCHES'; ResWatches = 'WATCHES';
@ -37,7 +38,8 @@ procedure DoneDesktopFile;
implementation implementation
uses Dos, uses Dos,
Objects,Drivers,Views,App,HistList,BrowCol, Objects,Drivers,Video,
Views,App,HistList,BrowCol,
WResource,WViews,WEditor, WResource,WViews,WEditor,
{$ifndef NODEBUG} {$ifndef NODEBUG}
fpdebug, fpdebug,
@ -316,6 +318,25 @@ begin
size); size);
end; end;
function WriteVideoMode(F: PResourceFile): boolean;
begin
F^.CreateResource(resVideo,rcBinary,0);
WriteVideoMode:=F^.AddResourceEntry(resVideo,langDefault,0,ScreenMode,
SizeOf(TVideoMode));
end;
function ReadVideoMode(F: PResourceFile;var NewScreenMode : TVideoMode): boolean;
var
size : sw_word;
test : boolean;
begin
test:=F^.ReadResourceEntry(resVideo,langDefault,NewScreenMode,
size);
if not test then
NewScreenMode:=ScreenMode;
ReadVideoMode:= test and (size = SizeOf(TVideoMode));
end;
function ReadSymbols(F: PResourceFile): boolean; function ReadSymbols(F: PResourceFile): boolean;
var S: PMemoryStream; var S: PMemoryStream;
OK: boolean; OK: boolean;
@ -353,8 +374,9 @@ begin
end; end;
function LoadDesktop: boolean; function LoadDesktop: boolean;
var OK: boolean; var OK,VOK: boolean;
F: PResourceFile; F: PResourceFile;
VM : TVideoMode;
begin begin
PushStatus('Reading desktop file...'); PushStatus('Reading desktop file...');
New(F, LoadFile(DesktopPath)); New(F, LoadFile(DesktopPath));
@ -364,17 +386,24 @@ begin
if OK then if OK then
begin begin
OK:=ReadFlags(F); OK:=ReadFlags(F);
if OK and ((DesktopFileFlags and dfHistoryLists)<>0) then if OK then
OK:=ReadHistory(F); begin
if OK and ((DesktopFileFlags and dfWatches)<>0) then VOK:=ReadVideoMode(F,VM);
OK:=ReadWatches(F); if VOK and ((VM.Col<>ScreenMode.Col) or
if OK and ((DesktopFileFlags and dfBreakpoints)<>0) then (VM.Row<>ScreenMode.Row) or (VM.Color<>ScreenMode.Color)) then
OK:=ReadBreakpoints(F); Application^.SetScreenVideoMode(VM);
if OK and ((DesktopFileFlags and dfOpenWindows)<>0) then end;
OK:=ReadOpenWindows(F); if {OK and} ((DesktopFileFlags and dfHistoryLists)<>0) then
OK:=OK and ReadHistory(F);
if {OK and} ((DesktopFileFlags and dfWatches)<>0) then
OK:=OK and ReadWatches(F);
if {OK and} ((DesktopFileFlags and dfBreakpoints)<>0) then
OK:=OK and ReadBreakpoints(F);
if {OK and} ((DesktopFileFlags and dfOpenWindows)<>0) then
OK:=OK and ReadOpenWindows(F);
{ no errors if no browser info available PM } { no errors if no browser info available PM }
if OK and ((DesktopFileFlags and dfSymbolInformation)<>0) then if {OK and} ((DesktopFileFlags and dfSymbolInformation)<>0) then
OK:=ReadSymbols(F); OK:=OK and ReadSymbols(F);
Dispose(F, Done); Dispose(F, Done);
end; end;
@ -396,19 +425,21 @@ begin
Clipboard^.Flags:=Clipboard^.Flags and not efStoreContent; Clipboard^.Flags:=Clipboard^.Flags and not efStoreContent;
OK:=Assigned(F); OK:=Assigned(F);
if OK then {if OK then}
OK:=WriteFlags(F); OK:=OK and WriteFlags(F);
if OK and ((DesktopFileFlags and dfHistoryLists)<>0) then {if OK then}
OK:=WriteHistory(F); OK:=OK and WriteVideoMode(F);
if OK and ((DesktopFileFlags and dfWatches)<>0) then if {OK and} ((DesktopFileFlags and dfHistoryLists)<>0) then
OK:=WriteWatches(F); OK:=OK and WriteHistory(F);
if OK and ((DesktopFileFlags and dfBreakpoints)<>0) then if {OK and} ((DesktopFileFlags and dfWatches)<>0) then
OK:=WriteBreakpoints(F); OK:=OK and WriteWatches(F);
if OK and ((DesktopFileFlags and dfOpenWindows)<>0) then if {OK and} ((DesktopFileFlags and dfBreakpoints)<>0) then
OK:=WriteOpenWindows(F); OK:=OK and WriteBreakpoints(F);
if {OK and} ((DesktopFileFlags and dfOpenWindows)<>0) then
OK:=OK and WriteOpenWindows(F);
{ no errors if no browser info available PM } { no errors if no browser info available PM }
if OK and ((DesktopFileFlags and dfSymbolInformation)<>0) then if {OK and} ((DesktopFileFlags and dfSymbolInformation)<>0) then
OK:=WriteSymbols(F) or not Assigned(Modules); OK:=OK and (WriteSymbols(F) or not Assigned(Modules));
Dispose(F, Done); Dispose(F, Done);
PopStatus; PopStatus;
SaveDesktop:=OK; SaveDesktop:=OK;
@ -417,7 +448,10 @@ end;
END. END.
{ {
$Log$ $Log$
Revision 1.15 1999-11-26 17:09:51 pierre Revision 1.16 1999-12-10 13:02:05 pierre
+ VideoMode save/restore
Revision 1.15 1999/11/26 17:09:51 pierre
* Force Desktop into Screen * Force Desktop into Screen
Revision 1.14 1999/11/25 00:25:43 pierre Revision 1.14 1999/11/25 00:25:43 pierre

View File

@ -196,6 +196,7 @@ begin
GetExtent(R); Dec(R.B.X); R.A.X:=R.B.X-9; R.A.Y:=R.B.Y-1; GetExtent(R); Dec(R.B.X); R.A.X:=R.B.X-9; R.A.Y:=R.B.Y-1;
New(HeapView, InitKb(R)); New(HeapView, InitKb(R));
Insert(HeapView); Insert(HeapView);
Drivers.ShowMouse;
end; end;
procedure TIDEApp.InitDesktop; procedure TIDEApp.InitDesktop;
@ -595,7 +596,6 @@ begin
InitMouse; InitMouse;
InitEvents; InitEvents;
InitSysError; InitSysError;
Redraw;
CurDirChanged; CurDirChanged;
Message(Application,evBroadcast,cmUpdate,nil); Message(Application,evBroadcast,cmUpdate,nil);
UpdateScreen(true); UpdateScreen(true);
@ -854,7 +854,10 @@ end;
END. END.
{ {
$Log$ $Log$
Revision 1.44 1999-11-25 00:26:49 pierre Revision 1.45 1999-12-10 13:02:05 pierre
+ VideoMode save/restore
Revision 1.44 1999/11/25 00:26:49 pierre
* RecentFiles missed the last char * RecentFiles missed the last char
Revision 1.43 1999/11/10 17:19:06 pierre Revision 1.43 1999/11/10 17:19:06 pierre