r877: Fix files that were missing from a make dist tarball.
[cinelerra_cv.git] / guicast / bclistboxitem.h
blob3aabde5d1577d361be3a204535574da51455fda2
1 #ifndef BCLISTBOXITEM_H
2 #define BCLISTBOXITEM_H
4 #include "arraylist.h"
5 #include "bcpixmap.inc"
6 #include "colors.h"
7 #include "vframe.h"
11 // Every item in a list inherits this
12 class BC_ListBoxItem
14 public:
15 BC_ListBoxItem();
16 // New items
17 BC_ListBoxItem(char *text,
18 int color = -1);
19 BC_ListBoxItem(char *text,
20 BC_Pixmap *icon,
21 int color = -1);
25 // autoplace is always 1 in initialization.
26 // Positions set with the set_ commands cancel autoplacement.
27 // Final positions are calculated in the next draw_items.
29 virtual ~BC_ListBoxItem();
31 friend class BC_ListBox;
33 BC_ListBoxItem& operator=(BC_ListBoxItem& item);
34 void copy_from(BC_ListBoxItem *item);
35 void set_text(char *new_text);
36 char* get_text();
37 void set_icon(BC_Pixmap *icon);
38 void set_icon_vframe(VFrame *icon_vframe);
39 int get_icon_x();
40 int get_icon_y();
41 int get_text_x();
42 int get_text_y();
43 void set_icon_x(int x);
44 void set_icon_y(int y);
45 void set_text_x(int x);
46 void set_text_y(int y);
47 void set_color(int color);
48 void set_searchable(int value);
49 int get_color();
50 void set_selected(int value);
51 int set_autoplace_icon(int value);
52 int set_autoplace_text(int value);
53 void set_selectable(int value);
54 int get_selectable();
56 // The item with the sublist must be in column 0. Only this is searched by
57 // BC_ListBox.
58 // Mind you, sublists are ignored in icon mode.
59 ArrayList<BC_ListBoxItem*>* new_sublist(int columns);
60 ArrayList<BC_ListBoxItem*>* get_sublist();
61 // Return the number of columns in the sublist
62 int get_columns();
63 // Return if it's expanded
64 int get_expand();
65 void set_expand(int value);
67 private:
68 int initialize();
69 int get_icon_w();
70 int get_icon_h();
73 BC_Pixmap *icon;
74 VFrame *icon_vframe;
75 // x and y position in listbox relative to top left
76 // Different positions for icon mode and text mode are maintained
77 int icon_x, icon_y;
78 int text_x, text_y;
79 // If autoplacement should be performed in the next draw
80 int autoplace_icon, autoplace_text;
81 char *text;
82 int color;
83 // 1 - currently selected
84 // 2 - previously selected and now adding selections with shift
85 int selected;
86 // Allow this item to be included in queries. Directories are not
87 // included in queries.
88 int searchable;
90 // Array of one list of pointers for each column for a sublist.
91 // It's an array so we can pass the sublist directly to another listbox.
92 ArrayList<BC_ListBoxItem*> *sublist;
93 // Columns in sublist
94 int columns;
95 // Sublist is visible
96 int expand;
97 // Item is selectable
98 int selectable;
103 #endif