📄 ezinspect.pas
字号:
end;
procedure TInplaceBrushstyleBox.GoOff;
begin
FRequireNotification := False;
Visible := False;
Windows.SetFocus( Parent.Handle );
end;
procedure TInplaceBrushstyleBox.TriggerGoingOffEvent(Reason: TGoingOffReason;
var AllowExit: Boolean);
begin
If Assigned( FOnGoingOff ) Then
FOnGoingOff( Self, Reason, AllowExit );
end;
procedure TInplaceBrushstyleBox.Click;
begin
DoChange;
end;
procedure TInplaceBrushstyleBox.DoChange;
begin
if FBaseProperty.ValInteger= Self.ItemIndex then exit;
FBaseProperty.ValInteger:= Self.ItemIndex;
FBaseProperty.Changed;
end;
{$IFDEF BCB}
function TInplaceBrushstyleBox.GetOnGoingOff: TGoingOffEvent;
begin
Result := FOnGoingOff;
end;
procedure TInplaceBrushstyleBox.SetOnGoingOff(const Value: TGoingOffEvent);
begin
FOnGoingOff := Value;
end;
{$ENDIF}
{ TInplaceColorBox }
constructor TInplaceColorBox.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
//If Not ( csDesigning In ComponentState ) Then
Visible := False;
ShowSystemColors:= True;
NoneColorText:= SNoneColorTextInColorPicker;
CustomText:= SCustomTextInColorPicker;
Transparent:= false;
Flat:= True;
TabStop:= True;
end;
procedure TInplaceColorBox.CMEnter(var Message: TCMEnter);
begin
Inherited;
FRequireNotification := True;
end;
procedure TInplaceColorBox.CMExit(var Message: TCMExit);
Var
allowExit: Boolean;
Begin
Inherited;
allowExit := True;
If FRequireNotification = True Then
TriggerGoingOffEvent( goNone, allowExit );
If allowExit Then
Begin
DoChange;
FRequireNotification := False;
Visible := False;
End
Else
Begin
MessageBeep( $FFFF );
Windows.SetFocus( Self.Handle );
End;
end;
procedure TInplaceColorBox.CNKeydown(var Message: TWMkeydown);
Var
allowExit: Boolean;
reason: TGoingOffReason;
Begin
allowExit := False;
reason := goNone;
With Message Do
Begin
Case CharCode Of
VK_TAB:
If ssShift In KeyDataToShiftState( KeyData ) Then
reason := goLTab
Else
reason := goRTab;
VK_RETURN:
reason := goEnter;
VK_ESCAPE:
reason := goEscape;
VK_UP:
if not Down{DroppedDown} then
reason := goUp;
VK_DOWN:
if not Down{DroppedDown} then
reason := goDown;
VK_LEFT:
//If ssCtrl In KeyDataToShiftState(KeyData) Then
reason := goLeft;
VK_RIGHT:
//If ssCtrl In KeyDataToShiftState(KeyData) Then
reason := goRight;
VK_HOME:
//If ssCtrl In KeyDataToShiftState(KeyData) Then
reason := goHome;
VK_END:
//If ssCtrl In KeyDataToShiftState(KeyData) Then
reason := goEnd;
VK_PRIOR:
reason := goPgUp;
VK_NEXT:
reason := goPgDn;
End;
If reason <> goNone Then
Begin
allowExit := True;
TriggerGoingOffEvent( reason, allowExit );
End;
If allowExit Then
Begin
DoChange;
FRequireNotification := False;
If reason <> goNone Then
Message.Result := 1; {to avoid beep on Return }
If reason = goEscape Then
MessageBeep( $FFFF );
Visible := False;
Windows.SetFocus( Parent.Handle );
End
Else
Begin
If reason <> goNone Then
MessageBeep( $FFFF );
exit;
End;
End;
end;
procedure TInplaceColorBox.GoOff;
begin
FRequireNotification := False;
Visible := False;
Windows.SetFocus( Parent.Handle );
end;
procedure TInplaceColorBox.TriggerGoingOffEvent(Reason: TGoingOffReason;
var AllowExit: Boolean);
begin
If Assigned( FOnGoingOff ) Then
FOnGoingOff( Self, Reason, AllowExit );
end;
procedure TInplaceColorBox.Click;
begin
DoChange;
end;
procedure TInplaceColorBox.DoChange;
begin
if FBaseProperty <> Nil then
begin
if FBaseProperty.ValInteger= Self.Selected then exit;
FBaseProperty.ValInteger:= Self.Selected;
FBaseProperty.Changed;
end;
end;
{$IFDEF BCB}
function TInplaceColorBox.GetOnGoingOff: TGoingOffEvent;
begin
Result := FOnGoingOff;
end;
procedure TInplaceColorBox.SetOnGoingOff(const Value: TGoingOffEvent);
begin
FOnGoingOff := Value;
end;
{$ENDIF}
{ TInplaceBlocksBox }
constructor TInplaceBlocksBox.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
//If Not ( csDesigning In ComponentState ) Then
Visible := False;
BorderStyle:= bsNone;
end;
procedure TInplaceBlocksBox.CMEnter(var Message: TCMEnter);
begin
Inherited;
FRequireNotification := True;
end;
procedure TInplaceBlocksBox.CMExit(var Message: TCMExit);
Var
allowExit: Boolean;
Begin
Inherited;
allowExit := True;
If FRequireNotification = True Then
TriggerGoingOffEvent( goNone, allowExit );
If allowExit Then
Begin
DoChange;
FRequireNotification := False;
Visible := False;
End
Else
Begin
MessageBeep( $FFFF );
Windows.SetFocus( Self.Handle );
End;
end;
procedure TInplaceBlocksBox.CNKeydown(var Message: TWMkeydown);
Var
allowExit: Boolean;
reason: TGoingOffReason;
Begin
allowExit := False;
reason := goNone;
With Message Do
Begin
Case CharCode Of
VK_TAB:
If ssShift In KeyDataToShiftState( KeyData ) Then
reason := goLTab
Else
reason := goRTab;
VK_RETURN:
reason := goEnter;
VK_ESCAPE:
reason := goEscape;
VK_UP:
if not DroppedDown then
reason := goUp;
VK_DOWN:
if not DroppedDown then
reason := goDown;
VK_LEFT:
//If ssCtrl In KeyDataToShiftState(KeyData) Then
reason := goLeft;
VK_RIGHT:
//If ssCtrl In KeyDataToShiftState(KeyData) Then
reason := goRight;
VK_HOME:
//If ssCtrl In KeyDataToShiftState(KeyData) Then
reason := goHome;
VK_END:
//If ssCtrl In KeyDataToShiftState(KeyData) Then
reason := goEnd;
VK_PRIOR:
reason := goPgUp;
VK_NEXT:
reason := goPgDn;
End;
If reason <> goNone Then
Begin
allowExit := True;
TriggerGoingOffEvent( reason, allowExit );
End;
If allowExit Then
Begin
DoChange;
FRequireNotification := False;
If reason <> goNone Then
Message.Result := 1; {to avoid beep on Return }
If reason = goEscape Then
MessageBeep( $FFFF );
Visible := False;
Windows.SetFocus( Parent.Handle );
End
Else
Begin
If reason <> goNone Then
MessageBeep( $FFFF );
exit;
End;
End;
end;
procedure TInplaceBlocksBox.GoOff;
begin
FRequireNotification := False;
Visible := False;
Windows.SetFocus( Parent.Handle );
end;
procedure TInplaceBlocksBox.TriggerGoingOffEvent(Reason: TGoingOffReason;
var AllowExit: Boolean);
begin
If Assigned( FOnGoingOff ) Then
FOnGoingOff( Self, Reason, AllowExit );
end;
procedure TInplaceBlocksBox.Click;
begin
DoChange;
end;
procedure TInplaceBlocksBox.DoChange;
begin
{ the name of the block is returned here }
if FBaseProperty.ValString= BlockList[ItemIndex] then exit;
FBaseProperty.ValString:= BlockList[ItemIndex];
FBaseProperty.Changed;
end;
{$IFDEF BCB}
function TInplaceBlocksBox.GetOnGoingOff: TGoingOffEvent;
begin
Result := FOnGoingOff;
end;
procedure TInplaceBlocksBox.SetOnGoingOff(const Value: TGoingOffEvent);
begin
FOnGoingOff := Value;
end;
{$ENDIF}
{ TInplaceEdit }
constructor TInplaceEdit.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
//If Not ( csDesigning In ComponentState ) Then
Visible := False;
BorderStyle:= bsNone;
end;
procedure TInplaceEdit.CMEnter(var Message: TCMEnter);
begin
Inherited;
FRequireNotification := True;
end;
procedure TInplaceEdit.CMExit(var Message: TCMExit);
Var
allowExit: Boolean;
Begin
Inherited;
allowExit := True;
If FRequireNotification = True Then
TriggerGoingOffEvent( goNone, allowExit );
If allowExit Then
Begin
DoChange;
FRequireNotification := False;
Visible := False;
End
Else
Begin
MessageBeep( $FFFF );
Windows.SetFocus( Self.Handle );
End;
end;
procedure TInplaceEdit.CNKeydown(var Message: TWMkeydown);
Var
allowExit: Boolean;
reason: TGoingOffReason;
Begin
allowExit := False;
reason := goNone;
With Message Do
Begin
Case CharCode Of
VK_TAB:
If ssShift In KeyDataToShiftState( KeyData ) Then
reason := goLTab
Else
reason := goRTab;
VK_RETURN:
begin
reason := goEnter;
if FBaseProperty.FPropType = ptString then
FBaseProperty.ValString:= Self.Text;
end;
VK_ESCAPE:
reason := goEscape;
VK_UP:
reason := goUp;
VK_DOWN:
reason := goDown;
//VK_LEFT:
//If ssCtrl In KeyDataToShiftState(KeyData) Then
//reason := goLeft;
//VK_RIGHT:
//If ssCtrl In KeyDataToShiftState(KeyData) Then
//reason := goRight;
//VK_HOME:
//If ssCtrl In KeyDataToShiftState(KeyData) Then
//reason := goHome;
//VK_END:
//If ssCtrl In KeyDataToShiftState(KeyData) Then
//reason := goEnd;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -