Author: kmachalkova
Date: Thu Oct 11 17:35:25 2007
New Revision: 41392
URL: http://svn.opensuse.org/viewcvs/yast?rev=41392&view=rev
Log:
Ported NCTable, part I
Modified:
branches/tmp/sh/mod-ui/ncurses/src/NCAskForDirectory.cc
branches/tmp/sh/mod-ui/ncurses/src/NCAskForFile.cc
branches/tmp/sh/mod-ui/ncurses/src/NCFileSelection.cc
branches/tmp/sh/mod-ui/ncurses/src/NCFileSelection.h
branches/tmp/sh/mod-ui/ncurses/src/NCPackageSelectorPlugin.cc
branches/tmp/sh/mod-ui/ncurses/src/NCPkgTable.cc
branches/tmp/sh/mod-ui/ncurses/src/NCPkgTable.h
branches/tmp/sh/mod-ui/ncurses/src/NCPopupList.cc
branches/tmp/sh/mod-ui/ncurses/src/NCPopupMenu.cc
branches/tmp/sh/mod-ui/ncurses/src/NCPopupTable.cc
branches/tmp/sh/mod-ui/ncurses/src/NCPopupTable.h
branches/tmp/sh/mod-ui/ncurses/src/NCTable.cc
branches/tmp/sh/mod-ui/ncurses/src/NCTable.h
branches/tmp/sh/mod-ui/ncurses/src/NCTableItem.cc
branches/tmp/sh/mod-ui/ncurses/src/NCTableItem.h
branches/tmp/sh/mod-ui/ncurses/src/NCTablePad.h
branches/tmp/sh/mod-ui/ncurses/src/NCWidgetFactory.cc
branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.cc
branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.h
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCAskForDirectory.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCAskForDirectory.cc?rev=41392&r1=41391&r2=41392&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCAskForDirectory.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCAskForDirectory.cc Thu Oct 11 17:35:25 2007
@@ -136,7 +136,7 @@
new NCSpacing( hSplit, YD_HORIZ, true, 0.1 ); // stretchable = true
// add the list of directories
- dirList = new NCDirectoryTable( split, opt, NCFileTable::T_Overview, iniDir );
+ dirList = new NCDirectoryTable( split, NCFileTable::T_Overview, iniDir );
// FIXME - remove this - will be obsolete when NCTable is migrated
dirList->setParent( split );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCAskForFile.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCAskForFile.cc?rev=41392&r1=41391&r2=41392&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCAskForFile.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCAskForFile.cc Thu Oct 11 17:35:25 2007
@@ -184,7 +184,7 @@
// add the list of directories
opt.keyEvents.setValue( true );
- dirList = new NCDirectoryTable( hSplit1, opt, NCFileSelection::T_Overview, YCPString(startDir) );
+ dirList = new NCDirectoryTable( hSplit1, NCFileSelection::T_Overview, YCPString(startDir) );
// FIXME - remove this - will be obsolete when NCTable is migrated
dirList->setParent( hSplit1 );
@@ -195,7 +195,7 @@
dirList->setId( dirListID );
// add the list of files
- fileList = new NCFileTable( hSplit1, opt, NCFileSelection::T_Overview, filter, YCPString(startDir) );
+ fileList = new NCFileTable( hSplit1, NCFileSelection::T_Overview, filter, YCPString(startDir) );
// FIXME - remove this - will be obsolete when NCTable is migrated
fileList->setParent( hSplit1 );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCFileSelection.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCFileSelection.cc?rev=41392&r1=41391&r2=41392&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCFileSelection.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCFileSelection.cc Thu Oct 11 17:35:25 2007
@@ -182,10 +182,9 @@
// DESCRIPTION :
//
NCFileSelection::NCFileSelection( YWidget * parent,
- const YWidgetOpt & opt,
NCFileSelectionType type,
const YCPString & iniDir )
- : NCTable( parent, opt, vector<string> (), false )
+ : NCTable( parent, 0 )
, startDir( iniDir->value() )
, currentDir( iniDir->value() )
, tableType( type )
@@ -320,14 +319,14 @@
///////////////////////////////////////////////////////////////////
//
//
-// METHOD NAME : NCFileSelection::itemsCleared
+// METHOD NAME : NCFileSelection::deleteAllItems
// METHOD TYPE : void
//
// DESCRIPTION :
//
-void NCFileSelection::itemsCleared()
+void NCFileSelection::deleteAllItems()
{
- return NCTable::itemsCleared();
+ return NCTable::deleteAllItems();
}
///////////////////////////////////////////////////////////////////
@@ -458,11 +457,10 @@
// DESCRIPTION :
//
NCFileTable::NCFileTable( YWidget * parent,
- const YWidgetOpt & opt,
NCFileSelectionType type,
const YCPString & filter,
const YCPString & iniDir )
- : NCFileSelection( parent, opt, type, iniDir )
+ : NCFileSelection( parent, type, iniDir )
{
fillHeader();
@@ -644,7 +642,7 @@
if ( ( diskDir = opendir( currentDir.c_str() ) ) )
{
- itemsCleared();
+ deleteAllItems();
while ( ( entry = readdir( diskDir ) ) )
{
string entryName = entry->d_name;
@@ -718,10 +716,9 @@
// DESCRIPTION :
//
NCDirectoryTable::NCDirectoryTable( YWidget * parent,
- const YWidgetOpt & opt,
NCFileSelectionType type,
const YCPString & iniDir )
- : NCFileSelection( parent, opt, type, iniDir )
+ : NCFileSelection( parent, type, iniDir )
{
fillHeader();
}
@@ -787,7 +784,7 @@
if ( ( diskDir = opendir( currentDir.c_str() ) ) )
{
- itemsCleared();
+ deleteAllItems();
while ( ( entry = readdir( diskDir ) ) )
{
string entryName = entry->d_name;
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCFileSelection.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCFileSelection.h?rev=41392&r1=41391&r2=41392&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCFileSelection.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCFileSelection.h Thu Oct 11 17:35:25 2007
@@ -132,7 +132,6 @@
* Constructor
*/
NCFileSelection( YWidget * parent,
- const YWidgetOpt & opt,
NCFileSelectionType type,
const YCPString & iniDir );
@@ -175,7 +174,7 @@
/**
* Clears the package list
*/
- virtual void itemsCleared();
+ virtual void deleteAllItems();
/**
* Fills the header of the table
@@ -225,7 +224,6 @@
* Constructor
*/
NCFileTable( YWidget * parent,
- const YWidgetOpt & opt,
NCFileSelectionType type,
const YCPString & filter,
const YCPString & iniDir );
@@ -261,7 +259,6 @@
* Constructor
*/
NCDirectoryTable( YWidget * parent,
- const YWidgetOpt & opt,
NCFileSelectionType type,
const YCPString & iniDir );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCPackageSelectorPlugin.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCPackageSelectorPlugin.cc?rev=41392&r1=41391&r2=41392&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCPackageSelectorPlugin.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCPackageSelectorPlugin.cc Thu Oct 11 17:35:25 2007
@@ -97,9 +97,7 @@
NCDBG << "Creating a NCPkgTable" << endl;
try
{
- // FIXME - remove YWidgetOpt() after NCTable is ported
- YWidgetOpt * opt = new YWidgetOpt();
- w = new NCPkgTable( parent, *opt );
+ w = new NCPkgTable( parent );
}
catch (const std::exception & e)
{
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCPkgTable.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCPkgTable.cc?rev=41392&r1=41391&r2=41392&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCPkgTable.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCPkgTable.cc Thu Oct 11 17:35:25 2007
@@ -113,8 +113,8 @@
//
// DESCRIPTION :
//
-NCPkgTable::NCPkgTable( YWidget * parent, const YWidgetOpt & opt )
- : NCTable( parent, opt, vector<string> (), false )
+NCPkgTable::NCPkgTable( YWidget * parent )
+ : NCTable( parent, 0 )
, packager ( 0 )
, statusStrategy( new PackageStatStrategy ) // default strategy: packages
, tableType ( T_Packages ) // default type: packages
@@ -173,14 +173,14 @@
///////////////////////////////////////////////////////////////////
//
//
-// METHOD NAME : NCPkgTable::itemsCleared
+// METHOD NAME : NCPkgTable::deleteAllItems
// METHOD TYPE : void
//
// DESCRIPTION :
//
void NCPkgTable::itemsCleared()
{
- return NCTable::itemsCleared();
+ return NCTable::deleteAllItems();
}
@@ -192,7 +192,7 @@
//
// DESCRIPTION :
//
-void NCPkgTable::cellChanged( int index, int colnum, const YCPString & newtext )
+void NCPkgTable::cellChanged( int index, int colnum, const string & newtext )
{
return NCTable::cellChanged( index, colnum, newtext );
}
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCPkgTable.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCPkgTable.h?rev=41392&r1=41391&r2=41392&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCPkgTable.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCPkgTable.h Thu Oct 11 17:35:25 2007
@@ -135,7 +135,7 @@
/**
* Constructor
*/
- NCPkgTable( YWidget * parent, const YWidgetOpt & opt );
+ NCPkgTable( YWidget * parent );
virtual ~NCPkgTable();
@@ -170,7 +170,7 @@
* @param newtext The new text
* @eturn void
*/
- virtual void cellChanged( int index, int colnum, const YCPString & newtext );
+ virtual void cellChanged( int index, int colnum, const string & newtext );
/**
* Returns the contents of a certain cell in table
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCPopupList.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCPopupList.cc?rev=41392&r1=41391&r2=41392&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCPopupList.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCPopupList.cc Thu Oct 11 17:35:25 2007
@@ -18,6 +18,7 @@
/-*/
#include "Y2Log.h"
#include "NCPopupList.h"
+#include "YTableItem.h"
#include
@@ -35,18 +36,10 @@
int index )
: NCPopupTable( at )
{
- NCMIL << "Constructor NCPopupList" << endl;
NCMIL << "CurrentDialog: " << dynamic_cast(currentDialog()) << endl;
-#if 0
- vector<string> row( 1 );
- createList( row );
- for ( list<string>::const_iterator entry = deflist.begin();
- entry != deflist.end(); ++entry ) {
- row[0] = (*entry);
- addItem( YCPNull(), row );
- }
- setCurrentItem( index );
-#endif
+ NCMIL << "CurrentDialog: " << dynamic_cast(currentDialog()) << endl;
+
+ createEntries( deflist, index);
}
///////////////////////////////////////////////////////////////////
@@ -68,9 +61,9 @@
createList( row );
for ( list<string>::const_iterator entry = deflist.begin();
entry != deflist.end(); ++entry ) {
- row[0] = (*entry);
- NCMIL << "Adding item: " << *entry << endl;
- addItem( YCPNull(), row );
+ //row[0] = (*entry);
+ YItem *item = new YTableItem( (*entry ));
+ addItem( item );
}
setCurrentItem( index );
}
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCPopupMenu.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCPopupMenu.cc?rev=41392&r1=41391&r2=41392&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCPopupMenu.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCPopupMenu.cc Thu Oct 11 17:35:25 2007
@@ -40,7 +40,7 @@
entry != menu.itemList().end(); ++entry ) {
row[0] = (*entry)->getLabel()->value();
row[1] = (*entry)->hasChildren() ? "..." : "";
- addItem( (*entry)->getId(), row );
+ /*addItem( (*entry)->getId(), row );*/
}
stripHotkeys();
}
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCPopupTable.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCPopupTable.cc?rev=41392&r1=41391&r2=41392&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCPopupTable.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCPopupTable.cc Thu Oct 11 17:35:25 2007
@@ -59,29 +59,17 @@
void NCPopupTable::createList( vector<string> & row )
{
if ( sellist )
- return;
-
- // FIXME: remove opt - will be obsolete once YTable is migrated
- YWidgetOpt opt;
- opt.notifyMode.setValue( true );
+ return ;
- sellist= new NCTable( this, opt, row, false );
+ sellist = new NCTable( this, row.size() );
sellist->setBigList( true );
sellist->SetSepChar( ' ' );
sellist->SetSepWidht( 0 );
sellist->SetHotCol( 0 );
sellist->setNotify( true );
-
- // TO DO: This will be obsolete once YTable is migrated
- // TO DO: This will be obsolete once YTable is migrated
- // TO DO: This will be obsolete once YTable is migrated
- sellist->setParent( this );
- addChild( sellist );
- // TO DO: This will be obsolete once YTable is migrated
- // TO DO: This will be obsolete once YTable is migrated
- // TO DO: This will be obsolete once YTable is migrated
currentDialog()->dumpWidgetTree();
+
}
///////////////////////////////////////////////////////////////////
@@ -92,12 +80,12 @@
//
// DESCRIPTION :
//
-void NCPopupTable::addItem( const YCPValue & id, vector<string> & row )
+void NCPopupTable::addItem( YItem *yitem )
{
- if ( !sellist )
+ if ( !yitem )
return;
- sellist->addItem( id, row );
+ sellist->addItem( yitem );
}
///////////////////////////////////////////////////////////////////
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCPopupTable.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCPopupTable.h?rev=41392&r1=41391&r2=41392&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCPopupTable.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCPopupTable.h Thu Oct 11 17:35:25 2007
@@ -26,6 +26,7 @@
using namespace std;
#include "NCPopup.h"
+#include "YItem.h"
class NCTable;
class YCPValue;
@@ -49,7 +50,7 @@
void createList( vector<string> & row );
- void addItem( const YCPValue & id, vector<string> & row );
+ void addItem( YItem *yitem );
void setCurrentItem( int index );
int getCurrentItem() const;
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCTable.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCTable.cc?rev=41392&r1=41391&r2=41392&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCTable.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCTable.cc Thu Oct 11 17:35:25 2007
@@ -34,23 +34,21 @@
//
// DESCRIPTION :
//
-NCTable::NCTable( YWidget * parent, const YWidgetOpt & opt,
- vector<string> head, bool sort )
- : YTable( opt, head.size() )
+NCTable::NCTable( YWidget * parent, int columns )
+ : YTable( parent, columns )
, NCPadWidget( parent )
- , immediate ( opt.immediateMode.value() )
- , sortable (sort)
- , header (head)
, biglist( false )
{
WIDDBG << endl;
+ immediate = immediateMode();
+
InitPad();
// !!! head is UTF8 encoded, thus should be vector<YCPstring>
- vector<NCstring> headline( head.size() );
- for ( unsigned i = 0; i < head.size(); ++i ) {
- headline[i] = NCstring( head[i] );
- }
- hasHeadline = myPad()->SetHeadline( headline );
+ header.assign( columns, NCstring("") );
+ /*for ( unsigned i = 0; i < head.size(); ++i ) {
+ setHeader( i, head[i] );
+ }*/
+ hasHeadline = myPad()->SetHeadline( header );
}
///////////////////////////////////////////////////////////////////
@@ -134,16 +132,38 @@
//
// DESCRIPTION :
//
-void NCTable::setHeader( const vector<string> & head )
+void NCTable::setHeader( int col, const string & text )
+{
+ YTable::setHeader( col, text );
+
+ if ( hasColumn( col ))
+ {
+ header[ col ] = NCstring( text ) ;
+ }
+
+ hasHeadline = myPad()->SetHeadline( header );
+}
+
+void NCTable::setHeader( vector<string> head )
{
- header = head;
- vector<NCstring> headline( head.size() );
- for ( unsigned i = 0; i < head.size(); ++i ) {
- headline[i] = NCstring( head[i] );
+ for (unsigned int i = 0; i < head.size(); i++) {
+ setHeader( i, head[i] );
}
- hasHeadline = myPad()->SetHeadline( headline );
}
+void NCTable::setAlignment ( int col, YTable::Alignment al )
+{
+ //FIXME: need something better than just dumb calling parent
+ // method - ncurses doesn't seem to support alignments natively
+ YTable::setAlignment( col, al );
+
+}
+
+void NCTable::setKeepSorting ( bool keepSorting )
+{
+ YTable::setKeepSorting( keepSorting );
+ sortable = keepSorting;
+}
///////////////////////////////////////////////////////////////////
//
//
@@ -189,34 +209,46 @@
///////////////////////////////////////////////////////////////////
//
//
-// METHOD NAME : NCTable::itemAdded
+// METHOD NAME : NCTable::addItem
// METHOD TYPE : void
//
// DESCRIPTION :
//
-void NCTable::itemAdded( vector<string> elements, int index )
+void NCTable::addItem( YItem *yitem )
{
- vector Items( elements.size(), 0 );
- for ( unsigned i = 0; i < elements.size(); ++i ) {
+ YTableItem *item = dynamic_cast(yitem);
+ YTable::addItem( item );
+
+ vector Items( item->cellCount() );
+ unsigned int i = 0;
+ for ( YTableCellIterator it = item->cellsBegin();
+ it != item->cellsEnd();
+ ++it ){
// use YCPString to enforce recoding from 'utf8'
- Items[i] = new NCTableCol( YCPString( elements[i] ) );
+ Items[i] = new NCTableCol( NCstring( (*it)->label() ) );
+ i++;
}
- myPad()->Append( Items, index );
+ NCTableLine *newline = new NCTableLine( Items );
+ newline->setOrigItem( item );
+
+ myPad()->Append( newline );
+ //myPad()->Append( Items, myPad()->Lines() );
DrawPad();
}
///////////////////////////////////////////////////////////////////
//
//
-// METHOD NAME : NCTable::itemsCleared
+// METHOD NAME : NCTable::deleteAllItems
// METHOD TYPE : void
//
// DESCRIPTION :
//
-void NCTable::itemsCleared()
+void NCTable::deleteAllItems()
{
myPad()->ClearTable();
DrawPad();
+ YTable::deleteAllItems();
}
///////////////////////////////////////////////////////////////////
@@ -227,15 +259,15 @@
//
// DESCRIPTION :
//
-void NCTable::cellChanged( int index, int colnum, const YCPString & newtext )
+void NCTable::cellChanged( int index, int colnum, const string & newtext )
{
NCTableLine * cl = myPad()->ModifyLine( index );
if ( !cl ) {
- NCINT << "No such line: " << wpos( index, colnum ) << newtext->value() << endl;
+ NCINT << "No such line: " << wpos( index, colnum ) << newtext << endl;
} else {
NCTableCol * cc = cl->GetCol( colnum );
if ( !cc ) {
- NCINT << "No such colnum: " << wpos( index, colnum ) << newtext->value() << endl;
+ NCINT << "No such colnum: " << wpos( index, colnum ) << newtext << endl;
} else {
// use YCPString to enforce recoding from 'utf8'
cc->SetLabel( NCstring( newtext ) );
@@ -244,6 +276,12 @@
}
}
+void NCTable::cellChanged( const YTableCell *cell ) {
+
+ cellChanged( cell->itemIndex(), cell->column(), cell->label() );
+
+}
+
///////////////////////////////////////////////////////////////////
//
//
@@ -277,7 +315,8 @@
if ( ! handleInput( key ) ) {
switch ( key ) {
- case CTRL('o'):
+ /*FIXME: once YMenuButton is ported
+ case CTRL('o'):
{
if ( ! sortable )
break;
@@ -304,7 +343,7 @@
myPad ()->setOrder (column);
return NCursesEvent::none;
- }
+ }*/
case KEY_SPACE:
case KEY_RETURN:
if ( notify() && citem != -1 )
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCTable.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCTable.h?rev=41392&r1=41391&r2=41392&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCTable.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCTable.h Thu Oct 11 17:35:25 2007
@@ -22,6 +22,7 @@
#include <iosfwd>
#include "YTable.h"
+
#include "NCPadWidget.h"
#include "NCTablePad.h"
@@ -45,7 +46,7 @@
bool immediate;
bool sortable;
- vector<string> header;
+ vector<NCstring> header;
protected:
@@ -62,7 +63,8 @@
virtual NCPad * CreatePad();
- virtual void cellChanged( int index, int colnum, const YCPString & newtext );
+ virtual void cellChanged( int index, int colnum, const string & newtext );
+ virtual void cellChanged( const YTableCell *cell );
protected:
@@ -72,22 +74,25 @@
public:
- NCTable( YWidget * parent, const YWidgetOpt & opt,
- vector<string> header, bool sort );
+ NCTable( YWidget * parent, int columns );
+
virtual ~NCTable();
bool bigList() const { return biglist; }
bool isImmediate() const { return immediate; } // addey by gs
- void setHeader( const vector<string> & head ); // added by gs
- virtual void itemsCleared();
+ void setHeader( int col, const string & text ); // added by gs
+ void setHeader ( vector<string> header );
+ void setAlignment ( int col, YTable::Alignment al );
+ void setKeepSorting( bool keepSorting );
+ virtual void deleteAllItems( );
void setBigList( const bool big ) { biglist = big; }
void SetSepChar( const chtype colSepchar ) { myPad()->SetSepChar( colSepchar ); }
void SetSepWidht( const unsigned sepwidth ) { myPad()->SetSepWidht( sepwidth ); }
void SetHotCol( const int hcol ) { myPad()->SetHotCol( hcol ); }
- virtual void itemAdded( vector<string> elements, int index );
+ virtual void addItem( YItem *yitem );
virtual long nicesize( YUIDimension dim );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCTableItem.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCTableItem.cc?rev=41392&r1=41391&r2=41392&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCTableItem.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCTableItem.cc Thu Oct 11 17:35:25 2007
@@ -137,6 +137,11 @@
{
}
+void NCTableLine::setOrigItem (YTableItem *it)
+{
+ origItem = it;
+ origItem->setData(this);
+}
///////////////////////////////////////////////////////////////////
//
//
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCTableItem.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCTableItem.h?rev=41392&r1=41391&r2=41392&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCTableItem.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCTableItem.h Thu Oct 11 17:35:25 2007
@@ -26,6 +26,7 @@
#include "position.h"
#include "NCWidget.h"
+#include "YTableItem.h"
class NCTableStyle;
class NCTableCol;
@@ -62,6 +63,8 @@
int index;
+ YTableItem *origItem;
+
protected:
mutable STATE vstate;
@@ -73,6 +76,7 @@
NCTableLine( unsigned cols, int index = -1, const unsigned s = S_NORMAL );
NCTableLine( vector & nItems, int index = -1, const unsigned s = S_NORMAL );
+ void setOrigItem( YTableItem *it);
virtual ~NCTableLine();
unsigned Cols() const { return Items.size(); }
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCTablePad.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCTablePad.h?rev=41392&r1=41391&r2=41392&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCTablePad.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCTablePad.h Thu Oct 11 17:35:25 2007
@@ -114,7 +114,10 @@
void ClearTable() { SetLines( 0 ); }
void Append( NCTableLine * item ) { AddLine( Lines(), item ); }
- void Append( vector & nItems, int index = -1 ) { AddLine( Lines(), new NCTableLine( nItems, index ) ); }
+ void Append( vector & nItems, int index = -1 )
+ {
+ AddLine( Lines(), new NCTableLine( nItems, index ) );
+ }
void AddLine( unsigned idx, NCTableLine * item );
void DelLine( unsigned idx );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCWidgetFactory.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCWidgetFactory.cc?rev=41392&r1=41391&r2=41392&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCWidgetFactory.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCWidgetFactory.cc Thu Oct 11 17:35:25 2007
@@ -167,7 +167,10 @@
NCTable *
NCWidgetFactory::createTable( YWidget * parent, int columns )
{
- return 0; // FIXME: TO DO
+ NCTable *table = new NCTable( parent, columns );
+ YUI_CHECK_NEW( table );
+
+ return table;
}
Modified: branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.cc?rev=41392&r1=41391&r2=41392&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.cc Thu Oct 11 17:35:25 2007
@@ -363,15 +363,6 @@
}
-YWidget * YNCursesUI::createTable( YWidget * parent, YWidgetOpt & opt,
- vector<string> header )
-{
- ONCREATE;
- NCMIL << "CreateTable" << endl;
- return new NCTable( parent, opt, header, true );
-}
-
-
YWidget * YNCursesUI::createIntField( YWidget * parent, YWidgetOpt & opt,
const YCPString & label,
int minValue, int maxValue,
Modified: branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.h?rev=41392&r1=41391&r2=41392&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.h Thu Oct 11 17:35:25 2007
@@ -156,9 +156,9 @@
/**
* Creates a table widget
- */
virtual YWidget * createTable( YWidget * parent, YWidgetOpt & opt,
vector<string> header );
+*/
/**
* Creates an IntField widget.
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org