1/* 2 * Copyright 2014 Haiku, Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * John Scipione, jscipione@gmail.com 7 * 8 * Corresponds to: 9 * headers/os/interface/SeparatorItem.h hrev46970 10 * src/kits/interface/SeparatorItem.cpp hrev46970 11 */ 12 13 14/*! 15 \file SeparatorItem.h 16 \ingroup interface 17 \ingroup libbe 18 \brief BSeparatorItem class definition. 19*/ 20 21 22/*! 23 \class BSeparatorItem 24 \ingroup interface 25 \ingroup libbe 26 \brief Display separator item for BMenu class. 27 28 A BSeparatorItem is used to separate groups of menu items in a BMenu. 29 It is drawn as a horizontal line and cannot be selected or highlighted. 30 31 \warning BSeparatorItems are only meant to be used with menus whose 32 items are arranged in a \c B_ITEMS_IN_COLUMN layout. 33 34 \since BeOS R3 35*/ 36 37 38/*! 39 \fn BSeparatorItem::BSeparatorItem() 40 \brief Creates a new BSeparatorItem object. 41 42 The creates a new BSeparatorItem from BMenuItem with a blank label and 43 \c NULL message, then disables it. 44 45 \since BeOS R3 46*/ 47 48 49/*! 50 \fn BSeparatorItem::BSeparatorItem(BMessage* data) 51 \brief Archive constructor. 52 53 \param data The message \a data to construct the separator item from. 54 55 \since BeOS R3 56*/ 57 58 59/*! 60 \fn BSeparatorItem::~BSeparatorItem() 61 \brief Destructor, does nothing. 62 63 \since BeOS R3 64*/ 65 66 67/*! 68 \name Archiving 69*/ 70 71 72//! @{ 73 74 75/*! 76 \fn status_t BSeparatorItem::Archive(BMessage* data, bool deep) const 77 \brief Archives the the BSeparatorItem object into the \a data message. 78 79 \param data A pointer to the BMessage to archive the object into. 80 \param deep This parameter has no effect for this class. 81 82 \return A status code, \c B_OK if everything went well or an error code 83 otherwise. 84 \retval B_OK The object was archived successfully. 85 \retval B_NO_MEMORY Ran out of memory while archiving the object. 86 87 \since BeOS R3 88*/ 89 90 91/*! 92 \fn BArchivable* BSeparatorItem::Instantiate(BMessage* data) 93 \brief Creates a new BSeparatorItem object from an \a data message. 94 95 \return A newly created BSeparatorItem object or \c NULL if the message 96 doesn't contain an archived BSeparatorItem. 97 98 \since BeOS R3 99*/ 100 101 102//! @} 103 104 105/*! 106 \fn void BSeparatorItem::SetEnabled(bool enable) 107 \brief Does nothing, this method is defined to override the default 108 BMenuItem behavior. 109 110 \param enable Not used. 111 112 \since BeOS R3 113*/ 114 115 116/*! 117 \fn void BSeparatorItem::GetContentSize(float* _width, float* _height) 118 \brief Fills out \a _width and \a _height with the content rectangle 119 dimensions. 120 121 You only need to call this method if you're implementing your own 122 DrawContent() method to override how the contents of the separator 123 are drawn. 124 125 \param _width Filled out with the width of the content rectangle. 126 \param _height Filled out with the height of the content rectangle. 127 128 \sa ContentLocation() 129 \sa DrawContent() 130 131 \since BeOS R3 132*/ 133 134 135/*! 136 \fn void BSeparatorItem::Draw() 137 \brief Hook method used to draw the menu items. 138 139 This method is called by automatically by BMenu::Draw(). You should not need to 140 call this method yourself but you may want to override it in a derived class 141 to do something other than the default. 142 143 The default draws a light grey horizontal line through the middle of the item. 144 145 \since BeOS R3 146*/ 147