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-03-13 16:38:41 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-03-13 16:38:41 +0300
commit4c3d64116e2c74315afea7b005ffaf320178337f (patch)
tree86d6db3a35fd5847387c2970ba0d160d9f92b0a7 /source/blender/makesrna/intern/rna_text.c
parenta4793a3b4ac298a651f7bab0bafd809287647509 (diff)
2.5: UI Layout Engine, initial code.
* As a test, used by: * Object buttons, tried to make it match the mockup. * Text window header. * Text window properties panel. * Panel interaction with view2d is still problematic, need to make this work properly still. * Templates are very basic, the ones there are simple but already can follow the object buttons mockup quite closely. * It's based on a three level system: panels, templates and items. To get an idea of what that means in practice, see: http://wiki.blender.org/index.php/BlenderDev/Blender2.5/UI_LayoutEngine#Panels.2C_Templates_and_Items
Diffstat (limited to 'source/blender/makesrna/intern/rna_text.c')
-rw-r--r--source/blender/makesrna/intern/rna_text.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/source/blender/makesrna/intern/rna_text.c b/source/blender/makesrna/intern/rna_text.c
index 80b9e56eff5..020ba635e4a 100644
--- a/source/blender/makesrna/intern/rna_text.c
+++ b/source/blender/makesrna/intern/rna_text.c
@@ -36,6 +36,8 @@
#include "DNA_text_types.h"
+#include "WM_types.h"
+
#ifdef RNA_RUNTIME
static void rna_Text_filename_get(PointerRNA *ptr, char *value)
@@ -83,7 +85,6 @@ static int rna_TextLine_line_length(PointerRNA *ptr)
return line->len;
}
-#if 0
static void rna_TextLine_line_set(PointerRNA *ptr, const char *value)
{
TextLine *line= (TextLine*)ptr->data;
@@ -91,16 +92,14 @@ static void rna_TextLine_line_set(PointerRNA *ptr, const char *value)
if(line->line)
MEM_freeN(line->line);
- if(strlen(value)) {
- line->line= BLI_strdup(value);
- line->len= strlen(line->line);
- }
- else {
- line->line= NULL;
- line->len= 0;
+ line->line= BLI_strdup(value);
+ line->len= strlen(line->line);
+
+ if(line->format) {
+ MEM_freeN(line->format);
+ line->format= NULL;
}
}
-#endif
#else
@@ -113,9 +112,9 @@ static void rna_def_text_line(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Text Line", "Line of text in a Text datablock.");
prop= RNA_def_property(srna, "line", PROP_STRING, PROP_NONE);
- RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
RNA_def_property_string_funcs(prop, "rna_TextLine_line_get", "rna_TextLine_line_length", "rna_TextLine_line_set");
RNA_def_property_ui_text(prop, "Line", "Text in the line.");
+ RNA_def_property_update(prop, NC_TEXT|NA_EDITED, NULL);
}
static void rna_def_text_marker(BlenderRNA *brna)