2002-03-11 17:00:41 +00:00
|
|
|
// -*- C++ -*-
|
2001-11-05 17:07:23 +00:00
|
|
|
/**
|
|
|
|
* \file DropDown.h
|
|
|
|
* Copyright 2001 the LyX Team
|
|
|
|
* Read the file COPYING
|
|
|
|
*
|
2002-03-11 17:00:41 +00:00
|
|
|
* \author John Levon, moz@compsoc.man.ac.uk
|
2001-11-05 17:07:23 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef DROPDOWN_H
|
|
|
|
#define DROPDOWN_H
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2002-04-23 08:16:27 +00:00
|
|
|
#ifdef __GNUG__
|
2002-03-11 17:00:41 +00:00
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
2002-05-23 12:08:47 +00:00
|
|
|
#include "frontends/LyXView.h"
|
2001-11-05 17:07:23 +00:00
|
|
|
#include "LString.h"
|
2002-05-29 16:21:03 +00:00
|
|
|
|
2001-11-05 17:07:23 +00:00
|
|
|
#include FORMS_H_LOCATION
|
2002-05-29 16:21:03 +00:00
|
|
|
|
|
|
|
#include <boost/signals/signal1.hpp>
|
|
|
|
|
2001-11-05 17:07:23 +00:00
|
|
|
#include <vector>
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2001-11-05 17:07:23 +00:00
|
|
|
class DropDown {
|
|
|
|
public:
|
|
|
|
/// constructor
|
|
|
|
DropDown(LyXView * lv, FL_OBJECT * ob);
|
|
|
|
/// destructor
|
|
|
|
~DropDown();
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2001-11-05 17:07:23 +00:00
|
|
|
/// choose from the list of choices.
|
|
|
|
void select(std::vector<string> const & choices, int x, int y, int w);
|
|
|
|
|
|
|
|
/// user completed action
|
|
|
|
void completed();
|
2002-01-14 12:47:17 +00:00
|
|
|
|
|
|
|
/// a key was pressed. Act on it.
|
|
|
|
void key_pressed(char c);
|
|
|
|
|
2001-11-05 17:07:23 +00:00
|
|
|
/// signal for completion
|
2002-05-29 16:21:03 +00:00
|
|
|
boost::signal1<void, string const &> result;
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2002-01-14 12:47:17 +00:00
|
|
|
/// signal that a key was pressed
|
2002-05-29 16:21:03 +00:00
|
|
|
boost::signal1<void, char> keypress;
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2001-11-05 17:07:23 +00:00
|
|
|
/// X event
|
|
|
|
int peek(XEvent *);
|
|
|
|
|
|
|
|
private:
|
2002-03-21 21:21:28 +00:00
|
|
|
/// move up a browser line
|
2001-11-05 17:07:23 +00:00
|
|
|
void line_up();
|
|
|
|
|
|
|
|
/// move down a browser line
|
|
|
|
void line_down();
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2001-11-05 17:07:23 +00:00
|
|
|
/// owning lyxview
|
|
|
|
LyXView * lv_;
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2001-11-05 17:07:23 +00:00
|
|
|
/// our form
|
|
|
|
FL_FORM * form_;
|
|
|
|
|
|
|
|
/// the browser
|
|
|
|
FL_OBJECT * browser_;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // DROPDOWN_H
|