KSpreadCanvas Class Reference
The canvas builds a part of the GUI of KSpread. More...
#include <kspread_canvas.h>
Inheritance diagram for KSpreadCanvas:


Public Types | |
enum | MouseActions { NoAction = 0, Mark = 1, ResizeCell = 2, AutoFill = 3 } |
enum | EditorType { CellEditor, FormulaEditor, EditWidget } |
Public Slots | |
void | slotScrollVert (int _value) |
void | slotScrollHorz (int _value) |
void | slotMaxColumn (int _max_column) |
void | slotMaxRow (int _max_row) |
Public Member Functions | |
KSpreadCanvas (KSpreadView *_view) | |
KSpreadView * | view () |
KSpreadDoc * | doc () |
void | init () |
KSpreadEditWidget * | editWidget () const |
KSpreadCellEditor * | editor () const |
int | chooseTextLen () const |
KSpreadSelection * | selectionInfo () const |
QRect | selection () const |
QPoint | marker () const |
int | markerColumn () const |
int | markerRow () const |
void | updateCellRect (const QRect &_rect) |
void | updateSelection (const QRect &oldSelection, const QPoint &oldMarker) |
const QPen & | defaultGridPen () const |
double | zoom () const |
double | xOffset () const |
double | yOffset () const |
QRect | visibleCells () |
KSpreadSheet * | activeSheet () const |
KSpreadSheet * | findSheet (const QString &_name) const |
bool | gotoLocation (const KSpreadRange &_range) |
bool | gotoLocation (const KSpreadPoint &_cell) |
void | gotoLocation (QPoint const &location, KSpreadSheet *sheet=NULL, bool extendSelection=false) |
void | gotoLocation (int col, int row, KSpreadSheet *sheet=NULL, bool extendSelection=false) |
void | paintUpdates () |
void | scrollToCell (QPoint location) |
void | createEditor () |
bool | createEditor (EditorType type, bool addFocus=true) |
void | deleteEditor (bool saveChanges) |
void | setLastEditorWithFocus (EditorType type) |
void | startChoose () |
void | startChoose (const QRect &selection) |
void | endChoose () |
bool | chooseMode () const |
void | adjustArea (bool makeUndo=true) |
void | equalizeRow () |
void | equalizeColumn () |
void | updatePosWidget () |
void | closeEditor () |
void | setEditWidget (KSpreadEditWidget *ew) |
virtual bool | focusNextPrevChild (bool) |
bool | chooseFormulaArea () const |
double | autoScrollAccelerationX (int offset) |
double | autoScrollAccelerationY (int offset) |
Protected Member Functions | |
virtual void | keyPressEvent (QKeyEvent *_ev) |
virtual void | paintEvent (QPaintEvent *_ev) |
virtual void | mousePressEvent (QMouseEvent *_ev) |
virtual void | mouseReleaseEvent (QMouseEvent *_ev) |
virtual void | mouseMoveEvent (QMouseEvent *_ev) |
virtual void | mouseDoubleClickEvent (QMouseEvent *) |
virtual void | wheelEvent (QWheelEvent *) |
virtual void | focusInEvent (QFocusEvent *) |
virtual void | focusOutEvent (QFocusEvent *) |
virtual void | resizeEvent (QResizeEvent *_ev) |
virtual void | dragMoveEvent (QDragMoveEvent *_ev) |
virtual void | dropEvent (QDropEvent *_ev) |
virtual void | dragLeaveEvent (QDragLeaveEvent *_ev) |
Friends | |
class | KSpreadHBorder |
class | KSpreadVBorder |
class | KSpreadView |
Detailed Description
The canvas builds a part of the GUI of KSpread.It contains the borders, scrollbars, editwidget and of course it displays the sheet. Especially most of the user interface logic is implemented here. That means that this class knows what to do when a key is pressed or if the mouse button was clicked.
Definition at line 80 of file kspread_canvas.h.
Member Enumeration Documentation
|
The current action associated with the mouse. Default is 'NoAction'. Definition at line 92 of file kspread_canvas.h. |
Member Function Documentation
|
Called from KSpreadView to complete the construction. Has to be called before any other method on this object may be invoced. |
|
If the user chooses some cells during editing a formula, then this function returns the length of the textual representation. For example the user selects "Sheet1!A1:B2" then this function returns 12. Definition at line 293 of file kspread_canvas.cc. |
|
Returns the width of the columns before the current screen.
Definition at line 229 of file kspread_canvas.cc. Referenced by gotoLocation(), paintUpdates(), scrollToCell(), and visibleCells(). |
|
Returns the height of the rows before the current screen.
Definition at line 234 of file kspread_canvas.cc. Referenced by gotoLocation(), paintUpdates(), scrollToCell(), and visibleCells(). |
|
Return a rect indicating which cell range is currently visible onscreen.
Definition at line 3378 of file kspread_canvas.cc. References xOffset(), and yOffset(). Referenced by paintUpdates(). |
|
A convenience function.
Definition at line 404 of file kspread_canvas.cc. Referenced by gotoLocation(). |
|
A convenience function.
Definition at line 426 of file kspread_canvas.cc. References gotoLocation(). |
|
Move the cursor to the specified cell. This may include switching the sheet. In addition KSpreadView::updateEditWidget is called.
Definition at line 447 of file kspread_canvas.cc. References KSpreadCell::column(), KSpreadCell::dblHeight(), KSpreadCell::dblWidth(), KSpreadCell::getValidity(), KSpreadCell::isObscured(), KSpreadCell::isObscuringForced(), KSpreadCell::obscuringCells(), KSpreadCell::row(), scrollToCell(), xOffset(), and yOffset(). |
|
convenience function
Definition at line 180 of file kspread_canvas.h. |
|
Paint all visible cells that have a paint dirty flag set.
Definition at line 3400 of file kspread_canvas.cc. References KSpreadCell::calc(), KSpreadCell::effBottomBorderPen(), KSpreadCell::effBottomBorderValue(), KSpreadCell::effLeftBorderPen(), KSpreadCell::effLeftBorderValue(), KSpreadCell::effRightBorderPen(), KSpreadCell::effRightBorderValue(), KSpreadCell::effTopBorderPen(), KSpreadCell::effTopBorderValue(), KSpreadCell::isDefault(), KSpreadCell::makeLayout(), KSpreadCell::paintCell(), visibleCells(), xOffset(), and yOffset(). |
|
Makes sure a cell is visible onscreen by scrolling up/down and left/right.
Definition at line 588 of file kspread_canvas.cc. References xOffset(), and yOffset(). Referenced by gotoLocation(). |
|
Chooses the correct EditorType by looking at the current cells value. By default CellEditor is chosen. Definition at line 2891 of file kspread_canvas.cc. |
|
Deletes the current cell editor.
Definition at line 2847 of file kspread_canvas.cc. |
|
Called from KSpreadEditWidget and KSpreadCellEditor if they loose the focus because the user started a "choose selection". This is done because the editor wants to get its focus back afterwards. But somehow KSpreadCanvas must know whether the EditWidget or the CellEditor lost the focus when the user clicked on the canvas. Definition at line 244 of file kspread_canvas.cc. |
|
Switches to choose mode and sets the initial selection to the position returned by marker.
Definition at line 333 of file kspread_canvas.cc. |
|
Switches to choose mode and sets the initial
Definition at line 345 of file kspread_canvas.cc. |
|
Adjust a area in height and width.
Definition at line 3301 of file kspread_canvas.cc. |
|
Depending on the offset in "zoomed" screen pixels for the horizontal direction, the function returns the steps in unzoomed points for the autoscroll acceleration.
Definition at line 2823 of file kspread_canvas.cc. |
|
Depending on the offset in "zoomed" screen pixels for the vertical direction, the function returns the steps in unzoomed points for the autoscroll acceleration.
Definition at line 2835 of file kspread_canvas.cc. |
The documentation for this class was generated from the following files: