if(!CreateControl(parent,winid,pos,size,style,validator,name))
return false;
wxLogDebug("Created control with id=%d",GetId());
- NSRect cocoaRect = NSMakeRect(10,10,20,20);
m_cocoaNSView = NULL;
- SetNSButton([[NSButton alloc] initWithFrame: cocoaRect]);
+ SetNSButton([[NSButton alloc] initWithFrame: MakeDefaultNSRect(size)]);
// NOTE: YES we want to release this (to match the alloc).
// DoAddChild(this) will retain us again since addSubView doesn't.
[m_cocoaNSView release];
if(m_parent)
m_parent->CocoaAddChild(this);
+ SetInitialFrameRect(pos,size);
return true;
}
if(!CreateControl(parent,winid,pos,size,style,validator,name))
return false;
wxLogDebug("Created control with id=%d",GetId());
- NSRect cocoaRect = NSMakeRect(10,10,20,20);
m_cocoaNSView = NULL;
- SetNSButton([[NSButton alloc] initWithFrame: cocoaRect]);
+ SetNSButton([[NSButton alloc] initWithFrame: MakeDefaultNSRect(size)]);
// NOTE: YES we want to release this (to match the alloc).
// DoAddChild(this) will retain us again since addSubView doesn't.
[m_cocoaNSView release];
if(m_parent)
m_parent->CocoaAddChild(this);
+ SetInitialFrameRect(pos,size);
return true;
}
if(!CreateControl(parent,winid,pos,size,style,validator,name))
return false;
m_cocoaNSView = NULL;
- NSRect cocoaRect = NSMakeRect(10,10,20,20);
- SetNSButton([[NSButton alloc] initWithFrame: cocoaRect]);
+ SetNSButton([[NSButton alloc] initWithFrame: MakeDefaultNSRect(size)]);
[m_cocoaNSView release];
[GetNSButton() setButtonType: NSSwitchButton];
[GetNSButton() setTitle:[NSString stringWithCString: label.c_str()]];
if(m_parent)
m_parent->CocoaAddChild(this);
+ SetInitialFrameRect(pos,size);
+
return true;
}
return false;
m_cocoaNSView = NULL;
- SetNSTextField([[NSComboBox alloc] initWithFrame:NSMakeRect(0,0,30,30)]);
+ SetNSTextField([[NSComboBox alloc] initWithFrame:MakeDefaultNSRect(size)]);
[m_cocoaNSView release];
[GetNSTextField() setStringValue:wxNSStringWithWxString(value.c_str())];
[GetNSControl() sizeToFit];
if(m_parent)
m_parent->CocoaAddChild(this);
+ SetInitialFrameRect(pos,size);
+
return true;
}
if(!CreateControl(parent,winid,pos,size,style,validator,name))
return false;
wxLogDebug("Created control with id=%d",GetId());
- NSRect cocoaRect = NSMakeRect(10,10,20,20);
m_cocoaNSView = NULL;
- SetNSControl([[NSControl alloc] initWithFrame: cocoaRect]);
+ SetNSControl([[NSControl alloc] initWithFrame: MakeDefaultNSRect(size)]);
// NOTE: YES we want to release this (to match the alloc).
// DoAddChild(this) will retain us again since addSubView doesn't.
[m_cocoaNSView release];
if(m_parent)
m_parent->CocoaAddChild(this);
+ SetInitialFrameRect(pos,size);
return true;
}
{
if(!CreateControl(parent,winid,pos,size,style,validator,name))
return false;
- SetNSView([[NSProgressIndicator alloc] initWithFrame: NSMakeRect(10,10,20,20)]);
+ SetNSView([[NSProgressIndicator alloc] initWithFrame: MakeDefaultNSRect(size)]);
[m_cocoaNSView release];
if(m_parent)
m_parent->CocoaAddChild(this);
+ SetInitialFrameRect(pos,size);
+
return true;
}
{
if(!CreateControl(parent,winid,pos,size,style,validator,name))
return false;
- SetNSView([[NSView alloc] initWithFrame: NSMakeRect(10,10,20,20)]);
+ SetNSView([[NSView alloc] initWithFrame: MakeDefaultNSRect(size)]);
[m_cocoaNSView release];
if(m_parent)
m_parent->CocoaAddChild(this);
+ SetInitialFrameRect(pos,size);
+
return true;
}
if(!CreateControl(parent,winid,pos,size,style,validator,name))
return false;
m_cocoaNSView = NULL;
- NSRect cocoaRect = NSMakeRect(10,10,20,20);
- SetNSButton([[NSButton alloc] initWithFrame: cocoaRect]);
+ SetNSButton([[NSButton alloc] initWithFrame: MakeDefaultNSRect(size)]);
[m_cocoaNSView release];
[GetNSButton() setButtonType: NSRadioButton];
[GetNSButton() setTitle:wxNSStringWithWxString(label)];
if(m_parent)
m_parent->CocoaAddChild(this);
+ SetInitialFrameRect(pos,size);
+
return true;
}
{
if(!CreateControl(parent,winid,pos,size,style,validator,name))
return false;
- SetNSView([[NSView alloc] initWithFrame: NSMakeRect(10,10,20,20)]);
+ SetNSView([[NSView alloc] initWithFrame: MakeDefaultNSRect(size)]);
[m_cocoaNSView release];
if(m_parent)
m_parent->CocoaAddChild(this);
+ SetInitialFrameRect(pos,size);
+
return true;
}
{
if(!CreateControl(parent,winid,pos,size,style,wxDefaultValidator,name))
return false;
- SetNSControl([[NSStepper alloc] initWithFrame: NSMakeRect(10,10,20,20)]);
+ SetNSControl([[NSStepper alloc] initWithFrame: MakeDefaultNSRect(size)]);
[m_cocoaNSView release];
if(m_parent)
m_parent->CocoaAddChild(this);
+ SetInitialFrameRect(pos,size);
+
return true;
}
if(!CreateControl(parent,winid,pos,size,style,wxDefaultValidator,name))
return false;
m_cocoaNSView = NULL;
- SetNSView([[NSView alloc] initWithFrame: NSMakeRect(10,10,20,20)]);
+ SetNSView([[NSView alloc] initWithFrame: MakeDefaultNSRect(size)]);
[m_cocoaNSView release];
if(m_parent)
m_parent->CocoaAddChild(this);
+ SetInitialFrameRect(pos,size);
+
return true;
}
if(!CreateControl(parent,winid,pos,size,style,validator,name))
return false;
m_cocoaNSView = NULL;
- SetNSBox([[NSBox alloc] initWithFrame:NSMakeRect(0,0,30,30)]);
+ SetNSBox([[NSBox alloc] initWithFrame:MakeDefaultNSRect(size)]);
[GetNSBox() setTitle:[NSString stringWithCString:title.c_str()]];
if(m_parent)
m_parent->CocoaAddChild(this);
+ SetInitialFrameRect(pos,size);
+
return true;
}
{
if(!CreateControl(parent,winid,pos,size,style,wxDefaultValidator,name))
return false;
- SetNSView([[NSView alloc] initWithFrame: NSMakeRect(10,10,20,20)]);
+ SetNSView([[NSView alloc] initWithFrame: MakeDefaultNSRect(size)]);
[m_cocoaNSView release];
if(m_parent)
m_parent->CocoaAddChild(this);
+ SetInitialFrameRect(pos,size);
+
return true;
}
if(!CreateControl(parent,winid,pos,size,style,wxDefaultValidator,name))
return false;
m_cocoaNSView = NULL;
- SetNSTextField([[NSTextField alloc] initWithFrame:NSMakeRect(0,0,30,30)]);
+ SetNSTextField([[NSTextField alloc] initWithFrame:MakeDefaultNSRect(size)]);
[m_cocoaNSView release];
[GetNSTextField() setStringValue:[NSString stringWithCString:label.c_str()]];
// [GetNSTextField() setBordered: NO];
if(m_parent)
m_parent->CocoaAddChild(this);
+ SetInitialFrameRect(pos,size);
+
return true;
}