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

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

?? propedit.pas

?? 數(shù)據(jù)屬性設(shè)置控件
?? PAS
字號:
{***************************************************************
 *
 * Unit Name: PropEdit
 * Purpose  :用于設(shè)置數(shù)據(jù)庫字段的屬性值
 * Author   :
 * History  :00-10-26
 *
 ****************************************************************}


unit PropEdit;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, CheckLst, Math, DB, DBCtrls, DesignIntf,DesignEditors{設(shè)置屬性編輯器時用}, SetProp;

type
  TCheckPropProperty = class(TPropertyEditor)
    function GetAttributes: TPropertyAttributes; override;
    function GetValue: string; override;
    procedure Edit; override;
  end;

  TPropEdit = class(TCheckListBox)
  private
    FProp: Integer;
    FStartPos: Integer;
    FReverse: Boolean;
    FCheckItems: TStrings;
    function GetProp: Integer;
    procedure SetProp(const Value: Integer);
    procedure SetCheck;
    procedure SetStartPos(const Value: Integer);
    procedure SetReverse(const Value: Boolean);
    function GetProp1: Integer;
    function GetProp2: Integer;
    procedure SetCheckItems(const Value: TStrings);
  protected
    procedure DblClick; override;
  public
    constructor Create(AOwner: TComponent); override;
  published
    property Prop: Integer read GetProp write SetProp;
    property Prop1: Integer read GetProp1 stored False;
    property Prop2: Integer read GetProp2 stored False;
    property StartPos: Integer read FStartPos write SetStartPos;
    property Reverse: Boolean read FReverse write SetReverse;
    property CheckItems: TStrings read FCheckItems write SetCheckItems;
  end;

  TDBPropEdit = class(TPropEdit)
  private
    FDataLink: TFieldDataLink;
    procedure DataChange(Sender: TObject);
    procedure UpdateDate(Sender: TObject);
    function GetDataField: string;
    function GetDataSource: TDataSource;
    procedure SetDataField(const Value: string);
    procedure SetDataSource(const Value: TDataSource);
    procedure CMExit(var Message: TWMNoParams); message CM_EXIT;
    function GetReadOnly: Boolean;
    procedure SetReadOnly(const Value: Boolean);
  protected
    procedure Loaded; override;
    procedure ClickCheck; override;
    procedure DblClick; override;
    procedure Notification(AComponent: TComponent; Operation: TOperation); override;
    procedure CMGetDataLink(var Message: TMessage); message CM_GETDATALINK;
  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
  published
    property DataField: string read GetDataField write SetDataField;
    property DataSource: TDataSource read GetDataSource write SetDataSource;
    property ReadOnly: Boolean read GetReadOnly write SetReadOnly default False;
  end;

  function CheckBit(Status, B1: Integer;
                          B2: Integer = 0;
                          B3: Integer = 0;
                          B4: Integer = 0;
                          B5: Integer = 0;
                          B6: Integer = 0;
                          B7: Integer = 0;
                          B8: Integer = 0;
                          B9: Integer = 0;
                          B10: Integer = 0): Boolean;

  function SetBit(Status, B1: Integer;
                        B2: Integer = 0;
                        B3: Integer = 0;
                        B4: Integer = 0;
                        B5: Integer = 0;
                        B6: Integer = 0;
                        B7: Integer = 0;
                        B8: Integer = 0;
                        B9: Integer = 0;
                        B10: Integer = 0): Integer;

procedure Register;

implementation

procedure Register;
begin
  RegisterComponents('hf comp', [TPropEdit, TDBPropEdit]);
  RegisterPropertyEditor(TypeInfo(TStrings), TPropEdit, 'Items', TCheckPropProperty);
  RegisterPropertyEditor(TypeInfo(TStrings), TPropEdit, 'CheckItems', TCheckPropProperty);
end;

function CheckBit(Status, B1: Integer;
                          B2: Integer = 0;
                          B3: Integer = 0;
                          B4: Integer = 0;
                          B5: Integer = 0;
                          B6: Integer = 0;
                          B7: Integer = 0;
                          B8: Integer = 0;
                          B9: Integer = 0;
                          B10: Integer = 0): Boolean;
