[haiku-development] Re: ColumnListView.h

  • From: Ralf Schülke <ralf.schuelke@xxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Tue, 10 Jan 2012 11:31:30 +0100

So i go a head and draw the verry first prototype.

I look into the QT World :-) and i litle understand this, but Haiku API is
litel bit other. We have no Signal and Slots we have BMessage /BLooper and
Hook functions ;-)  .

I Love the Idear to have a BTableView and add or remove Tabel Items.

The TableView are a Container View (BGridView) and all Items can add in the
Grid.

Quik List of BTableView Stuff:
- The TableView have some enums to handle the function.
- The TabelView have some Scrolling function
- The TableView have some layout function
- The TableView have some Style function (eg: BG and font color, font and
font size, grid boarder and pen size, etc.)
- the TableView can handle the Items (eg: Add, Remove, etc)
- The TableView have some Items Type ( at time: char, int, float, bitmap.
More can add here!)

Also we need not a BTableListItem!
Only the BTableView and then can add all what we need in the same style of
Haiku API.

So my question is:

Is This good a Idear?
Is the Destructor ok ?
Is the public function ok ?

Please see the Attachment!

Ralf Schülke
/*
 * Copyright 2012 Haiku, Inc. All rights reserved.
 * Distributed under the terms of the MIT License.
 *
 * Authors:
 *              Ralf Schülke, ralf.schuelke@xxxxxxxxxxxxxx
 *              
 */


#ifndef _TABLE_VIEW_H
#define _TABLE_VIEW_H


#include <GridView.h>



//Public Types
enum table_selection_mode {
        B_SINGLE_SELECTION,
        B_MULTIPLE_SELECTION,
        B_NO_SELECTION
};

/* TODO: more Types from here 
http://doc.qt.nokia.com/5.0-snapshot/qabstractitemview.html */

//Constructor
class BTableView  : public BGridView {
public:
                        BTableView(BRect frame, const char* name = NULL,
                                table_selection_mode mode = B_SINGLE_SELECTION
                                uint32 resizeMask = B_FOLLOW_LEFT | 
B_FOLLOW_TOP,
                                uint32 flags = B_WILL_DRAW | B_FRAME_EVENTS | 
B_NAVIGABLE);
                        BTableView(table_selection_mode mode = 
B_SINGLE_SELECTION);
                        BTableView(BMessage* data);
                        
        virtual void    AddTableMatrix(int column_pos, int row_pos);
        virtual void    AddTableItem(int column_pos, int row_pos, const char* 
name);
        virtual void    AddTableItem(int column_pos, int row_pos, int num);
        virtual void    AddTableItem(int column_pos, int row_pos, float num);
        virtual void    AddTableItem(int column_pos, int row_pos, BBitmap 
bitmap);

        virtual void    SetTableHeader(bool column, bool row);



        virtual         ~BTableView();

private:
        //code here

protected:
        // code here

        

#endif // _TABLE_VIEW_H

Other related posts: