New topic: 

tool button Menu action

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

       Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic         Author  
Message       crazymacsoftware.com           Post subject: tool button Menu 
actionPosted: Tue Oct 13, 2009 5:38 pm                               
Joined: Sat Jun 20, 2009 7:08 pm
Posts: 70              Hi,
I am using this code to put tool items in my toolbar.
How do I make the speak text toolbar item have a menu with two options 
and what do I do to get those to menu item options to do something?

Here's what I am doing to create the toolbar and menu items
so far the menus aren't showing up

  dim SelectAllButton as ToolButton
  dim SoundButton as ToolButton
  
  SelectAllButton = New ToolButton
  SoundButton = New ToolButton
  
  SelectAllButton.Caption = "Select All"
  SelectAllButton.Name = "Select All"
  SelectAllButton.icon = SelectAllIcon
  
  SelectAllButton.Style=ToolButton.ToolStylePushButton
  
  Me.append SelectAllButton
  
  Dim SpeakMenu as New MenuItem
  Dim StartSpeaking as New MenuItem
  Dim StopSpeaking as New MenuItem
  
  SoundButton.Name = "Speak Text"
  SpeakMenu.text = "Speak Text"
  
  StartSpeaking.text = "Start Speaking..."
  StopSpeaking.text = "Stop Speaking..."
  
  SpeakMenu.append StartSpeaking
  SpeakMenu.append StopSpeaking
  
  SoundButton.caption = "Speak Text"
  SoundButton.name = "Speak Text"
  SoundButton.icon = SoundIcon
  
  SoundButton.Style=ToolButton.ToolStyleDropDown

I got this in the dropdownmenuaction
  Select Case hititem.text
  Case "Start Speaking..."
  speak (readerwnd.bookarea.text)
  Case "Stop Speaking..."
  speak (" ",True)
  End Select

and this in the action event..
  Select Case item.name
  Case "Select All"
  readerwnd.bookarea.selectAll
  Case "Read Text"
  beep
  End Select
  
  Me.append SoundButton
  
  But it isn't working

  Can someone show me what I am doing wrong?

  Brian     
_________________
----
Brian Heibert
[email protected]  
                            Top            Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 1 post ]     
-- 
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