Home » Eclipse Projects » GEF » Create ToolBar for Direct Edit
Create ToolBar for Direct Edit [message #59349] |
Wed, 29 January 2003 02:16  |
Eclipse User |
|
|
|
I am trying to create a ToolBar for Direct Edit, I create my own CellEditor
and the createControl(Composite parent) method, I use the Tool Bar example
from the SWT page.
But my question is what should I pass to the Menu() contructor? It does not
take a Composite class, it needs a
Control class, and where I can get a reference to the Control from the
Composite class?
Thanks
<< my implementation of createControl(Composite parent) method >>
toolBar = new ToolBar(parent, SWT.NONE);
final Menu menu = new Menu(???, SWT.POP_UP);
for (int i = 0; i < 8; i++) {
MenuItem item = new MenuItem(menu, SWT.PUSH);
item.setText("Item " + i);
}
|
|
|
Re: Create ToolBar for Direct Edit [message #59399 is a reply to message #59349] |
Wed, 29 January 2003 11:11   |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
A composite is a control.
You might have trouble with focus issues. Your Toolbar will never gain
focus, therefore it will never fire focus lost. GEF tries to bring down
CellEditors when they lose focus, but yours will remain active.
"Hal" <otaconss2@hotmail.com> wrote in message
news:b18rrb$v3v$1@rogue.oti.com...
> I am trying to create a ToolBar for Direct Edit, I create my own
CellEditor
> and the createControl(Composite parent) method, I use the Tool Bar example
> from the SWT page.
>
> But my question is what should I pass to the Menu() contructor? It does
not
> take a Composite class, it needs a
> Control class, and where I can get a reference to the Control from the
> Composite class?
>
> Thanks
>
> << my implementation of createControl(Composite parent) method >>
> toolBar = new ToolBar(parent, SWT.NONE);
> final Menu menu = new Menu(???, SWT.POP_UP);
>
> for (int i = 0; i < 8; i++) {
> MenuItem item = new MenuItem(menu, SWT.PUSH);
> item.setText("Item " + i);
> }
>
>
|
|
|
Re: Create ToolBar for Direct Edit [message #59759 is a reply to message #59399] |
Wed, 29 January 2003 13:49   |
Eclipse User |
|
|
|
Should I use a Table instead?
Basically I want my control to have an icon and text.
CCombo and List won't work, they only support text.
What kind of controls I should use? i wants it shows both icon and text.
Thank you.
"Randy Hudson" <none@us.ibm.com> wrote in message
news:b18tfs$tl$1@rogue.oti.com...
> A composite is a control.
> You might have trouble with focus issues. Your Toolbar will never gain
> focus, therefore it will never fire focus lost. GEF tries to bring down
> CellEditors when they lose focus, but yours will remain active.
>
> "Hal" <otaconss2@hotmail.com> wrote in message
> news:b18rrb$v3v$1@rogue.oti.com...
> > I am trying to create a ToolBar for Direct Edit, I create my own
> CellEditor
> > and the createControl(Composite parent) method, I use the Tool Bar
example
> > from the SWT page.
> >
> > But my question is what should I pass to the Menu() contructor? It does
> not
> > take a Composite class, it needs a
> > Control class, and where I can get a reference to the Control from the
> > Composite class?
> >
> > Thanks
> >
> > << my implementation of createControl(Composite parent) method >>
> > toolBar = new ToolBar(parent, SWT.NONE);
> > final Menu menu = new Menu(???, SWT.POP_UP);
> >
> > for (int i = 0; i < 8; i++) {
> > MenuItem item = new MenuItem(menu, SWT.PUSH);
> > item.setText("Item " + i);
> > }
> >
> >
>
>
|
|
|
Re: Create ToolBar for Direct Edit [message #59781 is a reply to message #59759] |
Wed, 29 January 2003 13:49   |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
Why not compose a label and a Text control on a composite?
"Hal" <otaconss2@hotmail.com> wrote in message
news:b196gv$9k2$1@rogue.oti.com...
> Should I use a Table instead?
>
> Basically I want my control to have an icon and text.
> CCombo and List won't work, they only support text.
>
> What kind of controls I should use? i wants it shows both icon and text.
>
> Thank you.
>
>
> "Randy Hudson" <none@us.ibm.com> wrote in message
> news:b18tfs$tl$1@rogue.oti.com...
> > A composite is a control.
> > You might have trouble with focus issues. Your Toolbar will never gain
> > focus, therefore it will never fire focus lost. GEF tries to bring down
> > CellEditors when they lose focus, but yours will remain active.
> >
> > "Hal" <otaconss2@hotmail.com> wrote in message
> > news:b18rrb$v3v$1@rogue.oti.com...
> > > I am trying to create a ToolBar for Direct Edit, I create my own
> > CellEditor
> > > and the createControl(Composite parent) method, I use the Tool Bar
> example
> > > from the SWT page.
> > >
> > > But my question is what should I pass to the Menu() contructor? It
does
> > not
> > > take a Composite class, it needs a
> > > Control class, and where I can get a reference to the Control from the
> > > Composite class?
> > >
> > > Thanks
> > >
> > > << my implementation of createControl(Composite parent) method >>
> > > toolBar = new ToolBar(parent, SWT.NONE);
> > > final Menu menu = new Menu(???, SWT.POP_UP);
> > >
> > > for (int i = 0; i < 8; i++) {
> > > MenuItem item = new MenuItem(menu, SWT.PUSH);
> > > item.setText("Item " + i);
> > > }
> > >
> > >
> >
> >
>
>
|
|
|
Re: Create ToolBar for Direct Edit [message #60384 is a reply to message #59781] |
Thu, 30 January 2003 15:40  |
Eclipse User |
|
|
|
I can't since i want a List of item (with icons and text) to let user to
choose.
So I create a Table as my Direct Edit Control, but how can I listen to
user's change in Selection and then call doSetValue() in my direct Manager?
Here is how I create a SWT Table for my direct edit control:
table = new Table(parent, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
for (int i = 0; i < 12; i++) {
TableItem item = new TableItem(table, 0);
item.setText("Item " + i);}
table.setSize(10, 10);
"Randy Hudson" <none@us.ibm.com> wrote in message
news:b196mm$9oo$1@rogue.oti.com...
> Why not compose a label and a Text control on a composite?
> "Hal" <otaconss2@hotmail.com> wrote in message
> news:b196gv$9k2$1@rogue.oti.com...
> > Should I use a Table instead?
> >
> > Basically I want my control to have an icon and text.
> > CCombo and List won't work, they only support text.
> >
> > What kind of controls I should use? i wants it shows both icon and text.
> >
> > Thank you.
> >
> >
> > "Randy Hudson" <none@us.ibm.com> wrote in message
> > news:b18tfs$tl$1@rogue.oti.com...
> > > A composite is a control.
> > > You might have trouble with focus issues. Your Toolbar will never
gain
> > > focus, therefore it will never fire focus lost. GEF tries to bring
down
> > > CellEditors when they lose focus, but yours will remain active.
> > >
> > > "Hal" <otaconss2@hotmail.com> wrote in message
> > > news:b18rrb$v3v$1@rogue.oti.com...
> > > > I am trying to create a ToolBar for Direct Edit, I create my own
> > > CellEditor
> > > > and the createControl(Composite parent) method, I use the Tool Bar
> > example
> > > > from the SWT page.
> > > >
> > > > But my question is what should I pass to the Menu() contructor? It
> does
> > > not
> > > > take a Composite class, it needs a
> > > > Control class, and where I can get a reference to the Control from
the
> > > > Composite class?
> > > >
> > > > Thanks
> > > >
> > > > << my implementation of createControl(Composite parent) method >>
> > > > toolBar = new ToolBar(parent, SWT.NONE);
> > > > final Menu menu = new Menu(???, SWT.POP_UP);
> > > >
> > > > for (int i = 0; i < 8; i++) {
> > > > MenuItem item = new MenuItem(menu, SWT.PUSH);
> > > > item.setText("Item " + i);
> > > > }
> > > >
> > > >
> > >
> > >
> >
> >
>
>
|
|
|
Goto Forum:
Current Time: Mon Jul 14 03:12:01 EDT 2025
Powered by FUDForum. Page generated in 0.47861 seconds
|