a couple of string constants added

This commit is contained in:
zueuk 2009-02-07 08:37:58 +00:00
parent 5b20e148f5
commit fcda34868a

View File

@ -44,6 +44,9 @@ const
AppVersionString = 'Apophysis 2.08 beta 2'; AppVersionString = 'Apophysis 2.08 beta 2';
randFilename = 'apophysis.rand';
undoFilename = 'apophysis.undo';
type type
TMouseMoveState = (msUsual, msZoomWindow, msZoomOutWindow, msZoomWindowMove, TMouseMoveState = (msUsual, msZoomWindow, msZoomOutWindow, msZoomWindowMove,
msZoomOutWindowMove, msDrag, msDragMove, msRotate, msRotateMove); msZoomOutWindowMove, msDrag, msDragMove, msRotate, msRotateMove);
@ -887,7 +890,7 @@ end;
procedure TMainForm.UpdateUndo; procedure TMainForm.UpdateUndo;
begin begin
SaveFlame(MainCp, Format('%.4d-', [UndoIndex]) + MainCp.name, AppPath + 'apophysis.undo'); SaveFlame(MainCp, Format('%.4d-', [UndoIndex]) + MainCp.name, AppPath + undoFilename);
Inc(UndoIndex); Inc(UndoIndex);
UndoMax := UndoIndex; //Inc(UndoMax); UndoMax := UndoIndex; //Inc(UndoMax);
mnuSaveUndo.Enabled := true; mnuSaveUndo.Enabled := true;
@ -1936,8 +1939,8 @@ begin
inc(MainSeed); inc(MainSeed);
RandSeed := MainSeed; RandSeed := MainSeed;
try try
AssignFile(F, AppPath + 'apophysis.rand'); AssignFile(F, AppPath + randFilename);
OpenFile := AppPath + 'apophysis.rand'; OpenFile := AppPath + randFilename;
ReWrite(F); ReWrite(F);
WriteLn(F, '<random_batch>'); WriteLn(F, '<random_batch>');
for i := 0 to BatchSize - 1 do for i := 0 to BatchSize - 1 do
@ -1965,7 +1968,7 @@ begin
except except
on EInOutError do Application.MessageBox('Error creating batch', PChar(APP_NAME), 16); on EInOutError do Application.MessageBox('Error creating batch', PChar(APP_NAME), 16);
end; end;
RandFile := AppPath + 'apophysis.rand'; RandFile := AppPath + randFilename;
MainCp.name := ''; MainCp.name := '';
end; end;
@ -2151,7 +2154,7 @@ begin
inc(MainSeed); inc(MainSeed);
RandSeed := MainSeed; RandSeed := MainSeed;
RandomBatch; RandomBatch;
OpenFile := AppPath + 'apophysis.rand'; OpenFile := AppPath + randFilename;
OpenFileType := ftXML; OpenFileType := ftXML;
MainForm.Caption := AppVersionString + ' - Random Batch'; MainForm.Caption := AppVersionString + ' - Random Batch';
ListXML(OpenFile, 1); ListXML(OpenFile, 1);
@ -2602,8 +2605,8 @@ begin
GetCMap(cmap_index, 1, maincp.cmap); GetCMap(cmap_index, 1, maincp.cmap);
DefaultPalette := maincp.cmap; DefaultPalette := maincp.cmap;
end; end;
if FileExists(AppPath + 'apophysis.rand') then if FileExists(AppPath + randFilename) then
DeleteFile(AppPath + 'apophysis.rand'); DeleteFile(AppPath + randFilename);
// get filename from command line argument // get filename from command line argument
if ParamCount > 0 then openFile := ParamStr(1) if ParamCount > 0 then openFile := ParamStr(1)
@ -2615,7 +2618,7 @@ begin
MainCp.Height := Image.Height; MainCp.Height := Image.Height;
RandomBatch; RandomBatch;
MainForm.Caption := AppVersionString + ' - Random Batch'; MainForm.Caption := AppVersionString + ' - Random Batch';
OpenFile := AppPath + 'apophysis.rand'; OpenFile := AppPath + randFilename;
ListXML(OpenFile, 1); ListXML(OpenFile, 1);
OpenFileType := ftXML; OpenFileType := ftXML;
if batchsize = 1 then DrawFlame; if batchsize = 1 then DrawFlame;
@ -2696,8 +2699,8 @@ begin
end; end;
Application.ProcessMessages; Application.ProcessMessages;
CanDrawOnResize := False; CanDrawOnResize := False;
if FileExists('apophysis.rand') then DeleteFile('apophysis.rand'); if FileExists(randFilename) then DeleteFile(randFilename);
if FileExists('apophysis.undo') then DeleteFile('apophysis.undo'); if FileExists(undoFilename) then DeleteFile(undoFilename);
SaveSettings; SaveSettings;
end; end;
@ -2825,7 +2828,7 @@ begin
UndoIndex := 0; UndoIndex := 0;
UndoMax := 0; UndoMax := 0;
if fileExists(AppPath + 'apophysis.undo') then DeleteFile(AppPath + 'apophysis.undo'); if fileExists(AppPath + undoFilename) then DeleteFile(AppPath + undoFilename);
Statusbar.Panels[2].Text := Maincp.name; Statusbar.Panels[2].Text := Maincp.name;
RedrawTimer.Enabled := True; RedrawTimer.Enabled := True;
Application.ProcessMessages; Application.ProcessMessages;
@ -2897,7 +2900,7 @@ begin
UndoIndex := 0; UndoIndex := 0;
UndoMax := 0; UndoMax := 0;
if fileExists(AppPath + 'apophysis.undo') then DeleteFile(AppPath + 'apophysis.undo'); if fileExists(AppPath + undoFilename) then DeleteFile(AppPath + undoFilename);
Statusbar.Panels[2].Text := Maincp.name; Statusbar.Panels[2].Text := Maincp.name;
RedrawTimer.Enabled := True; RedrawTimer.Enabled := True;
Application.ProcessMessages; Application.ProcessMessages;
@ -3052,7 +3055,7 @@ begin
if SavedPal then maincp.cmap := Palette; if SavedPal then maincp.cmap := Palette;
UndoIndex := 0; UndoIndex := 0;
UndoMax := 0; UndoMax := 0;
if fileExists(AppPath + 'apophysis.undo') then DeleteFile(AppPath + 'apophysis.undo'); if fileExists(AppPath + undoFilename) then DeleteFile(AppPath + undoFilename);
maincp.name := ListView.Selected.Caption; maincp.name := ListView.Selected.Caption;
Statusbar.Panels[2].Text := maincp.name; Statusbar.Panels[2].Text := maincp.name;
RedrawTimer.Enabled := True; RedrawTimer.Enabled := True;
@ -3436,10 +3439,10 @@ end;
procedure TMainForm.Undo; procedure TMainForm.Undo;
begin begin
if UndoIndex = UndoMax then if UndoIndex = UndoMax then
SaveFlame(maincp, Format('%.4d-', [UndoIndex]) + maincp.name, AppPath + 'apophysis.undo'); SaveFlame(maincp, Format('%.4d-', [UndoIndex]) + maincp.name, AppPath + undoFilename);
StopThread; StopThread;
Dec(UndoIndex); Dec(UndoIndex);
LoadUndoFlame(UndoIndex, AppPath + 'apophysis.undo'); LoadUndoFlame(UndoIndex, AppPath + undoFilename);
mnuRedo.Enabled := True; mnuRedo.Enabled := True;
mnuPopRedo.Enabled := True; mnuPopRedo.Enabled := True;
btnRedo.Enabled := True; btnRedo.Enabled := True;
@ -3469,7 +3472,7 @@ begin
assert(UndoIndex <= UndoMax, 'Undo list index out of range!'); assert(UndoIndex <= UndoMax, 'Undo list index out of range!');
LoadUndoFlame(UndoIndex, AppPath + 'apophysis.undo'); LoadUndoFlame(UndoIndex, AppPath + undoFilename);
mnuUndo.Enabled := True; mnuUndo.Enabled := True;
mnuPopUndo.Enabled := True; mnuPopUndo.Enabled := True;
btnUndo.Enabled := True; btnUndo.Enabled := True;
@ -3659,7 +3662,7 @@ end;
procedure TMainForm.mnuSaveUndoClick(Sender: TObject); procedure TMainForm.mnuSaveUndoClick(Sender: TObject);
begin begin
if FileExists(AppPath + 'apophysis.undo') then if FileExists(AppPath + undoFilename) then
begin begin
SaveDialog.DefaultExt := 'apo'; SaveDialog.DefaultExt := 'apo';
SaveDialog.Filter := 'Apophysis Parameters (*.apo)|*.apo'; SaveDialog.Filter := 'Apophysis Parameters (*.apo)|*.apo';
@ -3667,14 +3670,14 @@ begin
if SaveDialog.Execute then if SaveDialog.Execute then
begin begin
if FileExists(SaveDialog.Filename) then DeleteFile(SaveDialog.Filename); if FileExists(SaveDialog.Filename) then DeleteFile(SaveDialog.Filename);
CopyFile(PChar(AppPath + 'apophysis.undo'), PChar(SaveDialog.Filename), False); CopyFile(PChar(AppPath + undoFilename), PChar(SaveDialog.Filename), False);
end; end;
end; end;
end; end;
procedure TMainForm.mnuExportBatchClick(Sender: TObject); procedure TMainForm.mnuExportBatchClick(Sender: TObject);
begin begin
if FileExists(AppPath + 'apophysis.rand') then if FileExists(AppPath + randFilename) then
begin begin
SaveDialog.DefaultExt := 'apo'; SaveDialog.DefaultExt := 'apo';
SaveDialog.Filter := 'Parameter files (*.apo)|*.apo'; SaveDialog.Filter := 'Parameter files (*.apo)|*.apo';
@ -3682,7 +3685,7 @@ begin
if SaveDialog.Execute then if SaveDialog.Execute then
begin begin
if FileExists(SaveDialog.Filename) then DeleteFile(SaveDialog.Filename); if FileExists(SaveDialog.Filename) then DeleteFile(SaveDialog.Filename);
CopyFile(PChar(AppPath + 'apophysis.rand'), PChar(SaveDialog.Filename), False); CopyFile(PChar(AppPath + randFilename), PChar(SaveDialog.Filename), False);
end; end;
end; end;
end; end;