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

gadget_w_justification.h

Go to the documentation of this file.
00001 /*
00002     File        : gadget_w_justification.h
00003     Date        : 19-Sep-02
00004     Description : Class to represent a toolbox gadget that has selectable
00005                   field justification.
00006 
00007     Copyright © 1995-2002 Alexander Thoukydides
00008 
00009     This program is free software; you can redistribute it and/or
00010     modify it under the terms of the GNU General Public License
00011     as published by the Free Software Foundation; either version 2
00012     of the License, or (at your option) any later version.
00013 
00014     This program is distributed in the hope that it will be useful,
00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00017     GNU General Public License for more details.
00018 
00019     You should have received a copy of the GNU General Public License
00020     along with this program; if not, write to the Free Software
00021     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
00022 */
00023 
00024 // Only include header file once
00025 #ifndef gadget_w_justification_h
00026 #define gadget_w_justification_h
00027 
00028 // A class to represent a gadget with selectable field justification
00029 class gadget_w_justification
00030 {
00031 public:
00032 
00033     // Possible field alignments
00034     enum justification
00035     {
00036         left,
00037         right,
00038         centre
00039     };
00040 
00041     /*
00042         Parameters  : position  - The field justification.
00043         Returns     : void
00044         Description : Set the justification for this gadget.
00045     */
00046     void set_justification(justification position = left);
00047 
00048     /*
00049         Parameters  : void
00050         Returns     : bool  - The field justification.
00051         Description : Get the justification for this gadget.
00052     */
00053     justification get_justification() const;
00054 
00055 protected:
00056 
00057     /*
00058         Parameters  : position  - The field justification.
00059         Returns     : void
00060         Description : Gadget specific function to set the justification.
00061     */
00062     virtual void _set_justification(justification position) = 0;
00063 
00064     /*
00065         Parameters  : void
00066         Returns     : bool  - The field justification.
00067         Description : Gadget specific function to Get the justification.
00068     */
00069     virtual justification _get_justification() const = 0;
00070 };
00071 
00072 /*
00073     Parameters  : position  - The field justification.
00074     Returns     : void
00075     Description : Set the justification for this gadget.
00076 */
00077 inline void gadget_w_justification::set_justification(justification position)
00078 {
00079     _set_justification(position);
00080 }
00081 
00082 /*
00083     Parameters  : void
00084     Returns     : bool  - The field justification.
00085     Description : Get the justification for this gadget.
00086 */
00087 inline gadget_w_justification::justification
00088 gadget_w_justification::get_justification() const
00089 {
00090     return _get_justification();
00091 }
00092 
00093 #endif

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