亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? wzgrid.pas

?? delphi控件的使用
?? PAS
?? 第 1 頁 / 共 4 頁
字號:
unit WzGrid;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Grids;

type
  TColumnValue  = ( cvColor, cvWidth, cvFont, cvAlignment, cvReadOnly,cvImeMode,
                    cvMask, cvAutoSelect, cvDataType,cvSL,cvSmode,cvDL,
                    cvTitleColor, cvTitleCaption, cvTitleAlignment, cvTitleFont );
  TColumnValues = set of TColumnValue;

const
  cm_DeferLayout = WM_USER + 100;
  IndicatorWidth = 11;
  ColumnTitleValues = [cvTitleColor..cvTitleFont];

type
  TColumnButtonStyle = (cbsAuto, cbsEllipsis, cbsNone);

  TWzGrid = class;
  TColumn = class;

  TColumnTitle = class(TPersistent)
  private
    FColumn: TColumn;
    FCaption: string;
    FFont: TFont;
    FColor: TColor;
    FAlignment: TAlignment;
//    procedure FontChanged(Sender: TObject);
    function GetAlignment: TAlignment;
    function GetColor: TColor;
    function GetCaption: string;
//    function GetFont: TFont;
    function IsAlignmentStored: Boolean;
    function IsColorStored: Boolean;
//    function IsFontStored: Boolean;
    function IsCaptionStored: Boolean;
    procedure SetAlignment(Value: TAlignment);
    procedure SetColor(Value: TColor);
//    procedure SetFont(Value: TFont);
    procedure SetCaption(const Value: string); virtual;
  protected
//    procedure RefreshDefaultFont;
  public
    constructor Create(Column: TColumn);
    destructor Destroy; override;
    procedure Assign(Source: TPersistent); override;
    function DefaultAlignment: TAlignment;
    function DefaultColor: TColor;
//    function DefaultFont: TFont;
    function DefaultCaption: string;
    procedure RestoreDefaults; virtual;
    property Column: TColumn read FColumn;
  published
    property Alignment: TAlignment read GetAlignment write SetAlignment
      stored IsAlignmentStored;
    property Caption: string read GetCaption write SetCaption stored IsCaptionStored;
    property Color: TColor read GetColor write SetColor stored IsColorStored;
