Main Page | Class Hierarchy | Compound List | File List | Compound Members | File Members

actionbutton_c.h

Go to the documentation of this file.
00001 /*
00002     File        : actionbutton_c.h
00003     Date        : 19-Sep-02
00004     Description : Class to represent an action button toolbox gadget.
00005 
00006     Copyright © 1995-2002 Alexander Thoukydides
00007 
00008     This program is free software; you can redistribute it and/or
00009     modify it under the terms of the GNU General Public License
00010     as published by the Free Software Foundation; either version 2
00011     of the License, or (at your option) any later version.
00012 
00013     This program is distributed in the hope that it will be useful,
00014     but WITHOUT ANY WARRANTY; without even the implied warranty of
00015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00016     GNU General Public License for more details.
00017 
00018     You should have received a copy of the GNU General Public License
00019     along with this program; if not, write to the Free Software
00020     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
00021 */
00022 
00023 // Only include header file once
00024 #ifndef actionbutton_c_h
00025 #define actionbutton_c_h
00026 
00027 // Include alexlib header files
00028 #ifndef actionbutton_b_h
00029 #include "actionbutton_b.h"
00030 #endif
00031 #ifndef gadget_c_h
00032 #include "gadget_c.h"
00033 #endif
00034 #ifndef gadget_w_show_c_h
00035 #include "gadget_w_show_c.h"
00036 #endif
00037 
00038 // A class to represent an action button gadget
00039 class actionbutton_c : public virtual gadget_b,
00040                        public gadget_c,
00041                        public actionbutton_b,
00042                        public gadget_w_show_c
00043 {
00044 public:
00045 
00046     /*
00047         Parameters  : component - The component ID of this action button.
00048                       object    - The object ID of this action button's parent
00049                                   window.
00050         Returns     : -
00051         Description : Constructor function. This does not create an
00052                       action button; it merely creates an object to represent
00053                       the action button.
00054     */
00055     actionbutton_c(toolbox_c component = toolbox_NULL_COMPONENT,
00056                    toolbox_o object = toolbox_NULL_OBJECT);
00057 
00058 protected:
00059 
00060     /*
00061         Parameters  : event      - The toolbox event code.
00062         Returns     : void
00063         Description : Gadget specific function to set the toolbox event code
00064                       which will be raised for this gadget.
00065     */
00066     virtual void _set_event(bits event);
00067 
00068     /*
00069         Parameters  : void
00070         Returns     : bits  - The toolbox event code.
00071         Description : Gadget specific function to get the toolbox event code
00072                       which will be raised for this gadget.
00073     */
00074     virtual bits _get_event() const;
00075 
00076     /*
00077         Parameters  : text  - The text string to set.
00078         Returns     : void
00079         Description : Gadget specific function to set the text.
00080     */
00081     virtual void _set_text(const char *text);
00082 
00083     /*
00084         Parameters  : text      - Pointer to buffer to hold the text, or NULL
00085                                   to read the size of buffer required.
00086                       size      - The size of the buffer.
00087         Returns     : size_t    - Number of bytes written to the buffer, or
00088                                   the buffer size required if NULL passed.
00089         Description : Gadget specific function to get the text or the buffer
00090                       size required.
00091     */
00092     virtual size_t _get_text(char *text, size_t size) const;
00093 
00094     /*
00095         Parameters  : object    - The object to show.
00096         Returns     : void
00097         Description : Gadget specific function to set the object to show.
00098     */
00099     virtual void _set_show(toolbox_o object);
00100 
00101     /*
00102         Parameters  : void
00103         Returns     : toolbox_o - The object to show.
00104         Description : Gadget specific function to get the object to show.
00105     */
00106     virtual toolbox_o _get_show() const;
00107 };
00108 
00109 /*
00110     Parameters  : component - The component ID of this action button.
00111                   object    - The object ID of this action button's parent
00112                               window.
00113     Returns     : -
00114     Description : Constructor function. This does not create an
00115                   action button; it merely creates an object to represent
00116                   the action button.
00117 */
00118 inline actionbutton_c::actionbutton_c(toolbox_c component, toolbox_o object)
00119 : gadget_c(component, object) {}
00120 
00121 /*
00122     Parameters  : object    - The object to show.
00123     Returns     : void
00124     Description : Gadget specific function to set the object to show.
00125 */
00126 inline void actionbutton_c::_set_show(toolbox_o object)
00127 {
00128     actionbutton_set_click_show(0, actionbutton_c::object, component,
00129                                 object, get_is_menu());
00130 }
00131 
00132 /*
00133     Parameters  : void
00134     Returns     : toolbox_o - The object to show.
00135     Description : Gadget specific function to get the object to show.
00136 */
00137 inline toolbox_o actionbutton_c::_get_show() const
00138 {
00139     return actionbutton_get_click_show(0, object, component);
00140 }
00141 
00142 #endif

Generated on Sun Jan 26 10:18:43 2025 for NBLib by doxygen 1.3.3