]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/DropDown.h
John's completion stuff
[lyx.git] / src / frontends / xforms / DropDown.h
1 /**
2  * \file DropDown.h
3  * Copyright 2001 the LyX Team
4  * Read the file COPYING
5  *
6  * \author John Levon <moz@compsoc.man.ac.uk>
7  */
8
9 #ifndef DROPDOWN_H
10 #define DROPDOWN_H
11  
12 #include <config.h>
13  
14 #include "LyXView.h"
15 #include <sigc++/signal_system.h> 
16 #include "LString.h"
17 #include FORMS_H_LOCATION
18 #include <vector>
19  
20 class DropDown {
21 public:
22         /// constructor
23         DropDown(LyXView * lv, FL_OBJECT * ob);
24         /// destructor
25         ~DropDown();
26  
27         /// choose from the list of choices.
28         void select(std::vector<string> const & choices, int x, int y, int w);
29
30         /// user completed action
31         void completed();
32  
33         /// signal for completion
34         SigC::Signal1<void, string const &> result;
35          
36         /// X event
37         int peek(XEvent *);
38
39 private:
40         /// move up a browser line 
41         void line_up();
42
43         /// move down a browser line
44         void line_down();
45  
46         /// owning lyxview
47         LyXView * lv_;
48  
49         /// our form
50         FL_FORM * form_;
51
52         /// the browser
53         FL_OBJECT * browser_;
54 };
55
56 #endif // DROPDOWN_H