Searching ToolStripGroup Javadoc for AutoChild I found the following methods:
- getBody
- getLabel
- getTitleProperties
So apparently these are the canvases that are available to change display properties. The only one that applies to what Im trying to do is getBody.
So I tried to following code:
Code:
[B]public[/B] [B]class[/B] RibbonGroupBorder [B]extends[/B] RibbonBar { [B]static[/B] String[] [I]imageFiles[/I] = [B]new[/B] String[] { "ConversationGuide/AlertIcon.png", "ConversationGuide/Recorder/qualification-badge-o-blue.png", "ConversationGuide/ContiguousSlider.png", "ConversationGuide/DateChooser.png", "ConversationGuide/DiscreteSlider.png", "ConversationGuide/Recorder/document.png", }; [B]private[/B] [B]static[/B] [B]int[/B] [I]imageIndex[/I]; [B]public[/B] RibbonGroupBorder() { [I]imageIndex[/I] = 0; addGroup([B]new[/B] ImageGroup(1, 1)); addGroup([B]new[/B] ImageGroup(2, 1)); addGroup([B]new[/B] ImageGroup(3, 2)); } [B]private[/B] [B]static[/B] [B]class[/B] ImageGroup [B]extends[/B] RibbonGroup { /** * If this is set to true it will draw a border just around the * IconButtons, but not around the entire body. */ [B]private[/B] [B]static[/B] [B]final[/B] [B]boolean[/B] [B][I]SET_GROUP_BODY_BORDER[/I][/B] = [B]true[/B]; /** * If this is set to true it will cause the display to go into an * infinite redrawing loop where the size of the RibbonGroup gets larger * and larger. */ [B]private[/B] [B]static[/B] [B]final[/B] [B]boolean[/B] [B][I]SET_GROUP_BORDER[/I][/B] = [B]false[/B]; [B]public[/B] ImageGroup([B]int[/B] numberOfImages, [B]int[/B] numberOfRows) { setNumRows(numberOfRows); setTitle("Has " + numberOfImages + " Images"); ULog.[I]info[/I]([B]this[/B], "numberOfImages=" + numberOfImages); [B]for[/B] ([B]int[/B] i = 0; i < numberOfImages; i++) { String imageFileName = [I]imageFiles[/I][[I]imageIndex[/I]++]; IconButton iconButton = [B]new[/B] IconButton(); iconButton.setIcon(imageFileName); iconButton.setShowButtonTitle([B]false[/B]); iconButton.setShowFocused([B]false[/B]); addControl(iconButton); } [B]if[/B] ([B][I]SET_GROUP_BODY_BORDER[/I][/B]) { getBody().setBorder("2px solid red"); } [B]if[/B] ([B][I]SET_GROUP_BORDER[/I][/B]) { setBorder("2px solid blue"); } } } }
- getBody().setBorder This results in a border around the button icons only.
- setBorder This results in an infinite display loop where the RibbonGroups are drawn larger and larger eventually causing Firefox browser to freeze.
In addition to this, we have noticed that since we started using RibbonBar, that Firefox will sporadically freeze. We suspect there is potentially an infinite display bug.
Leave a comment: