31 [control setEnabled:(value!=0)];
35 [[control window] makeFirstResponder:control];
40 [comboBox selectItemAtIndex:value];
43 [popUp selectItemAtIndex:value];
49 if (comboBox) [comboBox removeAllItems];
50 else if (popUp) [popUp removeAllItems];
60 "Function is not appropriate for this type of widget (%s)",
84 return ([control isEnabled])?1:0;
87 if ([control window]) {
88 if ([[control window] firstResponder] == control)
return 1;
94 return [comboBox indexOfSelectedItem];
97 return [popUp indexOfSelectedItem];
105 i = [comboBox numberOfItems];
108 i = [popUp numberOfItems];
120 "Function is not appropriate for this type of widget (%s)",
149 NSString *stringValue = [[NSString alloc] initWithCString:value encoding:NSUTF8StringEncoding];
150 if (popUp && stringValue) {
151 [popUp addItemWithTitle:stringValue];
153 else if (comboBox && stringValue) {
154 [comboBox addItemWithObjectValue:stringValue];
157 [stringValue release];
162 if (comboBox) [comboBox removeAllItems];
163 else if (popUp) [popUp removeAllItems];
172 "Function is not appropriate for this type of widget (%s)",
183 const char *defaultValue) {
195 NSString *value = nil;
198 value = [popUp titleOfSelectedItem];
200 else if (comboBox && [[comboBox itemObjectValueAtIndex:index] isKindOfClass:[NSString
class]]) {
201 value = [comboBox itemObjectValueAtIndex:index];
204 if (value)
return [value cStringUsingEncoding:NSUTF8StringEncoding];
213 "Function is not appropriate for this type of widget (%s)",
263 wParent=GWEN_Widget_Tree_GetParent(w);
276 [popUp setC_PopUpActionPtr:ptr Data:w];
288 [comboBox setC_ComboBoxActionPtr:ptr Data:w];
296#pragma mark NOCH MACHEN Action setzen
void(* gwenComboBoxActionPtr)(NSComboBox *comboBox, void *data)
#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
#define GWEN_WIDGET_FLAGS_READONLY
@ GWEN_DialogProperty_AddValue
@ GWEN_DialogProperty_ValueCount
@ GWEN_DialogProperty_ClearValues
@ GWEN_DialogProperty_Enabled
@ GWEN_DialogProperty_Value
@ GWEN_DialogProperty_Focus
@ GWEN_DialogEvent_TypeActivated
@ GWEN_DialogEvent_ResultAccept
@ GWEN_DialogEvent_ResultReject
#define GWEN_ERROR_INVALID
#define GWEN_ERROR_NOT_FOUND
static GWENHYWFAR_CB int CocoaGui_WComboBox_SetCharProperty(GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, const char *value, int doSignal)
static GWENHYWFAR_CB int CocoaGui_WComboBox_SetIntProperty(GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, int value, int doSignal)
static void CocoaGui_WComboBox_Changed_handler(NSControl *comboBoxOrPopUp, void *data)
static GWENHYWFAR_CB const char * CocoaGui_WComboBox_GetCharProperty(GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, const char *defaultValue)
static GWENHYWFAR_CB int CocoaGui_WComboBox_GetIntProperty(GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, int defaultValue)
int CocoaGui_WComboBox_Setup(GWEN_WIDGET *w)