00001 /* 00002 File : popup_c.h 00003 Date : 19-Sep-02 00004 Description : Class to represent a popup 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 popup_c_h 00025 #define popup_c_h 00026 00027 // Include alexlib header files 00028 #ifndef popup_b_h 00029 #include "popup_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 a popup gadget 00039 class popup_c : public virtual gadget_b, 00040 public gadget_c, 00041 public popup_b, 00042 public gadget_w_show_c 00043 { 00044 public: 00045 00046 /* 00047 Parameters : component - The component ID of this popup. 00048 object - The object ID of this popup's parent window. 00049 Returns : - 00050 Description : Constructor function. This does not create a popup; 00051 it merely creates an object to represent the popup. 00052 */ 00053 popup_c(toolbox_c component = toolbox_NULL_COMPONENT, 00054 toolbox_o object = toolbox_NULL_OBJECT); 00055 00056 protected: 00057 00058 /* 00059 Parameters : object - The object to show. 00060 Returns : void 00061 Description : Gadget specific function to set the object to show. 00062 */ 00063 virtual void _set_show(toolbox_o object); 00064 00065 /* 00066 Parameters : void 00067 Returns : toolbox_o - The object to show. 00068 Description : Gadget specific function to get the object to show. 00069 */ 00070 virtual toolbox_o _get_show() const; 00071 }; 00072 00073 /* 00074 Parameters : component - The component ID of this popup. 00075 object - The object ID of this popup's parent window. 00076 Returns : - 00077 Description : Constructor function. This does not create a popup; 00078 it merely creates an object to represent the popup. 00079 */ 00080 inline popup_c::popup_c(toolbox_c component, toolbox_o object) 00081 : gadget_c(component, object) {} 00082 00083 /* 00084 Parameters : object - The object to show. 00085 Returns : void 00086 Description : Gadget specific function to set the object to show. 00087 */ 00088 inline void popup_c::_set_show(toolbox_o object) 00089 { 00090 popup_set_menu(0, popup_c::object, component, object); 00091 } 00092 00093 /* 00094 Parameters : void 00095 Returns : toolbox_o - The object to show. 00096 Description : Gadget specific function to get the object to show. 00097 */ 00098 inline toolbox_o popup_c::_get_show() const 00099 { 00100 return popup_get_menu(0, object, component); 00101 } 00102 00103 #endif
1.3.3