Fixed some compiler errors.

This commit is contained in:
Pietro Gagliardi 2015-07-28 14:14:41 -04:00
parent da73d003ba
commit 87e4245e34
9 changed files with 13 additions and 15 deletions

View File

@ -80,7 +80,7 @@ uiButton *uiNewButton(const char *text)
b = (struct button *) uiNewControl(uiTypeButton());
b->button = [[NSButton alloc] initWithFrame:NSZeroFrame];
b->button = [[NSButton alloc] initWithFrame:NSZeroRect];
[b->button setTitle:toNSString(text)];
[b->button setButtonType:NSMomentaryPushInButton];
[b->button setBordered:YES];

View File

@ -97,7 +97,7 @@ uiCheckbox *uiNewCheckbox(const char *text)
c = (struct checkbox *) uiNewControl(uiTypeCheckbox());
// TODO make a macro for the below
c->checkbox = [[NSCheckbox alloc] initWithFrame:NSZeroRect];
c->checkbox = [[NSButton alloc] initWithFrame:NSZeroRect];
[c->checkbox setTitle:toNSString(text)];
[c->checkbox setButtonType:NSSwitchButton];
[c->checkbox setBordered:NO];

View File

@ -37,10 +37,10 @@ static uiCombobox *finishNewCombobox(BOOL editable)
c->cb = [[NSComboBox alloc] initWithFrame:NSZeroRect];
[c->cb setUsesDataSource:NO];
[c->cb setButtonBordered:YES];
NSLog(@"TEST intercellSpacing %@", NSStringFromSize([c->cb intercellSpacing]);
NSLog(@"TEST intercellSpacing %@", NSStringFromSize([c->cb intercellSpacing]));
[c->cb setCompletes:NO];
uiDarwinMakeSingleViewControl(uiControl(c), c->cb, YES);
NSLog(@"TEST intercellSpacing %@", NSStringFromSize([c->cb intercellSpacing]);
NSLog(@"TEST intercellSpacing %@", NSStringFromSize([c->cb intercellSpacing]));
} else {
c->pb = [[NSPopUpButton alloc] initWithFrame:NSZeroRect pullsDown:NO];
// TODO preferred edge

View File

@ -123,8 +123,6 @@ uiEntry *uiNewEntry(void)
[e->delegate setEntry:uiEntry(e)];
[e->delegate setOnChanged:defaultOnChanged data:NULL];
e->onChanged = defaultOnChanged;
uiControl(e)->Handle = entryHandle;
uiEntry(e)->Text = entryText;

View File

@ -73,11 +73,11 @@ uiGroup *uiNewGroup(const char *text)
{
struct group *g;
g = (struct group *) MAKE_CONTROL_INSTANCE(uiTypeGroup());
g = (struct group *) uiNewControl(uiTypeGroup());
g->box = [[NSBox alloc] initWithFrame:NSZeroRect];
[g->box setBoxType:NSBoxPrimary];
[g->box setBorderType:TODO];
//TODO [g->box setBorderType:TODO];
[g->box setTransparent:NO];
[g->box setTitlePosition:NSAtTop];

View File

@ -28,15 +28,15 @@ uiProgressBar *uiNewProgressBar(void)
{
struct progressbar *p;
p = (struct progressbar *) MAKE_CONTROL_INSTANCE(uiTypeProgressBar());
p = (struct progressbar *) uiNewControl(uiTypeProgressBar());
p->pi = [[NSProgressIndicator alloc] initWithFrame:NSZeroRect];
NSLog(@"TEST thread %d tint %d stopped %d", (int) [p->pi usesThreadedAnimation], [p->pi controlTint], (int) [p->pi displayedWhenStopped]);
NSLog(@"TEST thread %d tint %d stopped %d", (int) [p->pi usesThreadedAnimation], [p->pi controlTint], (int) [p->pi isDisplayedWhenStopped]);
[p->pi setControlSize:NSRegularControlSize];
[p->pi setBezeled:YES];
[p->pi setStyle:NSProgressIndicatorBarStyle];
[p->pi setIndeterminate:NO];
NSLog(@"TEST thread %d tint %d stopped %d", (int) [p->pi usesThreadedAnimation], [p->pi controlTint], (int) [p->pi displayedWhenStopped]);
NSLog(@"TEST thread %d tint %d stopped %d", (int) [p->pi usesThreadedAnimation], [p->pi controlTint], (int) [p->pi isDisplayedWhenStopped]);
uiDarwinMakeSingleViewControl(uiControl(p), p->pi, NO);
uiControl(p)->Handle = progressbarHandle;

View File

@ -21,11 +21,11 @@ uiSeparator *uiNewHorizontalSeparator(void)
{
struct separator *s;
s = (struct separator *) MAKE_CONTROL_INSTANCE(uiTypeSeparator());
s = (struct separator *) uiNewControl(uiTypeSeparator());
s->box = [[NSBox alloc] initWithFrame:NSZeroRect];
[s->box setBoxType:NSBoxSeparator];
[s->box setBorderType:TODO];
//TODO [s->box setBorderType:TODO];
[s->box setTransparent:NO];
[s->box setTitlePosition:NSNoTitle];

View File

@ -2,7 +2,7 @@
#define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_7
#define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_X_VERSION_10_7
#import <Cocoa/Cocoa.h>
#import "../ui.h"
#import "../out/ui.h"
#import "../ui_darwin.h"
#import "../uipriv.h"

View File

@ -8,7 +8,7 @@ This file assumes that you have imported <Cocoa/Cocoa.h> and "ui.h" beforehand.
#define __UI_UI_DARWIN_H__
// TODO document
_UI_EXTERN void uiDarwinMakeSingleViewControl(uiControl *, NSView *);
_UI_EXTERN void uiDarwinMakeSingleViewControl(uiControl *, NSView *, BOOL);
// You can use this function from within your control implementations to return text strings that can be freed with uiFreeText().
_UI_EXTERN char *uiDarwinNSStringToText(NSString *);