Chart2 Single-Click Concept

From Apache OpenOffice Wiki
Revision as of 16:29, 21 August 2006 by Bm@openoffice.org (Talk | contribs)

Jump to: navigation, search

Currently, users have to do a double-click to activate a chart object embedded in a container document. After the double click, a following single-click selects the object below the mouse cursor. As this is quite complicated and not expected by users, the new chart should be able to do the activation and selection of an object in one step.

This is a proposal for solving this issue.

Activation Behaviour

Currently, we favor a mechanism that does the following:

  • When a Calc document is loaded, for all charts that have a certain flag the model should be loaded, but no view should be created unless there is no replacement-image available. See below (#Loading Charts that use Calc Data Early enough) for a more detailed information about this.
  • So, a chart usually shows its replacement image. When a user clicks on the chart object with a single click, the container application must activate the chart (State UI_ACTIVE), convert the current mouse cursor position to local coordinates of the embedded object and pass them via an (to-be-defined) interface. Then the chart shows the same behaviour like when a single click is done at this position while being UI-active.
  • We have to find out if a double-click in the chart is also available with this mechanism. (I.e., a user double-clicks, which does the same as a double-click in an activated chart, which is, opens the properties dialog of the selected object).
  • Disadvantages: With this mechanism, the quick help texts that are shown when hovering with the mouse over chart objects will not be available until the chart is activated. That is, a user must at least have clicked once into the chart for activation to have the quick help available.
  • Advantages: As the replacement images are still used (when available), scrolling through a document containing charts is much faster as no views have to be created until the chart is activated (by a single-click).


Loading Charts that use Calc Data Early enough

Charts that take their data from a container Calc or Writer document, should be loaded directly after the container document was loaded, so that they can attach as XModifyListener at the data ranges they get for data ot be able to update changed ranges in the model or trigger the view to repaint when values have changed (apparently by setting themselves to modified which results in a refresh of the replacement image).

Things to take into account with this mechanism:

  • Loading of the XModel of the charts should be fast enough to avoid a performance issue with this change.
  • Charts that do not have to be loaded immediately, because they have their own data should not be loaded immediately. We should find some flag that a chart can have to tell the container whether it should be loaded immediately or later. (There exists the xlink:actuate attribute in the draw:object element that contains the chart in a Calc document which is usually set to "onLoad". There is also the attribute xlink:type which says "simple" for charts, currently. We have to check this.)
  • There is an OLE-cache that swaps out the model of OLE objects if too many of them are currently loaded. This mechanism must not be enabled for charts that need to have a running model to get notified about changes of the underlying data. There exists a mechanism to set an OLE-object to the "always_running" state which tells the OLE-cache not to remove those objects. This flag could also be used for the information whether to load an object immeditely mentioned before.
Personal tools