Moved the Mac OS X function newScrollView() to control_darwin.m and verified its styles against Interface Builder.

This commit is contained in:
Pietro Gagliardi 2014-07-30 12:50:45 -04:00
parent a8b7283a87
commit d21bd30583
3 changed files with 25 additions and 14 deletions

20
redo/control_darwin.m Normal file
View File

@ -0,0 +1,20 @@
// 30 july 2014
#import "objc_darwin.h"
#import <Cocoa/Cocoa.h>
#define toNSView(x) ((NSView *) (x))
// TODO verify this when we add more scrolling controls
id newScrollView(id content)
{
NSScrollView *sv;
sv = [[NSScrollView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)];
[sv setDocumentView:toNSView(content)];
[sv setHasHorizontalScroller:YES];
[sv setHasVerticalScroller:YES];
[sv setAutohidesScrollers:YES];
[sv setBorderType:NSBezelBorder];
return (id) sv;
}

View File

@ -31,7 +31,7 @@ extern void windowClose(id);
extern id windowContentView(id);
extern void windowRedraw(id);
/* controls_darwin.m */
/* basicctrls_darwin.m */
extern void parent(id, id);
extern void controlSetHidden(id, BOOL);
extern void setStandardControlFont(id);
@ -51,7 +51,7 @@ extern id newLabel(void);
/* sizing_darwin.m */
extern void moveControl(id, intptr_t, intptr_t, intptr_t, intptr_t);
/* containers_darwin.m */
/* containerctrls_darwin.m */
extern id newTab(void *);
extern id tabAppend(id, char *);
@ -59,7 +59,9 @@ extern id tabAppend(id, char *);
extern id newTable(void);
extern void tableAppendColumn(id, char *);
extern void tableUpdate(id);
extern id newScrollView(id);
extern void tableMakeDataSource(id, void *);
/* control_darwin.m */
extern id newScrollView(id);
#endif

View File

@ -5,7 +5,6 @@
#import <Cocoa/Cocoa.h>
#define toNSTableView(x) ((NSTableView *) (x))
#define toNSView(x) ((NSView *) (x))
@interface goTableDataSource : NSObject <NSTableViewDataSource> {
@public
@ -68,16 +67,6 @@ void tableUpdate(id t)
[toNSTableView(t) reloadData];
}
// TODO SPLIT
id newScrollView(id content)
{
NSScrollView *sv;
sv = [[NSScrollView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)];
[sv setDocumentView:toNSView(content)];
return (id) sv;
}
void tableMakeDataSource(id table, void *gotable)
{
goTableDataSource *model;