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/blenkernel/intern
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/blenkernel/intern')
-rw-r--r--source/blender/blenkernel/intern/library.c21
-rw-r--r--source/blender/blenkernel/intern/screen.c11
2 files changed, 32 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index 5728b844a88..d0e4c1a15bc 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -1102,6 +1102,27 @@ void test_idbutton(char *name)
if(idtest) if( new_id(lb, idtest, name)==0 ) sort_alpha_id(lb, idtest);
}
+void text_idbutton(struct ID *id, char *text)
+{
+ if(id) {
+ if(GS(id->name)==ID_SCE)
+ strcpy(text, "SCE: ");
+ else if(GS(id->name)==ID_SCE)
+ strcpy(text, "SCR: ");
+ else if(GS(id->name)==ID_MA && ((Material*)id)->use_nodes)
+ strcpy(text, "NT: ");
+ else {
+ text[0]= id->name[0];
+ text[1]= id->name[1];
+ text[2]= ':';
+ text[3]= ' ';
+ text[4]= 0;
+ }
+ }
+ else
+ strcpy(text, "");
+}
+
void rename_id(ID *id, char *name)
{
ListBase *lb;
diff --git a/source/blender/blenkernel/intern/screen.c b/source/blender/blenkernel/intern/screen.c
index f43dc287062..e25e4be90c8 100644
--- a/source/blender/blenkernel/intern/screen.c
+++ b/source/blender/blenkernel/intern/screen.c
@@ -54,6 +54,8 @@ static void spacetype_free(SpaceType *st)
{
ARegionType *art;
PanelType *pt;
+ HeaderType *ht;
+ MenuType *mt;
for(art= st->regiontypes.first; art; art= art->next) {
BLI_freelistN(&art->drawcalls);
@@ -62,8 +64,17 @@ static void spacetype_free(SpaceType *st)
if(pt->py_free)
pt->py_free(pt->py_data);
+ for(ht= art->headertypes.first; ht; ht= ht->next)
+ if(ht->py_free)
+ ht->py_free(ht->py_data);
+
+ for(mt= art->menutypes.first; mt; mt= mt->next)
+ if(mt->py_free)
+ mt->py_free(mt->py_data);
+
BLI_freelistN(&art->paneltypes);
BLI_freelistN(&art->headertypes);
+ BLI_freelistN(&art->menutypes);
}
BLI_freelistN(&st->regiontypes);