if CharCode = VK_TAB then begin Message.Result := 0; if GetKeyState(VK_SHIFT)<>0 then begin if (CurrentField=0) then Exit; CurrentField : = CurrentField - 1; end

else begin
if (CurrentField=3) then Exit;
CurrentField := CurrentField + 1;
end;
Message.Result := 1;

end //VK_TAB else

inherited;
end;

{procedure TCustomlPEdit.CMDialogKey (var Message: TCMDialogKey) ; begin if (Focused or Windows.IsChild(Handle, Windows.GetFocus)) and

(Message.CharCode= VKJIAB) and (GetKeyState(VK_CONTROL) < 0) then begin if GetKeyState(VK_SHIFT)<>0 then

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

CurrentField := (CurrentField + 1) mod 4;
Message.Result := 1;

end else inherited; end; }

function TCustomIPEdit.GetIP(Index: Integer): Byte;
begin
SendMessage(Handle,IPM_GETADDRESS,0,longint(@FipAddress));

case Index of

1 : Result := FIRST_IPADDRESS(FipAddress);
2 : Result := SECOND_IPADDRESS(FipAddress);
3 : Result := THIRD_IPADDRESS(FipAddress);
4 : Result := FOURTH_IPADDRESS(FipAddress);
else Result := 0;
end;
end;

procedure TCustomlPEdit.SetIP(Index: Integer; Value: Byte); begin case Index of

1: FIPAddress := FIPAddress AND $FFFFFF or DWORD(Value) shl 24;
2: FIPAddress := FIPAddress AND $FF00FFFF or DWORD(Value) shl 16;
3: FIPMiress := FIPMiress MD $FFFFOOFF or DWORD (Value) shl 8;
4: FIPMiress : = FIPMiress MD $FFFFFF00 or DWORD (Value) ;
else Exit ;
end;
SendMessage (Handle, IPM_SETADDRESS, 0, FIPMiress);
end;

functionTCustomIPEdit.GetMinIP(Index: Integer): Byte; begin if (Irx3ex<0) or (Index>3) then Result := 0 else

Result := LoByte(FIPLimits[Index]);
end;
procedure TCustomlPEdit. SetMinlP (Index: Integer;
Value: Byte) ;
begin
if (lndex<0) or (Index>3) then Exit;
FIPLimits[Index] : = MAKEIPRANGE(HiByte(FIPLimits[Index]), Value);
SendMessage(Handle, im_SEIESNGE, Index, FIPLimits[Index]);
end;

function TCustomlPEdit. GetMaxIP (Index: Integer) : Byte; begin if (lndex<0) or (Index>3) then Result := 0 else

Result := HiByte(FIPLimits[Index]);
end;
procedure TCustomlPEdit.SetMaxlP (Index: Integer;
Value: Byte) ;
begin
if (lndex<0) or (Index>3) then Exit;
FIPLimits[Index] := MAKEIPRANGE(Value, LoByte(FIPLimits[Index]));
SendMessage(Handle, IM_SEIRSNGE, Index, FIPLimits[Index]);
end;
procedure TCustomlPEdit.Clear;
begin
SendMessage(Handle, IPM_CLEARADDRESS, 0, 0 ) ;
end;
function TCustomlPEdit. isBlank: boolean;
begin
Result := SendMessage (Handle, IM_ISBLSNK, 0, 0) = 0 ;
end;
procedure TCustomlPEdit.SetCurrentField(Index: Integer) ;
begin
if (Tndex<0) or (Tndex>3) then Exit;
FCurrentField := Index;
SendMessage(Handle, IPM__SETFOCUS, wParam(FCurrentField), 0) ;
end;
function TCustomlPEdit. IPDwordToString (dw: EWORD) : string;
begin
Result := Format('%d.%d.%d.%d', [FIRST_IPADDRESS(dw), SECOND_IPADDRESS(dw), THIRD_IPADDRESS(dw), FOURTH_IPADDRESS(dw)]);
end;
function TCustomlPEdit. IPStringToDword (s : string): DaDRD;
var i,j : Integer;

NewA3dr, Part : EWDRD; begin NewMi: := 0; try

i := 0;

repeat j := PosC .', s) ; if j<=l then if i<3 then Abort else


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

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



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

  • Август
    2017
  • Пн
  • Вт
  • Ср
  • Чт
  • Пт
  • Сб
  • Вс