⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jvgcommclasses.pas

📁 East make Tray Icon in delphi
💻 PAS
📖 第 1 页 / 共 4 页
字号:
end;

procedure TJvgIllumination.SetShadowDepth(Value: Integer);
begin
  if Value < 0 then
    Value := 0;
  if FShadowDepth <> Value then
  begin
    FShadowDepth := Value;
    Changed;
  end;
end;

//=== { TJvgLabelTextStyles } ================================================

constructor TJvgLabelTextStyles.Create;
begin
  inherited Create;
  FActive := fstRaised;
  FPassive := fstRaised;
  FDisabled := fstPushed;
end;

procedure TJvgLabelTextStyles.Assign(Source: TPersistent);
var
  Src: TJvgLabelTextStyles;
begin
  if Source is TJvgLabelTextStyles then
  begin
    if Source = Self then
      Exit;
    Src := TJvgLabelTextStyles(Source);
    FPassive := Src.Passive;
    FActive := Src.Active;
    FDisabled := Src.Disabled;
    Changed;
  end
  else
    inherited Assign(Source);
end;

procedure TJvgLabelTextStyles.Changed;
begin
  if Assigned(FOnChanged) then
    FOnChanged(Self);
end;

procedure TJvgLabelTextStyles.SetPassive(Value: TglTextStyle);
begin
  if FPassive <> Value then
  begin
    FPassive := Value;
    Changed;
  end;
end;

procedure TJvgLabelTextStyles.SetActive(Value: TglTextStyle);
begin
  if FActive <> Value then
  begin
    FActive := Value;
    Changed;
  end;
end;

procedure TJvgLabelTextStyles.SetDisabled(Value: TglTextStyle);
begin
  if FDisabled <> Value then
  begin
    FDisabled := Value;
    Changed;
  end;
end;

//=== { TJvgCustomTextColors } ===============================================

constructor TJvgCustomTextColors.Create;
begin
  inherited Create;
  FText := clBlack;
  FTextDisabled := clGray;
  FDelineate := clWhite;
  FHighlight := clBtnHighlight;
  FShadow := clBtnShadow;
  FBackground := clBtnFace;
end;

procedure TJvgCustomTextColors.Assign(Source: TPersistent);
var
  Src: TJvgCustomTextColors;
begin
  if Source is TJvgCustomTextColors then
  begin
    if Source = Self then
      Exit;
    Src := TJvgCustomTextColors(Source);
    FText := Src.Text;
    FTextDisabled := Src.TextDisabled;
    FDelineate := Src.Delineate;
    FShadow := Src.Shadow;
    FHighlight := Src.Highlight;
    FBackground := Src.Background;
    Changed;
  end
  else
    inherited Assign(Source);
end;

procedure TJvgCustomTextColors.Changed;
begin
  if Assigned(FOnChanged) then
    FOnChanged(Self);
end;

procedure TJvgCustomTextColors.SetText(Value: TColor);
begin
  if FText <> Value then
  begin
    FText := Value;
    Changed;
  end;
end;

procedure TJvgCustomTextColors.SetTextDisabled(Value: TColor);
begin
  if FTextDisabled <> Value then
  begin
    FTextDisabled := Value;
    Changed;
  end;
end;

procedure TJvgCustomTextColors.SetDelineate(Value: TColor);
begin
  if FDelineate <> Value then
  begin
    FDelineate := Value;
    Changed;
  end;
end;

procedure TJvgCustomTextColors.SetHighlight(Value: TColor);
begin
  if FHighlight <> Value then
  begin
    FHighlight := Value;
    Changed;
  end;
end;

procedure TJvgCustomTextColors.SetShadow(Value: TColor);
begin
  if FShadow <> Value then
  begin
    FShadow := Value;
    Changed;
  end;
end;

procedure TJvgCustomTextColors.SetBackground(Value: TColor);
begin
  if FBackground <> Value then
  begin
    FBackground := Value;
    Changed;
  end;
end;

//=== { TJvgCustomLabelColors } ==============================================

constructor TJvgCustomLabelColors.Create;
begin
  inherited Create;
  FTextActive := clBlack;
  FDelineateActive := clWhite;
  FAutoHighlight := False;
  FAutoShadow := False;
  FColorHighlightShift := 40;
  FColorShadowShift := 60;
  FBackgroundActive := clBtnFace;
end;

procedure TJvgCustomLabelColors.Assign(Source: TPersistent);
var
  Src: TJvgCustomLabelColors;
begin
  inherited Assign(Source);
  if Source is TJvgCustomLabelColors then
  begin
    if Source = Self then
      Exit;
    Src := TJvgCustomLabelColors(Source);
    FTextActive := Src.TextActive;
    FDelineateActive := Src.DelineateActive;
    FAutoHighlight := Src.AutoHighlight;
    FAutoShadow := Src.AutoShadow;
    FColorHighlightShift := Src.ColorHighlightShift;
    FColorShadowShift := Src.ColorShadowShift;
    FBackgroundActive := Src.BackgroundActive;
    Changed;
  end;
end;

procedure TJvgCustomLabelColors.SetTextActive(Value: TColor);
begin
  if FTextActive <> Value then
  begin
    FTextActive := Value;
    Changed;
  end;
end;

procedure TJvgCustomLabelColors.SetDelineateActive(Value: TColor);
begin
  if FDelineateActive <> Value then
  begin
    FDelineateActive := Value;
    Changed;
  end;
end;

procedure TJvgCustomLabelColors.SetAutoHighlight(Value: Boolean);
begin
  if FAutoHighlight <> Value then
  begin
    FAutoHighlight := Value;
    Changed;
  end;
end;

procedure TJvgCustomLabelColors.SetAutoShadow(Value: Boolean);
begin
  if FAutoShadow <> Value then
  begin
    FAutoShadow := Value;
    Changed;
  end;
end;

procedure TJvgCustomLabelColors.SetColorHighlightShift(Value: Integer);
begin
  if FColorHighlightShift <> Value then
  begin
    FColorHighlightShift := Value;
    Changed;
  end;
end;

procedure TJvgCustomLabelColors.SetColorShadowShift(Value: Integer);
begin
  if FColorShadowShift <> Value then
  begin
    FColorShadowShift := Value;
    Changed;
  end;
end;

procedure TJvgCustomLabelColors.SetBackgroundActive(Value: TColor);
begin
  if FBackgroundActive <> Value then
  begin
    FBackgroundActive := Value;
    Changed;
  end;
end;

//=== { TJvgGroupBoxColors } =================================================

constructor TJvgGroupBoxColors.Create;
begin
  inherited Create;
  FCaption := clBtnFace;
  FCaptionActive := clBtnFace;
  FClient := clBtnFace;
  FClientActive := clBtnFace;
end;

procedure TJvgGroupBoxColors.Assign(Source: TPersistent);
var
  Src: TJvgGroupBoxColors;
begin
  inherited Assign(Source);
  if Source is TJvgGroupBoxColors then
  begin
    if Source = Self then
      Exit;
    Src := TJvgGroupBoxColors(Source);
    FCaption := Src.Caption;
    FCaptionActive := Src.CaptionActive;
    FClient := Src.Client;
    FClientActive := Src.ClientActive;
    Changed;
  end;
end;

procedure TJvgGroupBoxColors.SetCaption(Value: TColor);
begin
  if Value <> FCaption then
  begin
    FCaption := Value;
    Changed;
  end;
end;

procedure TJvgGroupBoxColors.SetCaptionActive(Value: TColor);
begin
  if Value <> FCaptionActive then
  begin
    FCaptionActive := Value;
    Changed;
  end;
end;

procedure TJvgGroupBoxColors.SetClient(Value: TColor);
begin
  if Value <> FClient then
  begin
    FClient := Value;
    Changed;
  end;
end;

procedure TJvgGroupBoxColors.SetClientActive(Value: TColor);
begin
  if Value <> FClientActive then
  begin
    FClientActive := Value;
    Changed;
  end;
end;

//=== { TJvgExtBevelOptions } ================================================

constructor TJvgExtBevelOptions.Create;
begin
  inherited Create;
  FActive := True;
  FBevelPenStyle := psSolid;
  FBevelPenWidth := 1;
end;

procedure TJvgExtBevelOptions.Assign(Source: TPersistent);
var
  Src: TJvgExtBevelOptions;
begin
  inherited Assign(Source);
  if Source is TJvgExtBevelOptions then
  begin
    if Source = Self then
      Exit;
    Src := TJvgExtBevelOptions(Source);
    FActive := Src.Active;
    FBevelPenStyle := Src.BevelPenStyle;
    FBevelPenWidth := Src.BevelPenWidth;
    FInteriorOffset := Src.InteriorOffset;
    Changed;
  end;
