kspread
KSpread::Canvas Class Reference
#include <kspread_canvas.h>
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 89 of file kspread_canvas.h.
Public Types | |
enum | MouseActions { NoAction, Mark, ResizeCell, AutoFill, ResizeSelection } |
enum | EditorType { CellEditor, EditWidget } |
Public Slots | |
void | slotScrollVert (int _value) |
void | slotScrollHorz (int _value) |
void | slotMaxColumn (int _max_column) |
void | slotMaxRow (int _max_row) |
Signals | |
void | objectSelectedChanged () |
void | objectSizeChanged () |
Public Member Functions | |
Canvas (View *_view) | |
View * | view () const |
Doc * | doc () const |
KSpread::EditWidget * | editWidget () const |
KSpread::CellEditor * | editor () const |
Selection * | selectionInfo () const |
Selection * | choice () const |
QRect | selection () const |
QPoint | marker () const |
int | markerColumn () const |
int | markerRow () const |
const QPen & | defaultGridPen () const |
double | zoom () const |
double | xOffset () const |
double | yOffset () const |
void | setXOffset (double _xOffset) |
void | setYOffset (double _yOffset) |
QRect | visibleCells () const |
Sheet * | activeSheet () const |
Sheet * | findSheet (const QString &_name) const |
void | validateSelection () |
void | paintUpdates () |
void | scrollToCell (QPoint location) const |
void | createEditor (bool captureArrowKeys=false) |
bool | createEditor (EditorType type, bool addFocus=true, bool captureArrowKeys=false) |
void | deleteEditor (bool saveChanges, bool array=false) |
void | setLastEditorWithFocus (EditorType type) |
void | startChoose () |
void | startChoose (const QRect &selection) |
void | endChoose () |
void | setChooseMode (bool state) |
bool | chooseMode () const |
void | equalizeRow () |
void | equalizeColumn () |
void | updatePosWidget () |
void | closeEditor () |
void | setEditWidget (KSpread::EditWidget *ew) |
virtual bool | focusNextPrevChild (bool) |
double | autoScrollAccelerationX (int offset) |
double | autoScrollAccelerationY (int offset) |
EmbeddedObject * | getObject (const QPoint &pos, Sheet *_sheet) |
void | selectAllObjects () |
void | deselectAllObjects () |
void | selectObject (EmbeddedObject *) |
void | deselectObject (EmbeddedObject *) |
void | setMouseSelectedObject (bool b) |
bool | isObjectSelected () |
void | moveObjectsByMouse (KoPoint &pos, bool keepXorYunchanged) |
void | resizeObject (ModifyType _modType, const KoPoint &point, bool keepRatio) |
void | finishResizeObject (const QString &name, bool layout=true) |
void | raiseObject (EmbeddedObject *object) |
void | lowerObject () |
void | displayObjectList (QPtrList< EmbeddedObject > &list) |
KoRect | objectRect (bool all) const |
void | repaintObject (EmbeddedObject *obj) |
void | copyOasisObjects () |
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) |
bool | highlightRangeSizeGripAt (double x, double y) |
Friends | |
class | HBorder |
class | VBorder |
class | View |
Member Enumeration Documentation
|
The current action associated with the mouse. Default is 'NoAction'.
Definition at line 101 of file kspread_canvas.h. |
Member Function Documentation
|
|
|
Depending on the offset in "zoomed" screen pixels for the horizontal direction, the function returns the steps in unzoomed points for the autoscroll acceleration.
|
|
Depending on the offset in "zoomed" screen pixels for the vertical direction, the function returns the steps in unzoomed points for the autoscroll acceleration.
|
|
|
|
|
|
Close the cell editor and saves changes.
|
|
This is intended to copy the selected objects to the clipboard so that they can be pasted into other applications. However, until at least KWord, KSpread, KPresenter, KChart and KFormula have consistant support for copying and pasting of OASIS objects the selected objects will just be copied in the form of raster graphics |
|
Chooses the correct EditorType by looking at the current cells value. By default CellEditor is chosen. |
|
|
|
Deletes the current cell editor.
|
|
Get the list of objects in the order they should be displayed. This takes into acount the object set in raiseObject so that it is the last one in the list returned (the one that is displayed above all the others).
|
|
Switches to selection mode. Clear the choice. |
|
convenience function
|
|
create KPrResizeCmd
|
|
Checks to see if there is a size grip for a highlight range at a given position. Note that both X and Y coordinates are UNZOOMED. To translate from a zoomed coordinate (eg. position of a mouse event) to an unzoomed coordinate, use Doc::unzoomItX and Doc::unzoomItY. The document object can be accessed via view()->doc()
|
|
Don't display an object above the others.
|
|
convenience function.
|
|
convenience function.
|
|
convenience function.
|
|
Move object by mouse.
|
|
Paint all visible cells that have a paint dirty flag set.
|
|
Display object above the other objects in editiong mode. This is used to bring a single slected object to front, so it is easier to modify.
|
|
resize the m_resizeObject
|
|
Makes sure a cell is visible onscreen by scrolling up/down and left/right.
|
|
|
|
|
|
Switches the choose mode on and off. Does not clear the choice. |
|
Called from EditWidget and CellEditor 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 Canvas must know whether the EditWidget or the CellEditor lost the focus when the user clicked on the canvas. |
|
Sets the width of the columns before the current screen.
|
|
Sets the height of the rows before the current screen.
|
|
Switches to choose mode and sets the initial
|
|
Switches to choose mode and sets the initial selection to the position returned by marker(). Clears the choice. |
|
Updates the position widget.
|
|
Validates the selected cell.
|
|
|
|
|
|
|
|
convenience function
|
The documentation for this class was generated from the following file: