Migrated the uiNewControl() definitions on OS X. This just leaves uiMenu.

This commit is contained in:
Pietro Gagliardi 2016-04-24 16:03:13 -04:00
parent b2c9577cb9
commit 5efad5e850
19 changed files with 19 additions and 18 deletions

View File

@ -1,5 +1,6 @@
// 24 april 2016
#define uiAreaSignature 0x41726561
#define uiBoxSignature 0x426F784C
#define uiButtonSignature 0x42746F6E
#define uiCheckboxSignature 0x43686B62

View File

@ -357,7 +357,7 @@ uiArea *uiNewArea(uiAreaHandler *ah)
{
uiArea *a;
a = (uiArea *) uiNewControl(uiAreaType());
a = (uiArea *) uiNewControl(uiArea);
a->ah = ah;
a->scrolling = NO;

View File

@ -272,7 +272,7 @@ static uiBox *finishNewBox(BOOL vertical)
{
uiBox *b;
b = (uiBox *) uiNewControl(uiBoxType());
b = (uiBox *) uiNewControl(uiBox);
b->view = [[NSView alloc] initWithFrame:NSZeroRect];

View File

@ -90,7 +90,7 @@ uiButton *uiNewButton(const char *text)
{
uiButton *b;
b = (uiButton *) uiNewControl(uiButtonType());
b = (uiButton *) uiNewControl(uiButton);
b->button = [[NSButton alloc] initWithFrame:NSZeroRect];
[b->button setTitle:toNSString(text)];

View File

@ -109,7 +109,7 @@ uiCheckbox *uiNewCheckbox(const char *text)
{
uiCheckbox *c;
c = (uiCheckbox *) uiNewControl(uiCheckboxType());
c = (uiCheckbox *) uiNewControl(uiCheckbox);
c->button = [[NSButton alloc] initWithFrame:NSZeroRect];
[c->button setTitle:toNSString(text)];

View File

@ -169,7 +169,7 @@ static uiCombobox *finishNewCombobox(BOOL editable)
{
uiCombobox *c;
c = (uiCombobox *) uiNewControl(uiComboboxType());
c = (uiCombobox *) uiNewControl(uiCombobox);
c->editable = editable;
if (c->editable) {

View File

@ -15,7 +15,7 @@ static uiDateTimePicker *finishNewDateTimePicker(NSDatePickerElementFlags elemen
{
uiDateTimePicker *d;
d = (uiDateTimePicker *) uiNewControl(uiDateTimePickerType());
d = (uiDateTimePicker *) uiNewControl(uiDateTimePicker);
d->dp = [[NSDatePicker alloc] initWithFrame:NSZeroRect];
[d->dp setBordered:NO];

View File

@ -148,7 +148,7 @@ uiEntry *uiNewEntry(void)
{
uiEntry *e;
e = (uiEntry *) uiNewControl(uiEntryType());
e = (uiEntry *) uiNewControl(uiEntry);
e->textfield = newEditableTextField();

View File

@ -172,7 +172,7 @@ uiFontButton *uiNewFontButton(void)
{
uiFontButton *b;
b = (uiFontButton *) uiNewControl(uiFontButtonType());
b = (uiFontButton *) uiNewControl(uiFontButton);
b->button = [[fontButton alloc] initWithFrame:NSZeroRect libuiFontButton:b];
uiDarwinSetControlFont(b->button, NSRegularControlSize);

View File

@ -101,7 +101,7 @@ uiGroup *uiNewGroup(const char *title)
{
uiGroup *g;
g = (uiGroup *) uiNewControl(uiGroupType());
g = (uiGroup *) uiNewControl(uiGroup);
g->box = [[NSBox alloc] initWithFrame:NSZeroRect];
[g->box setTitle:toNSString(title)];

View File

@ -27,7 +27,7 @@ uiLabel *uiNewLabel(const char *text)
{
uiLabel *l;
l = (uiLabel *) uiNewControl(uiLabelType());
l = (uiLabel *) uiNewControl(uiLabel);
l->textfield = [[NSTextField alloc] initWithFrame:NSZeroRect];
[l->textfield setStringValue:toNSString(text)];

View File

@ -70,7 +70,7 @@ uiMultilineEntry *uiNewMultilineEntry(void)
uiMultilineEntry *e;
NSFont *font;
e = (uiMultilineEntry *) uiNewControl(uiMultilineEntryType());
e = (uiMultilineEntry *) uiNewControl(uiMultilineEntry);
e->sv = [[NSScrollView alloc] initWithFrame:NSZeroRect];
// TODO verify against Interface Builder

View File

@ -31,7 +31,7 @@ uiProgressBar *uiNewProgressBar(void)
{
uiProgressBar *p;
p = (uiProgressBar *) uiNewControl(uiProgressBarType());
p = (uiProgressBar *) uiNewControl(uiProgressBar);
p->pi = [[NSProgressIndicator alloc] initWithFrame:NSZeroRect];
[p->pi setControlSize:NSRegularControlSize];

View File

@ -46,7 +46,7 @@ uiRadioButtons *uiNewRadioButtons(void)
uiRadioButtons *r;
NSButtonCell *cell;
r = (uiRadioButtons *) uiNewControl(uiRadioButtonsType());
r = (uiRadioButtons *) uiNewControl(uiRadioButtons);
// we have to set up the NSMatrix this way (prototype first)
// otherwise we won't be able to change its properties (such as the button type)

View File

@ -20,7 +20,7 @@ uiSeparator *uiNewHorizontalSeparator(void)
{
uiSeparator *s;
s = (uiSeparator *) uiNewControl(uiSeparatorType());
s = (uiSeparator *) uiNewControl(uiSeparator);
s->box = [[NSBox alloc] initWithFrame:NSMakeRect(0, 0, separatorFrameWidth, separatorFrameHeight)];
[s->box setBoxType:NSBoxSeparator];

View File

@ -110,7 +110,7 @@ uiSlider *uiNewSlider(intmax_t min, intmax_t max)
uiSlider *s;
NSSliderCell *cell;
s = (uiSlider *) uiNewControl(uiSliderType());
s = (uiSlider *) uiNewControl(uiSlider);
// a horizontal slider is defined as one where the width > height, not by a flag
// to be safe, don't use NSZeroRect, but make it horizontal from the get-go

View File

@ -162,7 +162,7 @@ uiSpinbox *uiNewSpinbox(intmax_t min, intmax_t max)
if (min >= max)
complain("error: min >= max in uiNewSpinbox()");
s = (uiSpinbox *) uiNewControl(uiSpinboxType());
s = (uiSpinbox *) uiNewControl(uiSpinbox);
s->spinbox = [[libui_spinbox alloc] initWithFrame:NSZeroRect spinbox:s];
[s->spinbox setMinimum:min];

View File

@ -148,7 +148,7 @@ uiTab *uiNewTab(void)
{
uiTab *t;
t = (uiTab *) uiNewControl(uiTabType());
t = (uiTab *) uiNewControl(uiTab);
t->tabview = [[NSTabView alloc] initWithFrame:NSZeroRect];
// also good for NSTabView (same selector and everything)

View File

@ -192,7 +192,7 @@ uiWindow *uiNewWindow(const char *title, int width, int height, int hasMenubar)
finalizeMenus();
w = (uiWindow *) uiNewControl(uiWindowType());
w = (uiWindow *) uiNewControl(uiWindow);
w->window = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, (CGFloat) width, (CGFloat) height)
styleMask:(NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask)