ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/cf.schmorp.de/dclient/include/ndk/button.hh
Revision: 1.1
Committed: Sun Oct 24 20:31:42 2010 UTC (16 years ago) by sf-pippijn
Branch: MAIN
CVS Tags: HEAD
Log Message:
use EV and plain sockets instead of asio

File Contents

# Content
1 /* button.hh
2 * This file is part of ndk library
3 * Copyright (c) 2003,2004 by Stanislav Ievlev
4 *
5 * This file is covered by the GNU Library General Public License,
6 * which should be included with libndk as the file COPYING.
7 */
8 #ifndef NDK_XX_BUTTON_H
9 #define NDK_XX_BUTTON_H
10
11 #include <ndk/label.hh>
12
13 namespace ndk
14 {
15 /**
16 * Simple version of the pre-button without activation/deactivation feature.
17 * This button only emits 'clicked' signal
18 * this class between label and button now to prevent dublication of on_click code
19 */
20 struct mini_button
21 : label
22 {
23 mini_button (const std::string &str, panel *parent = 0, bool accept = true);
24 };
25
26
27 /**
28 * Pre-Button: Label with activation support
29 * This is a base class for Radio/Check/Push buttons
30 */
31 struct button
32 : label
33 {
34 /**
35 * @see NDK::Label() for details
36 * @param accept additional parameter, accept or not focus
37 * buttons without focus acception are usefull for widgets like ListBox, SwitchButton
38 */
39 button (const std::string &str, panel *parent = 0, bool accept = true);
40
41 protected:
42 virtual void set_color (pen &p); /** set default color of the label */
43 int state_; /**< last status */
44 bool selected_; /**< semaphore: are this object selected now or not */
45
46 private:
47 event::result at_system (const event &); /**< system event processor */
48 };
49 }
50
51 #endif