]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/DropDown.h
8baccbe4798500aa2c6a46531658cd74f3d88469
[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 "LyXView.h"
13 #include <sigc++/signal_system.h> 
14 #include "LString.h"
15 #include FORMS_H_LOCATION
16 #include <vector>
17  
18 class DropDown {
19 public:
20         /// constructor
21         DropDown(LyXView * lv, FL_OBJECT * ob);
22         /// destructor
23         ~DropDown();
24  
25         /// choose from the list of choices.
26         void select(std::vector<string> const & choices, int x, int y, int w);
27
28         /// user completed action
29         void completed();
30
31         /// a key was pressed. Act on it.
32         void key_pressed(char c);
33
34         /// signal for completion
35         SigC::Signal1<void, string const &> result;
36          
37         /// signal that a key was pressed
38         SigC::Signal1<void, char> keypress;
39          
40         /// X event
41         int peek(XEvent *);
42
43 private:
44         /// move up a browser line 
45         void line_up();
46
47         /// move down a browser line
48         void line_down();
49  
50         /// owning lyxview
51         LyXView * lv_;
52  
53         /// our form
54         FL_FORM * form_;
55
56         /// the browser
57         FL_OBJECT * browser_;
58 };
59
60 #endif // DROPDOWN_H