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

📄 aqdockinguienhanced.pas

📁 AutomatedDocking Library 控件源代码修改 适合Delphi 2009 和C++ Builder 20009 使用。 修正汉字不能正确显示问题
💻 PAS
字号:
{*******************************************************************}
{                                                                   }
{       AutomatedDocking Library (Cross-Platform Edition)           }
{                                                                   }
{       Copyright (c) 1999-2008 AutomatedQA Corp.                   }
{       ALL RIGHTS RESERVED                                         }
{                                                                   }
{   The entire contents of this file is protected by U.S. and       }
{   International Copyright Laws. Unauthorized reproduction,        }
{   reverse-engineering, and distribution of all or any portion of  }
{   the code contained in this file is strictly prohibited and may  }
{   result in severe civil and criminal penalties and will be       }
{   prosecuted to the maximum extent possible under the law.        }
{                                                                   }
{   RESTRICTIONS                                                    }
{                                                                   }
{   THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES           }
{   (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE    }
{   SECRETS OF AUTOMATEDQA CORP. THE REGISTERED DEVELOPER IS        }
{   LICENSED TO DISTRIBUTE THE AUTOMATEDDOCKING LIBRARY AND ALL     }
{   ACCOMPANYING VCL AND CLX CONTROLS AS PART OF AN EXECUTABLE      }
{   PROGRAM ONLY.                                                   }
{                                                                   }
{   THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED      }
{   FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE        }
{   COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE       }
{   AVAILABLE TO OTHER INDIVIDUALS WITHOUT WRITTEN CONSENT          }
{   AND PERMISSION FROM AUTOMATEDQA CORP.                           }
{                                                                   }
{   CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON       }
{   ADDITIONAL RESTRICTIONS.                                        }
{                                                                   }
{*******************************************************************}

unit aqDockingUIEnhanced;

{$I aqDockingVer.inc}

interface

uses
  Types, Classes,
{$IFDEF VCL}
  Graphics, ImgList,
{$ELSE}
  QGraphics, QImgList,
{$ENDIF}
  aqUIHelpers, aqDockingUI, aqDockingUIStandard;

type
  TaqEnhancedUIStyle = class(TaqStandardUIStyle)
  protected
    { TaqDockingUIStyle }
    procedure DoDrawTabButton(ACanvas: TCanvas; ARect: TRect;
      AState: TaqTabButtonState; AKind: TaqTabButtonKind); override;
    procedure DoDrawTabPane(ACanvas: TCanvas; ARect: TRect;
      AOrientation: TaqTabOrientation); override;
    procedure DoDrawTabItem(ACanvas: TCanvas; ARect: TRect;
      const ACaption: string; AState: TaqTabItemState;
      APosition: TaqTabItemPosition; AOrientation: TaqOrientation;
      AButtonAreaWidthBefore: Integer; AButtonAreaWidthAfter: Integer;
      ADrawImage: Boolean; AImages: TCustomImageList; AImageIndex: Integer); override;
    procedure DoDrawCaptionButton(ACanvas: TCanvas; ARect: TRect;
      AState: TaqDockButtonState; ACaptionState: TaqDockCaptionState; AKind: TaqDockButtonKind); override;
    procedure DoDrawCaption(ACanvas: TCanvas; ARect: TRect; const ACaption: string;
      AState: TaqDockCaptionState; AMaxCaptionWidth: Integer; var AFitCaption: Boolean; ADrawImage: Boolean;
      AImages: TCustomImageList; AImageIndex: Integer); override;
    procedure DoDrawSplitter(ACanvas: TCanvas; ARect: TRect;
      AOrientation: TaqSplitterOrientation); override;
  end;

implementation

uses
{$IFDEF VCL}
  Windows,
{$ENDIF}
  Math;

{ TaqEnhancedUIStyle }

procedure TaqEnhancedUIStyle.DoDrawCaption(ACanvas: TCanvas;
  ARect: TRect; const ACaption: string; AState: TaqDockCaptionState;
  AMaxCaptionWidth: Integer; var AFitCaption: Boolean; ADrawImage: Boolean;
  AImages: TCustomImageList; AImageIndex: Integer);
begin
  inherited DoDrawCaption(ACanvas, ARect, ACaption, AState, AMaxCaptionWidth,
    AFitCaption, ADrawImage, AImages, AImageIndex);
end;

procedure TaqEnhancedUIStyle.DoDrawCaptionButton(
  ACanvas: TCanvas; ARect: TRect; AState: TaqDockButtonState;
  ACaptionState: TaqDockCaptionState; AKind: TaqDockButtonKind);
const
  EdgeStyles: array [TaqDockButtonState] of TaqEdgeStyle = (
    // tbsNormal, tbsHot, tbsPressed, tbsDisabled
    esNone, esRaised, esLowered, esRaised);
begin
  ACanvas.Pen.Style := psSolid;
  aqUIHelpers.DrawEdge(ACanvas, ARect, EdgeStyles[AState], esNone, [ebRight, ebBottom]);
  aqUIHelpers.DrawEdge(ACanvas, ARect, esNone, EdgeStyles[AState], [ebLeft, ebTop]);
  InflateRect(ARect, -1, -1);

  DoDrawCaptionButtonWidget(ACanvas, ARect, AState, ACaptionState, AKind);
end;

procedure TaqEnhancedUIStyle.DoDrawSplitter(ACanvas: TCanvas;
  ARect: TRect; AOrientation: TaqSplitterOrientation);
begin
  inherited;
end;

procedure TaqEnhancedUIStyle.DoDrawTabButton(ACanvas: TCanvas;
  ARect: TRect; AState: TaqTabButtonState;
  AKind: TaqTabButtonKind);
const
  BtnOuterEdgeStyles: array [TaqTabButtonState] of TaqEdgeStyle = (
    // tbsNormal, tbsHot, tbsPressed, tbsDisabled
    esNone, esRaised, esLowered, esNone);
begin
  if AKind = tbkClose then
  begin
    if FLastTabState in [tisSelected, tisFocused] then
      OffsetRect(ARect, -1, 0); // raise active tab
    ARect.Top := FLastTabTextRect.Top;
    ARect.Bottom := FLastTabTextRect.Bottom;
  end
  else
    with ACanvas do
    begin
      Brush.Style := bsSolid;
      Brush.Color := TabPaneColor.StartColor;
      FillRect(ARect);
    end;

  aqUIHelpers.DrawEdge(ACanvas, ARect, esNone, BtnOuterEdgeStyles[AState], ebRect);
  InflateRect(ARect, -1, -1);
  DoDrawTabButtonWidget(ACanvas, ARect, AState, AKind);
end;

procedure TaqEnhancedUIStyle.DoDrawTabItem(ACanvas: TCanvas;
  ARect: TRect; const ACaption: string; AState: TaqTabItemState;
  APosition: TaqTabItemPosition; AOrientation: TaqOrientation;
  AButtonAreaWidthBefore: Integer; AButtonAreaWidthAfter: Integer;
  ADrawImage: Boolean; AImages: TCustomImageList; AImageIndex: Integer);
begin
  inherited;
end;

procedure TaqEnhancedUIStyle.DoDrawTabPane(ACanvas: TCanvas;
  ARect: TRect; AOrientation: TaqTabOrientation);
begin
  inherited;
end;

end.

⌨️ 快捷键说明

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