Solved

MDI Taskbar

Posted on 2003-10-28
7
750 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Help on project with Soap 10 61
Why can't I create any project with my delphi EXE file? 6 44
Dynamically Created Query 3 69
Delphi Firemonkey send email on Android 1 38
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…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

685 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