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:
authorCampbell Barton <ideasman42@gmail.com>2010-08-26 05:05:37 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-08-26 05:05:37 +0400
commite7c4a0d53b950e5be77528efad907def59d18a8f (patch)
treed9976137e57ea5f25e1e7f87eb951888241288c0 /source/blender/makesrna/intern/rna_ui.c
parentda2a2005c7542b364057824c459ae0bc5d0af289 (diff)
rna api - replace panel properties bl_default_closed and bl_show_header with bl_options which has 2 flags: 'DEFAULT_CLOSED' and 'HIDE_HEADER'.
this matches operators which also uses bl_options like this
Diffstat (limited to 'source/blender/makesrna/intern/rna_ui.c')
-rw-r--r--source/blender/makesrna/intern/rna_ui.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c
index a659ff7c260..f2c33f354c2 100644
--- a/source/blender/makesrna/intern/rna_ui.c
+++ b/source/blender/makesrna/intern/rna_ui.c
@@ -583,6 +583,11 @@ static void rna_def_panel(BlenderRNA *brna)
PropertyRNA *parm;
FunctionRNA *func;
+ static EnumPropertyItem panel_flag_items[] = {
+ {PNL_DEFAULT_CLOSED, "DEFAULT_CLOSED", 0, "Default Closed", "Defines if the panel has to be open or collapsed at the time of its creation."},
+ {PNL_NO_HEADER, "HIDE_HEADER", 0, "Show Header", "If set to True, the panel shows a header, which contains a clickable arrow to collapse the panel and the label (see bl_label)."},
+ {0, NULL, 0, NULL, NULL}};
+
srna= RNA_def_struct(brna, "Panel", NULL);
RNA_def_struct_ui_text(srna, "Panel", "Panel containing UI elements");
RNA_def_struct_sdna(srna, "Panel");
@@ -646,15 +651,11 @@ static void rna_def_panel(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); /* should this be optional? - Campbell */
RNA_def_property_ui_text(prop, "Context", "The context in which the panel belongs to. (TODO: explain the possible combinations bl_context/bl_region_type/bl_space_type)");
- prop= RNA_def_property(srna, "bl_default_closed", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "type->flag", PNL_DEFAULT_CLOSED);
- RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
- RNA_def_property_ui_text(prop, "Default closed", "Defines if the panel has to be open or collapsed at the time of its creation. Note that once the panel has been created with bl_default_closed = True, at reload (F8) it stays open.");
-
- prop= RNA_def_property(srna, "bl_show_header", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_negative_sdna(prop, NULL, "type->flag", PNL_NO_HEADER);
- RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
- RNA_def_property_ui_text(prop, "Show Header", "If set to True, the panel shows a header, which contains a clickable arrow to collapse the panel and the label (see bl_label).");
+ prop= RNA_def_property(srna, "bl_options", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "type->flag");
+ RNA_def_property_enum_items(prop, panel_flag_items);
+ RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL|PROP_ENUM_FLAG);
+ RNA_def_property_ui_text(prop, "Options", "Options for this panel type");
}
static void rna_def_header(BlenderRNA *brna)