And added button columns. Now to start writing the rest of the uiTable glue.
This commit is contained in:
parent
b74b987fff
commit
8ee5c61fe8
|
@ -253,7 +253,7 @@ struct textColumnCreateParams {
|
||||||
data = (*(self->m->mh->CellValue))(self->m->mh, self->m, row, self->textParams.ColorModelColumn);
|
data = (*(self->m->mh->CellValue))(self->m->mh, self->m, row, self->textParams.ColorModelColumn);
|
||||||
uiTableDataColor(data, &r, &g, &b, &a);
|
uiTableDataColor(data, &r, &g, &b, &a);
|
||||||
uiFreeTableData(data);
|
uiFreeTableData(data);
|
||||||
xx TODO
|
// TODO
|
||||||
}
|
}
|
||||||
if (color == nil)
|
if (color == nil)
|
||||||
color = [NSColor controlTextColor];
|
color = [NSColor controlTextColor];
|
||||||
|
@ -374,6 +374,71 @@ struct textColumnCreateParams {
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@interface uiprivButtonColumnCellView : uiprivColumnCellView {
|
||||||
|
uiTable *t;
|
||||||
|
uiTableModel *m;
|
||||||
|
NSButton *b;
|
||||||
|
int modelColumn;
|
||||||
|
int editableColumn;
|
||||||
|
}
|
||||||
|
- (id)initWithFrame:(NSRect)r table:(uiTable *)table model:(uiTableModel *)model modelColumn:(int)mc editableColumn:(int)ec;
|
||||||
|
- (IBAction)uiprivOnClicked:(id)sender;
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation uiprivProgressBarColumnCellView
|
||||||
|
|
||||||
|
- (id)initWithFrame:(NSRect)r table:(uiTable *)table model:(uiTableModel *)model modelColumn:(int)mc editableColumn:(int)ec
|
||||||
|
{
|
||||||
|
self = [super initWithFrame:r];
|
||||||
|
if (self) {
|
||||||
|
self->t = table;
|
||||||
|
self->m = model;
|
||||||
|
self->modelColumn = mc;
|
||||||
|
self->editableColumn = ec;
|
||||||
|
|
||||||
|
self->b = [[NSButton alloc] initWithFrame:NSZeroRect];
|
||||||
|
[self->b setButtonType:NSMomentaryPushInButton];
|
||||||
|
[self->b setBordered:YES];
|
||||||
|
[self->b setBezelStyle:NSRoundRectBezelStyle];
|
||||||
|
uiDarwinSetControlFont(self->b, NSRegularControlSize);
|
||||||
|
[self->b setTarget:self];
|
||||||
|
[self->b setAction:@selector(uiprivOnClicked:)];
|
||||||
|
layoutCellSubview(self, self->b,
|
||||||
|
self, progressBarColumnLeading,
|
||||||
|
self, progressBarColumnTrailing,
|
||||||
|
YES);
|
||||||
|
}
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)dealloc
|
||||||
|
{
|
||||||
|
[self->p release];
|
||||||
|
self->p = nil;
|
||||||
|
[super dealloc];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)uiprivUpdate:(NSInteger)row
|
||||||
|
{
|
||||||
|
uiTableData *data;
|
||||||
|
NSString *str;
|
||||||
|
BOOL editable;
|
||||||
|
|
||||||
|
data = (*(self->m->mh->CellValue))(self->m->mh, self->m, row, self->modelColumn);
|
||||||
|
str = uiprivToNSString(uiTableDataString(data));
|
||||||
|
uiFreeTableData(data);
|
||||||
|
[self->b setTitle:str];
|
||||||
|
|
||||||
|
[self->b setEditable:isCellEditable(self->m, row, self->editableColumn)];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (id)uiprivOnClicked:(id)sender
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
void uiTableAppendTextColumn(uiTable *t,
|
void uiTableAppendTextColumn(uiTable *t,
|
||||||
const char *name,
|
const char *name,
|
||||||
int textModelColumn,
|
int textModelColumn,
|
||||||
|
|
Loading…
Reference in New Issue