Page 161 - DCAP408_WEB_PROGRAMMING
P. 161

Unit 9: Child and Pop Up Windows




          8.   Using a ......................... window can significantly improve performance and visual effects  Notes
               for a window that has a complex shape, animates its shape, or wishes to use alpha blending
               effects.
          9.   To set the opacity level or the transparency color key for a given layered window, call
               ......................... Attributes.

          10.  A ......................... window enables you to send and receive messages. It is not visible, has
               no z-order, cannot be enumerated, and does not receive broadcast messages.
          11.  To find message-only windows, specify ......................... in the hwndParent parameter of
               the FindWindowEx function.

          9.3 Fixed Child Windows


          [FIXED] Window that opens child Window - Menu displayed behind child

          If you have a main Window which opens a child Window and that child Window has a Component
          which displays a menu, the menu will appear behind the  child Window the first time it is
          displayed.
          To test, run the code below, click the button, then click the date field trigger. Do not move the
          child window in between steps as this will probably alter the child window z-index.
          Code:
          public  static  void  testPopupBug()
              {
                          final  Window  w  =  new  Window();
                          w.setSize(100,  100);


                          //  On  button  click,  display  a  new  window  with  a  simple  date  field
                          Button  b  =  new  Button(“Open  new  Window  with  date  field”);
                          b.addSelectionListener(new  SelectionListener<ButtonEvent>()  {
                                  public  void  componentSelected(ButtonEvent  ce)
                      {
                          final Window popup = new Window();
                          popup.setSize(150, 150);

                                          final  LayoutContainer  c  =  new  LayoutContainer();
                          c.add(new DateField());
                          popup.add(c);
                          popup.show();
                      }
                  });


                  w.add(b);






                                           LOVELY PROFESSIONAL UNIVERSITY                                   155
   156   157   158   159   160   161   162   163   164   165   166