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 or vertical line depending on menu layout 30 and cannot be selected or highlighted. 31 32 \warning BSeparatorItems are only meant to be used with menus whose 33 items are arranged in a \c B_ITEMS_IN_COLUMN or 34 \c B_ITEMS_IN_ROW layout. 35 36 \since BeOS R3 37*/ 38 39 40/*! 41 \fn BSeparatorItem::BSeparatorItem() 42 \brief Creates a new BSeparatorItem object. 43 44 The creates a new BSeparatorItem from BMenuItem with a blank label and 45 \c NULL message, then disables it. 46 47 \since BeOS R3 48*/ 49 50 51/*! 52 \fn BSeparatorItem::BSeparatorItem(BMessage* data) 53 \brief Archive constructor. 54 55 \param data The message \a data to construct the separator item from. 56 57 \since BeOS R3 58*/ 59 60 61/*! 62 \fn BSeparatorItem::~BSeparatorItem() 63 \brief Destructor, does nothing. 64 65 \since BeOS R3 66*/ 67 68 69/*! 70 \name Archiving 71*/ 72 73 74//! @{ 75 76 77/*! 78 \fn status_t BSeparatorItem::Archive(BMessage* data, bool deep) const 79 \brief Archives the the BSeparatorItem object into the \a data message. 80 81 \param data A pointer to the BMessage to archive the object into. 82 \param deep This parameter has no effect for this class. 83 84 \return A status code, \c B_OK if everything went well or an error code 85 otherwise. 86 \retval B_OK The object was archived successfully. 87 \retval B_NO_MEMORY Ran out of memory while archiving the object. 88 89 \since BeOS R3 90*/ 91 92 93/*! 94 \fn BArchivable* BSeparatorItem::Instantiate(BMessage* data) 95 \brief Creates a new BSeparatorItem object from an \a data message. 96 97 \return A newly created BSeparatorItem object or \c NULL if the message 98 doesn't contain an archived BSeparatorItem. 99 100 \since BeOS R3 101*/ 102 103 104//! @} 105 106 107/*! 108 \fn void BSeparatorItem::SetEnabled(bool enable) 109 \brief Does nothing, this method is defined to override the default 110 BMenuItem behavior. 111 112 \param enable Not used. 113 114 \since BeOS R3 115*/ 116 117 118/*! 119 \fn void BSeparatorItem::GetContentSize(float* _width, float* _height) 120 \brief Fills out \a _width and \a _height with the content rectangle 121 dimensions. 122 123 You only need to call this method if you're implementing your own 124 DrawContent() method to override how the contents of the separator 125 are drawn. 126 127 \param _width Filled out with the width of the content rectangle. 128 \param _height Filled out with the height of the content rectangle. 129 130 \sa ContentLocation() 131 \sa DrawContent() 132 133 \since BeOS R3 134*/ 135 136 137/*! 138 \fn void BSeparatorItem::Draw() 139 \brief Hook method used to draw the menu items. 140 141 This method is called by automatically by BMenu::Draw(). You should not need to 142 call this method yourself but you may want to override it in a derived class 143 to do something other than the default. 144 145 The default draws a light grey horizontal or vertical line through the middle 146 of the item. 147 148 \since BeOS R3 149*/ 150