Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Toolbar Implementation Confusion!!

Status
Not open for further replies.

lespaul

Programmer
Feb 4, 2002
7,083
US
Happy Monday!

I am trying to add a toolbar to my UI and am having difficulties! My main form has a Main Menu. I recently added an ActionList. I have been reorganizing the code in my Main form to take advantage of the benefits of the ActionList (wish I had known about it from the start, but there's only like 10,000 different things to learn in Delphi!). So now I want to add a tool bar. Do I need an ActionToolBar or just a regular ToolBar? If I use the ActionToolBar do I need to include an ActionManager on my MainForm (do I need this with a Regular one too?)? Once I add the necessary component, how do I set the action (add a button then what??)? How do I add a picture to the button? I added a glyph to the ImageList, and tried to reference the Array location, but that didn't work. Any help would be appreciated!

Thanks,

Leslie
landrews@metrocourt.state.nm.us

SELECT * FROM USERS WHERE CLUE > 0
No Rows Returned
 
there will always be many different ways to do 1 thing when programming.

you could use a toolbar component (or make your own, i use a panel with tspeedbuttons.
experiment and see what you find the best..
 
I have tried using the TToolBar and the ActionToolBar (experimented for a couple of days before writing first post), and I'm still not sure which one I should use (and what the differences between them are). I tried putting speed buttons on the toolbar and I couldn't get it to work! I'd like detailed information on how to set up a tool bar (which one I should use), how to add the buttons to the toolbar (the speed buttons didn't 'belong' to the Toolbar and so were underneath it), and how to make the image appear on the button. Thanks! Leslie
landrews@metrocourt.state.nm.us

SELECT * FROM USERS WHERE CLUE > 0
No Rows Returned
 
To keep things relatively simple, drop a toolbar onto your form. It should automatically align itself as alTop. Now, right click on the bar and amenu appears. From here you can add as many buttons as you need.

To give each button an image, add the glyphs as normal to an image index. Click on the actual toolbar (not one of its buttons) and assign the images value to your imagelist on the form. Now click each button, and change its image index value to match the values of the image list.

As for which type of toolbar to use. It depends on what you want it to do! Arte Et Labore
 
I want a toolbar (like the evil M$Word) that has a few often used procedures that the user can select without having to navigate through the menu. For example, 'Process Questionnaire' is a procedure that will be run multiple times each day. So I'd like a toolbar button that runs that procedure. I have made the procedure an Action (because I thought Actions were required in order to implement a toolbar or speed button - could be wrong). So, that's what I want to do. Now, how do I decide which kind of Toolbar to use? THANKS!!

Leslie
landrews@metrocourt.state.nm.us

SELECT * FROM USERS WHERE CLUE > 0
No Rows Returned
 
The action list is a relatively new non visual component and is not required for a speedbutton or toolbar.
But for the pictures, make a TImagelist, and link the toolbar to it, conform eric explained

Steven van Els
SAvanEls@cq-link.sr
 
An Action list is good for eliminating checking confusion, For example If you have a checkbox and a checked menu item that you need to synchronise link them both to an action list and toggle the actions checked property.

Steve
 
I would suggest using a control bar as it is behaves in the same way as M$Word (a lot like the delphi toolbar). Set it to align alTop. You will notice that when you drop a button onto it, it allows you to drag the button. When you drop another button on, it adds the button as a seperate slider. Combat this by dropping a panel onto the bar. You can then remove the panels caption and borders. If you need to, you can increase the size of the slider/panel height in the control bars Row Size value. You can then add as many buttons per slider/panel as you want by dropping them onto the panel.

As stated above, you dont need to use an action list as the buttons will all retain their normal properties. Arte Et Labore
 
Image List
I have a Database Grid with the code
ImageList1.Draw(Canvas,Rect.Left+4,Rect.Top,1,True)
How do I assign Images to the Image list?


Frank.
 
My application:
A TopMenyPanel->TControlbar->TToolbar.

Add a non visible component TMainMenu and then you can add your menu in the TMainMenu(also different icons to the diferent items if you want). After you have done that then remember to assign the TToolbar with the Menu.

Another way is just use TToolbar with TToolButton(you can also add different images: assign a imageIndex to a particular ImageList).

cheers,
mha




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top