/[classpath]/classpath/gnu/java/awt/peer/gtk/GtkComponentPeer.java
ViewVC logotype

Diff of /classpath/gnu/java/awt/peer/gtk/GtkComponentPeer.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.91 by fitzsim, Tue Jul 26 20:41:40 2005 UTC revision 1.92 by fitzsim, Sat Aug 13 00:22:26 2005 UTC
# Line 418  public class GtkComponentPeer extends Gt Line 418  public class GtkComponentPeer extends Gt
418    
419    public void setBounds (int x, int y, int width, int height)    public void setBounds (int x, int y, int width, int height)
420    {    {
421        int new_x = x;
422        int new_y = y;
423    
424      Component parent = awtComponent.getParent ();      Component parent = awtComponent.getParent ();
425    
426      // Heavyweight components that are children of one or more      // Heavyweight components that are children of one or more
# Line 438  public class GtkComponentPeer extends Gt Line 441  public class GtkComponentPeer extends Gt
441    
442          i = ((Container) parent).getInsets ();          i = ((Container) parent).getInsets ();
443    
444          x += parent.getX () + i.left;          new_x += parent.getX () + i.left;
445          y += parent.getY () + i.top;          new_y += parent.getY () + i.top;
446    
447          parent = parent.getParent ();          parent = parent.getParent ();
448        }        }
# Line 448  public class GtkComponentPeer extends Gt Line 451  public class GtkComponentPeer extends Gt
451      // placing a heavyweight component in a Window.      // placing a heavyweight component in a Window.
452      if (parent instanceof Window && !lightweightChild)      if (parent instanceof Window && !lightweightChild)
453        {        {
         Insets insets = ((Window) parent).getInsets ();  
454          GtkWindowPeer peer = (GtkWindowPeer) parent.getPeer ();          GtkWindowPeer peer = (GtkWindowPeer) parent.getPeer ();
455            // important: we want the window peer's insets here, not the
456            // window's, since user sub-classes of Window can override
457            // getInset and we only want to correct for the frame borders,
458            // not for any user-defined inset values
459            Insets insets = peer.getInsets ();
460    
461          int menuBarHeight = 0;          int menuBarHeight = 0;
462          if (peer instanceof GtkFramePeer)          if (peer instanceof GtkFramePeer)
463            menuBarHeight = ((GtkFramePeer) peer).getMenuBarHeight ();            menuBarHeight = ((GtkFramePeer) peer).getMenuBarHeight ();
464    
465          // Convert from Java coordinates to GTK coordinates.          new_x = x - insets.left;
466          setNativeBounds (x - insets.left, y - insets.top + menuBarHeight,          new_y = y - insets.top + menuBarHeight;
                          width, height);  
467        }        }
468      else  
469        setNativeBounds (x, y, width, height);      setNativeBounds (new_x, new_y, width, height);
470    }    }
471    
472    void setCursor ()    void setCursor ()
# Line 671  public class GtkComponentPeer extends Gt Line 678  public class GtkComponentPeer extends Gt
678    {    {
679      backBuffer.flush();      backBuffer.flush();
680    }    }
681      
682      public String toString ()
683      {
684        return "peer of " + awtComponent.toString();
685      }
686  }  }

Legend:
Removed from v.1.91  
changed lines
  Added in v.1.92

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26