+ 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
|
||||
OnClick = mnuSaveAsClick
|
||||
end
|
||||
object mnuSaveAllAs: TMenuItem
|
||||
Caption = 'Save &All Parameters'
|
||||
Hint = 'Saves all parameters to file.'
|
||||
ShortCut = 24659
|
||||
OnClick = mnuSaveAllAsClick
|
||||
end
|
||||
object N9: TMenuItem
|
||||
Caption = '-'
|
||||
end
|
||||
|
@ -178,6 +178,7 @@ type
|
||||
tbRotate: TToolButton;
|
||||
mnuimage: TMenuItem;
|
||||
tbzoomoutwindow: TToolButton;
|
||||
mnuSaveAllAs: TMenuItem;
|
||||
procedure tbzoomoutwindowClick(Sender: TObject);
|
||||
procedure mnuimageClick(Sender: TObject);
|
||||
procedure mnuExitClick(Sender: TObject);
|
||||
@ -274,6 +275,7 @@ type
|
||||
procedure tbzoomwindowClick(Sender: TObject);
|
||||
procedure tbDragClick(Sender: TObject);
|
||||
procedure tbRotateClick(Sender: TObject);
|
||||
procedure mnuSaveAllAsClick(Sender: TObject);
|
||||
private
|
||||
Renderer: TRenderThread;
|
||||
|
||||
@ -2376,6 +2378,36 @@ begin
|
||||
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);
|
||||
begin
|
||||
@ -4356,6 +4388,4 @@ begin
|
||||
UpdateWindows;
|
||||
end;
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
end.
|
||||
|
@ -85,11 +85,13 @@ begin
|
||||
else if caption = 'Save Gradient' then
|
||||
warn := 'gradient'
|
||||
else if caption = 'Export UPR' then
|
||||
warn := 'UPR';
|
||||
warn := 'UPR'
|
||||
else if caption = 'Save All Parameters' then
|
||||
warn := 'allparameters';
|
||||
t := Trim(txtTitle.Text);
|
||||
f := Trim(txtFilename.Text);
|
||||
|
||||
if t = '' then
|
||||
if ((t = '') and txtTitle.Enabled) then
|
||||
begin
|
||||
Application.MessageBox(PChar('Please enter a title for the ' + warn + '.'), 'Apophysis', 48);
|
||||
Exit;
|
||||
@ -109,6 +111,10 @@ begin
|
||||
begin
|
||||
check := XMLEntryExists(t, f);
|
||||
end
|
||||
else if warn = 'allparameters' then
|
||||
begin
|
||||
check := false;
|
||||
end
|
||||
else
|
||||
begin
|
||||
t := CleanIdentifier(t);
|
||||
@ -155,6 +161,12 @@ begin
|
||||
SaveDialog.Title := 'Select Ultra Fractal Parameter File';
|
||||
SaveDialog.DefaultExt := '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;
|
||||
SaveDialog.InitialDir := ExtractFilePath(txtFilename.Text);
|
||||
if SaveDialog.Execute then
|
||||
|
Loading…
Reference in New Issue
Block a user