SUMO - Simulation of Urban MObility
FXLCDLabel.h
Go to the documentation of this file.
00001 /********************************************************************************
00002 *                                                                               *
00003 *                  LCD text label widget                                        *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 2003 by Mathew Robertson.   All Rights Reserved.                *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or                 *
00009 * modify it under the terms of the GNU Lesser General Public                    *
00010 * License as published by the Free Software Foundation; either                  *
00011 * version 2.1 of the License, or (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 GNU             *
00016 * Lesser General Public License for more details.                               *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public              *
00019 * License along with this library; if not, write to the Free Software           *
00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.    *
00021 *********************************************************************************/
00022 #ifndef FXLCDLABEL_H
00023 #define FXLCDLABEL_H
00024 
00025 
00026 // ===========================================================================
00027 // included modules
00028 // ===========================================================================
00029 #ifdef _MSC_VER
00030 #include <windows_config.h>
00031 #else
00032 #include <config.h>
00033 #endif
00034 
00035 
00036 
00037 #ifndef FXHORIZONTALFRAME_H
00038 #include <FXHorizontalFrame.h>
00039 using namespace FX;
00040 #endif
00041 namespace FXEX {
00042 
00044 enum {
00045     LCDLABEL_NORMAL        = FRAME_SUNKEN | FRAME_THICK,
00046     LCDLABEL_LEADING_ZEROS = 0x01000000    
00047 };
00048 
00054 class /* FXAPI // patch by Daniel Krajzewicz 24.02.2004 */
00055         FXLCDLabel : public FXHorizontalFrame {
00056     FXDECLARE(FXLCDLabel)
00057 
00058 protected:
00059     FXLCDLabel() {}
00060 
00061     FXString label;      
00062     FXint   nfigures;    
00063 
00064     // Draw a string
00065     virtual void drawString(const FXString& lbl);
00066 
00067 public:
00068     enum {
00069         ID_SEVENSEGMENT = FXHorizontalFrame::ID_LAST,
00070         ID_LAST
00071     };
00072 
00073 public:
00074     long onPaint(FXObject*, FXSelector, void*);
00075     long onCmdSetValue(FXObject*, FXSelector, void* ptr);
00076     long onCmdSetIntValue(FXObject*, FXSelector, void* ptr);
00077     long onCmdSetRealValue(FXObject*, FXSelector, void* ptr);
00078     long onCmdSetStringValue(FXObject*, FXSelector, void* ptr);
00079     long onCmdGetIntValue(FXObject*, FXSelector, void* ptr);
00080     long onCmdGetRealValue(FXObject*, FXSelector, void* ptr);
00081     long onCmdGetStringValue(FXObject*, FXSelector, void* ptr);
00082     long onRedirectEvent(FXObject*, FXSelector, void* ptr);
00083     long onQueryTip(FXObject*, FXSelector, void* ptr);
00084     long onQueryHelp(FXObject*, FXSelector, void* ptr);
00085 
00086 public:
00088     FXLCDLabel(FXComposite* p, FXuint nfig = 1, FXObject* tgt = NULL, FXSelector sel = 0, FXuint opts = LCDLABEL_NORMAL, FXint pl = DEFAULT_PAD, FXint pr = DEFAULT_PAD, FXint pt = DEFAULT_PAD, FXint pb = DEFAULT_PAD, FXint hs = DEFAULT_PAD);
00089 
00091     virtual void create();
00092 
00094     virtual void detach();
00095 
00097     virtual void destroy();
00098 
00100     void setText(FXString lbl);
00101     FXString getText() const {
00102         return label;
00103     }
00104 
00106     void setFgColor(FXColor clr);
00107     FXColor getFgColor() const;
00108 
00110     void setBgColor(FXColor clr);
00111     FXColor getBgColor() const;
00112 
00114     void setHorizontal(const FXint len);
00115     FXint getHorizontal() const;
00116 
00118     void setVertical(const FXint len);
00119     FXint getVertical() const;
00120 
00122     void setThickness(const FXint width);
00123     FXint getThickness() const;
00124 
00126     void setGroove(const FXint width);
00127     FXint getGroove() const;
00128 
00130     virtual FXint getDefaultWidth();
00131 
00133     virtual FXint getDefaultHeight();
00134 
00136     virtual void save(FXStream& store) const;
00137 
00139     virtual void load(FXStream& store);
00140 
00142     virtual ~FXLCDLabel();
00143 };
00144 
00145 } // namespace FXEX
00146 #endif // FXLCDLabel
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines