我知道JVCL中唯一具有自动隐藏功能(用于固定停靠客户端)的停靠样式是JvDockVSNetStyle。我正在使用它,但我无法设置非活动固定窗格标签的大小。隐藏时,选项卡不显示窗格的标题,仅显示活动窗格的名称。抱歉,我无法发布示例图片,因为这是我的第一个问题。
在object inpector中有一个名为ChannelOption的选项,带有ActivePaneSize属性。有没有办法设置非活动窗格大小,以便它可以显示其名称?或者也许还有另一种我缺少的具有相同功能的停靠方式?
我正在使用C ++ Builder和JVCL 3.45。
答案 0 :(得分:1)
我是通过评论这些代码部分来完成的:
procedure TJvDockVSChannel.GetBlockRect(Block: TJvDockVSBlock; Index: Integer;
var ARect: TRect);
var
BlockWidth: Integer;
begin
// HERE
// if Block.VSPane[Index] <> Block.ActivePane then
// BlockWidth := Block.InactiveBlockWidth
// else
BlockWidth := Block.ActiveBlockWidth;
<snip>
procedure TJvDockVSChannel.Paint;
var
I: Integer;
<snip>
begin
VisiblePaneCount := 0;
for I := 0 to Block.VSPaneCount - 1 do
begin
if not Block.VSPane[I].FVisible then
Continue;
GetBlockRect(Block, I, DrawRect);
Canvas.Brush.Color := TabColor;
Canvas.FillRect(DrawRect);
Canvas.Brush.Color := clGray;
Canvas.FrameRect(DrawRect);
AdjustImagePos;
Block.FImageList.Draw(Canvas, DrawRect.Left, DrawRect.Top, I, dsTransparent, itImage);
// HERE
// if Block.ActivePane = Block.VSPane[I] then
begin
if Align in [alTop, alBottom] then
Inc(DrawRect.Left, Block.InactiveBlockWidth)
else
if Align in [alLeft, alRight] then
begin
Inc(DrawRect.Top, Block.InactiveBlockWidth);
if Align = alLeft then
DrawRect.Left := 15
else
DrawRect.Left := 20;
DrawRect.Right := DrawRect.Left + (DrawRect.Bottom - DrawRect.Top);
end;
Canvas.Brush.Color := TabColor;
Canvas.Pen.Color := clBlack;
Dec(DrawRect.Right, 3);
OldGraphicsMode := SetGraphicsMode(Canvas.Handle, GM_ADVANCED);
Canvas.Brush.Style := bsClear;
// HERE (changed options)
DrawText(Canvas.Handle, PChar(Block.VSPane[I].FDockForm.Caption), -1, DrawRect, {DT_END_ELLIPSIS or} DT_NOCLIP);
答案 1 :(得分:0)
TJvDockServer中有一个名为DoFinishSetDockPanelSize的事件。
在为该事件创建的函数中,您可以使用Dockpanel访问表单的大小。从这里可以有一种方法来设置选项卡的大小。