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

📄 dxribbonskins.pas

📁 胜天进销存源码,国产优秀的进销存
💻 PAS
📖 第 1 页 / 共 5 页
字号:
    DrawApplicationButtonLC(DC, R, AState)
  else
    Parts[FApplicationButton[Ord(AState)]].Draw(DC, R);
end;

procedure TdxCustomRibbonSkin.DrawApplicationMenuButton(DC: HDC; const R: TRect; AState: Integer);
begin
  if AState = DXBAR_HOT then
    InternalDrawPart(FSmallButtons, DC, R, AState)
  else
    Parts[FApplicationMenuButton].Draw(DC, R);
end;

procedure TdxCustomRibbonSkin.DrawApplicationMenuBorder(DC: HDC; const R: TRect);
begin
  if LowColors then
    DrawApplicationMenuBorderLC(DC, R)
  else
    Parts[FApplicationMenuBorder].Draw(DC, R);
end;

procedure TdxCustomRibbonSkin.DrawApplicationMenuContentHeader(DC: HDC; const R: TRect);
begin
  if LowColors then
    FillRectByColor(DC, R, clMenu)
  else
    Parts[FApplicationMenuContentHeader].Draw(DC, R);
end;

procedure TdxCustomRibbonSkin.DrawApplicationMenuContentFooter(DC: HDC; const R: TRect);
begin
  if LowColors then
    FillRectByColor(DC, R, clMenu)
  else
    Parts[FApplicationMenuContentFooter].Draw(DC, R);
end;

procedure TdxCustomRibbonSkin.DrawArrowDown(DC: HDC; const R: TRect; AState: Integer);
begin
  if FLowColors then
    DrawBlackArrow(DC, R, adDown)
  else
    InternalDrawPart(FArrowsDown, DC, R, AState);
end;

procedure TdxCustomRibbonSkin.DrawMenuArrowDown(DC: HDC; const R: TRect);
begin
  if FLowColors then
    DrawBlackArrow(DC, R, adDown)
  else
    Parts[FMenuArrowDown].Draw(DC, R);
end;

procedure TdxCustomRibbonSkin.DrawMenuArrowRight(DC: HDC; const R: TRect);
begin
  if FLowColors then
    DrawBlackArrow(DC, R, adRight)
  else
    Parts[FMenuArrowRight].Draw(DC, R);
end;

procedure TdxCustomRibbonSkin.DrawButtonGroup(DC: HDC; const R: TRect; AState: Integer);
begin
  InternalDrawPart(FButtonGroup, DC, R, AState);
end;

procedure TdxCustomRibbonSkin.DrawButtonGroupBorderLeft(DC: HDC; const R: TRect);
begin
  if not LowColors then
    Parts[FButtonGroupBorderLeft].Draw(DC, R);
end;

procedure TdxCustomRibbonSkin.DrawButtonGroupBorderMiddle(DC: HDC; const R: TRect; AState: Integer);
begin
  if not LowColors then
    InternalDrawPart(FButtonGroupBorderMiddle, DC, R, AState);
end;

procedure TdxCustomRibbonSkin.DrawButtonGroupBorderRight(DC: HDC; const R: TRect);
begin
  if not LowColors then
    Parts[FButtonGroupBorderRight].Draw(DC, R);
end;

procedure TdxCustomRibbonSkin.DrawButtonGroupSplitButtonSeparator(DC: HDC; const R: TRect; AState: Integer);
begin
  if not LowColors then
    InternalDrawPart(FButtonGroupSplitButtonSeparator, DC, R, AState);
end;

procedure TdxCustomRibbonSkin.DrawCollapsedToolbarBackground(DC: HDC;
  const R: TRect; AState: Integer);
begin
  if LowColors then
    InternalDrawPart(FCollapsedToolbars, DC, R, AState)
  else
    case AState of
      0, 2, 3, 4: Parts[FCollapsedToolbars[AState]].Draw(DC, R);
    else
      Parts[FCollapsedToolbars[0]].Draw(DC, R);
    end;
end;

procedure TdxCustomRibbonSkin.DrawCollapsedToolbarGlyphBackground(DC: HDC;
  const R: TRect; AState: Integer);
begin
  InternalDrawPart(FCollapsedToolbarGlyphBackgrounds, DC, R, AState);
end;

procedure TdxCustomRibbonSkin.DrawDropDownBorder(DC: HDC; const R: TRect);
begin
  Parts[FDropDownBorder].Draw(DC, R);
end;

procedure TdxCustomRibbonSkin.DrawDropDownGalleryBackground(DC: HDC; const R: TRect);
begin
  FillRectByColor(DC, R, GetPartColor(DXBAR_DROPDOWNGALLERY, DXBAR_NORMAL));
