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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ssplitter.pas

?? AlphaControls是一個Delphi標準控件的集合
?? PAS
?? 第 1 頁 / 共 2 頁
字號:
unit sSplitter;

interface

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

type
  TSplitterStyle = (spUnknown, spHorizontalFirst, spHorizontalSecond, spVerticalFirst, spVerticalSecond);
  TInverseMode = (imNew, imClear, imMove);
  TSplitterMoveEvent = procedure (Sender: TObject; X, Y: Integer; var AllowChange: Boolean) of object;
  TsResizeStyle = (srsNone, srsInverseLine, srsUpdate);

  TsSplitter = class(TCustomControl)
  private
    FCommonData: TsCommonData;
    FControlFirst: TControl;
    FControlSecond: TControl;
    FSizing: Boolean;
    FStyle: TSplitterStyle;
    FPrevOrg: TPoint;
    FOffset: TPoint;
    FNoDropCursor: Boolean;
    FLimitRect: TRect;
    FTopLeftLimit: Integer;
    FBottomRightLimit: Integer;
    FForm: TCustomForm;
    FActiveControl: TWinControl;
    FAppShowHint: Boolean;
    FOldKeyDown: TKeyEvent;
    FOnPosChanged: TNotifyEvent;
    FOnPosChanging: TSplitterMoveEvent;
    FResizeStyle: TsResizeStyle;
    function FindControl: TControl;
    procedure ControlKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
    procedure StartMoving;
    procedure StartInverseRect;
    procedure EndInverseRect(X, Y: Integer; AllowChange, Apply: Boolean);
    function GetAlign: TAlign;
    procedure MoveAndUpdate(X, Y: Integer; AllowChange: Boolean);
    procedure MoveInverseRect(X, Y: Integer; AllowChange: Boolean);
    procedure ShowInverseRect(X, Y: Integer; Mode: TInverseMode);
    procedure DrawSizingLine(Split: TPoint);
    function GetStyle: TSplitterStyle;
    function GetCursor: TCursor;
    procedure SetControlFirst(Value: TControl);
    procedure SetControlSecond(Value: TControl);
    procedure SetAlign(Value: TAlign);
    procedure StopSizing(X, Y: Integer; Apply: Boolean);
    procedure CheckPosition(var X, Y: Integer);
    procedure ReadOffset(Reader: TReader);
    procedure WriteOffset(Writer: TWriter);
  protected
    procedure Paint; override;
    procedure WndProc (var Message: TMessage); override;
    procedure DefineProperties(Filer: TFiler); override;
    procedure Notification(AComponent: TComponent; AOperation: TOperation); override;
    procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
    procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
    procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;
    procedure Changed; dynamic;
    procedure Changing(X, Y: Integer; var AllowChange: Boolean); dynamic;
  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
    procedure AfterConstruction; override;
    procedure Loaded; override;
    procedure UpdateState;
  published
    property Align: TAlign read GetAlign write SetAlign default alNone;
    property CommonData : TsCommonData read FCommonData write FCommonData;
    property ControlFirst: TControl read FControlFirst write SetControlFirst;
    property ControlSecond: TControl read FControlSecond write SetControlSecond;
    property Constraints;
    property BevelInner;
    property BevelOuter;
    property BevelWidth;
    property Enabled;
    property Color;
    property Cursor read GetCursor stored False;
    property TopLeftLimit: Integer read FTopLeftLimit write FTopLeftLimit default 20;
    property BottomRightLimit: Integer read FBottomRightLimit write FBottomRightLimit default 20;
    property ParentColor;
    property ParentCtl3D default False;
    property ParentShowHint;
    property ResizeStyle : TsResizeStyle read FResizeStyle write FResizeStyle default srsInverseLine;
    property ShowHint;
    property Visible;
    property OnPosChanged: TNotifyEvent read FOnPosChanged write FOnPosChanged;
    property OnPosChanging: TSplitterMoveEvent read FOnPosChanging write FOnPosChanging;
    property OnClick;
    property OnDblClick;
    property OnEnter;
    property OnExit;
    property OnMouseDown;
    property OnMouseMove;
    property OnMouseUp;
    property OnResize;
  end;