//    property Font: TFont read GetFont write SetFont stored IsFontStored;
  end;

  TColumn = class(TCollectionItem)
  private
    FColor     : TColor;
    FReadonly     : Boolean;
    FFont      : TFont;
    FWidth     : Integer;
    FTitle: TColumnTitle;
    FDropDownRows : Integer;
    FButtonStyle  : TColumnButtonStyle;
    FAssignedValues : TColumnValues;
    FAutoSelect   : Boolean;
    FAlignment    : TAlignment;
    FFieldName    : String;
    FOrgIndex : Integer;
    function  GetColor: TColor;
    procedure SetColor(Value: TColor);
    function  IsColorStored: Boolean;
    function  GetReadOnly: Boolean;
    function  IsReadOnlyStored: Boolean;
    procedure SetReadOnly(Value: Boolean); virtual;
    function  GetWidth: Integer;
    function  IsWidthStored: Boolean;
    procedure SetWidth(Value: Integer); virtual;
    procedure SetTitle(Value: TColumnTitle);
    function  GetAutoSelect: boolean;
    procedure SetAutoSelect(Value: boolean);
    function  IsAutoSelectStored: Boolean;
    function  GetAlignment: TAlignment;
    function  IsAlignmentStored: Boolean;
    procedure SetAlignment(Value: TAlignment); virtual;
    procedure SetFieldName(Value: String);
    function GetOrgIndex : Integer;
    procedure SetOrgIndex(Value: integer);
  protected
    function GetGrid: TWzGrid;
    function  CreateTitle: TColumnTitle; virtual;
    function  DefaultAutoSelect: boolean;
  public
    constructor Create(Collection: TCollection); override;
    destructor  Destroy; override;
    procedure Assign(Source: TPersistent); override;
    function  DefaultFont: TFont;
    function DefaultColor: TColor;
    function  DefaultReadOnly: Boolean;
    function  DefaultWidth: Integer;
    procedure RestoreDefaults; virtual;
    property  AssignedValues: TColumnValues read FAssignedValues;
    function  DefaultAlignment: TAlignment;
  published
    property  Color: TColor read GetColor write SetColor stored IsColorStored;
    property  ReadOnly: Boolean read GetReadOnly write SetReadOnly stored IsReadOnlyStored;
    property  Width: Integer read GetWidth write SetWidth stored IsWidthStored;
    property  Title: TColumnTitle read FTitle write SetTitle;
    property  AutoSelect : boolean read GetAutoSelect write SetAutoSelect
                                   stored IsAutoSelectStored;
    property Alignment : TAlignment read GetAlignment write SetAlignment stored IsAlignmentStored;
    property  FieldName: String read FFieldName write SetFieldName;
    property OrgIndex : integer read GetOrgIndex write SetOrgIndex;
  end;

  TColumnClass = class of TColumn;

  TWzGridColumns = class(TCollection)
  private
    FGrid : TWzGrid;
    function  GetColumn(Index: Integer): TColumn;
    procedure SetColumn(Index: Integer; Value: TColumn);
  protected
    function  GetOwner: TPersistent; override;
    procedure Update(Item: TCollectionItem); override;
  public
    constructor Create(Grid: TWzGrid; ColumnClass: TColumnClass);
    function  Add: TColumn;
    property  Grid: TWzGrid read FGrid;
    property  Items[Index: Integer]: TColumn read GetColumn write SetColumn; default;
  end;

  TDBGridOption = (dgEditing, dgAlwaysShowEditor, dgTitles, dgIndicator,
    dgColumnResize, dgColLines, dgRowLines, dgTabs, dgRowSelect,
    dgAlwaysShowSelection, dgConfirmDelete, dgCancelOnExit, dgMultiSelect,
    dgColumnMove,dgRowMove);

  TDBGridOptions = set of TDBGridOption;

  TSetDataEvent = procedure ( Sender: TObject; OrgIndex : integer; Row: integer;
                              var value : string ) of object;
  TGetDataEvent = procedure ( Sender: TObject; OrgIndex : integer; Row: integer;
                              value : string ) of object;
  TChkDataEvent = procedure ( Sender: TObject; OrgIndex : integer; Row: integer;
                              all: boolean; var ChkMode : boolean ) of object;


  TWzGrid = class(TStringGrid)
  private
    { Private declarations }
    FColumns  : TWzGridColumns;
    FOptions   : TDBGridOptions;
    FUpdateLock: Byte;
    FLayoutLock: Byte;
    FTitleOffset, FIndicatorOffset : Byte;
    FDefaultDrawing        : Boolean;

    FLineName : TStrings;
    FReadOnly: Boolean;
    FOnGoNext   : TNotifyEvent;
    FOnColEnter : TNotifyEvent;
    FOnColExit : TNotifyEvent;
    FInColExit : Boolean;
    FOnSetData : TSetDataEvent;
    FOnGetData : TGetDataEvent;
    FOnChkData  : TChkDataEvent;
    procedure SetOptions(Value: TDBGridOptions);
    procedure SetColumns(Value: TWzGridColumns);
    procedure InternalLayout;
    procedure UpdateRowCount;
    procedure SetLineName(Value: TStrings);
    function GetSelectedIndex: Integer;
    procedure SetSelectedIndex(Value: Integer);
    procedure MoveCol(RawCol, Direction: Integer);
    procedure CMExit(var Message: TMessage); message CM_EXIT;
    procedure CMDeferLayout(var Message); message cm_DeferLayout;
  protected
    { Protected declarations }
    procedure DeferLayout;
    procedure CancelLayout;
    procedure BeginLayout;  //refresh the grid after change the layout
    procedure BeginUpdate;
    procedure EndLayout;
    procedure EndUpdate;
    function  CreateColumns: TWzGridColumns; dynamic;
    function  CreateEditor: TInplaceEdit; override;
    procedure KeyDown(var Key: Word; Shift: TShiftState); override;
    procedure LayoutChanged; virtual;
    procedure SetColumnAttributes; virtual;
    function  DataToRawColumn(ACol: Integer): Integer;
    function  AcquireLayoutLock: Boolean;
    procedure Loaded; override;
    procedure DrawCell(ACol, ARow: Longint; ARect: TRect; AState: TGridDrawState); override;
    function  GetSlRow : integer;
    procedure SetSlRow( Value : integer );
    function  HighlightCell(DataCol, DataRow: Integer;
      const Value: string; AState: TGridDrawState): Boolean; virtual;
    function  RawToDataColumn(ACol: Integer): Integer;
    function  CanEditModify: Boolean; override;
    procedure ColExit; dynamic;
    procedure ColEnter; dynamic;
    procedure ColWidthsChanged; override;
    function  CanEditShow: Boolean; override;
    property  UpdateLock: Byte read FUpdateLock;
    property ReadOnly: Boolean read FReadOnly write FReadOnly default False;
    property  LayoutLock: Byte read FLayoutLock;
{    procedure DrawColumnCell(const Rect: TRect; DataCol: Integer;
      Column: TColumn; State: TGridDrawState); dynamic;
}  public
    { Public declarations }
    be4 : boolean;
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
    procedure  DefaultDrawColumnCell(const Rect: TRect;
      Value: String; Column: TColumn; State: TGridDrawState);
    procedure HideEdit;
    property SelectedRow : integer read GetSlRow write SetSlRow;
    property SelectedIndex: Integer read GetSelectedIndex write SetSelectedIndex;
  published
    { Published declarations }
    property  Columns: TWzGridColumns read FColumns write SetColumns;
    property  Options: TDBGridOptions read FOptions write SetOptions
              default [dgEditing, dgTitles, dgIndicator, dgColumnResize, dgColLines,
                       dgRowLines, dgTabs, dgConfirmDelete, dgCancelOnExit,
                       dgColumnMove,dgRowMove];
    property  DefaultDrawing: Boolean read FDefaultDrawing write FDefaultDrawing default True;
    property  OnGoNext : TNotifyEvent read FOnGoNext write FOnGoNext;
    property  LineName : TStrings read FLineName write SetLineName;
    property OnColEnter: TNotifyEvent read FOnColEnter write FOnColEnter;
    property OnColExit: TNotifyEvent read FOnColExit write FOnColExit;
    property  OnSetData : TSetDataEvent read FOnSetData write FOnSetData;
    property  OnGetData : TGetDataEvent read FOnGetData write FOnGetData;
    property OnChkData : TChkDataEvent read FOnChkData write FOnChkData;
  end;


