New topic: 

Toolbars & Toolbar Menus

<http://forums.realsoftware.com/viewtopic.php?t=30479>

       Page 1 of 1
   [ 2 posts ]                 Previous topic | Next topic         Author  
Message       jmorrillpda           Post subject: Toolbars & Toolbar 
MenusPosted: Wed Oct 14, 2009 10:55 am                        
Joined: Thu Sep 17, 2009 7:05 am
Posts: 9              I have created a toolbar for my program and I have two 
questions:

1. How do I disable or enable a button on the toolbar using code?
2. How do I populate a dropdown menu in the toolbar?
Thanks.   
                            Top                Phil M           Post subject: 
Re: Toolbars & Toolbar MenusPosted: Wed Oct 14, 2009 11:20 am                   
     
Joined: Fri Sep 30, 2005 12:18 pm
Posts: 103              There is a super class for ToolButton called ToolItem, 
that has the Enabled property... set this to false to make it disabled.  Access 
the ToolButton by Toolbar.Item (by index).  If you don't know the index of the 
button you want to disable, compare the ToolButton caption property to find the 
right one.

The Language Reference gives this example of handling MenuItems under the 
ToolButton page... just make sure your ToolButton Style = ToolStyleDropDown or 
ToolStyleSeparateDropDown.  And then assign a menu to DropDownMenu property.
Code:DropDownMenuAction(item as ToolItem, hitItem as MenuItem)
Select Case hititem.Text
Case "Grand Blanc"
  MsgBox "You chose Grand Blanc from the "+item.Name+" ."
Case "Flint"
  MsgBox "You chose Flint from the "+item.Name+" ."
Case "Bad Axe"
  MsgBox "you chose Bad Axe from the "+item.Name+" ."
End Select
   
                            Top           Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 2 posts ]     
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to