//procedure KeyDown(var Key: Word;
Shift: TShiftState);override;

function IPDwordToString(dw: DWORD) : string; function IPStringToDword(s: string) : DWORD; public

{ Public declarations } constructor Create(AOwner: TComponent);
override;
property IP[Index: Integer] : byte read GetIP write SetIP;
property MinIP[Index: Integer]: byte read GetMinIP write SetMinIP;
property MaxIP[Index: Integer]: byte read GetMaxIP write SetMaxIP;
property IPString : string read GetlPString write SetlPString;
property CurrentField : Integer read FCurrentField write SetCurrentField;
procedure Clear;
end;

TIPEdit = class(TCustomlPEdit)

published

property Align;
property Anchors;
property BorderWidth;
property DragCursor;
property DragKind;
property DragMode;
property Enabled;
property Font;
property Hint;
property Constraints;
property ParentShowHint;
property PopupMenu;
property ShowHint;
property TabOrder;
property TabStop;
property Visible;
property OnContextPopup;
property OnDragDrop;
property OnDragOver;
property OnEndDock;
property OnEndDrag;
property OnEnter;
property OnExit;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnStartDock;

property OnStartDrag; { Published declarations }

property IPString;
end;

procedure Register; implementation

uses Graphics, comractrl, comctrls;
constructor TCustomlPEdit. Create (AOwner: TCoiTponent) ;
begin
inherited. Create(AOwner);
FIPMdress := 0;
ControlStyle := [c^C3ptuie№use, csCiickEvents, csDoubleClicks, csOpaque] ;
Color := clBtnFace;
Width := 160;
Height := 25,-Align := alNone;
TatStop := True;
end;
procedure TCustomlPEdit.CreateParams (var Params: TCreateParams) ;
begin
InitCommonControl(icc_INTERNET_classes);
inherited CreateParams (Params) ;
CreateSubClass (Params, WC_IPADDRESS) ;
with Params do begin
Style := ws_visible or ws_border or WSJZHILD;

if NewStyleControls and Ctl3D then

tegin

Style := Style and not ws_border;
ExStyle := ExStyle or WS_EX_CLIENTJSDGE;
end;
end;
end;
procedure TCustomlPEdit.CreateWnd;
var i: Integer;

tegin

inherited CreateWnd;
Clear;
{ for i := 0 to 3 do tegin MinIP[i] := 0;
MaxIP[i] := $FF;
end;
} CurrentField := 0;
end;
procedure TCustomlPEdit.WMGetDlgCode (var Message: TWMGetDlgCode) ;

tegin

inherited;
Message.Result := {Message.Result or} DDXJaFANTTAB;
end;
procedure TCustomlPEdit.CNNotify(var Message: TWMNotify);

begin with Message.NMHdr" do begin case Code of

IPN_FIELDCHANGED :

begin FCurrentField := PNMIPAddress(Message.NMHdr)A.iField; {i f As signed(OnIpFieldChange) then with PNMIPAdress(Message.NMHdr)A do begin OnlPFieldChange(Self, iField, iValue);}

end;
end;
end;
end;
{procedure TCustomlPEdit.KeyDown (var Key: Word;
Shift: TShiftState) ;
begin
inherited KeyDown (Key, Shift);

if Key = VK_TAB then if ssShift in Shift then

CurrentField := (CurrentField - 1 + 4 ) mod 4 else

CurrentField := (CurrentField + 1) mod 4;

end;}

{procedure TCustomlPEdit.CMWantSpecialKey (var Msg: TCMWantSpecialKey) ;
begin
inherited;

//Msg.Result :=Ord(Char(Msg.CharCode) =#9); end;}

procedure TCustomlPEdit. CMDialogChar (var Message: TCMDialogChar) ; begin with Message do


⇐ Предыдущая страница| |Следующая страница ⇒

Программирование в Delphi 7



Новости за месяц

  • Октябрь
    2017
  • Пн
  • Вт
  • Ср
  • Чт
  • Пт
  • Сб
  • Вс