procedure Register;
procedure SelectNextCtrl( CurCtrl: TWinControl; goForward: boolean );
function between( d, d1,d2 : double ) : boolean;
procedure WriteText(ACanvas: TCanvas; ARect: TRect; DX, DY: Integer;
  const Text: string; Alignment: TAlignment);
function IsActiveControl(Sender:TObject  ): Boolean;

implementation

type
  TEditStyle = (esSimple, esEllipsis, esPickList, esDataList);

  TWzInplaceEdit = class(TInplaceEdit)
  private
    FButtonWidth : Integer;
    FEditStyle : TEditStyle;
    procedure SetEditStyle(Value: TEditStyle);
    procedure CMCancelMode(var Message: TCMCancelMode); message CM_CancelMode;
    procedure WMCancelMode(var Message: TMessage); message WM_CancelMode;
    procedure WMKillFocus(var Message: TMessage); message WM_KillFocus;
    procedure WMLButtonDblClk(var Message: TWMLButtonDblClk); message wm_LButtonDblClk;
    procedure WMPaint(var Message: TWMPaint); message wm_Paint;
    procedure WMSetCursor(var Message: TWMSetCursor); message WM_SetCursor;
  protected
    procedure KeyDown(var Key: Word; Shift: TShiftState); override;
    procedure WndProc(var Message: TMessage); override;
    procedure PaintWindow(DC: HDC); override;
    procedure UpdateContents; override;
    procedure BoundsChanged; override;
    property  EditStyle : TEditStyle read FEditStyle write SetEditStyle;
  public
    constructor Create(Owner: TComponent); override;
  published
  end;

procedure Register;
begin
  RegisterComponents('Samples', [TWzGrid]);
end;

constructor TWzInplaceEdit.Create(Owner: TComponent);
begin
  inherited Create(Owner);
//  FLookupSource := TDataSource.Create(Self);
  FButtonWidth := GetSystemMetrics(SM_CXVSCROLL);
  FEditStyle := esSimple;
end;

procedure TWzInplaceEdit.WndProc(var Message: TMessage);
begin
  case Message.Msg of
    wm_KeyDown,
    wm_SysKeyDown,
    wm_Char
      : if EditStyle in [esPickList] then
        with TWMKey(Message) do begin
//        DoDropDownKeys(CharCode, KeyDataToShiftState(KeyData));
//        if (CharCode <> 0) and FListVisible then begin
            with TMessage(Message) do
//            SendMessage(FActiveList.Handle, Msg, WParam, LParam);
            Exit;
//        end;
        end
  end;
  inherited;
end;

procedure TWzInplaceEdit.PaintWindow(DC: HDC);
var
  R: TRect;
  Flags: Integer;
  W: Integer;
begin
  if FEditStyle <> esSimple then begin
    SetRect(R, Width - FButtonWidth, 0, Width, Height);
    Flags := 0;
    if FEditStyle in [esPickList] then begin
     {if FActiveList = nil then
        Flags := DFCS_INACTIVE
      else if FPressed then}
        Flags := DFCS_FLAT or DFCS_PUSHED;
      DrawFrameControl(DC, R, DFC_SCROLL, Flags or DFCS_SCROLLCOMBOBOX);
    end else begin
{     if FPressed then   }
        Flags := BF_FLAT;
//      DrawEdge(DC, R, EDGE_RAISED, BF_RECT or BF_MIDDLE or Flags);
      Flags := ((R.Right - R.Left) shr 1) - 1{+ Ord(FPressed)};
      W := Height shr 3;
      if W = 0 then W := 1;
{      PatBlt(DC, R.Left + Flags, R.Top + Flags, W, W, BLACKNESS);
      PatBlt(DC, R.Left + Flags - (W * 2), R.Top + Flags, W, W, BLACKNESS);
      PatBlt(DC, R.Left + Flags + (W * 2), R.Top + Flags, W, W, BLACKNESS);
}    end;
    ExcludeClipRect(DC, R.Left, R.Top, R.Right, R.Bottom);
  end;
  inherited PaintWindow(DC);
end;

procedure TWzInplaceEdit.KeyDown(var Key: Word; Shift: TShiftState);
  procedure SendToParent;
  begin
    TWzGrid(Grid).KeyDown(Key, Shift);
    Key := 0;
  end;

begin
{  case Key of
  VK_RETURN : SendToParent;
  else inherited KeyDown(Key, Shift);
  end;}
  if (EditStyle = esEllipsis) and (Key = VK_DOWN) and (Shift = [ssAlt]) then begin
    SendToParent;
  end else if ( EditStyle = esPickList ) and ( Key = VK_DELETE ) then begin
    Key := 0;
  end else if ( Key in [VK_DELETE,VK_INSERT] ) and ( ssCtrl in Shift ) then begin
    SendToParent
  end else if Key in [VK_RETURN,VK_SPACE] then begin
    SendToParent;
  end else
    inherited KeyDown(Key, Shift);
end;

procedure TWzInplaceEdit.CMCancelMode(var Message: TCMCancelMode);
begin
//if (Message.Sender <> Self) and (Message.Sender <> FActiveList) then
//  CloseUp(False);
end;

procedure TWzInplaceEdit.WMCancelMode(var Message: TMessage);
begin
//StopTracking;
  inherited;
end;

procedure TWzInplaceEdit.WMKillFocus(var Message: TMessage);
begin
  inherited;
