File: ListSelect.h

package info (click to toggle)
pyfltk 1.3.8%2Brepack-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,868 kB
  • sloc: python: 7,494; cpp: 351; perl: 55; makefile: 24
file content (53 lines) | stat: -rw-r--r-- 1,309 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef MyListSelect_h
#define MyListSelect_h

#include <FL/Fl.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Group.H>
#include <FL/Fl_Multi_Browser.H>
#include <FL/Fl_Pack.H>
#include <FL/Fl_Window.H>

extern void upCB( Fl_Widget *v, void *);
extern void downCB( Fl_Widget *v, void *);
extern void toggleCB( Fl_Widget *v, void *);

class ListSelect : public Fl_Group
{
	public:
		ListSelect(int x, int y, int w, int h, 
			char *topLabel=0, char *bottomLabel=0);

                Fl_Multi_Browser* getTopBrowser() { return &topBrowser;};
                Fl_Multi_Browser* getBottomBrowser() { return &bottomBrowser;};

        protected:
		Fl_Multi_Browser topBrowser;
		Fl_Multi_Browser bottomBrowser;


		virtual void resize(int x, int y, int w, int h);

		//toggles selection state of every item in the browser
		void toggleMultiBrowser(Fl_Multi_Browser &mb);

		//moves selected items from one browser to another	
		void moveSelected(Fl_Multi_Browser &fromB, Fl_Multi_Browser &toB);


		void upButtonCallback(void);
		void downButtonCallback(void);
		void toggleButtonCallback(void);

		friend void upCB( Fl_Widget *v, void *);
		friend void downCB( Fl_Widget *v, void *);
		friend void toggleCB( Fl_Widget *v, void *);

		Fl_Button upButton;
		Fl_Button downButton;
		Fl_Button toggleButton;

};


#endif