var
  I: Integer;
  B: Integer;
begin
  Result := True;
  B := 0;
  for I := 1 to 10 do
  begin
    if I = 1 then B := B1
    else if I = 2 then B := B2
    else if I = 3 then B := B3
    else if I = 4 then B := B4
    else if I = 5 then B := B5
    else if I = 6 then B := B6
    else if I = 7 then B := B7
    else if I = 8 then B := B8
    else if I = 9 then B := B9
    else if I = 10 then B := B10;

    if B = 0 then
      Exit;
    if B > 0 then
      Result := Odd(Status shr (Abs(B) - 1))
    else Result := not Odd(Status shr (Abs(B) - 1));

    if not Result then
      Exit;
  end;
end;

function SetBit(Status, B1: Integer;
                        B2: Integer = 0;
                        B3: Integer = 0;
                        B4: Integer = 0;
                        B5: Integer = 0;
                        B6: Integer = 0;
                        B7: Integer = 0;
                        B8: Integer = 0;
                        B9: Integer = 0;
                        B10: Integer = 0): Integer;
var
  I: Integer;
  B: Integer;
begin
  Result := Status;
  B := 0;  
  for I := 1 to 10 do
  begin
    if I = 1 then B := B1
    else if I = 2 then B := B2
    else if I = 3 then B := B3
    else if I = 4 then B := B4
    else if I = 5 then B := B5
    else if I = 6 then B := B6
    else if I = 7 then B := B7
    else if I = 8 then B := B8
    else if I = 9 then B := B9
    else if I = 10 then B := B10;

    if B = 0 then
      Exit;

    if B < 0 then
      Result := Result and (not Round(IntPower(2, Abs(B) - 1)))
    else Result := Result or Round(IntPower(2, Abs(B) - 1));

//    if not Result then
//      Exit;
  end;
end;

{ TPropEdit }

constructor TPropEdit.Create(AOwner: TComponent);
var
 sList:string;
 v:TStrings;
begin


  inherited Create(AOwner);
  FCheckItems := TStringList.Create;
  Height := 40;
  Width := 100;
  FReverse := False;


end;

procedure TPropEdit.DblClick;
begin
  State[ItemIndex] := cbGrayed;
  inherited;
end;

function TPropEdit.GetProp: Integer;
var
  I, II, P: Integer;
  Check: Boolean;
begin
  P := 0;
  for I := FStartPos to FCheckItems.Count - 1 do
  begin
    if FCheckItems.Strings[I][1] = ';' then
      Check := FReverse or False
    else
    begin
      II := Items.IndexOf(FCheckItems.Strings[I]);
      if FReverse then
        Check := not Checked[II]
      else Check := Checked[II];
    end;

    if Check then
      P := P or Round(IntPower(2, I - FStartPos))
    else P := P and (not Round(IntPower(2, I - FStartPos)));
  end;
  Result := P;
end;

function TPropEdit.GetProp1: Integer;
var
  I, II, P: Integer;
  Check: Boolean;
begin
  P := 0;
  for I := FStartPos to FCheckItems.Count - 1 do
  begin
    if FCheckItems.Strings[I][1] = ';' then
      Check := False
    else
    begin
      II := Items.IndexOf(FCheckItems.Strings[I]);
      Check := not (State[II] = cbGrayed);
    end;

    if Check then
      P := P or Round(IntPower(2, I - FStartPos))
    else P := P and (not Round(IntPower(2, I - FStartPos)));
  end;
  Result := P;
end;

function TPropEdit.GetProp2: Integer;
var
  I, II, P: Integer;
  Check: Boolean;
begin
  P := 0;
  for I := FStartPos to FCheckItems.Count - 1 do
  begin
    if FCheckItems.Strings[I][1] = ';' then
      Check := False
    else
    begin
      II := Items.IndexOf(FCheckItems.Strings[I]);

      if FReverse then
        Check := State[II] = cbUnchecked
      else Check := Checked[II];
    end;

    if Check then
      P := P or Round(IntPower(2, I - FStartPos))
    else P := P and (not Round(IntPower(2, I - FStartPos)));
  end;
  Result := P;
