Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » GalleryItem & DefaultGalleryItemRenderer Problem
GalleryItem & DefaultGalleryItemRenderer Problem [message #589764] Mon, 12 May 2008 12:24
Eclipse UserFriend
Originally posted by: sandeep.goel.barco.com

Hi,
I am using nebula widgets (Gallery) to give view like ICON view in
Windows.
by the following code.
public static void main (final String[] args)
{
final Display display = new Display();
final Image itemImage = new Image(display,
Program.findProgram("gif").getImageData());

final Shell shell = new Shell(display);
shell.setSize(400, 300);
shell.setLayout(new FillLayout());
final Gallery gallery = new Gallery(shell, SWT.V_SCROLL | SWT.MULTI);
// Renderers
final NoGroupRenderer gr = new NoGroupRenderer();
gr.setMinMargin(2);
gr.setItemSize(76, 56);
gr.setAutoMargin(true);
gallery.setGroupRenderer(gr);

final DefaultGalleryItemRenderer ir = new DefaultGalleryItemRenderer();
gallery.setItemRenderer(ir);

for (int g = 0; g {
final GalleryItem group = new GalleryItem(gallery, SWT.NONE);
group.setText("Group " + g);
group.setExpanded(true);

for (int i = 0; i {
final GalleryItem item = new GalleryItem(group, SWT.NONE);
if (itemImage != null)
{
item.setImage(itemImage);
}
item.setText("ABCDEFGHIJKLMNOPQRSTUVWXYZ");
}
}

shell.open();
while (!shell.isDisposed())
{
if (!display.readAndDispatch())
{
display.sleep();
}
}

if (itemImage != null)
{
itemImage.dispose();
}
display.dispose();
}

here problem is that when I select an item I get a rectanle around it.(By
modifying implementation of render class I removed that recatangle.) But
now I need to make that image of the selected item must be selected as in
the windows means only image must get a thin blue layer on it which makes
it as selected.

Can any body help me??
Thanks..
With BR
Sandeep Goel...
Previous Topic:Grid - Inline Editing
Next Topic:Grid tooltips persistence
Goto Forum:
  


Current Time: Fri Apr 19 23:19:26 GMT 2024

Powered by FUDForum. Page generated in 0.02511 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top