Fixed up attributes of Table on Mac OS X.
This commit is contained in:
parent
d21bd30583
commit
3d922c87fa
|
@ -10,6 +10,8 @@
|
||||||
#define toNSButton(x) ((NSButton *) (x))
|
#define toNSButton(x) ((NSButton *) (x))
|
||||||
#define toNSTextField(x) ((NSTextField *) (x))
|
#define toNSTextField(x) ((NSTextField *) (x))
|
||||||
|
|
||||||
|
// TODO move to control_darwin.m
|
||||||
|
|
||||||
void parent(id control, id parentid)
|
void parent(id control, id parentid)
|
||||||
{
|
{
|
||||||
[toNSView(parentid) addSubview:toNSView(control)];
|
[toNSView(parentid) addSubview:toNSView(control)];
|
||||||
|
@ -20,11 +22,18 @@ void controlSetHidden(id control, BOOL hidden)
|
||||||
[toNSView(control) setHidden:hidden];
|
[toNSView(control) setHidden:hidden];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// also fine for NSCells
|
||||||
void setStandardControlFont(id control)
|
void setStandardControlFont(id control)
|
||||||
{
|
{
|
||||||
[toNSControl(control) setFont:[NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:NSRegularControlSize]]];
|
[toNSControl(control) setFont:[NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:NSRegularControlSize]]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// also fine for NSCells
|
||||||
|
void setSmallControlFont(id control)
|
||||||
|
{
|
||||||
|
[toNSControl(control) setFont:[NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:NSSmallControlSize]]];
|
||||||
|
}
|
||||||
|
|
||||||
@interface goControlDelegate : NSObject {
|
@interface goControlDelegate : NSObject {
|
||||||
@public
|
@public
|
||||||
void *gocontrol;
|
void *gocontrol;
|
||||||
|
|
|
@ -35,6 +35,7 @@ extern void windowRedraw(id);
|
||||||
extern void parent(id, id);
|
extern void parent(id, id);
|
||||||
extern void controlSetHidden(id, BOOL);
|
extern void controlSetHidden(id, BOOL);
|
||||||
extern void setStandardControlFont(id);
|
extern void setStandardControlFont(id);
|
||||||
|
extern void setSmallControlFont(id);
|
||||||
extern id newButton(void);
|
extern id newButton(void);
|
||||||
extern void buttonSetDelegate(id, void *);
|
extern void buttonSetDelegate(id, void *);
|
||||||
extern const char *buttonText(id);
|
extern const char *buttonText(id);
|
||||||
|
|
|
@ -45,12 +45,10 @@ id newTable(void)
|
||||||
[t setAllowsMultipleSelection:NO];
|
[t setAllowsMultipleSelection:NO];
|
||||||
[t setAllowsEmptySelection:YES];
|
[t setAllowsEmptySelection:YES];
|
||||||
[t setAllowsColumnSelection:NO];
|
[t setAllowsColumnSelection:NO];
|
||||||
// TODO check against interface builder
|
|
||||||
return (id) t;
|
return (id) t;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO scroll view
|
// TODO other types
|
||||||
|
|
||||||
void tableAppendColumn(id t, char *name)
|
void tableAppendColumn(id t, char *name)
|
||||||
{
|
{
|
||||||
NSTableColumn *c;
|
NSTableColumn *c;
|
||||||
|
@ -58,7 +56,9 @@ void tableAppendColumn(id t, char *name)
|
||||||
c = [[NSTableColumn alloc] initWithIdentifier:nil];
|
c = [[NSTableColumn alloc] initWithIdentifier:nil];
|
||||||
[c setEditable:NO];
|
[c setEditable:NO];
|
||||||
[[c headerCell] setStringValue:[NSString stringWithUTF8String:name]];
|
[[c headerCell] setStringValue:[NSString stringWithUTF8String:name]];
|
||||||
// TODO other options
|
setSmallControlFont((id) [c headerCell]);
|
||||||
|
setStandardControlFont((id) [c dataCell]);
|
||||||
|
// TODO text layout options
|
||||||
[toNSTableView(t) addTableColumn:c];
|
[toNSTableView(t) addTableColumn:c];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue