On 4/17/07, Ben Blake <[EMAIL PROTECTED]> wrote: > G'Day Dennis, > > On Wed, 18 Apr 2007, at 2:55, Dennis Birch wrote: > > > While working with the built-in RB toolbar, I noticed another problem > > that makes it difficult to use for my intended purposes. I want to be > > able to programmatically set the toggle (pushed) value of a toolbutton > > depending on conditions. But there is no apparent way of doing so. I > > found a bug report addressing this issue in the bugbase. If you would > > like to see RS address this shortcoming, please sign on to this report > > by clicking "Add" in the "Requests" line of the "Report Information" > > box at the top of the report. > > > > <http://support.realsoftware.com/feedback/viewreport.php? > > reportid=yfjebqae&cmd=watch> > > Put this in your Toolbar's Action event: > > //Toggle Handling - set all other Toggle Buttons to off > Dim T1, T2 as ToolButton > Dim i as Integer > > T1=ToolButton(Item) > If T1.Style = T1.ToolStyleToggleButton then > For i = 0 to Me.Count > If Me.Item(I) IsA ToolButton and Me.Item(i) <> Item then > T2 = ToolButton(Me.Item(i)) > If T2.Style = T2.ToolStyleToggleButton then T2.Pushed = Not > T1.Pushed > End If > Next > End If > > The only thing this does not do is stop you from deselecting the > currently toggled on item.
Thanks Ben. I want to be able to change the toggled state of a toolbar button programmatically, without a user clicking the button. This code does not appear to do that. In my tests, simply changing the .Pushed property of a toolbutton does not changed the toggled state of a ToggleStyle toolbar button. It appears to need a .Refresh method in order to do that, which is not provided by the ToolButton or ToolItem class. My guess is that the Toolbar class provides that when you click a button and invoke the Action event. _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives: <http://support.realsoftware.com/listarchives/lists.html>
