I need help with ActionBarAdvisor::fillCoolBar and saveState [message #453543] |
Tue, 01 August 2006 19:46 |
Brannon Messages: 6 Registered: July 2009 |
Junior Member |
|
|
I need six small toolbars consisting of one button and two text boxes. I
need them to remember their position between runs. Originally I had a single
coolBar.add call that added my own class extending ContributionItem. I added
text boxes to my toolbars, and those to my coolItems, all in the fill
function for that ContributionItem. That had two problems. First, it did not
automatically save the state of each of the toolbars. It would save the one
ContributionItem to the location -1,-1. Second, on restoring state from a
file with the contribution item in it, I would get mounds of junk controls
on top of the real toolbars. It made a mess of the rendering.
So then my plan was to change the fill function to use ToolBarManager
instead of Toolbar, but I don't know how to add a ToolBarManager to a
CoolItem directly. I ended up using myToolBar.createControl(parent) all over
in my code instead. It had the same problem. And are ToolBarManager objects
supposed to automatically save state? Or does the CoolBarManager pass some
saveState signal down to ToolBarManager children?
So at this point I decided to build the toolbars in the fillCoolBar function
directly. However, I don't know what composite to connect my text boxes to
in this situation. Example:
protected void fillCoolBar(ICoolBarManager coolBar) {
ToolBarManager tb;
tb = new ToolBarManager(SWT.FLAT|SWT.HORIZONTAL);
Text qisMinTxt = new Text(tb.createControl(????), SWT.BORDER | SWT.RIGHT |
SWT.FLAT| SWT.SINGLE);
I know you can add text boxes directly to CoolItems, but I don't want them
separated from their associated enabling button and other text box. Is there
some other way to force three CoolItems to stick together (and get rid of
the gripper between them)?
I'm also quite confused as to the fill function setting the control sizes
and the restoreState somehow changing the sizes after that point. Is that
right? I do have the saveState stuff enabled. All my view positions save
correctly.
I'm using a very recent 3.2.
Thank you for your time,
Brannon
|
|
|
Powered by
FUDForum. Page generated in 0.03617 seconds