-
Notifications
You must be signed in to change notification settings - Fork 0
/
CEditTable.cp
executable file
·76 lines (50 loc) · 1.71 KB
/
CEditTable.cp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// ===========================================================================
// CEditTable.cp ©1997-1998 Metrowerks, Inc. All rights reserved.
// ===========================================================================
// Original Author: John C. Daub
//
// An outline table that demonstrates pane hosting and in-place editing
#include "CEditTable.h"
#include <LTablePaneHostingGeometry.h>
#include <LOutlineKeySelector.h>
#include <LOutlineRowSelector.h>
#include <UAttachments.h>
#include "CEditItem.h"
#include "OutlineTableConstants.h"
CEditTable::CEditTable(
LStream *inStream )
: LOutlineTable( inStream )
{
SetTableGeometry( new LTablePaneHostingGeometry( this, kColWidth, 20 ) );
// set the table selector
SetTableSelector(new LOutlineRowSelector( this ) );
// and note that we don't set the table storage....
// most of the table classes not only maintain the graphical
// representation of your data but also the data itself. But
// LOutlineTable doesn't really do this...it mostly handles
// graphical representation... you need to handle your data
// maintenance elsewhere by yourself.
// insert a couple columns (name and size)
InsertCols( 1, 0, nil, nil, false );
// Set up keyboard selection and scrolling.
AddAttachment(new LOutlineKeySelector(this, msg_AnyMessage));
AddAttachment(new LKeyScrollAttachment(this));
// Try to become default commander in the window.
if (mSuperCommander != nil) {
mSuperCommander->SetLatentSub(this);
}
}
CEditTable::~CEditTable()
{
// nothing
}
void
CEditTable::FinishCreateSelf()
{
CEditItem *theItem;
for ( SInt16 i = 1; i <= 5; ++i ) {
theItem = new CEditItem;
ThrowIfNil_(theItem);
InsertItem( theItem, nil, nil );
}
}