SciDAVis  1.D4
Public Slots | Signals | Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes
MatrixView Class Reference

View class for Matrix. More...

#include <MatrixView.h>

Inheritance diagram for MatrixView:
MyWidget Matrix

List of all members.

Public Slots

void applyCoordinates ()
void applyFormat ()
void applyFormula ()
void goToCell (int row, int col)
void handleHorizontalSectionResized (int logicalIndex, int oldSize, int newSize)
void handleVerticalSectionResized (int logicalIndex, int oldSize, int newSize)
void rereadSectionSizes ()
void selectAll ()
void showControlCoordinatesTab ()
void showControlFormatTab ()
void showControlFormulaTab ()
void toggleControlTabBar ()
void updateCoordinatesTab ()
void updateFormatTab ()
void updateFormulaTab ()

Signals

void controlTabBarStatusChanged (bool visible)
- Signals inherited from MyWidget
void closedWindow (MyWidget *)
 Emitted when the window was closed.
void hiddenWindow (MyWidget *)
 Emitted when the window was hidden.
void modifiedWindow (QWidget *)
void resizedWindow (QWidget *)
void showTitleBarMenu ()
 Emitted when the title bar recieves a QContextMenuEvent.
void statusChanged (MyWidget *)
 Emitted when the window status changed.

Public Member Functions

int columnWidth (int col) const
bool isControlTabBarVisible ()
 MatrixView (future::Matrix *matrix)
 Constructor.
int rowHeight (int row) const
void setColumnWidth (int col, int width)
void setRowHeight (int row, int height)
virtual ~MatrixView ()
 Destructor.
selection related functions
int selectedColumnCount (bool full=false)
 Return how many columns are selected.
bool isColumnSelected (int col, bool full=false)
 Returns true if column 'col' is selected; otherwise false.
int selectedRowCount (bool full=false)
 Return how many rows are (at least partly) selected.
bool isRowSelected (int row, bool full=false)
 Returns true if row 'row' is selected; otherwise false.
int firstSelectedColumn (bool full=false)
 Return the index of the first selected column.
int lastSelectedColumn (bool full=false)
 Return the index of the last selected column.
int firstSelectedRow (bool full=false)
 Return the index of the first selected row.
int lastSelectedRow (bool full=false)
 Return the index of the last selected row.
bool isCellSelected (int row, int col)
 Return whether a cell is selected.
void setCellSelected (int row, int col)
 Select a cell.
void setCellsSelected (int first_row, int first_col, int last_row, int last_col)
 Select a range of cells.
void getCurrentCell (int *row, int *col)
 Determine the current cell (-1 if no cell is designated as the current)
- Public Member Functions inherited from MyWidget
void askOnCloseEvent (bool ask)
 Toggle the "ask on close" flag.
QString aspect ()
 Return the window status as a string.
virtual QString birthDate ()
 Return the creation date.
virtual CaptionPolicy captionPolicy ()
 Return the caption policy.
void closeEvent (QCloseEvent *)
 Close event handler.
virtual void exportPDF (const QString &)
Folderfolder ()
 Returns the pointer to the parent folder of the window.
 MyWidget (const QString &label=QString(), QWidget *parent=0, const QString name=0, Qt::WFlags f=0)
 Constructor.
virtual QString name ()
 Return the window name.
void notifyChanges ()
 Notifies the main application that the window has been modified.
virtual void print ()
virtual void restore (const QStringList &)
 Not implemented yet.
virtual QString saveAsTemplate (const QString &)
virtual QString saveToString (const QString &)
virtual void setBirthDate (const QString &s)
 Set the creation date.
virtual void setCaptionPolicy (CaptionPolicy policy)
 Set the caption policy.
void setFolder (Folder *f)
 Initializes the pointer to the parent folder of the window.
virtual void setHidden ()
 Notifies that a window was hidden by a direct user action.
void setMaximized ()
void setMinimized ()
virtual void setName (const QString &s)
 Set the window name.
void setNormal ()
void setStatus (Status s)
 Set the window status flag (hidden, normal, minimized or maximized)
