Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #import "CocoaVLineView.h"
00011
00012
00013 static GWENHYWFAR_CB
00014 int CocoaGui_WVLine_SetIntProperty(GWEN_WIDGET *w,
00015 GWEN_DIALOG_PROPERTY prop,
00016 int index,
00017 int value,
00018 int doSignal) {
00019 CocoaVLineView *vLineView;
00020
00021 vLineView=(CocoaVLineView*)(GWEN_Widget_GetImplData(w, COCOA_DIALOG_WIDGET_REAL));
00022 assert(vLineView);
00023
00024 switch(prop) {
00025 case GWEN_DialogProperty_Enabled:
00026
00027 return 0;
00028
00029 case GWEN_DialogProperty_Focus:
00030
00031 return 0;
00032
00033 default:
00034 break;
00035 }
00036
00037 DBG_WARN(GWEN_LOGDOMAIN,
00038 "Function is not appropriate for this type of widget (%s)",
00039 GWEN_Widget_Type_toString(GWEN_Widget_GetType(w)));
00040 return GWEN_ERROR_INVALID;
00041
00042 }
00043
00044
00045
00046
00047 static GWENHYWFAR_CB
00048 int CocoaGui_WVLine_GetIntProperty(GWEN_WIDGET *w,
00049 GWEN_DIALOG_PROPERTY prop,
00050 int index,
00051 int defaultValue) {
00052 CocoaVLineView *vLineView;
00053
00054 vLineView=(CocoaVLineView*)(GWEN_Widget_GetImplData(w, COCOA_DIALOG_WIDGET_REAL));
00055 assert(vLineView);
00056
00057
00058 switch(prop) {
00059 case GWEN_DialogProperty_Enabled:
00060
00061 return 0;
00062
00063 case GWEN_DialogProperty_Focus:
00064
00065 return 0;
00066
00067 default:
00068 break;
00069 }
00070
00071
00072 DBG_WARN(GWEN_LOGDOMAIN,
00073 "Function is not appropriate for this type of widget (%s)",
00074 GWEN_Widget_Type_toString(GWEN_Widget_GetType(w)));
00075 return defaultValue;
00076 }
00077
00078
00079
00080 int CocoaGui_WVLine_Setup(GWEN_WIDGET *w) {
00081 CocoaVLineView *vLineView;
00082 uint32_t flags;
00083 GWEN_WIDGET *wParent;
00084
00085 flags=GWEN_Widget_GetFlags(w);
00086 wParent=GWEN_Widget_Tree_GetParent(w);
00087
00088 vLineView = [[[CocoaVLineView alloc] initWithFrame:NSMakeRect(0.0, 0.0, 100.0, 5.0)] autorelease];
00089 if (flags & GWEN_WIDGET_FLAGS_FILLX) vLineView.fillX = YES;
00090 if (flags & GWEN_WIDGET_FLAGS_FILLY) vLineView.fillY = YES;
00091
00092
00093 GWEN_Widget_SetImplData(w, COCOA_DIALOG_WIDGET_REAL, (void*) vLineView);
00094 GWEN_Widget_SetImplData(w, COCOA_DIALOG_WIDGET_CONTENT, (void*) vLineView);
00095
00096 GWEN_Widget_SetSetIntPropertyFn(w, CocoaGui_WHLine_SetIntProperty);
00097 GWEN_Widget_SetGetIntPropertyFn(w, CocoaGui_WHLine_GetIntProperty);
00098
00099 if (wParent)
00100 GWEN_Widget_AddChildGuiWidget(wParent, w);
00101
00102 return 0;
00103 }
00104
00105