The DejaVU Framework -- hush 3.1

include: professional-program-09-NestedClasses-Spreadsheet.h /cygdrive/d/www/media


- [up] [top] - index make include source logic grammar scripts html configure mx slides talks scenes reports projects
<body bgcolor="#FFFFFF" text="#000000">

// Spreadsheet.h
include 
using std::string;

class SpreadsheetApplication; // forward declaration

<h4 align=right text=red> Spreadsheet</h4><hr>
  class Spreadsheet
{
 public:

<hr>

SpreadsheetCell</h4>
    class SpreadsheetCell
      {
      public:
        SpreadsheetCell();
        SpreadsheetCell(double initialValue);
        SpreadsheetCell(const string& initialValue);
        SpreadsheetCell(const SpreadsheetCell& src);
        SpreadsheetCell& operator=(const SpreadsheetCell& rhs);
        void set(double inValue);
        void set(const string& inString);
  
        double getValue() const {mNumAccesses++; return (mValue); }
        string getString() const {mNumAccesses++; return (mString); }
  
        static string doubleToString(double inValue);
        static double stringToDouble(const string& inString);
  
      protected:
        double mValue;
        string mString;
  
        mutable int mNumAccesses;
      };


  
    Spreadsheet(const SpreadsheetApplication& theApp,
                int inWidth = kMaxWidth, int inHeight = kMaxHeight);
    Spreadsheet(const Spreadsheet& src);
    ~Spreadsheet();
    Spreadsheet& operator=(const Spreadsheet& rhs);
  
    void setCellAt(int x, int y, const SpreadsheetCell& cell);
    SpreadsheetCell getCellAt(int x, int y);
  
    int getId();
  
    // Initializing here oesn't work in some compilers
    static const int kMaxHeight = 100;
    static const int kMaxWidth = 100;
  
   protected:
    bool inRange(int val, int upper);
    void copyFrom(const Spreadsheet& src);
  
    int mWidth, mHeight;
    int mId;
    SpreadsheetCell** mCells;
  
    const SpreadsheetApplication& mTheApp;
  
    static int sCounter;
  };

 
  
  typedef Spreadsheet::SpreadsheetCell SCell;
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author. <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-2780434-1"; urchinTracker(); </script>

Hush Online Technology
hush@cs.vu.nl
10/19/08