CEBL  2.1
StatusBar.hpp
Go to the documentation of this file.
1 /*
2 * CEBL : CSU EEG Brain-Computer Interface Lab
3 *
4 * Author: Jeshua Bratman - jeshuabratman@gmail.com
5 *
6 * This file is part of CEBL.
7 *
8 * CEBL is free software; you can redistribute it and/or modify it.
9 * We only ask that if you use our code that you cite the source in
10 * your project or publication.
11 *
12 * EEG Group (www.cs.colostate.edu/eeg)
13 * Department of Computer Science
14 * Colorado State University
15 *
16 */
17 
24 #ifndef STATUSBAR_H
25 #define STATUSBAR_H
26 
27 #include "CEBLGtkWidget.hpp"
28 #include <string>
29 #include <stack>
30 
31 using namespace std;
32 
34 class StatusID
35 {
36 public:
37 
40 
42  {
43  context_id = -1;
44  message_id = -1;
45  }
46 
47 
48 };
49 
50 class StatusBar : public CEBLGtkWidget
51 {
52 private:
53  //The status bar
54  GtkWidget* status_bar;
55  //Stack of message IDs
56  stack<StatusID> id_stack;
57  //Flag set when volatile message is pushed
58  bool volatile_msg;
59  //Flag set when timed message is pushed
60  bool timed_msg;
61 
62  //used by pushTimed to pop a timed message from the stack
63  static gint timedPop(gpointer);
64 
65 public:
66  StatusBar();
67  ~StatusBar();
68 
70  void remove(StatusID &id);
71 
73  void pop();
74 
76  StatusID push(string message);
77 
79  StatusID pushVolatile(string message);
80 
82  StatusID pushTimed(string message,int ms=2000);
83 
84 };
85 
86 #endif
87 
88