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

View File

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