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

/home/jeroen/FOX/fox/fox-1.7.33/include/FXFontSelector.h
00001 /********************************************************************************
00002 *                                                                               *
00003 *                        F o n t   S e l e c t i o n   B o x                    *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 1999,2012 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or modify          *
00009 * it under the terms of the GNU Lesser General Public License as published by   *
00010 * the Free Software Foundation; either version 3 of the License, or             *
00011 * (at your option) any later version.                                           *
00012 *                                                                               *
00013 * This library 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 Lesser General Public License for more details.                           *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public License      *
00019 * along with this program.  If not, see <http://www.gnu.org/licenses/>          *
00020 ********************************************************************************/
00021 #ifndef FXFONTSELECTOR_H
00022 #define FXFONTSELECTOR_H
00023 
00024 #ifndef FXPACKER_H
00025 #include "FXPacker.h"
00026 #endif
00027 
00028 namespace FX {
00029 
00030 
00031 class FXTextField;
00032 class FXList;
00033 class FXComboBox;
00034 class FXLabel;
00035 class FXButton;
00036 class FXCheckButton;
00037 class FXFont;
00038 
00039 
00041 class FXAPI FXFontSelector : public FXPacker {
00042   FXDECLARE(FXFontSelector)
00043 protected:
00044   FXTextField   *family;
00045   FXList        *familylist;
00046   FXTextField   *weight;
00047   FXList        *weightlist;
00048   FXTextField   *style;
00049   FXList        *stylelist;
00050   FXTextField   *size;
00051   FXList        *sizelist;
00052   FXComboBox    *charset;
00053   FXComboBox    *setwidth;
00054   FXComboBox    *pitch;
00055   FXCheckButton *scalable;
00056   FXCheckButton *allfonts;
00057   FXButton      *accept;
00058   FXButton      *cancel;
00059   FXLabel       *preview;
00060   FXFont        *previewfont;
00061   FXFontDesc     selected;
00062 protected:
00063   FXFontSelector(){}
00064   void listFontFaces();
00065   void listWeights();
00066   void listSlants();
00067   void listFontSizes();
00068   void previewFont();
00069 private:
00070   FXFontSelector(const FXFontSelector&);
00071   FXFontSelector &operator=(const FXFontSelector&);
00072 public:
00073   long onCmdFamily(FXObject*,FXSelector,void*);
00074   long onCmdWeight(FXObject*,FXSelector,void*);
00075   long onCmdStyle(FXObject*,FXSelector,void*);
00076   long onCmdStyleText(FXObject*,FXSelector,void*);
00077   long onCmdSize(FXObject*,FXSelector,void*);
00078   long onCmdSizeText(FXObject*,FXSelector,void*);
00079   long onCmdCharset(FXObject*,FXSelector,void*);
00080   long onUpdCharset(FXObject*,FXSelector,void*);
00081   long onCmdSetWidth(FXObject*,FXSelector,void*);
00082   long onUpdSetWidth(FXObject*,FXSelector,void*);
00083   long onCmdPitch(FXObject*,FXSelector,void*);
00084   long onUpdPitch(FXObject*,FXSelector,void*);
00085   long onCmdScalable(FXObject*,FXSelector,void*);
00086   long onUpdScalable(FXObject*,FXSelector,void*);
00087   long onCmdAllFonts(FXObject*,FXSelector,void*);
00088   long onUpdAllFonts(FXObject*,FXSelector,void*);
00089 public:
00090   enum{
00091     ID_FAMILY=FXPacker::ID_LAST,
00092     ID_WEIGHT,
00093     ID_STYLE,
00094     ID_STYLE_TEXT,
00095     ID_SIZE,
00096     ID_SIZE_TEXT,
00097     ID_CHARSET,
00098     ID_SETWIDTH,
00099     ID_PITCH,
00100     ID_SCALABLE,
00101     ID_ALLFONTS,
00102     ID_LAST
00103     };
00104 public:
00105 
00107   FXFontSelector(FXComposite *p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
00108 
00110   virtual void create();
00111 
00113   FXButton *acceptButton() const { return accept; }
00114 
00116   FXButton *cancelButton() const { return cancel; }
00117 
00119   void setFont(const FXString& string);
00120 
00122   FXString getFont() const;
00123 
00125   void setFontDesc(const FXFontDesc& fontdesc);
00126 
00128   const FXFontDesc& getFontDesc() const;
00129 
00131   virtual void save(FXStream& store) const;
00132 
00134   virtual void load(FXStream& store);
00135 
00137   virtual ~FXFontSelector();
00138   };
00139 
00140 }
00141 
00142 #endif

Copyright © 1997-2011 Jeroen van der Zijp