📄 ctrls.pas
字号:
rxSlider1.Options := rxSlider1.Options + [soShowPoints]
else
rxSlider1.Options := rxSlider1.Options - [soShowPoints];
end;
procedure TControlsForm.ComboBox3Change(Sender: TObject);
begin
with rxSlider1 do
case ComboBox3.ItemIndex of
0:
begin
NumThumbStates := 2;
ImageHRuler := nil;
ImageHThumb := nil;
ImageVRuler := nil;
ImageVThumb := nil;
end;
1:
begin
NumThumbStates := 1;
ImageHRuler := ADHRuler.Picture.Bitmap;
ImageHThumb := ADHThumb.Picture.Bitmap;
ImageVRuler := ADVRuler.Picture.Bitmap;
ImageVThumb := ADVThumb.Picture.Bitmap;
end;
end;
end;
procedure TControlsForm.ComboBox4Change(Sender: TObject);
begin
rxSwitch1.TextPosition := TTextPos(ComboBox4.ItemIndex);
end;
procedure TControlsForm.ComboBox5Change(Sender: TObject);
begin
with rxSwitch1 do
case ComboBox5.ItemIndex of
0:
begin
GlyphOn := nil;
GlyphOff := nil;
end;
1:
begin
GlyphOn := SwOn.Picture.Bitmap;
GlyphOff := SwOff.Picture.Bitmap;
end;
end;
end;
procedure TControlsForm.rxSwitchOn(Sender: TObject);
begin
rxSwitch1.Caption := 'On';
end;
procedure TControlsForm.rxSwitch1Off(Sender: TObject);
begin
rxSwitch1.Caption := 'Off';
end;
procedure TControlsForm.CheckBox5Click(Sender: TObject);
begin
if CheckBox5.Checked then
rxSwitch1.BorderStyle := bsSingle
else
rxSwitch1.BorderStyle := bsNone;
end;
procedure TControlsForm.FontComboBox1Change(Sender: TObject);
begin
Label2.Font.Name := FontComboBox1.FontName;
end;
procedure TControlsForm.ComboEdit1ButtonClick(Sender: TObject);
var
ADate: TDateTime;
begin
ADate := StrToDateDef(ComboEdit1.Text, Now);
if PopupDate(ADate, ComboEdit1) then
ComboEdit1.Text := DateToStr(ADate);
if ComboEdit1.CanFocus then ComboEdit1.SetFocus;
end;
procedure TControlsForm.Edit1Change(Sender: TObject);
begin
// CurrencyEdit1.DisplayFormat := Edit1.Text;
end;
procedure TControlsForm.CheckBox7Click(Sender: TObject);
begin
// CurrencyEdit1.FormatOnEditing := CheckBox7.Checked;
end;
procedure TControlsForm.ColorComboBox2Change(Sender: TObject);
begin
rxLabel1.ShadowColor := ColorComboBox2.ColorValue;
end;
procedure TControlsForm.ComboBox6Change(Sender: TObject);
begin
rxLabel1.ShadowPos := TShadowPosition(ComboBox6.ItemIndex);
end;
procedure TControlsForm.SpinEdit2Change(Sender: TObject);
begin
rxLabel1.ShadowSize := SpinEdit2.Value;
end;
procedure TControlsForm.Button1Click(Sender: TObject);
begin
FontDialog1.Font := rxLabel1.Font;
if FontDialog1.Execute then
rxLabel1.Font := FontDialog1.Font;
end;
procedure TControlsForm.FileListBox1Change(Sender: TObject);
begin
try
Memo1.Lines.LoadFromFile(FileListBox1.FileName);
except
Memo1.Clear;
end;
end;
procedure TControlsForm.ComboBox7Change(Sender: TObject);
begin
case ComboBox7.ItemIndex of
0:
begin
AnimatedImage1.Glyph := RunnerImage.Picture.Bitmap;
AnimatedImage1.GlyphNum := 12;
end;
1:
begin
AnimatedImage1.Glyph := FlagImage.Picture.Bitmap;
AnimatedImage1.GlyphNum := 4;
end;
2:
begin
AnimatedImage1.Glyph := SearchImage.Picture.Bitmap;
AnimatedImage1.GlyphNum := 12;
end;
3:
begin
AnimatedImage1.Glyph := BookImage.Picture.Bitmap;
AnimatedImage1.GlyphNum := 5;
end;
end;
end;
procedure TControlsForm.Button2Click(Sender: TObject);
begin
AnimatedImage1.Active := not AnimatedImage1.Active;
end;
procedure TControlsForm.SpinEdit3Change(Sender: TObject);
begin
AnimatedImage1.Interval := SpinEdit3.Value;
end;
procedure TControlsForm.SpinEdit4Change(Sender: TObject);
begin
AnimatedImage1.GlyphNum := SpinEdit4.Value;
end;
procedure TControlsForm.AnimatedImage1StartStop(Sender: TObject);
begin
SpinEdit4.Value := AnimatedImage1.GlyphNum;
SpinEdit3.Value := AnimatedImage1.Interval;
if AnimatedImage1.Active then
Button2.Caption := 'Stop'
else
Button2.Caption := 'Start';
end;
procedure TControlsForm.ComboBox8Change(Sender: TObject);
begin
JvClock1.ShowMode := TShowClock(ComboBox8.ItemIndex);
end;
procedure TControlsForm.Button3Click(Sender: TObject);
begin
FontDialog1.Font := JvClock1.Font;
if FontDialog1.Execute then
JvClock1.Font := FontDialog1.Font;
end;
procedure TControlsForm.CheckBox6Click(Sender: TObject);
begin
JvClock1.AlarmEnabled := CheckBox6.Checked;
end;
procedure TControlsForm.SpinEdit5Change(Sender: TObject);
begin
JvClock1.AlarmHour := SpinEdit5.Value;
end;
procedure TControlsForm.SpinEdit6Change(Sender: TObject);
begin
JvClock1.AlarmMinute := SpinEdit6.Value;
end;
procedure TControlsForm.SpinEdit7Change(Sender: TObject);
begin
JvClock1.AlarmSecond := SpinEdit7.Value;
end;
procedure TControlsForm.JvClock1Alarm(Sender: TObject);
begin
MessageDlg('Alarm!', mtInformation, [mbOk], 0);
end;
procedure TControlsForm.Button4Click(Sender: TObject);
begin
JvDice.Rotate := not JvDice.Rotate;
if JvDice.Rotate then
Button4.Caption := 'Stop'
else
Button4.Caption := 'Start';
end;
procedure TControlsForm.SpinEdit8Change(Sender: TObject);
begin
JvDice.Interval := SpinEdit8.Value;
end;
procedure TControlsForm.SpinEdit9Change(Sender: TObject);
begin
JvDice.Value := SpinEdit9.Value;
end;
procedure TControlsForm.JvDiceChange(Sender: TObject);
begin
SpinEdit9.Value := JvDice.Value;
end;
procedure TControlsForm.Button5Click(Sender: TObject);
begin
with TextListBox1.Items do begin
if Count = 3 then begin
Insert(2, 'Very Long Item Very Long Item Very Long Item');
Button5.Caption := 'Back';
end
else begin
Delete(2);
Button5.Caption := 'Show';
end;
end;
end;
procedure TControlsForm.ComboBox9Change(Sender: TObject);
begin
rxSpinEdit1.ValueType := TValueType(ComboBox9.ItemIndex);
end;
procedure TControlsForm.SpinEdit1Change(Sender: TObject);
begin
rxSpinEdit1.Increment := SpinEdit1.Value;
end;
procedure TControlsForm.CheckBox4Click(Sender: TObject);
begin
if CheckBox4.Checked then
ColorComboBox1.Options := ColorComboBox1.Options + [coText]
else
ColorComboBox1.Options := ColorComboBox1.Options - [coText];
end;
procedure TControlsForm.Button6Click(Sender: TObject);
var
Image: TJvAni;
begin
if OpenDialog.Execute then begin
OpenDialog.InitialDir := ExtractFilePath(OpenDialog.FileName);
Image := TJvAni.Create;
try
AnimatedImage1.Active := False;
Image.LoadFromFile(OpenDialog.FileName);
Image.AssignToBitmap(AnimatedImage1.Glyph, clFuchsia, True,
AnimatedImage1.Orientation = goVertical);
ComboBox7.ItemIndex := -1;
AnimatedImage1.Interval := Image.Header.dwJIFRate div 4;
SpinEdit3.Value := AnimatedImage1.Interval;
AnimatedImage1.TransparentColor := clFuchsia;
AnimatedImage1.Active := True;
finally
Image.Free;
end;
end;
end;
initialization
RegisterClasses([TBevel]);
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -