wiki:FRAME_POSITION_R0

Version 5 (modified by mira, 16 years ago) (diff)

--

Error: Macro BackLinksMenu(None) failed
compressed data is corrupt

Error: Macro TicketQuery(summary=FRAME_POSITION_R0, format=table, col=summary|owner|status|type|component|priority|effort|importance, rows=description|analysis_owners|analysis_reviewers|analysis_score|design_owners|design_reviewers|design_score|implementation_owners|implementation_reviewers|implementation_score|test_owners|test_reviewers|test_score|) failed
current transaction is aborted, commands ignored until end of transaction block

Analysis

Overview

The frames could have different position(coordinates) in relation to the upper left angle of the page. They could overlap and the frame should always be able to fit into the page. Therefore whenever a negative coordinate occurs(because of a drag and drop for example) the page size and position is recalculated. That way the negative coordinate is set to 0. Other frames recalculate their coordinates as well so that their relative positions are kept. The same is done for a bigger than pages hight or width coordinate. There is a "clipping part" of the page though and in reader mode only the frames that are inside it are visible.

Task requirements

  • The frame should have property for the distance to the top of the page. It should be greater than 0 and less than (pages hight-frames high).
  • The frame should have property for the distance to the left end of the page. It should be greater than 0 and less than (pages width-frames width).

Task result

The result of this task is source code.

Implementation idea

  • Create Position class extending ProObject with properties for the frames upper left position.
  • Add Position position property to the Frame.
  • Recalculate all coordinates when needed so that the conditions are kept for all frames.

How to demo

  • Create frame with concrete coordinates and check if they are correct.
  • Try creating a frame with incorrect coordinates.
  • Change the frames coordinates and check that its position is updated.