00001 /* 00002 File : label_b.h 00003 Date : 19-Sep-02 00004 Description : Base class to represent a label 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 label_b_h 00025 #define label_b_h 00026 00027 // Include oslib header files 00028 #include "oslib/label.h" 00029 00030 // Include alexlib header files 00031 #ifndef gadget_b_h 00032 #include "gadget_b.h" 00033 #endif 00034 #ifndef gadget_w_justification_h 00035 #include "gadget_w_justification.h" 00036 #endif 00037 00038 // A base class to represent a label gadget 00039 class label_b : public virtual gadget_b, 00040 public gadget_w_justification 00041 { 00042 public: 00043 00044 /* 00045 Parameters : omit - Should the bounding box be omitted. 00046 Returns : void 00047 Description : Set whether the bounding box should be omitted for this 00048 label. 00049 */ 00050 void set_omit_box(bool omit = TRUE); 00051 00052 /* 00053 Parameters : void 00054 Returns : bool - Should the bounding box be omitted. 00055 Description : Get whether the bounding box should be omitted for this 00056 label. 00057 */ 00058 bool get_omit_box() const; 00059 00060 protected: 00061 00062 /* 00063 Parameters : position - The field justification. 00064 Returns : void 00065 Description : Gadget specific function to set the justification. 00066 */ 00067 virtual void _set_justification(justification position); 00068 00069 /* 00070 Parameters : void 00071 Returns : bool - The field justification. 00072 Description : Gadget specific function to Get the justification. 00073 */ 00074 virtual justification _get_justification() const; 00075 }; 00076 00077 /* 00078 Parameters : omit - Should the bounding box be omitted. 00079 Returns : void 00080 Description : Set whether the bounding box should be omitted for this 00081 label. 00082 */ 00083 inline void label_b::set_omit_box(bool omit) 00084 { 00085 gadget_flags flags = _get_flags(); 00086 _set_flags(omit 00087 ? flags | label_NO_BOX 00088 : flags & ~label_NO_BOX); 00089 } 00090 00091 /* 00092 Parameters : void 00093 Returns : bool - Should the bounding box be omitted. 00094 Description : Get whether the bounding box should be omitted for this 00095 label. 00096 */ 00097 inline bool label_b::get_omit_box() const 00098 { 00099 return BOOL(_get_flags() & label_NO_BOX); 00100 } 00101 00102 #endif
1.3.3