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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

menus, jus like in C++Builder IDE

Status
Not open for further replies.

StoneColdCrazy

Programmer
Jun 30, 2000
11
0
0
US
Have u seen a C++Builder IDE's menu, sure u did, if u using C++Builder. It rested on a CoolBar or a ControlBar, along with tulbars that u can move around. I know how to implement a UI like that with toolbars, but don't know how to do it with menus.  Any help will be apriciated.  thnx in advace...  ~~StonE~~
 
&nbsp;&nbsp;&nbsp;&nbsp;The menus are actually fairly easy to impliment if I'm understanding your question correctly. You will need to drop the MainMenu component onto your form, maybe along with a Popup Menu component.<br><br>&nbsp;&nbsp;&nbsp;&nbsp;If you can't seem to get these to work, post back to this thread with your specific problem.<br> <p>James P. Cottingham<br><a href=mailto: > </a><br><a href= Veneer Co., Inc.</a><br>All opinions are mine alone and do not necessarily reflect those of my employer.
 
U drop a TMainMenu on your form, u set Form's MainMenu property to the TMainMenu u just dropped.&nbsp;&nbsp;That's not what I'm talking about here.<br><br>Open your C++Builder IDE or Delphi IDE, whichever, observ its MainMenu, and its Toolbars.&nbsp;&nbsp;You can move the toolbars and MainMenu around, just click on them and move them. Those MainMenu and toolbars are rested on a thing called TControlBar, which can be found on your Additional component pallete.<br><br>Drop TContolBar on your form.&nbsp;&nbsp;Drop a TToolBar on ContolBar which is already on your form.&nbsp;&nbsp;Make a few buttons, and run the form.&nbsp;&nbsp;Now, I need to do the same with TMainMenu.&nbsp;&nbsp;That is to make TMainMenu apper on TControlBar, so that it can be moved around, just like in C++Builder IDE.&nbsp;&nbsp;That's what I need to know, I can't make a main menu just like in C++Builder's IDE...
 
&nbsp;&nbsp;&nbsp;&nbsp;My BCB is too old, I guess. I can't move the menu, just the toolbar. Sorry. <p>James P. Cottingham<br><a href=mailto: > </a><br><a href= Veneer Co., Inc.</a><br>All opinions are mine alone and do not necessarily reflect those of my employer.
 
I have the solution to your problem, good eh ?<br>Do this:<br><br>1. Drop a ControlBar onto your form. (Additional tab), set align to top and autosize to true, for this ControlBar<br><br>2. Drop a ToolBar onto this ControlBar<br><br>3. Set ShowCaptions to true for this ToolBar<br><br>4. Set property Flat, and AutoSize to true for the ToolBar<br><br>5. Add buttons, one for each menu<br><br>6. Enter appropriate captions in these buttons<br><br>7. Set all items under EdgeBorders in the ToolBar to false<br><br>8. Fiddle with the various borders and stuff tomake it look good.<br><br>9. Add one popup menu for each button<br><br>10. Enter code like this:<br><br><i>void __fastcall TForm1::ToolButton1Click(TObject *Sender)<br>{<br>&nbsp;&nbsp;int x,y;<br>&nbsp;&nbsp;x=ClientOrigin.x+ToolButton1-&gt;Left+ToolBar1-&gt;Left;<br>&nbsp;&nbsp;y=ClientOrigin.y+ToolButton1-&gt;Top+ToolButton1-&gt;Height+2;<br>&nbsp;&nbsp;PopupMenu1-&gt;Popup(x,y);<br>}<br></i><br>into each buttons click event, or make a function to handle all of them. Remember to handle the appropriate PopUpMenu for each button.<br><br>phew... <p>Anders Sjöberg<br><a href=mailto:ansj@perceptive.se>ansj@perceptive.se</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top