1 // Emacs style mode select -*- C++ -*-
2 //-----------------------------------------------------------------------------
4 // Copyright(C) 2006 Simon Howard
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
22 #ifndef TXT_WINDOW_ACTION_H
23 #define TXT_WINDOW_ACTION_H
26 * @file txt_window_action.h
28 * Window action widget.
32 * Window action widget.
34 * A window action is attached to a window and corresponds to a
35 * keyboard shortcut that is active within that window. When the
36 * key is pressed, the action is triggered.
38 * When a window action is triggered, the "pressed" signal is emitted.
41 typedef struct txt_window_action_s txt_window_action_t
;
43 #include "txt_widget.h"
44 #include "txt_window.h"
46 struct txt_window_action_s
54 * Create a new window action.
56 * @param key The keyboard key that triggers this action.
57 * @param label Label to display for this action in the tray
58 * at the bottom of the window.
59 * @return Pointer to the new window action widget.
62 txt_window_action_t
*TXT_NewWindowAction(int key
, const char *label
);
65 * Create a new window action that closes the window when the
66 * escape key is pressed. The label "Close" is used.
68 * @param window The window to close.
69 * @return Pointer to the new window action widget.
72 txt_window_action_t
*TXT_NewWindowEscapeAction(txt_window_t
*window
);
75 * Create a new window action that closes the window when the
76 * escape key is pressed. The label "Abort" is used.
78 * @param window The window to close.
79 * @return Pointer to the new window action widget.
82 txt_window_action_t
*TXT_NewWindowAbortAction(txt_window_t
*window
);
85 * Create a new "select" window action. This does not really do
86 * anything, but reminds the user that "enter" can be pressed to
87 * activate the currently-selected widget.
89 * @param window The window.
90 * @return Pointer to the new window action widget.
93 txt_window_action_t
*TXT_NewWindowSelectAction(txt_window_t
*window
);
95 #endif /* #ifndef TXT_WINDOW_ACTION_H */