randomize color preset button

This commit is contained in:
zueuk 2005-09-23 11:22:49 +00:00
parent 573de31ffc
commit 3c5e316960
2 changed files with 38 additions and 51 deletions

View File

@ -173,7 +173,7 @@ object AdjustForm: TAdjustForm
Top = 133 Top = 133
Width = 390 Width = 390
Height = 131 Height = 131
ActivePage = TabSheet1 ActivePage = TabSheet2
Align = alBottom Align = alBottom
TabOrder = 1 TabOrder = 1
object TabSheet1: TTabSheet object TabSheet1: TTabSheet
@ -446,8 +446,8 @@ object AdjustForm: TAdjustForm
OnKeyPress = txtVibrancyKeyPress OnKeyPress = txtVibrancyKeyPress
end end
object ColorPanel: TPanel object ColorPanel: TPanel
Left = 104 Left = 112
Top = 76 Top = 78
Width = 113 Width = 113
Height = 21 Height = 21
Cursor = crHandPoint Cursor = crHandPoint
@ -457,8 +457,8 @@ object AdjustForm: TAdjustForm
OnClick = ColorPanelClick OnClick = ColorPanelClick
end end
object cbColor: TComboBox object cbColor: TComboBox
Left = 224 Left = 232
Top = 76 Top = 78
Width = 59 Width = 59
Height = 21 Height = 21
Enabled = False Enabled = False
@ -466,6 +466,7 @@ object AdjustForm: TAdjustForm
ItemIndex = 0 ItemIndex = 0
TabOrder = 7 TabOrder = 7
Text = '000000' Text = '000000'
Visible = False
Items.Strings = ( Items.Strings = (
'000000' '000000'
'FFFFFF') 'FFFFFF')
@ -473,11 +474,12 @@ object AdjustForm: TAdjustForm
object chkTransparent: TCheckBox object chkTransparent: TCheckBox
Left = 296 Left = 296
Top = 80 Top = 80
Width = 97 Width = 81
Height = 17 Height = 17
Caption = 'Transparent' Caption = 'Transparent'
Enabled = False Enabled = False
TabOrder = 8 TabOrder = 8
Visible = False
end end
end end
object TabSheet3: TTabSheet object TabSheet3: TTabSheet
@ -491,9 +493,9 @@ object AdjustForm: TAdjustForm
Caption = '0' Caption = '0'
end end
object btnMenu: TSpeedButton object btnMenu: TSpeedButton
Left = 6 Left = 4
Top = 52 Top = 52
Width = 75 Width = 61
Height = 21 Height = 21
Hint = 'Click for menu' Hint = 'Click for menu'
Caption = 'Rotate' Caption = 'Rotate'
@ -504,7 +506,7 @@ object AdjustForm: TAdjustForm
end end
object btnOpen: TSpeedButton object btnOpen: TSpeedButton
Left = 333 Left = 333
Top = 77 Top = 78
Width = 23 Width = 23
Height = 22 Height = 22
Hint = 'Open Gradient Browser' Hint = 'Open Gradient Browser'
@ -544,7 +546,7 @@ object AdjustForm: TAdjustForm
end end
object btnSmoothPalette: TSpeedButton object btnSmoothPalette: TSpeedButton
Left = 357 Left = 357
Top = 77 Top = 78
Width = 23 Width = 23
Height = 22 Height = 22
Hint = 'Smooth Palette' Hint = 'Smooth Palette'
@ -580,18 +582,9 @@ object AdjustForm: TAdjustForm
ShowHint = True ShowHint = True
OnClick = mnuSmoothPaletteClick OnClick = mnuSmoothPaletteClick
end end
object Label1: TLabel
Left = 5
Top = 80
Width = 57
Height = 13
Alignment = taCenter
AutoSize = False
Caption = 'Preset'
end
object btnPaste: TSpeedButton object btnPaste: TSpeedButton
Left = 309 Left = 309
Top = 77 Top = 78
Width = 23 Width = 23
Height = 22 Height = 22
Hint = 'Paste fradient from clipboard' Hint = 'Paste fradient from clipboard'
@ -629,7 +622,7 @@ object AdjustForm: TAdjustForm
end end
object btnCopy: TSpeedButton object btnCopy: TSpeedButton
Left = 285 Left = 285
Top = 77 Top = 78
Width = 23 Width = 23
Height = 22 Height = 22
Hint = 'Copy gradient to clipboard' Hint = 'Copy gradient to clipboard'
@ -665,6 +658,18 @@ object AdjustForm: TAdjustForm
ShowHint = True ShowHint = True
OnClick = btnCopyClick OnClick = btnCopyClick
end end
object btnColorPreset: TSpeedButton
Left = 4
Top = 78
Width = 61
Height = 21
Hint = 'Click to choose random preset'
Caption = 'Preset'
Flat = True
ParentShowHint = False
ShowHint = True
OnClick = btnColorPresetClick
end
object GradientPnl: TPanel object GradientPnl: TPanel
Left = 0 Left = 0
Top = 0 Top = 0
@ -689,9 +694,9 @@ object AdjustForm: TAdjustForm
end end
end end
object ScrollBar: TScrollBar object ScrollBar: TScrollBar
Left = 88 Left = 72
Top = 55 Top = 55
Width = 255 Width = 271
Height = 15 Height = 15
LargeChange = 16 LargeChange = 16
Max = 128 Max = 128
@ -702,9 +707,9 @@ object AdjustForm: TAdjustForm
OnScroll = ScrollBarScroll OnScroll = ScrollBarScroll
end end
object cmbPalette: TComboBox object cmbPalette: TComboBox
Left = 69 Left = 72
Top = 79 Top = 79
Width = 201 Width = 206
Height = 19 Height = 19
Style = csOwnerDrawFixed Style = csOwnerDrawFixed
Color = clBlack Color = clBlack
@ -942,23 +947,6 @@ object AdjustForm: TAdjustForm
end end
end end
end end
object trkQuality: TTrackBar
Left = 288
Top = 0
Width = 33
Height = 129
Hint = 'Preview image quality'
Max = 5
Min = 1
Orientation = trVertical
ParentShowHint = False
Position = 3
ShowHint = True
TabOrder = 2
TabStop = False
ThumbLength = 18
Visible = False
end
object QualityPopup: TPopupMenu object QualityPopup: TPopupMenu
Images = MainForm.Buttons Images = MainForm.Buttons
Left = 320 Left = 320

