]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/DropDown.h
Yet more dialog tweaking from Rob.
[lyx.git] / src / frontends / xforms / DropDown.h
1 // -*- C++ -*-
2 /**
3  * \file DropDown.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author John Levon
8  *
9  * Full author contact details are available in file CREDITS
10  */
11
12 #ifndef DROPDOWN_H
13 #define DROPDOWN_H
14
15 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include "forms_fwd.h"
20 #include <X11/Xlib.h>
21
22 #include <boost/signals/signal1.hpp>
23
24 #include "LString.h"
25 #include <vector>
26
27 class DropDown {
28 public:
29         /// constructor
30         DropDown(FL_OBJECT * ob);
31         /// destructor
32         ~DropDown();
33
34         /// choose from the list of choices.
35         void select(std::vector<string> const & choices, int x, int y, int w);
36
37         /// user completed action
38         void completed();
39
40         /// a key was pressed. Act on it.
41         void key_pressed(char c);
42
43         /// signal for completion
44         boost::signal1<void, string const &> result;
45
46         /// signal that a key was pressed
47         boost::signal1<void, char> keypress;
48
49         /// X event
50         int peek(XEvent *);
51
52 private:
53         /// move up a browser line
54         void line_up();
55
56         /// move down a browser line
57         void line_down();
58
59         /// our form
60         FL_FORM * form_;
61
62         /// the browser
63         FL_OBJECT * browser_;
64 };
65
66 #endif // DROPDOWN_H