implementation

uses sConst, sVclUtils, sMaskData, sMessages, sStyleSimply, sGraphUtils, sUtils;

const
  InverseThickness = 2;
  DefWidth = 3;

type
  TWC = class (TWinControl);

function CToC(C1, C2: TControl; P: TPoint): TPoint;
begin
  Result := C1.ScreenToClient(C2.ClientToScreen(P));
end;

{ TsSplitter }

procedure TsSplitter.AfterConstruction;
begin
  inherited;
  CommonData.Loaded;
end;

procedure TsSplitter.Changed;
begin
  if Assigned(FOnPosChanged) then FOnPosChanged(Self);
end;

procedure TsSplitter.Changing(X, Y: Integer; var AllowChange: Boolean);
begin
  if Assigned(FOnPosChanging) then FOnPosChanging(Self, X, Y, AllowChange);
end;

procedure TsSplitter.CheckPosition(var X, Y: Integer);
begin
  if X - FOffset.X < FLimitRect.Left
    then X := FLimitRect.Left + FOffset.X
    else if X - FOffset.X + Width > FLimitRect.Right then X := FLimitRect.Right - Width + FOffset.X;
  if Y - FOffset.Y < FLimitRect.Top
    then Y := FLimitRect.Top + FOffset.Y
    else if Y - FOffset.Y + Height > FLimitRect.Bottom then Y := FLimitRect.Bottom + FOffset.Y - Height;
end;

procedure TsSplitter.ControlKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
  if Key = VK_ESCAPE then StopSizing(0, 0, False)
  else if Assigned(FOldKeyDown) then FOldKeyDown(Sender, Key, Shift);
end;

constructor TsSplitter.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
  FCommonData := TsCommonData.Create(Self, True);
  FCommonData.COC := COC_TsSplitter;

  ControlStyle := [csAcceptsControls, csCaptureMouse, csClickEvents, {csOpaque,} csDoubleClicks];
  Width := 185;
  Height := DefWidth;
  FSizing := False;
  FTopLeftLimit := 20;
  FBottomRightLimit := 20;
  FControlFirst := nil;
  FControlSecond := nil;
  ParentCtl3D := False;
  Ctl3D := False;
  FResizeStyle := srsInverseLine;
end;

procedure TsSplitter.DefineProperties(Filer: TFiler);
begin
  inherited DefineProperties(Filer);
  Filer.DefineProperty('LimitOffset', ReadOffset, WriteOffset, False);
end;

destructor TsSplitter.Destroy;
begin
  if Assigned(FCommonData) then FreeAndNil(FCommonData);
  inherited Destroy;
end;

procedure TsSplitter.DrawSizingLine(Split: TPoint);
var
  P: TPoint;
begin
  if FForm <> nil then begin
    P := FForm.ScreenToClient(Split);
    with FForm.Canvas do begin
      MoveTo(P.X, P.Y);
      if FStyle in [spHorizontalFirst, spHorizontalSecond] then
        LineTo(CToC(FForm, Self, Point(Width, 0)).X, P.Y)
      else LineTo(P.X, CToC(FForm, Self, Point(0, Height)).Y);
    end;
  end;
end;

procedure TsSplitter.EndInverseRect(X, Y: Integer; AllowChange, Apply: Boolean);
const
  DecSize = 3;
var
  NewSize: Integer;
  Rect: TRect;
  W, H: Integer;
  DC: HDC;
  P: TPoint;
  i : integer;
