📄 jvdockvsnetstyle.pas
字号:
procedure TJvDockVSChannel.SetVSPopupPanelSplitterPosition;
begin
case Align of
alLeft:
begin
VSPopupPanelSplitter.Left := VSPopupPanel.Left + VSPopupPanel.Width;
VSPopupPanelSplitter.Width := VSPopupPanelSplitter.SplitWidth;
VSPopupPanelSplitter.Top := VSPopupPanel.Top;
VSPopupPanelSplitter.Height := VSPopupPanel.Height;
end;
alRight:
begin
VSPopupPanelSplitter.Left := VSPopupPanel.Left - VSPopupPanelSplitter.SplitWidth;
VSPopupPanelSplitter.Width := VSPopupPanelSplitter.SplitWidth;
VSPopupPanelSplitter.Top := VSPopupPanel.Top;
VSPopupPanelSplitter.Height := VSPopupPanel.Height;
end;
alTop:
begin
VSPopupPanelSplitter.Left := VSPopupPanel.Left;
VSPopupPanelSplitter.Width := VSPopupPanel.Width;
VSPopupPanelSplitter.Top := VSPopupPanel.Top + VSPopupPanel.Height;
VSPopupPanelSplitter.Height := VSPopupPanelSplitter.SplitWidth;
end;
alBottom:
begin
VSPopupPanelSplitter.Left := VSPopupPanel.Left;
VSPopupPanelSplitter.Width := VSPopupPanel.Width;
VSPopupPanelSplitter.Top := VSPopupPanel.Top - VSPopupPanelSplitter.SplitWidth;
VSPopupPanelSplitter.Height := VSPopupPanelSplitter.SplitWidth;
end;
end;
VSPopupPanelSplitter.Visible := True;
VSPopupPanelSplitter.BringToFront;
end;
procedure TJvDockVSChannel.ShowPopupPanel(Control: TWinControl);
var
BlockIndex, PaneIndex: Integer;
begin
FindDockControl(Control, BlockIndex, PaneIndex);
if (BlockIndex >= 0) and (PaneIndex >= 0) then
ShowPopupPanel(Blocks[BlockIndex].VSPanes[PaneIndex]);
end;
procedure TJvDockVSChannel.ShowPopupPanel(Pane: TJvDockVSPane);
procedure SetControlBringToFront(Control: TWinControl; Align: TAlign);
var
I: Integer;
begin
for I := Control.ControlCount - 1 downto 0 do
if Control.Controls[I].Visible and (Control.Controls[I].Align = Align) and
not (Control.Controls[I] is TJvDockVSChannel) and
not (Control.Controls[I] is TJvDockPanel) and
not (Control.Controls[I] is TJvDockSplitter) then
Control.Controls[I].BringToFront;
end;
procedure SetSingleDockFormVisible(HostDockSite: TWinControl; AForm: TForm);
var
I: Integer;
begin
for I := 0 to HostDockSite.DockClientCount - 1 do
HostDockSite.DockClients[I].Visible := AForm = HostDockSite.DockClients[I];
end;
var
LShowControl: TWinControl;
begin
if Pane <> nil then
begin
JvDockLockWindow(nil);
Parent.DisableAlign;
try
{ Auto-hide all popups of this pane }
HidePopupPanel(FActivePane);
Pane.FDockForm.Visible := True;
if (Pane.FDockForm <> nil) and (Pane.FDockForm.HostDockSite.Parent is TJvDockTabHostForm) then
begin
FVSPopupPanel.JvDockManager.ShowSingleControl(Pane.FDockForm.HostDockSite.Parent);
SetSingleDockFormVisible(Pane.FDockForm.HostDockSite, Pane.FDockForm);
TJvDockTabHostForm(Pane.FDockForm.HostDockSite.Parent).Caption := Pane.FDockForm.Caption;
end
else
FVSPopupPanel.JvDockManager.ShowSingleControl(Pane.FDockForm);
FActiveDockForm := Pane.FDockForm;
FActivePane := Pane;
FVSPopupPanel.JvDockManager.ResetBounds(True);
Pane.FBlock.ActiveDockControl := Pane.FDockForm;
//Invalidate;
VSPopupPanel.BringToFront;
VSPopupPanelSplitter.BringToFront;
SetControlBringToFront(Parent, Align);
BringToFront;
case Align of
alLeft:
begin
VSPopupPanel.Width := Pane.FWidth;
VSPopupPanel.Top := Top;
VSPopupPanel.Height := Height;
VSPopupPanelSplitter.Top := Top;
VSPopupPanelSplitter.Height := Height;
VSPopupPanelSplitter.Width := VSPopupPanelSplitter.SplitWidth;
VSPopupPanel.Left := Left + Width + Pane.FWidth - VSPopupPanel.Width;
VSPopupPanelSplitter.Left := VSPopupPanel.Left + VSPopupPanel.Width;
end;
alRight:
begin
VSPopupPanel.Width := Pane.FWidth;
VSPopupPanel.Top := Top;
VSPopupPanel.Height := Height;
VSPopupPanelSplitter.Top := Top;
VSPopupPanelSplitter.Height := Height;
VSPopupPanelSplitter.Width := VSPopupPanelSplitter.SplitWidth;
VSPopupPanel.Left := Left - Pane.FWidth;
VSPopupPanelSplitter.Left := VSPopupPanel.Left - VSPopupPanelSplitter.SplitWidth;
end;
alTop:
begin
VSPopupPanel.Left := Left;
VSPopupPanel.Height := Pane.FWidth;
VSPopupPanel.Width := Width;
VSPopupPanelSplitter.Left := Left;
VSPopupPanelSplitter.Width := Width;
VSPopupPanelSplitter.Height := VSPopupPanelSplitter.SplitWidth;
VSPopupPanel.Top := Top + Height + Pane.FWidth - VSPopupPanel.Height;
VSPopupPanelSplitter.Top := VSPopupPanel.Top + VSPopupPanel.Height;
end;
alBottom:
begin
VSPopupPanel.Left := Left;
VSPopupPanel.Width := Width;
VSPopupPanel.Height := Pane.FWidth;
VSPopupPanelSplitter.Left := Left;
VSPopupPanelSplitter.Width := Width;
VSPopupPanelSplitter.Height := VSPopupPanelSplitter.SplitWidth;
VSPopupPanel.Top := Top - Pane.FWidth;
VSPopupPanelSplitter.Top := VSPopupPanel.Top - VSPopupPanelSplitter.SplitWidth;
end;
end;
VSPopupPanel.Visible := True;
VSPopupPanelSplitter.Visible := True;
{ If the form is on a tab, then show the parent of the pagecontrol
(a TJvDockTabHostForm), otherwise show the form.
}
LShowControl := nil;
case Pane.FBlock.BlockType of
btTabBlock:
if Pane.FDockForm.Parent is TJvDockTabSheet then
begin
LShowControl := TJvDockTabSheet(Pane.FDockForm.Parent).PageControl;
if Assigned(LShowControl) then
LShowControl := LShowControl.Parent;
end;
btConjoinBlock: LShowControl := Pane.FDockForm;
end;
if Assigned(LShowControl) then
FVSPopupPanel.DoShowControl(LShowControl);
finally
Parent.EnableAlign;
JvDockUnLockWindow;
end;
if ActiveDockForm <> nil then
if ActiveDockForm.CanFocus then
ActiveDockForm.SetFocus;
end;
end;
//=== { TJvDockVSNETChannelOption } ==========================================
constructor TJvDockVSNETChannelOption.Create(ADockStyle: TJvDockBasicStyle);
begin
inherited Create(ADockStyle);
FActivePaneSize := 100;
FShowImage := True;
FMouseleaveHide := True;
FHideHoldTime := 1000;
FTabColor := clBtnFace;
end;
procedure TJvDockVSNETChannelOption.ResetDockClientOption(ADockClient: TJvDockClient);
var
VSChannel: TJvDockVSChannel;
procedure ResetActiveBlockSize;
begin
if VSChannel <> nil then
VSChannel.ActivePaneSize := ActivePaneSize;
end;
begin
if ADockClient = nil then
Exit;
if ADockClient.ParentForm.HostDockSite is TJvDockVSPopupPanel then
VSChannel := TJvDockVSPopupPanel(ADockClient.ParentForm.HostDockSite).VSChannel
else
if (ADockClient.ParentForm.HostDockSite is TJvDockVSNETTabPageControl) and
(ADockClient.ParentForm.HostDockSite.Parent.HostDockSite is TJvDockVSPopupPanel) then
VSChannel := TJvDockVSPopupPanel(ADockClient.ParentForm.HostDockSite.Parent.HostDockSite).VSChannel;
ResetActiveBlockSize;
end;
procedure TJvDockVSNETChannelOption.ResetDockControlOption;
var
I: Integer;
ADockServer: TJvDockServer;
begin
if DockStyle <> nil then
for I := 0 to DockStyle.Count - 1 do
if DockStyle.DockBaseControlLists[I] is TJvDockServer then
begin
ADockServer := TJvDockServer(DockStyle.DockBaseControlLists[I]);
ResetDockServerOption(ADockServer);
end;
end;
procedure TJvDockVSNETChannelOption.ResetDockServerOption(ADockServer: TJvDockServer);
var
VSChannel: TJvDockVSChannel;
procedure ResetActiveBlockSize;
begin
if VSChannel <> nil then
VSChannel.ActivePaneSize := ActivePaneSize;
end;
var
I: TAlign;
begin
if ADockServer <> nil then
for I := alTop to alRight do
if ADockServer.DockPanelWithAlign[I] <> nil then
begin
VSChannel := TJvDockVSNETPanel(ADockServer.DockPanelWithAlign[I]).VSChannel;
ResetActiveBlockSize;
end;
end;
procedure TJvDockVSNETChannelOption.SetActivePaneSize(const Value: Integer);
begin
if FActivePaneSize <> Value then
begin
FActivePaneSize := Max(24, Value);
ResetDockControlOption;
end;
end;
procedure TJvDockVSNETChannelOption.SetHideHoldTime(const Value: Integer);
begin
if FHideHoldTime <> Value then
if Value < 100 then
begin
{ (rom) disabled
if csDesigning in DockStyle.ComponentState then
ShowMessage('HideHoldTime cannot be less than 100');
}
FHideHoldTime := 100;
end
else
FHideHoldTime := Value;
end;
procedure TJvDockVSNETChannelOption.SetMouseleaveHide(const Value: Boolean);
begin
if FMouseleaveHide <> Value then
FMouseleaveHide := Value;
end;
procedure TJvDockVSNETChannelOption.SetShowImage(const Value: Boolean);
begin
FShowImage := Value;
end;
//=== { TJvDockVSNETConjoinServerOption } ====================================
constructor TJvDockVSNETConjoinServerOption.Create(ADockStyle: TJvDockBasicStyle);
begin
inherited Create(ADockStyle);
SystemInfo := True;
end;
procedure TJvDockVSNETConjoinServerOption.SetDefaultSystemCaptionInfo;
begin
inherited SetDefaultSystemCaptionInfo;
ActiveFont.Color := clWhite;
ActiveFont.Style := [];
InactiveFont.Color := clBlack;
InactiveFont.Style := [];
SetActiveTitleEndColor_WithoutChangeSystemInfo(ActiveTitleStartColor);
SetInactiveTitleStartColor_WithoutChangeSystemInfo(clBtnFace);
SetInactiveTitleEndColor_WithoutChangeSystemInfo(clBtnFace);
end;
//=== { TJvDockVSNETPanel } ==================================================
constructor TJvDockVSNETPanel.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FVSChannelClass := TJvDockVSChannel;
end;
procedure TJvDockVSNETPanel.AddDockServer(ADockServer: TJvDockServer);
begin
{ Dirty; resolve with new class? }
if not (Self is TJvDockVSPopupPanel) and Assigned(ADockServer) then
begin
Assert(Assigned(ADockServer.DockStyle));
CreateVSChannel(ADockServer.DockStyle);
end;
end;
procedure TJvDockVSNETPanel.CreateVSChannel(DockStyle: TComponent);
begin
if (FVSChannelClass <> nil) and
{ (rb) ??? }
(FVSChannelClass <> TJvDockVSChannelClass(ClassType)) then
begin
FVSChannel := FVSChannelClass.Create(Self);
FVSChannel.Parent := Parent;
FVSChannel.Align := Align;
FVSChannel.ResetFontAngle;
FVSChannel.ResetPosition;
FVSChannel.Visible := False;
FVSChannel.Name := Name + '_VSChannel';
FVSChannel.CreateVSPopupPanel(DockStyle);
FVSChannel.FreeNotification(Self);
end;
end;
procedure TJvDockVSNETPanel.CustomDockDrop(Source: TJvDockDragDockObject;
X, Y: Integer);
begin
inherited CustomDockDrop(Source, X, Y);
VSChannel.ActiveDockForm.Perform(CM_EXIT, 0, 0);
end;
procedure TJvDockVSNETPanel.DestroyVSChannel;
begin
FVSChannel.Free;
FVSChannel := nil;
end;
procedure TJvDockVSNETPanel.DoAutoHideControl(Control: TWinControl);
begin
if Align = alNone then
DoShowControl(Control)
else
DoHideControl(Control);
end;
procedure TJvDockVSNETPanel.DoHideControl(Control: TWinControl);
begin
JvDockLockWindow(nil);
DisableAlign;
try
VSChannel.AddDockControl(Control);
ShowDockPanel(VisibleDockClientCount > 1, Control, sdfDockPanel);
Control.Dock(VSChannel.VSPopupPanel, Rect(0, 0, 0, 0));
VSChannel.VSPopupPanel.JvDockManager.InsertControl(Control, alNone, nil);
VSChannel.VSPopupPanel.JvDockManager.ShowSingleControl(Control);
JvDockManager.HideControl(Control);
ResetChannelBlockStartOffset(VSChannel);
finally
EnableAlign;
JvDockUnLockWindow;
end;
end;
procedure TJvDockVSNETPanel.DoShowControl(Control: TWinControl);
var
Panel: TJvDockVSNETPanel;
procedure ResetDockFormVisible;
var
I: Integer;
begin
if Control is TJvDockTabHostForm then
with TJvDockTabHostForm(Control) do
for I := 0 to PageControl.Count - 1 do
begin
PageControl.Pages[I].Visible := TJvDockVSNETTabSheet(PageControl.Pages[I]).OldVisible;
PageControl.Pages[I].Controls[0].Visible := PageControl.Pages[I].Visible;
end;
end;
begin
{ Dirty; solve with virtual method? }
if Self is TJvDockVSPopupPanel then
begin
Panel := TJvDockVSPopupPanel(Self).FVSNETDockPanel;
JvDockLockWindow(nil);
Panel.DisableAlign;
try
Control.Dock(Panel, Rect(0, 0, 0, 0));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -