+ Added 'Save all parameters' option to the main menu
This commit is contained in:
parent
8e77ea06e8
commit
82243aaf59
@ -2476,6 +2476,12 @@ object MainForm: TMainForm
|
|||||||
ShortCut = 16467
|
ShortCut = 16467
|
||||||
OnClick = mnuSaveAsClick
|
OnClick = mnuSaveAsClick
|
||||||
end
|
end
|
||||||
|
object mnuSaveAllAs: TMenuItem
|
||||||
|
Caption = 'Save &All Parameters'
|
||||||
|
Hint = 'Saves all parameters to file.'
|
||||||
|
ShortCut = 24659
|
||||||
|
OnClick = mnuSaveAllAsClick
|
||||||
|
end
|
||||||
object N9: TMenuItem
|
object N9: TMenuItem
|
||||||
Caption = '-'
|
Caption = '-'
|
||||||
end
|
end
|
||||||
|
@ -178,6 +178,7 @@ type
|
|||||||
tbRotate: TToolButton;
|
tbRotate: TToolButton;
|
||||||
mnuimage: TMenuItem;
|
mnuimage: TMenuItem;
|
||||||
tbzoomoutwindow: TToolButton;
|
tbzoomoutwindow: TToolButton;
|
||||||
|
mnuSaveAllAs: TMenuItem;
|
||||||
procedure tbzoomoutwindowClick(Sender: TObject);
|
procedure tbzoomoutwindowClick(Sender: TObject);
|
||||||
procedure mnuimageClick(Sender: TObject);
|
procedure mnuimageClick(Sender: TObject);
|
||||||
procedure mnuExitClick(Sender: TObject);
|
procedure mnuExitClick(Sender: TObject);
|
||||||
@ -274,6 +275,7 @@ type
|
|||||||
procedure tbzoomwindowClick(Sender: TObject);
|
procedure tbzoomwindowClick(Sender: TObject);
|
||||||
procedure tbDragClick(Sender: TObject);
|
procedure tbDragClick(Sender: TObject);
|
||||||
procedure tbRotateClick(Sender: TObject);
|
procedure tbRotateClick(Sender: TObject);
|
||||||
|
procedure mnuSaveAllAsClick(Sender: TObject);
|
||||||
private
|
private
|
||||||
Renderer: TRenderThread;
|
Renderer: TRenderThread;
|
||||||
|
|
||||||
@ -2376,6 +2378,36 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TMainForm.mnuSaveAllAsClick(Sender: TObject);
|
||||||
|
{ Save all parameters to a file }
|
||||||
|
var
|
||||||
|
i, current: integer;
|
||||||
|
begin
|
||||||
|
SaveForm.Caption := 'Save All Parameters';
|
||||||
|
SaveForm.Filename := SavePath;
|
||||||
|
SaveForm.Title := '';
|
||||||
|
SaveForm.txtTitle.Enabled := false;
|
||||||
|
if SaveForm.ShowModal = mrOK then
|
||||||
|
begin
|
||||||
|
SavePath := SaveForm.Filename;
|
||||||
|
if ExtractFileExt(SavePath) = '' then SavePath := SavePath + '.flame';
|
||||||
|
if ExtractFileExt(SavePath) <> '.flame' then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('Bad filename extension.', 'Warning',
|
||||||
|
MB_OK or MB_ICONEXCLAMATION);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
current := ListView.ItemIndex;
|
||||||
|
for i := 0 to ListView.Items.Count-1 do
|
||||||
|
begin
|
||||||
|
LoadXMLFlame(OpenFile, ListView.Items.Item[i].Caption);
|
||||||
|
SaveXMLFlame(maincp, maincp.name, SavePath);
|
||||||
|
end;
|
||||||
|
ListView.ItemIndex := current;
|
||||||
|
LoadXMLFlame(OpenFile, ListView.Selected.caption);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TMainForm.mnuAutoZoomClick(Sender: TObject);
|
procedure TMainForm.mnuAutoZoomClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
@ -4356,6 +4388,4 @@ begin
|
|||||||
UpdateWindows;
|
UpdateWindows;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
|
||||||
end.
|
end.
|
||||||
|
@ -85,11 +85,13 @@ begin
|
|||||||
else if caption = 'Save Gradient' then
|
else if caption = 'Save Gradient' then
|
||||||
warn := 'gradient'
|
warn := 'gradient'
|
||||||
else if caption = 'Export UPR' then
|
else if caption = 'Export UPR' then
|
||||||
warn := 'UPR';
|
warn := 'UPR'
|
||||||
|
else if caption = 'Save All Parameters' then
|
||||||
|
warn := 'allparameters';
|
||||||
t := Trim(txtTitle.Text);
|
t := Trim(txtTitle.Text);
|
||||||
f := Trim(txtFilename.Text);
|
f := Trim(txtFilename.Text);
|
||||||
|
|
||||||
if t = '' then
|
if ((t = '') and txtTitle.Enabled) then
|
||||||
begin
|
begin
|
||||||
Application.MessageBox(PChar('Please enter a title for the ' + warn + '.'), 'Apophysis', 48);
|
Application.MessageBox(PChar('Please enter a title for the ' + warn + '.'), 'Apophysis', 48);
|
||||||
Exit;
|
Exit;
|
||||||
@ -109,6 +111,10 @@ begin
|
|||||||
begin
|
begin
|
||||||
check := XMLEntryExists(t, f);
|
check := XMLEntryExists(t, f);
|
||||||
end
|
end
|
||||||
|
else if warn = 'allparameters' then
|
||||||
|
begin
|
||||||
|
check := false;
|
||||||
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
t := CleanIdentifier(t);
|
t := CleanIdentifier(t);
|
||||||
@ -155,6 +161,12 @@ begin
|
|||||||
SaveDialog.Title := 'Select Ultra Fractal Parameter File';
|
SaveDialog.Title := 'Select Ultra Fractal Parameter File';
|
||||||
SaveDialog.DefaultExt := 'upr';
|
SaveDialog.DefaultExt := 'upr';
|
||||||
SaveDialog.Filter := 'UPR Files (*.upr)|*.upr';
|
SaveDialog.Filter := 'UPR Files (*.upr)|*.upr';
|
||||||
|
end
|
||||||
|
else if caption = 'Save All Parameters' then
|
||||||
|
begin
|
||||||
|
SaveDialog.Title := 'Select Parameter File';
|
||||||
|
SaveDialog.DefaultExt := 'flame';
|
||||||
|
SaveDialog.Filter := 'Flame files (*.flame)|*.flame';
|
||||||
end;
|
end;
|
||||||
SaveDialog.InitialDir := ExtractFilePath(txtFilename.Text);
|
SaveDialog.InitialDir := ExtractFilePath(txtFilename.Text);
|
||||||
if SaveDialog.Execute then
|
if SaveDialog.Execute then
|
||||||
|
Loading…
Reference in New Issue
Block a user