gwenhywfar  4.3.3
fox16_htmltext.hpp
Go to the documentation of this file.
00001 /***************************************************************************
00002     begin       : Sat Jun 19 2010
00003     copyright   : (C) 2010 by Martin Preuss
00004     email       : martin@libchipcard.de
00005 
00006  ***************************************************************************
00007  *          Please see toplevel file COPYING for license details           *
00008  ***************************************************************************/
00009 
00010 
00011 #ifndef FOX16_HTMLTEXT_HPP
00012 #define FOX16_HTMLTEXT_HPP
00013 
00014 #include <gwen-gui-fox16/cppgui.hpp>
00015 
00016 #include <fx.h>
00017 
00018 
00019 class FOX16_HtmlCtx;
00020 
00021 
00022 class FOX16GUI_API FOX16_HtmlText: public FXScrollArea {
00023   FXDECLARE(FOX16_HtmlText)
00024 
00025 public:
00026 
00027   enum {
00031     FLAGS_NO_WORDWRAP = 0x00080000
00032   };
00033 
00034   FOX16_HtmlText(FXComposite* p, const FXString& text,
00035                  FXuint opts=0,
00036                  FXint x=0, FXint y=0, FXint w=0, FXint h=0);
00037   ~FOX16_HtmlText();
00038 
00040   void setText(const FXString& text);
00041 
00043   FXString getText() const { return m_text; }
00044 
00045   virtual FXint getContentWidth();
00046 
00047   virtual FXint getContentHeight();
00048 
00049   void setMinimumWidth(int i) { m_minWidth=i;};
00050 
00051   void makePositionVisible(FXint pos);
00052 
00053   long onPaint(FXObject*, FXSelector, void*);
00054 
00055   void layout();
00056 
00057 protected:
00058   FOX16_HtmlCtx *m_htmlCtx;
00059   FXString m_text;
00060   int m_minWidth;
00061   int m_maxDefaultWidth;
00062 
00063   bool m_haveDefaultDims;
00064   FXint m_defaultWidth;
00065   FXint m_defaultHeight;
00066 
00067   FXint margintop;           // Margins top
00068   FXint marginbottom;        // Margin bottom
00069   FXint marginleft;          // Margin left
00070   FXint marginright;         // Margin right
00071   FXint barwidth;
00072 
00073   FOX16_HtmlText();
00074   void updateHtml();
00075   void calcDefaultDims();
00076 
00077 
00078 };
00079 
00080 
00081 
00082 #endif
00083