Solved

MDI Taskbar

Posted on 2003-10-28
7
734 Views
Last Modified: 2010-04-16
I have a MDI form. I need a taskbar for the MDI children, like the switchbar in mIRC, which does the same thing. I have searched all over, but i can't find any. I saw some taskbars on www.torry.net/taskbars.htm, but they don't work in DELPHI 7 (the version i have) or they don't have any source code. Could you tell me how to create such taskbar, or make me a component(TTaskBar for example) ?

My e-mail is sandy@alexandrion.ro
0
Comment
Question by:SandyXP
  • 4
7 Comments
 

Author Comment

by:SandyXP
ID: 9635060
I think i could use a ttoolbar or something like that do do this.
0
 

Accepted Solution

by:
jgilm earned 125 total points
ID: 9637175
You could make your own. Put the following in a procedure and call it every time an MDI is created or destroyed (or hidden). This will create buttons for as many MDI windows as are available. You may have to modify this to get them to look how you want them. The event that is assigned to the OnClick brings the window to the foreground. The window number (in the MDIChildren array) is stored in the tag property of the toolbutton, but there are other ways to link the button and the window.

procedure TMainForm.UpdateToolbar;
begin
  for I := Toolbar1.ButtonCount - 1 downto 0 do
      ToolBar1.Buttons[I].Free;

  for I := 0 to MainForm.MDIChildCount - 1 do
  begin
    with TToolButton.Create(toolbar1) do
    try
      AutoSize  := True;
      Grouped   := True;
      Parent    := Toolbar1;
      Tag       := i;
      Caption := MainForm.MDIChildren[i].Caption;
      OnClick   := ToolButtonClick;
    except
      Free;
      raise;
    end;
  end;
end;

procedure TMainForm.ToolButtonClick(Sender: TObject);
begin
  MainForm.MDIChildren[ (Sender as TToolButton).Tag ].BringToFront;
end;

-- jgilm
0
 

Author Comment

by:SandyXP
ID: 9642320
Well, it kindda works..
But there are some major problems:
- How can I place every ToolButton on a new row? (i want the toolbar to be vertical, not horizontal like the windows taskbar)
- I have multiple mdi children but i can only select them by clicking on the first toolbutton, which iterates through the windows, putting them on top one by one. I tested it with 2 windows and when i click the second button nothing happens.

Could you help me?
AND one more thing: where EXACTLY shoud i place the UpdateToolBar procedure?
0
 

Author Comment

by:SandyXP
ID: 9642387
And btw, i need another thing:
Please tell me how to insert images into a TRichEdit:)
I am making a chat prog and i want to insert emotion-icons, smileys
I have found something with ole functions, a lot of code, and it inserts the image by
  copying the TPicture in the clipboard and pasting it in the RichEdit
Do you know any other method to insert an image into TRichEdit?
And if you do, please tell me also how to search for any ':)' text in the richedit and transform it into the smiley image.
0
 

Author Comment

by:SandyXP
ID: 9642389
And btw, i need another thing:
Please tell me how to insert images into a TRichEdit:)
I am making a chat prog and i want to insert emotion-icons, smileys
I have found something with ole functions, a lot of code, and it inserts the image by
  copying the TPicture in the clipboard and pasting it in the RichEdit
Do you know any other method to insert an image into TRichEdit?
And if you do, please tell me also how to search for any ':)' text in the richedit and transform it into the smiley image.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
This is an introductory video for CloudBerry Managed Backup. You will learn how to sign up with the service and get started in a few minutes.

911 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now