Displays a list of items that the user can select and invoke. More...
Inherited by BOutlineListView.
Public Member Functions | |
BListView (BMessage *data) | |
Creates a BListView object from the archive message. | |
BListView (BRect frame, const char *name, list_view_type type=B_SINGLE_SELECTION_LIST, uint32 resizeMask=B_FOLLOW_LEFT_TOP, uint32 flags=B_WILL_DRAW|B_FRAME_EVENTS|B_NAVIGABLE) | |
Creates a new list view. This is the non-layout constructor. | |
BListView (const char *name, list_view_type type=B_SINGLE_SELECTION_LIST, uint32 flags=B_WILL_DRAW|B_FRAME_EVENTS|B_NAVIGABLE) | |
Creates a new list view suitable as part of a layout with the specified name, type, and flags. | |
BListView (list_view_type type=B_SINGLE_SELECTION_LIST) | |
Creates a new list view suitable as part of a layout. | |
virtual | ~BListView () |
Delete the BListView object and free the memory used by it. | |
virtual status_t | GetSupportedSuites (BMessage *data) |
Reports the suites of messages and specifiers that derived classes understand. | |
void | InvalidateItem (int32 index) |
Draws the list item at the specified index. | |
virtual status_t | Invoke (BMessage *message=NULL) |
Invoke the list view, either with the current invocation message or message if it is specified. | |
BRect | ItemFrame (int32 index) |
Return the frame of the item at the specified index. | |
virtual void | MakeFocus (bool state=true) |
Highlight or unhighlight the selection when the list view acquires or loses its focus state. | |
bool | MoveItem (int32 from, int32 to) |
Move the item at index from to the position in the list at index to. | |
virtual status_t | Perform (perform_code code, void *arg) |
Performs an action give a perform_code and data. (Internal Method) | |
bool | ReplaceItem (int32 index, BListItem *item) |
Replace the item at index index with item. | |
virtual BHandler * | ResolveSpecifier (BMessage *message, int32 index, BMessage *specifier, int32 what, const char *property) |
Determines the proper handler for the passed in scripting message. | |
virtual void | SetFont (const BFont *font, uint32 mask=B_FONT_ALL) |
Sets the font of the list view to font with the font parameters set by mask. | |
void | SortItems (int(*cmp)(const void *, const void *)) |
Sort the items according the the passed in cmp function. | |
bool | SwapItems (int32 a, int32 b) |
Swap item a with item b. | |
Hook Methods | |
virtual void | Draw (BRect updateRect) |
Hook method called to draw the contents of the text view. | |
virtual void | AttachedToWindow () |
Hook method called when the list view is added to the view hierarchy. | |
virtual void | DetachedFromWindow () |
Hook method that is called when the list view is removed from the view hierarchy. | |
virtual void | AllAttached () |
Hook method called once all views are attached to the view. | |
virtual void | AllDetached () |
Hook method called once all views are detached from the view. | |
virtual void | FrameResized (float newWidth, float newHeight) |
Hook method called when the list view is resized. | |
virtual void | FrameMoved (BPoint newPosition) |
Hook method called when the list view is moved. | |
virtual void | TargetedByScrollView (BScrollView *view) |
Hook method called when the list view is attached to a BScrollView. | |
virtual void | WindowActivated (bool active) |
Hook method that is called when the window becomes the active window or gives up that status. | |
virtual void | MessageReceived (BMessage *message) |
Hook method called when a message is received by the list view. | |
virtual void | KeyDown (const char *bytes, int32 numBytes) |
Hook method that is called when a key is pressed while the view is the focus view of the active window. | |
virtual void | MouseDown (BPoint where) |
Hook method that is called when a mouse button is pushed down while the cursor is contained in the view. | |
virtual void | MouseUp (BPoint where) |
Hook method that is called when a mouse button is released while the cursor is contained in the view. | |
virtual void | MouseMoved (BPoint where, uint32 code, const BMessage *dragMessage) |
Hook method that is called whenever the mouse cursor enters, exits or moves inside the list view. | |
virtual void | SelectionChanged () |
Hook method that is called when the selection changes. | |
virtual bool | InitiateDrag (BPoint where, int32 index, bool wasSelected) |
Hook method called when a drag and drop operation is initiated. | |
Resizing | |
virtual void | ResizeToPreferred () |
Resize the view to its preferred size. | |
virtual void | GetPreferredSize (float *_width, float *_height) |
Fill out the _width and _height parameters with the preferred width and height of the list view. | |
virtual BSize | MinSize () |
Returns the minimum size of the list view. | |
virtual BSize | MaxSize () |
Returns the maximum size of the list view. | |
virtual BSize | PreferredSize () |
Returns the preferred size of the list view. | |
Scrolling | |
virtual void | ScrollTo (BPoint where) |
Scroll the view to the specified point. | |
void | ScrollTo (int32 index) |
Scrolls to list item at index. | |
void | ScrollToSelection () |
Scrolls to selected list item. | |
Adding/Removing Items | |
virtual bool | AddItem (BListItem *item, int32 atIndex) |
Add an item to the list view at the specified index. | |
virtual bool | AddList (BList *newItems) |
Add a list of list items to the end of the list view. | |
virtual bool | AddList (BList *newItems, int32 atIndex) |
Add a list of list items to the list view at the specified index. | |
virtual bool | RemoveItem (BListItem *item) |
Remove the specified list item. | |
virtual BListItem * | RemoveItem (int32 index) |
Remove the item at index from the list. | |
virtual bool | RemoveItems (int32 index, int32 count) |
Removes the items from index and the next count items. | |
Selection and Invocation Message Methods | |
virtual void | SetSelectionMessage (BMessage *message) |
Sets the message that the list view sends when a new item is selected. | |
virtual void | SetInvocationMessage (BMessage *message) |
BMessage * | SelectionMessage () const |
Returns the message that is send when an item is selected. | |
uint32 | SelectionCommand () const |
Returns the what parameter of the message that is send when an item is selected. | |
BMessage * | InvocationMessage () const |
Returns the message that is send when an item is invoked. | |
uint32 | InvocationCommand () const |
Returns the what parameter of the current invocation method. | |
List Type Methods | |
virtual void | SetListType (list_view_type type) |
Sets the list view type. | |
list_view_type | ListType () const |
Returns the current list view type. | |
List Methods | |
BListItem * | ItemAt (int32 index) const |
Returns the list item at the specified index. | |
int32 | IndexOf (BPoint point) const |
Returns the index of the item at the specified point. | |
int32 | IndexOf (BListItem *item) const |
Returns the index of the specified item. | |
BListItem * | FirstItem () const |
Returns a pointer to the first list item. | |
BListItem * | LastItem () const |
Returns a pointer to the last list item. | |
bool | HasItem (BListItem *item) const |
Returns whether or not the list contains the specified item. | |
int32 | CountItems () const |
Returns the number of items contained in the list view. | |
virtual void | MakeEmpty () |
Empties the list view of all items. | |
bool | IsEmpty () const |
Returns whether or not the list view is empty. | |
void | DoForEach (bool(*func)(BListItem *item)) |
Calls the specified function on each item in the list. | |
void | DoForEach (bool(*func)(BListItem *item, void *arg), void *arg) |
Calls the specified function on each item in the list. | |
const BListItem ** | Items () const |
Returns a pointer to the list of list items. | |
Selection | |
void | Select (int32 index, bool extend=false) |
Selects the list item at the specified index. | |
void | Select (int32 from, int32 to, bool extend=false) |
Select items from start to finish. | |
bool | IsItemSelected (int32 index) const |
Returns whether or not the item at index is selected. | |
int32 | CurrentSelection (int32 index=0) const |
Returns the index of a currently selected item relative to the passed in index. | |
Deselection | |
void | DeselectAll () |
Deselect all items. | |
void | DeselectExcept (int32 exceptFrom, int32 exceptTo) |
Deselect all items except the items with index in the range of exceptFrom to exceptTo. | |
void | Deselect (int32 index) |
Deselect the item at index. | |
Public Member Functions inherited from BView | |
BView (BMessage *archive) | |
Archive constructor. | |
BView (BRect frame, const char *name, uint32 resizingMode, uint32 flags) | |
Standard constructor. | |
BView (const char *name, uint32 flags, BLayout *layout=NULL) | |
Layout constructor. | |
virtual | ~BView () |
Destructor method. | |
BRect | Bounds () const |
Returns the view's frame rectangle in the view's coordinate system. | |
void | Flush () const |
Flushes the attached window's connection to App Server. | |
BRect | Frame () const |
Returns the view's frame rectangle in the parent's coordinate system. | |
virtual void | GetPreferredSize (float *_width, float *_height) |
Fill out the preferred width and height of the view into the _width and _height parameters. | |
virtual status_t | GetSupportedSuites (BMessage *data) |
virtual void | Hide () |
Hides the view without removing it from the view hierarchy. | |
bool | IsFocus () const |
Returns whether or not the view is the window's current focus view. | |
bool | IsHidden () const |
Returns whether or not the view is hidden. | |
bool | IsHidden (const BView *looking_from) const |
Returns whether or not the view is hidden from the perspective of lookingFrom. | |
bool | IsPrinting () const |
Returns whether or not the view is drawing to a printer. | |
BPoint | LeftTop () const |
Returns the left top corner point. | |
virtual status_t | Perform (perform_code code, void *data) |
Perform some action. (Internal Method) | |
virtual void | ResizeToPreferred () |
Resizes the view to its preferred size keeping the position of the left top corner constant. | |
uint32 | ResizingMode () const |
Returns the resizing mode flags mask set in the constructor or by SetResizingMode(). | |
virtual BHandler * | ResolveSpecifier (BMessage *message, int32 index, BMessage *specifier, int32 form, const char *property) |
virtual void | SetResizingMode (uint32 mode) |
Sets the resizing mode of the view according to the mode mask. | |
void | SetViewCursor (const BCursor *cursor, bool sync=true) |
Assigns cursor to the view. | |
virtual void | Show () |
Shows the view making it visible. | |
void | Sync () const |
Synchronizes the attached window's connection to App Server. | |
BWindow * | Window () const |
Returns the window the view is attached to. | |
void | AddChild (BView *child, BView *before=NULL) |
Adds child to the view hierarchy immediately before before. | |
bool | AddChild (BLayoutItem *child) |
Add the child layout item to the view hierarchy. | |
bool | RemoveChild (BView *child) |
Removes child from the view hierarchy. | |
int32 | CountChildren () const |
Returns the number of child views that this view has. | |
BView * | ChildAt (int32 index) const |
Returns a pointer to the child view found at index. | |
BView * | NextSibling () const |
Returns a pointer to the next sibling view. | |
BView * | PreviousSibling () const |
Returns a pointer to the previous sibling view. | |
bool | RemoveSelf () |
Removes the view and all child views from the view hierarchy. | |
BView * | FindView (const char *name) const |
Returns the view in the view hierarchy with the specified name. | |
BView * | Parent () const |
Returns a pointer to the view's parent. | |
void | ConvertToScreen (BPoint *point) const |
Convert point to the screen's coordinate system in place. | |
BPoint | ConvertToScreen (BPoint point) const |
Returns point converted to the screen's coordinate system. | |
void | ConvertFromScreen (BPoint *point) const |
Convert point from the screen's coordinate system to the view's coordinate system in place. | |
BPoint | ConvertFromScreen (BPoint point) const |
Returns point converted from the screen's coordinate system to the view's coordinate system. | |
void | ConvertToScreen (BRect *rect) const |
Convert rect to the screen's coordinate system in place. | |
BRect | ConvertToScreen (BRect rect) const |
Returns rect converted to the screen's coordinate system. | |
void | ConvertFromScreen (BRect *rect) const |
Convert rect from the screen's coordinate system to the view's coordinate system in place. | |
BRect | ConvertFromScreen (BRect rect) const |
Returns rect converted from the screen's coordinate system to the view's coordinate system. | |
void | ConvertToParent (BPoint *point) const |
Convert point to the parent's coordinate system in place. | |
BPoint | ConvertToParent (BPoint point) const |
Returns point converted to the parent's coordinate system. | |
void | ConvertFromParent (BPoint *point) const |
Convert point from the parent's coordinate system to the view's coordinate system in place. | |
BPoint | ConvertFromParent (BPoint point) const |
Returns point converted from the parent's coordinate system to the view's coordinate system. | |
void | ConvertToParent (BRect *rect) const |
Convert rect to the parent's coordinate system in place. | |
BRect | ConvertToParent (BRect rect) const |
Returns rect converted to the parent's coordinate system. | |
void | ConvertFromParent (BRect *rect) const |
Convert rect from the parent's coordinate system to the view's coordinate system in place. | |
BRect | ConvertFromParent (BRect rect) const |
Returns rect converted from the parent's coordinate system to the view's coordinate system. | |
virtual void | SetFlags (uint32 flags) |
Sets the view flags to the flags mask. | |
uint32 | Flags () const |
Return the view flags set in the constructor or by SetFlags(). | |
void | GetClippingRegion (BRegion *region) const |
Fill out region with the view's clipping region. | |
virtual void | ConstrainClippingRegion (BRegion *region) |
Set the clipping region the region restricting the area that the view can draw in. | |
void | ClipToPicture (BPicture *picture, BPoint where=B_ORIGIN, bool sync=true) |
Intersects the current clipping region of the view with the pixels of picture. | |
void | ClipToInversePicture (BPicture *picture, BPoint where=B_ORIGIN, bool sync=true) |
Intersects the current clipping region of the view with the pixels outside of picture. | |
void | ClipToRect (BRect rect) |
Intersects the current clipping region of the view with the pixels of rect. | |
void | ClipToInverseRect (BRect rect) |
Intersects the current clipping region of the view with the pixels outside of rect. | |
void | ClipToShape (BShape *shape) |
Intersects the current clipping region of the view with the pixels of shape. | |
void | ClipToInverseShape (BShape *shape) |
Intersects the current clipping region of the view with the pixels outside of shape. | |
virtual void | SetDrawingMode (drawing_mode mode) |
Sets the drawing mode of the view. | |
drawing_mode | DrawingMode () const |
Return the current drawing_mode. | |
void | SetBlendingMode (source_alpha srcAlpha, alpha_function alphaFunc) |
Set the blending mode which controls how transparency is used. | |
void | GetBlendingMode (source_alpha *srcAlpha, alpha_function *alphaFunc) const |
Fill out srcAlpha and alphaFunc with the alpha mode and alpha function of the view. | |
virtual void | SetPenSize (float size) |
Set the pen size to size. | |
float | PenSize () const |
Return the current pen size. | |
bool | HasDefaultColors () const |
Tests if the view has any colors set. | |
bool | HasSystemColors () const |
Tests if the view is using system "panel" colors. B_PANEL_BACKGROUND_COLOR for ViewUIColor() B_PANEL_BACKGROUND_COLOR for LowUIColor() B_PANEL_TEXT_COLOR for HighUIColor() | |
void | AdoptParentColors () |
Attempts to use the colors of any parent view. Will adopt view, low, and high colors. Should be called in AttachedToWindow() or AllAttached(). | |
void | AdoptSystemColors () |
Instructs view to use standard system "panel" colors. B_PANEL_BACKGROUND_COLOR for ViewUIColor() B_PANEL_BACKGROUND_COLOR for LowUIColor() B_PANEL_TEXT_COLOR for HighUIColor() | |
void | AdoptViewColors (BView *view) |
Attempts to use the colors of a given view. Will adopt view, low, and high colors. | |
virtual void | SetViewColor (rgb_color color) |
Set the view color of the view. | |
void | SetViewColor (uchar red, uchar green, uchar blue, uchar alpha=255) |
Set the view color of the view. | |
rgb_color | ViewColor () const |
Return the current view color. | |
void | SetViewUIColor (color_which which, float tint=B_NO_TINT) |
Set the view color of the view to a system constant. The color will update live with user changes. | |
color_which | ViewUIColor (float *tint=NULL) const |
Return the current view color constant being used. | |
virtual void | SetHighColor (rgb_color color) |
Set the high color of the view. | |
void | SetHighColor (uchar red, uchar green, uchar blue, uchar alpha=255) |
Set the high color of the view. | |
rgb_color | HighColor () const |
Return the current high color. | |
void | SetHighUIColor (color_which which, float tint=B_NO_TINT) |
Set the high color of the view to a system constant. The color will update live with user changes. | |
color_which | HighUIColor (float *tint=NULL) const |
Return the current high color constant being used. | |
virtual void | SetLowColor (rgb_color color) |
Set the low color of the view. | |
void | SetLowColor (uchar red, uchar green, uchar blue, uchar alpha=255) |
Set the low color of the view. | |
rgb_color | LowColor () const |
Return the current low color. | |
void | SetLowUIColor (color_which which, float tint=B_NO_TINT) |
Set the low color of the view to a system constant. The color will update live with user changes. | |
color_which | LowUIColor (float *tint=NULL) const |
Return the current low color constant being used. | |
void | SetLineMode (cap_mode lineCap, join_mode lineJoin, float miterLimit=B_DEFAULT_MITER_LIMIT) |
Set line mode to use PostScript-style line cap and join modes. | |
join_mode | LineJoinMode () const |
Returns the current line join mode. | |
cap_mode | LineCapMode () const |
Returns the current line cap mode. | |
float | LineMiterLimit () const |
Returns the miter limit used for B_MITER_JOIN join mode. | |
void | SetFillRule (int32 rule) |
Sets the fill rule for the view. | |
int32 | FillRule () const |
Return the current fill mode. | |
void | SetOrigin (BPoint where) |
Sets the origin in the view's coordinate system. | |
void | SetOrigin (float x, float y) |
Sets the origin in the view's coordinate system. | |
BPoint | Origin () const |
Returns the origin point in the view's coordinate system. | |
void | SetTransform (BAffineTransform transform) |
Sets a BAffineTransform to transform the coordinate system. | |
BAffineTransform | Transform () const |
Returns the current BAffineTransform that is applied to the coordinate system. | |
void | TranslateBy (double x, double y) |
Translate the current view by coordinates. | |
void | ScaleBy (double x, double y) |
Scale the current view by factors x and y. | |
void | RotateBy (double angleRadians) |
Rotate the current view by angleRadians. | |
BAffineTransform | TransformTo (coordinate_space basis) const |
Return the BAffineTransform to convert from the current drawing space to basis. | |
void | PushState () |
Saves the drawing state to the stack. | |
void | PopState () |
Restores the drawing state from the stack. | |
void | MovePenTo (BPoint pt) |
Move the pen to point in the view's coordinate system. | |
void | MovePenTo (float x, float y) |
Move the pen to the point specified by x and y in the view's coordinate system. | |
void | MovePenBy (float x, float y) |
Move the pen by x pixels horizontally and y pixels vertically. | |
BPoint | PenLocation () const |
Return the current pen location as a BPoint object. | |
void | GetFont (BFont *font) const |
Fill out font with the font set to the view. | |
void | TruncateString (BString *in_out, uint32 mode, float width) const |
Truncate string with truncation mode mode so that it is no wider than width set in the view's font. | |
float | StringWidth (const char *string) const |
Return the width of string set in the font of the view. | |
float | StringWidth (const char *string, int32 length) const |
Return the width of string set in the font of the view up to length characters. | |
void | GetStringWidths (char *stringArray[], int32 lengthArray[], int32 numStrings, float widthArray[]) const |
Fill out widths of the strings in stringArray set in the font of the view into widthArray. | |
void | SetFontSize (float size) |
Set the size of the view's font to size. | |
void | ForceFontAliasing (bool enable) |
Turn anti-aliasing on and off when printing. | |
void | GetFontHeight (font_height *height) const |
Fill out the font_height struct with the view font. | |
void | SetScale (float scale) const |
Sets the scale of the coordinate system the view uses for drawing. | |
float | Scale () const |
Return the current drawing scale. | |
void | SetViewBitmap (const BBitmap *bitmap, BRect srcRect, BRect dstRect, uint32 followFlags=B_FOLLOW_LEFT_TOP, uint32 options=B_TILE_BITMAP) |
Sets the background bitmap of the view. | |
void | SetViewBitmap (const BBitmap *bitmap, uint32 followFlags=B_FOLLOW_LEFT_TOP, uint32 options=B_TILE_BITMAP) |
Sets the background bitmap of the view. | |
void | ClearViewBitmap () |
Clears the background bitmap of the view if it has one. | |
status_t | SetViewOverlay (const BBitmap *overlay, BRect srcRect, BRect dstRect, rgb_color *colorKey, uint32 followFlags=B_FOLLOW_LEFT_TOP, uint32 options=0) |
Sets the overlay bitmap of the view. | |
status_t | SetViewOverlay (const BBitmap *overlay, rgb_color *colorKey, uint32 followFlags=B_FOLLOW_LEFT_TOP, uint32 options=0) |
Sets the overlay bitmap of the view. | |
void | ClearViewOverlay () |
Clears the overlay bitmap of the view if it has one. | |
void | StrokeLine (BPoint toPoint, ::pattern pattern=B_SOLID_HIGH) |
Stroke a line from the current pen location to the point toPoint. | |
void | StrokeLine (BPoint start, BPoint end, ::pattern pattern=B_SOLID_HIGH) |
Stroke a line from point start to point end. | |
void | BeginLineArray (int32 count) |
Begin a line array of up to count lines. | |
void | AddLine (BPoint start, BPoint end, rgb_color color) |
Add a line to the line array drawn from start to end. | |
void | EndLineArray () |
End the line array drawing the lines. | |
void | StrokePolygon (const BPolygon *polygon, bool closed=true, ::pattern pattern=B_SOLID_HIGH) |
Stroke a polygon shape. | |
void | StrokePolygon (const BPoint *pointArray, int32 numPoints, bool closed=true, ::pattern pattern=B_SOLID_HIGH) |
Stroke a polygon shape made up of points specified by pointArray. | |
void | StrokePolygon (const BPoint *pointArray, int32 numPoints, BRect bounds, bool closed=true, ::pattern pattern=B_SOLID_HIGH) |
Stroke a polygon shape made up of points specified by pointArray inscribed by bounds. | |
void | FillPolygon (const BPolygon *polygon, ::pattern pattern=B_SOLID_HIGH) |
Fill a polygon shape. | |
void | FillPolygon (const BPoint *pointArray, int32 numPoints, ::pattern pattern=B_SOLID_HIGH) |
Fill a polygon shape made up of points specified by pointArray. | |
void | FillPolygon (const BPoint *pointArray, int32 numPoints, BRect bounds, ::pattern pattern=B_SOLID_HIGH) |
Fill a polygon shape made up of points specified by pointArray inscribed by bounds. | |
void | FillPolygon (const BPolygon *polygon, const BGradient &gradient) |
Fill a polygon shape with the specified gradient pattern. | |
void | FillPolygon (const BPoint *pointArray, int32 numPoints, const BGradient &gradient) |
Fill a polygon shape made up of points specified by pointArray with the specified gradient pattern. | |
void | FillPolygon (const BPoint *pointArray, int32 numPoints, BRect bounds, const BGradient &gradient) |
Fill a polygon shape made up of points specified by pointArray inscribed by bounds with the specified gradient pattern. | |
void | StrokeTriangle (BPoint point1, BPoint point2, BPoint point3, BRect bounds, ::pattern pattern=B_SOLID_HIGH) |
Stroke the triangle specified by points point1, point2, and point3 and enclosed by bounds. | |
void | StrokeTriangle (BPoint point1, BPoint point2, BPoint point3, ::pattern pattern=B_SOLID_HIGH) |
Stroke the triangle specified by points point1, point2, and point3. | |
void | FillTriangle (BPoint point1, BPoint point2, BPoint point3, ::pattern pattern=B_SOLID_HIGH) |
Fill the triangle specified by points point1, point2, and point3. | |
void | FillTriangle (BPoint point1, BPoint point2, BPoint point3, BRect bounds, ::pattern pattern=B_SOLID_HIGH) |
Fill the triangle specified by points point1, point2, and point3 and enclosed by bounds. | |
void | FillTriangle (BPoint point1, BPoint point2, BPoint point3, const BGradient &gradient) |
Fill the triangle specified by points point1, point2, and point3 with the specified gradient pattern. | |
void | FillTriangle (BPoint point1, BPoint point2, BPoint point3, BRect bounds, const BGradient &gradient) |
Fill the triangle specified by points point1, point2, and point3 and enclosed by bounds with the specified gradient pattern. | |
void | StrokeRect (BRect rect, ::pattern pattern=B_SOLID_HIGH) |
Stroke the rectangle specified by rect. | |
void | FillRect (BRect rect, ::pattern pattern=B_SOLID_HIGH) |
Fill the rectangle specified by rect. | |
void | FillRect (BRect rect, const BGradient &gradient) |
Fill the rectangle specified by rect with the specified gradient pattern. | |
void | FillRegion (BRegion *rectegion, ::pattern pattern=B_SOLID_HIGH) |
Fill region. | |
void | FillRegion (BRegion *rectegion, const BGradient &gradient) |
Fill region with the specified gradient pattern. | |
void | InvertRect (BRect rect) |
Inverts the colors within rect. | |
void | StrokeRoundRect (BRect rect, float xRadius, float yRadius, ::pattern pattern=B_SOLID_HIGH) |
Stroke the rounded rectangle with horizontal radius xRadius and vertical radius yRadius. | |
void | FillRoundRect (BRect rect, float xRadius, float yRadius, ::pattern pattern=B_SOLID_HIGH) |
Fill the rounded rectangle with horizontal radius xRadius and vertical radius yRadius. | |
void | FillRoundRect (BRect rect, float xRadius, float yRadius, const BGradient &gradient) |
Fill the rounded rectangle with horizontal radius xRadius and vertical radius yRadius with the specified gradient pattern. | |
void | StrokeEllipse (BPoint center, float xRadius, float yRadius, ::pattern pattern=B_SOLID_HIGH) |
Stroke the outline of an ellipse starting at center with a horizontal radius of xRadius and a vertical radius of yRadius. | |
void | StrokeEllipse (BRect rect, ::pattern pattern=B_SOLID_HIGH) |
Stroke the outline of an ellipse inscribed within rect. | |
void | FillEllipse (BPoint center, float xRadius, float yRadius, ::pattern pattern=B_SOLID_HIGH) |
Fill an ellipse starting at center with a horizontal radius of xRadius and a vertical radius of yRadius. | |
void | FillEllipse (BRect rect, ::pattern pattern=B_SOLID_HIGH) |
Fill an ellipse inscribed within rect. | |
void | FillEllipse (BPoint center, float xRadius, float yRadius, const BGradient &gradient) |
Fill an ellipse with the specified gradient pattern starting at center with a horizontal radius of xRadius and a vertical radius of yRadius. | |
void | FillEllipse (BRect rect, const BGradient &gradient) |
Fill an ellipse with the specified gradient pattern inscribed within rect. | |
void | StrokeArc (BPoint center, float xRadius, float yRadius, float startAngle, float arcAngle, ::pattern pattern=B_SOLID_HIGH) |
Stroke the outline of an arc starting at center with a horizontal radius of xRadius and a vertical radius of yRadius starting at startAngle and drawing arcAngle degrees. | |
void | StrokeArc (BRect rect, float startAngle, float arcAngle, ::pattern pattern=B_SOLID_HIGH) |
Stroke the outline of an arc inscribed within rect starting at startAngle and drawing arcAngle degrees. | |
void | FillArc (BPoint center, float xRadius, float yRadius, float startAngle, float arcAngle, ::pattern pattern=B_SOLID_HIGH) |
Fill an arc starting at center with a horizontal radius of xRadius and a vertical radius of yRadius starting at startAngle and drawing arcAngle degrees. | |
void | FillArc (BRect rect, float startAngle, float arcAngle, ::pattern pattern=B_SOLID_HIGH) |
Fill an arc inscribed within rect starting at startAngle and drawing arcAngle degrees. | |
void | FillArc (BPoint center, float xRadius, float yRadius, float startAngle, float arcAngle, const BGradient &gradient) |
Fill an arc with the specified gradient pattern starting at center with a horizontal radius of xRadius and a vertical radius of yRadius starting at startAngle and drawing arcAngle degrees. | |
void | FillArc (BRect rect, float startAngle, float arcAngle, const BGradient &gradient) |
Fill an arc with the specified gradient pattern inscribed within rect starting at startAngle and drawing arcAngle degrees. | |
void | StrokeBezier (BPoint *controlPoints, ::pattern pattern=B_SOLID_HIGH) |
Stroke a bezier curve. | |
void | FillBezier (BPoint *controlPoints, ::pattern pattern=B_SOLID_HIGH) |
Fill a bezier curve. | |
void | FillBezier (BPoint *controlPoints, const BGradient &gradient) |
Fill a bezier curve. | |
void | StrokeShape (BShape *shape, ::pattern pattern=B_SOLID_HIGH) |
Stroke shape. | |
void | FillShape (BShape *shape, ::pattern pattern=B_SOLID_HIGH) |
Fill shape. | |
void | FillShape (BShape *shape, const BGradient &gradient) |
Fill shape with the specified gradient pattern. | |
void | CopyBits (BRect src, BRect dst) |
Copy the bits from the src rectangle to the dst rectangle in the view's coordinate system. | |
void | DrawBitmapAsync (const BBitmap *aBitmap, BRect bitmapRect, BRect viewRect, uint32 options) |
Draws bitmap on the view within viewRect asynchronously. bitmap portion is scaled to fit viewRect. | |
void | DrawBitmapAsync (const BBitmap *aBitmap, BRect bitmapRect, BRect viewRect) |
Draws bitmap on the view within viewRect asynchronously. bitmap portion is scaled to fit viewRect. | |
void | DrawBitmapAsync (const BBitmap *aBitmap, BRect viewRect) |
Draws bitmap on the view within viewRect asynchronously. bitmap is scaled to fit viewRect. | |
void | DrawBitmapAsync (const BBitmap *aBitmap, BPoint where) |
Draws bitmap on the view offset by where asynchronously. | |
void | DrawBitmapAsync (const BBitmap *aBitmap) |
Draws bitmap on the view asynchronously. | |
void | DrawBitmap (const BBitmap *aBitmap, BRect bitmapRect, BRect viewRect, uint32 options) |
Draws bitmap on the view within viewRect. bitmap portion is scaled to fit viewRect. | |
void | DrawBitmap (const BBitmap *aBitmap, BRect bitmapRect, BRect viewRect) |
Draws bitmap on the view within viewRect. bitmap portion is scaled to fit viewRect. | |
void | DrawBitmap (const BBitmap *aBitmap, BRect viewRect) |
Draws bitmap on the view within viewRect. bitmap is scaled to fit viewRect. | |
void | DrawBitmap (const BBitmap *aBitmap, BPoint where) |
Draws bitmap on the view offset by where. | |
void | DrawBitmap (const BBitmap *aBitmap) |
Draws bitmap on the view. | |
void | DrawTiledBitmapAsync (const BBitmap *aBitmap, BRect viewRect, BPoint phase=B_ORIGIN) |
Draws bitmap on the view within viewRect asynchronously. If bitmap is smaller, it is cloned to fill remaining space in viewRect. | |
void | DrawTiledBitmap (const BBitmap *aBitmap, BRect viewRect, BPoint phase=B_ORIGIN) |
Draws bitmap on the view within viewRect. If bitmap is smaller, it is cloned to fill remaining space in viewRect. | |
void | DrawChar (char aChar) |
Draws character c onto to the view at the current pen position. | |
void | DrawChar (char aChar, BPoint location) |
Draws character c at the specified location in the view. | |
void | DrawString (const char *string, escapement_delta *delta=NULL) |
Draw string onto the view at the current pen position. | |
void | DrawString (const char *string, BPoint location, escapement_delta *delta=NULL) |
Draw string onto the view at the specified location in the view. | |
void | DrawString (const char *string, int32 length, escapement_delta *delta=NULL) |
Draw string up to length characters onto the view at the current pen position. | |
void | DrawString (const char *string, int32 length, BPoint location, escapement_delta *delta=0L) |
Draw string up to length characters onto the view at the specified location in the view. | |
void | DrawString (const char *string, const BPoint *locations, int32 locationCount) |
Draw string locationCount times at the specified locations. | |
void | DrawString (const char *string, int32 length, const BPoint *locations, int32 locationCount) |
Draw string up to length characters locationCount times at the specified locations. | |
void | Invalidate (BRect invalRect) |
Sends a message to App Server to redraw the portion of the view specified by invalRect. | |
void | Invalidate (const BRegion *invalRegion) |
Sends a message to App Server to redraw the portion of the view specified by region. | |
void | Invalidate () |
Sends a message to App Server to redraw the view. | |
void | DelayedInvalidate (bigtime_t delay) |
Sends a message to App Server to redraw the entire view after a certain, minimum, delay. Repeated calls to this method may be merged, but the view is guaranteed to be redrawn after the delay given in the first call of this method. | |
void | DelayedInvalidate (bigtime_t delay, BRect invalRect) |
Sends a message to App Server to redraw the portion of the view specified by invalRect after a certain, minimum, delay. Repeated calls to this method may be merged, but the invalidated rect is guaranteed to be redrawn after the minimum delay given by the first call of this method. | |
void | SetDiskMode (char *filename, long offset) |
Unimplemented. | |
void | BeginPicture (BPicture *a_picture) |
Begins sending drawing instructions to picture. | |
void | AppendToPicture (BPicture *a_picture) |
Appends drawing instructions to picture without clearing it first. | |
BPicture * | EndPicture () |
Ends the drawing instruction recording session and returns the BPicture object passed to BeginPicture() or AppendToPicture(). | |
void | DrawPicture (const BPicture *a_picture) |
Draws the picture at the view's current pen position. | |
void | DrawPicture (const BPicture *a_picture, BPoint where) |
Draws the picture at the location in the view specified by where. | |
void | DrawPicture (const char *filename, long offset, BPoint where) |
Draws the picture from the file specified by filename offset by offset bytes at the location in the view specified by where. | |
void | DrawPictureAsync (const BPicture *a_picture) |
Draws the picture at the view's current pen position. | |
void | DrawPictureAsync (const BPicture *a_picture, BPoint where) |
Draws the picture at the location in the view specified by where. | |
void | DrawPictureAsync (const char *filename, long offset, BPoint where) |
Draws the picture from the file specified by filename offset by offset bytes at the location in the view specified by where. | |
void | BeginLayer (uint8 opacity) |
Begins a drawing layer. | |
void | EndLayer () |
Finish a layer and blend it in with the view. | |
void | MoveBy (float dh, float dv) |
Moves the view deltaX pixels horizontally and deltaY pixels vertically in the parent view's coordinate system. | |
void | MoveTo (BPoint where) |
Move the view to the location specified by where in the parent view's coordinate system. | |
void | MoveTo (float x, float y) |
Move the view to the coordinates specified by x in the horizontal dimension and y in the vertical dimension in the parent view's coordinate system. | |
void | ResizeBy (float dh, float dv) |
Resize the view by deltaWidth horizontally and deltaHeight vertically without moving the top left corner of the view. | |
void | ResizeTo (float width, float height) |
Resize the view to the specified width and height. | |
void | ResizeTo (BSize size) |
Resize the view to the dimension specified by size. | |
virtual status_t | AllUnarchived (const BMessage *archive) |
Hook method called when all views have been unarchived. | |
virtual status_t | AllArchived (BMessage *archive) const |
Hook method called when all views have been archived. | |
virtual void | KeyUp (const char *bytes, int32 numBytes) |
Hook method called when a keyboard key is released. | |
virtual void | Pulse () |
Hook method called when the view receives a B_PULSE message. | |
virtual void | DrawAfterChildren (BRect updateRect) |
Perform any drawing that needs to be done after child view have already been drawn. | |
void | BeginRectTracking (BRect startRect, uint32 style=B_TRACK_WHOLE_RECT) |
Displays an outline rectangle on the view and initiates tracking. | |
void | EndRectTracking () |
Ends tracking removing the outline rectangle from the view. | |
void | GetMouse (BPoint *location, uint32 *buttons, bool checkMessageQueue=true) |
Fills out the cursor location and the current state of the mouse buttons. | |
void | DragMessage (BMessage *message, BRect dragRect, BHandler *replyTo=NULL) |
Initiates a drag-and-drop session. | |
void | DragMessage (BMessage *message, BBitmap *bitmap, BPoint offset, BHandler *replyTo=NULL) |
Initiates a drag-and-drop session of an image. | |
void | DragMessage (BMessage *message, BBitmap *bitmap, drawing_mode dragMode, BPoint offset, BHandler *replyTo=NULL) |
Initiates a drag-and-drop session of an image with drawing_mode set by dragMode. | |
status_t | SetEventMask (uint32 mask, uint32 options=0) |
Sets whether or not the view can accept mouse and keyboard events when not in focus. | |
uint32 | EventMask () |
Returns the current event mask. | |
status_t | SetMouseEventMask (uint32 mask, uint32 options=0) |
Sets whether or not the view can accept mouse and keyboard events when not in focus from within MouseDown() until the following MouseUp() event. | |
void | ScrollBy (float dh, float dv) |
Scroll the view by deltaX horizontally and deltaY vertically. | |
void | ScrollTo (float x, float y) |
Scroll the view to the point specified by coordinates. | |
BScrollBar * | ScrollBar (orientation direction) const |
Returns the BScrollBar object that has the BView set as its target. | |
virtual BAlignment | LayoutAlignment () |
Return the current BAlignemnt of the view. | |
void | SetExplicitMinSize (BSize size) |
Set this view's min size, to be used by MinSize(). | |
void | SetExplicitMaxSize (BSize size) |
Set this view's max size, to be used by MaxSize(). | |
void | SetExplicitPreferredSize (BSize size) |
Set this view's preferred size, to be used by PreferredSize(). | |
void | SetExplicitSize (BSize size) |
Set this view's size. | |
void | SetExplicitAlignment (BAlignment alignment) |
Set this view's alignment, to be used by Alignment(). | |
BSize | ExplicitMinSize () const |
Returns the explicit minimum size. | |
BSize | ExplicitMaxSize () const |
Returns the explicit maximum size. | |
BSize | ExplicitPreferredSize () const |
Returns the explicit preferred size. | |
BAlignment | ExplicitAlignment () const |
Returns the explicit alignment size. | |
virtual bool | HasHeightForWidth () |
Returns whether the layout of the view can calculate a height for a given width. | |
virtual void | GetHeightForWidth (float width, float *min, float *max, float *preferred) |
Returns the min, max and preferred height for a given width. | |
void | InvalidateLayout (bool descendants=false) |
Invalidate layout. | |
virtual void | SetLayout (BLayout *layout) |
Sets the layout of the view. | |
BLayout * | GetLayout () const |
Get the layout of the view. | |
void | EnableLayoutInvalidation () |
Enable layout invalidation. | |
void | DisableLayoutInvalidation () |
Disable layout invalidation. | |
bool | IsLayoutInvalidationDisabled () |
Returns whether or not layout invalidation is disabled. | |
bool | IsLayoutValid () const |
Returns whether or not the layout is valid. | |
void | ResetLayoutInvalidation () |
Service call for BView derived classes re-enabling InvalidateLayout() notifications. | |
BLayoutContext * | LayoutContext () const |
Returns the BLayoutContext for this View. | |
void | Layout (bool force) |
Layout the view. | |
void | Relayout () |
Relayout the view. | |
void | SetToolTip (const char *text) |
Set the tool tip of the view to text. | |
void | SetToolTip (BToolTip *tip) |
Set the tool tip of the view to the tip object. | |
BToolTip * | ToolTip () const |
Return the tool tip set to the view or NULL if not set. | |
void | ShowToolTip (BToolTip *tip=NULL) |
Show the tool tip at the current mouse position. | |
void | HideToolTip () |
Hide the view's tool tip. | |
Public Member Functions inherited from BHandler | |
BHandler (const char *name=NULL) | |
Construct a new handler with a name. | |
virtual | ~BHandler () |
Free the filters of this handler, as well as the list of observers. | |
virtual status_t | Perform (perform_code d, void *arg) |
Perform some action (Internal method defined for binary compatibility purposes). | |
BHandler (BMessage *data) | |
Construct a handler from an archived message. | |
BLooper * | Looper () const |
Return a pointer to the looper that this handler is associated with. | |
void | SetName (const char *name) |
Set or change the name of this handler. | |
const char * | Name () const |
Return the name of this handler. | |
virtual void | SetNextHandler (BHandler *handler) |
Set the next handler in the chain that the message is passed on to if this handler cannot process it. | |
BHandler * | NextHandler () const |
Return the next hander in the chain to which the message is passed on. | |
virtual void | AddFilter (BMessageFilter *filter) |
Add filter as a prerequisite to this handler. | |
virtual bool | RemoveFilter (BMessageFilter *filter) |
Remove filter from the filter list. | |
virtual void | SetFilterList (BList *filters) |
Set the internal list of filters to filters. | |
BList * | FilterList () |
Return a pointer to the list of filters. | |
bool | LockLooper () |
Lock the looper associated with this handler. | |
status_t | LockLooperWithTimeout (bigtime_t timeout) |
Lock the looper associated with this handler, with a time out value. | |
void | UnlockLooper () |
Unlock the looper. | |
status_t | StartWatching (BMessenger target, uint32 what) |
Subscribe this handler to watch a specific state change of a target. | |
status_t | StartWatchingAll (BMessenger target) |
Subscribe this handler to watch a target for all events. | |
status_t | StopWatching (BMessenger target, uint32 what) |
Unsubscribe this handler from watching a specific state. | |
status_t | StopWatchingAll (BMessenger target) |
Unsubscribe this handler from watching all states. | |
status_t | StartWatching (BHandler *observer, uint32 what) |
Subscribe an observer for a specific state change of this handler. | |
status_t | StartWatchingAll (BHandler *observer) |
Subscribe an observer for a all state changes. | |
status_t | StopWatching (BHandler *observer, uint32 what) |
Unsubscribe an observer from watching a specific state. | |
status_t | StopWatchingAll (BHandler *observer) |
Unsubscribe an observer from watching all states. | |
virtual void | SendNotices (uint32 what, const BMessage *notice=NULL) |
Emit a state change to the observers. | |
bool | IsWatched () const |
Check if there are any observers watching this handler. | |
Public Member Functions inherited from BArchivable | |
BArchivable () | |
Constructor. Does nothing. | |
BArchivable (BMessage *from) | |
Constructor. Does important behind-the-scenes work in the unarchiving process. | |
virtual | ~BArchivable () |
Destructor. Does nothing. | |
virtual status_t | AllArchived (BMessage *archive) const |
Method relating to the use of BArchiver . | |
virtual status_t | AllUnarchived (const BMessage *archive) |
Method relating to the use of BUnarchiver . | |
virtual status_t | Archive (BMessage *into, bool deep=true) const |
Archive the object into a BMessage. | |
virtual status_t | Perform (perform_code d, void *arg) |
Perform some action (Internal method defined for binary compatibility purposes). | |
Public Member Functions inherited from BInvoker | |
BInvoker () | |
Initializes a BInvoker without a message or target. | |
BInvoker (BMessage *message, BMessenger target) | |
Initializes the BInvoker with message and sets the target messenger where the message is sent when Invoke() is called. | |
BInvoker (BMessage *message, const BHandler *handler, const BLooper *looper=NULL) | |
Initializes the BInvoker with message and sets the target to either a local handler or as the preferred handler of a local looper where the message is sent when Invoke() is called. | |
virtual | ~BInvoker () |
Destructor method, deletes the BMessage object if set. | |
uint32 | Command () const |
Returns the message's what data member. | |
BHandler * | HandlerForReply () const |
Returns the previously set reply handler or NULL if not set. | |
virtual status_t | Invoke (BMessage *message=NULL) |
Sends the message to the invoker's target. | |
status_t | InvokeNotify (BMessage *message, uint32 kind=B_CONTROL_INVOKED) |
Sends the message to its target, using the notification code specified by kind. | |
bool | IsTargetLocal () const |
Returns whether or not the invoker and its target belong to the same team. | |
BMessage * | Message () const |
Returns a pointer to the invoker's message object. | |
BMessenger | Messenger () const |
Returns the BMessenger object that the invoker uses to send its messages. | |
virtual status_t | SetHandlerForReply (BHandler *handler) |
Sets the BHandler object responsible for handling reply messages. | |
virtual status_t | SetMessage (BMessage *message) |
Assigns message to the invoker, deleting any previously assigned message. | |
virtual status_t | SetTarget (BMessenger messenger) |
Sets the invoker's target to messenger. | |
virtual status_t | SetTarget (const BHandler *handler, const BLooper *looper=NULL) |
Sets the target to either a local handler or as the preferred handler of a local looper. | |
status_t | SetTimeout (bigtime_t timeout) |
Sets the timeout to use when sending the message to the target. | |
BHandler * | Target (BLooper **_looper=NULL) const |
Invoke BMessenger::Target() on the internal messenger. | |
bigtime_t | Timeout () const |
Returns the current timeout value. | |
Protected Member Functions | |
virtual bool | DoMiscellaneous (MiscCode code, MiscData *data) |
Do a miscellaneous action. | |
Protected Member Functions inherited from BView | |
virtual void | LayoutInvalidated (bool descendants=false) |
Hook method called when the layout is invalidated. | |
virtual void | LayoutChanged () |
Hook function that is called when the layout if this view, or one of its children, has changed. | |
status_t | ScrollWithMouseWheelDelta (BScrollBar *, float) |
Handle the scroll wheel changing over scrollbars. | |
virtual void | DoLayout () |
Layout view within the layout context. | |
virtual bool | GetToolTipAt (BPoint point, BToolTip **_tip) |
Point _tip with the view's tool tip. | |
Protected Member Functions inherited from BInvoker | |
void | BeginInvokeNotify (uint32 kind=B_CONTROL_INVOKED) |
Implement this method to set up an InvokeNotify() context. | |
void | EndInvokeNotify () |
Implement this method to tear down an InvokeNotify() context. | |
uint32 | InvokeKind (bool *_notify=NULL) |
Returns the kind set by InvokeNotify(). | |
Archiving | |
virtual status_t | Archive (BMessage *data, bool deep=true) const |
Archive the BListView object to a message. | |
static BArchivable * | Instantiate (BMessage *data) |
Create a new BListView object from the message archive. | |
Additional Inherited Members | |
Static Public Member Functions inherited from BView | |
static BArchivable * | Instantiate (BMessage *archive) |
Creates a new BView object from the data message. | |
Static Public Member Functions inherited from BHandler | |
static BArchivable * | Instantiate (BMessage *data) |
Static method to instantiate a handler from an archived message. | |
Static Public Member Functions inherited from BArchivable | |
static BArchivable * | Instantiate (BMessage *archive) |
Static member to restore objects from messages. | |
Displays a list of items that the user can select and invoke.
BListView's can be one of two types set by the type parameter of the constructor:
B_SINGLE_SELECTION_LIST
Can select only one item in the list at a time. This is the default.B_MULTIPLE_SELECTION_LIST
Can select any number of items by holding down Option for a discontinuous selection, or Shift for a contiguous selection.An example of a BListView looks like this:
Click on an item to select it and double-click an item to invoke it. The BListView doesn't define what it means to "invoke" an item. See BListView::SetSelectionMessage() and BListView::SetInvocationMessage() to set a message to be set when these actions occur. You can also select and invoke items with keyboard keys such as the up and down arrow keys, Page Up and Page Down and the Enter key or Space key to invoke the item.
This class is based on the BList class from the Support Kit and many of the methods it uses behave similarly.
Although a BListView is scrollable, it doesn't provide scroll bars by itself. You should add the BListView as a child of a BScrollView to make it scrollable.
The code to add a BListView to a BScrollView looks something like this:
BListView::BListView | ( | BRect | frame, |
const char * | name, | ||
list_view_type | type = B_SINGLE_SELECTION_LIST , |
||
uint32 | resizingMode = B_FOLLOW_LEFT_TOP , |
||
uint32 | flags = B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE |
||
) |
Creates a new list view. This is the non-layout constructor.
frame | The frame rectangle of the view. |
name | The name of the view. |
type | Whether the list view supports a single selection or multiple selections. |
resizingMode | The resizing mode flags. See BView for details. |
flags | The view flags. See BView for details. |
BListView::BListView | ( | const char * | name, |
list_view_type | type = B_SINGLE_SELECTION_LIST , |
||
uint32 | flags = B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE |
||
) |
Creates a new list view suitable as part of a layout with the specified name, type, and flags.
name | The name of the view. |
type | Whether the list view supports a single selection or multiple selections. |
flags | The view flags. See BView for details. |
BListView::BListView | ( | list_view_type | type = B_SINGLE_SELECTION_LIST | ) |
Creates a new list view suitable as part of a layout.
type | Whether the list view supports a single selection or multiple selections. |
BListView::BListView | ( | BMessage * | archive | ) |
Creates a BListView object from the archive message.
archive | The message to create the object from. |
|
virtual |
Delete the BListView object and free the memory used by it.
This method does not free the attached list items.
Add an item to the list view at the specified index.
item | The list item to add. |
index | The index of where to add the list item, if not specified the item is added to the end. |
true
if the list item was added, false
otherwise.Reimplemented in BOutlineListView.
|
virtual |
Add a list of list items to the end of the list view.
list | The list of list items to add. |
true
if the list was added, false
otherwise.Reimplemented in BOutlineListView.
Add a list of list items to the list view at the specified index.
list | The list of list items to add. |
index | The index of where to add the list, if not specified the list is added to the end. |
true
if the list was added, false
otherwise.Reimplemented in BOutlineListView.
|
virtual |
Hook method called once all views are attached to the view.
Reimplemented from BView.
Reimplemented in BOutlineListView.
|
virtual |
Hook method called once all views are detached from the view.
Reimplemented from BView.
Reimplemented in BOutlineListView.
Archive the BListView object to a message.
data | A pointer to the BMessage object to archive the object into. |
deep | Whether or not to archive child views as well. |
B_OK
if everything went well or an error code otherwise. B_OK | The object was archived successfully. |
B_NO_MEMORY | Ran out of memory while archiving the object. |
Reimplemented from BView.
Reimplemented in BOutlineListView.
|
virtual |
Hook method called when the list view is added to the view hierarchy.
Reimplemented from BView.
int32 BListView::CountItems | ( | ) | const |
Returns the number of items contained in the list view.
Returns the index of a currently selected item relative to the passed in index.
If the index of the selected item is lower than index the value returned is negative, if the index of the selected item is greater than index the value returned is positive. If the index of the selected item is equal to index then 0 is returned.
index | The index of the item to get relative to the selected item's index. |
void BListView::Deselect | ( | int32 | index | ) |
Deselect the item at index.
index | The index of the item to deselect. |
void BListView::DeselectAll | ( | ) |
Deselect all items.
Deselect all items except the items with index in the range of exceptFrom to exceptTo.
exceptFrom | The index of the start of the exception list. |
exceptTo | The index of the end of the exception list. |
|
virtual |
Hook method that is called when the list view is removed from the view hierarchy.
Reimplemented from BView.
Reimplemented in BOutlineListView.
void BListView::DoForEach | ( | bool(*)(BListItem *item) | func | ) |
Calls the specified function on each item in the list.
The func is called on the items in order starting with the item at index 0 and ending at the last item in the list. This method stops calling the func once it returns true or the end of the list is reached.
The first argument of func is a pointer to the list item.
func | The function to call on each item. |
void BListView::DoForEach | ( | bool(*)(BListItem *item, void *arg) | func, |
void * | arg | ||
) |
Calls the specified function on each item in the list.
The func is called on the items in order starting with the item at index 0 and ending at the last item in the list. This method stops calling the func once it returns true or the end of the list is reached.
The first argument of func is a pointer to the list item, arg is passed in as the second argument.
func | The function to call on each item. |
arg | The second argument of the function. |
|
protectedvirtual |
Do a miscellaneous action.
code | The action code to use.
|
data | The data to act on. |
Reimplemented in BOutlineListView.
|
virtual |
Hook method called to draw the contents of the text view.
You should not have to call this method directly, use Invalidate() instead.
updateRect | The rectangular area to draw. |
Reimplemented from BView.
BListItem * BListView::FirstItem | ( | ) | const |
Returns a pointer to the first list item.
NULL
if there are no items.
|
virtual |
Hook method called when the list view is moved.
newPosition | The point of the top left corner of the frame that the view has been moved to. |
Reimplemented from BView.
Reimplemented in BOutlineListView.
|
virtual |
Hook method called when the list view is resized.
newWidth | The new width of the view. |
newHeight | The new height of the view. |
Reimplemented from BView.
Reimplemented in BOutlineListView.
|
virtual |
Fill out the _width and _height parameters with the preferred width and height of the list view.
_width | The list view's preferred width is written to _width. |
_height | The list view's preferred height is written to _height. |
Reimplemented from BView.
Reimplemented in BOutlineListView.
Reports the suites of messages and specifiers that derived classes understand.
Reports the suites of messages and specifiers that derived classes understand.
Reimplemented from BView.
Reimplemented in BOutlineListView.
bool BListView::HasItem | ( | BListItem * | item | ) | const |
Returns whether or not the list contains the specified item.
item | The list item to check. |
true
if item is in the list, false
otherwise.Returns the index of the specified item.
item | The list item to get the index of. |
Returns the index of the item at the specified point.
point | The location of the list item to get the index of. |
Hook method called when a drag and drop operation is initiated.
This method is used by derived classes to implement drag and drop. This method is called by the MouseDown() method. If the derived class initiates the drag & drop operation you should return true
, otherwise return false
. By default this method returns false
.
point | Where the drag & drop operation started. |
index | |
wasSelected | Indicates whether or not the item was selected. |
true
if a drag & drop operation was initiated, false
otherwise.
|
static |
void BListView::InvalidateItem | ( | int32 | index | ) |
Draws the list item at the specified index.
index | The index of the list item to draw. |
uint32 BListView::InvocationCommand | ( | ) | const |
Returns the what parameter of the current invocation method.
BMessage * BListView::InvocationMessage | ( | ) | const |
Returns the message that is send when an item is invoked.
Invoke the list view, either with the current invocation message or message if it is specified.
message | The message to send or NULL to send the current invocation message. |
Reimplemented from BInvoker.
bool BListView::IsEmpty | ( | ) | const |
Returns whether or not the list view is empty.
true
if the list view is empty, false
otherwise.bool BListView::IsItemSelected | ( | int32 | index | ) | const |
Returns whether or not the item at index is selected.
true
if the item was selected, false
otherwise.Returns the list item at the specified index.
index |
Return the frame of the item at the specified index.
index | The index of the item to get the frame of. |
const BListItem ** BListView::Items | ( | ) | const |
Returns a pointer to the list of list items.
|
virtual |
Hook method that is called when a key is pressed while the view is the focus view of the active window.
The following keys are used by the list view by default:
bytes | The bytes representing the keys pushed down. |
numBytes | The size of bytes. |
Reimplemented from BView.
Reimplemented in BOutlineListView.
BListItem * BListView::LastItem | ( | ) | const |
Returns a pointer to the last list item.
NULL
if there are no items.list_view_type BListView::ListType | ( | ) | const |
Returns the current list view type.
|
virtual |
|
virtual |
Highlight or unhighlight the selection when the list view acquires or loses its focus state.
focused | true to receive focus or false to lose it. |
Reimplemented from BView.
Reimplemented in BOutlineListView.
|
virtual |
Returns the maximum size of the list view.
Reimplemented from BView.
|
virtual |
Hook method called when a message is received by the list view.
message | The message received by the associated looper. |
Reimplemented from BView.
Reimplemented in BOutlineListView.
|
virtual |
Returns the minimum size of the list view.
Reimplemented from BView.
|
virtual |
Hook method that is called when a mouse button is pushed down while the cursor is contained in the view.
By default this method selects items on a single click, and invokes them on a double click. This method calls InitiateDrag() to allow derived classes the opportunity to drag and drop items from the list.
point | The point where the mouse button was pushed down. |
Reimplemented from BView.
Reimplemented in BOutlineListView.
Hook method that is called whenever the mouse cursor enters, exits or moves inside the list view.
where | The point where the mouse cursor has moved to. |
code | A code which indicating if the mouse entered or exited the view. |
dragMessage | A message containing drag and drop information. |
Reimplemented from BView.
|
virtual |
Hook method that is called when a mouse button is released while the cursor is contained in the view.
where | The location that the mouse button was released. |
Reimplemented from BView.
Reimplemented in BOutlineListView.
Move the item at index from to the position in the list at index to.
from | The index of the item to move. |
to | The index to move the item to. |
true
if the item was moved, false
otherwise.
|
virtual |
Performs an action give a perform_code and data. (Internal Method)
Reimplemented from BView.
Reimplemented in BOutlineListView.
|
virtual |
Returns the preferred size of the list view.
Reimplemented from BView.
|
virtual |
Remove the specified list item.
item | The list item to remove. |
true
if the item was removed, false
otherwise.Reimplemented in BOutlineListView.
Remove the item at index from the list.
index | The index of the item to remove. |
true
if the item was removed, false
otherwise.Reimplemented in BOutlineListView.
Removes the items from index and the next count items.
index | The location to start removing items from. |
count | The number of items past index to remove. |
return true
if the items were removed, false
otherwise.
Reimplemented in BOutlineListView.
Replace the item at index index with item.
index | The index of the item to replace. |
item | The item to replace the item at index with. |
true
if the item was replaced, false
otherwise.
|
virtual |
Resize the view to its preferred size.
Reimplemented from BView.
Reimplemented in BOutlineListView.
|
virtual |
Determines the proper handler for the passed in scripting message.
Determine the proper handler for a scripting message.
message | The scripting message to determine the handler. |
index | The index of the specifier. |
specifier | The message which contains the specifier. |
what | The 'what' field of the specifier message. |
property | The name of the target property. |
Reimplemented from BView.
Reimplemented in BOutlineListView.
|
virtual |
Scroll the view to the specified point.
point | The location to scroll the list view to. |
Reimplemented from BView.
void BListView::ScrollTo | ( | int32 | index | ) |
Scrolls to list item at index.
If above top scroll to first item, if below bottom scroll to last item otherwise scroll to item at index.
void BListView::ScrollToSelection | ( | ) |
Scrolls to selected list item.
Select items from start to finish.
start | The index of the item to start the selection. |
finish | The index of the item to end the selection. |
extend | Whether or not to also select child items. |
void BListView::Select | ( | int32 | index, |
bool | extend = false |
||
) |
Selects the list item at the specified index.
index | The index of the item to select. |
extend | Whether or not to also select child items. |
|
virtual |
Hook method that is called when the selection changes.
This method should be implemented by derived classes, the default implementation does nothing.
uint32 BListView::SelectionCommand | ( | ) | const |
Returns the what parameter of the message that is send when an item is selected.
BMessage * BListView::SelectionMessage | ( | ) | const |
Returns the message that is send when an item is selected.
|
virtual |
Sets the font of the list view to font with the font parameters set by mask.
font | The font to set the list view to. |
mask | A mask indicating which properties of font to set. |
Reimplemented from BView.
|
virtual |
Sets the message that the list view sends when an item is invoked.
message | The invocation message to set. |
|
virtual |
Sets the list view type.
type | The list view type to set. |
|
virtual |
Sets the message that the list view sends when a new item is selected.
message | The selection message to set. |
void BListView::SortItems | ( | int(*)(const void *, const void *) | cmp | ) |
Sort the items according the the passed in cmp function.
cmp | The compare function to use to sort the items. |
Swap item a with item b.
a | The index of the first item to swap. |
b | The index of the second item to swap. |
true
if the items were swapped, false
otherwise.
|
virtual |
Hook method called when the list view is attached to a BScrollView.
view | The BScrollView the list view is attached to. |
Reimplemented from BView.
|
virtual |
Hook method that is called when the window becomes the active window or gives up that status.
active | true when the window becomes activated, false when the window becomes deactivated. |
Reimplemented from BView.