Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface.c
| Show First 20 Lines • Show All 3,106 Lines • ▼ Show 20 Lines | if (!ot) { | ||||
| but->flag |= UI_BUT_DISABLED; | but->flag |= UI_BUT_DISABLED; | ||||
| but->lock = TRUE; | but->lock = TRUE; | ||||
| but->lockstr = ""; | but->lockstr = ""; | ||||
| } | } | ||||
| return but; | return but; | ||||
| } | } | ||||
| #if 0 /* UNUSED */ | |||||
| static uiBut *UNUSED_FUNCTION(ui_def_but_operator) (uiBlock *block, int type, const char *opname, int opcontext, const char *str, int x, int y, short width, short height, const char *tip) | |||||
| { | |||||
| wmOperatorType *ot = WM_operatortype_find(opname, 0); | |||||
| if (str == NULL && ot == NULL) str = opname; | |||||
| return ui_def_but_operator_ptr(block, type, ot, opcontext, str, x, y, width, height, tip); | |||||
| } | |||||
| #endif | |||||
| static uiBut *ui_def_but_operator_text(uiBlock *block, int type, const char *opname, int opcontext, const char *str, int x, int y, short width, short height, void *poin, float min, float max, float a1, float a2, const char *tip) | |||||
| { | |||||
| uiBut *but; | |||||
| wmOperatorType *ot; | |||||
| ot = WM_operatortype_find(opname, 0); | |||||
| if (!str) { | |||||
| if (ot) str = ot->name; | |||||
| else str = opname; | |||||
| } | |||||
| if ((!tip || tip[0] == '\0') && ot && ot->description) { | |||||
| tip = ot->description; | |||||
| } | |||||
| but = ui_def_but(block, type, -1, str, x, y, width, height, poin, min, max, a1, a2, tip); | |||||
| but->optype = ot; | |||||
| but->opcontext = opcontext; | |||||
| but->flag &= ~UI_BUT_UNDO; /* no need for ui_is_but_rna_undo(), we never need undo here */ | |||||
| if (!ot) { | |||||
| but->flag |= UI_BUT_DISABLED; | |||||
| but->lock = TRUE; | |||||
| but->lockstr = ""; | |||||
| } | |||||
| return but; | |||||
| } | |||||
| uiBut *uiDefBut(uiBlock *block, int type, int retval, const char *str, int x, int y, short width, short height, void *poin, float min, float max, float a1, float a2, const char *tip) | uiBut *uiDefBut(uiBlock *block, int type, int retval, const char *str, int x, int y, short width, short height, void *poin, float min, float max, float a1, float a2, const char *tip) | ||||
| { | { | ||||
| uiBut *but = ui_def_but(block, type, retval, str, x, y, width, height, poin, min, max, a1, a2, tip); | uiBut *but = ui_def_but(block, type, retval, str, x, y, width, height, poin, min, max, a1, a2, tip); | ||||
| ui_check_but(but); | ui_check_but(but); | ||||
| return but; | return but; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 175 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| uiBut *uiDefButO(uiBlock *block, int type, const char *opname, int opcontext, const char *str, int x, int y, short width, short height, const char *tip) | uiBut *uiDefButO(uiBlock *block, int type, const char *opname, int opcontext, const char *str, int x, int y, short width, short height, const char *tip) | ||||
| { | { | ||||
| wmOperatorType *ot = WM_operatortype_find(opname, 0); | wmOperatorType *ot = WM_operatortype_find(opname, 0); | ||||
| if (str == NULL && ot == NULL) str = opname; | if (str == NULL && ot == NULL) str = opname; | ||||
| return uiDefButO_ptr(block, type, ot, opcontext, str, x, y, width, height, tip); | return uiDefButO_ptr(block, type, ot, opcontext, str, x, y, width, height, tip); | ||||
| } | } | ||||
| uiBut *uiDefButTextO(uiBlock *block, int type, const char *opname, int opcontext, const char *str, int x, int y, short width, short height, void *poin, float min, float max, float a1, float a2, const char *tip) | |||||
| { | |||||
| uiBut *but = ui_def_but_operator_text(block, type, opname, opcontext, str, x, y, width, height, poin, min, max, a1, a2, tip); | |||||
| ui_check_but(but); | |||||
| return but; | |||||
| } | |||||
| /* if a1==1.0 then a2 is an extra icon blending factor (alpha 0.0 - 1.0) */ | /* if a1==1.0 then a2 is an extra icon blending factor (alpha 0.0 - 1.0) */ | ||||
| uiBut *uiDefIconBut(uiBlock *block, int type, int retval, int icon, int x, int y, short width, short height, void *poin, float min, float max, float a1, float a2, const char *tip) | uiBut *uiDefIconBut(uiBlock *block, int type, int retval, int icon, int x, int y, short width, short height, void *poin, float min, float max, float a1, float a2, const char *tip) | ||||
| { | { | ||||
| uiBut *but = ui_def_but(block, type, retval, "", x, y, width, height, poin, min, max, a1, a2, tip); | uiBut *but = ui_def_but(block, type, retval, "", x, y, width, height, poin, min, max, a1, a2, tip); | ||||
| ui_check_but_and_iconize(but, icon); | ui_check_but_and_iconize(but, icon); | ||||
| return but; | return but; | ||||
| } | } | ||||
| static uiBut *uiDefIconButBit(uiBlock *block, int type, int bit, int retval, int icon, int x, int y, short width, short height, void *poin, float min, float max, float a1, float a2, const char *tip) | static uiBut *uiDefIconButBit(uiBlock *block, int type, int bit, int retval, int icon, int x, int y, short width, short height, void *poin, float min, float max, float a1, float a2, const char *tip) | ||||
| ▲ Show 20 Lines • Show All 853 Lines • Show Last 20 Lines | |||||