end;

procedure TPropEdit.SetCheck;
var
  I, II: Integer;
begin
  for I := FStartPos to FCheckItems.Count - 1 do
  begin
    if FCheckItems.Strings[I][1] = ';' then
      Continue
    else
      II := Items.IndexOf(FCheckItems.Strings[I]);

    if FReverse then
      Checked[II] := not ((FProp or Round(IntPower(2, I - FStartPos))) = FProp)
    else Checked[II] := ((FProp or Round(IntPower(2, I - FStartPos))) = FProp);
  end;
end;

procedure TPropEdit.SetCheckItems(const Value: TStrings);
begin
  FCheckItems.Assign(Value);
end;

procedure TPropEdit.SetProp(const Value: Integer);
begin
//  if FProp <> Value then
  if Prop <> Value then
  begin
    FProp := Value;
    SetCheck;
  end;
end;

procedure TPropEdit.SetReverse(const Value: Boolean);
begin
  if FReverse <> Value then
  begin
    FReverse := Value;
    SetCheck;
  end;
end;

procedure TPropEdit.SetStartPos(const Value: Integer);
begin
  if FStartPos <> Value then
  begin
    FStartPos := Value;
    SetCheck;
  end;
end;

{ TDBPropEdit }

procedure TDBPropEdit.ClickCheck;
begin
  inherited;

  try
	  FDataLink.Modified;
	  FDataLink.DataSet.Edit;
	  FDataLink.Field.AsInteger := Prop;
  except
  	on e: Exception do
  	   //	Application.HandleException(Sender);
  end;  // try/except

end;

procedure TDBPropEdit.CMExit(var Message: TWMNoParams);
begin
  try
    FDataLink.UpdateRecord;
  except
    SetFocus;
    raise;
  end;
//  SetFocus;
//  DoExit;
  inherited;
end;

constructor TDBPropEdit.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
  ControlStyle := ControlStyle + [csReplicatable, csCaptureMouse, csClickEvents];


  try
	  FDataLink := TFieldDataLink.Create;
	  FDataLink.Control := Self;

	  FDataLink.OnDataChange := DataChange;
	  FDataLink.OnUpdateData := UpdateDate;
  except
  	on e: Exception do
  	   //	Application.HandleException(Sender);
  end;  // try/except
end;

procedure TDBPropEdit.DataChange(Sender: TObject);
begin

  try
	  if FDataLink.Field <> nil then
		 Prop := FDataLink.Field.AsInteger;
  except
  	on e: Exception do
  	   //	Application.HandleException(Sender);
  end;  // try/except

end;

destructor TDBPropEdit.Destroy;
begin
  FDataLink.Free;
  FDataLink := nil;
  inherited Destroy;
end;

function TDBPropEdit.GetDataField: string;
begin
  Result:=FDataLink.FieldName;
end;

procedure TDBPropEdit.CMGetDataLink(var Message: TMessage);
begin
  Message.Result := Integer(FDataLink);
end;

function TDBPropEdit.GetDataSource: TDataSource;
begin
  Result:=FDataLink.DataSource;
end;

function TDBPropEdit.GetReadOnly: Boolean;
begin
  Result := (FDataLink.ReadOnly);
end;

procedure TDBPropEdit.Notification(AComponent: TComponent;
  Operation: TOperation);
begin
  inherited Notification(AComponent, Operation);
  if (Operation = opRemove) and (FDataLink <> nil) and
    (AComponent = DataSource) then DataSource := nil;
end;

procedure TDBPropEdit.SetDataField(const Value: string);
begin
  FDataLink.FieldName:=Value;
end;

procedure TDBPropEdit.SetDataSource(const Value: TDataSource);
begin
  if not (FDataLink.DataSourceFixed and (csLoading in ComponentState)) then
    FDataLink.DataSource := Value;
  if Value <> nil then Value.FreeNotification(Self);
end;

procedure TDBPropEdit.SetReadOnly(const Value: Boolean);
begin
  FDataLink.ReadOnly := Value;
end;

procedure TDBPropEdit.UpdateDate(Sender: TObject);
begin
  FDataLink.Field.AsInteger := Prop;
end;

procedure TDBPropEdit.Loaded;
begin
  inherited Loaded;
  ControlStyle := ControlStyle + [csReplicatable, csCaptureMouse, csClickEvents];
end;

procedure TDBPropEdit.DblClick;
begin
end;

{ TCheckPropProperty }

procedure TCheckPropProperty.Edit;
var
  SetPropForm: TSetPropForm;
begin
  inherited;
  SetPropForm := TSetPropForm.Create(nil);
  try
    SetPropForm.SetItems(TPropEdit(GetComponent(0)).CheckItems);
    if SetPropForm.ShowModal = mrOK then
    begin
      TPropEdit(GetComponent(0)).CheckItems := SetPropForm.CheckItems;
      TPropEdit(GetComponent(0)).Items := SetPropForm.VisibleItems;
    end;
  finally
    SetPropForm.Free;
  end;
end;

function TCheckPropProperty.GetAttributes: TPropertyAttributes;
begin
  Result := [paDialog, paReadOnly]
end;

function TCheckPropProperty.GetValue: string;
begin
  Result := '(設(shè)置標志位)';
end;

