Revision 825673

Go back to digest for 6th July 2008

Features in Office

Jan Hambrecht committed changes in /trunk/koffice/libs:

Implemented dragging of guide lines from the rulers.
When dragging outside of the ruler, the ruler emits a signal guideLineCreated which when connected to the KoCanvasControllers slot addGuideLine will temporary activate the KoGuidesTool.

This tool then positions the new guide line corresponding to the mouse movement.
When the mouse gets released, the guide line is added to the guides data provided by the canvas.

To add support for guide lines to an application one has to do the following steps:
1. when creating your rulers, connect the guideLineCreated signal with the canvas controllers addGuideLine slot.
2. In the canvas implementation, reimplement the guidesData function to provide access to the guides data of the applications KoDocument implementation.
3. In the canvas implementation call KoGuidesData::paintGuides to paint the guides.
4. Profit!!! :-)

File Changes

Added 4 files
  • /trunk/koffice/libs/flake/tools
  •   /KoGuidesTool.cpp
  •   /KoGuidesTool.h
  •   /KoGuidesToolFactory.cpp
  •   /KoGuidesToolFactory.h
Modified 11 files
  • /trunk/koffice/libs
  •   /flake/CMakeLists.txt
  •   /flake/KoCanvasBase.cpp
  •   /flake/KoCanvasBase.h
  •   /flake/KoCanvasController.cpp
  •   /flake/KoCanvasController.h
  •   /flake/KoToolManager.cpp
  •   /flake/KoToolManager.h
  •   /guiutils/KoRuler.cpp
  •   /guiutils/KoRuler.h
  •   /main/KoGuidesData.cpp
  •   /main/KoGuidesData.h
15 files changed in total