Class: Fox::FXTopWindow

Inherits:
FXShell show all
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

Instance Attribute Summary collapse

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

#height, #visual, #width

Attributes inherited from FXId

#app, #userData, #xid

Instance Method Summary collapse

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

#connect

Methods inherited from FXDrawable

#resize

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

#decorationsObject

Title and border decorations (see above) [Integer]


110
111
112
# File 'rdoc-sources/FXTopWindow.rb', line 110

def decorations
  @decorations
end

#hSpacingObject

Horizontal spacing between child widgets, in pixels [Integer]


101
102
103
# File 'rdoc-sources/FXTopWindow.rb', line 101

def hSpacing
  @hSpacing
end

#iconObject

Window icon Fox::FXIcon


113
114
115
# File 'rdoc-sources/FXTopWindow.rb', line 113

def icon
  @icon
end

#miniIconObject

Window mini (title) icon Fox::FXIcon


116
117
118
# File 'rdoc-sources/FXTopWindow.rb', line 116

def miniIcon
  @miniIcon
end

#packingHintsObject

Packing hints for child widgets [Integer]


107
108
109
# File 'rdoc-sources/FXTopWindow.rb', line 107

def packingHints
  @packingHints
end

#padBottomObject

Bottom padding, in pixels [Integer]


92
93
94
# File 'rdoc-sources/FXTopWindow.rb', line 92

def padBottom
  @padBottom
end

#padLeftObject

Left padding, in pixels [Integer]


95
96
97
# File 'rdoc-sources/FXTopWindow.rb', line 95

def padLeft
  @padLeft
end

#padRightObject

Right padding, in pixels [Integer]


98
99
100
# File 'rdoc-sources/FXTopWindow.rb', line 98

def padRight
  @padRight
end

#padTopObject

Top padding, in pixels [Integer]


89
90
91
# File 'rdoc-sources/FXTopWindow.rb', line 89

def padTop
  @padTop
end

#titleObject

Window title [String]


86
87
88
# File 'rdoc-sources/FXTopWindow.rb', line 86

def title
  @title
end

#vSpacingObject

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

#getWMBordersObject

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.

Returns:

  • (Boolean)

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.

Returns:

  • (Boolean)

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