Sophie

Sophie

distrib > Mandriva > 10.0 > i586 > media > contrib > by-pkgid > a30195132950ef62bc2a088ae34f5204 > files > 276

libfox1.0-devel-1.0.42-3mdk.i586.rpm

<html>
<head>
<LINK REL="stylesheet" HREF="styles.css" TYPE="text/css">
<title>FOX-Toolkit</title>
<!-- HTML Copyright 2001 Paul Laufer -->
</head>

<body bgcolor=#ffffff link=#990033 vlink=#4a73ad alink=#ed004f text=#000000>

<!--header-->
<table align=center border=0 cellpadding=0 cellspacing=0 width=100% >
  <tr><td bgcolor=silver colspan=5 align=right height=50><img src=art/oul_grey.gif align=left valign=top width=8 height=8><img src=art/foxlogo.png valign=bottom alt="FOX Toolkit" height=50 width=500 border=0 ></td>
  	<td bgcolor=#557faa valign=top align=right><img src=art/our.gif width=8 height=8></td>
  </tr>
<!-- end header -->
  <tr>
    <td bgcolor=#557faa colspan=2 valign=top align=left>&nbsp;</td>
    <td bgcolor=#557faa colspan=3><font color=#ffffff size=+1><center>
<!-- Page Title -->
Documentation: The Window Class
<!-- End Page Title -->
    </center></font></td>
    <td bgcolor=#557faa valign=top align=right>&nbsp;</td>
  </tr>
  <tr>
    <td bgcolor=#557faa colspan=2>&nbsp;</td>
    <td bgcolor=#ffffff valign=top align=left><img src=art/iul.gif width=8 height=8></td>
    <td bgcolor=#ffffff>&nbsp;</td>
    <td bgcolor=#ffffff valign=top align=right><img src=art/iur.gif width=8 height=8></td>
    <td bgcolor=#557faa width=15>&nbsp;</td>
  </tr>
  <tr>
    <td width=8 bgcolor=#557faa>&nbsp;</td>
    <td valign=top bgcolor=#557faa link=#ffffff width=150>

<!-- start navbar content -->

	<a href=fox.html><font color=#ffffff>Home</font></a><br>
	<a href=news.html><font color=#ffffff>News</font></a><br>
	<a href=download.html><font color=#ffffff>Download</font></a><br>
	<a href=goals.html><font color=#ffffff>Goals & Approach</font></a><br>
	<a href=doc.html><font color=#ffffff>Documentation</font></a><br>
	<a href=faq.html><font color=#ffffff>FAQ</font></a><br>
	<a href=rex.html><font color=#ffffff>FXRex</font></a><br>
	<a href=screenshots.html><font color=#ffffff>Screenshots</font></a><br>
	<br>
	<a href=adie.html><font color=#ffffff>Adie</font></a><br>
	<a href=pathfinder.html><font color=#ffffff>PathFinder</font></a><br>
	<a href=calc.html><font color=#ffffff>FOX Calculator</font></a><br>
	<br>
	<a href=projects.html><font color=#ffffff>Projects</font></a><br>
	<br>
	<a href='http://fxpy.sourceforge.net'><font color=#ffffff>FXPy</font></a><br>
	<a href='http://fxruby.sourceforge.net'><font color=#ffffff>FXRuby</font></a><br>
	<a href='http://eiffelfox.sourceforge.net'><font color=#ffffff>EiffelFox</font></a><br>
        <a href='http://eevolved.com/foxhole/'><font color=#ffffff>The FOX Hole</font></a><br>
        <a href='http://takahr.dhis.portside.net/cgi-bin/rwiki.cgi?cmd=view;name=FOX+FAQ'><font color=#ffffff>Japanese Docs</font></a><br>
	<br>
	<center>
	<a href="http://www.eff.org/br"><img SRC="art/freespeach.gif" border=0></a>
	<p>
	<a href="http://www.slashdot.org"><img SRC="art/slingerzbutton1.gif" border=0></a>
	</center>



<!-- end navbar content -->

    </td>
    <td bgcolor=#ffffff>&nbsp;</td>
    <td valign=top>

<!-- start main window content -->
<center><img src='art/foxstart.png'>
<BR><B>Documentation: The Window Class</B>
</center>
<p>
<p>
<b>The FXWindow Class</b>
<hr>
The FXWindow class manages a window on the screen.  FXWindow is the base class of all FOX GUI
widgets such as buttons and sliders, in other words, all widgets are ultimately derived from
FXWindow.
<p>
All windows are organized into a so called widget tree; at the root of this widget tree
is the <b>root window</b> which is a special window which represents the entire screen.
<p>
<b>Top level</b> or <b>shell windows</b> are children of the root window; they're special because top level
windows, such as the <b>main window</b> and <b>dialog box</b>, are positioned and resized
directly by the user.
<p>
<b>Layout manager</b> windows are composite windows which may have zero or more children,
possibly including other layout managers.  Layout managers position their child-windows
according to certain layout patterns and layout flags.
<p>
<b>Child</b> windows or <b>simple</b> windows are windows which do not themselves have any
children.  Child windows are usually simple controls such as buttons and sliders.
<p>
<p>
<b>Navigating The Widget Tree</b>
<hr>
As each window is positioned somewhere in the widget tree, each window maintains some information
about where in the tree it is; this information can be obtained with the following API's:<br><br>

<blockquote>
<b><u>FXWindow::getParent()</u></b>
<p>This function returns the window which is this window's immediate parent.  For the root
window, this returns NULL as the root window does not have a parent.

<p><b><u>FXWindow::getRoot()</u></b>
<p>This function returns the root window, or the window's ultimate parent.

<p><b><u>FXWindow::getShell()</u></b>
<p>This function returns the top level or shell window of this window.  The shell window
is always a child of the root window.

<p><b><u>FXWindow::getOwner()</u></b>
<p>This returns the window's owner, if any.  The owner of a window is the window that is resposible
for this window in some way.  For example, a modal dialog may be owned by a main window.
The system usually ensures that a top level window stays on top of the window that owns it.
Windows which have no owner return NULL as the owner window.

<p><b><u>FXWindow::getFirst()</u></b>
<p>This returns the first child of this window, if any.

<p><b><u>FXWindow::getLast()</u></b>
<p>This returns the last child of this window, if any.

<p><b><u>FXWindow::getNext()</u></b>
<p>This returns the next sibling of this window.  Use this function to iterate over
all windows which have a common parent.

<p><b><u>FXWindow::getPrev()</u></b>
<p>This returns the previous sibling of this window.
</blockquote><br>
<p>
<p>
<b>Querying Widget Tree Information</b>
<hr>
There are a number of common questions about the various possible relationships between
windows in the widget tree.  While it is possible to answer them with the API's above,
it is cumbersome and so a number of API's are available to make this more easy:<br><br>

<blockquote>
<b><u>FXWindow::isChildOf(window)</u></b>
<p>Determines if this window is a child of the given window.

<b><u>FXWindow::containsChild(window)</u></b>
<p>Determines if this window contains the given window as a child.

<b><u>FXWindow::containsChild(window)</u></b>
<p>Determines if this window contains the given window as a child; also returns TRUE
if the given window is the same as this window.

<b><u>FXWindow::numChildren()</u></b>
<p>Returns the number of children of this window by counting them.

<b><u>FXWindow::indexOfChild(window)</u></b>
<p>Returns the 0-based position of the given window in this window's list of children.
If the window is not a child of this window then it returns -1.

<b><u>FXWindow::childAtIndex(index)</u></b>
<p>Returns the child window at the given position, or NULL if the index is invalid.

<b><u>FXWindow::commonAncestor(window1,window2)</u></b>
<p>This function determines the lowest common ancestor of window1 and window2.
</blockquote><br>

<p>
<p>
<b>Primary,Clipboard, Drag and Drop Selections</b>
<hr>
Many widgets display some data.  For example, a text widget can display some text.
When the user highlights a range of text, a <b>primary selection</b> is in effect.
This primary selection can be obtained by other widgets, or even by other programs.
For instance a selection of some text may be pasted into a terminal by means of the
middle mouse button under X-Windows (under MS-Windows, the primary selection only
works within the same FOX program).
<p>
When a selection is <b>copied</b> or <b>cut</b> to the clipboard, a <b>clipboard-selection</b>
is in effect.  Usually, a clipboard selection is made by <b>Ctrl-C</b> for copy, or
a <b>Ctrl-X</b> for cut.
Again, other widgets or other programs can obtain this data from
the clipboard.  For instance, an application can obtain the  clipboard selection by
a <b>paste</b> operation, typically invoked by means of <b>Ctrl-V</b>.
<p>
Finally, when a drag operation is started from this widget, a
<b>drag-and-drop</b> selection is in effect.  <br>
Drag and drop selections are only in effect while a drag operation is ongoing.
In contrast, a clipboard or primary selection remains in effect until another
selection is made (possibly by another application).
<p>
The following API's pertain to the selections:<br><br>
<blockquote>
<b><u>FXWindow::hasSelection()</u></b>
<p>Return true if this window owns the primary selection.

<b><u>FXWindow::acquireSelection(types,FXuinumtypes)</u></b>
<p>Try to acquire the primary selection, given a list of drag types.
The list of drag types must have been previously registered by means of <a href=app.html#DRAGTYPE>FXApp::registerDragType()</a>.

</blockquote><br>

<!-- end main window content -->

    </td>
    <td bgcolor=#ffffff>&nbsp;</td>
    <td bgcolor=#557faa width=15>&nbsp;</td>
  </tr>
  <tr>
    <td colspan=2 bgcolor="#557faa" align=center>&nbsp;
     </td>
    <td bgcolor=#ffffff valign=bottom align=left><img src=art/ill.gif width=8 height=8></td>
    <td bgcolor=#ffffff>&nbsp;</td>
    <td bgcolor=#ffffff valign=bottom align=right><img src=art/ilr.gif width=8 height=8></td>
    <td bgcolor=#557faa width=15>&nbsp;</td>
  </tr>
  <tr>
    <td valign=bottom align=left bgcolor=#557faa><img src=art/oll.gif width=8 height=8></td>
    <td colspan=4 bgcolor=#557faa>&nbsp;</td>
    <td valign=bottom align=right bgcolor=#557faa><img src=art/olr.gif width=8 height=8></td>
  </tr>
</table>

<address>Copyright 1997-2002 <a href=mailto:jeroen@fox-toolkit.org>Jeroen van der Zijp</a></address>
<!-- Created: Mon Apr 10 11:20:32 CEST 2000 -->
<!-- hhmts start -->

<!-- hhmts end -->
</body>
</html>