Solved

MDI Taskbar

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

759 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