Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

I need to make a toolwindow (like in Photoshop)

Posted on 2001-06-27
7
Medium Priority
?
380 Views
Last Modified: 2010-04-06
Ok, I was wondering if there was a component out there to make a toolwindow.  I've tried to use the bsToolWindow setting for a window, but it does not give the desired effect.  I guess what I really need is a way to:
1) have a form with controls on it
2) be able to use the StayOnTop setting
3) have the controls be clickable, BUT
4) does not take focus away from currently active window.

I guess I could always return focus to a form, but was wondering if there was an obvious (easier) way that I am missing.
0
Comment
Question by:felonious
[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 6

Expert Comment

by:Jaymol
ID: 6234198
I'd advise using a form without a caption bar or border, and place an image on it that looks like a form.  That way, when it does not have focus, it doesn't look disabled.

I know this is basic, but you may not know so I'll tell you anyway.  Set the border style to bsNone and set the caption blank.  The form will just appear as a grey rectangle.  Drop the image on it and set both the image and form to autosize:=true.

It's not the best way, but it does work nicely.

John.
0
 
LVL 9

Expert Comment

by:ITugay
ID: 6234201
Hi felonious,
it is not an easy question, really.
It something like combobox dropdown window, right?
You can take a look at my component TDBFieldsGrid, there is a sample how to show ListBox by the meaning way. Pay attension on TConstBox.CreateWnd and  TDBFieldsGrid.ShowConstBox methods.

http://i-g-o-r.virtualave.net/fldgrd.html

------
Igor
0
 
LVL 1

Expert Comment

by:Kaspars
ID: 6234588
I suggest you to use, for example, panel and make it docked with ManualFloat. It will look like just as a tool window but will be focused with the form it belongs to ad is minimized also, when the form is minimized.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:felonious
ID: 6236715
Ok, while everything offered so far had been very interesting, I've either failed to understand it or it doesn't give the desired effect.  

For instance, ManualFloating a panel (never knew this was possible) does give you something that is close to a toolwindow, but again when the panel is clicked on the currently active window (in this case an MDI child form) losses focus.

And I guess I just dont understand windows messages and such enough to comprehend Igor's code.  I checked out the WM_SETFOCUS and WM_KILLFOCUS messages as well as SETFOCUS, and everything else in the CreateWnd procedure but I failed to understand what it does (as I cant compile/install the package in Delphi 6 I can not see the effects on that component).

Again, to restate what I would like:

-A form that *DOES NOT* take the focus away from currently selected window when it is clicked yet the controls on it act normally (OnClick events fire when a control is clicked) (i.e. like Photoshops toolbars.  I can select a tool to use from a toolbar, but the image I am working on always retains focus)
0
 
LVL 9

Accepted Solution

by:
ITugay earned 200 total points
ID: 6237250
Ok, here is another way.

let say you have Form2 that should be toolbar. Set it's property in designtime.
Form2.FormStyle := fsStayOnTop;
Form2.BorderStyle := bsToolWindow;

To show this form without loosing focus on current( main) form do next:

  Form2.Parent := Self;
  Form2.Show;

Your main form will not loose focus, but toolbar window will never get focus, so, some of controls
may not works on toolbar form. (e.g. TEdit.) while TListBox, TComboBox, TButtons etc. still works.

-----
Igor.
0
 

Author Comment

by:felonious
ID: 6237841
This worked very well for me.  I ended up going into the main project file where the application creates the forms and adding in a few lines of code:

  Application.CreateForm(TTBTools, TBTools);
  TBTools.Parent := mainform;
  Application.CreateForm(TTBDetails, TBDetails);
  TBDetails.Parent := mainform;
  Application.CreateForm(TTBItems, TBItems);
  TBItems.Parent := mainform;

Thanks for the help Igor!
0
 
LVL 9

Expert Comment

by:ITugay
ID: 6237857
always wellcome :-)
0

Featured Post

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!

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

618 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