home *** CD-ROM | disk | FTP | other *** search
- /***
- * CNBPPane
- *
- * ArrayPane to display NBP names
- *
- * needs the table classes
- *
- * Copyright © 1992 Bernard Bernstein. All rights reserved.
- ***/
-
- #include "CNBPPane.h"
- #include "CNBP.h"
- #include <CArray.h>
-
- /***
- * INBPPane
- *
- * Initialize the pane
- ***/
- void CNBPPane::INBPPane( CView *anEnclosure, CBureaucrat *aSupervisor,
- short aWidth, short aHeight,
- short aHEncl, short aVEncl,
- SizingOption aHSizing, SizingOption aVSizing)
- {
- CArrayPane::IArrayPane( anEnclosure, aSupervisor, aWidth, aHeight,
- aHEncl, aVEncl, aHSizing, aVSizing);
- }
-
- /***
- * GetCellText
- *
- * return the text to print in the list
- ***/
- void CNBPPane::GetCellText(Cell aCell, short availableWidth, StringPtr itsText)
- {
- if (itsArray)
- {
- NBPAddrNameRec addr;
- itsArray->GetItem( &addr, aCell.v+1);
- BlockMove(addr.name, itsText, addr.name[0]+1);
- }
- }
-
- /***
- * GetSelectedAddr
- *
- * return the AddrBlock of the selected NBP name
- ***/
- AddrBlock CNBPPane::GetSelectedAddr(void)
- {
- Cell aCell;
- NBPAddrNameRec addr;
-
- addr.addr.aNet = 0;
- addr.addr.aNode = 0x00;
- addr.addr.aSocket = 0x00;
- SetCell(aCell, 0, 0);
- if (GetSelect( TRUE, &aCell))
- {
- itsArray->GetItem(&addr, ++aCell.v);
- }
- return addr.addr;
- }
-
-