Hi Andreas, the most ugly thing concerns the chess board, which I set up with SimplePanels based on your idea: There are gaps between the columns.
Look at this: http://yfrog.com/0nappdp I find that most web apps still work good with old browsers, and I am not sure if my app should look better with IE6... Magnus On Jul 21, 7:15 pm, andreas <[email protected]> wrote: > Hey Magnus, > > to be honest I was very glad to read this post: > > http://googleenterprise.blogspot.com/2010/01/modern-browsers-for-mode... > > Besides, what exactly is looking ugly? > > Me personally, I would not spend much time in fixing it for IE6 if it > can not be fixed by slightly adjusting the UI setup in such a way that > it still works correctly on modern browsers. > > Regards, > > Andreas > > On 21 Jul., 19:00, Magnus <[email protected]> wrote: > > > Hi Andreas, > > > may I come back to your code? I have build my chess game on your idea > > using SimplePanels for the cells. It always worked great, but today I > > found that it looks ugly under IE6. What would you do in this case? Is > > IE6 so old that you can ignore it? > > > Thanks > > Magnus > > > On Jun 28, 12:24 pm, andreas <[email protected]> wrote: > > > > Here's code I'd use to create a simplistic chess board: > > > > // the chess board with no spaces > > > Grid cb = new Grid(10, 10); > > > cb.setCellPadding(0); > > > cb.setCellSpacing(0); > > > cb.setBorderWidth(0); > > > > // assembles the board by inserting colored panels > > > for (int i = 1; i < 9; i++) { > > > // panels of the top row > > > SimplePanel pHTop = new SimplePanel(); > > > pHTop.setPixelSize(40, 20); > > > pHTop.getElement().getStyle().setBackgroundColor("red"); > > > > // panels of the bottom row > > > SimplePanel pHBottom = new SimplePanel(); > > > pHBottom.setPixelSize(40, 20); > > > pHBottom.getElement().getStyle().setBackgroundColor("red"); > > > > // panels of the left column > > > SimplePanel pVLeft = new SimplePanel(); > > > pVLeft.setPixelSize(20, 40); > > > pVLeft.getElement().getStyle().setBackgroundColor("green"); > > > > // panels of the right column > > > SimplePanel pVRight = new SimplePanel(); > > > pVRight.setPixelSize(20, 40); > > > pVRight.getElement().getStyle().setBackgroundColor("green"); > > > > // insert the border cells > > > cb.setWidget(0, i, pHTop); > > > cb.setWidget(9, i, pHBottom); > > > cb.setWidget(i, 0, pVLeft); > > > cb.setWidget(i, 9, pVRight); > > > > for (int j = 1; j < 9; j++) { > > > // the inner chess board panels > > > SimplePanel cP = new SimplePanel(); > > > cP.setPixelSize(40, 40); > > > // switches between black and white > > > if (j % 2 == 0) { > > > cP.getElement().getStyle().setBackgroundColor( > > > i % 2 == 0 ? "black" : "white"); > > > } else { > > > cP.getElement().getStyle().setBackgroundColor( > > > i % 2 == 0 ? "white" : "black"); > > > } > > > cb.setWidget(i, j, cP); > > > } > > > > } > > > > // there it is > > > RootPanel.get().add(cb, 1, 1); > > > > Programmatic styles are of course not as good as using stylesheets, > > > consider this just a demo. > > > > On 28 Jun., 11:51, andreas <[email protected]> wrote: > > > > > Where exactly are the vertical spaces? From what I see, there are no > > > > spaces between the cells of the top and bottom row and the spaces > > > > between the cells in the left and right column are of the same color > > > > as the image background, so I assume there are actually also no > > > > spaces, correct me on this one? > > > > > For better debug you could also assign a border and background color > > > > to the Grid. If none of these colors will be visible you can be sure > > > > that there are no spaces or anything left. > > > > > For the inner cells I can not say if there are any spaces. > > > > > Also I assume your style "pnl-r" adds the red border to the Grid? If > > > > there were any spaces left caused by the border width you would see a > > > > red Grid. > > > > > I think you got what you wanted... > > > > > BTW: I think you do not need to set the cell dimensions manually; Grid > > > > will automatically adjust cell dimensions so that the cell widgets > > > > fit, in other words a columns width for example will be adjusted so > > > > that the cell widget with the biggest width is completely visible; > > > > same goes for rows and heights and so on > > > > > BTW2: the two for-blocks in init() can be realized in one single for- > > > > block since they iterate over exactly the same interval (0-9) > > > > > On 28 Jun., 11:27, Magnus <[email protected]> wrote: > > > > > > Here is the screenshot: > > > > > >http://yfrog.com/j7chessboardj > > > > > > Magnus -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