begin
  if FForm <> nil then begin
    ShowInverseRect(0, 0, imClear);
    with FForm do begin
      DC := Canvas.Handle;
      Canvas.Handle := 0;
      ReleaseDC(Handle, DC);
    end;
    FForm := nil;
  end;
  FNoDropCursor := False;
  if Parent = nil then Exit;
  Rect := Parent.ClientRect;
  H := Rect.Bottom - Rect.Top - Height;
  W := Rect.Right - Rect.Left - Width;
  if not AllowChange then begin
    P := ScreenToClient(FPrevOrg);
    X := P.X + FOffset.X - Width div 2;
    Y := P.Y + FOffset.Y - Height div 2
  end;
  if not Apply then Exit;
  CheckPosition(X, Y);
  if (ControlFirst.Align = alRight) or
    ((ControlSecond <> nil) and (ControlSecond.Align = alRight)) then
  begin
    X := -X;
    FOffset.X := -FOffset.X;
  end;
  if (ControlFirst.Align = alBottom) or
    ((ControlSecond <> nil) and (ControlSecond.Align = alBottom)) then
  begin
    Y := -Y;
    FOffset.Y := -FOffset.Y;
  end;
  Parent.DisableAlign;
  try
    if FStyle = spHorizontalFirst then begin
      NewSize := ControlFirst.Height + Y - FOffset.Y;
      if NewSize <= 0 then NewSize := 1;
      if NewSize >= H then NewSize := H - DecSize;
      ControlFirst.Height := NewSize;
    end
    else if FStyle = spHorizontalSecond then begin
      NewSize := ControlSecond.Height + Y - FOffset.Y;
      if NewSize <= 0 then NewSize := 1;
      if NewSize >= H then NewSize := H - DecSize;
      ControlSecond.Height := NewSize;
    end
    else if FStyle = spVerticalFirst then begin
      NewSize := ControlFirst.Width + X - FOffset.X;
      if NewSize <= 0 then NewSize := 1;
      if NewSize >= W then NewSize := W - DecSize;
      ControlFirst.Width := NewSize;
    end
    else if FStyle = spVerticalSecond then begin
      NewSize := ControlSecond.Width + X - FOffset.X;
      if NewSize <= 0 then NewSize := 1;
      if NewSize >= W then NewSize := W - DecSize;
      ControlSecond.Width := NewSize;
    end;
  finally
    Parent.EnableAlign;
    for i := 0 to Parent.ControlCount - 1 do begin
      Parent.Controls[i].Repaint;    
    end;
//    if Assigned(ControlFirst) then ControlFirst.Repaint;
//    if Assigned(ControlSecond) then ControlSecond.Repaint;
  end;
end;

function TsSplitter.FindControl: TControl;
var
  P: TPoint;
  I: Integer;
begin
  Result := nil;
  P := Point(Left, Top);
  case Align of
    alLeft: Dec(P.X);
    alRight: Inc(P.X, Width);
    alTop: Dec(P.Y);
    alBottom: Inc(P.Y, Height);
    else Exit;
  end;
  for I := 0 to Parent.ControlCount - 1 do begin
    Result := Parent.Controls[I];
    if PtInRect(Result.BoundsRect, P) then Exit;
  end;
  Result := nil;
end;

function TsSplitter.GetAlign: TAlign;
begin
  Result := inherited Align;
end;

function TsSplitter.GetCursor: TCursor;
begin
  Result := crDefault;
  case GetStyle of
    spHorizontalFirst, spHorizontalSecond: Result := crVSplit;
    spVerticalFirst, spVerticalSecond: Result := crHSplit;
  end;
end;

function TsSplitter.GetStyle: TSplitterStyle;
begin
  Result := spUnknown; // other styles 
  if ControlFirst <> nil then begin
    if ((ControlFirst.Align = alTop) and ((ControlSecond = nil) or
       (ControlSecond.Align = alClient))) or
       ((ControlFirst.Align = alBottom) and ((ControlSecond = nil) or
       (ControlSecond.Align = alClient))) then
      Result := spHorizontalFirst
    else if ((ControlFirst.Align = alClient) and (ControlSecond <> nil) and
       (ControlSecond.Align = alBottom)) or
       ((ControlFirst.Align = alClient) and (ControlSecond <> nil) and
       (ControlSecond.Align = alTop)) then
      Result := spHorizontalSecond
    else if ((ControlFirst.Align = alLeft) and ((ControlSecond = nil) or
       (ControlSecond.Align = alClient))) or
       ((ControlFirst.Align = alRight) and ((ControlSecond = nil) or
       (ControlSecond.Align = alClient))) then
      Result := spVerticalFirst
    else if ((ControlFirst.Align = alClient) and (ControlSecond <> nil) and
       (ControlSecond.Align = alRight)) or
       ((ControlFirst.Align = alClient) and (ControlSecond <> nil) and
       (ControlSecond.Align = alLeft)) then
      Result := spVerticalSecond;
    case Result of
      spHorizontalFirst, spVerticalFirst:
        if Align <> FControlFirst.Align then Result := spUnknown;
      spHorizontalSecond, spVerticalSecond:
        if Align <> FControlSecond.Align then Result := spUnknown;
    end;
  end;
