Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/uvedit/uvedit_buttons.c
| Show First 20 Lines • Show All 152 Lines • ▼ Show 20 Lines | if (sima->flag & SI_COORDFLOATS) { | ||||
| step = 1; | step = 1; | ||||
| digits = 3; | digits = 3; | ||||
| } | } | ||||
| else { | else { | ||||
| step = 100; | step = 100; | ||||
| digits = 2; | digits = 2; | ||||
| } | } | ||||
| uiBlockBeginAlign(block); | UI_block_align_begin(block); | ||||
| uiDefButF(block, NUM, B_UVEDIT_VERTEX, IFACE_("X:"), 0, 0, width, UI_UNIT_Y, &uvedit_old_center[0], | uiDefButF(block, UI_BTYPE_NUM, B_UVEDIT_VERTEX, IFACE_("X:"), 0, 0, width, UI_UNIT_Y, &uvedit_old_center[0], | ||||
| -10 * imx, 10.0 * imx, step, digits, ""); | -10 * imx, 10.0 * imx, step, digits, ""); | ||||
| uiDefButF(block, NUM, B_UVEDIT_VERTEX, IFACE_("Y:"), width, 0, width, UI_UNIT_Y, &uvedit_old_center[1], | uiDefButF(block, UI_BTYPE_NUM, B_UVEDIT_VERTEX, IFACE_("Y:"), width, 0, width, UI_UNIT_Y, &uvedit_old_center[1], | ||||
| -10 * imy, 10.0 * imy, step, digits, ""); | -10 * imy, 10.0 * imy, step, digits, ""); | ||||
| uiBlockEndAlign(block); | UI_block_align_end(block); | ||||
| } | } | ||||
| } | } | ||||
| static void do_uvedit_vertex(bContext *C, void *UNUSED(arg), int event) | static void do_uvedit_vertex(bContext *C, void *UNUSED(arg), int event) | ||||
| { | { | ||||
| SpaceImage *sima = CTX_wm_space_image(C); | SpaceImage *sima = CTX_wm_space_image(C); | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| Object *obedit = CTX_data_edit_object(C); | Object *obedit = CTX_data_edit_object(C); | ||||
| Show All 32 Lines | static int image_panel_uv_poll(const bContext *C, PanelType *UNUSED(pt)) | ||||
| return ED_uvedit_test(obedit); | return ED_uvedit_test(obedit); | ||||
| } | } | ||||
| static void image_panel_uv(const bContext *C, Panel *pa) | static void image_panel_uv(const bContext *C, Panel *pa) | ||||
| { | { | ||||
| uiBlock *block; | uiBlock *block; | ||||
| block = uiLayoutAbsoluteBlock(pa->layout); | block = uiLayoutAbsoluteBlock(pa->layout); | ||||
| uiBlockSetHandleFunc(block, do_uvedit_vertex, NULL); | UI_block_func_handle_set(block, do_uvedit_vertex, NULL); | ||||
| uvedit_vertex_buttons(C, block); | uvedit_vertex_buttons(C, block); | ||||
| } | } | ||||
| void ED_uvedit_buttons_register(ARegionType *art) | void ED_uvedit_buttons_register(ARegionType *art) | ||||
| { | { | ||||
| PanelType *pt; | PanelType *pt; | ||||
| pt = MEM_callocN(sizeof(PanelType), "spacetype image panel uv"); | pt = MEM_callocN(sizeof(PanelType), "spacetype image panel uv"); | ||||
| strcpy(pt->idname, "IMAGE_PT_uv"); | strcpy(pt->idname, "IMAGE_PT_uv"); | ||||
| strcpy(pt->label, N_("UV Vertex")); /* XXX C panels are not available through RNA (bpy.types)! */ | strcpy(pt->label, N_("UV Vertex")); /* XXX C panels are not available through RNA (bpy.types)! */ | ||||
| pt->draw = image_panel_uv; | pt->draw = image_panel_uv; | ||||
| pt->poll = image_panel_uv_poll; | pt->poll = image_panel_uv_poll; | ||||
| BLI_addtail(&art->paneltypes, pt); | BLI_addtail(&art->paneltypes, pt); | ||||
| } | } | ||||