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:
authorBastien Montagne <montagne29@wanadoo.fr>2013-08-29 16:55:31 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2013-08-29 16:55:31 +0400
commit113997a03c9b1ecc7ec6460f24781d54fd9efb57 (patch)
tree27febdc8ef32e37b0519d4a9bd8426c1ef73257d /source/blender/blenkernel/BKE_screen.h
parent034d5a9578714db01cd05629804d1dbef48c1734 (diff)
Last uiList patch (for now!): filtering and reordering of shown elements.
Thanks to Brecht for the reviews. :) This commit adds a show/hide extension below each uiList, containing by default an option to filter and/or reorder items by name (and to reverse those filtering and reordering). Each derived uiList class in Python can define more specific filtering by implementing callbacks: the draw_filter() function to draw options in UI, and the filter_items() function to effectively filter/reorder items. Note: the advanced options for vgroups shown as "proof od concept" in patches do not go in trunk for now, we have to find a better way to get those vgroups info for UI code, we can't afford to loop over each vertex here! And doc (release notes and uiList example) is still to be updated, will do this in next days.
Diffstat (limited to 'source/blender/blenkernel/BKE_screen.h')
-rw-r--r--source/blender/blenkernel/BKE_screen.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/blenkernel/BKE_screen.h b/source/blender/blenkernel/BKE_screen.h
index c883bdf74e0..3c0928d38a0 100644
--- a/source/blender/blenkernel/BKE_screen.h
+++ b/source/blender/blenkernel/BKE_screen.h
@@ -189,9 +189,15 @@ typedef struct PanelType {
/* uilist types */
-/* draw an item in the uiList */
+/* Draw an item in the uiList */
typedef void (*uiListDrawItemFunc)(struct uiList *, struct bContext *, struct uiLayout *, struct PointerRNA *,
- struct PointerRNA *, int, struct PointerRNA *, const char *, int);
+ struct PointerRNA *, int, struct PointerRNA *, const char *, int, int);
+
+/* Draw the filtering part of an uiList */
+typedef void (*uiListDrawFilterFunc)(struct uiList *, struct bContext *, struct uiLayout *);
+
+/* Filter items of an uiList */
+typedef void (*uiListFilterItemsFunc)(struct uiList *, struct bContext *, struct PointerRNA *, const char *);
typedef struct uiListType {
struct uiListType *next, *prev;
@@ -199,6 +205,8 @@ typedef struct uiListType {
char idname[BKE_ST_MAXNAME]; /* unique name */
uiListDrawItemFunc draw_item;
+ uiListDrawFilterFunc draw_filter;
+ uiListFilterItemsFunc filter_items;
/* RNA integration */
ExtensionRNA ext;