24 #ifndef YMGA_NCCBTable_h 25 #define YMGA_NCCBTable_h 29 #include <yui/mga/YMGA_CBTable.h> 30 #include <yui/ncurses/NCPadWidget.h> 31 #include <yui/ncurses/NCTablePad.h> 38 YMGA_NCCBTable( YWidget * parent, YTableHeader *tableHeader, YCBTableMode mode = YCBTableMode::YCBTableCheckBoxOnFirstColumn);
42 bool bigList()
const {
return biglist; }
44 void setHeader( std::vector <std::string> head );
45 void getHeader( std::vector <std::string> & head );
47 virtual void setAlignment(
int col, YAlignmentType al );
49 void setBigList(
const bool big ) { biglist = big; }
51 void SetSepChar(
const chtype colSepchar ) {
myPad()->SetSepChar( colSepchar ); }
53 void SetSepWidth(
const unsigned sepwidth ) {
myPad()->SetSepWidth( sepwidth ); }
55 void SetHotCol(
const int hcol ) {
myPad()->SetHotCol( hcol ); }
57 virtual void addItem( YItem *yitem );
58 virtual void addItems(
const YItemCollection & itemCollection );
59 virtual void deleteAllItems( );
61 virtual int getCurrentItem();
62 YItem * getCurrentItemPointer();
64 virtual void setCurrentItem(
int index );
65 virtual void selectItem( YItem *yitem,
bool selected );
66 void selectCurrentItem();
67 virtual void deselectAllItems();
69 virtual int preferredWidth();
70 virtual int preferredHeight();
72 virtual void setSize(
int newWidth,
int newHeight );
74 virtual void setLabel(
const std::string & nlabel );
76 virtual void setEnabled(
bool do_bv );
78 bool setItemByKey(
int key );
80 virtual NCursesEvent wHandleInput( wint_t key );
82 virtual bool setKeyboardFocus()
85 return YWidget::setKeyboardFocus();
90 void stripHotkeys() {
myPad()->stripHotkeys(); }
92 void setSortStrategy( NCTableSortStrategyBase * newStrategy ) {
myPad()->setSortStrategy( newStrategy ); }
94 void checkItem( YItem* yitem,
bool checked =
true );
102 {
return dynamic_cast<NCTablePad*
>( NCPadWidget::myPad() ); }
108 virtual const char * location()
const {
return "YMGA_NCCBTable"; }
110 virtual NCPad * CreatePad();
112 virtual void cellChanged(
int index,
int colnum,
const std::string & newtext );
113 virtual void cellChanged(
const YTableCell *cell );
115 virtual void startMultipleChanges() { startMultidraw(); }
116 virtual void doneMultipleChanges() { stopMultidraw(); }
120 virtual void addItem( YItem *yitem,
bool allAtOnce );
125 std::vector<NCstring> _header;
127 friend std::ostream & operator<<( std::ostream & STREAM,
const YMGA_NCCBTable & OBJ );
135 #endif // YMGA_NCCBTable_h virtual NCTablePad * myPad() const
Overload myPad to narrow the type.
void toggleCurrentItem()
Toggle item from selected -> deselected and vice versa.