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