virtual void setWindowLabel (const QString &s)
 Set the window label.
Status status ()
 Return the window status flag (hidden, normal, minimized or maximized)
virtual QString windowLabel ()
 Return the window label.

Protected Slots

void advanceCell ()
 Advance current cell after [Return] or [Enter] was pressed.
void updateTypeInfo ()
- Protected Slots inherited from MyWidget
void updateCaption ()
 Set caption according to current CaptionPolicy, name and label.

Protected Member Functions

virtual void changeEvent (QEvent *event)
 Catches parent changes (in order to gain access to the title bar)
bool eventFilter (QObject *watched, QEvent *event)
 Filters other object's events (customizes title bar's context menu)
void init ()
 Initialization.
void retranslateStrings ()

Protected Attributes

QWidget * d_control_tabs
 Widget that contains the control tabs UI from ui.
QToolButton * d_hide_button
 Button to toogle the visibility of #d_tool_box.
QHBoxLayout * d_main_layout
future::Matrixd_matrix
MatrixModeld_model
 Pointer to the current underlying model.
MatrixViewWidgetd_view_widget
 The matrix view (first part of the UI)
Ui::MatrixControlTabs ui
- Protected Attributes inherited from MyWidget
bool askOnClose
 Toggle on/off: Ask the user "delete, hide, or cancel?" on a close event.
QString birthdate
 The creation date.
CaptionPolicy caption_policy
 The caption policy.
FolderparentFolder
 Pointer to the parent folder of the window.
QWidget * titleBar
 Title bar of this MDI window if it currently belongs to a QWorkspace, NULL else.
QString w_label
 The window label.
Status w_status
 The window status.

Additional Inherited Members

- Public Types inherited from MyWidget
enum  CaptionPolicy { Name = 0, Label = 1, Both = 2 }
 Possible window captions. More...
enum  Status { Hidden = -1, Normal = 0, Minimized = 1, Maximized = 2 }

Detailed Description

View class for Matrix.


Constructor & Destructor Documentation

MatrixView::MatrixView ( future::Matrix matrix)

Constructor.

References d_model, and init().

MatrixView::~MatrixView ( )
virtual

Destructor.

References d_model.


Member Function Documentation

void MatrixView::advanceCell ( )
protectedslot

Advance current cell after [Return] or [Enter] was pressed.

References d_matrix, d_view_widget, and future::Matrix::rowCount().

Referenced by init().

void MatrixView::applyCoordinates ( )
slot

References d_matrix, future::Matrix::setCoordinates(), and ui.

Referenced by init().

void MatrixView::applyFormat ( )
slot
void MatrixView::applyFormula ( )
slot

Reimplemented in Matrix.

References d_matrix, future::Matrix::setFormula(), and ui.

Referenced by init().

void MatrixView::changeEvent ( QEvent *  event)
protectedvirtual

Catches parent changes (in order to gain access to the title bar)

Reimplemented from MyWidget.

References retranslateStrings().

int MatrixView::columnWidth ( int  col) const
void MatrixView::controlTabBarStatusChanged ( bool  visible)
signal
bool MatrixView::eventFilter ( QObject *  object,
QEvent *  e 
)
protected

Filters other object's events (customizes title bar's context menu)

Reimplemented from MyWidget.

References d_matrix, d_view_widget, future::Matrix::showMatrixViewColumnContextMenu(), future::Matrix::showMatrixViewContextMenu(), and future::Matrix::showMatrixViewRowContextMenu().

int MatrixView::firstSelectedColumn ( bool  full = false)
int MatrixView::firstSelectedRow ( bool  full = false)
void MatrixView::getCurrentCell ( int *  row,
int *  col 
)

Determine the current cell (-1 if no cell is designated as the current)

References d_view_widget.

Referenced by future::Matrix::pasteIntoSelection().

