둘리.CSIEDA 님이 쓰신 글 :
: 그림을 보니 docking 을 사용하여 특정 폼을 docking 한 형태군요.
:
: 그리고 원하시는 부분이 drag bar를 제거하고 싶으신거군요.
:
: docking할 경우 drag bar가 자동적으로 만들어져서 그렇습니다.
:
: 오래전에 저도 이문제를 해결하기 위하여 한참 찾아보았으나 제가 내린 결론은
:
: docking 되는 것이 내부적으로 drag bar를 만들고 그 drag bar height가 절대로 VCL에 의존해서는 0 이 될수 없음을 알게 되었습니다.
:
: 그래서 저는 panel을 상속받아 drag bar height을 0을 허락 하도록 만들어 사용한 적이 있습니다.
:
: 아래 부분은 제가 만든 코드 같은데요.. 오래되서 쩝...
:
: C/C++ 프로그래머이지, Delphi 코더가 아니고 , 요즘은 사용하지 않고 있는것이라 코드가 영 그렀습니다만,,,, 혹시나 해서 올립니다.
:
:
: unit cDockPanelUnit;
:
:
: interface
:
: uses
: Windows, SysUtils, Classes, Controls, ExtCtrls, Graphics;
: type
: TXPDockTree = class(TDockTree)
: protected
: property DockSite;
: public
: GrabberSize: Integer;
: procedure AdjustDockRect(Control: TControl; var ARect: TRect); override;
: procedure PaintDockFrame(Canvas: TCanvas; Control: TControl; const ARect: TRect); override;
: procedure PaintSite(DC: HDC); override;
: constructor Create(DockSite: TWinControl);
: end;
: type
: TC6DockPanel = class(TPanel)
: private
: { Private declarations }
: protected
: { Protected declarations }
: public
: { Public declarations }
: DockingManager: TXPDockTree;
: constructor Create(Owner: TWinControl);
: procedure SetGrabberSize(size: Integer);
: published
: { Published declarations }
: end;
:
:
: procedure Register;
:
: implementation
:
: constructor TC6DockPanel.Create(Owner: TWinControl);
: begin
: inherited Create(Owner);
: DockingManager := nil;
: end;
:
: procedure TC6DockPanel.SetGrabberSize(size: Integer);
: begin
: self.UseDockManager:=false;
: if(DockingManager<>nil) then
: begin
: DockingManager.Free;
: end;
:
: DockingManager := TxpDockTree.Create(self);
: DockingManager.GrabberSize := size;
: self.DockManager := DockingManager;
: //TXPDockTree.Create(self);
: self.UseDockManager:= true;
:
: end;
:
: constructor TXPDockTree.Create(DockSite: TWinControl);
: begin
: inherited Create(DockSite);
: GrabberSize := 10;
: end;
:
: procedure TXPDockTree.AdjustDockRect(Control: TControl; var ARect: TRect);
: begin
: if DockSite.Align in [alTop, alBottom] then
: Inc(ARect.Left, GrabberSize)
: else
: Inc(ARect.Top, GrabberSize);
: end;
:
: procedure TXPDockTree.PaintDockFrame(Canvas: TCanvas; Control: TControl; const ARect: TRect);
:
: procedure DrawCloseButton(Left, Top: Integer);
: var
: R: TRect;
: begin
: {
: R := Rect(Left + 1, Top + 1, Left + GrabberSize - 3, Top + GrabberSize - 3);
: with Canvas do begin
: Rectangle(R);
: MoveTo(Left + 4, Top + 4);
: LineTo(Left + GrabberSize - 6, Top + GrabberSize - 6);
: MoveTo(Left + GrabberSize - 7, Top + 4);
: LineTo(Left + 3, Top + GrabberSize - 6);
: end;
: }
: end;
:
: var
: R: TRect;
: Title: String;
: begin
: R := ARect;
: R.Bottom := R.Top + GrabberSize;
: with Canvas do begin
: if (Control.Tag = 0) then begin
: Brush.Color := clBtnFace;
: Pen.Color := clBtnShadow;
: Font.Color := clBtnText;
: end else begin
: Brush.Color := clActiveCaption;
: Pen.Color := clActiveCaption;
: Font.Color := clCaptionText;
: end;
: FillRect(R);
: Rectangle(R.Left, R.Top, R.Right, R.Bottom);
: {
: if (Control is TPanel) then begin
: Font.Name := (Control as TPanel).Font.Name;
: Title := (Control as TPanel).Caption;
: end else begin
: Title := Control.ClassName;
: end;
: }
: end;
: {
: with ARect do begin
: Canvas.TextOut(Left + 3, Top + 1, Title);
: if Control.Tag <> 0 then Canvas.Pen.Color := clCaptionText;
: if DockSite.Align in [alTop, alBottom] then
: DrawCloseButton(Left + 1, Top + 1)
: else
: DrawCloseButton(Right - GrabberSize + 1, Top + 1);
: end;
: }
: end;
:
: { Borland Code BEGIN }
: procedure TXPDockTree.PaintSite(DC: HDC);
: var
: Canvas: TControlCanvas;
: Control: TControl;
: I: Integer;
: R: TRect;
: begin
: Canvas := TControlCanvas.Create;
: try
: Canvas.Control := DockSite;
: Canvas.Lock;
: try
: Canvas.Handle := DC;
: try
: for I := 0 to DockSite.ControlCount - 1 do
: begin
: Control := DockSite.Controls[I];
: if Control.Visible and (Control.HostDockSite = DockSite) then begin
: R := Control.BoundsRect;
: AdjustDockRect(Control, R);
: Dec(R.Left, 2 * (R.Left - Control.Left));
: Dec(R.Top, 2 * (R.Top - Control.Top));
: Dec(R.Right, 2 * (Control.Width - (R.Right - R.Left)));
: Dec(R.Bottom, 2 * (Control.Height - (R.Bottom - R.Top)));
: PaintDockFrame(Canvas, Control, R);
: end;
: end;
: finally
: Canvas.Handle := 0;
: end;
: finally
: Canvas.Unlock;
: end;
: finally
: Canvas.Free;
: end;
: end;
: { Borland Code END }
:
: procedure Register;
: begin
: RegisterComponents('EDAFramework6', [TC6DockPanel]);
: end;
:
: end.
:
:
:
:
:
: 땅주인 님이 쓰신 글 :
: : 환경: C++ Builder XE5 ( RAD Studio XE5)
: :
: : [BCB] 메인창이 뜰때 폼을 Docking상태로 뜨게 할 수 있을가요?
: :
http://www.borlandforum.com/impboard/impboard.dll?action=read&db=bcb_faq&no=46
: :
: : 를 응용해서 첨부하는 그림처럼 left Window/Right Window로 나누었습니다.
: : 그런데, Left Windows는 붙박이로 쓰고 좌우 넓이만 조절하고 싶고, Left Windows의 위쪽 헤더에 해당하는
: : 부분을 모두 삭제하고 싶습니다.(판넬에 윈도우가 들어가 있는 상황)
: :
: : 그냥 MDIChidl영역의 왼쪽 윈도우와 오른쪽 윈도우로 갈라서,
: : 왼쪽 윈도우에 해당 윈도우 화면을 그대로 붙이는 방법이 있나요? (굳이 판넬을 써서 붙여야 하는 것이 좀 그래서.. )
: :
: : 모양도 이쁘지 않고요..
: :
: : 고수님들의 조언을 부탁드립니다.
: :
: : 감사합니다
: :