end;

procedure TJvgExtBevelOptions.SetActive(Value: Boolean);
begin
  if FActive <> Value then
  begin
    FActive := Value;
    Changed;
  end;
end;

procedure TJvgExtBevelOptions.SetBevelPenStyle(Value: TPenStyle);
begin
  if FBevelPenStyle <> Value then
  begin
    FBevelPenStyle := Value;
    Changed;
  end;
end;

procedure TJvgExtBevelOptions.SetBevelPenWidth(Value: Word);
begin
  if FBevelPenWidth <> Value then
  begin
    FBevelPenWidth := Value;
    Changed;
  end;
end;

procedure TJvgExtBevelOptions.SetInteriorOffset(Value: Word);
begin
  if FInteriorOffset <> Value then
  begin
    FInteriorOffset := Value;
    Changed;
  end;
end;

//=== { TJvgCustomListBoxItemStyle } =========================================

constructor TJvgCustomListBoxItemStyle.Create;
begin
  inherited Create;
  FBevel := TJvgBevelOptions.Create;
  FFont := TFont.Create;
end;

destructor TJvgCustomListBoxItemStyle.Destroy;
begin
  FFont.Free;
  FBevel.Free;
  inherited Destroy;
end;

procedure TJvgCustomListBoxItemStyle.Assign(Source: TPersistent);
var
  Src: TJvgCustomListBoxItemStyle;
begin
  if Source is TJvgCustomListBoxItemStyle then
  begin
    if Source = Self then
      Exit;
    Src := TJvgCustomListBoxItemStyle(Source);
    FColor := Src.Color;
    FDelineateColor := Src.DelineateColor;
    FTextStyle := Src.TextStyle;
    Font := Src.Font;
    Bevel := Src.Bevel; // invokes OnChanged
  end
  else
    inherited Assign(Source);
end;

procedure TJvgCustomListBoxItemStyle.SetOnChanged(Value: TNotifyEvent);
begin
  FOnChanged := Value;
  FBevel.OnChanged := Value;
end;

procedure TJvgCustomListBoxItemStyle.Changed;
begin
  if Assigned(FOnChanged) then
    FOnChanged(Self);
end;

procedure TJvgCustomListBoxItemStyle.SetColor(Value: TColor);
begin
  if FColor <> Value then
  begin
    FColor := Value;
    Changed;
  end;
end;

procedure TJvgCustomListBoxItemStyle.SetDelineateColor(Value: TColor);
begin
  if FDelineateColor <> Value then
  begin
    FDelineateColor := Value;
    Changed;
  end;
end;

procedure TJvgCustomListBoxItemStyle.SetFont(Value: TFont);
begin
  if Value <> FFont then
  begin
    FFont.Assign(Value);
    Changed;
  end;
end;

procedure TJvgCustomListBoxItemStyle.SetBevel(Value: TJvgBevelOptions);
begin
  FBevel.Assign(Value);
end;

procedure TJvgCustomListBoxItemStyle.SetTextStyle(Value: TglTextStyle);
begin
  if Value <> FTextStyle then
  begin
    FTextStyle := Value;
    Changed;
  end;
end;

function TJvgCustomListBoxItemStyle.HighlightColor: TColor;
begin
  Result := IncColor(Color, 60);
end;

function TJvgCustomListBoxItemStyle.ShadowColor: TColor;
begin
  Result := DecColor(Color, 60);
end;

//=== { TJvgListBoxItemStyle } ===============================================

constructor TJvgListBoxItemStyle.Create;
begin
  inherited Create;
  FGradient := TJvgGradient.Create;
  FTextGradient := TJvgGradient.Create;
end;

destructor TJvgListBoxItemStyle.Destroy;
begin
  FGradient.Free;
  FTextGradient.Free;
  inherited Destroy;
end;

procedure TJvgListBoxItemStyle.Assign(Source: TPersistent);
var
  Src: TJvgListBoxItemStyle;
begin
  inherited Assign(Source);
  if Source is TJvgListBoxItemStyle then
  begin
    if Source = Self then
      Exit;
    Src := TJvgListBoxItemStyle(Source);
    TextGradient := Src.TextGradient;
    Gradient := Src.Gradient;
  end
end;

procedure TJvgListBoxItemStyle.SetOnChanged(Value: TNotifyEvent);
begin

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -