home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ool_main.zip / ool / include / xchart.h < prev    next >
C/C++ Source or Header  |  1998-02-15  |  2KB  |  60 lines

  1. #ifndef __OOL_XCHART_H__
  2. #define __OOL_XCHART_H__
  3.  
  4. /*===========================================================================*/
  5. /* OOL ------------------- the Open Object Library ------------------- r 1.0 */
  6. /*===========================================================================*/
  7. /*                              class: XChart                                */
  8. /*                       derived from: XUserWindow                           */
  9. /*                        last update: 12/96                                 */
  10. /*                      programmed by: Stefan von Brauk (sbrauk@gwdg.de)     */
  11. /*===========================================================================*/
  12.  
  13.  
  14. #include "xuserwnd.h"
  15. #include "xgraphdv.h"
  16. #include "XLayer.h"
  17. #include "xstring.h"
  18. #include "xbox.h"
  19. #include "XText.h"
  20. #include "XFont.h"
  21.  
  22.  
  23. typedef struct chartItem
  24. {
  25.    double value;
  26.    //LONG color;
  27. } ChartItem;
  28.  
  29.  
  30. class _export_ XChart:public XUserWindow
  31. {
  32.    protected:
  33.       XGraphicDevice * graph;
  34.       XLayer layer;
  35.       chartItem ** item;
  36.       USHORT itemCount;
  37.       LONG style;
  38.       XBox * box;
  39.       XChart( const XWindow*, const XRect& rec=XRect(), const LONG id=0, const LONG style=0, const char * t = "");
  40.       XFont * titleFont;
  41.       XText * title;
  42.    public:
  43.       virtual ~XChart();
  44.       virtual void Draw() { graph->FillBackground(); title->Draw(graph); layer.Draw(graph); }
  45.       void GetBackgroundColor( XColor * c) const;
  46.       virtual void GetItemColor( const USHORT index, XColor * ) { ;}
  47.       double GetItemValue( const USHORT index );
  48.       XGraphicDevice * GetGraphicDevice( void) const { return graph; }
  49.       XText * GetTitleObject( void ) const { return title; }
  50.       virtual BOOL SetBackgroundColor( const XColor * rgbColor);
  51.       virtual void SetItemColor( const USHORT index, const XColor *) { ;}
  52.       virtual void SetItemCount( const USHORT count );
  53.       void SetItemValue( const USHORT index, const double value);
  54.       void SetSize( const XRect*) const;
  55.       void SetSize( const ULONG xPos, const ULONG yPos, const ULONG width, const ULONG height) const ;
  56.       virtual void SetText(const char * text);
  57. };
  58.  
  59. #endif
  60.