Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Docking Question

Posted on 2002-05-18
7
Medium Priority
?
281 Views
Last Modified: 2010-04-04
Hi,

I am writing an app and I would like to implement docking.  I have two questions I would like to ask.  I'll give 50 points for each question with a grade of A.

1. How do I prevent floating windows (which are undocked) from being closed?  IE.  If you undock a panel, it gives you a ToolWindow style window with a close control.  I'll like to make it impossible for this ToolWindow to close.

2. How to you automatically show the docking caption bar in the application?  I'll explain.  If you have a control docked, by default you don't get the double lined caption bar above the control.  The way I force this is to first undock the control using Control.ManualDock(nil) in the FormCreate, then Control.ManualDock(DockContainer) in the FormShow.  This works well, but the docked controls flash up on the screen when they're being created.  It's not neat.

Delphi manages this well with the Messages ListBox which docked at the bottom of the editor.

Thanks for any info.

Stu

0
Comment
Question by:Stuart_Johnson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 3

Expert Comment

by:tongalite
ID: 7019167
Hi

this should deal with the first part of your question:
a small example, Delete the messagebox code if you wish and just use the Canclose:=False; command.

// hook up the FormCloseQuery event

procedure TForm1.FormCloseQuery
(Sender: TObject; var CanClose: Boolean);
begin
if MessageDlg('Really close this window?',
 mtConfirmation, [mbOk, mbCancel], 0) = mrCancel then
 CanClose := False;
end;

good luck
T.
0
 
LVL 6

Author Comment

by:Stuart_Johnson
ID: 7019171
Hi T,

It's not the form that closing, it's the undocked component.  Components don't have a FormCloseQuery event.

Stu
0
 
LVL 3

Expert Comment

by:tongalite
ID: 7019490
OOPS!
Silly me! :)
Sorry about that, I misunderstood.
t.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 14

Expert Comment

by:DragonSlayer
ID: 7020628
Okay this might not be a solution, but you can try using the Toolbar2000 components (http://www.jrsoftware.org/tb2k/). Either the component itself (or one of its plugins) will be able to do what you want.
0
 
LVL 6

Author Comment

by:Stuart_Johnson
ID: 7020638
Hi DS,

Thanks for that, but I'm trying to steer clear of 3rd party components.  There must be a way of doing it without using components.

I just found out that if you 'close' a ToolWindow containing the undocked controls, Delphi doesn't actually close the window, but hides it.  So, I can quite easily reshow the control if needed.

Stu
0
 
LVL 6

Author Comment

by:Stuart_Johnson
ID: 7061172
I'm going to ask for this question to be deleted as there was no additional information provided.

Please post any objections.

Stu
0
 
LVL 1

Accepted Solution

by:
Moondancer earned 0 total points
ID: 7061753
50 points refunded, question closed.  This has been "pending deletion"; but will not complete without Moderator intervention once comments have been added.
Moondancer - EE Moderator
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

661 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question