//CloseUp(False);
end;

procedure TWzInplaceEdit.WMLButtonDblClk(var Message: TWMLButtonDblClk);
begin
  with Message do
//if (FEditStyle <> esSimple) and
//  PtInRect(Rect(Width - FButtonWidth, 0, Width, Height), Point(XPos, YPos)) then
//  Exit;
  inherited;
end;

procedure TWzInplaceEdit.WMPaint(var Message: TWMPaint);
begin
  PaintHandler(Message);
end;

procedure TWzInplaceEdit.WMSetCursor(var Message: TWMSetCursor);
begin
{ if (csDesigning in ComponentState) and (Columns.State = csDefault) then
    Windows.SetCursor(LoadCursor(0, IDC_ARROW))
  else}
    inherited;
end;

procedure TWzInplaceEdit.SetEditStyle(Value: TEditStyle);
begin
 if Value = FEditStyle then Exit;
  FEditStyle := Value;
  case Value of
    esPickList:
      begin
{        if FPickList = nil then
        begin
          FPickList := TPopupListbox.Create(Self);
          FPickList.Visible := False;
          FPickList.Parent := Self;
          FPickList.OnMouseUp := ListMouseUp;
          FPickList.IntegralHeight := True;
          FPickList.ItemHeight := 11;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧洲日韩女同| 久久精品欧美一区二区三区麻豆 | 欧美巨大另类极品videosbest| 日韩美女啊v在线免费观看| 99久久伊人网影院| 樱桃国产成人精品视频| 欧美日本高清视频在线观看| 麻豆免费看一区二区三区| 久久久精品国产免费观看同学| 国产福利一区二区三区视频| 国产精品久久夜| 欧美少妇bbb| 韩国一区二区三区| 专区另类欧美日韩| 欧美一区三区四区| 国v精品久久久网| 一区二区三区欧美视频| 欧美一级日韩不卡播放免费| 成人免费看黄yyy456| 一区二区三区四区不卡视频| 日韩精品专区在线影院观看| av在线不卡观看免费观看| 亚洲第一二三四区| 2023国产一二三区日本精品2022| 成人av免费在线| 无码av中文一区二区三区桃花岛| 久久久久久久综合狠狠综合| 色综合久久久久综合| 毛片不卡一区二区| 亚洲欧美经典视频| 久久一区二区三区四区| 欧美偷拍一区二区| 国产99久久久精品| 欧美aaaaaa午夜精品| 自拍偷在线精品自拍偷无码专区| 日韩片之四级片| 91网上在线视频| 国产精品中文字幕日韩精品| 亚洲1区2区3区4区| 综合婷婷亚洲小说| 国产午夜亚洲精品不卡| 欧美精品一卡两卡| 91一区二区在线| 国产老女人精品毛片久久| 亚洲成人资源网| 亚洲丝袜制服诱惑| 国产午夜精品一区二区| 91精品在线观看入口| 色94色欧美sute亚洲13| 国产精品一区二区久激情瑜伽| 天天综合色天天| 亚洲精品视频免费观看| 国产精品全国免费观看高清 | 国产日韩成人精品| 91精品国产乱码久久蜜臀| 日本韩国欧美三级| 99精品久久只有精品| 国产成人自拍网| 国产真实乱子伦精品视频| 日本美女一区二区| 午夜精品视频在线观看| 亚洲在线免费播放| 一区二区三区免费看视频| 国产精品三级视频| 中文字幕成人av| 国产午夜精品久久久久久免费视| 精品国产一区二区三区不卡| 日韩视频免费观看高清完整版在线观看 | 欧美日韩精品一区二区| 色综合久久综合网欧美综合网| 丁香激情综合五月| 丁香桃色午夜亚洲一区二区三区| 国产乱码精品一区二区三| 国产毛片一区二区| 国产成人av福利| 成人毛片在线观看| 99久久婷婷国产综合精品电影| 成a人片国产精品| 色综合视频一区二区三区高清| 99久久国产综合精品女不卡| 99视频在线观看一区三区| 99在线精品视频| 一本一道久久a久久精品| 91麻豆精品秘密| 欧美亚洲高清一区| 777xxx欧美| 精品久久久久久久久久久久包黑料 | 亚洲欧洲综合另类在线| 亚洲精品国产成人久久av盗摄 | 精品捆绑美女sm三区| 久久久久久久性| 国产精品蜜臀在线观看| 亚洲免费色视频| 日韩精品亚洲一区二区三区免费| 蜜臀av性久久久久av蜜臀妖精| 国产精品一区一区三区| 99热在这里有精品免费| 欧美这里有精品| 日韩亚洲欧美一区| 欧美国产精品中文字幕| 亚洲自拍与偷拍| 久久精品国产一区二区三区免费看| 激情欧美一区二区| 色老头久久综合| 欧美一级生活片| 亚洲欧美在线观看| 日韩不卡一区二区三区| 粉嫩av一区二区三区| 欧美日韩精品一区二区三区蜜桃| www成人在线观看| 夜夜爽夜夜爽精品视频| 精品在线免费观看| 91视频观看免费| 精品免费日韩av| 亚洲最新视频在线观看| 极品美女销魂一区二区三区免费| 色综合久久中文字幕综合网| 欧美成人aa大片| 亚洲乱码一区二区三区在线观看| 日本最新不卡在线| 成人美女在线观看| 欧美一级欧美一级在线播放| 亚洲人123区| 精品一区二区三区日韩| 欧美午夜精品电影| 国产精品丝袜一区| 蜜臀av性久久久久蜜臀aⅴ流畅| 99精品欧美一区二区三区小说| 日韩三级中文字幕| 亚洲成人一区在线| 97久久精品人人做人人爽| 精品国产髙清在线看国产毛片 | 欧美国产精品久久| 日本欧美韩国一区三区| 色偷偷一区二区三区| 久久综合五月天婷婷伊人| 亚洲福利电影网| av不卡免费电影| 欧美经典一区二区| 老司机免费视频一区二区三区| 在线观看一区二区精品视频| 欧美高清在线一区| 国产一区久久久| 欧美日韩国产影片| 一区二区三区在线免费播放| 成人一道本在线| 日韩欧美一区中文| 日韩不卡一区二区三区| 欧美网站大全在线观看| 一区二区久久久久| 色又黄又爽网站www久久| 国产精品国产三级国产普通话三级 | 99精品久久只有精品| 亚洲国产成人午夜在线一区| 狠狠色狠狠色合久久伊人| 7777精品伊人久久久大香线蕉最新版| 一区二区三区**美女毛片| 色婷婷久久久久swag精品 | 精品久久久久久最新网址| 日韩av不卡在线观看| 制服视频三区第一页精品| 亚洲国产日韩在线一区模特| 在线免费观看日韩欧美| 亚洲精品欧美在线| 欧美少妇bbb| 日日欢夜夜爽一区| 91精品国产高清一区二区三区蜜臀| 偷偷要91色婷婷| 5858s免费视频成人| 美女性感视频久久| 日韩精品一区二区三区在线| 看片网站欧美日韩| 久久先锋资源网| 成人蜜臀av电影| 一区二区在线电影| 欧美一区二视频| 精品一区在线看| 中文字幕第一区综合| 97成人超碰视| 亚洲激情第一区| 69久久99精品久久久久婷婷| 精品一区二区影视| 国产精品免费视频网站| 91黄色在线观看| 奇米综合一区二区三区精品视频| 精品第一国产综合精品aⅴ| 成人国产精品免费| 亚洲一区二区三区视频在线| 欧美精品乱人伦久久久久久| 老司机午夜精品99久久| 国产日本一区二区| 91国内精品野花午夜精品| 日本午夜一区二区| 国产三级精品三级在线专区| 色噜噜狠狠一区二区三区果冻| 日本欧美一区二区三区乱码 | 亚洲日本免费电影| 欧美欧美欧美欧美| 国产一区二区美女诱惑| 亚洲欧美日韩国产一区二区三区|