Difference between revisions of "Documentation/DevGuide/OfficeDev/Component/Window Interfaces"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (1 revision(s))
 
(5 intermediate revisions by 3 users not shown)
Line 6: Line 6:
 
|NextPage=Documentation/DevGuide/OfficeDev/Creating Frames Manually
 
|NextPage=Documentation/DevGuide/OfficeDev/Creating Frames Manually
 
}}
 
}}
{{DISPLAYTITLE:Window Interfaces}}
+
{{Documentation/DevGuideLanguages|Documentation/DevGuide/OfficeDev/{{SUBPAGENAME}}}}
 +
{{DISPLAYTITLE:Window Interfaces}}
 
<!--<idltopic>com.sun.star.awt.XWindow;com.sun.star.awt.XTopWindow;com.sun.star.awt.XWindowPeer</idltopic>-->
 
<!--<idltopic>com.sun.star.awt.XWindow;com.sun.star.awt.XTopWindow;com.sun.star.awt.XWindowPeer</idltopic>-->
 
The window interfaces of the component window and container window control the {{PRODUCTNAME}} application windows. This chapter provides a short overview.
 
The window interfaces of the component window and container window control the {{PRODUCTNAME}} application windows. This chapter provides a short overview.
Line 12: Line 13:
 
=== XWindow ===
 
=== XWindow ===
 
The interface <idl>com.sun.star.awt.XWindow</idl> is supported by the component and controller windows. This interface comprises methods to resize a window, control its visibility, enable and disable it, and make it the focus for input device events. Listeners are informed about window events.
 
The interface <idl>com.sun.star.awt.XWindow</idl> is supported by the component and controller windows. This interface comprises methods to resize a window, control its visibility, enable and disable it, and make it the focus for input device events. Listeners are informed about window events.
 
+
<source lang="idl">
 
   [oneway] void setPosSize ( long X, long Y, long Width, long Height, short Flags );  
 
   [oneway] void setPosSize ( long X, long Y, long Width, long Height, short Flags );  
 
   com::sun::star::awt::Rectangle getPosSize ();  
 
   com::sun::star::awt::Rectangle getPosSize ();  
Line 32: Line 33:
 
   [oneway] void addPaintListener ( com::sun::star::awt::XPaintListener xListener );  
 
   [oneway] void addPaintListener ( com::sun::star::awt::XPaintListener xListener );  
 
   [oneway] void removePaintListener ( com::sun::star::awt::XPaintListener xListener );  
 
   [oneway] void removePaintListener ( com::sun::star::awt::XPaintListener xListener );  
 
+
</source>
 
The <idl>com.sun.star.awt.XWindowListener</idl> gets the following notifications. The <idl>com.sun.star.awt.WindowEvent</idl> has members describing the size and position of the window.
 
The <idl>com.sun.star.awt.XWindowListener</idl> gets the following notifications. The <idl>com.sun.star.awt.WindowEvent</idl> has members describing the size and position of the window.
 
+
<source lang="idl">
 
   [oneway] void windowResized ( [in] com::sun::star::awt::WindowEvent e )
 
   [oneway] void windowResized ( [in] com::sun::star::awt::WindowEvent e )
 
   [oneway] void windowMoved ( [in] com::sun::star::awt::WindowEvent e )
 
   [oneway] void windowMoved ( [in] com::sun::star::awt::WindowEvent e )
 
   [oneway] void windowShown ( [in] com::sun::star::lang::EventObject e )
 
   [oneway] void windowShown ( [in] com::sun::star::lang::EventObject e )
 
   [oneway] void windowHidden ( [in] com::sun::star::lang::EventObject e );  
 
   [oneway] void windowHidden ( [in] com::sun::star::lang::EventObject e );  
 
+
</source>
 
What the other listeners do are evident by their names.
 
What the other listeners do are evident by their names.
  
Line 45: Line 46:
  
 
The interface <idl>com.sun.star.awt.XTopWindow</idl> is available at container windows. It informs listeners about top window events, and it can put itself in front of other windows or withdraw into the background. It also has a method to control the current menu bar:
 
The interface <idl>com.sun.star.awt.XTopWindow</idl> is available at container windows. It informs listeners about top window events, and it can put itself in front of other windows or withdraw into the background. It also has a method to control the current menu bar:
 
+
<source lang="idl">
 
   [oneway] void addTopWindowListener ( com::sun::star::awt::XTopWindowListener xListener );  
 
   [oneway] void addTopWindowListener ( com::sun::star::awt::XTopWindowListener xListener );  
 
   [oneway] void removeTopWindowListener ( com::sun::star::awt::XTopWindowListener xListener );  
 
   [oneway] void removeTopWindowListener ( com::sun::star::awt::XTopWindowListener xListener );  
Line 51: Line 52:
 
   [oneway] void toBack ();  
 
   [oneway] void toBack ();  
 
   [oneway] void setMenuBar ( com::sun::star::awt::XMenuBar xMenu );
 
   [oneway] void setMenuBar ( com::sun::star::awt::XMenuBar xMenu );
 +
</source>
  
 +
{{Note|Although the <tt>XTopWindow</tt> interface has a method <tt>setMenuBar()</tt>, this method is not usable at this time. The <idl>com.sun.star.awt.XMenuBar</idl> interface is deprecated.}}
  
{{Documentation/Note|Although the <tt>XTopWindow</tt> interface has a method <tt>setMenuBar()</tt>, this method is not usable at this time. The <idl>com.sun.star.awt.XMenuBar</idl> interface is deprecated.}}
+
The top window listener receives the following messages. All methods take a <idl>com.sun.star.lang.EventObject</idl>.
 
+
<source lang="idl">
The top window listener receives the following messages. All methods take a <idl>com.sun.star.awt.WindowEvent</idl> with members describing the size and position of the window.
+
   [oneway] void windowOpened ( [in] com::sun::star::lang::EventObject e )
 
+
   [oneway] void windowClosing ( [in] com::sun::star::lang::EventObject e )
   [oneway] void windowOpened ( [in] com::sun::star::awt::WindowEvent e )
+
   [oneway] void windowClosed ( [in] com::sun::star::lang::EventObject e )
   [oneway] void windowClosing ( [in] com::sun::star::awt::WindowEvent e )
+
   [oneway] void windowMinimized ( [in] com::sun::star::lang::EventObject e )
   [oneway] void windowClosed ( [in] com::sun::star::awt::WindowEvent e )
+
   [oneway] void windowNormalized ( [in] com::sun::star::lang::EventObject e )
   [oneway] void windowMinimized ( [in] com::sun::star::awt::WindowEvent e )
+
   [oneway] void windowActivated ( [in] com::sun::star::lang::EventObject e )
   [oneway] void windowNormalized ( [in] com::sun::star::awt::WindowEvent e )
+
   [oneway] void windowDeactivated ( [in] com::sun::star::lang::EventObject e )
   [oneway] void windowActivated ( [in] com::sun::star::awt::WindowEvent e )
+
</source>
   [oneway] void windowDeactivated ( [in] com::sun::star::awt::WindowEvent e )
+
 
+
 
=== XWindowPeer ===
 
=== XWindowPeer ===
  
 
Each <code>XWindow</code> has a <idl>com.sun.star.awt.XWindowPeer</idl>. The <idl>com.sun.star.awt.XWindowPeer</idl> interface accesses the window toolkit implementation used to create it and provides the pointer of the pointing device, and controls the background color. It is also used to invalidate a window or portions of it to trigger a redraw cycle.
 
Each <code>XWindow</code> has a <idl>com.sun.star.awt.XWindowPeer</idl>. The <idl>com.sun.star.awt.XWindowPeer</idl> interface accesses the window toolkit implementation used to create it and provides the pointer of the pointing device, and controls the background color. It is also used to invalidate a window or portions of it to trigger a redraw cycle.
 
+
<source lang="idl">
 
   com::sun::star::awt::XToolkit getToolkit ()
 
   com::sun::star::awt::XToolkit getToolkit ()
 
   [oneway] void setPointer ( [in] com::sun::star::awt::XPointer Pointer )
 
   [oneway] void setPointer ( [in] com::sun::star::awt::XPointer Pointer )
Line 75: Line 76:
 
   [oneway] void invalidateRect ( [in] com::sun::star::awt::Rectangle Rect,  
 
   [oneway] void invalidateRect ( [in] com::sun::star::awt::Rectangle Rect,  
 
   [in] short Flags )
 
   [in] short Flags )
 
+
</source>
 
{{PDL1}}
 
{{PDL1}}
[[Category: Office Development]]
+
 
 +