end.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品久久久久久亚洲伦| 亚洲乱码日产精品bd | 洋洋成人永久网站入口| 18成人在线观看| 午夜欧美大尺度福利影院在线看| 日本强好片久久久久久aaa| 1024精品合集| 日本在线不卡一区| 99r精品视频| 91精品国产色综合久久| 中文字幕成人在线观看| 亚洲一区成人在线| 国产69精品久久久久毛片| 色猫猫国产区一区二在线视频| 日韩一区二区在线免费观看| 中文一区二区完整视频在线观看| 亚洲国产精品久久久久婷婷884 | 91网上在线视频| 日韩视频免费观看高清在线视频| 中文字幕在线一区免费| 青青草国产成人99久久| 91尤物视频在线观看| 日韩精品一区二区在线观看| 亚洲精品视频在线| 国产成人综合网| 91麻豆精品国产91久久久久| 久久亚洲精品国产精品紫薇| 亚洲444eee在线观看| 91美女在线看| 中文字幕巨乱亚洲| 国产原创一区二区三区| 欧美性生活一区| 国产日产欧美精品一区二区三区| 日本不卡一区二区| 欧美性三三影院| 欧美三级电影在线看| 亚洲欧美日韩系列| www.日本不卡| 国产欧美精品一区| 国产一区二区三区| 日韩女优制服丝袜电影| 亚洲国产精品久久不卡毛片| 欧美亚洲丝袜传媒另类| 国产午夜亚洲精品不卡| 狠狠色综合色综合网络| 日韩一级黄色片| 天堂影院一区二区| 欧美日韩一区二区在线视频| 国产欧美久久久精品影院| 国产米奇在线777精品观看| 日韩女优制服丝袜电影| 日韩国产在线一| 精品电影一区二区三区| 成人午夜精品在线| 一区二区三区鲁丝不卡| 欧美一级高清片| 国产精品69久久久久水密桃| 亚洲私人影院在线观看| 欧美男人的天堂一二区| 久久99精品国产麻豆婷婷| 亚洲国产成人在线| 欧美日韩视频在线一区二区| 国产尤物一区二区在线| 亚洲精品伦理在线| 日韩女优毛片在线| 99久久99久久精品免费看蜜桃| 亚洲国产精品嫩草影院| 久久嫩草精品久久久精品| 色8久久精品久久久久久蜜| 美女诱惑一区二区| 中文字幕一区二区视频| 日韩一级精品视频在线观看| 不卡区在线中文字幕| 青娱乐精品视频| 尤物视频一区二区| 欧美精品一区二区三区在线播放 | 日韩视频免费直播| av综合在线播放| 久久99精品视频| 一区二区成人在线| 国产欧美一区二区精品仙草咪| 欧美日韩一级片在线观看| 成人激情文学综合网| 日本不卡视频在线| 亚洲一卡二卡三卡四卡五卡| 日韩美女视频在线| 色av一区二区| 成人综合在线视频| 久久99精品国产.久久久久久| 一区二区三区日韩精品视频| 久久久久9999亚洲精品| 91精品欧美一区二区三区综合在 | 色妹子一区二区| 国产成人精品亚洲午夜麻豆| 日韩主播视频在线| 亚洲电影一级片| 久久无码av三级| 精品久久久久久久久久久久包黑料 | 欧美一级理论性理论a| 亚洲男人电影天堂| 欧美日韩一区二区三区四区 | 一本大道综合伊人精品热热 | 中文字幕乱码亚洲精品一区| 91精品国产综合久久香蕉的特点| 高清国产一区二区| 久久精品99久久久| 日本亚洲免费观看| 午夜精品aaa| 亚洲成人资源网| 亚洲国产日韩精品| 亚洲最色的网站| 亚洲欧美综合色| 中文字幕色av一区二区三区| 中文av一区特黄| 国产精品久久久久精k8| 国产免费观看久久| 久久久久久久精| www国产精品av| 久久品道一品道久久精品| 欧美一区二区三区在线看| 884aa四虎影成人精品一区| 欧美日韩中文一区| 91精品国产色综合久久ai换脸| 8x福利精品第一导航| 日韩欧美二区三区| 久久综合精品国产一区二区三区| 久久影院午夜论| 国产精品日韩成人| 亚洲视频精选在线| 亚洲高清免费观看高清完整版在线观看| 一区二区三区欧美视频| 午夜精品久久久久久久| 蜜桃久久久久久| 国产成人夜色高潮福利影视| 成人性生交大片免费| 99热这里都是精品| 在线国产亚洲欧美| 日韩三级电影网址| 亚洲国产精品高清| 亚洲自拍偷拍av| 麻豆一区二区99久久久久| 国产资源在线一区| caoporen国产精品视频| 欧美群妇大交群的观看方式| 日韩欧美综合一区| 国产精品天干天干在观线| 一区二区不卡在线视频 午夜欧美不卡在| 午夜精品福利在线| 国产成人综合网站| 欧美日韩大陆一区二区| 国产午夜久久久久| 偷拍亚洲欧洲综合| 风流少妇一区二区| 欧美日韩精品电影| 欧美国产欧美综合| 日韩av一级片| 99免费精品视频| 91精品国产综合久久香蕉的特点 | 亚洲国产高清在线观看视频| 极品少妇xxxx精品少妇| 国产精品白丝jk白祙喷水网站| 波多野结衣在线aⅴ中文字幕不卡| 色网站国产精品| 欧美岛国在线观看| 亚洲成va人在线观看| 国产成人啪午夜精品网站男同| 色综合色综合色综合| 欧美色男人天堂| 国产亚洲精久久久久久| 国产一区欧美一区| 国模一区二区三区白浆| 99精品视频在线观看免费| 日韩免费高清视频| 亚洲v日本v欧美v久久精品| av中文字幕不卡| 26uuu国产日韩综合| 日韩电影在线免费看| 一本高清dvd不卡在线观看| 久久久久久久性| 美女精品一区二区| 欧美亚一区二区| 亚洲激情五月婷婷| 97久久精品人人做人人爽50路 | 国产一区二区三区日韩| 欧美日韩一卡二卡三卡| 亚洲另类春色校园小说| 成人黄色大片在线观看| 久久精品视频免费观看| 老鸭窝一区二区久久精品| 欧美日韩国产首页| 亚洲无人区一区| 欧洲人成人精品| 亚洲精品美腿丝袜| 色婷婷久久久久swag精品| 亚洲色图欧洲色图| 成人高清免费在线播放| 中文字幕一区二区日韩精品绯色| 国产精品亚洲第一| 国产精品视频在线看| 成熟亚洲日本毛茸茸凸凹|