end;

procedure TdxCustomRibbonSkin.DrawDropDownGalleryBottomSizeGrip(DC: HDC;
  const R: TRect);
var
  ARect: TRect;
begin
  ARect := cxRectInflate(R, 0, -3, -2, -1);
  ARect.Left := ARect.Right - cxRectHeight(ARect);
  Parts[FDropDownGalleryBottomSizeGrip].Draw(DC, ARect);
end;

procedure TdxCustomRibbonSkin.DrawDropDownGalleryBottomSizingBand(DC: HDC;
  const R: TRect);
begin
  Parts[FDropDownGalleryBottomSizingBand].Draw(DC, R);
end;

procedure TdxCustomRibbonSkin.DrawDropDownGalleryBottomVerticalSizeGrip(DC: HDC;
  const R: TRect);
begin
  DrawDropDownGalleryVerticalSizeGrip(DC, Rect(R.Left, R.Top + 1, R.Right, R.Bottom));
end;

procedure TdxCustomRibbonSkin.DrawDropDownGalleryTopSizeGrip(DC: HDC;
  const R: TRect);
var
  ARect: TRect;
begin
  ARect := cxRectInflate(R, 0, -1, -2, -3);
  ARect.Left := ARect.Right - cxRectHeight(ARect);
  Parts[FDropDownGalleryTopSizeGrip].Draw(DC, ARect);
end;

procedure TdxCustomRibbonSkin.DrawDropDownGalleryTopSizingBand(DC: HDC;
  const R: TRect);
begin
  Parts[FDropDownGalleryTopSizingBand].Draw(DC, R);
end;

procedure TdxCustomRibbonSkin.DrawDropDownGalleryTopVerticalSizeGrip(DC: HDC;
  const R: TRect);
begin
  DrawDropDownGalleryVerticalSizeGrip(DC, Rect(R.Left, R.Top, R.Right, R.Bottom - 1));
end;

procedure TdxCustomRibbonSkin.DrawEditArrowButton(DC: HDC; const R: TRect; AState: Integer);
begin
  // do nothing
end;

procedure TdxCustomRibbonSkin.DrawEditButton(DC: HDC; const R: TRect; AState: Integer);
begin
  InternalDrawPart(FEditButtons, DC, R, AState);
end;

procedure TdxCustomRibbonSkin.DrawEditEllipsisButton(DC: HDC; const R: TRect; AState: Integer);
begin
  // do nothing
end;

procedure TdxCustomRibbonSkin.DrawEditSpinDownButton(DC: HDC; const R: TRect; AState: Integer);
begin
  // do nothing
end;

procedure TdxCustomRibbonSkin.DrawEditSpinUpButton(DC: HDC; const R: TRect; AState: Integer);
begin
  // do nothing
end;

procedure TdxCustomRibbonSkin.DrawFormBorders(DC: HDC;
  const ABordersWidth: TRect; ACaptionHeight: Integer;
  const AData: TdxRibbonFormData);
var
  R: TRect;
  ARectangularBottom: Boolean;
begin
  if LowColors then
    DrawFormBordersLC(DC, ABordersWidth, ACaptionHeight, AData)
  else
  begin
    //catpion borders
    if ACaptionHeight > 0 then
    begin
      R := AData.Bounds;
      R.Bottom := ACaptionHeight;
      R.Right := R.Left + ABordersWidth.Left;
      Parts[FCaptionLeftBorder[not AData.Active]].Draw(DC, R);
      R.Right := AData.Bounds.Right;
      R.Left := R.Right - ABordersWidth.Right;
      Parts[FCaptionRightBorder[not AData.Active]].Draw(DC, R)
    end;
    ARectangularBottom := IsRectangularFormBottom(AData);
    if ABordersWidth.Bottom > 1 then
    begin
      R := AData.Bounds;
      R.Top := R.Bottom - ABordersWidth.Bottom;
      Parts[FBottomBorderThick[ARectangularBottom][not AData.Active]].Draw(DC, R);
      ExcludeClipRect(DC, R);
    end
    else
    begin
      R := AData.Bounds;
      R.Top := R.Bottom - ABordersWidth.Bottom;
      Inc(R.Left, ABordersWidth.Left);
      Dec(R.Right, ABordersWidth.Right);
      Parts[FBottomBorderThin[not AData.Active]].Draw(DC, R);
    end;
    R := AData.Bounds;
    if not ARectangularBottom then
      Dec(R.Bottom);
    R.Top := ACaptionHeight + ABordersWidth.Top;
    R.Right := R.Left + ABordersWidth.Left;
    Parts[FLeftBorder[not AData.Active]].Draw(DC, R);
    R.Right := AData.Bounds.Right;
    R.Left := R.Right - ABordersWidth.Right;
    Parts[FRightBorder[not AData.Active]].Draw(DC, R);
  end;
