[Echo-list] Two problems with Echo 1.0.3
Brought to you by:
tliebeck
From: davout <da...@ds...> - 2003-12-16 21:48:42
|
First issue... I have the following code that sets up an array of Button objects inside a grid. One of the buttons has its select status set to true. However, the selected button does not show the 'selected' icon. String[] aNames = new String[4]; aNames[0] = "/com/eis/echo/images/menu/" + aPrefix + "_normal.jpg"; aNames[1] = "/com/eis/echo/images/menu/" + aPrefix + "_normal_roll.jpg"; aNames[2] = "/com/eis/echo/images/menu/" + aPrefix + "_selected.jpg"; aNames[3] = "/com/eis/echo/images/menu/" + aPrefix + "_selected_roll.jpg"; ResourceImageReference[] anImages = new ResourceImageReference[4]; for (int i=0; i < 4; i++) { anImages[i] = new ResourceImageReference(aNames[i]); } Button aButton = new Button(); aButton.setIcon(anImages[0]); aButton.setRolloverIcon(anImages[1]); aButton.setSelectedIcon(anImages[2]); aButton.setRolloverSelectedIcon(anImages[3]); aButton.setRolloverEnabled(true); aButton.setSelected(aSelected); Any ideas? Second problem.... I have the header part of a main window design that is trying to display two images. the first image should be positioned on the left edge of the available area, the second image should be positioned on the right edge of the same area. The full window width is wider than both images The code below is my attempt to do this. But the right side image is being positioned in the middle not the right edge. private void setup() { setHeight(44); setInsets(new Insets(0)); setBackground(new Color(128,173,186)); setScrollBarPolicy(ContentPane.SCROLL_BAR_NEVER); fMainGrid = new Grid(); fMainGrid.setBorderSize(0); add(fMainGrid); ResourceImageReference anImage = new ResourceImageReference(HEADING); fImageIcon = new ImageIcon(anImage,400,44); fMainGrid.add(0,0,fImageIcon).setHorizontalAlignment(EchoConstants.LEFT); fRightGrid = new Grid(); fRightGrid.setBorderSize(0); fRightGrid.setWidthUnits(Grid.PIXEL_UNITS); fRightGrid.setWidth(180); fRightGrid.setHeight(44); fRightGrid.setBackground(new Color(220,232,235)); fMainGrid.add(1,0,fRightGrid).setHorizontalAlignment(EchoConstants.RIGHT); ResourceImageReference aRightImage = new ResourceImageReference(HEADING_RIGHT); fRightImageIcon = new ImageIcon(aRightImage,180,44); fRightGrid.add(0,0,fRightImageIcon).setHorizontalAlignment(EchoConstants.RIG HT); } Any ideas? |