1/* 2 * Copyright 2011-2013 Haiku, Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * John Scipione, jscipione@gmail.com 7 * 8 * Corresponds to: 9 * headers/os/interface/Window.h hrev45799 10 * src/kits/interface/Window.cpp hrev45799 11 */ 12 13 14/*! 15 \file Window.h 16 \ingroup interface 17 \ingroup libbe 18 \brief BWindow class definition and support data structures. 19*/ 20 21 22// window_type 23 24 25/*! 26 \enum window_type 27 \ingroup interface 28 29 Combined window look and feel constants. Define both the appearance and 30 behavior of a window. 31*/ 32 33 34/*! 35 \var window_type B_UNTYPED_WINDOW 36 37 A window of unknown or undefined type. 38*/ 39 40 41/*! 42 \var window_type B_TITLED_WINDOW 43 44 \c B_TITLED_WINDOW_LOOK and \c B_NORMAL_WINDOW_FEEL. 45*/ 46 47 48/*! 49 \var window_type B_MODAL_WINDOW 50 51 \c B_MODAL_WINDOW_LOOK and \c B_MODAL_APP_WINDOW_FEEL. 52*/ 53 54 55/*! 56 \var window_type B_DOCUMENT_WINDOW 57 58 \c B_DOCUMENT_WINDOW_LOOK and \c B_NORMAL_WINDOW_FEEL. 59*/ 60 61 62/*! 63 \var window_type B_BORDERED_WINDOW 64 65 \c B_BORDERED_WINDOW_LOOK and \c B_NORMAL_WINDOW_FEEL. 66*/ 67 68 69/*! 70 \var window_type B_FLOATING_WINDOW 71 72 \c B_FLOATING_WINDOW_LOOK and \c B_FLOATING_APP_WINDOW_FEEL. 73*/ 74 75 76// window_look 77 78 79/*! 80 \enum window_look 81 \ingroup interface 82 83 Window look constants, define window appearance. 84*/ 85 86 87/*! 88 \var window_look B_BORDERED_WINDOW_LOOK 89 90 No title bar, thin border, no resize control. 91*/ 92 93 94/*! 95 \var window_look B_NO_BORDER_WINDOW_LOOK 96 97 A borderless rectangle with no provisions to move or close the window. 98*/ 99 100 101/*! 102 \var window_look B_TITLED_WINDOW_LOOK 103 104 Like \c B_DOCUMENT_WINDOW_LOOK, but with a resize corner instead of a resize 105 thumb. 106*/ 107 108 109/*! 110 \var window_look B_DOCUMENT_WINDOW_LOOK 111 112 Large title bar, thick border, draggable resize corner thumb. 113*/ 114 115 116/*! 117 \var window_look B_MODAL_WINDOW_LOOK 118 119 For modal dialogs: no title bar, thick border, resize corner depending on the 120 \c B_NOT_RESIZABLE flag. 121*/ 122 123 124/*! 125 \var window_look B_FLOATING_WINDOW_LOOK 126 127 For floating sub windows: small title bar, thin border, resize corner. 128*/ 129 130 131// window_feel 132 133 134/*! 135 \enum window_feel 136 \ingroup interface 137 138 Window feel constants, define window behavior. 139*/ 140 141 142/*! 143 \var window_feel B_NORMAL_WINDOW_FEEL 144 145 Behaves like a normal, non-modal, non-floating window. 146*/ 147 148 149/*! 150 \var window_feel B_MODAL_SUBSET_WINDOW_FEEL 151 152 Blocks all windows in its subset when displayed. Visible only if a window in 153 its subset is visible. 154*/ 155 156 157/*! 158 \var window_feel B_MODAL_APP_WINDOW_FEEL 159 160 Blocks all windows in its app when displayed. Visible only if a window in its 161 app is visible. 162*/ 163 164 165/*! 166 \var window_feel B_MODAL_ALL_WINDOW_FEEL 167 168 Blocks all windows across the entire system when displayed. Always visible 169 in all workspaces. 170*/ 171 172 173/*! 174 \var window_feel B_FLOATING_SUBSET_WINDOW_FEEL 175 176 Floats above all windows in its subset when displayed. Visible only if a 177 window in its subset is the frontmost window. 178*/ 179 180 181/*! 182 \var window_feel B_FLOATING_APP_WINDOW_FEEL 183 184 Floats above all windows in its app when displayed. Visible only if a 185 window in its app is the frontmost window. 186*/ 187 188 189/*! 190 \var window_feel B_FLOATING_ALL_WINDOW_FEEL 191 192 Floats above all windows across the entire system when displayed. Always 193 visible in all workspaces. 194*/ 195 196 197// window_alignment 198 199 200/*! 201 \enum window_alignment 202 \ingroup interface 203 204 Define window alignment. 205*/ 206 207 208/*! 209 \var window_alignment B_BYTE_ALIGNMENT 210 211 Aligns window in terms of frame buffer offsets. Affects only horizontal 212 origin and width, can't align right and bottom edges in this mode. 213*/ 214 215 216/*! 217 \var window_alignment B_PIXEL_ALIGNMENT 218 219 Aligns window in pixel coordinates. 220*/ 221 222 223// window flags 224 225 226/*! 227 \var B_NOT_MOVABLE 228 229 Window cannot be moved by the user. 230*/ 231 232 233/*! 234 \var B_NOT_CLOSABLE 235 236 Window cannot be closed by the user, no close button is displayed. 237*/ 238 239 240/*! 241 \var B_NOT_ZOOMABLE 242 243 Window cannot be zoomed by the user, no zoom button is displayed. 244*/ 245 246 247/*! 248 \var B_NOT_MINIMIZABLE 249 250 Window cannot be minimized by the user. 251*/ 252 253 254/*! 255 \var B_NOT_RESIZABLE 256 257 Window cannot be resized by the user. 258*/ 259 260 261/*! 262 \var B_NOT_H_RESIZABLE 263 264 Window cannot be resized horizontally by the user. 265*/ 266 267 268/*! 269 \var B_NOT_V_RESIZABLE 270 271 Window cannot be resized vertically by the user. 272*/ 273 274 275/*! 276 \var B_AVOID_FRONT 277 278 Window cannot be brought to front. 279*/ 280 281 282/*! 283 \var B_AVOID_FOCUS 284 285 Window cannot receive keyboard focus. 286*/ 287 288 289/*! 290 \var B_WILL_ACCEPT_FIRST_CLICK 291 292 The first click will not just bring the window to front, it will also be 293 processed by the window. 294*/ 295 296 297/*! 298 \var B_OUTLINE_RESIZE 299 300 Window draws only it's outline as it's resized and doesn't draw its 301 contents. 302*/ 303 304 305/*! 306 \var B_NO_WORKSPACE_ACTIVATION 307 308 Causes the current workspace to stay active even if the window is activated on 309 another workspace. 310*/ 311 312 313/*! 314 \var B_NOT_ANCHORED_ON_ACTIVATE 315 316 Causes the window to move to the current workspace when activated if it already 317 exists on another workspace. 318*/ 319 320 321/*! 322 \var B_QUIT_ON_WINDOW_CLOSE 323 324 Quit the application when the window closes. 325 326 \note This flag existed but didn't function in BeOS R5. 327*/ 328 329 330/*! 331 \var B_SAME_POSITION_IN_ALL_WORKSPACES 332 333 Window maintains its position across workspaces. 334 335 \note This flag did not exist in BeOS R5. 336*/ 337 338 339/*! 340 \var B_AUTO_UPDATE_SIZE_LIMITS 341 342 Automatically adjust the window size according to the layout constraints. 343 344 \note This flag did not exist in BeOS R5. 345*/ 346 347 348/*! 349 \var B_CLOSE_ON_ESCAPE 350 351 Close the window when the user pushes the Escape key. 352 353 \note This flag did not exist in BeOS R5. 354*/ 355 356 357/*! 358 \var B_NO_SERVER_SIDE_WINDOW_MODIFIERS 359 360 ?? 361 362 \note This flag did not exist in BeOS R5. 363*/ 364 365 366// workspace constants 367 368 369/*! 370 \def B_CURRENT_WORKSPACE 371 372 Applies to current workspace only. 373*/ 374 375 376/*! 377 \def B_ALL_WORKSPACES 378 379 Applies to all workspaces. 380*/ 381 382 383/*! 384 \class BWindow 385 \ingroup interface 386 \ingroup libbe 387 \brief Window base class. 388 389 A BWindow is an on-screen window which contains views and is the target of 390 keyboard and mouse events. A BWindow instance is nearly always subclassed. 391 392 BWindow draws by talking to App Server. If you want draw directly into the 393 graphics card by-passing App Server, you need to use a BDirectWindow or 394 BWindowScreen. 395 396 Despite the fact that BWindow inherits from BLooper, you should not invoke 397 Run() on a BWindow, instead, call Show() to get the message loop started and 398 show the window on screen. Once you've called Show() you may remove a window 399 from the screen without interrupting the message loop by calling Hide(). Other 400 message loop details such as locking and quitting are detailed in the BLooper 401 class. 402 403 BWindow has the following built-in shortcuts: 404 405 <table> 406 <tr> 407 <th>Shortcut</th> 408 <th>Action</th> 409 <th>Handler</th> 410 </tr> 411 <tr> 412 <td>\key{Command}+\key{X}</td> 413 <td>Cut</td> 414 <td>Focus view</td> 415 </tr> 416 <tr> 417 <td>\key{Command}+\key{C}</td> 418 <td>Copy</td> 419 <td>Focus view</td> 420 </tr> 421 <tr> 422 <td>\key{Command}+\key{V}</td> 423 <td>Paste</td> 424 <td>Focus view</td> 425 </tr> 426 <tr> 427 <td>\key{Command}+\key{A}</td> 428 <td>Select All</td> 429 <td>Focus view</td> 430 </tr> 431 <tr> 432 <td>\key{Command}+\key{W}</td> 433 <td>Close</td> 434 <td>Window (if closable)</td> 435 </tr> 436 <tr> 437 <td>\key{Command}+\key{Q}</td> 438 <td>Quit</td> 439 <td>Application (non-modal windows only)</td> 440 </tr> 441 <tr> 442 <td>\key{Command}+\key{Control}+\key{M}</td> 443 <td>Minimize</td> 444 <td>Window (if minimizable)</td> 445 </tr> 446 <tr> 447 <td>\key{Command}+\key{Control}+\key{Z}</td> 448 <td>Zoom</td> 449 <td>Window (if zoomable)</td> 450 </tr> 451 <tr> 452 <td>\key{Command}+\key{Control}+\key{H}</td> 453 <td>Hide</td> 454 <td>Window</td> 455 </tr> 456 <tr> 457 <td>\key{Command}+\key{Control}+\key{F}</td> 458 <td>Send to front</td> 459 <td>Window</td> 460 </tr> 461 <tr> 462 <td>\key{Command}+\key{Control}+\key{B}</td> 463 <td>Send behind</td> 464 <td>Window</td> 465 </tr> 466 <tr> 467 <td>\key{Command}+\key{Control}+\key{←}</td> 468 <td>Go to left workspace</td> 469 <td>Desktop window</td> 470 </tr> 471 <tr> 472 <td>\key{Command}+\key{Control}+\key{→}</td> 473 <td>Go to right workspace</td> 474 <td>Desktop window</td> 475 </tr> 476 <tr> 477 <td>\key{Command}+\key{Control}+\key{↑}</td> 478 <td>Go to above workspace</td> 479 <td>Desktop window</td> 480 </tr> 481 <tr> 482 <td>\key{Command}+\key{Control}+\key{↓}</td> 483 <td>Go to below workspace</td> 484 <td>Desktop window</td> 485 </tr> 486 <tr> 487 <td>\key{Command}+\key{Control}+\key{Shift}+\key{←}</td> 488 <td>Send window and go to left workspace</td> 489 <td>Desktop window</td> 490 </tr> 491 <tr> 492 <td>\key{Command}+\key{Control}+\key{Shift}+\key{→}</td> 493 <td>Send window and go to right workspace</td> 494 <td>Desktop window</td> 495 </tr> 496 <tr> 497 <td>\key{Command}+\key{Control}+\key{Shift}+\key{↑}</td> 498 <td>Send window and go to above workspace</td> 499 <td>Desktop window</td> 500 </tr> 501 <tr> 502 <td>\key{Command}+\key{Control}+\key{Shift}+\key{↓}</td> 503 <td>Send window and go to below workspace</td> 504 <td>Desktop window</td> 505 </tr> 506 </table> 507*/ 508 509 510/*! 511 \fn BWindow::BWindow(BRect frame, const char* title, window_type type, 512 uint32 flags, uint32 workspace) 513 \brief Creates a new BWindow object. 514 515 \param frame The inner \a frame rectangle in the screen coordinate system. 516 \param title The window \a title and thread title as "w>title". 517 \param type window_type flag, one of the following: 518 - \c B_UNTYPED_WINDOW 519 - \c B_TITLED_WINDOW 520 - \c B_MODAL_WINDOW 521 - \c B_DOCUMENT_WINDOW 522 - \c B_BORDERED_WINDOW 523 - \c B_FLOATING_WINDOW 524 \param flags Mask that defines window attributes: 525 - \c B_NOT_MOVABLE cannot be moved by the user 526 - \c B_NOT_CLOSABLE cannot be closed by the user, no close button 527 displayed 528 - \c B_NOT_ZOOMABLE cannot be zoomed by the user, no zoom button 529 displayed 530 - \c B_NOT_MINIMIZABLE cannot be minimized by the user 531 - \c B_NOT_RESIZABLE cannot be resized by the user 532 - \c B_NOT_H_RESIZABLE cannot be resized horizontally by the user 533 - \c B_NOT_V_RESIZABLE cannot be resized vertically by the user 534 - \c B_AVOID_FRONT cannot be brought to front by the user 535 - \c B_AVOID_FOCUS cannot receive keyboard focus 536 - \c B_WILL_ACCEPT_FIRST_CLICK The first click is processed by the 537 window. 538 - \c B_OUTLINE_RESIZE draws only it's outline as it's resized and 539 doesn't draw its contents. 540 - \c B_NO_WORKSPACE_ACTIVATION Causes the current workspace to stay 541 active when activated on another workspace. 542 - \c B_NOT_ANCHORED_ON_ACTIVATE Causes the window to move to the current 543 workspace when activated if it already exists on another workspace. 544 - \c B_QUIT_ON_WINDOW_CLOSE Quit the application when the window closes. 545 - \c B_SAME_POSITION_IN_ALL_WORKSPACES Window maintains its position 546 across workspaces. 547 - \c B_AUTO_UPDATE_SIZE_LIMITS Automatically adjust the size according 548 to layout constraints. 549 - \c B_CLOSE_ON_ESCAPE Close when the user pushes the Escape key. 550 - \c B_NO_SERVER_SIDE_WINDOW_MODIFIERS ?? 551 \param workspace Mask that indicates which of the 32 potential workspace(s) 552 the window should be displayed in or \c B_CURRENT_WORKSPACE or 553 \c B_ALL_WORKSPACES constants. 554*/ 555 556 557/*! 558 \fn BWindow::BWindow(BRect frame, const char* title, window_look look, 559 window_feel feel, uint32 flags, uint32 workspace) 560 \brief Creates a new BWindow object with the specified \a look and \a feel. 561 562 \param frame The inner \a frame rectangle in the screen coordinate system. 563 \param title The window \a title and thread title as "w>title". 564 \param look The window_look flags, one of the following: 565 - \c B_BORDERED_WINDOW_LOOK No title bar, thin border, no resize 566 control. 567 - \c B_NO_BORDER_WINDOW_LOOK A borderless rectangle with no provisions 568 to move or close the window. 569 - \c B_TITLED_WINDOW_LOOK Like \c B_DOCUMENT_WINDOW_LOOK, but with a 570 resize corner instead of a resize thumb. 571 - \c B_DOCUMENT_WINDOW_LOOK Large title bar, thick border, draggable 572 resize corner thumb. 573 - \c B_MODAL_WINDOW_LOOK For modal dialogs: no title bar, thick border, 574 resize corner depending on the \c B_NOT_RESIZABLE flag. 575 - \c B_FLOATING_WINDOW_LOOK For floating sub windows: small title bar, 576 thin border, resize corner. 577 \param feel The window_feel flags, one of the following: 578 - \c B_NORMAL_WINDOW_FEEL Behaves like a normal, non-modal, 579 non-floating window. 580 - \c B_MODAL_SUBSET_WINDOW_FEEL Blocks all windows in its subset when 581 displayed. Visible only if a window in its subset is visible. 582 - \c B_MODAL_APP_WINDOW_FEEL Blocks all windows in its app when 583 displayed. Visible only if a window in its app is visible. 584 - \c B_MODAL_ALL_WINDOW_FEEL Blocks all windows across the entire 585 system when displayed. Always visible in all workspaces. 586 - \c B_FLOATING_SUBSET_WINDOW_FEEL Floats above all windows in its 587 subset when displayed. Visible only if a window in its subset is the 588 frontmost window. 589 - \c B_FLOATING_APP_WINDOW_FEEL Floats above all windows in its app 590 when displayed. Visible only if a window in its app is the frontmost 591 window. 592 - \c B_FLOATING_ALL_WINDOW_FEEL Floats above all windows across the 593 entire system when displayed. Always visible in all workspaces. 594 \param flags Mask that defines window attributes: 595 - \c B_NOT_MOVABLE cannot be moved by the user 596 - \c B_NOT_CLOSABLE cannot be closed by the user, no close button 597 displayed 598 - \c B_NOT_ZOOMABLE cannot be zoomed by the user, no zoom button 599 displayed 600 - \c B_NOT_MINIMIZABLE cannot be minimized by the user 601 - \c B_NOT_RESIZABLE cannot be resized by the user 602 - \c B_NOT_H_RESIZABLE cannot be resized horizontally by the user 603 - \c B_NOT_V_RESIZABLE cannot be resized vertically by the user 604 - \c B_AVOID_FRONT cannot be brought to front by the user 605 - \c B_AVOID_FOCUS cannot receive keyboard focus 606 - \c B_WILL_ACCEPT_FIRST_CLICK The first click is processed by the 607 window. 608 - \c B_OUTLINE_RESIZE draws only it's outline as it's resized and 609 doesn't draw its contents. 610 - \c B_NO_WORKSPACE_ACTIVATION Causes the current workspace to stay 611 active when activated on another workspace. 612 - \c B_NOT_ANCHORED_ON_ACTIVATE Causes the window to move to the current 613 workspace when activated if it already exists on another workspace. 614 - \c B_QUIT_ON_WINDOW_CLOSE Quit the application when the window closes. 615 - \c B_SAME_POSITION_IN_ALL_WORKSPACES Window maintains its position 616 across workspaces. 617 - \c B_AUTO_UPDATE_SIZE_LIMITS Automatically adjust the size according 618 to layout constraints. 619 - \c B_CLOSE_ON_ESCAPE Close when the user pushes the Escape key. 620 - \c B_NO_SERVER_SIDE_WINDOW_MODIFIERS ?? 621 \param workspace Mask that indicates which of the 32 potential workspace(s) 622 the window should be displayed in or \c B_CURRENT_WORKSPACE or 623 \c B_ALL_WORKSPACES constants. 624*/ 625 626 627/*! 628 \fn BWindow::BWindow(BMessage* data) 629 \brief Archive constructor. 630 631 \param data A pointer to the BMessage object to build the object from. 632*/ 633 634 635/*! 636 \fn BWindow::BWindow(BRect frame, int32 bitmapToken) 637 \brief Offscreen bitmap constructor. 638 639 \param frame The inner \a frame rectangle in the screen coordinate system. 640 \param bitmapToken Token to pass into App Server for offscreen window bitmap. 641*/ 642 643 644/*! 645 \fn BWindow::~BWindow() 646 \brief Destroys the BWindow object and all attached views. 647*/ 648 649 650/*! 651 \fn BArchivable* BWindow::Instantiate(BMessage* data) 652 \brief Creates a new BWindow object from the \a data message. 653 654 \param data A pointer to the BMessage object to build the object from. 655 656 \returns A newly created BWindow object or \c NULL if the message doesn't 657 contain an archived BWindow. 658*/ 659 660 661/*! 662 \fn status_t BWindow::Archive(BMessage* data, bool deep) const 663 \brief Archives the object into the \a data message. 664 665 \param data A pointer to the BMessage object to archive the object into. 666 \param deep Whether or not to archive child views as well. 667 668 \return A status code, \c B_OK if the object was archived or an error code 669 otherwise. 670*/ 671 672 673/*! 674 \fn void BWindow::Quit() 675 \brief Deletes the window and all child views, destroys the window thread, 676 removes the window's connection to the Application Server, and deletes 677 the object. 678 679 Use this method to destroy a window rather than using the delete operator. 680 681 This method works much like the BLooper::Quit(), it doesn't return when 682 called from the BWindow's thread and it returns after all messages have been 683 processed when called from another thread and the BWindow and its thread has 684 been destroyed. 685 686 \warning The window must first be locked before calling Quit(). 687 688 \see BLooper::Quit() 689*/ 690 691 692/*! 693 \fn void BWindow::AddChild(BView* child, BView* before) 694 \brief Adds \a child to the view hierarchy immediately before \a before. 695 696 A view may only have one parent at a time so \a child must not have already 697 been added to the view hierarchy. If \a before is \c NULL then \a child is 698 added to the end of the view hierarchy. 699 700 The AttachedToWindow() method is invoked on \a child and all of its 701 descendent views. 702 703 \param child The child view to add. 704 \param before The sibling view to add \a child before. 705*/ 706 707 708/*! 709 \fn void BWindow::AddChild(BLayoutItem* child) 710 \brief Add the \a child layout item to the view hierarchy. 711 712 \note This method was not available in BeOS R5. 713 714 \param child The child layout item to add. 715*/ 716 717 718/*! 719 \fn bool BWindow::RemoveChild(BView* child) 720 \brief Removes \a child from the view hierarchy. 721 722 \param child The child view to remove. 723 724 \return Whether or not \a child was removed from the view hierarchy. 725*/ 726 727 728/*! 729 \fn int32 BWindow::CountChildren() const 730 \brief Returns the number of child views that the window has. 731 732 \return The number of child views as an int32. 733*/ 734 735 736/*! 737 \fn BView* BWindow::ChildAt(int32 index) const 738 \brief Returns a pointer to the child view found at \a index. 739 740 \param index The index of the child view to return a pointer of. 741 742 \return A pointer to the child view at \a index or \c NULL if not found. 743*/ 744 745 746/*! 747 \fn void BWindow::Minimize(bool minimize) 748 \brief Minimizes or un-minimizes the window based on \a minimize. 749 750 Unlike Hide() an Show(), Minimize() dims and un-dims the entry for the window 751 in Deskbar's window list rather than removing it. Also Minimize() calls are not 752 cumulative like Hide() and Show(); one \c false call will undo multiple \c true 753 calls. 754 755 Minimize() also acts as a hook method that is invoked when the user double- 756 clicks on the title tab of the window or selects the window from the DeskBar 757 window list. The \a minimize parameter is \c true if the window is about to be 758 hidden and \c false if it is about to be shown. 759 760 If you override Minimize() and you want to inherit BWindow's behavior, you 761 must call BWindow::Minimize(). 762*/ 763 764 765/*! 766 \fn status_t BWindow::SendBehind(const BWindow* window) 767 \brief Moves the BWindow object behind \a window. 768 769 \param window A pointer to the window to move behind. 770 771 \returns \c B_OK on success or \c B_ERROR on failure. 772*/ 773 774 775/*! 776 \fn void BWindow::Flush() const 777 \brief Flushes the window's connection to App Server causing any pending 778 messages to be processed then returns immediately. 779*/ 780 781 782/*! 783 \fn void BWindow::Sync() const 784 \brief Synchronizes the attached window's connection to App Server causing any 785 pending messages to be processed and then waits for the App Server to respond. 786*/ 787 788 789/*! 790 \fn void BWindow::DisableUpdates() 791 \brief Suppresses drawing within the window. 792 793 If you want the results of several drawing operations to appear in the window 794 all at once you disable updates, draw, and then re-enable updates. 795*/ 796 797 798/*! 799 \fn void BWindow::EnableUpdates() 800 \brief Re-enable drawing within the window. 801 802 If you want the results of several drawing operations to appear in the window 803 all at once you disable updates, draw, and then re-enable updates. 804*/ 805 806 807/*! 808 \fn void BWindow::BeginViewTransaction() 809 \brief Stall updates to App Server allowing you to batch drawing commands to 810 limit flickering. 811 812 Unlike DisableUpdates() the messages are sent but are not processed. 813 814 \note This method was not available in BeOS R5. 815*/ 816 817 818/*! 819 \fn void BWindow::EndViewTransaction() 820 \brief Ends a view transaction allowing update to go to App Server again. 821 822 \note This method was not available in BeOS R5. 823*/ 824 825 826/*! 827 \fn bool BWindow::InViewTransaction() const 828 \brief Returns whether or not the window is currently in a view transaction. 829 830 \note This method was not available in BeOS R5. 831 832 \returns \c true if the window is currently in a view transaction, 833 \c false otherwise. 834*/ 835 836 837/*! 838 \fn bool BWindow::IsFront() const 839 \brief Returns whether or not the window is the frontmost on screen. 840 841 \returns \c true if window is the frontmost on screen, \c false otherwise. 842*/ 843 844 845/*! 846 \fn void BWindow::MessageReceived(BMessage* message) 847 \brief Handle \a message received by the associated looper. 848 849 \param message The \a message received by the looper. 850 851 \see BHandler::MessageReceived() 852*/ 853 854 855/*! 856 \fn void BWindow::DispatchMessage(BMessage* message, BHandler* target) 857 \brief Window's central message-processing method. 858 859 This method called automatically as messages arrive in the queue, you should 860 never call DispatchMessage() yourself. 861 862 \warning Don't override this method in your BWindow subclass. Override 863 MessageReceived() instead to alter the window's message dispatching 864 mechanism. 865 866 \see BLooper::DispatchMessage() 867*/ 868 869 870/*! 871 \fn void BWindow::FrameMoved(BPoint newPosition) 872 \brief Hook method that gets called when the window is moved. 873 874 The default implementation does nothing. 875 876 \param newPosition The point of the top left corner of the frame 877 rectangle that the window has been moved to. 878*/ 879 880 881/*! 882 \fn void BWindow::FrameResized(float newWidth, float newHeight) 883 \brief Hook method that gets called when the window is resized. 884 885 The default implementation does nothing. 886 887 \param newWidth The new \a width of the window. 888 \param newHeight The new \a height of the window. 889*/ 890 891 892/*! 893 \fn void BWindow::WorkspacesChanged(uint32 oldWorkspaces, 894 uint32 newWorkspaces) 895 \brief Hook method that gets called when the number of workspaces changes. 896 897 The default implementation does nothing. 898 899 \param oldWorkspaces The old number of workspaces. 900 \param newWorkspaces The new number of workspaces. 901*/ 902 903 904/*! 905 \fn void BWindow::WorkspaceActivated(int32 workspace, bool state) 906 \brief Hook method that gets called when the active workspace changes. 907 908 The default implementation does nothing. 909 910 \param workspace The \a workspace number that was activated/deactivated. 911 \param state \c true if activated, \c false if deactivated. 912*/ 913 914 915/*! 916 \fn void BWindow::MenusBeginning() 917 \brief Hook method that gets called just before a menu owned by the window is 918 shown. 919 920 The default implementation does nothing. 921 922 \note This method is not invoked by a message, there is no 923 \c B_MENUS_BEGINNING flag. 924*/ 925 926 927/*! 928 \fn void BWindow::MenusEnded() 929 \brief Hook method that gets called just before a menu owned by the window is 930 hidden. 931 932 The default implementation does nothing. 933 934 \note This method is not invoked by a message, there is no 935 \c B_MENUS_ENDED flag. 936*/ 937 938 939/*! 940 \fn void BWindow::SetSizeLimits(float minWidth, float maxWidth, 941 float minHeight, float maxHeight) 942 \brief Set size limits on the window. 943 944 The user won't be able to resize the window beyond the limits set by this 945 method. SetSizeLimits() constrains the user, not the programmer, you may 946 still resize the window outside of the size limits set by this method by 947 calling ResizeBy() or ResizeTo(). 948 949 \param minWidth The minimum width of the window to set. 950 \param maxWidth The maximum width of the window to set. 951 \param minHeight The minimum height of the window to set. 952 \param maxHeight The maximum height of the window to set. 953*/ 954 955 956/*! 957 \fn void BWindow::GetSizeLimits(float* _minWidth, float* _maxWidth, 958 float* _minHeight, float* _maxHeight) 959 \brief Fills out the size limits set on the window. 960 961 \param _minWidth The minimum width of the window. 962 \param _maxWidth The maximum width of the window. 963 \param _minHeight The minimum height of the window. 964 \param _maxHeight The maximum height of the window. 965* 966 967 968/*! 969 \fn void BWindow::UpdateSizeLimits() 970 \brief Updates the window's size limits from the minimum and maximum sizes 971 of its top view. 972 973 This method does nothing unless the \c B_AUTO_UPDATE_SIZE_LIMITS window flag 974 is set. 975 976 The method is called automatically after a layout invalidation. Since it is 977 invoked asynchronously, calling this method manually is necessary, if it is 978 desired to adjust the limits (and as a possible side effect the window size) 979 earlier, e.g. before the first call to the Show() method.) 980*/ 981 982 983/*! 984 \fn status_t BWindow::SetDecoratorSettings(const BMessage& settings) 985 \brief Set the window decorator settings according to \a settings. 986 987 \param settings The decorator \a settings message to set. 988 989 \returns \c B_OK if the decorator settings were set successfully or an error 990 code otherwise. 991*/ 992 993 994/*! 995 \fn status_t BWindow::GetDecoratorSettings(BMessage* settings) const 996 \brief Fill out the window's decorator settings into \a settings. 997 998 \param settings A pointer to a BMessage object to fill out. 999 1000 \returns \c B_OK if the decorator settings were filled out successfully 1001 or an error code otherwise. 1002*/ 1003 1004 1005/*! 1006 \fn void BWindow::SetZoomLimits(float maxWidth, float maxHeight) 1007 \brief Sets the maximum size that the window will zoom to when Zoom() is 1008 called. 1009 1010 The window will zoom to the minimum of the screen size, the maximum values 1011 set by SetSizeLimits(), and the maximum values set by this method. 1012 1013 /see Zoom() 1014*/ 1015 1016 1017/*! 1018 \fn void BWindow::Zoom(BPoint origin, float width, float height) 1019 \brief Move window to \a origin, then resize to \a width and \a height. 1020 1021 You may call Zoom() even if the window has the \c B_NOT_ZOOMABLE flag set. 1022 This method may move and resize the window resulting in both the FrameMoved() 1023 and FrameResized() hook methods to be called. 1024 1025 \param origin The point that the window was moved to. 1026 \param width The new width of the window. 1027 \param height The new height of the window. 1028*/ 1029 1030 1031/*! 1032 \fn void BWindow::Zoom() 1033 \brief Resize the window to the minimum of the screen size, the maximum values 1034 set by SetSizeLimits(), and the maximum values set by SetZoomLimits(). 1035 1036 You may call Zoom() even if the window has the \c B_NOT_ZOOMABLE flag set. 1037 This method may move and resize the window resulting in both the FrameMoved() 1038 and FrameResized() hook methods to be called. This is the method called when 1039 the user clicks a window's zoom button. 1040*/ 1041 1042 1043/*! 1044 \fn void BWindow::ScreenChanged(BRect screenSize, color_space depth) 1045 \brief Hook method that is called when the screen that the window is located 1046 on changes size or location or the color space of the screen changes. 1047 1048 The default implementation does nothing. 1049 1050 \param screenSize The new screen size in the screen's coordinate system. 1051 \param depth The new color space of the screen. 1052*/ 1053 1054 1055/*! 1056 \fn void BWindow::SetPulseRate(bigtime_t rate) 1057 \brief Sets how often \c B_PULSE messages are posted to the window. 1058 1059 All BViews attached to a window share the same pulse rate. 1060 1061 \a rate should not be set to less than 100,000 microseconds, differences less 1062 than 50,000 microseconds may not be noticeable. 1063 1064 Setting the \a rate to 0 disables pulsing for all views attache to the window. 1065 1066 \param rate The pulse rate to set. 1067*/ 1068 1069 1070/*! 1071 \fn bigtime_t BWindow::PulseRate() const 1072 \brief Returns the pulse rate of the window. 1073 1074 \c B_PULSE messages are sent by default every 500,000 microseconds provided 1075 that no other messages are pending. 1076 1077 \returns The pulse rate of the window as a bigtime_t. 1078*/ 1079 1080 1081/*! 1082 \name Shortcut methods 1083 1084 The key parameter is specified in the form of a Unicode code point. This 1085 is generally an ASCII character such as 'A' or a key constant such as 1086 \c B_RIGHT_ARROW. To use a UTF-8 character you must first convert it to a 1087 Unicode code point using BUnicodeChar::FromUTF8(). 1088*/ 1089 1090 1091//! @{ 1092 1093 1094/*! 1095 \fn void BWindow::AddShortcut(uint32 key, uint32 modifiers, BMenuItem* item) 1096 \brief Creates a keyboard shortcut that activates a menu \a item. 1097 1098 \note This method was not available in BeOS R5. 1099 1100 \param key The character that activates the shortcut, case-insensitive. 1101 \param modifiers A bit mask of modifiers in addition to \c B_COMMAND_KEY, 1102 options include: 1103 - \c B_SHIFT_KEY 1104 - \c B_OPTION_KEY 1105 - \c B_CONTROL_KEY 1106 - \c B_MENU_KEY 1107 \param item The menu \a item to activate. 1108*/ 1109 1110 1111/*! 1112 \fn void BWindow::AddShortcut(uint32 key, uint32 modifiers, BMessage* message) 1113 \brief Creates a keyboard shortcut that sends a \a message to the window. 1114 1115 \warning Don't use this method to a create menu shortcut, add a BMenuItem 1116 instead. 1117 1118 \param key The character that activates the shortcut, case-insensitive. 1119 \param modifiers A bit mask of modifiers in addition to \c B_COMMAND_KEY, 1120 options include: 1121 - \c B_SHIFT_KEY 1122 - \c B_OPTION_KEY 1123 - \c B_CONTROL_KEY 1124 - \c B_MENU_KEY 1125 \param message The \a message to send when the shortcut is activated. The 1126 BWindow takes ownership of the \a message. 1127*/ 1128 1129 1130/*! 1131 \fn void BWindow::AddShortcut(uint32 key, uint32 modifiers, BMessage* message, 1132 BHandler* target) 1133 \brief Creates a keyboard shortcut that sends a \a message to the specified 1134 \a target. 1135 1136 \warning Don't use this method to a create menu shortcut, add a BMenuItem 1137 instead. 1138 1139 \param key The character that activates the shortcut, case-insensitive. 1140 \param modifiers A bit mask of modifiers in addition to \c B_COMMAND_KEY, 1141 options include one or more of the following: 1142 - \c B_SHIFT_KEY 1143 - \c B_OPTION_KEY 1144 - \c B_CONTROL_KEY 1145 - \c B_MENU_KEY 1146 \param message The \a message to send when the shortcut is activated. The 1147 BWindow takes ownership of the \a message. 1148 \param target The handler to send the message to. 1149*/ 1150 1151 1152/*! 1153 \fn bool BWindow::HasShortcut(uint32 key, uint32 modifiers) 1154 \brief Returns whether or not the specified shortcut is set on the window. 1155 1156 \note This method was not available in BeOS R5. 1157 1158 \param key The character to check, case-insensitive. 1159 \param modifiers A bit mask of modifiers in addition to \c B_COMMAND_KEY, 1160 options include one or more of the following: 1161 - \c B_SHIFT_KEY 1162 - \c B_OPTION_KEY 1163 - \c B_CONTROL_KEY 1164 - \c B_MENU_KEY 1165 1166 \returns \c true if the window has the specified shortcut, \c false 1167 otherwise. 1168*/ 1169 1170 1171/*! 1172 \fn void BWindow::RemoveShortcut(uint32 key, uint32 modifiers) 1173 \brief Removes the specified shortcut from the window. 1174 1175 The memory used by the shortcut message is freed. 1176 1177 \param key The character to remove, case-insensitive. 1178 \param modifiers A bit mask of modifiers in addition to \c B_COMMAND_KEY, 1179 options include one or more of the following: 1180 - \c B_SHIFT_KEY 1181 - \c B_OPTION_KEY 1182 - \c B_CONTROL_KEY 1183 - \c B_MENU_KEY 1184*/ 1185 1186 1187//! @} 1188 1189 1190/*! 1191 \fn BButton* BWindow::DefaultButton() const 1192 \brief Returns a pointer to the default button set on the window. 1193 1194 \return A pointer to the window's default button or \c NULL if it doesn't 1195 have one. 1196*/ 1197 1198 1199/*! 1200 \fn void BWindow::SetDefaultButton(BButton* button) 1201 \brief Set the default button of the window to \a button. 1202 1203 The default button has a grey outline and is activated by the user pushing 1204 the Enter key. The user can activate the default button even if another view 1205 is currently set to be the focus view of the window. 1206 1207 A window may only have one default button at a time, to remove the current 1208 default without setting another button you may pass in \c NULL. 1209 1210 \param button A pointer to the button to set as the default or \c NULL to 1211 unset. 1212*/ 1213 1214 1215/*! 1216 \fn bool BWindow::NeedsUpdate() const 1217 \brief Returns whether or not any of the attached views need to be updated. 1218 1219 \return \c true if an attached view needs to be updated, \c false otherwise. 1220*/ 1221 1222 1223/*! 1224 \fn void BWindow::UpdateIfNeeded() 1225 \brief Invokes Draw() immediately on each child view that needs updating. 1226 1227 This method is synchronous, it waits for each child view to update before 1228 returning. This method is ignored unless it is called from within the message 1229 loop of the thread that the BWindow is running in. 1230 1231 You may call this method as part of a hook function such as MouseMoved() or 1232 KeyDown() to force invalid views to be immediately redrawn without having to 1233 wait for the hook function to finish. 1234*/ 1235 1236 1237/*! 1238 \fn BView* BWindow::FindView(const char* viewName) const 1239 \brief Returns the attached view with the specified \a viewName. 1240 1241 \param viewName The name of the attached view to look for. 1242 1243 \return A pointer to the BView object or \c NULL if no view is found. 1244*/ 1245 1246 1247/*! 1248 \fn BView* BWindow::FindView(BPoint point) const 1249 \brief Returns a pointer to the attached view located at the specified 1250 \a point. 1251 1252 \param point The \a point to get the view at in the window's coordinate 1253 system. 1254 1255 \return A pointer to the BView object or \c NULL if no view is found. 1256*/ 1257 1258 1259/*! 1260 \fn BView* BWindow::CurrentFocus() const 1261 \brief Returns a pointer to the current focus view of the window. 1262 1263 \return A pointer to the current focus view of the window or \c NULL if 1264 not found. 1265*/ 1266 1267 1268/*! 1269 \fn void BWindow::Activate(bool active) 1270 \brief Activates or deactivates the window based on \a active. 1271 1272 The title tab of the active window is drawn more brightly, the window is made 1273 frontmost, and it becomes the target of keyboard events. Calling Show() 1274 automatically activates the window calling the WindowActivated() hook method. 1275 1276 \param active \c true to activate the window, \c false to deactivate the 1277 window. 1278*/ 1279 1280 1281/*! 1282 \fn void BWindow::WindowActivated(bool state) 1283 \brief Hook method that gets called when the window becomes activated or 1284 deactivated. 1285 1286 The default implementation does nothing. 1287 1288 \param state \c true if the window has become activated, \c false if the 1289 window has become deactivated. 1290*/ 1291 1292 1293/*! 1294 \fn void BWindow::ConvertToScreen(BPoint* point) const 1295 \brief Convert \a point to the screen's coordinate system in place. 1296 1297 \param point A pointer to a BPoint object to convert. 1298*/ 1299 1300 1301/*! 1302 \fn BPoint BWindow::ConvertToScreen(BPoint point) const 1303 \brief Returns \a point converted to the screen's coordinate system. 1304 1305 \param point A BPoint object to convert. 1306 1307 \return A new BPoint object in the screen's coordinate system. 1308*/ 1309 1310 1311/*! 1312 \fn void BWindow::ConvertFromScreen(BPoint* point) const 1313 \brief Convert \a point from the screen's coordinate system to the 1314 window's coordinate system in place. 1315 1316 \param point A pointer to a BPoint object to convert. 1317*/ 1318 1319 1320/*! 1321 \fn BPoint BWindow::ConvertFromScreen(BPoint point) const 1322 \brief Returns \a point converted from the screen's coordinate system to 1323 the window's coordinate system. 1324 1325 \param point A BPoint object to convert. 1326 1327 \return A new BPoint object in the window's coordinate system. 1328*/ 1329 1330 1331/*! 1332 \fn void BWindow::ConvertToScreen(BRect* rect) const 1333 \brief Convert \a rect to the screen's coordinate system in place. 1334 1335 \param rect A pointer to a BRect object to convert. 1336*/ 1337 1338 1339/*! 1340 \fn BRect BWindow::ConvertToScreen(BRect rect) const 1341 \brief Returns \a rect converted to the screen's coordinate system. 1342 1343 \param rect A BRect object to convert. 1344 1345 \return A new BRect object in the screen's coordinate system. 1346*/ 1347 1348 1349/*! 1350 \fn void BWindow::ConvertFromScreen(BRect* rect) const 1351 \brief Convert \a rect from the screen's coordinate system to the 1352 window's coordinate system in place. 1353 1354 \param rect A pointer to a BRect object to convert. 1355*/ 1356 1357 1358/*! 1359 \fn BRect BWindow::ConvertFromScreen(BRect rect) const 1360 \brief Returns \a rect converted from the screen's coordinate system to the 1361 window's coordinate system. 1362 1363 \param rect A BRect object to convert. 1364 1365 \return A new BRect object in the window's coordinate system. 1366*/ 1367 1368 1369/*! 1370 \fn bool BWindow::IsMinimized() const 1371 \brief Returns whether or not the window is minimized. 1372 1373 \return \c true if the window is minimized, \c false otherwise. 1374*/ 1375 1376 1377/*! 1378 \fn BRect BWindow::Bounds() const 1379 \brief Returns the bounding rectangle of the window. 1380 1381 \return The bounding rectangle of the window as a BRect in the window's 1382 coordinate system. 1383*/ 1384 1385 1386/*! 1387 \fn BRect BWindow::Frame() const 1388 \brief Returns the frame rectangle of the window. 1389 1390 \return The bounding rectangle of the window as a BRect in the screen 1391 coordinate system. 1392*/ 1393 1394 1395/*! 1396 \fn BRect BWindow::DecoratorFrame() const 1397 \brief Returns the frame rectangle of the window decorator. 1398 1399 \note This method was not available in BeOS R5. 1400 1401 \return The bounding rectangle of the window decorator as a BRect in the 1402 screen coordinate system. 1403*/ 1404 1405 1406/*! 1407 \fn BSize BWindow::Size() const 1408 \brief Returns the size of the window. 1409 1410 \note This method was not available in BeOS R5. 1411 1412 \return The size of the window as a BSize in the screen coordinate system. 1413*/ 1414 1415 1416/*! 1417 \fn const char* BWindow::Title() const 1418 \brief Returns the window title as set by the constructor or SetTitle(). 1419 1420 \return A pointer to the window title. 1421*/ 1422 1423 1424/*! 1425 \fn void BWindow::SetTitle(const char* title) 1426 \brief Sets the window title to \a title. 1427 1428 Also renames the window thread to "w>title" where "title" is the passed in 1429 title string. 1430*/ 1431 1432 1433/*! 1434 \fn bool BWindow::IsActive() const 1435 \brief Returns whether or not the window is active. 1436 1437 \return \c true if the window is active, \c false otherwise. 1438*/ 1439 1440 1441/*! 1442 \fn void BWindow::SetKeyMenuBar(BMenuBar* bar) 1443 \brief Set the specified menu \a bar as the key menu bar for the window. 1444 1445 The key menu bar is the one located at the top of the window at the root of 1446 the menu hierarchy that the user can navigate with the keyboard. 1447 1448 \param bar A pointer to the menu \a bar to set as as the key menu \a bar for 1449 the window. 1450*/ 1451 1452 1453/*! 1454 \fn BMenuBar* BWindow::KeyMenuBar() const 1455 \brief Returns a pointer to the key menu bar set to the window. 1456 1457 If the window contains only one menu bar it is automatically considered to be 1458 the key menu bar for the window. If more than one menu bar is attached to the 1459 window then the last one added to the window's view hierarchy is considered 1460 to be the key menu bar for the window. 1461 1462 To explicitly set a menu bar as the key menu bar call SetKeyMenuBar(). 1463 1464 \return A pointer to the key menu bar or \c NULL is not is set. 1465*/ 1466 1467 1468/*! 1469 \fn bool BWindow::IsModal() const 1470 \brief Returns whether or not the window is modal. 1471 1472 \return \c true if the window is modal, \c false otherwise. 1473*/ 1474 1475 1476/*! 1477 \fn bool BWindow::IsFloating() const 1478 \brief Returns whether or not the window is floating. 1479 1480 \return \c true if the window is floating, \c false otherwise. 1481*/ 1482 1483 1484/*! 1485 \fn status_t BWindow::AddToSubset(BWindow* window) 1486 \brief Adds \a window to be in the subset of the BWindow. 1487 1488 \return A status code. 1489 \retval B_OK \a window was added as a subset of the BWindow. 1490 \retval B_BAD_VALUE \c window is not \c B_NORMAL_WINDOW_FEEL or the BWindow 1491 object's feel is not set to \c B_MODAL_SUBSET_WINDOW_FEEL or 1492 \c B_FLOATING_SUBSET_WINDOW_FEEL. 1493 \retval B_ERROR Could not lock the BWindow object. 1494*/ 1495 1496 1497/*! 1498 \fn status_t BWindow::RemoveFromSubset(BWindow* window) 1499 \brief Remove \a window from the subset of the BWindow. 1500 1501 \return A status code. 1502 \retval B_OK \a window was removed from the subset of the BWindow. 1503 \retval B_BAD_VALUE \c window is not \c B_NORMAL_WINDOW_FEEL or the BWindow 1504 object's feel is not set to \c B_MODAL_SUBSET_WINDOW_FEEL or 1505 \c B_FLOATING_SUBSET_WINDOW_FEEL. 1506 \retval B_ERROR Could not lock the BWindow object. 1507*/ 1508 1509 1510/*! 1511 \fn status_t BWindow::SetType(window_type type) 1512 \brief Changes the window type set in the constructor to \a type. 1513 1514 \return \c B_OK on success or an error code on failure. 1515*/ 1516 1517 1518/*! 1519 \fn window_type BWindow::Type() const 1520 \brief Returns the current window type flag. 1521 1522 \return The currently set window type flag. 1523*/ 1524 1525 1526/*! 1527 \fn status_t BWindow::SetLook(window_look look) 1528 \brief Changes the window look set in the constructor to \a look. 1529 1530 \return \c B_OK on success or an error code on failure. 1531*/ 1532 1533 1534/*! 1535 \fn window_look BWindow::Look() const 1536 \brief Returns the current window look flag. 1537 1538 \return The currently set window look flag. 1539*/ 1540 1541 1542/*! 1543 \fn status_t BWindow::SetFeel(window_feel feel) 1544 \brief Changes the window feel set in the constructor to \a feel. 1545 1546 \return \c B_OK on success or an error code on failure. 1547*/ 1548 1549 1550/*! 1551 \fn window_feel BWindow::Feel() const 1552 \brief Returns the current window feel flag. 1553 1554 \return The currently set window feel flag. 1555*/ 1556 1557 1558/*! 1559 \fn status_t BWindow::SetFlags(uint32 flags) 1560 \brief Changes the window flags set in the constructor to \a flags. 1561 1562 \return \c B_OK on success or an error code on failure. 1563*/ 1564 1565 1566/*! 1567 \fn uint32 BWindow::Flags() const 1568 \brief Returns the current window flags. 1569 1570 \return The currently set window flags. 1571*/ 1572 1573 1574/*! 1575 \fn status_t BWindow::SetWindowAlignment(window_alignment mode, 1576 int32 h, int32 hOffset, int32 width, int32 widthOffset, 1577 int32 v, int32 vOffset, int32 height, int32 heightOffset) 1578*/ 1579 1580 1581/*! 1582 \fn status_t BWindow::GetWindowAlignment(window_alignment* mode, 1583 int32* h, int32* hOffset, int32* width, int32* widthOffset, 1584 int32* v, int32* vOffset, int32* height, int32* heightOffset) const 1585*/ 1586 1587 1588/*! 1589 \fn uint32 BWindow::Workspaces() const 1590 \brief Returns the set of workspaces where the window can be displayed. 1591*/ 1592 1593 1594/*! 1595 \fn void BWindow::SetWorkspaces(uint32 workspaces) 1596 \brief Sets the set of workspaces where the window can be displayed. 1597 1598 \param workspaces 1599 - \c B_CURRENT_WORKSPACE to place the window in the currently displayed 1600 workspace removing it from all others. 1601 - \c B_ALL_WORKSPACES to make the window show up in all workspaces. 1602*/ 1603 1604 1605/*! 1606 \fn BView* BWindow::LastMouseMovedView() const 1607 \brief Returns a pointer to the attached view that most recently received 1608 a \c B_MOUSE_MOVED message. 1609 1610 \return A pointer the BView object that most recently received a 1611 \c B_MOUSE_MOVED message or \c NULL if not found. 1612*/ 1613 1614 1615/*! 1616 \fn void BWindow::MoveBy(float dx, float dy) 1617 \brief Move the window by \a dx pixels horizontally and \a dy pixels 1618 vertically. 1619 1620 \a dx and \a dy must be integral units. 1621 1622 \param dx The number of pixels to move the window vertically. 1623 \param dy The number of pixels to move the window horizontally. 1624*/ 1625 1626 1627/*! 1628 \fn void BWindow::MoveTo(BPoint point) 1629 \brief Move the window to \a point. 1630 1631 \param point the location to move the window in the screen's coordinate 1632 system. 1633*/ 1634 1635 1636/*! 1637 \fn void BWindow::MoveTo(float x, float y) 1638 \brief Move the window to the specified \a x and \a y coordinates. 1639 1640 \a x and \a y must be integral units. 1641 1642 \param x The horizontal coordinate to move the window to in the screen's 1643 coordinate system. 1644 \param y The vertical coordinate to move the window to in the screen's 1645 coordinate system. 1646*/ 1647 1648 1649/*! 1650 \fn void BWindow::ResizeBy(float dx, float dy) 1651 \brief Resize the window by \a dx pixels horizontally and \a dy pixels vertically. 1652 1653 \a dx and \a dy must be integral units. 1654 1655 \brief dx The number of pixels to resize the window horizontally. 1656 \brief dy The number of pixels to resize the window vertically. 1657*/ 1658 1659 1660/*! 1661 \fn void BWindow::ResizeTo(float width, float height) 1662 \brief Resize the window to the specified \a width and \a height. 1663 1664 \a width and \a height must be integral units. 1665 1666 \param width The width to resize the window to. 1667 \param height The height to resize the window to. 1668*/ 1669 1670 1671/*! 1672 \fn void BWindow::CenterIn(const BRect& rect) 1673 \brief Center the window in \a rect. 1674 1675 \param rect The rectangle to center the window in. 1676*/ 1677 1678 1679/*! 1680 \fn void BWindow::CenterOnScreen() 1681 \brief Centers the window on the screen the window is currently on. 1682*/ 1683 1684 1685/*! 1686 \fn void BWindow::CenterOnScreen(screen_id id) 1687 \brief Centers the window on the screen with the passed in \a id. 1688*/ 1689 1690 1691/*! 1692 \fn void BWindow::Show() 1693 \brief Shows the window on screen, places it frontmost on the screen, adds 1694 the window to Deskbar's window list, and makes it the active window. 1695 1696 If this is the first time Show() has been called on the window the message loop 1697 is started and it is unlocked. 1698 1699 Calls to Hide() and Show() are cumulative. 1700*/ 1701 1702 1703/*! 1704 \fn void BWindow::Hide() 1705 \brief Removes the window from the screen, removes it from Deskbar's window 1706 list, and passes active status to another window. 1707 1708 Calls to Hide() and Show() are cumulative. 1709*/ 1710 1711 1712/*! 1713 \fn bool BWindow::IsHidden() const 1714 \brief Returns whether or not the window is hidden. 1715 1716 Windows are hidden by default, you must call Show() to show the window starting 1717 the message loop going. 1718*/ 1719 1720 1721/*! 1722 \fn bool BWindow::QuitRequested() 1723 \brief Hook method that gets called when the window receives a 1724 \a B_QUIT_REQUESTED message. 1725 1726 \see Quit() 1727 \see BLooper::QuitRequested() 1728*/ 1729 1730 1731/*! 1732 \fn thread_id BWindow::Run() 1733 \brief Spawns the message loop thread and starts the window running. 1734 1735 \see BLooper::Run() 1736*/ 1737 1738 1739/*! 1740 \fn void BWindow::SetLayout(BLayout* layout) 1741 \brief Sets the \a layout of the window. 1742 1743 \param layout The \a layout to set. 1744*/ 1745 1746 1747/*! 1748 \fn BLayout* BWindow::GetLayout() const 1749 \brief Get the layout of the window. 1750 1751 \returns The layout of the window. 1752*/ 1753 1754 1755/*! 1756 \fn void BWindow::InvalidateLayout(bool descendants) 1757 \brief Invalidate layout. 1758 1759 \param descendants Also invalidate its children windows. 1760*/ 1761 1762 1763/*! 1764 \fn void BWindow::Layout(bool force) 1765 \brief Update the size limits and do the layout of the topmost view attached 1766 to the window. 1767 1768 \param force If \c true, layout even if valid. 1769*/ 1770 1771 1772/*! 1773 \fn status_t BWindow::GetSupportedSuites(BMessage* data) 1774 \brief Reports the suites of messages and specifiers understood by the window. 1775 1776 \param data The message to use to report the suite of messages and specifiers. 1777 1778 \see BHandler::GetSupportedSuites() 1779*/ 1780 1781 1782/*! 1783 \fn BHandler* BView::ResolveSpecifier(BMessage* message, int32 index, 1784 BMessage* specifier, int32 what, const char* property) 1785 \brief Determine the proper handler for a scripting message. 1786 1787 \see BHandler::ResolveSpecifier() 1788*/ 1789