end;

procedure TsSplitter.Loaded;
begin
  inherited Loaded;
  CommonData.Loaded;
  UpdateState;
end;

procedure TsSplitter.MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
  inherited MouseDown(Button, Shift, X, Y);
  if not (csDesigning in ComponentState) and (Button = mbLeft) and not (srsNone = ResizeStyle) then begin
    FStyle := GetStyle;
    if FStyle <> spUnknown then begin
      FSizing := True;
      FAppShowHint := Application.ShowHint;
      ReleaseCapture;
      SetCapture(Handle);

      with ValidParentForm(Self) do begin
        if ActiveControl <> nil
          then FActiveControl := ActiveControl
          else FActiveControl := GetParentForm(Self);
        FOldKeyDown := TWC(FActiveControl).OnKeyDown;
        TWC(FActiveControl).OnKeyDown := ControlKeyDown;
      end;
      Application.ShowHint := False;
      FOffset := Point(X, Y);
      case ResizeStyle of
        srsUpdate : begin
          Repaint;
          StartMoving;
        end;
        srsInverseLine : begin
          StartInverseRect;
        end;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区精密机械公司| 亚洲国产视频在线| 亚洲伦在线观看| 日本中文字幕一区| 99久久伊人网影院| 精品久久一区二区三区| 亚洲综合色视频| 大白屁股一区二区视频| 日韩精品一区二| 一区二区三区**美女毛片| 国产高清不卡二三区| 欧美精三区欧美精三区| 亚洲色图欧美在线| 国产成人a级片| 久久久亚洲欧洲日产国码αv| 亚洲成人动漫一区| av不卡在线播放| 国产欧美日韩卡一| 国产黑丝在线一区二区三区| 日韩欧美的一区| 午夜精品一区在线观看| eeuss鲁片一区二区三区在线观看| 精品国产一区二区在线观看| 国产高清久久久久| 欧美一级在线免费| 欧美aaaaaa午夜精品| 在线不卡一区二区| 日韩激情视频网站| 3d动漫精品啪啪一区二区竹菊| 一区二区三区国产| 91国产免费观看| 亚洲精品ww久久久久久p站| 色综合天天综合色综合av| 亚洲六月丁香色婷婷综合久久 | 一本一道综合狠狠老| 国产精品剧情在线亚洲| av成人动漫在线观看| 亚洲日本中文字幕区| 色综合天天性综合| 亚洲国产毛片aaaaa无费看| 91黄色激情网站| 亚洲成av人片一区二区| 欧美精品一卡二卡| 日韩av电影免费观看高清完整版| 欧美电影一区二区三区| 日本欧美肥老太交大片| 欧美精品三级日韩久久| 欧美激情在线一区二区三区| 国产最新精品免费| 欧美日韩电影一区| 亚洲成人777| 午夜电影久久久| 黄色日韩网站视频| 日韩亚洲欧美高清| 国产一区二区精品在线观看| 国产欧美综合色| 91在线精品一区二区| 亚洲国产精品久久久久婷婷884| 欧美丝袜自拍制服另类| 国内精品久久久久影院一蜜桃| 国产日韩影视精品| 日本韩国一区二区| 蜜桃视频第一区免费观看| 国产婷婷一区二区| 欧美日韩一区高清| 国产精品伊人色| 亚洲欧美日韩一区二区三区在线观看| 欧美日韩国产成人在线免费| 国产一区二区在线免费观看| 亚洲精品精品亚洲| 日韩精品一区二区三区在线 | 中文字幕一区二区三区色视频| 91欧美一区二区| 蜜桃视频在线一区| 亚洲欧美另类小说| 久久影音资源网| 欧美亚洲综合色| 国产91富婆露脸刺激对白| 亚洲国产cao| 国产精品免费网站在线观看| 6080午夜不卡| 色综合久久综合| 国产精品主播直播| 日日夜夜免费精品视频| 国产精品美女久久久久高潮| 日韩欧美在线1卡| 91黄色免费版| 成人a免费在线看| 九一久久久久久| 日本女优在线视频一区二区| 亚洲精品少妇30p| 国产日韩av一区二区| 日韩欧美国产综合在线一区二区三区| 91国产免费看| 91免费观看在线| 成人综合婷婷国产精品久久免费| 免费成人美女在线观看| 一区二区三区在线观看欧美| 国产精品欧美久久久久一区二区| 欧美一区二区女人| 欧美日韩mp4| 欧美性三三影院| 一本大道av伊人久久综合| av一区二区久久| 成人黄色小视频在线观看| 国产精品资源网| 国产电影一区二区三区| 国产麻豆视频一区| 韩国欧美一区二区| 精品一区二区三区久久| 免费黄网站欧美| 久久精品噜噜噜成人av农村| 日本亚洲最大的色成网站www| 亚洲mv在线观看| 丝瓜av网站精品一区二区| 天堂一区二区在线免费观看| 石原莉奈在线亚洲二区| 日韩高清不卡一区二区| 免费人成精品欧美精品| 国内精品伊人久久久久影院对白| 久久99久久99| 丰满亚洲少妇av| 色婷婷av久久久久久久| 欧美日韩三级一区| 日韩一区二区三区精品视频| 日韩视频一区二区三区在线播放| 精品国产在天天线2019| 国产欧美一区二区精品性色超碰 | 欧美大片一区二区| 久久品道一品道久久精品| 久久精品在线观看| 国产精品乱码久久久久久| 亚洲美女电影在线| 亚洲成av人片在线观看| 久久国产免费看| 99视频一区二区| 欧美色综合天天久久综合精品| 欧美日韩成人综合| 精品久久一区二区三区| 国产精品久久久久影院| 亚洲国产一二三| 经典三级在线一区| 不卡一二三区首页| 在线播放日韩导航| 国产婷婷色一区二区三区四区| 自拍av一区二区三区| 日本aⅴ亚洲精品中文乱码| 国产精品一二三区在线| 91久久国产综合久久| 精品国产91乱码一区二区三区| 中文字幕高清一区| 日韩精品久久理论片| 成人免费视频国产在线观看| 欧美日韩精品综合在线| 26uuu久久天堂性欧美| 怡红院av一区二区三区| 精品综合免费视频观看| 欧美性色综合网| 久久日韩精品一区二区五区| 亚洲天堂网中文字| 久久99久久久久| 欧美影视一区二区三区| 久久久蜜桃精品| 午夜不卡av免费| 99久久夜色精品国产网站| 欧美白人最猛性xxxxx69交| 亚洲欧美日韩系列| 国产成a人亚洲| 日韩一区二区三区在线视频| 一区在线中文字幕| 国产一区视频导航| 欧美日韩精品专区| 亚洲激情成人在线| 成人综合在线观看| 亚洲精品在线观| 日韩福利视频导航| 欧美日韩国产系列| 亚洲综合久久久久| 99精品在线免费| 国产日韩欧美精品在线| 精品一区二区免费| 欧美一卡2卡3卡4卡| 天天av天天翘天天综合网 | 国产不卡视频在线播放| 欧美一区二区三区成人| 亚洲国产乱码最新视频| 在线日韩av片| 亚洲色图制服诱惑| 99国产精品一区| 中文字幕一区二区三区不卡在线 | 久久精品人人做人人综合| 男女激情视频一区| 欧美一区二区三区在线观看| 午夜精品久久久久久久久| 欧美视频一区二区三区在线观看| 亚洲人成亚洲人成在线观看图片| 成人免费精品视频| 综合久久久久综合| 99视频一区二区| 亚洲美女区一区|