0

How to add eyelid field manager to grid field manager.

I have created a grid layout.Now i want to add an eyelid field manager on top of it.

I have been able to add both of them separately but now am unable to use them together.

Following code was used when i wanted to integrate

         _eyelidFieldManager.add(grid);
         add(_eyelidFieldManager);

How else can this be accomplished?

I have also tried adding this way

       grid.add(_eyelidFieldManager);
       add(grid);

But what what i get is the eye lid field manager comes below the grid.I want to superimpose the eyelid on top of grid.So that when i click anywhere on the screen of grid,the eyelid opens.Your help will be appreciated.

techie
  • 467
  • 3
  • 8
  • 23

1 Answers1

1

EyelidFieldManager has three main methods for adding fields:

  • addTop(Field f): adds a field to the top eyelid.
  • addBottom(Field f): adds a field to the bottom eyelid.
  • add(Field f, int x, int y): adds a field and places it in the specified absolute position. Fields added using this method will remain visible after the lids get closed.

As you can see, EyelidFieldManager extends from AbsoluteFieldManager and this is what makes this class so problematic, as fields added in between the lids must be layed out using absolute coordinates.

In turn, AbsoluteFieldManager extends Manager so it has an additional add(Field f) method, which is overriden to add the field to the bottom eyelid. This is what is happening in your case. You should instead use the third add method listed above and provide absolute coordinates.

Mister Smith
  • 27,417
  • 21
  • 110
  • 193
  • Thanks so much for responding.I tried using that third method in this way _eyelidFieldManager.add(grid, 20 , 40); and then i added the eyelidfieldmanager like this add(_eyelidFieldManager); But i only get the eyelids implemented.The grid is not to be seen.Whats going wrong now? – techie May 25 '12 at 07:50