void MatrixView::goToCell ( int  row,
int  col 
)
slot
void MatrixView::handleHorizontalSectionResized ( int  logicalIndex,
int  oldSize,
int  newSize 
)
slot
void MatrixView::handleVerticalSectionResized ( int  logicalIndex,
int  oldSize,
int  newSize 
)
slot
void MatrixView::init ( )
protected
bool MatrixView::isCellSelected ( int  row,
int  col 
)
bool MatrixView::isColumnSelected ( int  col,
bool  full = false 
)

Returns true if column 'col' is selected; otherwise false.

If full is true, this function only returns true if the whole column is selected.

References d_view_widget.

Referenced by future::Matrix::clearSelectedColumns(), Matrix::columnsSelected(), firstSelectedColumn(), handleHorizontalSectionResized(), lastSelectedColumn(), Matrix::numSelectedColumns(), future::Matrix::removeSelectedColumns(), and selectedColumnCount().

bool MatrixView::isControlTabBarVisible ( )
inline

References d_control_tabs.

bool MatrixView::isRowSelected ( int  row,
bool  full = false 
)

Returns true if row 'row' is selected; otherwise false.

If full is true, this function only returns true if the whole row is selected.

References d_view_widget.

Referenced by future::Matrix::clearSelectedRows(), firstSelectedRow(), handleVerticalSectionResized(), lastSelectedRow(), Matrix::numSelectedRows(), future::Matrix::removeSelectedRows(), Matrix::rowsSelected(), and selectedRowCount().

int MatrixView::lastSelectedColumn ( bool  full = false)
int MatrixView::lastSelectedRow ( bool  full = false)
void MatrixView::rereadSectionSizes ( )
slot
void MatrixView::retranslateStrings ( )
protected

References d_control_tabs, d_hide_button, and ui.

Referenced by changeEvent(), and init().

int MatrixView::rowHeight ( int  row) const

References d_view_widget.

void MatrixView::selectAll ( )
slot
int MatrixView::selectedColumnCount ( bool  full = false)

Return how many columns are selected.

If full is true, this function only returns the number of fully selected columns.

References future::Matrix::columnCount(), d_matrix, and isColumnSelected().

int MatrixView::selectedRowCount ( bool  full = false)

Return how many rows are (at least partly) selected.

If full is true, this function only returns the number of fully selected rows.

References d_matrix, isRowSelected(), and future::Matrix::rowCount().

Referenced by future::Matrix::addColumns(), and future::Matrix::addRows().

void MatrixView::setCellSelected ( int  row,
int  col 
)

Select a cell.

References d_model, d_view_widget, and MatrixModel::index().

Referenced by future::Matrix::pasteIntoSelection().

void MatrixView::setCellsSelected ( int  first_row,
int  first_col,
int  last_row,
int  last_col 
)

Select a range of cells.

References d_model, d_view_widget, and MatrixModel::index().

Referenced by future::Matrix::pasteIntoSelection().

void MatrixView::setColumnWidth ( int  col,
int  width 
)
void MatrixView::setRowHeight ( int  row,
int  height 
)
void MatrixView::showControlCoordinatesTab ( )
slot
void MatrixView::showControlFormatTab ( )
slot
void MatrixView::showControlFormulaTab ( )
slot
void MatrixView::toggleControlTabBar ( )
slot
void MatrixView::updateCoordinatesTab ( )
slot
void MatrixView::updateFormatTab ( )
slot
void MatrixView::updateFormulaTab ( )
slot

References d_matrix, future::Matrix::formula(), and ui.

Referenced by init().

void MatrixView::updateTypeInfo ( )
protectedslot

References ui.

Referenced by init().


Member Data Documentation

QWidget* MatrixView::d_control_tabs
protected
QToolButton* MatrixView::d_hide_button
protected
QHBoxLayout* MatrixView::d_main_layout
protected

Referenced by init().

future::Matrix* MatrixView::d_matrix
protected
MatrixModel* MatrixView::d_model
protected

Pointer to the current underlying model.

Referenced by goToCell(), init(), isCellSelected(), MatrixView(), setCellSelected(), setCellsSelected(), and ~MatrixView().

MatrixViewWidget* MatrixView::d_view_widget
protected
Ui::MatrixControlTabs MatrixView::ui
protected

The documentation for this class was generated from the following files: