1/* 2 * Copyright 2011-2015 Haiku, Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * John Scipione, jscipione@gmail.com 7 * Joseph Groover, looncraz@looncraz.net 8 * 9 * Corresponds to: 10 * headers/os/interface/View.h hrev497** 11 * src/kits/interface/View.cpp hrev497** 12 */ 13 14 15/*! 16 \file View.h 17 \ingroup interface 18 \ingroup libbe 19 \brief BView class definition and support data structures. 20 21 \since BeOS R5 22*/ 23 24 25// mouse buttons 26 27 28/*! 29 \var B_PRIMARY_MOUSE_BUTTON 30 \brief Primary mouse button mask parameter. 31 32 \since BeOS R3 33*/ 34 35 36/*! 37 \var B_SECONDARY_MOUSE_BUTTON 38 \brief Secondary mouse button mask parameter. 39 40 \since BeOS R3 41*/ 42 43 44/*! 45 \var B_TERTIARY_MOUSE_BUTTON 46 \brief Tertiary mouse button mask parameter. 47 48 \since BeOS R3 49*/ 50 51 52// mouse transit 53 54 55/*! 56 \var B_ENTERED_VIEW 57 \brief Mouse transit entered view. 58 59 \since BeOS R3 60*/ 61 62 63/*! 64 \var B_INSIDE_VIEW 65 \brief Mouse transit inside view. 66 67 \since BeOS R3 68*/ 69 70 71/*! 72 \var B_EXITED_VIEW 73 \brief Mouse transit exited view. 74 75 \since BeOS R3 76*/ 77 78 79/*! 80 \var B_OUTSIDE_VIEW 81 \brief Mouse transit outside view. 82 83 \since BeOS R5 84*/ 85 86 87// event mask 88 89 90/*! 91 \var B_POINTER_EVENTS 92 \brief Mouse pointer events mask parameter. 93 94 \since BeOS R5 95*/ 96 97 98/*! 99 \var B_KEYBOARD_EVENTS 100 \brief Keyboard events mask parameter. 101 102 \since BeOS R5 103*/ 104 105 106// event mask options 107 108 109/*! 110 \var B_LOCK_WINDOW_FOCUS 111 \brief Prevents the attached window from losing its focused state while 112 the mouse is held down. 113 114 \since BeOS R5 115*/ 116 117 118/*! 119 \var B_SUSPEND_VIEW_FOCUS 120 \brief Events normally sent to the focus view are suppressed. 121 122 \since BeOS R5 123*/ 124 125 126/*! 127 \var B_NO_POINTER_HISTORY 128 \brief Send only the most recent MouseMoved() event to the view. 129 130 \note New in Haiku: unless this flag is specified, both BWindow and 131 BView::GetMouse() will filter out older mouse moved messages. 132 133 \since BeOS R5 134*/ 135 136 137/*! 138 \var B_FULL_POINTER_HISTORY 139 \brief Send all MouseMoved() events to the view. 140 141 \since Haiku R1 142*/ 143 144 145// event tracking 146 147 148/*! 149 \var B_TRACK_WHOLE_RECT 150 \brief The whole rectangle moves with the cursor. 151 152 \since BeOS R3 153*/ 154 155 156/*! 157 \var B_TRACK_RECT_CORNER 158 \brief The left top corner is fixed while the right and bottom edges 159 move with the cursor. 160 161 \since BeOS R3 162*/ 163 164 165// set font mask 166 167 168/*! 169 \var B_FONT_FAMILY_AND_STYLE 170 \brief Font family and style mask parameter. 171 172 \since BeOS R3 173*/ 174 175 176/*! 177 \var B_FONT_SIZE 178 \brief Font size mask parameter. 179 180 \since BeOS R3 181*/ 182 183 184/*! 185 \var B_FONT_SHEAR 186 \brief Font shear mask parameter. 187 188 \since BeOS R3 189*/ 190 191 192/*! 193 \var B_FONT_ROTATION 194 \brief Font rotation mask parameter. 195 196 \since BeOS R3 197*/ 198 199 200/*! 201 \var B_FONT_SPACING 202 \brief Font spacing mask parameter. 203 204 \since BeOS R3 205*/ 206 207 208/*! 209 \var B_FONT_ENCODING 210 \brief Font encoding mask parameter. 211 212 \since BeOS R3 213*/ 214 215 216/*! 217 \var B_FONT_FACE 218 \brief Font face mask parameter. 219 220 \since BeOS R3 221*/ 222 223 224/*! 225 \var B_FONT_FLAGS 226 \brief Font flags mask parameter. 227 228 \since BeOS R3 229*/ 230 231 232/*! 233 \var B_FONT_FALSE_BOLD_WIDTH 234 \brief Font false bold width mask parameter. 235 236 \since Haiku R1 237*/ 238 239 240/*! 241 \var B_FONT_ALL 242 \brief Font all properties mask parameter. 243 244 \since BeOS R3 245*/ 246 247 248// view flags 249 250 251/*! 252 \var B_FULL_UPDATE_ON_RESIZE 253 \brief Redraw the entire view on resize. 254 255 \since BeOS R3 256*/ 257 258 259/*! 260 \var _B_RESERVED1_ 261 \brief Reserved for future use. 262 263 \since Haiku R1 264*/ 265 266 267/*! 268 \var B_WILL_DRAW 269 \brief Indicates that the view will do its own drawing. 270 271 \since BeOS R3 272*/ 273 274 275/*! 276 \var B_PULSE_NEEDED 277 \brief Indicates that the view accepts Pulse() messages. 278 279 \since BeOS R3 280*/ 281 282 283/*! 284 \var B_NAVIGABLE_JUMP 285 \brief Indicates this is the default keyboard navigation view. 286 287 \since BeOS R3 288*/ 289 290/*! 291 \var B_FRAME_EVENTS 292 \brief View responds to frame move and resize events. 293 294 \since BeOS R3 295*/ 296 297 298/*! 299 \var B_NAVIGABLE 300 \brief The view is able to receive focus for keyboard navigation. 301 Typically focus is indicated by drawing a blue rectangle around the view. 302 303 \since BeOS R3 304*/ 305 306 307/*! 308 \var B_SUBPIXEL_PRECISE 309 \brief The view draws with sub-pixel precision. 310 311 \since Haiku R1 312*/ 313 314 315/*! 316 \var B_DRAW_ON_CHILDREN 317 \brief Indicates that the view responds to the DrawAfterChildren() hook method. 318 319 \since BeOS R5 320*/ 321 322 323/*! 324 \var B_INPUT_METHOD_AWARE 325 \brief Allows the view to use input method add-ons to gain access to the 326 input methods needed for Japanese and other languages. 327 328 \since Haiku R1 329*/ 330 331 332/*! 333 \var _B_RESERVED7_ 334 \brief Reserved for future use. 335 336 \since Haiku R1 337*/ 338 339 340/*! 341 \var B_SUPPORTS_LAYOUT 342 \brief The view supports the layout APIs, i.e. it doesn't require an 343 frame rectangle to be specified. 344 345 \since Haiku R1 346*/ 347 348 349/*! 350 \var B_INVALIDATE_AFTER_LAYOUT 351 \brief Indicates that the view should be redraw after being added to 352 a layout. 353 354 \since Haiku R1 355*/ 356 357 358// resize mask variables, internal variables but are in a public header. 359 360 361/*! 362 \var _RESIZE_MASK_ 363 \brief Resize mask. Do not use. 364 365 \since Haiku R1 366*/ 367 368 369/*! 370 \var _VIEW_TOP_ 371 \brief View top mask variable. Do not use. 372 373 \since Haiku R1 374*/ 375 376 377/*! 378 \var _VIEW_LEFT_ 379 \brief View left mask variable. Do not use. 380 381 \since Haiku R1 382*/ 383 384 385/*! 386 \var _VIEW_BOTTOM_ 387 \brief View bottom mask variable. Do not use. 388 389 \since Haiku R1 390*/ 391 392 393/*! 394 \var _VIEW_RIGHT_ 395 \brief View right mask variable. Do not use. 396 397 \since Haiku R1 398*/ 399 400 401/*! 402 \var _VIEW_CENTER_ 403 \brief View center mask variable. Do not use. 404 405 \since Haiku R1 406*/ 407 408 409/*! 410 \fn inline uint32 _rule_(uint32 r1, uint32 r2, uint32 r3, uint32 r4) 411 \brief Internal function, do not use. 412 413 \since Haiku R1 414*/ 415 416 417// resize mask 418 419 420/*! 421 \var B_FOLLOW_NONE 422 \brief Follow none resize mask parameter. Equivalent to 423 \c B_FOLLOW_LEFT | \c B_FOLLOW_TOP. The view maintains its position 424 in its parent's coordinate system but not in the screen coordinate 425 system. 426 427 \since BeOS R3 428*/ 429 430 431/*! 432 \var B_FOLLOW_ALL_SIDES 433 \brief Follow all sides resize mask parameter. Equivalent to 434 \c B_FOLLOW_LEFT_RIGHT | \c B_FOLLOW_TOP_BOTTOM. The view will be resized 435 with its parent view both horizontally and vertically. 436 437 \since BeOS R3 438*/ 439 440 441/*! 442 \var B_FOLLOW_ALL 443 \brief Equivalent to \c B_FOLLOW_ALL_SIDES. 444 445 \since BeOS R3 446*/ 447 448 449// horizontal resize mask 450 451 452/*! 453 \var B_FOLLOW_LEFT 454 \brief The margin between the left side of the view and the left side 455 of its parent remains constant. 456 457 \since BeOS R3 458*/ 459 460 461/*! 462 \var B_FOLLOW_RIGHT 463 \brief The margin between the right side of the view and the right side 464 of its parent remains constant. 465 466 \since BeOS R3 467*/ 468 469 470/*! 471 \var B_FOLLOW_LEFT_RIGHT 472 \brief The margin between the left and right sides of the view and the left 473 and right sides of its parent both remain constant. 474 475 \since BeOS R3 476*/ 477 478 479/*! 480 \var B_FOLLOW_H_CENTER 481 \brief The view maintains a constant relationship to the horizontal center 482 of its parent view. 483 484 \since BeOS R3 485*/ 486 487 488// vertical resize mask 489 490 491/*! 492 \var B_FOLLOW_TOP 493 \brief The margin between the top of the view and the top of its parent 494 remains constant. 495 496 \since BeOS R3 497*/ 498 499 500/*! 501 \var B_FOLLOW_BOTTOM 502 \brief The margin between the bottom of the view and the bottom of its 503 parent remains constant. 504 505 \since BeOS R3 506*/ 507 508 509/*! 510 \var B_FOLLOW_TOP_BOTTOM 511 \brief The margin between the top and bottom sides of the view and the 512 top and bottom sides of its parent both remain constant. 513 514 \since BeOS R3 515*/ 516 517 518/*! 519 \var B_FOLLOW_V_CENTER 520 \brief The view maintains a constant relationship to the vertical center 521 of its parent view. 522 523 \since BeOS R3 524*/ 525 526 527/*! 528 \var B_FOLLOW_LEFT_TOP 529 \brief The margins between the left and top sides of the view and the left 530 and top sides of its parent remain constant. 531 532 \since Haiku R1 533*/ 534 535 536/*! 537 \class BView 538 \ingroup interface 539 \ingroup libbe 540 \brief View base class. 541 542 A BView is a rectangular area within a window that responds to mouse clicks 543 and key presses, and acts as a surface for you to draw on. 544 545 Most Interface Kit classes, with the notable exception of BWindow inherit from 546 BView. Some of the time you might use a BView object as is, but most of the 547 time you subclass BView to do something unique. 548 549 To create a subclass of BView you generally override one or more of BView's 550 hook methods to respond to user events such as MouseDown() or FrameMoved(). 551 By default a BView does nothing in its hook methods unless otherwise stated, 552 it's up to you to define what happens. To override the look of a BView you 553 should override the Draw() or DrawAfterChildren() methods. See the section on 554 Hook Methods below for more details. 555 556 When a BView object is first created it has no parent or child views. How you 557 add a view to the view hierarchy depends on if you want to use a standard 558 view with a defined frame rectangle or to use the Layout APIs to position and 559 size your view instead. 560 561 If you create a standard view you need to add it to a window or another view 562 using the AddChild() method, if you create a layout view you need to add your 563 view to a layout using BLayout::AddView() or by adding it to a layout builder. 564 565 Views are not very interesting until they, or one of their parents, are 566 attached to a window as many of BView's methods depend on a connection to the 567 App Server to do their work. In order to prevent multiple views from altering 568 the window simultaneously though locking is required. To perform an action 569 while the window is locked you issue the following code: 570 571\code 572if (Window()->LockLooper()) { 573 ... 574 Window()->UnlockLooper() 575} 576\endcode 577 578 Whenever App Server calls a hook method it automatically locks the BWindow for 579 you. 580 581 Only one view attached to a window is able to receive keyboard events at a 582 time. The view that is able to receive keyboard events such as KeyDown() is 583 called the "focus view". MakeFocus() gives or removes focus from a view. 584 Call IsFocus() to determine whether or not the view is the window's current 585 focus view. 586 587 When a view has focus an indicator should be drawn to inform the user. Typically 588 the view is surrounded by a blue rectangle to indicate that it is the window's 589 focus view. The color can be queried using the keyboard_navigation_color() 590 function in InterfaceDefs.h 591 592 Each view has its own coordinate system with the origin point (0.0, 0.0) 593 located at the top left corner. You can convert a BPoint or BRect to or from 594 the view's coordinate system to the coordinate system of its parent, or 595 of the screen's coordinate system. See the section on Coordinate Conversion 596 Methods for more details. 597 598 The Application Server clips a BView to the region where it's permitted to 599 draw which is never larger than the view's bound rectangle. A view can never 600 draw outside its bounds nor can it draw outside of the bounds rectangle of any 601 parent view. 602 603 You may limit the clipping region further by passing a BRegion object to 604 ConstrainClippingRegion(). You can obtain the current clipping region by 605 calling GetClippingRegion(). 606 607 Each view has a ViewColor() that fills the frame rectangle before the 608 view does any drawing of its own. The default view color is white, you may 609 change the view color by calling SetViewColor() or, as of Haiku R1, 610 SetViewUIColor(). A commonly used view color is \c B_PANEL_BACKGROUND_COLOR 611 which is a user-defined color used as the view color of most applications. 612 If you set the view color to \c B_TRANSPARENT_COLOR then the Application Server 613 won't erase the clipping region of the view before updating, this should only 614 be used if the view erases itself by drawing on every pixel in the clipping 615 region. 616 617 If you want to set the view color of a view to be the same as its parent you 618 need to set it within the AttachedToWindow() method of the view like so: 619 620\code 621SetViewColor(Parent()->ViewColor()); 622\endcode 623 624 \since BeOS R3 625*/ 626 627 628 629/*! 630 \fn BView::BView(const char* name, uint32 flags, BLayout* layout) 631 \brief Layout constructor. 632 633 To be used as part of a BLayout. You may use the Layout Methods found below 634 to set the size and alignment constraints of the view. 635 636 \c B_SUPPORTS_LAYOUT is automatically set to the view. The view flags can be 637 set after the view has been constructed by calling the SetFlags() methods. 638 639 \param name The name of the view, can be \c NULL. 640 \param flags The view flags, a mask of one or more of the following: 641 - \c B_FULL_UPDATE_ON_RESIZE Redraw the entire view on resize. 642 - \c B_WILL_DRAW Indicates that the view will do its own drawing. 643 - \c B_PULSE_NEEDED The view accepts Pulse() messages. 644 - \c B_NAVIGABLE_JUMP Default for keyboard navigation. 645 - \c B_FRAME_EVENTS Responds to move and resize events. 646 - \c B_NAVIGABLE Able to receive keyboard navigation focus. 647 - \c B_SUBPIXEL_PRECISE Draws with sub-pixel precision. 648 - \c B_DRAW_ON_CHILDREN Responds to DrawAfterChildren(). 649 - \c B_INPUT_METHOD_AWARE Allows access input method add-ons. 650 - \c B_SUPPORTS_LAYOUT Supports the layout APIs, i.e. it doesn't 651 use a frame rectangle. 652 - \c B_INVALIDATE_AFTER_LAYOUT Is redraw after added to a layout. 653 \param layout A \a layout to set the view to. 654 655 \since Haiku R1 656*/ 657 658 659/*! 660 \fn BView::BView(BRect frame, const char* name, uint32 resizingMode, 661 uint32 flags) 662 \brief Standard constructor. 663 664 A newly constructed BView object has no parent, you must assign it one by 665 passing it into the AddChild() method of another view or window. Once the 666 view or a parent view has been attached to a window the view becomes part of 667 that window's view hierarchy. 668 669 When the BView object is added as a child the \a frame values are interpreted 670 in the parent's coordinate system. The frame rectangle should be specified in 671 integral values to align on pixel boundaries, decimal values will be rounded. 672 673 The resizing mode flags and view flags can be set after the view has been 674 constructed by calling the SetResizingMode() and SetFlags() methods. 675 676 \param frame The \a frame rectangle of the view. 677 \param name The name of the view, can be \c NULL. 678 \param resizingMode Defines the view's behavior when its parent is resized. 679 \n\n It combines one of the following horizontal resizing constants: 680 \li \c B_FOLLOW_TOP The margin between the top of the view and the top 681 of its parent remains constant. 682 \li \c B_FOLLOW_BOTTOM The margin between the bottom of the view and 683 the bottom of its parent remains constant. 684 \li \c B_FOLLOW_TOP_BOTTOM The margin between the top and bottom sides 685 of the view and the top and bottom sides of the parent both remain 686 constant. 687 \li \c B_FOLLOW_V_CENTER Maintains a constant relationship to the 688 vertical center of the parent view. 689 690 with one of the following vertical resizing constants: 691 \li \c B_FOLLOW_LEFT The margin between the left side of the view and 692 the left side of its parent remains constant. 693 \li \c B_FOLLOW_RIGHT The margin between the right side of the view and 694 the right side of the parent remains constant. 695 \li \c B_FOLLOW_LEFT_RIGHT The margin between the left and right sides 696 of the view and the left and right sides of its parent both remain 697 constant. 698 \li \c B_FOLLOW_H_CENTER The view maintains a constant relationship to 699 the horizontal center of the parent view. 700 701 or use one of the following combined horizontal/vertical constants: 702 \li \c B_FOLLOW_NONE Equivalent to \c B_FOLLOW_LEFT | \c B_FOLLOW_TOP. 703 \li \c B_FOLLOW_ALL_SIDES Equivalent to 704 \c B_FOLLOW_LEFT_RIGHT | \c B_FOLLOW_TOP_BOTTOM. 705 \param flags The view flags, a mask of one or more of the following: 706 - \c B_FULL_UPDATE_ON_RESIZE Redraw the entire view on resize. 707 - \c B_WILL_DRAW Indicates that the view will do its own drawing. 708 - \c B_PULSE_NEEDED The view accepts Pulse() messages. 709 - \c B_NAVIGABLE_JUMP Default for keyboard navigation. 710 - \c B_FRAME_EVENTS Responds to move and resize events. 711 - \c B_NAVIGABLE Able to receive keyboard navigation focus. 712 - \c B_SUBPIXEL_PRECISE Draws with sub-pixel precision. 713 - \c B_DRAW_ON_CHILDREN Responds to DrawAfterChildren(). 714 - \c B_INPUT_METHOD_AWARE Allows access input method add-ons. 715 - \c B_SUPPORTS_LAYOUT Supports the layout APIs, i.e. it doesn't 716 use a frame rectangle. 717 - \c B_INVALIDATE_AFTER_LAYOUT Is redraw after added to a layout. 718 719 \since BeOS R3 720*/ 721 722 723/*! 724 \fn BView::BView(BMessage* archive) 725 \brief Archive constructor. 726 727 \param archive The message data to construct the view from. 728 729 \since BeOS R3 730*/ 731 732 733/*! 734 \fn BView::~BView() 735 \brief Destructor method. 736 737 Deletes the view and all children freeing any memory used. 738 739 \since BeOS R3 740*/ 741 742 743/*! 744 \name Archiving 745*/ 746 747 748//! @{ 749 750 751/*! 752 \fn BArchivable* BView::Instantiate(BMessage* data) 753 \brief Creates a new BView object from the \a data message. 754 755 \returns A newly created BView object or \c NULL if the message doesn't 756 contain an archived BView. 757 758 \since BeOS R3 759*/ 760 761 762/*! 763 \fn status_t BView::Archive(BMessage* data, bool deep) const 764 \brief Archives the object into the \a data message. 765 766 \param data A pointer to the BMessage object to archive the object into. 767 \param deep Whether or not to archive child views as well. 768 769 \return A status code, \c B_OK if everything went well or an error code 770 otherwise. 771 \retval B_OK The object was archived successfully. 772 \retval B_NO_MEMORY Ran out of memory while archiving the object. 773 774 \since BeOS R3 775*/ 776 777 778//! @} 779 780 781/*! 782 \name Hook Methods 783*/ 784 785 786//! @{ 787 788 789/*! 790 \fn status_t BView::AllUnarchived(const BMessage* from) 791 \brief Hook method called when all views have been unarchived. 792 793 \since BeOS R3 794*/ 795 796 797/*! 798 \fn status_t BView::AllArchived(BMessage* into) const 799 \brief Hook method called when all views have been archived. 800 801 \since BeOS R3 802*/ 803 804 805/*! 806 \fn void BView::AllAttached() 807 \brief Similar to AttachedToWindow() but this method is triggered after 808 all child views have already been attached to a window. 809 810 \since BeOS R3 811*/ 812 813 814/*! 815 \fn void BView::DetachedFromWindow() 816 \brief Hook method called when the object is detached from a window. 817 818 \since BeOS R3 819*/ 820 821 822/*! 823 \fn void BView::AttachedToWindow() 824 \brief Hook method called when the object is attached to a window. 825 826 \since BeOS R3 827*/ 828 829 830/*! 831 \fn void BView::AllDetached() 832 \brief Similar to AttachedToWindow() but this method is triggered after 833 all child views have already been detached from a window. 834 835 \since BeOS R3 836*/ 837 838 839/*! 840 \fn void BView::Draw(BRect updateRect) 841 \brief Draws the area of the view that intersects \a updateRect. 842 843 Derived classes should override this method to draw their view. 844 845 \remark This is an hook method called by the Interface Kit, you don't have to 846 call it yourself. If you need to forcefully redraw the view consider 847 calling Invalidate() instead. 848 849 \param updateRect The rectangular area to be drawn. 850 851 \since BeOS R3 852*/ 853 854 855/*! 856 \fn void BView::DrawAfterChildren(BRect updateRect) 857 \brief Perform any drawing that needs to be done after child view have 858 already been drawn. 859 860 \param updateRect The rectangular area to drawn in. 861 862 \since BeOS R5 863*/ 864 865 866/*! 867 \fn void BView::FrameMoved(BPoint newPosition) 868 \brief Hook method called when the view is moved. 869 870 \param newPosition The point of the top left corner of the frame 871 that the view has been moved to. 872 873 \since BeOS R3 874*/ 875 876 877/*! 878 \fn void BView::FrameResized(float newWidth, float newHeight) 879 \brief Hook method called when the view is resized. 880 881 \param newWidth The new width of the view. 882 \param newHeight The new height of the view. 883 884 \since BeOS R3 885*/ 886 887 888/*! 889 \fn void BView::KeyDown(const char* bytes, int32 numBytes) 890 \brief Hook method called when a keyboard key is pressed. 891 892 \param bytes The bytes of the key combination pressed. 893 \param numBytes The number of bytes in \a bytes. 894 895 \since BeOS R3 896*/ 897 898 899/*! 900 \fn void BView::KeyUp(const char* bytes, int32 numBytes) 901 \brief Hook method called when a keyboard key is released. 902 903 \param bytes The bytes of the key combination pressed. 904 \param numBytes The number of bytes in \a bytes. 905 906 \since BeOS R3 907*/ 908 909 910/*! 911 \fn void BView::LayoutInvalidated(bool descendants) 912 \brief Hook method called when the layout is invalidated. 913 914 \param descendants Whether or not child views have also been invalidated. 915 916 \since Haiku R1 917*/ 918 919 920/*! 921 \fn void BView::MessageReceived(BMessage* message) 922 \brief Handle \a message received by the associated looper. 923 924 \param message The \a message received by the associated looper. 925 926 \see BHandler::MessageReceived() 927 928 \since BeOS R3 929*/ 930 931 932/*! 933 \fn void BView::MouseDown(BPoint where) 934 \brief Hook method called when a mouse button is pressed. 935 936 \param where The point on the screen where to mouse pointer is when 937 the mouse button is pressed. 938 939 \since BeOS R3 940*/ 941 942 943/*! 944 \fn void BView::MouseUp(BPoint where) 945 \brief Hook method called when a mouse button is released. 946 947 \param where The point on the screen where to mouse pointer is when 948 the mouse button is released. 949 950 \since BeOS R3 951*/ 952 953 954/*! 955 \fn void BView::MouseMoved(BPoint where, uint32 code, 956 const BMessage* dragMessage) 957 \brief Hook method called when the mouse is moved. 958 959 \param where The new location of the mouse in the view's coordinate system. 960 \param code One of the following: 961 - \c B_ENTERED_VIEW The cursor has just entered the view. 962 - \c B_INSIDE_VIEW The cursor is inside the view. 963 - \c B_EXITED_VIEW The cursor has left the view's bounds. This only gets sent 964 if the scope of the mouse events that the view can receive has been 965 expanded by SetEventMask() or SetMouseEventMask(). 966 - \c B_OUTSIDE_VIEW The cursor is outside the view. This only gets sent if the 967 scope of the mouse events that the view can receive has been expanded by 968 SetEventMask() or SetMouseEventMask(). 969 \param dragMessage If a drag-and-drop operation is taking place this is a 970 pointer to a BMessage that holds the drag information, otherwise the 971 pointer is \c NULL. 972 973 \sa SetEventMask(), SetMouseEventMask() 974 \sa DragMessage() 975 976 \since BeOS R3 977*/ 978 979 980/*! 981 \fn void BView::Pulse() 982 \brief Hook method called when the view receives a \c B_PULSE 983 message. 984 985 An action is performed each time the App Server calls the Pulse() method. 986 The pulse rate is set by SetPulseRate(). You can implement Pulse() to do 987 anything you want. The default version does nothing. The pulse granularity 988 is no better than once per 100,000 microseconds. 989 990 \sa SetPulseRate() 991 992 \since BeOS R3 993*/ 994 995 996/*! 997 \fn void BView::TargetedByScrollView(BScrollView* scrollView) 998 \brief Hook method called when the view becomes the target of 999 \a scrollView. 1000 1001 \param scrollView The BScrollView object that has targeted the view. 1002 1003 \since Haiku R1 1004*/ 1005 1006 1007/*! 1008 \fn void BView::WindowActivated(bool active) 1009 \brief Hook method called when the attached window is activated or 1010 deactivated. 1011 1012 \param active \c true when the window becomes activated, \c false when the 1013 window becomes deactivated. 1014 1015 \since BeOS R3 1016*/ 1017 1018 1019//! @} 1020 1021 1022/*! 1023 \fn BRect BView::Bounds() const 1024 \brief Returns the view's frame rectangle in the view's coordinate system. 1025 1026 \return The view's bounding rectangle in the view's coordinate system. 1027 1028 \since BeOS R3 1029*/ 1030 1031 1032/*! 1033 \fn BRect BView::Frame() const 1034 \brief Returns the view's frame rectangle in the parent's coordinate system. 1035 1036 \returns The view's frame rectangle in the parent's coordinate system. 1037 1038 \since BeOS R3 1039*/ 1040 1041 1042/*! 1043 \name Coordinate Conversions 1044*/ 1045 1046 1047//! @{ 1048 1049 1050/*! 1051 \fn void BView::ConvertToParent(BPoint* point) const 1052 \brief Convert \a point to the parent's coordinate system in place. 1053 1054 \param point A pointer to a BPoint object to convert. 1055 1056 \since BeOS R3 1057*/ 1058 1059 1060/*! 1061 \fn BPoint BView::ConvertToParent(BPoint point) const 1062 \brief Returns \a point converted to the parent's coordinate system. 1063 1064 \param point A BPoint object to convert. 1065 1066 \return A new BPoint object in the parent's coordinate system. 1067 1068 \since BeOS R3 1069*/ 1070 1071 1072/*! 1073 \fn void BView::ConvertFromParent(BPoint* point) const 1074 \brief Convert \a point from the parent's coordinate system to the 1075 view's coordinate system in place. 1076 1077 \param point A pointer to a BPoint object to convert. 1078 1079 \since BeOS R3 1080*/ 1081 1082 1083/*! 1084 \fn BPoint BView::ConvertFromParent(BPoint point) const 1085 \brief Returns \a point converted from the parent's coordinate system to 1086 the view's coordinate system. 1087 1088 \param point A BPoint object to convert. 1089 1090 \return A new BPoint object in the view's coordinate system. 1091 1092 \since BeOS R3 1093*/ 1094 1095 1096/*! 1097 \fn void BView::ConvertToParent(BRect* rect) const 1098 \brief Convert \a rect to the parent's coordinate system in place. 1099 1100 \param rect A pointer to a BRect object to convert. 1101 1102 \since BeOS R3 1103*/ 1104 1105 1106/*! 1107 \fn BRect BView::ConvertToParent(BRect rect) const 1108 \brief Returns \a rect converted to the parent's coordinate system. 1109 1110 \param rect A BRect object to convert. 1111 1112 \return A new BRect object in the parent's coordinate system. 1113 1114 \since BeOS R3 1115*/ 1116 1117 1118/*! 1119 \fn void BView::ConvertFromParent(BRect* rect) const 1120 \brief Convert \a rect from the parent's coordinate system to the 1121 view's coordinate system in place. 1122 1123 \param rect A pointer to a BRect object to convert. 1124 1125 \since BeOS R3 1126*/ 1127 1128 1129/*! 1130 \fn BRect BView::ConvertFromParent(BRect rect) const 1131 \brief Returns \a rect converted from the parent's coordinate system to the 1132 view's coordinate system. 1133 1134 \param rect A BRect object to convert. 1135 1136 \return A new BRect object in the view's coordinate system. 1137 1138 \since BeOS R3 1139*/ 1140 1141 1142/*! 1143 \fn void BView::ConvertToScreen(BPoint* point) const 1144 \brief Convert \a point to the screen's coordinate system in place. 1145 1146 \param point A pointer to a BPoint object to convert. 1147 1148 \since BeOS R3 1149*/ 1150 1151 1152/*! 1153 \fn BPoint BView::ConvertToScreen(BPoint point) const 1154 \brief Returns \a point converted to the screen's coordinate system. 1155 1156 \param point A BPoint object to convert. 1157 1158 \return A new BPoint object in the screen's coordinate system. 1159 1160 \since BeOS R3 1161*/ 1162 1163 1164/*! 1165 \fn void BView::ConvertFromScreen(BPoint* point) const 1166 \brief Convert \a point from the screen's coordinate system to the 1167 view's coordinate system in place. 1168 1169 \param point A pointer to a BPoint object to convert. 1170 1171 \since BeOS R3 1172*/ 1173 1174 1175/*! 1176 \fn BPoint BView::ConvertFromScreen(BPoint point) const 1177 \brief Returns \a point converted from the screen's coordinate system to 1178 the view's coordinate system. 1179 1180 \param point A BPoint object to convert. 1181 1182 \return A new BPoint object in the view's coordinate system. 1183 1184 \since BeOS R3 1185*/ 1186 1187 1188/*! 1189 \fn void BView::ConvertToScreen(BRect* rect) const 1190 \brief Convert \a rect to the screen's coordinate system in place. 1191 1192 \param rect A pointer to a BRect object to convert. 1193 1194 \since BeOS R3 1195*/ 1196 1197 1198/*! 1199 \fn BRect BView::ConvertToScreen(BRect rect) const 1200 \brief Returns \a rect converted to the screen's coordinate system. 1201 1202 \param rect A BRect object to convert. 1203 1204 \return A new BRect object in the screen's coordinate system. 1205 1206 \since BeOS R3 1207*/ 1208 1209 1210/*! 1211 \fn void BView::ConvertFromScreen(BRect* rect) const 1212 \brief Convert \a rect from the screen's coordinate system to the 1213 view's coordinate system in place. 1214 1215 \param rect A pointer to a BRect object to convert. 1216 1217 \since BeOS R3 1218*/ 1219 1220 1221/*! 1222 \fn BRect BView::ConvertFromScreen(BRect rect) const 1223 \brief Returns \a rect converted from the screen's coordinate system to the 1224 view's coordinate system. 1225 1226 \param rect A BRect object to convert. 1227 1228 \return A new BRect object in the view's coordinate system. 1229 1230 \since BeOS R3 1231*/ 1232 1233 1234//! @} 1235 1236 1237/*! 1238 \fn uint32 BView::Flags() const 1239 \brief Return the view flags set in the constructor or by SetFlags(). 1240 1241 \return The view flags as a uint32 mask. 1242 1243 \sa SetFlags() 1244 1245 \since BeOS R3 1246*/ 1247 1248 1249/*! 1250 \fn void BView::SetFlags(uint32 flags) 1251 \brief Sets the view flags to the \a flags mask. 1252 1253 \param flags The view flags to set as a uint32 mask. 1254 1255 \sa Flags() 1256 1257 \since BeOS R3 1258*/ 1259 1260 1261//! @} 1262 1263 1264/*! 1265 \fn void BView::Hide() 1266 \brief Hides the view without removing it from the view hierarchy. 1267 1268 Calls to Hide() and Show() are cumulative. A visible view becomes hidden 1269 once the number of Hide() calls exceeds the number of Show() calls. 1270 1271 \sa Show() 1272 \sa BWindow::Hide() 1273 \sa IsHidden() 1274 1275 \since BeOS R3 1276*/ 1277 1278 1279/*! 1280 \fn void BView::Show() 1281 \brief Shows the view making it visible. 1282 1283 Calls to Hide() and Show() are cumulative. A hidden view becomes visible 1284 again once the number of Show() calls matches the number of Hide() calls. 1285 1286 \sa Hide() 1287 \sa BWindow::Show() 1288 \sa IsHidden() 1289 1290 \since BeOS R3 1291*/ 1292 1293 1294/*! 1295 \fn bool BView::IsFocus() const 1296 \brief Returns whether or not the view is the window's current focus view. 1297 1298 The focus view changes as the user moves from one view to another either 1299 by pushing the tab key or by clicking a new view with the mouse. The change 1300 can be made programmatically via the MakeFocus() method. 1301 1302 \returns \c true if the view is the current focus view, \c false otherwise. 1303 1304 \sa MakeFocus() 1305 \sa BWindow::CurrentFocus() 1306 1307 \since BeOS R3 1308*/ 1309 1310 1311/*! 1312 \fn bool BView::IsHidden(const BView* lookingFrom) const 1313 \brief Returns whether or not the view is hidden from the perspective of 1314 \a lookingFrom. 1315 1316 A view is considered hidden if it, any of its parent views, or the window 1317 it's attached to has had the Hide() method called on it. This method 1318 allows you to determine the hidden status of a view from a different point 1319 on the view hierarchy. 1320 1321 \param lookingFrom The view used as a base when determining the hidden 1322 status of the BView object. 1323 1324 \return \c true if the view was hidden via the Hide() method, \c false 1325 otherwise. 1326 1327 \since Haiku R1 1328*/ 1329 1330 1331/*! 1332 \fn bool BView::IsHidden() const 1333 \brief Returns whether or not the view is hidden. 1334 1335 A view can be hidden either by calling Hide() on the view, calling Hide() 1336 on a parent view or calling Hide() on the window that the view is attached 1337 to. When a BWindow or BView is hidden, all its descendants are also hidden. 1338 1339 This method only returns whether the view or an ancestor view has had the 1340 Hide() method called on it, it doesn't consider if the view is obscured 1341 by another view or is off-screen. A BView is not hidden by default. 1342 1343 \return \c true if the view was hidden via the Hide() method, \c false 1344 otherwise. 1345 1346 \since BeOS R3 1347*/ 1348 1349 1350/*! 1351 \fn bool BView::IsPrinting() const 1352 \brief Returns whether or not the view is drawing to a printer. 1353 1354 This method should only be called from the Draw() or DrawAfterChildren() 1355 methods. If called from any other method this method returns \c false. 1356 1357 The view may choose different fonts, images, or colors when drawing to a 1358 printer vs. when drawing to the screen. 1359 1360 \return Returns \c true if drawing to a printer, \c false otherwise. 1361 1362 \since BeOS R3 1363*/ 1364 1365 1366/*! 1367 \fn BPoint BView::LeftTop() const 1368 \brief Returns the left top corner point. 1369 1370 \return The left top corner of the view as a BPoint object. 1371 1372 \since BeOS R3 1373*/ 1374 1375 1376/*! 1377 \fn void BView::SetResizingMode(uint32 mode) 1378 \brief Sets the resizing mode of the view according to the \a mode mask. 1379 1380 The resizing mode is first set in the BView constructor. 1381 1382 \sa ResizingMode() 1383 1384 \since BeOS R3 1385*/ 1386 1387 1388/*! 1389 \fn uint32 BView::ResizingMode() const 1390 \brief Returns the resizing mode flags mask set in the constructor or by 1391 SetResizingMode(). 1392 1393 \returns the current resizing mode flags as a uint32 mask. 1394 1395 \sa SetResizingMode() 1396 1397 \since BeOS R3 1398*/ 1399 1400 1401/*! 1402 \fn void BView::SetViewCursor(const BCursor* cursor, bool sync) 1403 \brief Assigns \a cursor to the view. 1404 1405 This cursor will be displayed when the mouse is positioned inside the view. 1406 1407 \param cursor The BCursor object to assign to the view. 1408 \param sync If \c true App Server is synchronized immediately forcing the 1409 change to occur. If \c false, the change will be put in the queue and 1410 will take effect when the pending requests are processed. 1411 1412 \since BeOS R5 1413*/ 1414 1415 1416/*! 1417 \fn void BView::Flush() const 1418 \brief Flushes the attached window's connection to App Server. 1419 1420 \note If the view isn't attached to a window, Flush() does nothing. 1421 1422 \since BeOS R3 1423*/ 1424 1425 1426/*! 1427 \fn void BView::Sync() const 1428 \brief Synchronizes the attached window's connection to App Server. 1429 1430 \warning If the view isn't attached to a window, Sync() might crash the 1431 application. 1432 1433 \since BeOS R3 1434*/ 1435 1436 1437/*! 1438 \fn BWindow* BView::Window() const 1439 \brief Returns the window the view is attached to. 1440 1441 \return The window the view is attached to or \c NULL if the view isn't 1442 attached to a window. 1443 1444 \since BeOS R3 1445*/ 1446 1447 1448/*! 1449 \fn void BView::GetPreferredSize(float* _width, float* _height) 1450 \brief Fill out the preferred width and height of the view 1451 into the \a _width and \a _height parameters. 1452 1453 Derived classes should override this method to set the preferred 1454 size of object. 1455 1456 \remark Either the \a _width or \a _height parameter may be set to \c NULL 1457 if you only want to get the other one. 1458 1459 \param[out] _width Pointer to a float to store the width of the view. 1460 \param[out] _height Pointer to a float to store the height of the view. 1461 1462 \since BeOS R3 1463*/ 1464 1465 1466/*! 1467 \fn void BView::ResizeToPreferred() 1468 \brief Resizes the view to its preferred size keeping the position of the 1469 left top corner constant. 1470 1471 \warning It is not recommended to use this method for views that are part 1472 of a BLayout. 1473 1474 \since BeOS R3 1475*/ 1476 1477 1478/*! 1479 \name Input Related 1480*/ 1481 1482 1483//! @{ 1484 1485 1486/*! 1487 \fn void BView::BeginRectTracking(BRect startRect, uint32 style) 1488 \brief Displays an outline rectangle on the view and initiates tracking. 1489 1490 This method is typically called from the MouseDown() while EndRectTracking() 1491 is typically called from the MouseUp method(). 1492 1493 \param startRect The initial frame in the view's coordinate system. 1494 \param style This parameter is set to one of the following: 1495 - \c B_TRACK_WHOLE_RECT The position of the rect changes with the cursor 1496 while its size remains the same. 1497 - \c B_TRACK_RECT_CORNER The left top corner is fixed while the right and 1498 bottom edges move with the cursor. 1499 1500 \since BeOS R3 1501*/ 1502 1503 1504/*! 1505 \fn void BView::EndRectTracking() 1506 \brief Ends tracking removing the outline rectangle from the view. 1507 1508 BeginRectTracking() is typically called from the MouseDown() while this 1509 method is typically called from the MouseUp() method. 1510 1511 \since BeOS R3 1512*/ 1513 1514 1515/*! 1516 \fn void BView::DragMessage(BMessage* message, BRect dragRect, 1517 BHandler* replyTo) 1518 \brief Initiates a drag-and-drop session. 1519 1520 \warning This method only works if the BView objects are attached to a 1521 window. 1522 1523 \param message Contains data to be dragged and dropped on the destination 1524 view. The caller retains responsibility for this object. 1525 \param dragRect An outline rectangle used in place of a bitmap image set in 1526 the view's coordinate system. 1527 \param replyTo The target set to handle the message sent in reply to the 1528 dragged message. If \c NULL the reply is instead directed to the 1529 BView object that initiated the drag-and-drop session. 1530 1531 \since BeOS R3 1532*/ 1533 1534 1535/*! 1536 \fn void BView::DragMessage(BMessage* message, BBitmap* image, 1537 BPoint offset, BHandler* replyTo) 1538 \brief Initiates a drag-and-drop session of an \a image. 1539 1540 \warning This method only works if the BView objects are attached to a 1541 window. 1542 1543 \param message Contains data to be dragged and dropped on the destination 1544 view. The caller retains responsibility for this object. 1545 \param image Bitmap image dragged by the user. The memory used by the bitmap 1546 is freed automatically when the message is dropped. 1547 \param offset The offset to the hotspot within the image in the bitmap's 1548 coordinate system. 1549 \param replyTo The target set to handle the message sent in reply to the 1550 dragged message. If \c NULL the reply is instead directed to the 1551 BView object that initiated the drag-and-drop session. 1552 1553 \since BeOS R3 1554*/ 1555 1556 1557/*! 1558 \fn void BView::DragMessage(BMessage* message, BBitmap* image, 1559 drawing_mode dragMode, BPoint offset, BHandler* replyTo) 1560 \brief Initiates a drag-and-drop session of an \a image with drawing_mode 1561 set by \a dragMode. 1562 1563 \warning This method only works if the BView objects are attached to a 1564 window. 1565 1566 \param message Contains data to be dragged and dropped on the destination 1567 view. The caller retains responsibility for this object. 1568 \param image Bitmap image dragged by the user. The memory used by the bitmap 1569 is freed automatically when the message is dropped. 1570 \param dragMode Sets the drawing_mode used to draw the dragged image. Set to 1571 \c B_OP_ALPHA to drag-and-drop partially transparent images. 1572 \param offset The offset to the hotspot within the image in the bitmap's 1573 coordinate system. 1574 \param replyTo The target set to handle the message sent in reply to the 1575 dragged message. If \c NULL the reply is instead directed to the 1576 BView object that initiated the drag-and-drop session. 1577 1578 \since BeOS R5 1579*/ 1580 1581 1582/*! 1583 \fn void BView::GetMouse(BPoint* _location, uint32* _buttons, 1584 bool checkMessageQueue) 1585 \brief Fills out the cursor location and the current state of the mouse 1586 buttons. 1587 1588 The cursor doesn't have to be located within the view for this method to work, 1589 however, the view must be attached to a window. Don't use this method to track 1590 the mouse in your derived view, implement MouseMoved() instead. 1591 1592 \param[out] _location Filled out with the cursor location in the view's 1593 coordinate system. 1594 \param[out] _buttons Filled out with a mask of the following values: 1595 - \c B_PRIMARY_MOUSE_BUTTON 1596 - \c B_SECONDARY_MOUSE_BUTTON 1597 - \c B_TERTIARY_MOUSE_BUTTON 1598 \param checkMessageQueue If \c true pull from any pending MouseMoved() or 1599 MouseUp() events in the message queue top down before filling out 1600 the current mouse cursor state. 1601 1602 \since BeOS R3 1603*/ 1604 1605 1606/*! 1607 \fn void BView::MakeFocus(bool focus) 1608 \brief Makes the view the current focus view of the window or gives up 1609 being the window's focus view. 1610 1611 The focus view handles selections and KeyDown events when the the attached 1612 window is active. There can be only one focus view at a time per window. 1613 1614 When called with \a focus set to \c true this method first calls 1615 MakeFocus() on the previously focused view with \a focus set to 1616 \c false. 1617 1618 The focus doesn't automatically change when MouseDown() is called so calling 1619 MakeFocus() is the only way to make a view the focus view of a window. 1620 Classes derived from BView that can display the current selection, or that 1621 can accept pasted data should call MakeFocus() in their MouseDown() method 1622 to update the focus view of the window on click. 1623 1624 If the view isn't attached to a window this method has no effect. 1625 1626 \param focus \a true to set focus, \a false to remove it. 1627 1628 \since BeOS R3 1629*/ 1630 1631 1632/*! 1633 \fn BScrollBar* BView::ScrollBar(orientation posture) const 1634 \brief Returns the BScrollBar object that has the BView set as its target. 1635 1636 \param posture Either \c B_VERTICAL to get the vertical scroll bar or 1637 \c B_HORIZONTAL to get the horizontal scroll bar. 1638 1639 \returns the Scrollbar object requested or \c NULL if none found. 1640 1641 \see BScrollBar::SetTarget() 1642 1643 \since BeOS R3 1644*/ 1645 1646 1647/*! 1648 \fn void BView::ScrollBy(float deltaX, float deltaY) 1649 \brief Scroll the view by \a deltaX horizontally and \a deltaY vertically. 1650 1651 \param deltaX The amount to scroll horizontally. 1652 \param deltaY The amount to scroll vertically. 1653 1654 \since BeOS R3 1655*/ 1656 1657 1658/*! 1659 \fn void BView::ScrollTo(BPoint where) 1660 \brief Scroll the view to the point specified by \a where. 1661 1662 \param where The location to scroll the view to. 1663 1664 \since BeOS R3 1665*/ 1666 1667 1668/*! 1669 \fn void BView::ScrollWithMouseWheelDelta(BScrollBar* scrollBar, 1670 float delta) 1671 \brief Handle the scroll wheel changing over scrollbars. 1672 1673 - Extract the scrollbar change based on the mouse wheel \a delta into a 1674 protected method of BView. 1675 - The method is called from the MessageReceived() method of BScrollBar. 1676 1677 With this change it is now a bit easier to scroll horizontally around the 1678 system by putting the mouse cursor over a horizontal scrollbar and using 1679 the wheel. 1680 1681 \since Haiku R1 1682*/ 1683 1684 1685/*! 1686 \fn status_t BView::SetEventMask(uint32 mask, uint32 options) 1687 \brief Sets whether or not the view can accept mouse and keyboard 1688 events when not in focus. 1689 1690 If \a mask includes \c B_POINTER_EVENTS then the view will receive mouse 1691 events even when the mouse isn't over the view and if it includes 1692 \c B_KEYBOARD_EVENTS the view will receive keyboard events even if it 1693 isn't in focus. 1694 1695 The \a options mask options are as follows: 1696 - \c B_NO_POINTER_HISTORY Tells App Server to only send the most recent 1697 MouseMoved() event to the view sacrificing some granularity. 1698 - \c B_FULL_POINTER_HISTORY Tells App Server to send all MouseMoved() 1699 events to the view. 1700 1701 \param mask The \a mask of \c B_POINTER_EVENTS and \c B_KEYBOARD_EVENTS 1702 to set. 1703 \param options Sets other event-handling options. 1704 1705 \return \c B_OK if everything went fine or an error code, usually 1706 \c B_ERROR if something went wrong. 1707 1708 \sa EventMask() 1709 1710 \since BeOS R5 1711*/ 1712 1713 1714/*! 1715 \fn uint32 BView::EventMask() 1716 \brief Returns the current event mask. 1717 1718 \return The current event mask as a uint32. 1719 1720 \sa SetEventMask() 1721 1722 \since BeOS R5 1723*/ 1724 1725 1726/*! 1727 \fn status_t BView::SetMouseEventMask(uint32 mask, uint32 options) 1728 \brief Sets whether or not the view can accept mouse and keyboard 1729 events when not in focus from within MouseDown() until the 1730 following MouseUp() event. 1731 1732 The \a options mask options are as follows: 1733 - \c B_NO_POINTER_HISTORY Tells App Server to send only the most recent 1734 MouseMoved() event to the view sacrificing mouse movement granularity. 1735 - \c B_FULL_POINTER_HISTORY Tells App Server to send all MouseMoved() 1736 events to the view. 1737 - \c B_SUSPEND_VIEW_FOCUS Events normally sent to the focus view are 1738 suppressed. While the mouse is held down, the keyboard is ignored. 1739 The view receiving the MouseDown() messages doesn't have to be the 1740 focus view to suppress focused messages. 1741 - \c B_LOCK_WINDOW_FOCUS Prevents the attached window from losing its 1742 focused state while the mouse is held down, even if the mouse leaves 1743 the bounds of the window. 1744 1745 \param mask The \a mask of \c B_POINTER_EVENTS and \c B_KEYBOARD_EVENTS 1746 to set. 1747 \param options Sets other event-handling options. 1748 1749 \return \c B_OK if everything went fine or an error code, usually 1750 \c B_ERROR if something went wrong. 1751 1752 \since BeOS R5 1753*/ 1754 1755 1756//! @} 1757 1758 1759/*! 1760 \name Graphics State 1761*/ 1762 1763 1764//! @{ 1765 1766 1767/*! 1768 \fn void BView::PushState() 1769 \brief Saves the drawing state to the stack. 1770 1771 The drawing state contains the following elements: 1772 - local and global origins 1773 - local and global scales 1774 - local and global clipping regions 1775 - the current drawing mode 1776 - pen size and location 1777 - the font context 1778 - foreground and background color 1779 - line cap and join modes 1780 - miter limit 1781 - stipple pattern 1782 1783 A new state context is created after PushState() is called with a local scale 1784 at 0, a local origin at (0, 0), and no clipping region. 1785 1786 \since BeOS R3 1787*/ 1788 1789 1790/*! 1791 \fn void BView::PopState() 1792 \brief Restores the drawing state from the stack. 1793 1794 \since BeOS R3 1795*/ 1796 1797 1798/*! 1799 \fn void BView::SetOrigin(BPoint where) 1800 \brief Sets the origin in the view's coordinate system. 1801 1802 \param where The point to set the origin to. 1803 1804 \sa Origin() 1805 1806 \since BeOS R3 1807*/ 1808 1809 1810/*! 1811 \fn void BView::SetOrigin(float x, float y) 1812 \brief Sets the origin in the view's coordinate system. 1813 1814 \param x The x-coordinate to set the origin to. 1815 \param y The y-coordinate to set the origin to. 1816 1817 \sa Origin() 1818 1819 \since BeOS R3 1820*/ 1821 1822 1823/*! 1824 \fn BPoint BView::Origin() const 1825 \brief Returns the origin point in the view's coordinate system. 1826 1827 \return The local origin point in the view's coordinate system. 1828 1829 \sa SetOrigin() 1830 1831 \since BeOS R3 1832*/ 1833 1834 1835/*! 1836 \fn void BView::SetScale(float scale) const 1837 \brief Sets the scale of the coordinate system the view uses for drawing. 1838 1839 The default scale is 1.0. A \a scale value lower than 1.0 reduces the size of 1840 the drawing coordinate system, a \a scale value greater than 1.0 magnifies 1841 the coordinate system; for example, a \a scale value of 0.5 cuts the drawing 1842 drawing area in half moving the drawing closer to the origin while a \a scale 1843 value of 2.0 doubles the drawing area and moving it away from the origin. 1844 1845 Updating the \a scale of view won't update previously drawn elements. 1846 1847 SetScale() calls are not commutative unless you call them across different 1848 drawing states as the following: 1849 1850\code 1851 view->SetScale(2); 1852 view->SetScale(2); 1853 // view's scale is 2 1854 1855 view2->SetScale(2); 1856 view2->PushState(); 1857 view2->SetScale(2); 1858 // view2's scale is 4 1859\endcode 1860 1861 \param scale The scale factor to set. 1862 1863 \since BeOS R3 1864*/ 1865 1866 1867/*! 1868 \fn float BView::Scale() const 1869 \brief Return the current drawing scale. 1870 1871 \return The current drawing scale. 1872 1873 \since BeOS R3 1874*/ 1875 1876 1877/*! 1878 \fn void BView::SetLineMode(cap_mode lineCap, join_mode lineJoin, 1879 float miterLimit) 1880 \brief Set line mode to use PostScript-style line cap and join modes. 1881 1882 \a lineCap determines the shape of the endpoints of stroked paths while 1883 \a lineJoin determines the shape of the corners where two lines meet. 1884 1885 The default miter limit is 10.0 which gives an angle of 11.478341°. 1886 1887 \param lineCap One of the following: 1888 - \c B_ROUND_CAP A semicircle with diameter of line width is drawn at the 1889 endpoint. 1890 - \c B_BUTT_CAP A straight edge is drawn without extending beyond the endpoint. 1891 - \c B_SQUARE_CAP A straight edge is drawn extending past the endpoint by half 1892 the line width. 1893 \param lineJoin One of the following: 1894 - \c B_ROUND_JOIN Same as \c B_ROUND_CAP but for a join. 1895 - \c B_MITER_JOIN The lines are extended until they meet. If angle that they 1896 meet at is greater than the 2*arcsin(1/\a miterLimit) than a bevel join 1897 is used instead. 1898 - \c B_BEVEL_JOIN The area between the caps is filled with a triangle. 1899 - \c B_BUTT_JOIN Same as \c B_BUTT_CAP but for a join. 1900 - \c B_SQUARE_JOIN Same as \c B_SQUARE_CAP but for a join. 1901 \param miterLimit Sets the cut off angle before a miter join becomes a bevel 1902 join calculated by 2*arcsin(1/\a miterLimit). 1903 1904 \since BeOS R3 1905*/ 1906 1907 1908/*! 1909 \fn join_mode BView::LineJoinMode() const 1910 \brief Returns the current line join mode. 1911 1912 \return The current line join mode set to the view. 1913 1914 \since BeOS R3 1915*/ 1916 1917 1918/*! 1919 \fn cap_mode BView::LineCapMode() const 1920 \brief Returns the current line cap mode. 1921 1922 \return The current line cap mode set to the view. 1923 1924 \since BeOS R3 1925*/ 1926 1927 1928/*! 1929 \fn float BView::LineMiterLimit() const 1930 \brief Returns the miter limit used for \c B_MITER_JOIN join mode. 1931 1932 \return The current miter limit set to the view. 1933 1934 \since BeOS R3 1935*/ 1936 1937 1938/*! 1939 \fn void BView::SetDrawingMode(drawing_mode mode) 1940 \brief Sets the drawing mode of the view. 1941 1942 The default drawing mode is \c B_OP_COPY. 1943 1944 \param mode Set to one of the following: 1945 - \c B_OP_COPY 1946 - \c B_OP_OVER 1947 - \c B_OP_ERASE 1948 - \c B_OP_INVERT 1949 - \c B_OP_SELECT 1950 - \c B_OP_ALPHA 1951 - \c B_OP_MIN 1952 - \c B_OP_MAX 1953 - \c B_OP_ADD 1954 - \c B_OP_SUBTRACT 1955 - \c B_OP_BLEND 1956 1957 \since BeOS R3 1958*/ 1959 1960 1961/*! 1962 \fn drawing_mode BView::DrawingMode() const 1963 \brief Return the current drawing_mode. 1964 1965 \return The current drawing_mode. 1966 1967 \since BeOS R3 1968*/ 1969 1970 1971/*! 1972 \fn void BView::SetBlendingMode(source_alpha srcAlpha, 1973 alpha_function alphaFunc) 1974 \brief Set the blending mode which controls how transparency is used. 1975 1976 \param srcAlpha Set to one of the following: 1977 - \c B_CONSTANT_ALPHA Use the high color's alpha channel. 1978 - \c B_PIXEL_ALPHA Use the alpha value of each pixel when drawing a bitmap. 1979 \param alphaFunc Set to one of the following: 1980 - \c B_ALPHA_OVERLAY Used for drawing a image with transparency over an opaque 1981 background. 1982 - \c B_ALPHA_COMPOSITE Used to composite two or more transparent images 1983 together offscreen to produce a new image drawn using 1984 \c B_ALPHA_OVERLAY mode. 1985 1986 \since BeOS R5 1987*/ 1988 1989 1990/*! 1991 \fn void BView::GetBlendingMode(source_alpha* srcAlpha, 1992 alpha_function* alphaFunc) const 1993 \brief Fill out \a srcAlpha and \a alphaFunc with the alpha mode and 1994 alpha function of the view. 1995 1996 \param[out] srcAlpha The alpha mode to fill out. 1997 \param[out] alphaFunc The alpha function to fill out. 1998 1999 \since BeOS R5 2000*/ 2001 2002 2003/*! 2004 \fn void BView::MovePenTo(BPoint point) 2005 \brief Move the pen to \a point in the view's coordinate system. 2006 2007 \param point the location to move the pen to. 2008 2009 \since BeOS R3 2010*/ 2011 2012 2013/*! 2014 \fn void BView::MovePenTo(float x, float y) 2015 \brief Move the pen to the point specified by \a x and \a y in the view's 2016 coordinate system. 2017 2018 \param x The horizontal coordinate to move the pen to. 2019 \param y The vertical coordinate to move the pen to. 2020 2021 \since BeOS R3 2022*/ 2023 2024 2025/*! 2026 \fn void BView::MovePenBy(float x, float y) 2027 \brief Move the pen by \a x pixels horizontally and \a y pixels vertically. 2028 2029 \param x The number of pixels to move the pen horizontally. 2030 \param y The number of pixels to move the pen vertically. 2031 2032 \since BeOS R3 2033*/ 2034 2035 2036/*! 2037 \fn BPoint BView::PenLocation() const 2038 \brief Return the current pen location as a BPoint object. 2039 2040 \return The current pen location in the view's coordinate system. 2041 2042 \sa MovePenTo(BPoint) 2043 \sa MovePenTo(float, float) 2044 \sa MovePenBy(float, float) 2045 2046 \since BeOS R3 2047*/ 2048 2049 2050/*! 2051 \fn void BView::SetPenSize(float size) 2052 \brief Set the pen size to \a size. 2053 2054 \param size The pen size to set. 2055 2056 \since BeOS R3 2057*/ 2058 2059 2060/*! 2061 \fn float BView::PenSize() const 2062 \brief Return the current pen size. 2063 2064 \return The current pen size as a float. 2065 2066 \sa SetPenSize() 2067 2068 \since BeOS R3 2069*/ 2070 2071 2072/*! 2073 \fn bool BView::HasDefaultColors() const 2074 \brief Tests if the view has any colors set. 2075 2076 \return Boolean value, true if colors are not set. 2077 2078 \since Haiku R1 2079*/ 2080 2081 2082/*! 2083 \fn bool BView::HasSystemColors() const 2084 \brief Tests if the view is using system "panel" colors. 2085 B_PANEL_BACKGROUND_COLOR for ViewUIColor() 2086 B_PANEL_BACKGROUND_COLOR for LowUIColor() 2087 B_PANEL_TEXT_COLOR for HighUIColor() 2088 2089 \return Boolean value, true if colors are as described. 2090 2091 \since Haiku R1 2092*/ 2093 2094 2095/*! 2096 \fn void BView::AdoptParentColors() 2097 \brief Attempts to use the colors of any parent view. 2098 Will adopt view, low, and high colors. 2099 Should be called in AttachedToWindow() or AllAttached(). 2100 2101 \since Haiku R1 2102*/ 2103 2104 2105/*! 2106 \fn void BView::AdoptSystemColors() 2107 \brief Instructs view to use standard system "panel" colors. 2108 B_PANEL_BACKGROUND_COLOR for ViewUIColor() 2109 B_PANEL_BACKGROUND_COLOR for LowUIColor() 2110 B_PANEL_TEXT_COLOR for HighUIColor() 2111 2112 \since Haiku R1 2113*/ 2114 2115 2116/*! 2117 \fn void BView::AdoptViewColors(BView* view) 2118 \brief Attempts to use the colors of a given view. 2119 Will adopt view, low, and high colors. 2120 2121 \since Haiku R1 2122*/ 2123 2124 2125/*! 2126 \fn void BView::SetHighColor(rgb_color color) 2127 \brief Set the high color of the view. 2128 2129 \param color The color to set. 2130 2131 \since BeOS R3 2132*/ 2133 2134 2135/*! 2136 \fn void BView::SetHighColor(uchar red, uchar green, uchar blue, 2137 uchar alpha) 2138 \brief Set the high color of the view. 2139 2140 \param red The \a red component of the high color. 2141 \param green The \a green component of the high color. 2142 \param blue The \a blue component of the high color. 2143 \param alpha The \a alpha component of the high color. 2144 2145 \since BeOS R3 2146*/ 2147 2148 2149/*! 2150 \fn void BView::SetHighUIColor(color_which which, float tint) 2151 \brief Set the high color of the view to a system constant. 2152 The color will update live with user changes. 2153 2154 \param which The color_which constant to set. 2155 \param tint Optional tint value to use. 2156 2157 \since Haiku R1 2158*/ 2159 2160 2161/*! 2162 \fn rgb_color BView::HighColor() const 2163 \brief Return the current high color. 2164 2165 \return The current high color as an rgb_color struct. 2166 2167 \sa SetHighColor(rgb_color) 2168 \sa SetHighColor(uchar, uchar, uchar, uchar) 2169 2170 \since BeOS R3 2171*/ 2172 2173 2174/*! 2175 \fn color_which BView::HighUIColor(float* tint) const 2176 \brief Return the current high color constant being used. 2177 2178 \param tint Optional float pointer in which to store the tint 2179 value used to modify the system color constant. 2180 \return The current high color constant. 2181 2182 \sa SetHighUIColor(color_which, float) 2183 2184 \since Haiku R1 2185*/ 2186 2187 2188/*! 2189 \fn void BView::SetLowColor(rgb_color color) 2190 \brief Set the low color of the view. 2191 2192 \param color The color to set. 2193 2194 \since BeOS R3 2195*/ 2196 2197 2198/*! 2199 \fn void BView::SetLowColor(uchar red, uchar green, uchar blue, uchar alpha) 2200 \brief Set the low color of the view. 2201 2202 \param red The \a red component of the low color. 2203 \param green The \a green component of the low color. 2204 \param blue The \a blue component of the low color. 2205 \param alpha The \a alpha component of the low color. 2206 2207 \since BeOS R3 2208*/ 2209 2210 2211/*! 2212 \fn void BView::SetLowUIColor(color_which which, float tint) 2213 \brief Set the low color of the view to a system constant. 2214 The color will update live with user changes. 2215 2216 \param which The color_which constant to set. 2217 \param tint Optional tint value to use. 2218 2219 \since Haiku R1 2220*/ 2221 2222 2223/*! 2224 \fn rgb_color BView::LowColor() const 2225 \brief Return the current low color. 2226 2227 \return The current low color as an rgb_color struct. 2228 2229 \sa SetLowColor(rgb_color) 2230 \sa SetLowColor(uchar, uchar, uchar, uchar) 2231 2232 \since BeOS R3 2233*/ 2234 2235 2236/*! 2237 \fn color_which BView::LowUIColor(float* tint) const 2238 \brief Return the current low color constant being used. 2239 2240 \param tint Optional float pointer in which to store the tint 2241 value used to modify the system color constant. 2242 \return The current low color constant. 2243 2244 \sa SetLowUIColor(color_which, float) 2245 2246 \since Haiku R1 2247*/ 2248 2249 2250/*! 2251 \fn void BView::SetViewColor(rgb_color color) 2252 \brief Set the view color of the view. 2253 2254 \param color The color to set. 2255 2256 \since BeOS R3 2257*/ 2258 2259 2260/*! 2261 \fn void BView::SetViewColor(uchar red, uchar green, uchar blue, 2262 uchar alpha) 2263 \brief Set the view color of the view. 2264 2265 \param red The \a red component of the view color. 2266 \param green The \a green component of the view color. 2267 \param blue The \a blue component of the view color. 2268 \param alpha The \a alpha component of the view color. 2269 2270 \since BeOS R3 2271*/ 2272 2273 2274/*! 2275 \fn void BView::SetViewUIColor(color_which which, float tint) 2276 \brief Set the view color of the view to a system constant. 2277 The color will update live with user changes. 2278 2279 \param which The color_which constant to set. 2280 \param tint Optional tint value to use. 2281 2282 \since Haiku R1 2283*/ 2284 2285 2286/*! 2287 \fn rgb_color BView::ViewColor() const 2288 \brief Return the current view color. 2289 2290 \return The current view color as an rgb_color struct. 2291 2292 \sa SetViewColor(rgb_color) 2293 \sa SetViewColor(uchar, uchar, uchar, uchar) 2294 2295 \since BeOS R3 2296*/ 2297 2298 2299/*! 2300 \fn color_which BView::ViewUIColor(float* tint) const 2301 \brief Return the current view color constant being used. 2302 2303 \param tint Optional float pointer in which to store the tint 2304 value used to modify the system color constant. 2305 \return The current view color constant. 2306 2307 \sa SetViewUIColor(color_which, float) 2308 2309 \since Haiku R1 2310*/ 2311 2312 2313/*! 2314 \fn void BView::ForceFontAliasing(bool enable) 2315 \brief Turn anti-aliasing on and off when printing. 2316 2317 Typically want to turn font anti-aliasing off when printing by passing 2318 \c true to this method and then turn it on again by passing in \c false. 2319 2320 This method does not affect characters drawn to the screen. 2321 2322 \param enable If \c true turn off anti-aliasing, if \c false turn on 2323 anti-aliasing. 2324 2325 \since BeOS R5 2326*/ 2327 2328 2329/*! 2330 \fn void BView::SetFont(const BFont* font, uint32 mask) 2331 \brief Set the font of the view. 2332 2333 By passing \c B_FONT_ALL to the \a mask parameter as is the default all 2334 font properties from \a font are set on the view. 2335 2336 \param font A pointer to a const BFont object to set on the view. 2337 \param mask A mask to determine what font properties to set, either pass 2338 in \c B_FONT_ALL to set all font properties or create a mask 2339 containing one or more of the following values to set: 2340 - \c B_FONT_FAMILY_AND_STYLE 2341 - \c B_FONT_SPACING 2342 - \c B_FONT_SIZE 2343 - \c B_FONT_ENCODING 2344 - \c B_FONT_SHEAR 2345 - \c B_FONT_FACE 2346 - \c B_FONT_ROTATION 2347 - \c B_FONT_FLAGS 2348 2349 \see BFont for more details. 2350 2351 \since BeOS R3 2352*/ 2353 2354 2355/*! 2356 \fn void BView::GetFont(BFont* font) const 2357 \brief Fill out \a font with the font set to the view. 2358 2359 \param[out] font The BFont object to fill out. 2360 2361 \since BeOS R3 2362*/ 2363 2364 2365/*! 2366 \fn void BView::GetFontHeight(font_height* height) const 2367 \brief Fill out the font_height struct with the view font. 2368 2369 \param[out] height The font_height struct to fill out. 2370 2371 \since BeOS R3 2372*/ 2373 2374 2375/*! 2376 \fn void BView::SetFontSize(float size) 2377 \brief Set the size of the view's font to \a size. 2378 2379 \param size The font size to set to the view in points. 2380 2381 \since BeOS R3 2382*/ 2383 2384 2385/*! 2386 \fn float BView::StringWidth(const char* string) const 2387 \brief Return the width of \a string set in the font of the view. 2388 2389 \param string The \a string to get the width of. 2390 2391 \return The width of the string in the view's font as a float. 2392 2393 \since BeOS R3 2394*/ 2395 2396 2397/*! 2398 \fn float BView::StringWidth(const char* string, int32 length) const 2399 \brief Return the width of \a string set in the font of the view up to 2400 \a length characters. 2401 2402 \param string The \a string to get the width of. 2403 \param length The maximum number of characters in \a string to consider. 2404 2405 \return The width of the string in the view's font as a float. 2406 2407 \since BeOS R3 2408*/ 2409 2410 2411/*! 2412 \fn void BView::GetStringWidths(char* stringArray[], int32 lengthArray[], 2413 int32 numStrings, float widthArray[]) const 2414 \brief Fill out widths of the strings in \a stringArray set in the font 2415 of the view into \a widthArray. 2416 2417 \param stringArray The array of strings to get the lengths of. 2418 \param lengthArray The number of characters of the strings in \a stringArray 2419 to consider. 2420 \param numStrings The number of strings in \a stringArray. 2421 \param widthArray The array to store the widths of the strings in 2422 \a stringArray. 2423 2424 \since BeOS R3 2425*/ 2426 2427 2428/*! 2429 \fn void BView::TruncateString(BString* string, uint32 mode, float width) const 2430 \brief Truncate \a string with truncation mode \a mode so that it is no wider 2431 than \a width set in the view's font. 2432 2433 When the string is truncated the missing characters are replaced by a 2434 horizontal ellipses. 2435 2436 \param string The string to truncate in place. 2437 \param mode The truncation mode to use, one of the following: 2438 - \c B_TRUNCATE_BEGINNING Truncate from the beginning of the string. 2439 - \c B_TRUNCATE_MIDDLE Truncate from the middle of the string. 2440 - \c B_TRUNCATE_END Truncate from the end of the string. 2441 - \c B_TRUNCATE_SMART Truncate from anywhere based on the string content. 2442 Not currently implemented. 2443 \param width The maximum width to truncate the string to. 2444 2445 \since BeOS R5 2446*/ 2447 2448 2449/*! 2450 \fn void BView::ClipToPicture(BPicture* picture, BPoint where, bool sync) 2451 \brief Intersects the current clipping region of the view with the pixels 2452 of \a picture. 2453 2454 BPicture instances are resolution independent, \a picture is effectively 2455 drawn at the view's resolution and the bitmap produced is used to modify the 2456 clipping region. 2457 2458 The pixels that are at least partially opaque are the ones drawn by 2459 \a picture. 2460 2461 \param picture The BPicture object to intersect with. 2462 \param where Offset in the view's coordinate system. 2463 \param sync If \c false, this method will execute asynchronously. 2464 2465 \since BeOS R5 2466*/ 2467 2468 2469/*! 2470 \fn void BView::ClipToInversePicture(BPicture* picture, BPoint where, 2471 bool sync) 2472 \brief Intersects the current clipping region of the view with the pixels 2473 outside of \a picture. 2474 2475 \param picture The BPicture object to intersect with. 2476 \param where Offset in the view's coordinate system. 2477 \param sync If \c false, this method will execute asynchronously. 2478 2479 \see ClipToPicture() 2480 2481 \since BeOS R5 2482*/ 2483 2484 2485/*! 2486 \fn void BView::GetClippingRegion(BRegion* region) const 2487 \brief Fill out \a region with the view's clipping region. 2488 2489 \param[out] region The BRegion object to fill out. 2490 2491 Get the current clipping region, which is an intersection of the view 2492 visible region on screen (which depends on the view bounds, any child view 2493 hiding parts of it, and overlapping windows) and the constrained clipping 2494 regions set by calls to ConstrainClippingRegion() in the current stack of 2495 drawing states. 2496 2497 \since BeOS R3 2498*/ 2499 2500 2501/*! 2502 \fn void BView::ConstrainClippingRegion(BRegion* region) 2503 \brief Set the clipping region the \a region restricting the area that the 2504 view can draw in. 2505 2506 The Application Server keeps track of the clipping region for each view 2507 attached to a window so that the view can't draw outside of it, 2508 consequently this method works only for views that are attached to a window. 2509 2510 The default clipping region contains the visible area of the view. By 2511 passing a region to this method the clipping area is further restricted. 2512 Passing in \c NULL resets the clipping region back to the default. 2513 2514 Calls to ConstrainClippingRegion() are not cumulative, each time this 2515 method is called it replaces the old clipping region. However, clipping 2516 regions from previous states are intersected to compute the effective 2517 clipping. 2518 2519 Region-based clipping is not affected by the view transform. If you need to 2520 constrain drawing to a transformed region, use ClipToPicture() and 2521 FillRegion() instead. 2522 2523 \param region The region to set the clipping region to or \c NULL 2524 to reset to default. 2525 2526 \since BeOS R3 2527*/ 2528 2529 2530//! @} 2531 2532 2533/*! 2534 \name Drawing Related 2535 2536 The view must be attached to the window for these methods to work unless 2537 otherwise stated. Notes on specific methods are provided below: 2538 2539 DrawBitmap() 2540 2541 If the the image is bigger than the destination rectangle, it is scaled to fit. 2542 2543 The asynchronous versions pass the image to Application Server and return 2544 immediately. 2545 2546 This can be more efficient in some cases for example to draw several bitmaps 2547 at once and then call Sync() to tell Application Server to wait for them all 2548 to finish drawing rather than waiting for each one to draw. 2549 2550 DrawPicture() 2551 2552 The asynchronous versions pass the picture to Application Server and return 2553 immediately. 2554 2555 This can be more efficient in some cases for example to draw several pictures 2556 at once and then call Sync() to tell Application Server to wait for them all 2557 to finish drawing rather than waiting for each one to draw. 2558 2559 DrawPicture() doesn't alter the graphics state of the view nor do changes to 2560 the graphics state of the view alter the BPicture object. What the picture 2561 will look like depends on the graphics parameters that were in effect when the 2562 picture was recorded. 2563 2564 DrawString() 2565 2566 The \a string is drawn in the view's current font and is modified by 2567 the other parameters of the font such as its direction (left-to-right or 2568 right-to-left), rotation, spacing, shear, etc. The \a string is always drawn 2569 left to right even if its text direction is set to right-to-left mode. 2570 2571 Drawing a string is fastest in \c B_OP_COPY mode and anti-aliasing can 2572 produce undesirable effects when a string is draw in other modes, especially 2573 if the string is drawn in the same location repeatedly. 2574 2575 DrawString() doesn't erase before drawing. 2576*/ 2577 2578 2579//! @{ 2580 2581 2582/*! 2583 \fn void BView::DrawBitmapAsync(const BBitmap* bitmap, BRect bitmapRect, 2584 BRect viewRect, uint32 options) 2585 \brief Draws \a bitmap on the view within \a viewRect asynchronously. 2586 2587 \param bitmap The bitmap to draw onto the view. 2588 \param bitmapRect The portion of the bitmap to draw in the bitmap's 2589 coordinate system. 2590 \param viewRect The area in the view's coordinate system to draw the 2591 bitmap in. 2592 \param options ?? 2593 2594 \since Haiku R1 2595*/ 2596 2597 2598/*! 2599 \fn void BView::DrawBitmapAsync(const BBitmap* bitmap, BRect bitmapRect, 2600 BRect viewRect) 2601 \brief Draws \a bitmap on the view within \a viewRect asynchronously. 2602 2603 \param bitmap The bitmap to draw onto the view. 2604 \param bitmapRect The portion of the bitmap to draw in the bitmap's 2605 coordinate system. 2606 \param viewRect The area in the view's coordinate system to draw the 2607 bitmap in. 2608 2609 \since BeOS R3 2610*/ 2611 2612 2613/*! 2614 \fn void BView::DrawBitmapAsync(const BBitmap* bitmap, BRect viewRect) 2615 \brief Draws \a bitmap on the view within \a viewRect asynchronously. 2616 2617 \param bitmap The bitmap to draw onto the view. 2618 \param viewRect The area in the view's coordinate system to draw the 2619 bitmap in. 2620 2621 \since BeOS R3 2622*/ 2623 2624 2625/*! 2626 \fn void BView::DrawBitmapAsync(const BBitmap* bitmap, BPoint where) 2627 \brief Draws \a bitmap on the view offset by \a where asynchronously. 2628 2629 \param bitmap The bitmap to draw onto the view. 2630 \param where The location to draw the bitmap in the view's coordinate system. 2631 2632 \since BeOS R3 2633*/ 2634 2635 2636/*! 2637 \fn void BView::DrawBitmapAsync(const BBitmap* bitmap) 2638 \brief Draws \a bitmap on the view asynchronously. 2639 2640 \param bitmap The bitmap to draw onto the view. 2641 2642 \since BeOS R3 2643*/ 2644 2645 2646/*! 2647 \fn void BView::DrawBitmap(const BBitmap* bitmap, BRect bitmapRect, 2648 BRect viewRect, uint32 options) 2649 \brief brief Draws \a bitmap on the view within \a viewRect. 2650 2651 \param bitmap The bitmap to draw onto the view. 2652 \param bitmapRect The portion of the bitmap to draw in the bitmap's 2653 coordinate system. 2654 \param viewRect The area in the view's coordinate system to draw the 2655 bitmap in. 2656 \param options ?? 2657 2658 \since Haiku R1 2659*/ 2660 2661 2662/*! 2663 \fn void BView::DrawBitmap(const BBitmap* bitmap, BRect bitmapRect, 2664 BRect viewRect) 2665 \brief Draws \a bitmap on the view within \a viewRect. 2666 2667 \param bitmap The bitmap to draw onto the view. 2668 \param bitmapRect The portion of the bitmap to draw in the bitmap's 2669 coordinate system. 2670 \param viewRect The area in the view's coordinate system to draw the 2671 bitmap in. 2672 2673 \since BeOS R3 2674*/ 2675 2676 2677/*! 2678 \fn void BView::DrawBitmap(const BBitmap* bitmap, BRect viewRect) 2679 \brief Draws \a bitmap on the view within \a viewRect. 2680 2681 \param bitmap The bitmap to draw onto the view. 2682 \param viewRect The area in the view's coordinate system to draw the 2683 bitmap in. 2684 2685 \since BeOS R3 2686*/ 2687 2688 2689/*! 2690 \fn void BView::DrawBitmap(const BBitmap* bitmap, BPoint where) 2691 \brief Draws \a bitmap on the view offset by \a where. 2692 2693 \param bitmap The bitmap to draw onto the view. 2694 \param where The location to draw the bitmap in the view's coordinate system. 2695 2696 \since BeOS R3 2697*/ 2698 2699 2700/*! 2701 \fn void BView::DrawBitmap(const BBitmap* bitmap) 2702 \brief Draws \a bitmap on the view. 2703 2704 \param bitmap The bitmap to draw onto the view. 2705 2706 \since BeOS R3 2707*/ 2708 2709 2710/*! 2711 \fn void BView::DrawChar(char c) 2712 \brief Draws character \a c onto to the view at the current pen position. 2713 2714 The character is drawn in the view's current font. 2715 2716 \param c The character to draw. 2717 2718 \since BeOS R3 2719*/ 2720 2721 2722/*! 2723 \fn void BView::DrawChar(char c, BPoint location) 2724 \brief Draws character \a c at the specified \a location in the view. 2725 2726 The character is drawn in the view's current font. 2727 2728 \param c The character to draw. 2729 \param location The location in the view to draw the character. 2730 2731 \since BeOS R3 2732*/ 2733 2734 2735/*! 2736 \fn void BView::DrawString(const char* string, escapement_delta* delta) 2737 \brief Draw \a string onto the view at the current pen position. 2738 2739 \param string The string to draw. 2740 \param delta Adds additional width to each character according to the 2741 following fields: 2742 - nonspace(float) The amount of width to add to characters with visible 2743 glyphs. 2744 - space(float) The amount of width to add to characters with escapements 2745 but don't have visible glyphs. 2746 2747 \since BeOS R3 2748*/ 2749 2750 2751/*! 2752 \fn void BView::DrawString(const char* string, BPoint location, 2753 escapement_delta* delta) 2754 \brief Draw \a string onto the view at the specified \a location in the view. 2755 2756 \param string The string to draw. 2757 \param location The location in the view to draw the string. 2758 \param delta Adds additional width to each character according to the 2759 following fields: 2760 - nonspace(float) The amount of width to add to characters with visible 2761 glyphs. 2762 - space(float) The amount of width to add to characters with escapements 2763 but don't have visible glyphs. 2764 2765 \since BeOS R3 2766*/ 2767 2768 2769/*! 2770 \fn void BView::DrawString(const char* string, int32 length, 2771 escapement_delta* delta) 2772 \brief Draw \a string up to \a length characters onto the view at the current 2773 pen position. 2774 2775 \param string The string to draw. 2776 \param length The maximum number of characters in \a string to draw. 2777 \param delta Adds additional width to each character according to the 2778 following fields: 2779 - nonspace(float) The amount of width to add to characters with visible 2780 glyphs. 2781 - space(float) The amount of width to add to characters with escapements 2782 but don't have visible glyphs. 2783 2784 \since BeOS R3 2785*/ 2786 2787 2788/*! 2789 \fn void BView::DrawString(const char* string, int32 length, BPoint location, 2790 escapement_delta* delta) 2791 \brief Draw \a string up to \a length characters onto the view at the 2792 specified \a location in the view. 2793 2794 \param string The string to draw. 2795 \param length The maximum number of characters in \a string to draw. 2796 \param location The location in the view to draw the string. 2797 \param delta Adds additional width to each character according to the 2798 following fields: 2799 - nonspace(float) The amount of width to add to characters with visible 2800 glyphs. 2801 - space(float) The amount of width to add to characters with escapements 2802 but don't have visible glyphs. 2803 2804 \since BeOS R3 2805*/ 2806 2807 2808/*! 2809 \fn void BView::DrawString(const char* string, const BPoint* locations, 2810 int32 locationCount) 2811 \brief Draw \a string \a locationCount times at the specified \a locations. 2812 2813 \param string The string to draw. 2814 \param locations A pointer to an array of BPoint objects to draw the string. 2815 \param locationCount The number of elements in \a locations. 2816 2817 \since Haiku R1 2818*/ 2819 2820 2821/*! 2822 \fn void BView::DrawString(const char* string, int32 length, 2823 const BPoint* locations, int32 locationCount) 2824 \brief Draw \a string up to \a length characters \a locationCount times at the 2825 specified \a locations. 2826 2827 \param string The string to draw. 2828 \param length The maximum number of characters in \a string to draw. 2829 \param locations A pointer to an array of BPoint objects to draw the string. 2830 \param locationCount The number of elements in \a locations. 2831 2832 \since Haiku R1 2833*/ 2834 2835 2836/*! 2837 \fn void BView::StrokeEllipse(BPoint center, float xRadius, float yRadius, 2838 ::pattern pattern) 2839 \brief Stroke the outline of an ellipse starting at \a center with a 2840 horizontal radius of \a xRadius and a vertical radius of \a yRadius. 2841 2842 \param center The center point. 2843 \param xRadius The horizontal radius. 2844 \param yRadius The vertical radius. 2845 \param pattern One of the following: 2846 - \c B_SOLID_HIGH 2847 - \c B_SOLID_LOW 2848 - \c B_MIXED_COLORS 2849 2850 \since BeOS R3 2851*/ 2852 2853 2854/*! 2855 \fn void BView::StrokeEllipse(BRect rect, ::pattern pattern) 2856 \brief Stroke the outline of an ellipse inscribed within \a rect. 2857 2858 \param rect The area within which to inscribe the shape. 2859 \param pattern One of the following: 2860 - \c B_SOLID_HIGH 2861 - \c B_SOLID_LOW 2862 - \c B_MIXED_COLORS 2863 2864 \since BeOS R3 2865*/ 2866 2867 2868/*! 2869 \fn void BView::FillEllipse(BPoint center, float xRadius, float yRadius, 2870 ::pattern pattern) 2871 \brief Fill an ellipse starting at \a center with a horizontal radius 2872 of \a xRadius and a vertical radius of \a yRadius. 2873 2874 \param center The center point. 2875 \param xRadius The horizontal radius. 2876 \param yRadius The vertical radius. 2877 \param pattern One of the following: 2878 - \c B_SOLID_HIGH 2879 - \c B_SOLID_LOW 2880 - \c B_MIXED_COLORS 2881 2882 \since BeOS R3 2883*/ 2884 2885 2886/*! 2887 \fn void BView::FillEllipse(BRect rect, ::pattern pattern) 2888 \brief Fill an ellipse inscribed within \a rect. 2889 2890 \param rect The area within which to inscribe the shape. 2891 \param pattern One of the following: 2892 - \c B_SOLID_HIGH 2893 - \c B_SOLID_LOW 2894 - \c B_MIXED_COLORS 2895 2896 \since BeOS R3 2897*/ 2898 2899 2900/*! 2901 \fn void BView::FillEllipse(BPoint center, float xRadius, float yRadius, 2902 const BGradient& gradient) 2903 \brief Fill an ellipse with the specified \a gradient pattern starting at 2904 \a center with a horizontal radius of \a xRadius and a vertical radius 2905 of \a yRadius. 2906 2907 \param center The center point. 2908 \param xRadius The horizontal radius. 2909 \param yRadius The vertical radius. 2910 \param gradient The gradient pattern to fill the ellipse with. 2911 2912 \since Haiku R1 2913*/ 2914 2915 2916/*! 2917 \fn void BView::FillEllipse(BRect rect, const BGradient& gradient) 2918 \brief Fill an ellipse with the specified \a gradient pattern inscribed within 2919 \a rect. 2920 2921 \param rect The area within which to inscribe the shape. 2922 \param gradient The gradient pattern to fill the ellipse with. 2923 2924 \since Haiku R1 2925*/ 2926 2927 2928/*! 2929 \fn void BView::StrokeArc(BPoint center, float xRadius, float yRadius, 2930 float startAngle, float arcAngle, ::pattern pattern) 2931 \brief Stroke the outline of an arc starting at \a center with a 2932 horizontal radius of \a xRadius and a vertical radius of \a yRadius 2933 starting at \a startAngle and drawing \a arcAngle degrees. 2934 2935 \param center The center point. 2936 \param xRadius The horizontal radius. 2937 \param yRadius The vertical radius. 2938 \param startAngle The angle to begin drawing at. 2939 \param arcAngle The number of degrees of the arc to draw. 2940 \param pattern One of the following: 2941 - \c B_SOLID_HIGH 2942 - \c B_SOLID_LOW 2943 - \c B_MIXED_COLORS 2944 2945 \since BeOS R3 2946*/ 2947 2948 2949/*! 2950 \fn void BView::StrokeArc(BRect rect, float startAngle, float arcAngle, 2951 ::pattern pattern) 2952 \brief Stroke the outline of an arc inscribed within \a rect starting at 2953 \a startAngle and drawing \a arcAngle degrees. 2954 2955 \param rect The area within which to inscribe the shape. 2956 \param startAngle The angle to begin drawing at. 2957 \param arcAngle The number of degrees of the arc to draw. 2958 \param pattern One of the following: 2959 - \c B_SOLID_HIGH 2960 - \c B_SOLID_LOW 2961 - \c B_MIXED_COLORS 2962 2963 \since BeOS R3 2964*/ 2965 2966 2967/*! 2968 \fn void BView::FillArc(BPoint center, float xRadius, float yRadius, 2969 float startAngle, float arcAngle, ::pattern pattern) 2970 \brief Fill an arc starting at \a center with a horizontal radius of 2971 \a xRadius and a vertical radius of \a yRadius starting at 2972 \a startAngle and drawing \a arcAngle degrees. 2973 2974 \param center The center point. 2975 \param xRadius The horizontal radius. 2976 \param yRadius The vertical radius. 2977 \param startAngle The angle to begin drawing at. 2978 \param arcAngle The number of degrees of the arc to draw. 2979 \param pattern One of the following: 2980 - \c B_SOLID_HIGH 2981 - \c B_SOLID_LOW 2982 - \c B_MIXED_COLORS 2983 2984 \since BeOS R3 2985*/ 2986 2987 2988/*! 2989 \fn void BView::FillArc(BPoint center, float xRadius, float yRadius, 2990 float startAngle, float arcAngle, const BGradient& gradient) 2991 \brief Fill an arc with the specified \a gradient pattern starting at 2992 \a center with a horizontal radius of \a xRadius and a vertical 2993 radius of \a yRadius starting at \a startAngle and drawing 2994 \a arcAngle degrees. 2995 2996 \param center The center point. 2997 \param xRadius The horizontal radius. 2998 \param yRadius The vertical radius. 2999 \param startAngle The angle to begin drawing at. 3000 \param arcAngle The number of degrees of the arc to draw. 3001 \param gradient The gradient pattern to fill the arc with. 3002 3003 \since Haiku R1 3004*/ 3005 3006 3007/*! 3008 \fn void BView::FillArc(BRect rect, float startAngle, float arcAngle, 3009 ::pattern pattern) 3010 \brief Fill an arc inscribed within \a rect starting at startAngle and 3011 drawing \a arcAngle degrees. 3012 3013 \param rect The area within which to inscribe the shape. 3014 \param startAngle The angle to begin drawing at. 3015 \param arcAngle The number of degrees of the arc to draw. 3016 \param pattern One of the following: 3017 - \c B_SOLID_HIGH 3018 - \c B_SOLID_LOW 3019 - \c B_MIXED_COLORS 3020 3021 \since BeOS R3 3022*/ 3023 3024 3025/*! 3026 \fn void BView::FillArc(BRect rect, float startAngle, float arcAngle, 3027 const BGradient& gradient) 3028 \brief Fill an arc with the specified \a gradient pattern inscribed within 3029 \a rect starting at startAngle and drawing \a arcAngle degrees. 3030 3031 \param rect The area within which to inscribe the shape. 3032 \param startAngle The angle to begin drawing at. 3033 \param arcAngle The number of degrees of the arc to draw. 3034 \param gradient The gradient pattern to fill the arc with. 3035 3036 \since Haiku R1 3037*/ 3038 3039 3040/*! 3041 \fn void BView::StrokeBezier(BPoint* controlPoints, ::pattern pattern) 3042 \brief Stroke a bezier curve. 3043 3044 \param controlPoints The list of points that form the bezier curve. 3045 \param pattern One of the following: 3046 - \c B_SOLID_HIGH 3047 - \c B_SOLID_LOW 3048 - \c B_MIXED_COLORS 3049 3050 \since BeOS R3 3051*/ 3052 3053 3054/*! 3055 \fn void BView::FillBezier(BPoint* controlPoints, ::pattern pattern) 3056 \brief Fill a bezier curve. 3057 3058 \param controlPoints The list of points that form the bezier curve. 3059 \param pattern One of the following: 3060 - \c B_SOLID_HIGH 3061 - \c B_SOLID_LOW 3062 - \c B_MIXED_COLORS 3063 3064 \since BeOS R3 3065*/ 3066 3067 3068/*! 3069 \fn void BView::FillBezier(BPoint* controlPoints, const BGradient& gradient) 3070 3071 \brief Fill a bezier curve. 3072 3073 \param controlPoints The list of points that form the bezier curve. 3074 \param gradient The gradient pattern to fill the bezier curve with. 3075 3076 \since Haiku R1 3077*/ 3078 3079 3080/*! 3081 \fn void BView::StrokePolygon(const BPolygon* polygon, bool closed, 3082 ::pattern pattern) 3083 \brief Stroke a polygon shape. 3084 3085 \param polygon The polygon shape to stroke. 3086 \param closed Whether or not the last line of the polygon should intersect 3087 with the initial point. 3088 \param pattern One of the following: 3089 - \c B_SOLID_HIGH 3090 - \c B_SOLID_LOW 3091 - \c B_MIXED_COLORS 3092 3093 \since BeOS R3 3094*/ 3095 3096 3097/*! 3098 \fn void BView::StrokePolygon(const BPoint* pointArray, int32 numPoints, 3099 bool closed, ::pattern pattern) 3100 \brief Stroke a polygon shape made up of points specified by \a pointArray. 3101 3102 \param pointArray An array of points that specify the vertices of the 3103 polygon. 3104 \param numPoints The number of points in \a pointArray. 3105 \param closed Whether or not the last line of the polygon should intersect 3106 with the initial point. 3107 \param pattern One of the following: 3108 - \c B_SOLID_HIGH 3109 - \c B_SOLID_LOW 3110 - \c B_MIXED_COLORS 3111 3112 \since BeOS R3 3113*/ 3114 3115 3116/*! 3117 \fn void BView::StrokePolygon(const BPoint* pointArray, int32 numPoints, 3118 BRect bounds, bool closed, ::pattern pattern) 3119 \brief Stroke a polygon shape made up of points specified by \a pointArray 3120 inscribed by \a bounds. 3121 3122 \param pointArray An array of points that specify the vertices of the 3123 polygon. 3124 \param numPoints The number of points in \a pointArray. 3125 \param bounds The smallest rectangle that encloses the points in 3126 \a pointArray. 3127 \param closed Whether or not the last line of the polygon should intersect 3128 with the initial point. 3129 \param pattern One of the following: 3130 - \c B_SOLID_HIGH 3131 - \c B_SOLID_LOW 3132 - \c B_MIXED_COLORS 3133 3134 \since BeOS R3 3135*/ 3136 3137 3138/*! 3139 \fn void BView::FillPolygon(const BPolygon* polygon, ::pattern pattern) 3140 \brief Fill a polygon shape. 3141 3142 \param polygon The polygon shape to fill. 3143 \param pattern One of the following: 3144 - \c B_SOLID_HIGH 3145 - \c B_SOLID_LOW 3146 - \c B_MIXED_COLORS 3147 3148 \since BeOS R3 3149*/ 3150 3151 3152/*! 3153 \fn void BView::FillPolygon(const BPolygon* polygon, 3154 const BGradient& gradient) 3155 \brief Fill a polygon shape with the specified \a gradient pattern. 3156 3157 \param polygon The polygon shape to fill. 3158 \param gradient The gradient pattern to fill the polygon with. 3159 3160 \since Haiku R1 3161*/ 3162 3163 3164/*! 3165 \fn void BView::FillPolygon(const BPoint* pointArray, int32 numPoints, 3166 ::pattern pattern) 3167 \brief Fill a polygon shape made up of points specified by \a pointArray. 3168 3169 \param pointArray An array of points that specify the vertices of the polygon. 3170 \param numPoints The number of points in \a pointArray. 3171 \param pattern One of the following: 3172 - \c B_SOLID_HIGH 3173 - \c B_SOLID_LOW 3174 - \c B_MIXED_COLORS 3175 3176 \since BeOS R3 3177*/ 3178 3179 3180/*! 3181 \fn void BView::FillPolygon(const BPoint* pointArray, int32 numPoints, 3182 const BGradient& gradient) 3183 \brief Fill a polygon shape made up of points specified by \a pointArray 3184 with the specified \a gradient pattern. 3185 3186 \param pointArray An array of points that specify the vertices of the 3187 polygon. 3188 \param numPoints The number of points in \a pointArray. 3189 \param gradient The gradient pattern to fill the polygon with. 3190 3191 \since Haiku R1 3192*/ 3193 3194 3195/*! 3196 \fn void BView::FillPolygon(const BPoint* pointArray, int32 numPoints, 3197 BRect bounds, ::pattern pattern) 3198 \brief Fill a polygon shape made up of points specified by \a pointArray 3199 inscribed by \a bounds. 3200 3201 \param pointArray An array of points that specify the vertices of the 3202 polygon. 3203 \param numPoints The number of points in \a pointArray. 3204 \param bounds The smallest rectangle that encloses the points in 3205 \a pointArray. 3206 \param pattern One of the following: 3207 - \c B_SOLID_HIGH 3208 - \c B_SOLID_LOW 3209 - \c B_MIXED_COLORS 3210 3211 \since BeOS R3 3212*/ 3213 3214 3215/*! 3216 \fn void BView::FillPolygon(const BPoint* pointArray, int32 numPoints, 3217 BRect bounds, const BGradient& gradient) 3218 \brief Fill a polygon shape made up of points specified by \a pointArray 3219 inscribed by \a bounds with the specified \a gradient pattern. 3220 3221 \param pointArray An array of points that specify the vertices of the 3222 polygon. 3223 \param numPoints The number of points in \a pointArray. 3224 \param bounds The smallest rectangle that encloses the points in 3225 \a pointArray. 3226 \param gradient The gradient pattern to fill the polygon with. 3227 3228 \since Haiku R1 3229*/ 3230 3231 3232/*! 3233 \fn void BView::StrokeRect(BRect rect, ::pattern pattern) 3234 \brief Stroke the rectangle specified by \a rect. 3235 3236 \param rect The rectangular area to stroke. 3237 \param pattern One of the following: 3238 - \c B_SOLID_HIGH 3239 - \c B_SOLID_LOW 3240 - \c B_MIXED_COLORS 3241 3242 \since BeOS R3 3243*/ 3244 3245 3246/*! 3247 \fn void BView::FillRect(BRect rect, ::pattern pattern) 3248 \brief Fill the rectangle specified by \a rect. 3249 3250 \param rect The rectangular area to fill. 3251 \param pattern One of the following: 3252 - \c B_SOLID_HIGH 3253 - \c B_SOLID_LOW 3254 - \c B_MIXED_COLORS 3255 3256 \since BeOS R3 3257*/ 3258 3259 3260/*! 3261 \fn void BView::FillRect(BRect rect, const BGradient& gradient) 3262 \brief Fill the rectangle specified by \a rect with the specified 3263 \a gradient pattern. 3264 3265 \param rect The rectangular area to fill. 3266 \param gradient The gradient pattern to fill the rectangle with. 3267 3268 \since Haiku R1 3269*/ 3270 3271 3272/*! 3273 \fn void BView::StrokeRoundRect(BRect rect, float xRadius, float yRadius, 3274 ::pattern pattern) 3275 \brief Stroke the rounded rectangle with horizontal radius \a xRadius and 3276 vertical radius \a yRadius. 3277 3278 \param rect The rectangular area to stroke the round rect within. 3279 \param xRadius The horizontal radius. 3280 \param yRadius The vertical radius. 3281 \param pattern One of the following: 3282 - \c B_SOLID_HIGH 3283 - \c B_SOLID_LOW 3284 - \c B_MIXED_COLORS 3285 3286 \since BeOS R3 3287*/ 3288 3289 3290/*! 3291 \fn void BView::FillRoundRect(BRect rect, float xRadius, float yRadius, 3292 ::pattern pattern) 3293 \brief Fill the rounded rectangle with horizontal radius \a xRadius and 3294 vertical radius \a yRadius. 3295 3296 \param rect The rectangular area to fill the round rect within. 3297 \param xRadius The horizontal radius. 3298 \param yRadius The vertical radius. 3299 \param pattern One of the following: 3300 - \c B_SOLID_HIGH 3301 - \c B_SOLID_LOW 3302 - \c B_MIXED_COLORS 3303 3304 \since BeOS R3 3305*/ 3306 3307 3308/*! 3309 \fn void BView::FillRoundRect(BRect rect, float xRadius, float yRadius, 3310 const BGradient& gradient) 3311 \brief Fill the rounded rectangle with horizontal radius \a xRadius and 3312 vertical radius \a yRadius with the specified \a gradient pattern. 3313 3314 \param rect The rectangular area to fill the round rect within. 3315 \param xRadius The horizontal radius. 3316 \param yRadius The vertical radius. 3317 \param gradient The gradient pattern to fill the round rect with. 3318 3319 \since Haiku R1 3320*/ 3321 3322 3323/*! 3324 \fn void BView::FillRegion(BRegion* region, ::pattern pattern) 3325 \brief Fill \a region. 3326 3327 \param region The \a region to fill. 3328 \param pattern One of the following: 3329 - \c B_SOLID_HIGH 3330 - \c B_SOLID_LOW 3331 - \c B_MIXED_COLORS 3332 3333 \since BeOS R3 3334*/ 3335 3336 3337/*! 3338 \fn void BView::FillRegion(BRegion* region, const BGradient& gradient) 3339 \brief Fill \a region with the specified \a gradient pattern. 3340 3341 \param region The \a region to fill. 3342 \param gradient The gradient pattern to fill the \a region with. 3343 3344 \since Haiku R1 3345*/ 3346 3347 3348/*! 3349 \fn void BView::StrokeTriangle(BPoint point1, BPoint point2, BPoint point3, 3350 BRect bounds, ::pattern pattern) 3351 \brief Stroke the triangle specified by points \a point1, \a point2, and 3352 \a point3 and enclosed by \a bounds. 3353 3354 \param point1 The first point of the triangle. 3355 \param point2 The second point of the triangle. 3356 \param point3 The third point of the triangle. 3357 \param bounds The rectangular area that encloses the triangle. 3358 \param pattern One of the following: 3359 - \c B_SOLID_HIGH 3360 - \c B_SOLID_LOW 3361 - \c B_MIXED_COLORS 3362 3363 \since BeOS R3 3364*/ 3365 3366 3367/*! 3368 \fn void BView::StrokeTriangle(BPoint point1, BPoint point2, BPoint point3, 3369 ::pattern pattern) 3370 \brief Stroke the triangle specified by points \a point1, \a point2, 3371 and \a point3. 3372 3373 \param point1 The first point of the triangle. 3374 \param point2 The second point of the triangle. 3375 \param point3 The third point of the triangle. 3376 \param pattern One of the following: 3377 - \c B_SOLID_HIGH 3378 - \c B_SOLID_LOW 3379 - \c B_MIXED_COLORS 3380 3381 \since BeOS R3 3382*/ 3383 3384 3385/*! 3386 \fn void BView::FillTriangle(BPoint point1, BPoint point2, BPoint point3, 3387 ::pattern pattern) 3388 \brief Fill the triangle specified by points \a point1, \a point2, 3389 and \a point3. 3390 3391 \param point1 The first point of the triangle. 3392 \param point2 The second point of the triangle. 3393 \param point3 The third point of the triangle. 3394 \param pattern One of the following: 3395 - \c B_SOLID_HIGH 3396 - \c B_SOLID_LOW 3397 - \c B_MIXED_COLORS 3398 3399 \since BeOS R3 3400*/ 3401 3402 3403/*! 3404 \fn void BView::FillTriangle(BPoint point1, BPoint point2, BPoint point3, 3405 const BGradient& gradient) 3406 \brief Fill the triangle specified by points \a point1, \a point2, 3407 and \a point3 with the specified \a gradient pattern. 3408 3409 \param point1 The first point of the triangle. 3410 \param point2 The second point of the triangle. 3411 \param point3 The third point of the triangle. 3412 \param gradient The gradient pattern to fill the triangle with. 3413 3414 \since Haiku R1 3415*/ 3416 3417 3418/*! 3419 \fn void BView::FillTriangle(BPoint point1, BPoint point2, BPoint point3, 3420 BRect bounds, ::pattern pattern) 3421 \brief Fill the triangle specified by points \a point1, \a point2, 3422 and \a point3 and enclosed by \a bounds. 3423 3424 \param point1 The first point of the triangle. 3425 \param point2 The second point of the triangle. 3426 \param point3 The third point of the triangle. 3427 \param bounds The rectangular area that encloses the triangle. 3428 \param pattern One of the following: 3429 - \c B_SOLID_HIGH 3430 - \c B_SOLID_LOW 3431 - \c B_MIXED_COLORS 3432 3433 \since BeOS R3 3434*/ 3435 3436 3437/*! 3438 \fn void BView::FillTriangle(BPoint point1, BPoint point2, BPoint point3, 3439 BRect bounds, const BGradient& gradient) 3440 \brief Fill the triangle specified by points \a point1, \a point2, 3441 and \a point3 and enclosed by \a bounds with the specified 3442 \a gradient pattern. 3443 3444 \param point1 The first point of the triangle. 3445 \param point2 The second point of the triangle. 3446 \param point3 The third point of the triangle. 3447 \param bounds The rectangular area that encloses the triangle. 3448 \param gradient The gradient pattern to fill the triangle with. 3449 3450 \since Haiku R1 3451*/ 3452 3453 3454/*! 3455 \fn void BView::StrokeLine(BPoint toPoint, ::pattern pattern) 3456 \brief Stroke a line from the current pen location to the point \a toPoint. 3457 3458 \param toPoint The end point of the line. 3459 \param pattern One of the following: 3460 - \c B_SOLID_HIGH 3461 - \c B_SOLID_LOW 3462 - \c B_MIXED_COLORS 3463 3464 \since BeOS R3 3465*/ 3466 3467 3468/*! 3469 \fn void BView::StrokeLine(BPoint start, BPoint end, ::pattern pattern) 3470 \brief Stroke a line from point \a start to point \a end. 3471 3472 \param start The start point of the line. 3473 \param end The end point of the line. 3474 \param pattern One of the following: 3475 - \c B_SOLID_HIGH 3476 - \c B_SOLID_LOW 3477 - \c B_MIXED_COLORS 3478 3479 \since BeOS R3 3480*/ 3481 3482 3483/*! 3484 \fn void BView::StrokeShape(BShape* shape, ::pattern pattern) 3485 \brief Stroke \a shape. 3486 3487 \param shape The \a shape to stroke. 3488 \param pattern One of the following: 3489 - \c B_SOLID_HIGH 3490 - \c B_SOLID_LOW 3491 - \c B_MIXED_COLORS 3492 3493 \since BeOS R5 3494*/ 3495 3496 3497/*! 3498 \fn void BView::FillShape(BShape* shape, ::pattern pattern) 3499 \brief Fill \a shape. 3500 3501 \param shape The \a shape to fill. 3502 \param pattern One of the following: 3503 - \c B_SOLID_HIGH 3504 - \c B_SOLID_LOW 3505 - \c B_MIXED_COLORS 3506 3507 \since BeOS R5 3508*/ 3509 3510 3511/*! 3512 \fn void BView::FillShape(BShape* shape, const BGradient& gradient) 3513 \brief Fill \a shape with the specified \a gradient pattern. 3514 3515 \param shape The \a shape to fill. 3516 \param gradient The gradient pattern to fill the \a shape with. 3517 3518 \since Haiku R1 3519*/ 3520 3521 3522/*! 3523 \fn void BView::BeginLineArray(int32 count) 3524 \brief Begin a line array of up to \a count lines. 3525 3526 This is a more efficient way of drawing a large number of lines than calling 3527 StrokeLine() repeatedly. First call BeginLineArray() to begin drawing lines, 3528 then call AddLine() for each line you wish to draw, and finally call 3529 EndLineArray() to finish the line array and draw the lines. 3530 3531 These methods don't move the current pen location or change the high or low 3532 colors of the view. \a count should be close to the number of lines you wish 3533 to draw and should be below 256 to draw efficiently. 3534 3535 \param count The maximum number of lines in the line array to draw. 3536 3537 \see StrokeLine() 3538 3539 \since BeOS R3 3540*/ 3541 3542 3543/*! 3544 \fn void BView::AddLine(BPoint start, BPoint end, rgb_color color); 3545 \brief Add a line to the line array drawn from \a start to \a end. 3546 3547 \param start The \a start point of the line. 3548 \param end The \a end point of the line. 3549 \param color The \a color to draw the line. 3550 3551 \since BeOS R3 3552*/ 3553 3554 3555/*! 3556 \fn void BView::EndLineArray() 3557 \brief End the line array drawing the lines. 3558 3559 \since BeOS R3 3560*/ 3561 3562 3563/*! 3564 \fn void BView::SetDiskMode(char* filename, long offset) 3565 \brief Unimplemented. 3566 3567 \since Haiku R1 3568*/ 3569 3570 3571/*! 3572 \fn void BView::BeginPicture(BPicture* picture) 3573 \brief Begins sending drawing instructions to \a picture. 3574 3575 The \a BPicture object is cleared and any successive drawing instructions sent 3576 to the view are redirected to \a picture until EndPicture() is called. To 3577 append drawing instructions to a BPicture object without clearing it first 3578 call AppendToPicture() instead. 3579 3580 The view doesn't display anything to the screen while it's recording to \a 3581 picture. Use the DrawPicture() method to render the \a picture. 3582 3583 Only drawing instructions performed directly on the view, not its child views 3584 are send to the BPicture object and BPicture captures only primitive graphics 3585 operations. The view must be attached to a window for the drawing instruction 3586 to be recorded. Drawing instructions are recorded even if the view is hidden or 3587 resides outside the clipping region or the window is off-screen. 3588 3589 \param picture The BPicture object to record drawing instructions to. 3590 3591 \since BeOS R3 3592*/ 3593 3594 3595/*! 3596 \fn void BView::AppendToPicture(BPicture* picture) 3597 \brief Appends drawing instructions to \a picture without clearing it first. 3598 3599 \param picture The BPicture object to record drawing instructions to. 3600 3601 \since BeOS R3 3602*/ 3603 3604 3605/*! 3606 \fn BPicture* BView::EndPicture() 3607 \brief Ends the drawing instruction recording session and returns the 3608 BPicture object passed to BeginPicture() or AppendToPicture(). 3609 3610 \return The BPicture object passed to BeginPicture() or AppendToPicture(). 3611 3612 \since BeOS R3 3613*/ 3614 3615 3616/*! 3617 \fn void BView::SetViewBitmap(const BBitmap* bitmap, BRect srcRect, 3618 BRect dstRect, uint32 followFlags, uint32 options) 3619 \brief Sets the background \a bitmap of the view. 3620 3621 All drawing to the view occurs over \a bitmap. Any visible regions not 3622 covered by \a bitmap are filled with the current background color. 3623 3624 Once \a bitmap has been passed in and this method returns the caller may 3625 safely delete the object. 3626 3627 \param bitmap The background bitmap to set to the view. 3628 \param srcRect Specifies the area of \a bitmap to use. 3629 \param dstRect Specifies the area of the view to set \a bitmap to. 3630 \param followFlags Specifies the as the view is resized. See the BView 3631 constructor for more details. 3632 \param options Specifies additional view options. The only option currently 3633 available is \c B_TILE_BITMAP which tiles the bitmap across the view. 3634 3635 \since BeOS R4 3636*/ 3637 3638 3639/*! 3640 \fn void BView::SetViewBitmap(const BBitmap* bitmap, uint32 followFlags, 3641 uint32 options) 3642 \brief Sets the background \a bitmap of the view. 3643 3644 All drawing to the view occurs over \a bitmap. Any visible regions not 3645 covered by \a bitmap are filled with the current background color. 3646 3647 Once \a bitmap has been passed in and this method returns the caller may 3648 safely delete the object. 3649 3650 \param bitmap The background bitmap to set to the view. 3651 \param followFlags Specifies the as the view is resized. See the BView 3652 constructor for more details. 3653 \param options Specifies additional view options. The only option currently 3654 available is \c B_TILE_BITMAP which tiles the bitmap across the view. 3655 3656 \since BeOS R4 3657*/ 3658 3659 3660/*! 3661 \fn void BView::ClearViewBitmap() 3662 \brief Clears the background bitmap of the view if it has one. 3663 3664 \since BeOS R4 3665*/ 3666 3667 3668/*! 3669 \fn status_t BView::SetViewOverlay(const BBitmap* overlay, BRect srcRect, 3670 BRect dstRect, rgb_color* colorKey, uint32 followFlags, uint32 options) 3671 \brief Sets the \a overlay bitmap of the view. 3672 3673 \a colorKey specifies which color pixels in \a overlay are treated as transparent 3674 allowing the pixels of the view to show through. 3675 3676 Once \a overlay has been passed in and this method returns the caller may 3677 safely delete the object. 3678 3679 \param overlay The overlay bitmap to set to the view. 3680 \param srcRect Specifies the area of \a overlay to use. 3681 \param dstRect Specifies the area of the view to set \a overlay to. 3682 \param colorKey The color in \a overlay to treat as transparent. 3683 \param followFlags Specifies the as the view is resized. See the BView 3684 constructor for more details. 3685 \param options Specifies additional view options. The only option currently 3686 available is \c B_TILE_BITMAP which tiles the bitmap across the view. 3687 3688 \since BeOS R5 3689*/ 3690 3691 3692/*! 3693 \fn status_t BView::SetViewOverlay(const BBitmap* overlay, 3694 rgb_color* colorKey, uint32 followFlags, uint32 options) 3695 \brief Sets the \a overlay bitmap of the view. 3696 3697 \a colorKey specifies which color pixels in \a overlay are treated as transparent 3698 allowing the pixels of the view to show through. 3699 3700 Once \a overlay has been passed in and this method returns the caller may 3701 safely delete the object. 3702 3703 \param overlay The overlay bitmap to set to the view. 3704 \param colorKey The color in \a overlay to treat as transparent. 3705 \param followFlags Specifies the as the view is resized. See the BView 3706 constructor for more details. 3707 \param options Specifies additional view options. The only option currently 3708 available is \c B_TILE_BITMAP which tiles the bitmap across the view. 3709 3710 \since BeOS R5 3711*/ 3712 3713 3714/*! 3715 \fn void BView::ClearViewOverlay() 3716 \brief Clears the overlay bitmap of the view if it has one. 3717 3718 \since BeOS R5 3719*/ 3720 3721 3722/*! 3723 \fn void BView::CopyBits(BRect src, BRect dst) 3724 \brief Copy the bits from the \a src rectangle to the \a dst rectangle in the 3725 view's coordinate system. 3726 3727 If the rectangles are of different sizes than \a src is scaled to fit. \a src 3728 is clipped if a part of \a dst lies outside of the visible region of the view. 3729 Only the visible portions of \a src are copied. 3730 3731 The view must be attached to a window for this method to work. 3732 3733 \param src The source rectangle to copy bits from. 3734 \param dst The destination rectangle to copy bits to. 3735 3736 \since BeOS R3 3737*/ 3738 3739 3740/*! 3741 \fn void BView::DrawPicture(const BPicture* picture) 3742 \brief Draws the \a picture at the view's current pen position. 3743 3744 \param picture The BPicture object to draw. 3745 3746 \since BeOS R3 3747*/ 3748 3749 3750/*! 3751 \fn void BView::DrawPicture(const BPicture* picture, BPoint where) 3752 \brief Draws the \a picture at the location in the view specified by \a where. 3753 3754 \param picture The BPicture object to draw. 3755 \param where The point on the view to draw \a picture. 3756 3757 \since BeOS R3 3758*/ 3759 3760 3761/*! 3762 \fn void BView::DrawPicture(const char* filename, long offset, BPoint where) 3763 \brief Draws the \a picture from the file specified by \a filename offset by 3764 \a offset bytes at the location in the view specified by \a where. 3765 3766 \param filename The filename of the file containing the picture to draw. 3767 \param where The point on the view to draw the picture. 3768 \param offset The number of bytes to offset in the file to find the picture. 3769 3770 \since BeOS R4 3771*/ 3772 3773 3774/*! 3775 \fn void BView::DrawPictureAsync(const BPicture* picture) 3776 \brief Draws the \a picture at the view's current pen position. 3777 3778 \param picture The BPicture object to draw. 3779 3780 \since BeOS R5 3781*/ 3782 3783 3784/*! 3785 \fn void BView::DrawPictureAsync(const BPicture* picture, BPoint where) 3786 \brief Draws the \a picture at the location in the view specified by 3787 \a where. 3788 3789 \param picture The BPicture object to draw. 3790 \param where The point on the view to draw \a picture. 3791 3792 \since BeOS R5 3793*/ 3794 3795 3796/*! 3797 \fn void BView::DrawPictureAsync(const char* filename, long offset, 3798 BPoint where) 3799 \brief Draws the \a picture from the file specified by \a filename offset 3800 by \a offset bytes at the location in the view specified by 3801 \a where. 3802 3803 \param filename The filename of the file containing the picture to draw. 3804 \param where The point on the view to draw the picture. 3805 \param offset The number of bytes to offset in the file to find the 3806 picture. 3807 3808 \since BeOS R5 3809*/ 3810 3811 3812/*! 3813 \fn void BView::Invalidate(BRect invalRect) 3814 \brief Sends a message to App Server to redraw the portion of the view 3815 specified by \a invalRect. 3816 3817 \param invalRect The rectangular area of the view to redraw. 3818 3819 \since BeOS R3 3820*/ 3821 3822 3823/*! 3824 \fn void BView::Invalidate(const BRegion* region) 3825 \brief Sends a message to App Server to redraw the portion of the view 3826 specified by \a region. 3827 3828 \param region The region of the view to redraw. 3829 3830 \since Haiku R1 3831*/ 3832 3833 3834/*! 3835 \fn void BView::Invalidate() 3836 \brief Sends a message to App Server to redraw the view. 3837 3838 \since BeOS R3 3839*/ 3840 3841 3842/*! 3843 \fn void BView::DelayedInvalidate(bigtime_t delay) 3844 \brief Sends a message to App Server to redraw the entire view after 3845 a certain, minimum, delay. Repeated calls to this method may be 3846 merged, but the view is guaranteed to be redrawn after the delay 3847 given in the first call of this method. 3848 3849 \param delay The time, in microseconds, to wait until redrawing the view. 3850 3851 \since Haiku R1 3852*/ 3853 3854 3855/*! 3856 \fn void BView::DelayedInvalidate(bigtime_t delay, BRect invalRect) 3857 \brief Sends a message to App Server to redraw the portion of the view 3858 specified by \a invalRect after a certain, minimum, delay. 3859 Repeated calls to this method may be merged, but the invalidated 3860 rect is guaranteed to be redrawn after the minimum delay given 3861 by the first call of this method. 3862 3863 \param delay The time, in microseconds, to wait until redrawing the view. 3864 \param invalRect The rectangular area of the view to redraw. 3865 3866 \since Haiku R1 3867*/ 3868 3869 3870/*! 3871 \fn void BView::InvertRect(BRect rect) 3872 \brief Inverts the colors within \a rect. 3873 3874 This method is often used to draw a highlighted selection in a view. 3875 3876 \param rect The rectangular area in the view to invert the colors of. 3877 3878 \since BeOS R3 3879*/ 3880 3881 3882//! @} 3883 3884 3885/*! 3886 \name View Hierarchy 3887*/ 3888 3889 3890//! @{ 3891 3892 3893/*! 3894 \fn void BView::AddChild(BView* child, BView* before) 3895 \brief Adds \a child to the view hierarchy immediately before \a before. 3896 3897 A view may only have one parent at a time so \a child must not have already 3898 been added to the view hierarchy. If \a before is \c NULL then \a child is added 3899 to the end of the tree. If the view is attached to a window \a child and all 3900 of its descendent views also become attached to the window invoking an 3901 AttachedToWindow() method on each view. 3902 3903 \param child The child view to add. 3904 \param before The sibling view to add \a child before. 3905 3906 \since BeOS R3 3907*/ 3908 3909 3910/*! 3911 \fn bool BView::AddChild(BLayoutItem* child) 3912 \brief Add the \a child layout item to the view hierarchy. 3913 3914 \param child The child layout item to add. 3915 \return Whether or not \a child was added to the view layout hierarchy. 3916 3917 \since Haiku R1 3918*/ 3919 3920 3921/*! 3922 \fn bool BView::RemoveChild(BView* child) 3923 \brief Removes \a child from the view hierarchy. 3924 3925 \param child The child view to remove. 3926 \return Whether or not \a child was removed from the view hierarchy. 3927 3928 \since BeOS R3 3929*/ 3930 3931 3932/*! 3933 \fn int32 BView::CountChildren() const 3934 \brief Returns the number of child views that this view has. 3935 3936 \return The number of child views. 3937 3938 \since BeOS R3 3939*/ 3940 3941 3942/*! 3943 \fn BView* BView::ChildAt(int32 index) const 3944 \brief Returns a pointer to the child view found at \a index. 3945 3946 \param index The index of the child view to return a pointer of. 3947 3948 \return A pointer to the child view at \a index or \c NULL if not found. 3949 3950 \since BeOS R3 3951*/ 3952 3953 3954/*! 3955 \fn BView* BView::NextSibling() const 3956 \brief Returns a pointer to the next sibling view. 3957 3958 \return A pointer to the next sibling view or \a NULL if not found. 3959 3960 \since BeOS R3 3961*/ 3962 3963 3964/*! 3965 \fn BView* BView::PreviousSibling() const 3966 \brief Returns a pointer to the previous sibling view. 3967 3968 \return A pointer to the previous sibling view or \a NULL if not found. 3969 3970 \since BeOS R3 3971*/ 3972 3973 3974/*! 3975 \fn bool BView::RemoveSelf() 3976 \brief Removes the view and all child views from the view hierarchy. 3977 3978 \returns Whether or not the view was removed from the view hierarchy. 3979 3980 \since BeOS R3 3981*/ 3982 3983 3984/*! 3985 \fn BView* BView::Parent() const 3986 \brief Returns a pointer to the view's parent. 3987 3988 \return A pointer to the parent view or \c NULL if not attached. 3989 3990 \since BeOS R3 3991*/ 3992 3993 3994/*! 3995 \fn BView* BView::FindView(const char* name) const 3996 \brief Returns the view in the view hierarchy with the specified \a name. 3997 3998 \return The view in the view hierarchy with the specified \a name or \c NULL 3999 if not found. 4000 4001 \since BeOS R3 4002*/ 4003 4004 4005//! @} 4006 4007 4008/*! 4009 \name View Frame Alteration 4010 4011 As a view's frame rectangle must be aligned to pixel values all parameters are 4012 rounded to the nearest integer. If the view isn't attached these methods alter the 4013 frame rectangle without triggering FrameMoved(), FrameResized() or Invalidate(). 4014*/ 4015 4016 4017//! @{ 4018 4019 4020/*! 4021 \fn void BView::MoveBy(float deltaX, float deltaY) 4022 \brief Moves the view \a deltaX pixels horizontally and \a deltaY pixels 4023 vertically in the parent view's coordinate system. 4024 4025 \param deltaX The number of pixels to move the view horizontally. 4026 \param deltaY The number of pixels to move the view vertically. 4027 4028 \since BeOS R3 4029*/ 4030 4031 4032/*! 4033 \fn void BView::MoveTo(BPoint where) 4034 \brief Move the view to the location specified by \a where in the parent 4035 view's coordinate system. 4036 4037 \param where The location to move the view to. 4038 4039 \since BeOS R3 4040*/ 4041 4042 4043/*! 4044 \fn void BView::MoveTo(float x, float y) 4045 \brief Move the view to the coordinates specified by \a x in the horizontal 4046 dimension and \a y in the vertical dimension in the parent view's 4047 coordinate system. 4048 4049 \param x The horizontal coordinate to move the view to. 4050 \param y The vertical coordinate to move the view to. 4051 4052 \since BeOS R3 4053*/ 4054 4055 4056/*! 4057 \fn void BView::ResizeBy(float deltaWidth, float deltaHeight) 4058 \brief Resize the view by \a deltaWidth horizontally and \a deltaHeight 4059 vertically without moving the top left corner of the view. 4060 4061 \param deltaWidth The number of pixels to resize the view by horizontally. 4062 \param deltaHeight The number of pixels to resize the view by vertically. 4063 4064 \since BeOS R3 4065*/ 4066 4067 4068/*! 4069 \fn void BView::ResizeTo(float width, float height) 4070 \brief Resize the view to the specified \a width and \a height. 4071 4072 \param width The width to resize the view to. 4073 \param height The height to resize the view to. 4074 4075 \since BeOS R3 4076*/ 4077 4078 4079/*! 4080 \fn void BView::ResizeTo(BSize size) 4081 \brief Resize the view to the dimension specified by \a size. 4082 4083 \param size The \a size to resize the view to. 4084 4085 \since Haiku R1 4086*/ 4087 4088 4089//! @} 4090 4091 4092/*! 4093 \fn status_t BView::GetSupportedSuites(BMessage* data) 4094 \copydoc BHandler::GetSupportedSuites() 4095*/ 4096 4097 4098/*! 4099 \fn BHandler* BView::ResolveSpecifier(BMessage* message, int32 index, 4100 BMessage* specifier, int32 what, const char* property) 4101 \copydoc BHandler::ResolveSpecifier() 4102*/ 4103 4104 4105/*! 4106 \fn status_t BView::Perform(perform_code code, void* _data) 4107 \brief Perform some action. (Internal Method) 4108 4109 The following perform codes are recognized: 4110 - \c PERFORM_CODE_MIN_SIZE: 4111 - \c PERFORM_CODE_MAX_SIZE: 4112 - \c PERFORM_CODE_PREFERRED_SIZE: 4113 - \c PERFORM_CODE_LAYOUT_ALIGNMENT: 4114 - \c PERFORM_CODE_HAS_HEIGHT_FOR_WIDTH: 4115 - \c PERFORM_CODE_GET_HEIGHT_FOR_WIDTH: 4116 - \c PERFORM_CODE_SET_LAYOUT: 4117 - \c PERFORM_CODE_INVALIDATE_LAYOUT: 4118 - \c PERFORM_CODE_DO_LAYOUT: 4119 - \c PERFORM_CODE_GET_TOOL_TIP_AT: 4120 - \c PERFORM_CODE_ALL_UNARCHIVED: 4121 - \c PERFORM_CODE_ALL_ARCHIVED: 4122 4123 \param code The perform code. 4124 \param _data A pointer to store some data. 4125 4126 \returns A status code. 4127 4128 \since Haiku R1 4129*/ 4130 4131 4132/*! 4133 \name Layouting 4134 4135 \note These methods were not available in BeOS R5. 4136*/ 4137 4138 4139//! @{ 4140 4141 4142/*! 4143 \fn BSize BView::MinSize() 4144 \brief Return the minimum size of the view. 4145 4146 \remark This is only meaningful if the view is part of a BLayout. 4147 4148 \return The minimum size of the view as a BSize. 4149 4150 \sa BAbstractLayout::MinSize() 4151 4152 \since Haiku R1 4153*/ 4154 4155 4156/*! 4157 \fn BSize BView::MaxSize() 4158 \brief Return the maximum size of the view. 4159 4160 \remark This is only meaningful if the view is part of a BLayout. 4161 4162 \return The maximum size of the view as a BSize. 4163 4164 \sa BAbstractLayout::MaxSize() 4165 4166 \since Haiku R1 4167*/ 4168 4169 4170/*! 4171 \fn BSize BView::PreferredSize() 4172 \brief Return the preferred size of the view. 4173 4174 \remark This is only meaningful if the view is part of a BLayout. 4175 4176 \return The preferred size of the view as a BSize. 4177 4178 \sa BAbstractLayout::PreferredSize() 4179 4180 \since Haiku R1 4181*/ 4182 4183 4184/*! 4185 \fn void BView::SetExplicitMinSize(BSize size) 4186 \brief Set this view's min size, to be used by MinSize(). 4187 4188 \remark This is only meaningful if the view is part of a BLayout. 4189 4190 \sa BAbstractLayout::SetExplicitMinSize() 4191 4192 \since Haiku R1 4193*/ 4194 4195 4196/*! 4197 \fn void BView::SetExplicitMaxSize(BSize size) 4198 \brief Set this view's max size, to be used by MaxSize(). 4199 4200 \remark This is only meaningful if the view is part of a BLayout. 4201 4202 \sa BAbstractLayout::SetExplicitMaxSize() 4203 4204 \since Haiku R1 4205*/ 4206 4207 4208/*! 4209 \fn void BView::SetExplicitPreferredSize(BSize size) 4210 \brief Set this view's preferred size, to be used by PreferredSize(). 4211 4212 \remark This is only meaningful if the view is part of a BLayout. 4213 4214 \sa BAbstractLayout::SetExplicitPreferredSize() 4215 4216 \since Haiku R1 4217*/ 4218 4219 4220/*! 4221 \fn void BView::SetExplicitAlignment(BAlignment alignment) 4222 \brief Set this view's alignment, to be used by Alignment(). 4223 4224 \remark This is only meaningful if the view is part of a BLayout. 4225 4226 \sa BAbstractLayout::SetExplicitAlignment() 4227 4228 \since Haiku R1 4229*/ 4230 4231 4232/*! 4233 \fn void BView::SetLayout(BLayout* layout) 4234 \brief Sets the \a layout of the view. 4235 4236 \param layout The \a layout to set. 4237 4238 \since Haiku R1 4239*/ 4240 4241 4242/*! 4243 \fn BLayout* BView::GetLayout() const 4244 \brief Get the layout of the view. 4245 4246 \remark This is only meaningful if the view is part of a BLayout. 4247 4248 \returns The layout of the view. 4249 4250 \since Haiku R1 4251*/ 4252 4253 4254/*! 4255 \fn void BView::InvalidateLayout(bool descendants) 4256 \brief Invalidate layout. 4257 4258 \remark This is only meaningful if the view is part of a BLayout. 4259 4260 \param descendants Also invalidate its children views. 4261 4262 \since Haiku R1 4263*/ 4264 4265 4266/*! 4267 \fn void BView::EnableLayoutInvalidation() 4268 \brief Enable layout invalidation. 4269 4270 \remark This is only meaningful if the view is part of a BLayout. 4271 4272 \since Haiku R1 4273*/ 4274 4275 4276/*! 4277 \fn void BView::DisableLayoutInvalidation() 4278 \brief Disable layout invalidation. 4279 4280 \remark This is only meaningful if the view is part of a BLayout. 4281 4282 \since Haiku R1 4283*/ 4284 4285 4286/*! 4287 \fn bool BView::IsLayoutInvalidationDisabled() 4288 \brief Returns whether or not layout invalidation is disabled. 4289 4290 \remark This is only meaningful if the view is part of a BLayout. 4291 4292 \return \c true of layout invalidation is disabled, \c false otherwise. 4293 4294 \since Haiku R1 4295*/ 4296 4297 4298/*! 4299 \fn bool BView::IsLayoutValid() const 4300 \brief Returns whether or not the layout is valid. 4301 4302 \remark This is only meaningful if the view is part of a BLayout. 4303 4304 \brief Returns \c true if the layout is valid, \c false otherwise. 4305 4306 \since Haiku R1 4307*/ 4308 4309 4310/*! 4311 \fn void BView::ResetLayoutInvalidation() 4312 \brief Service call for BView derived classes re-enabling 4313 InvalidateLayout() notifications. 4314 4315 BLayout and BView will avoid calling InvalidateLayout on views that have 4316 already been invalidated, but if the view caches internal layout information 4317 which it updates in methods other than DoLayout(), it has to invoke this 4318 method, when it has done so, since otherwise the information might become 4319 obsolete without the layout noticing. 4320 4321 This is only meaningful if the view is part of a BLayout. 4322 4323 \since Haiku R1 4324*/ 4325 4326 4327/*! 4328 \fn void BView::Layout(bool force) 4329 \brief Layout the view. 4330 4331 \remark This is only meaningful if the view is part of a BLayout. 4332 4333 \param force If \c true layout even if valid. 4334 4335 \since Haiku R1 4336*/ 4337 4338 4339/*! 4340 \fn void BView::Relayout() 4341 \brief Relayout the view. 4342 4343 \remark This is only meaningful if the view is part of a BLayout. 4344 4345 \since Haiku R1 4346*/ 4347 4348 4349/*! 4350 \fn void BView::DoLayout() 4351 \brief Layout view within the layout context. 4352 4353 \remark This is only meaningful if the view is part of a BLayout. 4354 4355 \since Haiku R1 4356*/ 4357 4358 4359//! @} 4360 4361 4362/*! 4363 \name Tool Tips 4364 4365 \note These methods were not available in BeOS R5. 4366*/ 4367 4368 4369//! @{ 4370 4371 4372/*! 4373 \fn void BView::SetToolTip(const char* text) 4374 \brief Set the tool tip of the view to \a text. 4375 4376 \param text The \a text to set the view to or \c NULL or blank to unset. 4377 4378 \since Haiku R1 4379*/ 4380 4381 4382/*! 4383 \fn void BView::SetToolTip(BToolTip* tip) 4384 \brief Set the tool tip of the view to the \a tip object. 4385 4386 \param tip The tool tip object to set the view to or \c NULL to unset. 4387 4388 \since Haiku R1 4389*/ 4390 4391 4392/*! 4393 \fn BToolTip* BView::ToolTip() const 4394 \brief Return the tool tip set to the view or \c NULL if not set. 4395 4396 \return The BToolTip object set to the view. 4397 4398 \since Haiku R1 4399*/ 4400 4401 4402/*! 4403 \fn void BView::ShowToolTip(BToolTip* tip) 4404 \brief Show the tool tip at the current mouse position. 4405 4406 \param tip The BToolTip object to show. 4407 4408 \since Haiku R1 4409*/ 4410 4411 4412/*! 4413 \fn void BView::HideToolTip() 4414 \brief Hide the view's tool tip. 4415 4416 \since Haiku R1 4417*/ 4418 4419 4420/*! 4421 \fn bool BView::GetToolTipAt(BPoint point, BToolTip** _tip) 4422 \brief Point \a _tip with the view's tool tip. 4423 4424 \param point Currently unused. 4425 \param _tip A pointer to a pointer to a BToolTip object to set. 4426 4427 \since Haiku R1 4428*/ 4429 4430 4431//! @} 4432