View File

@ -78,7 +78,6 @@ type
btnMenu: TSpeedButton; btnMenu: TSpeedButton;
btnOpen: TSpeedButton; btnOpen: TSpeedButton;
btnSmoothPalette: TSpeedButton; btnSmoothPalette: TSpeedButton;
Label1: TLabel;
btnPaste: TSpeedButton; btnPaste: TSpeedButton;
btnCopy: TSpeedButton; btnCopy: TSpeedButton;
cmbPalette: TComboBox; cmbPalette: TComboBox;
@ -125,10 +124,10 @@ type
txtHeight: TComboBox; txtHeight: TComboBox;
Bevel1: TBevel; Bevel1: TBevel;
Bevel2: TBevel; Bevel2: TBevel;
trkQuality: TTrackBar;
btnUndo: TSpeedButton; btnUndo: TSpeedButton;
btnRedo: TSpeedButton; btnRedo: TSpeedButton;
chkTransparent: TCheckBox; chkTransparent: TCheckBox;
btnColorPreset: TSpeedButton;
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);
@ -243,6 +242,7 @@ type
procedure btnUndoClick(Sender: TObject); procedure btnUndoClick(Sender: TObject);
procedure btnRedoClick(Sender: TObject); procedure btnRedoClick(Sender: TObject);
procedure GradientImageDblClick(Sender: TObject); procedure GradientImageDblClick(Sender: TObject);
procedure btnColorPresetClick(Sender: TObject);
private private
Resetting: boolean; Resetting: boolean;
@ -1635,13 +1635,6 @@ begin
SaveMap(AppPath + 'default.map'); SaveMap(AppPath + 'default.map');
end; end;
{
function RandomGradient: TColorMap;
begin
Result := GradientHelper.RandomGradient;
end;
}
procedure TAdjustForm.mnuRandomizeClick(Sender: TObject); procedure TAdjustForm.mnuRandomizeClick(Sender: TObject);
begin begin
UpdateGradient(GradientHelper.RandomGradient); UpdateGradient(GradientHelper.RandomGradient);
@ -1873,5 +1866,11 @@ begin
MainForm.Redo; MainForm.Redo;
end; end;
procedure TAdjustForm.btnColorPresetClick(Sender: TObject);
begin
cmbPalette.ItemIndex := random(701);
cmbPaletteChange(Sender);
end;
end. end.