Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-04-22 22:39:44 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-04-22 22:39:44 +0400
commitaf02a0aa4e0b80c3c1154e7be095f4a387f81179 (patch)
tree3f714e683c96929cc4e44962570860ab0f635bc9 /source/blender/editors/curve
parent643d59bb9bf3bdd46f41a0b8c79384146629f9c8 (diff)
UI
* Headers and menus can now be created in python. * Replaced the uiMenuItem functions to create menus with equivalent uiItem functions using a layout, removing duplicated code. * More uiItem functions are now exposed to python. * The text editor header, panels and one of its menus are now created in space_text.py. * Buttons window data context icon new changes depending on active object. Issues * Icons are not wrapped yet, hardcoded ints at the moment. * The ID browse template is unfinished.
Diffstat (limited to 'source/blender/editors/curve')
-rw-r--r--source/blender/editors/curve/curve_ops.c22
-rw-r--r--source/blender/editors/curve/editcurve.c29
2 files changed, 29 insertions, 22 deletions
diff --git a/source/blender/editors/curve/curve_ops.c b/source/blender/editors/curve/curve_ops.c
index c27c498f55e..49d86d08db2 100644
--- a/source/blender/editors/curve/curve_ops.c
+++ b/source/blender/editors/curve/curve_ops.c
@@ -67,16 +67,18 @@
static int specials_menu_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- uiMenuItem *head;
-
- head= uiPupMenuBegin("Specials", 0);
- uiMenuItemO(head, 0, "CURVE_OT_subdivide");
- uiMenuItemO(head, 0, "CURVE_OT_switch_direction");
- uiMenuItemO(head, 0, "CURVE_OT_spline_weight_set");
- uiMenuItemO(head, 0, "CURVE_OT_radius_set");
- uiMenuItemO(head, 0, "CURVE_OT_smooth");
- uiMenuItemO(head, 0, "CURVE_OT_smooth_radius");
- uiPupMenuEnd(C, head);
+ uiPopupMenu *pup;
+ uiLayout *layout;
+
+ pup= uiPupMenuBegin("Specials", 0);
+ layout= uiPupMenuLayout(pup);
+ uiItemO(layout, NULL, 0, "CURVE_OT_subdivide");
+ uiItemO(layout, NULL, 0, "CURVE_OT_switch_direction");
+ uiItemO(layout, NULL, 0, "CURVE_OT_spline_weight_set");
+ uiItemO(layout, NULL, 0, "CURVE_OT_radius_set");
+ uiItemO(layout, NULL, 0, "CURVE_OT_smooth");
+ uiItemO(layout, NULL, 0, "CURVE_OT_smooth_radius");
+ uiPupMenuEnd(C, pup);
return OPERATOR_CANCELLED;
}
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index 72806a79c50..78b86ad7f32 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -3562,15 +3562,17 @@ static int toggle_cyclic_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
Object *obedit= CTX_data_edit_object(C);
ListBase *editnurb= curve_get_editcurve(obedit);
- uiMenuItem *head;
+ uiPopupMenu *pup;
+ uiLayout *layout;
Nurb *nu;
for(nu= editnurb->first; nu; nu= nu->next) {
if(nu->pntsu>1 || nu->pntsv>1) {
if(nu->type==CU_NURBS) {
- head= uiPupMenuBegin("Direction", 0);
- uiMenuItemsEnumO(head, op->type->idname, "direction");
- uiPupMenuEnd(C, head);
+ pup= uiPupMenuBegin("Direction", 0);
+ layout= uiPupMenuLayout(pup);
+ uiItemsEnumO(layout, op->type->idname, "direction");
+ uiPupMenuEnd(C, pup);
return OPERATOR_CANCELLED;
}
}
@@ -4507,18 +4509,21 @@ static int delete_exec(bContext *C, wmOperator *op)
static int delete_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
Object *obedit= CTX_data_edit_object(C);
- uiMenuItem *head;
+ uiPopupMenu *pup;
+ uiLayout *layout;
if(obedit->type==OB_SURF) {
- head= uiPupMenuBegin("Delete", 0);
- uiMenuItemEnumO(head, "", 0, op->type->idname, "type", 0);
- uiMenuItemEnumO(head, "", 0, op->type->idname, "type", 2);
- uiPupMenuEnd(C, head);
+ pup= uiPupMenuBegin("Delete", 0);
+ layout= uiPupMenuLayout(pup);
+ uiItemEnumO(layout, NULL, 0, op->type->idname, "type", 0);
+ uiItemEnumO(layout, NULL, 0, op->type->idname, "type", 2);
+ uiPupMenuEnd(C, pup);
}
else {
- head= uiPupMenuBegin("Delete", 0);
- uiMenuItemsEnumO(head, op->type->idname, "type");
- uiPupMenuEnd(C, head);
+ pup= uiPupMenuBegin("Delete", 0);
+ layout= uiPupMenuLayout(pup);
+ uiItemsEnumO(layout, op->type->idname, "type");
+ uiPupMenuEnd(C, pup);
}
return OPERATOR_CANCELLED;