[[Category:Documentation/Developer's Guide/Office Development]]

Latest revision as of 19:30, 3 July 2018



The window interfaces of the component window and container window control the OpenOffice.org application windows. This chapter provides a short overview.

XWindow

The interface com.sun.star.awt.XWindow is supported by the component and controller windows. This interface comprises methods to resize a window, control its visibility, enable and disable it, and make it the focus for input device events. Listeners are informed about window events.

  [oneway] void setPosSize ( long X, long Y, long Width, long Height, short Flags ); 
  com::sun::star::awt::Rectangle getPosSize (); 
 
  [oneway] void setVisible ( boolean Visible ); 
  [oneway] void setEnable ( boolean Enable ); 
  [oneway] void setFocus (); 
 
  [oneway] void addWindowListener ( com::sun::star::awt::XWindowListener xListener ); 
  [oneway] void removeWindowListener ( com::sun::star::awt::XWindowListener xListener ); 
  [oneway] void addFocusListener ( com::sun::star::awt::XFocusListener xListener ); 
  [oneway] void removeFocusListener ( com::sun::star::awt::XFocusListener xListener ); 
  [oneway] void addKeyListener ( com::sun::star::awt::XKeyListener xListener ); 
  [oneway] void removeKeyListener ( com::sun::star::awt::XKeyListener xListener ); 
  [oneway] void addMouseListener ( com::sun::star::awt::XMouseListener xListener ); 
  [oneway] void removeMouseListener ( com::sun::star::awt::XMouseListener xListener ); 
  [oneway] void addMouseMotionListener ( com::sun::star::awt::XMouseMotionListener xListener ); 
  [oneway] void removeMouseMotionListener ( com::sun::star::awt::XMouseMotionListener xListener ); 
  [oneway] void addPaintListener ( com::sun::star::awt::XPaintListener xListener ); 
  [oneway] void removePaintListener ( com::sun::star::awt::XPaintListener xListener );

The com.sun.star.awt.XWindowListener gets the following notifications. The com.sun.star.awt.WindowEvent has members describing the size and position of the window.

  [oneway] void windowResized ( [in] com::sun::star::awt::WindowEvent e )
  [oneway] void windowMoved ( [in] com::sun::star::awt::WindowEvent e )
  [oneway] void windowShown ( [in] com::sun::star::lang::EventObject e )
  [oneway] void windowHidden ( [in] com::sun::star::lang::EventObject e );

What the other listeners do are evident by their names.

XTopWindow

The interface com.sun.star.awt.XTopWindow is available at container windows. It informs listeners about top window events, and it can put itself in front of other windows or withdraw into the background. It also has a method to control the current menu bar:

  [oneway] void addTopWindowListener ( com::sun::star::awt::XTopWindowListener xListener ); 
  [oneway] void removeTopWindowListener ( com::sun::star::awt::XTopWindowListener xListener ); 
  [oneway] void toFront (); 
  [oneway] void toBack (); 
  [oneway] void setMenuBar ( com::sun::star::awt::XMenuBar xMenu );
Documentation note.png Although the XTopWindow interface has a method setMenuBar(), this method is not usable at this time. The com.sun.star.awt.XMenuBar interface is deprecated.

The top window listener receives the following messages. All methods take a com.sun.star.lang.EventObject.

  [oneway] void windowOpened ( [in] com::sun::star::lang::EventObject e )
  [oneway] void windowClosing ( [in] com::sun::star::lang::EventObject e )
  [oneway] void windowClosed ( [in] com::sun::star::lang::EventObject e )
  [oneway] void windowMinimized ( [in] com::sun::star::lang::EventObject e )
  [oneway] void windowNormalized ( [in] com::sun::star::lang::EventObject e )
  [oneway] void windowActivated ( [in] com::sun::star::lang::EventObject e )
  [oneway] void windowDeactivated ( [in] com::sun::star::lang::EventObject e )

XWindowPeer

Each XWindow has a com.sun.star.awt.XWindowPeer. The com.sun.star.awt.XWindowPeer interface accesses the window toolkit implementation used to create it and provides the pointer of the pointing device, and controls the background color. It is also used to invalidate a window or portions of it to trigger a redraw cycle.

  com::sun::star::awt::XToolkit getToolkit ()
  [oneway] void setPointer ( [in] com::sun::star::awt::XPointer Pointer )
  [oneway] void setBackground ( [in] long Color ) 
  [oneway] void invalidate ( [in] short Flags )
  [oneway] void invalidateRect ( [in] com::sun::star::awt::Rectangle Rect, 
  [in] short Flags )
Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages