Changeset View
Standalone View
source/blender/makesrna/intern/rna_space.c
| Context not available. | |||||
| WM_main_add_notifier(NC_TEXT | NA_EDITED, st->text); | WM_main_add_notifier(NC_TEXT | NA_EDITED, st->text); | ||||
| } | } | ||||
| static void rna_SpaceTextEditor_cursor_position_get(PointerRNA *ptr, int *values) | |||||
| { | |||||
| SpaceText *st = (SpaceText *)ptr->data; | |||||
| if (st) { | |||||
| copy_v2_v2_int(values, st->text_cursor_pos); | |||||
| } | |||||
Severin: Could be copy_v2_v2_int | |||||
Not Done Inline Actionsjust finding the first text space is really arbitrary, its even possible st and ar are unrelated. See how text_scroll_to_cursor__area gets the region from the ScrArea campbellbarton: just finding the first text space is really arbitrary, its even possible `st` and `ar` are… | |||||
| } | |||||
mont29Unsubmitted Not Done Inline ActionsSee comment below (and needless blank lines again). mont29: See comment below (and needless blank lines again). | |||||
| /* Space Properties */ | /* Space Properties */ | ||||
| Context not available. | |||||
| RNA_def_property_string_sdna(prop, NULL, "replacestr"); | RNA_def_property_string_sdna(prop, NULL, "replacestr"); | ||||
| RNA_def_property_ui_text(prop, "Replace Text", "Text to replace selected text with using the replace tool"); | RNA_def_property_ui_text(prop, "Replace Text", "Text to replace selected text with using the replace tool"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TEXT, NULL); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TEXT, NULL); | ||||
| prop = RNA_def_property(srna, "cursor_position", PROP_INT, PROP_NONE); | |||||
| RNA_def_property_array(prop, 2); | |||||
| RNA_def_property_int_sdna(prop, NULL, "text_cursor_pos"); | |||||
| RNA_def_property_int_funcs(prop, "rna_SpaceTextEditor_cursor_position_get", | |||||
| NULL, NULL); | |||||
mont29Unsubmitted Not Done Inline ActionsThis is not what you want to do I think, you want to make this prop read-only, right? Defining a getter func and setting setter to NULL will not make the prop read-only! You do not need the getter at all here, and should rather define the prop as readonly (i.e. replace RNA_def_property_int_funcs by RNA_def_property_clear_flag(prop, PROP_EDITABLE);). mont29: This is not what you want to do I think, you want to make this prop read-only, right? Defining… | |||||
| RNA_def_property_ui_text(prop, "Text Cursor Position", "Text cursor position for this view"); | |||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TEXT, NULL); | |||||
mont29Unsubmitted Not Done Inline ActionsAdd in 'tip' a reference about the unit (pixel)? And no need to define an update for this prop, if it's read-only… mont29: Add in 'tip' a reference about the unit (pixel)? And no need to define an update for this prop… | |||||
mont29Unsubmitted Not Done Inline ActionsGrrrrr… xD mont29: Grrrrr… xD | |||||
| } | } | ||||
| static void rna_def_space_dopesheet(BlenderRNA *brna) | static void rna_def_space_dopesheet(BlenderRNA *brna) | ||||
| Context not available. | |||||
Not Done Inline ActionsSuggest to make this a function rather then a property. then the function can do any checks it needs to at the time its run. campbellbarton: Suggest to make this a function rather then a property. then the function can do any checks it… | |||||
Could be copy_v2_v2_int