small (un)fixes to the adjust window :-P

This commit is contained in:
zueuk 2005-10-06 15:54:53 +00:00
parent 30f49d0eae
commit c6185f9095
2 changed files with 40 additions and 17 deletions

View File

@ -173,7 +173,7 @@ object AdjustForm: TAdjustForm
Top = 133 Top = 133
Width = 390 Width = 390
Height = 131 Height = 131
ActivePage = TabSheet3 ActivePage = TabSheet1
Align = alBottom Align = alBottom
TabOrder = 1 TabOrder = 1
object TabSheet1: TTabSheet object TabSheet1: TTabSheet
@ -960,8 +960,8 @@ object AdjustForm: TAdjustForm
end end
object QualityPopup: TPopupMenu object QualityPopup: TPopupMenu
Images = MainForm.Buttons Images = MainForm.Buttons
Left = 320 Left = 200
Top = 8 Top = 16
object mnuLowQuality: TMenuItem object mnuLowQuality: TMenuItem
Caption = 'Low Quality' Caption = 'Low Quality'
RadioItem = True RadioItem = True
@ -978,16 +978,23 @@ object AdjustForm: TAdjustForm
RadioItem = True RadioItem = True
OnClick = mnuHighQualityClick OnClick = mnuHighQualityClick
end end
object N8: TMenuItem
Caption = '-'
end
object mnuInstantPreview: TMenuItem
Caption = 'Instant Preview'
OnClick = mnuInstantPreviewClick
end
end end
object ColorDialog: TColorDialog object ColorDialog: TColorDialog
Options = [cdFullOpen] Options = [cdFullOpen]
Left = 352 Left = 232
Top = 8 Top = 16
end end
object GradientPopup: TPopupMenu object GradientPopup: TPopupMenu
Images = MainForm.Buttons Images = MainForm.Buttons
Left = 320 Left = 200
Top = 48 Top = 56
object mnuRandomize: TMenuItem object mnuRandomize: TMenuItem
Caption = 'Randomize' Caption = 'Randomize'
OnClick = mnuRandomizeClick OnClick = mnuRandomizeClick
@ -1052,8 +1059,8 @@ object AdjustForm: TAdjustForm
object scrollModePopup: TPopupMenu object scrollModePopup: TPopupMenu
AutoHotkeys = maManual AutoHotkeys = maManual
AutoPopup = False AutoPopup = False
Left = 352 Left = 232
Top = 48 Top = 56
object mnuRotate: TMenuItem object mnuRotate: TMenuItem
Caption = 'Rotate' Caption = 'Rotate'
OnClick = mnuRotateClick OnClick = mnuRotateClick
@ -1092,12 +1099,12 @@ object AdjustForm: TAdjustForm
object SaveDialog: TSaveDialog object SaveDialog: TSaveDialog
DefaultExt = 'map' DefaultExt = 'map'
Filter = 'Map files|*.map' Filter = 'Map files|*.map'
Left = 320 Left = 200
Top = 80 Top = 88
end end
object ApplicationEvents: TApplicationEvents object ApplicationEvents: TApplicationEvents
OnActivate = ApplicationEventsActivate OnActivate = ApplicationEventsActivate
Left = 352 Left = 232
Top = 80 Top = 88
end end
end end

View File

@ -129,6 +129,8 @@ type
txtWidth: TComboBox; txtWidth: TComboBox;
txtHeight: TComboBox; txtHeight: TComboBox;
Bevel2: TBevel; Bevel2: TBevel;
N8: TMenuItem;
mnuInstantPreview: TMenuItem;
procedure FormCreate(Sender: TObject); procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormDestroy(Sender: TObject); procedure FormDestroy(Sender: TObject);
@ -245,6 +247,7 @@ type
procedure GradientImageDblClick(Sender: TObject); procedure GradientImageDblClick(Sender: TObject);
procedure btnColorPresetClick(Sender: TObject); procedure btnColorPresetClick(Sender: TObject);
procedure btnApplySizeClick(Sender: TObject); procedure btnApplySizeClick(Sender: TObject);
procedure mnuInstantPreviewClick(Sender: TObject);
private private
Resetting: boolean; Resetting: boolean;
@ -410,7 +413,8 @@ begin
BM.Assign(Render.GetImage); BM.Assign(Render.GetImage);
PreviewImage.Picture.Graphic := bm; PreviewImage.Picture.Graphic := bm;
// PreviewImage.Refresh; // --Z-- why was commented out? ;-) if mnuInstantPreview.Checked then
PreviewImage.Refresh;
//--begin DrawPalette //--begin DrawPalette
BitMap := TBitMap.Create; BitMap := TBitMap.Create;
@ -475,6 +479,7 @@ begin
begin begin
Registry.WriteInteger('Top', AdjustForm.Top); Registry.WriteInteger('Top', AdjustForm.Top);
Registry.WriteInteger('Left', AdjustForm.Left); Registry.WriteInteger('Left', AdjustForm.Left);
Registry.WriteBool('InstantPreview', mnuInstantPreview.Checked);
end; end;
finally finally
Registry.Free; Registry.Free;
@ -523,6 +528,8 @@ begin
AdjustForm.Left := Registry.ReadInteger('Left'); AdjustForm.Left := Registry.ReadInteger('Left');
if Registry.ValueExists('Top') then if Registry.ValueExists('Top') then
AdjustForm.Top := Registry.ReadInteger('Top'); AdjustForm.Top := Registry.ReadInteger('Top');
if Registry.ValueExists('InstantPreview') then
mnuInstantPreview.Checked := Registry.ReadBool('InstantPreview');
Registry.CloseKey; Registry.CloseKey;
end; end;
@ -1033,11 +1040,13 @@ begin
MainCp.CmapIndex := cmbPalette.ItemIndex; MainCp.CmapIndex := cmbPalette.ItemIndex;
MainCp.cmap := Palette; MainCp.cmap := Palette;
// BackupPal := Palette;
if EditForm.visible then EditForm.UpdateDisplay; if EditForm.visible then EditForm.UpdateDisplay;
if MutateForm.Visible then MutateForm.UpdateDisplay; if MutateForm.Visible then MutateForm.UpdateDisplay;
// DrawPreview; //hmm if mnuInstantPreview.Checked then
DrawPreview; //hmm
MainForm.RedrawTimer.enabled := true; MainForm.RedrawTimer.enabled := true;
end; end;
@ -1078,7 +1087,9 @@ begin
// DrawPalette; // DrawPalette;
cp.copy(MainCp); cp.copy(MainCp);
// DrawPreview;
if mnuInstantPreview.Checked then
DrawPreview; //hmm
end; end;
procedure HSVToRGB(H, S, V: real; var Rb, Gb, Bb: integer); procedure HSVToRGB(H, S, V: real; var Rb, Gb, Bb: integer);
@ -1913,5 +1924,10 @@ begin
SetMainWindowSize; SetMainWindowSize;
end; end;
procedure TAdjustForm.mnuInstantPreviewClick(Sender: TObject);
begin
mnuInstantPreview.Checked := not mnuInstantPreview.Checked;
end;
end. end.