end;

procedure TdxCustomRibbonSkin.DrawFormBorderIcon(DC: HDC; const R: TRect;
  AIcon: TdxBorderDrawIcon; AState: TdxBorderIconState);
var
  APart: Integer;
  GR: TRect;
begin
  if LowColors then
    DrawFormBorderIconLC(DC, R, AIcon, AState)
  else
  begin
    case AState of
      bisHot: APart := 0;
      bisPressed: APart := 1;
      bisHotInactive: APart := 2;
    else
      APart := -1;
    end;
    if APart >= 0 then
      Parts[FBorderIcons[APart]].Draw(DC, R);
    GR := cxRectBounds(R.Left, R.Top, 9, 9);
    OffsetRect(GR, (R.Right - R.Left - 9) div 2, (R.Bottom - R.Top - 9) div 2 + 1);

    case AState of
      bisHot: APart := 1;
      bisPressed: APart := 2;
      bisInactive: APart := 3;
      bisHotInactive: APart := 3;
    else
      APart := 0;
    end;
    Parts[FBorderIconGlyph[AIcon][APart]].Draw(DC, GR);
  end;
end;

procedure TdxCustomRibbonSkin.DrawFormCaption(DC: HDC; const R: TRect;
  const AData: TdxRibbonFormData);
var
  ARect: TRect;
begin
  if LowColors then
    DrawFormCaptionLC(DC, R, AData)
  else
  begin
    if AData.State = wsMaximized then
      Parts[FCaptionZoomed[not AData.Active]].Draw(DC, R)
    else if AData.State = wsMinimized then
    begin
      ARect := R;
      Dec(ARect.Bottom, 1);
      Parts[FCaption[not AData.Active]].Draw(DC, ARect);
      ARect := R;
      ARect.Top := ARect.Bottom - 1;
      Parts[FBottomBorderThin[not AData.Active]].Draw(DC, ARect);
    end
    else
      Parts[FCaption[not AData.Active]].Draw(DC, R);
  end;
end;

procedure TdxCustomRibbonSkin.DrawFormStatusBarPart(DC: HDC; const R: TRect;
  AIsLeft, AIsActive, AIsRaised, AIsRectangular: Boolean);
var
  APart: Integer;
begin
  if LowColors then
    FillRectByColor(DC, R, clBtnFace)
  else
  begin
    APart := 0;
    Inc(APart, Ord(AIsRaised));
    Inc(APart, Ord(not AIsActive) * 2);
    if AIsLeft then
      Parts[FFormStatusBarLeftParts[AIsRectangular][APart]].Draw(DC, R)
    else
      Parts[FFormStatusBarRightParts[AIsRectangular][APart]].Draw(DC, R);
  end;
end;

procedure TdxCustomRibbonSkin.DrawHelpButton(DC: HDC; const R: TRect;
  AState: TdxBorderIconState);
var
  APart: Integer;
begin
  case AState of
    bisHot: APart := DXBAR_HOT;
    bisPressed: APart := DXBAR_PRESSED;
  else
    APart := DXBAR_NORMAL;
  end;
  if APart = DXBAR_NORMAL then
    FillRectByColor(DC, R, GetPartColor(rspRibbonBackground))
  else
    DrawSmallButton(DC, R, APart);
end;

procedure TdxCustomRibbonSkin.DrawHelpButtonGlyph(DC: HDC; const R: TRect;
  AGlyph: TBitmap);
var
  GR: TRect;
begin
  GR := cxRectBounds(R.Left, R.Top, 16, 16);
  OffsetRect(GR, (R.Right - R.Left - 16) div 2, (R.Bottom - R.Top - 16) div 2);
  Parts[FHelpButton].Draw(DC, GR);
end;

procedure TdxCustomRibbonSkin.DrawGalleryFilterBandBackground(DC: HDC;
  const R: TRect);
begin
  Parts[FGalleryFilterBand].Draw(DC, R);
end;

procedure TdxCustomRibbonSkin.DrawGalleryGroupHeaderBackground(DC: HDC; const R: TRect);
begin
  Parts[FGalleryGroupHeader].Draw(DC, R);
end;

procedure TdxCustomRibbonSkin.DrawGroupScrollButton(DC: HDC; const R: TRect; ALeft: Boolean; AState: Integer);
var
  I: Integer;
begin
  case AState of
    DXBAR_HOT: I := 1;
    DXBAR_PRESSED: I := 2;
  else

⌨️ 快捷键说明

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