![]() |
Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members
![]() |
00001 /******************************************************************************** 00002 * * 00003 * W i n d o w O b j e c t * 00004 * * 00005 ********************************************************************************* 00006 * Copyright (C) 1997,2002 by Jeroen van der Zijp. All Rights Reserved. * 00007 ********************************************************************************* 00008 * This library is free software; you can redistribute it and/or * 00009 * modify it under the terms of the GNU Lesser General Public * 00010 * License as published by the Free Software Foundation; either * 00011 * version 2.1 of the License, or (at your option) any later version. * 00012 * * 00013 * This library is distributed in the hope that it will be useful, * 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00016 * Lesser General Public License for more details. * 00017 * * 00018 * You should have received a copy of the GNU Lesser General Public * 00019 * License along with this library; if not, write to the Free Software * 00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * 00021 ********************************************************************************* 00022 * $Id: FXWindow.h,v 1.80 2002/01/18 22:42:55 jeroen Exp $ * 00023 ********************************************************************************/ 00024 #ifndef FXWINDOW_H 00025 #define FXWINDOW_H 00026 00027 #ifndef FXDRAWABLE_H 00028 #include "FXDrawable.h" 00029 #endif 00030 00031 00032 00033 /// Layout hints for child widgets 00034 enum { 00035 LAYOUT_NORMAL = 0, /// Default layout mode 00036 LAYOUT_SIDE_TOP = 0, /// Pack on top side (default) 00037 LAYOUT_SIDE_BOTTOM = 0x00000001, /// Pack on bottom side 00038 LAYOUT_SIDE_LEFT = 0x00000002, /// Pack on left side 00039 LAYOUT_SIDE_RIGHT = LAYOUT_SIDE_LEFT|LAYOUT_SIDE_BOTTOM, /// Pack on right side 00040 LAYOUT_FILL_COLUMN = 0x00000001, /// Matrix column is stretchable 00041 LAYOUT_FILL_ROW = 0x00000002, /// Matrix row is stretchable 00042 LAYOUT_LEFT = 0, /// Stick on left (default) 00043 LAYOUT_RIGHT = 0x00000004, /// Stick on right 00044 LAYOUT_CENTER_X = 0x00000008, /// Center horizontally 00045 LAYOUT_FIX_X = LAYOUT_RIGHT|LAYOUT_CENTER_X, /// X fixed 00046 LAYOUT_TOP = 0, /// Stick on top (default) 00047 LAYOUT_BOTTOM = 0x00000010, /// Stick on bottom 00048 LAYOUT_CENTER_Y = 0x00000020, /// Center vertically 00049 LAYOUT_FIX_Y = LAYOUT_BOTTOM|LAYOUT_CENTER_Y, /// Y fixed 00050 LAYOUT_RESERVED_1 = 0x00000040, 00051 LAYOUT_RESERVED_2 = 0x00000080, 00052 LAYOUT_FIX_WIDTH = 0x00000100, /// Width fixed 00053 LAYOUT_FIX_HEIGHT = 0x00000200, /// height fixed 00054 LAYOUT_MIN_WIDTH = 0, /// Minimum width is the default 00055 LAYOUT_MIN_HEIGHT = 0, /// Minimum height is the default 00056 LAYOUT_FILL_X = 0x00000400, /// Stretch or shrink horizontally 00057 LAYOUT_FILL_Y = 0x00000800, /// Stretch or shrink vertically 00058 LAYOUT_EXPLICIT = LAYOUT_FIX_X|LAYOUT_FIX_Y|LAYOUT_FIX_WIDTH|LAYOUT_FIX_HEIGHT /// Explicit placement 00059 }; 00060 00061 00062 /// Frame border appearance styles (for subclasses) 00063 enum { 00064 FRAME_NONE = 0, /// Default is no frame 00065 FRAME_SUNKEN = 0x00001000, /// Sunken border 00066 FRAME_RAISED = 0x00002000, /// Raised border 00067 FRAME_THICK = 0x00004000, /// Thick border 00068 FRAME_GROOVE = FRAME_THICK, /// A groove or etched-in border 00069 FRAME_RIDGE = FRAME_THICK|FRAME_RAISED|FRAME_SUNKEN, /// A ridge or embossed border 00070 FRAME_LINE = FRAME_RAISED|FRAME_SUNKEN, /// Simple line border 00071 FRAME_NORMAL = FRAME_SUNKEN|FRAME_THICK /// Regular raised/thick border 00072 }; 00073 00074 00075 /// Packing style (for packers) 00076 enum { 00077 PACK_NORMAL = 0, /// Default is each its own size 00078 PACK_UNIFORM_HEIGHT = 0x00008000, /// Uniform height 00079 PACK_UNIFORM_WIDTH = 0x00010000 /// Uniform width 00080 }; 00081 00082 00083 class FXCursor; 00084 class FXAccelTable; 00085 class FXComposite; 00086 00087 00088 /// Base class for all windows 00089 class FXAPI FXWindow : public FXDrawable { 00090 FXDECLARE(FXWindow) 00091 private: 00092 FXWindow *parent; // Parent Window 00093 FXWindow *owner; // Owner Window 00094 FXWindow *first; // First Child 00095 FXWindow *last; // Last Child 00096 FXWindow *next; // Next Sibling 00097 FXWindow *prev; // Previous Sibling 00098 FXWindow *focus; // Focus Child 00099 FXuint wk; // Window Key 00100 protected: 00101 FXCursor *defaultCursor; // Normal Cursor 00102 FXCursor *dragCursor; // Cursor during drag 00103 FXAccelTable *accelTable; // Accelerator table 00104 FXObject *target; // Target object 00105 FXSelector message; // Message ID 00106 FXint xpos; // Window X Position 00107 FXint ypos; // Window Y Position 00108 FXColor backColor; // Window background color 00109 FXuint flags; // Window state flags 00110 FXuint options; // Window options 00111 public: 00112 00113 // Common DND types 00114 static FXDragType deleteType; // Delete request 00115 static FXDragType textType; // Ascii text request 00116 static FXDragType stringType; // Clipboard text type (pre-registered) 00117 static FXDragType colorType; // Color 00118 static FXDragType urilistType; // URI List 00119 00120 protected: 00121 #ifdef WIN32 00122 virtual FXID GetDC() const; 00123 virtual int ReleaseDC(FXID) const; 00124 virtual const char* GetClass() const; 00125 #else 00126 void addColormapWindows(); 00127 void remColormapWindows(); 00128 #endif 00129 00130 protected: 00131 FXWindow(); 00132 FXWindow(FXApp* a,FXVisual *vis); 00133 FXWindow(FXApp* a,FXWindow* own,FXuint opts,FXint x,FXint y,FXint w,FXint h); 00134 static FXWindow* findDefault(FXWindow* window); 00135 static FXWindow* findInitial(FXWindow* window); 00136 virtual FXbool doesOverrideRedirect() const; 00137 virtual void layout(); 00138 private: 00139 FXWindow(const FXWindow&); 00140 FXWindow& operator=(const FXWindow&); 00141 00142 protected: 00143 00144 // Window state flags 00145 enum { 00146 FLAG_SHOWN = 0x00000001, // Is shown 00147 FLAG_ENABLED = 0x00000002, // Able to receive input 00148 FLAG_UPDATE = 0x00000004, // Is subject to GUI update 00149 FLAG_DROPTARGET = 0x00000008, // Drop target 00150 FLAG_FOCUSED = 0x00000010, // Has focus 00151 FLAG_DIRTY = 0x00000020, // Needs layout 00152 FLAG_RECALC = 0x00000040, // Needs recalculation 00153 FLAG_TIP = 0x00000080, // Show tip 00154 FLAG_HELP = 0x00000100, // Show help 00155 FLAG_DEFAULT = 0x00000200, // Default widget 00156 FLAG_INITIAL = 0x00000400, // Initial widget 00157 FLAG_SHELL = 0x00000800, // Shell window 00158 FLAG_ACTIVE = 0x00001000, // Window is active 00159 FLAG_PRESSED = 0x00002000, // Button has been pressed 00160 FLAG_KEY = 0x00004000, // Keyboard key pressed 00161 FLAG_CARET = 0x00008000, // Caret is on 00162 FLAG_CHANGED = 0x00010000, // Window data changed 00163 FLAG_LASSO = 0x00020000, // Lasso mode 00164 FLAG_TRYDRAG = 0x00040000, // Tentative drag mode 00165 FLAG_DODRAG = 0x00080000, // Doing drag mode 00166 FLAG_SCROLLINSIDE = 0x00100000, // Scroll only when inside 00167 FLAG_SCROLLING = 0x00200000 // Right mouse scrolling 00168 }; 00169 00170 public: 00171 00172 // Message handlers 00173 long onPaint(FXObject*,FXSelector,void*); 00174 long onMap(FXObject*,FXSelector,void*); 00175 long onUnmap(FXObject*,FXSelector,void*); 00176 long onConfigure(FXObject*,FXSelector,void*); 00177 long onUpdate(FXObject*,FXSelector,void*); 00178 long onMotion(FXObject*,FXSelector,void*); 00179 long onMouseWheel(FXObject*,FXSelector,void*); 00180 long onEnter(FXObject*,FXSelector,void*); 00181 long onLeave(FXObject*,FXSelector,void*); 00182 long onLeftBtnPress(FXObject*,FXSelector,void*); 00183 long onLeftBtnRelease(FXObject*,FXSelector,void*); 00184 long onMiddleBtnPress(FXObject*,FXSelector,void*); 00185 long onMiddleBtnRelease(FXObject*,FXSelector,void*); 00186 long onRightBtnPress(FXObject*,FXSelector,void*); 00187 long onRightBtnRelease(FXObject*,FXSelector,void*); 00188 long onBeginDrag(FXObject*,FXSelector,void*); 00189 long onEndDrag(FXObject*,FXSelector,void*); 00190 long onDragged(FXObject*,FXSelector,void*); 00191 long onKeyPress(FXObject*,FXSelector,void*); 00192 long onKeyRelease(FXObject*,FXSelector,void*); 00193 long onUngrabbed(FXObject*,FXSelector,void*); 00194 long onDestroy(FXObject*,FXSelector,void*); 00195 long onFocusSelf(FXObject*,FXSelector,void*); 00196 long onFocusIn(FXObject*,FXSelector,void*); 00197 long onFocusOut(FXObject*,FXSelector,void*); 00198 long onSelectionLost(FXObject*,FXSelector,void*); 00199 long onSelectionGained(FXObject*,FXSelector,void*); 00200 long onSelectionRequest(FXObject*,FXSelector,void*); 00201 long onClipboardLost(FXObject*,FXSelector,void*); 00202 long onClipboardGained(FXObject*,FXSelector,void*); 00203 long onClipboardRequest(FXObject*,FXSelector,void*); 00204 long onDNDEnter(FXObject*,FXSelector,void*); 00205 long onDNDLeave(FXObject*,FXSelector,void*); 00206 long onDNDMotion(FXObject*,FXSelector,void*); 00207 long onDNDDrop(FXObject*,FXSelector,void*); 00208 long onDNDRequest(FXObject*,FXSelector,void*); 00209 long onCmdShow(FXObject*,FXSelector,void*); 00210 long onCmdHide(FXObject*,FXSelector,void*); 00211 long onUpdToggleShown(FXObject*,FXSelector,void*); 00212 long onCmdToggleShown(FXObject*,FXSelector,void*); 00213 long onCmdRaise(FXObject*,FXSelector,void*); 00214 long onCmdLower(FXObject*,FXSelector,void*); 00215 long onCmdEnable(FXObject*,FXSelector,void*); 00216 long onCmdDisable(FXObject*,FXSelector,void*); 00217 long onCmdUpdate(FXObject*,FXSelector,void*); 00218 long onUpdYes(FXObject*,FXSelector,void*); 00219 long onCmdDelete(FXObject*,FXSelector,void*); 00220 00221 public: 00222 00223 // Message ID's common to most Windows 00224 enum { 00225 ID_NONE, 00226 ID_HIDE, 00227 ID_SHOW, 00228 ID_TOGGLESHOWN, 00229 ID_LOWER, 00230 ID_RAISE, 00231 ID_DELETE, 00232 ID_DISABLE, 00233 ID_ENABLE, 00234 ID_UNCHECK, 00235 ID_CHECK, 00236 ID_UNKNOWN, 00237 ID_UPDATE, 00238 ID_AUTOSCROLL, 00239 ID_HSCROLLED, 00240 ID_VSCROLLED, 00241 ID_SETVALUE, 00242 ID_SETINTVALUE, 00243 ID_SETREALVALUE, 00244 ID_SETSTRINGVALUE, 00245 ID_SETINTRANGE, 00246 ID_SETREALRANGE, 00247 ID_GETINTVALUE, 00248 ID_GETREALVALUE, 00249 ID_GETSTRINGVALUE, 00250 ID_GETINTRANGE, 00251 ID_GETREALRANGE, 00252 ID_QUERY_TIP, 00253 ID_QUERY_HELP, 00254 ID_QUERY_MENU, 00255 ID_HOTKEY, 00256 ID_ACCEL, 00257 ID_UNPOST, 00258 ID_POST, 00259 ID_MDI_TILEHORIZONTAL, 00260 ID_MDI_TILEVERTICAL, 00261 ID_MDI_CASCADE, 00262 ID_MDI_MAXIMIZE, 00263 ID_MDI_MINIMIZE, 00264 ID_MDI_RESTORE, 00265 ID_MDI_CLOSE, 00266 ID_MDI_WINDOW, 00267 ID_MDI_MENUWINDOW, 00268 ID_MDI_MENUMINIMIZE, 00269 ID_MDI_MENURESTORE, 00270 ID_MDI_MENUCLOSE, 00271 ID_MDI_NEXT, 00272 ID_MDI_PREV, 00273 ID_CLOSE_DOCUMENT, 00274 ID_CLOSE_ALL_DOCUMENTS, 00275 ID_LAST 00276 }; 00277 00278 public: 00279 00280 // Common DND type names 00281 static const FXchar deleteTypeName[]; 00282 static const FXchar textTypeName[]; 00283 static const FXchar colorTypeName[]; 00284 static const FXchar urilistTypeName[]; 00285 00286 public: 00287 00288 /// Constructor 00289 FXWindow(FXComposite* p,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0); 00290 00291 /// Return a pointer to the parent window 00292 FXWindow* getParent() const { return parent; } 00293 00294 /// Return a pointer to the owner window 00295 FXWindow* getOwner() const { return owner; } 00296 00297 /// Return a pointer to the shell window 00298 FXWindow* getShell() const; 00299 00300 /// Return a pointer to the root window 00301 FXWindow* getRoot() const; 00302 00303 /// Return a pointer to the next (sibling) window, if any 00304 FXWindow* getNext() const { return next; } 00305 00306 /// Return a pointer to the previous (sibling) window , if any 00307 FXWindow* getPrev() const { return prev; } 00308 00309 /// Return a pointer to this window's first child window , if any 00310 FXWindow* getFirst() const { return first; } 00311 00312 /// Return a pointer to this window's last child window, if any 00313 FXWindow* getLast() const { return last; } 00314 00315 /// Return a pointer to the currently focused child window 00316 FXWindow* getFocus() const { return focus; } 00317 00318 /// Change window key 00319 void setKey(FXuint k){ wk=k; } 00320 00321 /// Return window key 00322 FXuint getKey() const { return wk; } 00323 00324 /// Set the message target object for this window 00325 void setTarget(FXObject *t){ target=t; } 00326 00327 /// Get the message target object for this window, if any 00328 FXObject* getTarget() const { return target; } 00329 00330 /// Set the message identifier for this window 00331 void setSelector(FXSelector sel){ message=sel; } 00332 00333 /// Get the message identifier for this window 00334 FXSelector getSelector() const { return message; } 00335 00336 /// Get this window's x-coordinate, in the parent's coordinate system 00337 FXint getX() const { return xpos; } 00338 00339 /// Get this window's y-coordinate, in the parent's coordinate system 00340 FXint getY() const { return ypos; } 00341 00342 /// Return the default width of this window 00343 virtual FXint getDefaultWidth(); 00344 00345 /// Return the default height of this window 00346 virtual FXint getDefaultHeight(); 00347 00348 /// Return width for given height 00349 virtual FXint getWidthForHeight(FXint givenheight); 00350 00351 /// Return height for given width 00352 virtual FXint getHeightForWidth(FXint givenwidth); 00353 00354 /// Set this window's x-coordinate, in the parent's coordinate system 00355 void setX(FXint x); 00356 00357 /// Set this window's y-coordinate, in the parent's coordinate system 00358 void setY(FXint y); 00359 00360 /// Set the window width 00361 void setWidth(FXint w); 00362 00363 /// Set the window height 00364 void setHeight(FXint h); 00365 00366 /// Set layout hints for this window 00367 void setLayoutHints(FXuint lout); 00368 00369 /// Get layout hints for this window 00370 FXuint getLayoutHints() const; 00371 00372 /// Return a pointer to the accelerator table 00373 FXAccelTable* getAccelTable() const { return accelTable; } 00374 00375 /// Set the accelerator table 00376 void setAccelTable(FXAccelTable* acceltable){ accelTable=acceltable; } 00377 00378 /// Add a hot key 00379 void addHotKey(FXHotKey code); 00380 00381 /// Remove a hot key 00382 void remHotKey(FXHotKey code); 00383 00384 /// Return true if window is a shell window 00385 FXbool isShell() const; 00386 00387 /// Return true if specified window is this window's parent 00388 FXbool isChildOf(const FXWindow* window) const; 00389 00390 /// Return true if specified window is a child of this window 00391 FXbool containsChild(const FXWindow* child) const; 00392 00393 /// Return the child window at specified coordinates 00394 FXWindow* getChildAt(FXint x,FXint y) const; 00395 00396 /// Return the number of child windows for this window 00397 FXint numChildren() const; 00398 00399 /** 00400 * Return the index (starting from zero) of the specified child window, 00401 * or -1 if the window is not a child or NULL 00402 */ 00403 FXint indexOfChild(const FXWindow *window) const; 00404 00405 /** 00406 * Return the child window at specified index, 00407 * or NULL if the index is negative or out of range 00408 */ 00409 FXWindow* childAtIndex(FXint index) const; 00410 00411 /// Return the common ancestor of window a and window b 00412 static FXWindow* commonAncestor(FXWindow* a,FXWindow* b); 00413 00414 /// Set the default cursor for this window 00415 void setDefaultCursor(FXCursor* cur); 00416 00417 /// Return the default cursor for this window 00418 FXCursor* getDefaultCursor() const { return defaultCursor; } 00419 00420 /// Set the drag cursor for this window 00421 void setDragCursor(FXCursor* cur); 00422 00423 /// Return the drag cursor for this window 00424 FXCursor* getDragCursor() const { return dragCursor; } 00425 00426 /// Return the cursor position and mouse button-state 00427 FXint getCursorPosition(FXint& x,FXint& y,FXuint& buttons) const; 00428 00429 /// Warp the cursor to the new position 00430 FXint setCursorPosition(FXint x,FXint y); 00431 00432 /// Return true if this window is able to receive mouse and keyboard events 00433 FXbool isEnabled() const; 00434 00435 /// Return true if the window is active 00436 FXbool isActive() const; 00437 00438 /// Return true if this window is a control capable of receiving the focus 00439 virtual FXbool canFocus() const; 00440 00441 /// Return true if this window has the focus 00442 FXbool hasFocus() const; 00443 00444 /// Move the focus to this window 00445 virtual void setFocus(); 00446 00447 /// Remove the focus from this window 00448 virtual void killFocus(); 00449 00450 /** 00451 * This changes the default window which responds to the Return 00452 * key in a dialog. If enable is TRUE, this window becomes the default 00453 * window; when enable is FALSE, this window will be no longer the 00454 * default window. Finally, when enable is MAYBE, the default window 00455 * will revert to the initial default window. 00456 */ 00457 virtual void setDefault(FXbool enable=TRUE); 00458 00459 /// Return true if this is the default window 00460 FXbool isDefault() const; 00461 00462 /// Make this window the initial default window 00463 void setInitial(FXbool enable=TRUE); 00464 00465 /// Return true if this is the initial default window 00466 FXbool isInitial() const; 00467 00468 /// Enable the window to receive mouse and keyboard events 00469 virtual void enable(); 00470 00471 /// Disable the window from receiving mouse and keyboard events 00472 virtual void disable(); 00473 00474 /// Create all of the server-side resources for this window 00475 virtual void create(); 00476 00477 /// Detach the server-side resources for this window 00478 virtual void detach(); 00479 00480 /// Destroy the server-side resources for this window 00481 virtual void destroy(); 00482 00483 /// Raise this window to the top of the stacking order 00484 virtual void raise(); 00485 00486 /// Lower this window to the bottom of the stacking order 00487 virtual void lower(); 00488 00489 /// Move this window to the specified position in the parent's coordinates 00490 virtual void move(FXint x,FXint y); 00491 00492 /// Resize this window to the specified width and height 00493 virtual void resize(FXint w,FXint h); 00494 00495 /// Move and resize this window in the parent's coordinates 00496 virtual void position(FXint x,FXint y,FXint w,FXint h); 00497 00498 /// Mark this window's layout as dirty 00499 virtual void recalc(); 00500 00501 /// Force a GUI update of this window and its children 00502 void forceRefresh(); 00503 00504 /// Change the parent for this window 00505 virtual void reparent(FXWindow* newparent); 00506 00507 /// Scroll rectangle x,y,w,h by a shift of dx,dy 00508 void scroll(FXint x,FXint y,FXint w,FXint h,FXint dx,FXint dy); 00509 00510 /// Mark the specified rectangle dirty, i.e. to be repainted 00511 void update(FXint x,FXint y,FXint w,FXint h); 00512 00513 /// Mark the entire window client area dirty 00514 void update(); 00515 00516 /// If marked but not yet painted, paint the given area 00517 void repaint(FXint x,FXint y,FXint w,FXint h); 00518 00519 /// If marked but not yet painted, paint the entire window 00520 void repaint(); 00521 00522 /** 00523 * Grab the mouse to this window; future mouse events will be 00524 * reported to this window even while the cursor goes outside of this window 00525 */ 00526 void grab(); 00527 00528 /// Release the mouse grab 00529 void ungrab(); 00530 00531 /// Return true if the window has been grabbed 00532 FXbool grabbed() const; 00533 00534 /// Grab keyboard device 00535 void grabKeyboard(); 00536 00537 /// Ungrab keyboard device 00538 void ungrabKeyboard(); 00539 00540 /// Return true if active grab is in effect 00541 FXbool grabbedKeyboard() const; 00542 00543 /// Show this window 00544 virtual void show(); 00545 00546 /// Hide this window 00547 virtual void hide(); 00548 00549 /// Return true if the window is shown 00550 FXbool shown() const; 00551 00552 /// Return true if the window is composite 00553 virtual FXbool isComposite() const; 00554 00555 /// Return true if the window is under the cursor 00556 FXbool underCursor() const; 00557 00558 /// Return true if this window owns the primary selection 00559 FXbool hasSelection() const; 00560 00561 /// Try to acquire the primary selection, given a list of drag types 00562 FXbool acquireSelection(const FXDragType *types,FXuint numtypes); 00563 00564 /// Release the primary selection 00565 FXbool releaseSelection(); 00566 00567 /// Return true if this window owns the clipboard 00568 FXbool hasClipboard() const; 00569 00570 /// Try to acquire the clipboard, given a list of drag types 00571 FXbool acquireClipboard(const FXDragType *types,FXuint numtypes); 00572 00573 /// Release the clipboard 00574 FXbool releaseClipboard(); 00575 00576 /// Enable this window to receive drops 00577 void dropEnable(); 00578 00579 /// Disable this window from receiving drops 00580 void dropDisable(); 00581 00582 /// Return true if this window is able to receive drops 00583 FXbool isDropEnabled() const; 00584 00585 /// Return true if a drag operaion has been initiated from this window 00586 FXbool isDragging() const; 00587 00588 /// Initiate a drag operation with a list of previously registered drag types 00589 FXbool beginDrag(const FXDragType *types,FXuint numtypes); 00590 00591 /** 00592 * When dragging, inform the drop-target of the new position and 00593 * the drag action 00594 */ 00595 FXbool handleDrag(FXint x,FXint y,FXDragAction action=DRAG_COPY); 00596 00597 /// Terminate the drag operation with or without actually dropping the data 00598 FXbool endDrag(FXbool drop=TRUE); 00599 00600 /// Return true if this window is the target of a drop 00601 FXbool isDropTarget() const; 00602 00603 /** 00604 * When being dragged over, indicate that no further SEL_DND_MOTION messages 00605 * are required while the cursor is inside the given rectangle 00606 */ 00607 void setDragRectangle(FXint x,FXint y,FXint w,FXint h,FXbool wantupdates=TRUE); 00608 00609 /** 00610 * When being dragged over, indicate we want to receive SEL_DND_MOTION messages 00611 * every time the cursor moves 00612 */ 00613 void clearDragRectangle(); 00614 00615 /// When being dragged over, indicate acceptance or rejection of the dragged data 00616 void acceptDrop(FXDragAction action=DRAG_ACCEPT); 00617 00618 /// The target accepted our drop 00619 FXDragAction didAccept() const; 00620 00621 /// When being dragged over, inquire the drag types which are being offered 00622 FXbool inquireDNDTypes(FXDNDOrigin origin,FXDragType*& types,FXuint& numtypes); 00623 00624 /// When being dragged over, return true if we are offered the given drag type 00625 FXbool offeredDNDType(FXDNDOrigin origin,FXDragType type); 00626 00627 /// When being dragged over, return the drag action 00628 FXDragAction inquireDNDAction() const; 00629 00630 /** 00631 * Set DND data; the array must be allocated with FXMALLOC and ownership is 00632 * transferred to the system 00633 */ 00634 FXbool setDNDData(FXDNDOrigin origin,FXDragType type,FXuchar* data,FXuint size); 00635 00636 /** 00637 * Get DND data; the caller becomes the owner of the array and must free it 00638 * with FXFREE 00639 */ 00640 FXbool getDNDData(FXDNDOrigin origin,FXDragType type,FXuchar*& data,FXuint& size); 00641 00642 /// Return true if window logically contains the given point 00643 virtual FXbool contains(FXint parentx,FXint parenty) const; 00644 00645 /// Translate coordinates from fromwindow's coordinate space to this window's coordinate space 00646 void translateCoordinatesFrom(FXint& tox,FXint& toy,const FXWindow* fromwindow,FXint fromx,FXint fromy) const; 00647 00648 /// Translate coordinates from this window's coordinate space to towindow's coordinate space 00649 void translateCoordinatesTo(FXint& tox,FXint& toy,const FXWindow* towindow,FXint fromx,FXint fromy) const; 00650 00651 /// Set window background color 00652 virtual void setBackColor(FXColor clr); 00653 00654 /// Get background color 00655 FXColor getBackColor() const { return backColor; } 00656 00657 /// Relink this window before sibling in the window list 00658 void linkBefore(FXWindow* sibling); 00659 00660 /// Relink this window after sibling in the window list 00661 void linkAfter(FXWindow* sibling); 00662 00663 virtual FXbool doesSaveUnder() const; 00664 00665 /// Save window to stream 00666 virtual void save(FXStream& store) const; 00667 00668 /// Restore window from stream 00669 virtual void load(FXStream& store); 00670 00671 /// Destroy window 00672 virtual ~FXWindow(); 00673 }; 00674 00675 00676 #endif