Overrides for the popdown flex table to close at the right times, etc.

This commit is contained in:
pinkerton%netscape.com 1998-08-11 19:19:18 +00:00
Родитель 87fed0868e
Коммит a70aff6fbb
2 изменённых файлов: 80 добавлений и 2 удалений

Просмотреть файл

@ -1539,3 +1539,53 @@ CHyperTreeSelector :: SyncSelectorWithHT ( )
}
} // SyncSelectorWithHT
#pragma mark -
CPopdownFlexTable :: CPopdownFlexTable ( LStream* inStream )
: CHyperTreeFlexTable(inStream)
{
}
CPopdownFlexTable :: ~CPopdownFlexTable ( )
{
}
//
// OpenRow
//
// Do the normal thing, but close up the tree afterwards.
//
void
CPopdownFlexTable :: OpenRow ( TableIndexT inRow )
{
CHyperTreeFlexTable::OpenRow(inRow);
BroadcastMessage ( msg_ClosePopdownTree, NULL );
} // OpenRow
#if 0
//
// OpenSelection
//
// The inherited version of this routine iterates over the selection and opens each row in
// turn. The problem, as you may be able to see from OpenRow() above, is that as soon as
// we open a row, the tree goes away. Guess what then happens when it tries to fetch the
// next selected row from a tree that has been obliterated....
//
// To avoid this nasty happening, only open the first selected item we encounter, even if
// many things are selected. What would it mean to open all of them in the browser window
// anyway?
//
void
CPopdownFlexTable :: OpenSelection()
{
TableIndexT selectedRow = 0;
if ( GetNextSelectedRow(selectedRow) && !CmdPeriod() )
OpenRow(selectedRow);
}
#endif

Просмотреть файл

@ -197,3 +197,31 @@ protected:
HT_View mTreeView;
}; // class CHyperTreeSelector
#pragma mark -- class CPopdownFlexTable --
//
// class CPopdownFlexTable
//
// The flex table used by the popdown view. It needs to broadcast some messages to the
// coordinator (such as when to close up) and do funny things to handle closing when
// items are opened.
//
class CPopdownFlexTable : public CHyperTreeFlexTable
{
public:
enum { class_ID = 'pdFT' };
enum { msg_ClosePopdownTree = 'clos' };
CPopdownFlexTable(LStream *inStream);
~CPopdownFlexTable();
private:
// void OpenSelection();
void OpenRow ( TableIndexT inRow ) ;
}; // class CPopdownFlexTable