36 [spinbox setEnabled:(value==0)?NO:YES];
40 [spinbox makeFirstResponder];
44 NSRect frame = [spinbox frame];
45 frame.size.width = value;
46 [spinbox setFrame:frame];
51 NSRect frame = [spinbox frame];
52 frame.size.height = value;
53 [spinbox setFrame:frame];
58 [spinbox setIntegerValue:value];
62 [spinbox setMinValue:value];
66 [spinbox setMaxValue:value];
74 "Function is not appropriate for this type of widget (%s)",
94 return ([spinbox isEnabled])?1:0;
97 return ([spinbox isFirstResponder])?1:0;
100 return [spinbox frame].size.width;
103 return [spinbox frame].size.height;
106 return [spinbox integerValue];
109 return [spinbox minValue];
112 return [spinbox maxValue];
118 "Function is not appropriate for this type of widget (%s)",
140 if (value && *value) {
141 NSString *stringValue = [[NSString alloc] initWithCString:value encoding:NSUTF8StringEncoding];
142 [spinbox setStringValue:stringValue];
143 [stringValue release];
151 "Function is not appropriate for this type of widget (%s)",
162 const char *defaultValue) {
171 return [[spinbox stringValue] cStringUsingEncoding:NSUTF8StringEncoding];
177 "Function is not appropriate for this type of widget (%s)",
208 wParent=GWEN_Widget_Tree_GetParent(w);
215 spinbox = [[[
CocoaSpinbox alloc] initWithFrame:NSMakeRect(0.0, 0.0, 100.0, 22.0)] autorelease];
220 NSString *stringValue = [[NSString alloc] initWithCString:s encoding:NSUTF8StringEncoding];
221 [spinbox setStringValue:stringValue];
222 [stringValue release];
225 [spinbox setStringValue:nil];
238 [spinbox setC_ActionPtr:ptr Data:w];
#define COCOA_DIALOG_WIDGET_REAL
#define GWEN_ERROR_INVALID
#define DBG_WARN(dbg_logger, format, args...)
int CocoaGui_WSpinBox_Setup(GWEN_WIDGET *w)
#define COCOA_DIALOG_WIDGET_CONTENT
#define GWEN_WIDGET_FLAGS_FILLY
#define GWEN_WIDGET_FLAGS_FILLX
int GWEN_Dialog_EmitSignal(GWEN_DIALOG *dlg, GWEN_DIALOG_EVENTTYPE t, const char *sender)
#define DBG_ERROR(dbg_logger, format, args...)
static GWENHYWFAR_CB const char * CocoaGui_WSpinBox_GetCharProperty(GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, const char *defaultValue)
static GWENHYWFAR_CB int CocoaGui_WSpinBox_SetIntProperty(GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, int value, int doSignal)
void CocoaGui_Dialog_Leave(GWEN_DIALOG *dlg, int result)
#define GWEN_INHERIT(bt, t)
static GWENHYWFAR_CB int CocoaGui_WSpinBox_SetCharProperty(GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, const char *value, int doSignal)
void(* gwenSpinBoxActionPtr)(NSView *spinbox, void *data)
static GWENHYWFAR_CB int CocoaGui_WSpinBox_GetIntProperty(GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, int defaultValue)
static void CocoaGui_WSpinBox_Changed_handler(NSView *spinbox, void *data)