14#define W_LISTBOX_MAX_TYPES 256
30 listbox = [scrollView documentView];
35 [listbox setEnabled:(value==0)?NO:YES];
39 if ([listbox window]) {
40 [[listbox window] makeFirstResponder:listbox];
48 [listbox setAllowsEmptySelection:YES];
49 [listbox setAllowsMultipleSelection:NO];
50 [listbox deselectAll:listbox];
53 [listbox setAllowsEmptySelection:NO];
54 [listbox setAllowsMultipleSelection:NO];
57 [listbox setAllowsEmptySelection:NO];
58 [listbox setAllowsMultipleSelection:YES];
67 if ([listbox setColumnWidthTo:value forColumn:index])
return 0;
86 "Function is not appropriate for this type of widget (%s)",
105 listbox = [scrollView documentView];
110 return ([listbox isEnabled])?1:0;
113 if ([listbox window]) {
114 if ([[listbox window] firstResponder] == listbox)
120 return [listbox selectedRow];
125 return [listbox widthOfColumn:index];
130 NSInteger sortOrder = [listbox sortOrderForColumnAtIndex:index];
147 "Function is not appropriate for this type of widget (%s)",
166 listbox = [scrollView documentView];
172 if (value && *value) {
173 NSString *titleString = [[NSString alloc] initWithCString:value encoding:NSUTF8StringEncoding];
174 [listbox setTitelsAndCreateColumns:titleString];
175 [titleString release];
181 [listbox clearDataRows];
187 if (value && *value) {
188 NSString *dataRowString = [[NSString alloc] initWithCString:value encoding:NSUTF8StringEncoding];
189 [listbox addDataRowString:dataRowString];
190 [dataRowString release];
200 "Function is not appropriate for this type of widget (%s)",
211 const char *defaultValue) {
218 listbox = [scrollView documentView];
223 NSString *titlesString = [listbox titlesString];
225 return [titlesString cStringUsingEncoding:NSUTF8StringEncoding];
231 NSString *dataRowString = [listbox dataRowStringForRow:index];
233 return [dataRowString cStringUsingEncoding:NSUTF8StringEncoding];
244 "Function is not appropriate for this type of widget (%s)",
276 wParent=GWEN_Widget_Tree_GetParent(w);
279 [scrollView setHasVerticalScroller:YES];
280 [scrollView setHasHorizontalScroller:YES];
281 [scrollView setAutohidesScrollers:YES];
285 listBox = [[[
CocoaListBox alloc] initWithFrame:NSMakeRect(0.0, 0.0, 100.0, 100.0)] autorelease];
286 [listBox setFocusRingType:NSFocusRingTypeNone];
287 [scrollView setLayoutedDocumentView:listBox];
298#pragma mark NOCH MACHEN
305 [listBox setC_ActionPtr:ptr Data:w];
void(* gwenListBoxActionPtr)(NSTableView *listbox, void *data)
#define COCOA_DIALOG_WIDGET_REAL
void CocoaGui_Dialog_Leave(GWEN_DIALOG *dlg, int result)
#define COCOA_DIALOG_WIDGET_CONTENT
#define DBG_WARN(dbg_logger, format, args...)
#define DBG_ERROR(dbg_logger, format, args...)
int GWEN_Dialog_EmitSignal(GWEN_DIALOG *dlg, GWEN_DIALOG_EVENTTYPE t, const char *sender)
@ GWEN_DialogEvent_ResultAccept
@ GWEN_DialogEvent_ResultReject
#define GWEN_WIDGET_FLAGS_FILLY
@ GWEN_DialogSortDirection_None
@ GWEN_DialogSortDirection_Up
@ GWEN_DialogSortDirection_Down
#define GWEN_WIDGET_FLAGS_FILLX
@ GWEN_DialogProperty_AddValue
@ GWEN_DialogProperty_ColumnWidth
@ GWEN_DialogProperty_Title
@ GWEN_DialogProperty_Sort
@ GWEN_DialogProperty_ClearValues
@ GWEN_DialogProperty_SelectionMode
@ GWEN_DialogProperty_SortDirection
@ GWEN_DialogProperty_Enabled
@ GWEN_DialogProperty_Value
@ GWEN_DialogProperty_Focus
@ GWEN_DialogEvent_TypeActivated
@ GWEN_Dialog_SelectionMode_None
@ GWEN_Dialog_SelectionMode_Multi
@ GWEN_Dialog_SelectionMode_Single
#define GWEN_ERROR_INVALID
static GWENHYWFAR_CB int CocoaGui_WListBox_SetIntProperty(GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, int value, int doSignal)
int CocoaGui_WListBox_Setup(GWEN_WIDGET *w)
static GWENHYWFAR_CB const char * CocoaGui_WListBox_GetCharProperty(GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, const char *defaultValue)
static GWENHYWFAR_CB int CocoaGui_WListBox_GetIntProperty(GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, int defaultValue)
static void CocoaGui_WListBox_Changed_handler(NSTableView *tableView, void *data)
static GWENHYWFAR_CB int CocoaGui_WListBox_SetCharProperty(GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, const char *value, int doSignal)