26 [checkbox setEnabled:(value==0)?NO:YES];
30 if ([checkbox window]) {
31 [[checkbox window] makeFirstResponder:checkbox];
36 NSRect frame = [checkbox frame];
37 frame.size.width = value;
38 [checkbox setFrame:frame];
43 NSRect frame = [checkbox frame];
44 frame.size.height = value;
45 [checkbox setFrame:frame];
50 if (value==0) [checkbox setState:NSOffState];
51 else [checkbox setState:NSOnState];
60 "Function is not appropriate for this type of widget (%s)",
80 return ([checkbox isEnabled]==YES)?1:0;
83 if ([checkbox window]) {
84 if ([[checkbox window] firstResponder] == checkbox)
return 1;
89 return [checkbox frame].size.width;
92 return [checkbox frame].size.height;
95 return ([checkbox state]==NSOnState)?1:0;
102 "Function is not appropriate for this type of widget (%s)",
122 NSString *stringValue = [[NSString alloc] initWithCString:value encoding:NSUTF8StringEncoding];
123 [checkbox setTitle:stringValue];
124 [stringValue release];
132 "Function is not appropriate for this type of widget (%s)",
143 const char *defaultValue) {
151 return [[checkbox stringValue] cStringUsingEncoding:NSUTF8StringEncoding];
157 "Function is not appropriate for this type of widget (%s)",
189 wParent=GWEN_Widget_Tree_GetParent(w);
193 checkbox = [[[
CocoaCheckboxButton alloc] initWithFrame:NSMakeRect(0.0, 0.0, 60.0, 24.0)] autorelease];
197 NSString *title = [[NSString alloc] initWithCString:s encoding:NSUTF8StringEncoding];
198 [checkbox setTitle:title];
211 [checkbox setC_ActionPtr:ptr Data:w];
#define COCOA_DIALOG_WIDGET_REAL
void CocoaGui_Dialog_Leave(GWEN_DIALOG *dlg, int result)
#define COCOA_DIALOG_WIDGET_CONTENT
#define DBG_ERROR(dbg_logger, format,...)
#define DBG_WARN(dbg_logger, format,...)
int GWEN_Dialog_EmitSignal(GWEN_DIALOG *dlg, GWEN_DIALOG_EVENTTYPE t, const char *sender)
#define GWEN_WIDGET_FLAGS_FILLY
#define GWEN_WIDGET_FLAGS_FILLX
@ GWEN_DialogProperty_Title
@ GWEN_DialogProperty_Height
@ GWEN_DialogProperty_Enabled
@ GWEN_DialogProperty_Value
@ GWEN_DialogProperty_Focus
@ GWEN_DialogProperty_Width
@ GWEN_DialogEvent_TypeActivated
@ GWEN_DialogEvent_ResultAccept
@ GWEN_DialogEvent_ResultReject
#define GWEN_ERROR_INVALID
int CocoaGui_WCheckBox_Setup(GWEN_WIDGET *w)
static GWENHYWFAR_CB int CocoaGui_WCheckBox_SetIntProperty(GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, int value, int doSignal)
static void CocoaGui_WCheckBox_Toggled_handler(NSButton *button, void *data)
static GWENHYWFAR_CB int CocoaGui_WCheckBox_SetCharProperty(GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, const char *value, int doSignal)
static GWENHYWFAR_CB const char * CocoaGui_WCheckBox_GetCharProperty(GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, const char *defaultValue)
static GWENHYWFAR_CB int CocoaGui_WCheckBox_GetIntProperty(GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, int defaultValue)