Class: Fox::FXTopWindow
- Inherits:
-
FXShell
- Object
- FXObject
- FXId
- FXDrawable
- FXWindow
- FXComposite
- FXShell
- Fox::FXTopWindow
- Defined in:
- rdoc-sources/FXTopWindow.rb
Overview
Abstract base class for all top-level windows.
TopWindows are usually managed by a Window Manager under X11 and therefore borders and window-menus and other decorations like resize- handles are subject to the Window Manager’s interpretation of the decoration hints. When a TopWindow is closed, it sends a SEL_CLOSE message to its target. The target should return 0 in response to this message if there is no objection to proceed with the closing of the window, and return 1 otherwise. After the SEL_CLOSE message has been sent and no objection was raised, the window will delete itself. When the session is closed, the window will send a SEL_SESSION_NOTIFY message to its target, allowing the application to write any unsaved data to the disk. If the target returns 0, then the system will proceed to close the session. Subsequently a SEL_SESSION_CLOSED will be received which causes the window to be closed with prejudice by calling the function close(FALSE). When receiving a SEL_UPDATE, the target can update the title string of the window, so that the title of the window reflects the name of the document, for example. For convenience, TopWindow provides the same layout behavior as the Packer widget, as well as docking and undocking of toolbars. TopWindows can be owned by other windows, or be free-floating. Owned TopWindows will usually remain stacked on top of the owner windows. The lifetime of an owned window should not exceed that of the owner.
Events
The following messages are sent by FXTopWindow to its target:
SEL_MINIMIZE
-
sent when the user clicks the minimize button in the upper right-hand corner of the top-level window.
SEL_MAXIMIZE
-
sent when the user clicks the maximize button in the upper right-hand corner of the top-level window.
SEL_RESTORE
-
sent when the user clicks the restore button in the upper right-hand corner of the top-level window.
SEL_CLOSE
-
sent when the user clicks the close button in the upper right-hand corner of the top-level window.
SEL_SESSION_NOTIFY
:
sent when the session is closed.:
SEL_SESSION_CLOSED
-
sent after the session is closed.
Title and border decorations
DECOR_NONE
-
Borderless window
DECOR_TITLE
-
Window title
DECOR_MINIMIZE
-
Minimize button
DECOR_MAXIMIZE
-
Maximize button
DECOR_CLOSE
-
Close button
DECOR_BORDER
-
Border
DECOR_SHRINKABLE
-
Window can become smaller
DECOR_STRETCHABLE
-
Window can become larger
DECOR_RESIZE
-
Resize handles
DECOR_MENU
-
Window menu
DECOR_ALL
-
All of the above
Initial window placement
PLACEMENT_DEFAULT
-
Place it at the default size and location
PLACEMENT_VISIBLE
-
Place window to be fully visible
PLACEMENT_CURSOR
-
Place it under the cursor position
PLACEMENT_OWNER
-
Place it centered on its owner
PLACEMENT_SCREEN
-
Place it centered on the screen
PLACEMENT_MAXIMIZED
-
Place it maximized to the screen size
Message identifiers
ID_MAXIMIZE
-
Maximize the window
ID_MINIMIZE
-
Minimize the window
ID_RESTORE
-
Restore the window
ID_CLOSE
-
Close the window
ID_QUERY_DOCK
-
Toolbar asks to dock
Direct Known Subclasses
Instance Attribute Summary collapse
-
#decorations ⇒ Object
Title and border decorations (see above) [Integer].
-
#hSpacing ⇒ Object
Horizontal spacing between child widgets, in pixels [Integer].
-
#icon ⇒ Object
Window icon FXIcon.
-
#miniIcon ⇒ Object
Window mini (title) icon FXIcon.
-
#packingHints ⇒ Object
Packing hints for child widgets [Integer].
-
#padBottom ⇒ Object
Bottom padding, in pixels [Integer].
-
#padLeft ⇒ Object
Left padding, in pixels [Integer].
-
#padRight ⇒ Object
Right padding, in pixels [Integer].
-
#padTop ⇒ Object
Top padding, in pixels [Integer].
-
#title ⇒ Object
Window title [String].
-
#vSpacing ⇒ Object
Vertical spacing between child widgets, in pixels [Integer].
Attributes inherited from FXWindow
#accelTable, #backColor, #defaultCursor, #dragCursor, #first, #focus, #key, #last, #layoutHints, #next, #numChildren, #owner, #parent, #prev, #root, #selector, #shell, #target, #x, #y
Attributes inherited from FXDrawable
Attributes inherited from FXId
Instance Method Summary collapse
-
#close(notify = false) ⇒ Object
Close the window, return
true
if actually closed. -
#getWMBorders ⇒ Object
Obtain border sizes added to our window by the window manager.
-
#maximize(notify = false) ⇒ Object
Maximize window and return
true
if maximized. -
#maximized? ⇒ Boolean
Return
true
if window is maximized. -
#minimize(notify = false) ⇒ Object
Minimize or iconify window and return
true
if minimized. -
#minimized? ⇒ Boolean
Return
true
if window is minimized. -
#place(placement) ⇒ Object
Position the window based on placement (one of
PLACEMENT_DEFAULT
,PLACEMENT_VISIBLE
,PLACEMENT_CURSOR
,PLACEMENT_OWNER
,PLACEMENT_SCREEN
orPLACEMENT_MAXIMIZED
). -
#restore(notify = false) ⇒ Object
Restore window to normal and return
true
if restored. -
#show(placement) ⇒ Object
Show this window with given placement (one of
PLACEMENT_DEFAULT
,PLACEMENT_VISIBLE
,PLACEMENT_CURSOR
,PLACEMENT_OWNER
,PLACEMENT_SCREEN
orPLACEMENT_MAXIMIZED
).
Methods inherited from FXComposite
#initialize, #maxChildHeight, #maxChildWidth
Methods inherited from FXWindow
#acceptDrop, #acquireClipboard, #acquireSelection, #active?, #addHotKey, after?, #after?, before?, #before?, #beginDrag, #canFocus?, #changeFocus, #childAtIndex, #childOf?, #children, #clearDragRectangle, #clearShape, colorType, colorTypeName, commonAncestor, #composeContext, #composite?, #contains?, #containsChild?, #create, #createComposeContext, #cursorPosition, #default?, #defaultHeight, #defaultWidth, deleteType, deleteTypeName, #destroy, #destroyComposeContext, #detach, #didAccept, #disable, #doesSaveUnder?, #dragging?, #dropDisable, #dropEnable, #dropEnabled?, #dropFinished, #dropTarget?, #each_child, #each_child_recursive, #enable, #enabled?, #endDrag, #forceRefresh, #getChildAt, #getDNDData, #getHeightForWidth, #getWidthForHeight, #grab, #grabKeyboard, #grabbed?, #grabbedKeyboard?, #handleDrag, #hasClipboard?, #hasFocus?, #hasSelection?, #height, #height=, #hide, imageType, #inFocusChain?, #indexOfChild, #initial?, #initialize, #inquireDNDAction, #inquireDNDTypes, #killFocus, #layout, #linkAfter, #linkBefore, #lower, #move, octetType, octetTypeName, #offeredDNDType?, #position, #raiseWindow, #recalc, #releaseClipboard, #releaseSelection, #remHotKey, #removeChild, #repaint, #reparent, #resize, #scroll, #setCursorPosition, #setDNDData, #setDefault, #setDragRectangle, #setFocus, #setInitial, #setShape, #shell?, #shown?, stringType, textType, textTypeName, #tr, #translateCoordinatesFrom, #translateCoordinatesTo, #underCursor?, #ungrab, #ungrabKeyboard, #update, urilistType, urilistTypeName, utf16Type, utf16TypeName, utf8Type, utf8TypeName, #visible=, #width, #width=
Methods included from Responder2
Methods inherited from FXDrawable
Methods inherited from FXId
#create, #created?, #destroy, #detach, #runOnUiThread
Methods inherited from FXObject
#bind, #handle, #load, #save, subclasses
Constructor Details
This class inherits a constructor from Fox::FXComposite
Instance Attribute Details
#decorations ⇒ Object
Title and border decorations (see above) [Integer]
110 111 112 |
# File 'rdoc-sources/FXTopWindow.rb', line 110 def decorations @decorations end |
#hSpacing ⇒ Object
Horizontal spacing between child widgets, in pixels [Integer]
101 102 103 |
# File 'rdoc-sources/FXTopWindow.rb', line 101 def hSpacing @hSpacing end |
#icon ⇒ Object
Window icon Fox::FXIcon
113 114 115 |
# File 'rdoc-sources/FXTopWindow.rb', line 113 def icon @icon end |
#miniIcon ⇒ Object
Window mini (title) icon Fox::FXIcon
116 117 118 |
# File 'rdoc-sources/FXTopWindow.rb', line 116 def miniIcon @miniIcon end |
#packingHints ⇒ Object
Packing hints for child widgets [Integer]
107 108 109 |
# File 'rdoc-sources/FXTopWindow.rb', line 107 def packingHints @packingHints end |
#padBottom ⇒ Object
Bottom padding, in pixels [Integer]
92 93 94 |
# File 'rdoc-sources/FXTopWindow.rb', line 92 def padBottom @padBottom end |
#padLeft ⇒ Object
Left padding, in pixels [Integer]
95 96 97 |
# File 'rdoc-sources/FXTopWindow.rb', line 95 def padLeft @padLeft end |
#padRight ⇒ Object
Right padding, in pixels [Integer]
98 99 100 |
# File 'rdoc-sources/FXTopWindow.rb', line 98 def padRight @padRight end |
#padTop ⇒ Object
Top padding, in pixels [Integer]
89 90 91 |
# File 'rdoc-sources/FXTopWindow.rb', line 89 def padTop @padTop end |
#title ⇒ Object
Window title [String]
86 87 88 |
# File 'rdoc-sources/FXTopWindow.rb', line 86 def title @title end |
#vSpacing ⇒ Object
Vertical spacing between child widgets, in pixels [Integer]
104 105 106 |
# File 'rdoc-sources/FXTopWindow.rb', line 104 def vSpacing @vSpacing end |
Instance Method Details
#close(notify = false) ⇒ Object
Close the window, return true
if actually closed. If notify is true
, the target will receive a SEL_CLOSE
message to determine if it is OK to close the window. If the target ignores the SEL_CLOSE
message or returns 0, the window will be closed, and subsequently deleted. When the last main window has been closed, the application will receive an ID_QUIT
message and will be closed.
161 |
# File 'rdoc-sources/FXTopWindow.rb', line 161 def close(notify=false); end |
#getWMBorders ⇒ Object
Obtain border sizes added to our window by the window manager. Returns a 4-element array containing the left, right, top and bottom border sizes (in pixels).
128 |
# File 'rdoc-sources/FXTopWindow.rb', line 128 def getWMBorders(); end |
#maximize(notify = false) ⇒ Object
Maximize window and return true
if maximized. If notify is true
, sends a SEL_MAXIMIZE
message to its message target.
140 |
# File 'rdoc-sources/FXTopWindow.rb', line 140 def maximize(notify=false); end |
#maximized? ⇒ Boolean
Return true
if window is maximized.
131 |
# File 'rdoc-sources/FXTopWindow.rb', line 131 def maximized? ; end |
#minimize(notify = false) ⇒ Object
Minimize or iconify window and return true
if minimized. If notify is true
, sends a SEL_MINIMIZE
message to its message target.
146 |
# File 'rdoc-sources/FXTopWindow.rb', line 146 def minimize(notify=false); end |
#minimized? ⇒ Boolean
Return true
if window is minimized.
134 |
# File 'rdoc-sources/FXTopWindow.rb', line 134 def minimized? ; end |
#place(placement) ⇒ Object
Position the window based on placement (one of PLACEMENT_DEFAULT
, PLACEMENT_VISIBLE
, PLACEMENT_CURSOR
, PLACEMENT_OWNER
, PLACEMENT_SCREEN
or PLACEMENT_MAXIMIZED
).
124 |
# File 'rdoc-sources/FXTopWindow.rb', line 124 def place(placement) ; end |
#restore(notify = false) ⇒ Object
Restore window to normal and return true
if restored. If notify is true
, sends a SEL_RESTORE
message to its message target.
152 |
# File 'rdoc-sources/FXTopWindow.rb', line 152 def restore(notify=false); end |
#show(placement) ⇒ Object
Show this window with given placement (one of PLACEMENT_DEFAULT
, PLACEMENT_VISIBLE
, PLACEMENT_CURSOR
, PLACEMENT_OWNER
, PLACEMENT_SCREEN
or PLACEMENT_MAXIMIZED
).
120 |
# File 'rdoc-sources/FXTopWindow.rb', line 120 def show(placement) ; end |