00001 /* 00002 File : popup_b.h 00003 Date : 19-Sep-02 00004 Description : Base 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_b_h 00025 #define popup_b_h 00026 00027 // Include oslib header files 00028 #include "oslib/popup.h" 00029 00030 // Include alexlib header files 00031 #ifndef gadget_b_h 00032 #include "gadget_b.h" 00033 #endif 00034 00035 // A base class to represent a popup gadget 00036 class popup_b : public virtual gadget_b 00037 { 00038 public: 00039 00040 /* 00041 Parameters : generate - The generate event status. 00042 Returns : void 00043 Description : Set the PopUp_AboutToBeShown event status. 00044 */ 00045 void set_generate_about_to_be_shown(bool generate = TRUE); 00046 00047 /* 00048 Parameters : void 00049 Returns : bool - The generate event status. 00050 Description : Get the PopUp_AboutToBeShown event status. 00051 */ 00052 bool get_generate_about_to_be_shown() const; 00053 }; 00054 00055 /* 00056 Parameters : generate - The generate event status. 00057 Returns : void 00058 Description : Set the PopUp_AboutToBeShown event status. 00059 */ 00060 inline void popup_b::set_generate_about_to_be_shown(bool generate) 00061 { 00062 gadget_flags flags = _get_flags(); 00063 _set_flags(generate 00064 ? flags | popup_GENERATE_ABOUT_TO_BE_SHOWN 00065 : flags & ~popup_GENERATE_ABOUT_TO_BE_SHOWN); 00066 } 00067 00068 /* 00069 Parameters : void 00070 Returns : bool - The generate event status. 00071 Description : Get the PopUp_AboutToBeShown event status. 00072 */ 00073 inline bool popup_b::get_generate_about_to_be_shown() const 00074 { 00075 return BOOL(_get_flags() & popup_GENERATE_ABOUT_TO_BE_SHOWN); 00076 } 00077 00078 #endif
1.3.3