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