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

adjuster_b.h

Go to the documentation of this file.
00001 /*
00002     File        : adjuster_b.h
00003     Date        : 19-Sep-02
00004     Description : Base class to represent an adjuster arrow 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 adjuster_b_h
00025 #define adjuster_b_h
00026 
00027 // Include oslib header files
00028 #include "oslib/adjuster.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 adjuster arrow gadget
00036 class adjuster_b : public virtual gadget_b
00037 {
00038 public:
00039 
00040     /*
00041         Parameters  : increment - The increment status.
00042         Returns     : void
00043         Description : Set the increment/decrement status for this adjuster
00044                       arrow.
00045     */
00046     void set_increment(bool increment = TRUE);
00047 
00048     /*
00049         Parameters  : void
00050         Returns     : bool  - The increment status.
00051         Description : Get the increment/decrement status for this adjuster
00052                       arrow.
00053     */
00054     bool get_increment() const;
00055 
00056     /*
00057         Parameters  : vertical  - The vertical status.
00058         Returns     : void
00059         Description : Set the vertical/horizontal status for this adjuster
00060                       arrow.
00061     */
00062     void set_vertical(bool vertical = TRUE);
00063 
00064     /*
00065         Parameters  : void
00066         Returns     : bool  - The vertical status.
00067         Description : Get the vertical/horizontal status for this adjuster
00068                       arrow.
00069     */
00070     bool get_vertical() const;
00071 };
00072 
00073 /*
00074     Parameters  : increment - The increment status.
00075     Returns     : void
00076     Description : Set the increment/decrement status for this adjuster
00077                   arrow.
00078 */
00079 inline void adjuster_b::set_increment(bool increment)
00080 {
00081     gadget_flags flags = _get_flags();
00082     _set_flags(increment
00083                ? flags | adjuster_INCREMENT
00084                : flags & ~adjuster_INCREMENT);
00085 }
00086 
00087 /*
00088     Parameters  : void
00089     Returns     : bool  - The increment status.
00090     Description : Get the increment/decrement status for this adjuster
00091                   arrow.
00092 */
00093 inline bool adjuster_b::get_increment() const
00094 {
00095     return BOOL(_get_flags() & adjuster_INCREMENT);
00096 }
00097 
00098 /*
00099     Parameters  : vertical  - The vertical status.
00100     Returns     : void
00101     Description : Set the vertical/horizontal status for this adjuster
00102                   arrow.
00103 */
00104 inline void adjuster_b::set_vertical(bool vertical)
00105 {
00106     gadget_flags flags = _get_flags();
00107     _set_flags(vertical
00108                ? flags | adjuster_VERTICAL
00109                : flags & ~adjuster_VERTICAL);
00110 }
00111 
00112 /*
00113     Parameters  : void
00114     Returns     : bool  - The vertical status.
00115     Description : Get the vertical/horizontal status for this adjuster
00116                   arrow.
00117 */
00118 inline bool adjuster_b::get_vertical() const
00119 {
00120     return BOOL(_get_flags() & adjuster_VERTICAL);
00121 }
00122 
00123 #endif

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