SpreadSheet Class Reference

#include <spreadsheet.h>

List of all members.

Public Member Functions

 SpreadSheet (QWidget *parent, const char *name, int wflags)
 SpreadSheet (QString loadfrom, QWidget *parent, const char *name, int wflags)
void recalcSelection ()
void allowUserInput ()
void insertRows ()
void insertCols ()
void copyRight ()
void copyDown ()
bool hasFilename ()
void setFilename (QString filename)
void saveFile ()
 ~SpreadSheet ()

Private Member Functions

void init ()
void load ()

Private Attributes

SpreadSheetTabletable
QString filename


Detailed Description

Definition at line 6 of file spreadsheet.h.


Constructor & Destructor Documentation

SpreadSheet::SpreadSheet QWidget *  parent,
const char *  name,
int  wflags
 

Definition at line 19 of file spreadsheet.cpp.

References init().

00020   : QMainWindow( parent, name, wflags )
00021 {
00022   init();
00023 }

SpreadSheet::SpreadSheet QString  loadfrom,
QWidget *  parent,
const char *  name,
int  wflags
 

Definition at line 11 of file spreadsheet.cpp.

References init(), load(), and setFilename().

00011                                                                                          :
00012   QMainWindow(parent,name,wflags)
00013 {
00014   init();
00015   setFilename(loadfrom);
00016   load();
00017 }

SpreadSheet::~SpreadSheet  ) 
 

Definition at line 63 of file spreadsheet.cpp.

00064 {
00065 }


Member Function Documentation

void SpreadSheet::allowUserInput  ) 
 

Definition at line 72 of file spreadsheet.cpp.

References SpreadSheetTable::status_selection(), and table.

Referenced by ApplicationWindow::allowUserInput().

00073 {
00074   table->status_selection(true,true);
00075 }

void SpreadSheet::copyDown  ) 
 

Definition at line 58 of file spreadsheet.cpp.

References SpreadSheetTable::copyDown(), and table.

Referenced by ApplicationWindow::copyDown().

00059 {
00060   table->copyDown();
00061 }

void SpreadSheet::copyRight  ) 
 

Definition at line 53 of file spreadsheet.cpp.

References SpreadSheetTable::copyRight(), and table.

Referenced by ApplicationWindow::copyRight().

00054 {
00055   table->copyRight();
00056 }

bool SpreadSheet::hasFilename  ) 
 

Definition at line 77 of file spreadsheet.cpp.

References filename.

Referenced by ApplicationWindow::saveFile().

00078 {
00079   return !filename.isEmpty();
00080 }

void SpreadSheet::init  )  [private]
 

Definition at line 25 of file spreadsheet.cpp.

References table.

Referenced by SpreadSheet().

00026 {
00027   table = new SpreadSheetTable(100,26,this,"table");
00028   // set the vertical header
00029   QHeader * h = table->verticalHeader();
00030   for(int i = 0 ; i < 100 ; i++)
00031     h->setLabel(i,QString::number(i));
00032   h = table->horizontalHeader();
00033   for(int i = 0 ; i < 26 ; i ++)
00034     {
00035       char c[2];
00036       c[0] = 'A'+i;
00037       c[1]=0;
00038       h->setLabel(i,QString(c));
00039     }
00040   // make it to be the central widget
00041   setCentralWidget(table);
00042 }

void SpreadSheet::insertCols  ) 
 

Definition at line 48 of file spreadsheet.cpp.

References SpreadSheetTable::insertCols(), and table.

Referenced by ApplicationWindow::insertCols().

00049 {
00050   table->insertCols();
00051 }

void SpreadSheet::insertRows  ) 
 

Definition at line 43 of file spreadsheet.cpp.

References SpreadSheetTable::insertRows(), and table.

Referenced by ApplicationWindow::insertRows().

00044 {
00045   table->insertRows();
00046 }

void SpreadSheet::load  )  [private]
 

Definition at line 93 of file spreadsheet.cpp.

References filename, SpreadSheetTable::loadFile(), and table.

Referenced by SpreadSheet().

00094 {
00095   table->loadFile(filename);
00096 }

void SpreadSheet::recalcSelection  ) 
 

Definition at line 67 of file spreadsheet.cpp.

References SpreadSheetTable::status_selection(), and table.

Referenced by ApplicationWindow::recalcNow().

00068 {
00069   table->status_selection(true,false);
00070 }

void SpreadSheet::saveFile  ) 
 

Definition at line 88 of file spreadsheet.cpp.

References filename, SpreadSheetTable::saveFile(), and table.

Referenced by ApplicationWindow::saveFile(), and ApplicationWindow::saveFileAs().

00089 {
00090   table->saveFile(filename);
00091 }

void SpreadSheet::setFilename QString  filename  ) 
 

Definition at line 82 of file spreadsheet.cpp.

References filename.

Referenced by ApplicationWindow::saveFileAs(), and SpreadSheet().

00083 {
00084   filename = fn;
00085   setCaption(fn);
00086 }


Member Data Documentation

QString SpreadSheet::filename [private]
 

Definition at line 11 of file spreadsheet.h.

Referenced by hasFilename(), load(), saveFile(), and setFilename().

SpreadSheetTable* SpreadSheet::table [private]
 

Definition at line 8 of file spreadsheet.h.

Referenced by allowUserInput(), copyDown(), copyRight(), init(), insertCols(), insertRows(), load(), recalcSelection(), and saveFile().


The documentation for this class was generated from the following files:
Generated on Mon Jun 5 22:08:44 2006 for iis by  doxygen 1.4.6