public static void view3d_toolbar_register(ARegionType art) { PanelType pt; pt = new PanelType(); StringUtil.strcpy(pt.idname, 0, StringUtil.toCString("VIEW3D_PT_tool_shelf"), 0); StringUtil.strcpy(pt.label, 0, StringUtil.toCString("Tool Shelf"), 0); pt.draw = view3d_panel_tool_shelf; ListBaseUtil.BLI_addtail(art.paneltypes, pt); }
public static void view3d_tool_props_register(ARegionType art) { PanelType pt; pt = new PanelType(); StringUtil.strcpy(pt.idname, 0, StringUtil.toCString("VIEW3D_PT_last_operator"), 0); StringUtil.strcpy(pt.label, 0, StringUtil.toCString("Last Operator"), 0); pt.draw = view3d_panel_operator_redo; ListBaseUtil.BLI_addtail(art.paneltypes, pt); }
public void run(bContext C, Panel pa) // static void view3d_panel_tool_shelf(const bContext *C, Panel *pa) { SpaceLink sl = bContext.CTX_wm_space_data(C); SpaceType st = null; uiLayout col; byte[] context = StringUtil.toCString(view3d_context_string(C)); if (sl != null) st = ScreenUtil.BKE_spacetype_from_id(sl.spacetype); if (st != null && st.toolshelf.first != null) { CustomTool ct; for (ct = (CustomTool) st.toolshelf.first; ct != null; ct = ct.next) { if (0 == StringUtil.strncmp( context, 0, ct.context, 0, WindowManagerTypes.OP_MAX_TYPENAME)) { col = UILayout.uiLayoutColumn((uiLayout) pa.layout, 1); UILayout.uiItemFullO( col, StringUtil.toJString(ct.opname, 0), null, 0, null, WmTypes.WM_OP_INVOKE_REGION_WIN, 0); } } } col = UILayout.uiLayoutColumn((uiLayout) pa.layout, 1); final SpaceType stf = st; Pointer<ListBase> st_toolshelf = new Pointer<ListBase>() { public ListBase get() { return stf.toolshelf; } public void set(ListBase obj) { throw new UnsupportedOperationException("Not supported yet."); } }; UI.uiDefBlockBut( UILayout.uiLayoutGetBlock((uiLayout) pa.layout), tool_search_menu, st_toolshelf, "Add Tool", 0, 0, UI.UI_UNIT_X, UI.UI_UNIT_Y, "Add Tool in shelf, gets saved in files"); }