Browse Prior Art Database

Maintaining Relative Icon Positions when Sizing a Container

IP.com Disclosure Number: IPCOM000112151D
Original Publication Date: 1994-Apr-01
Included in the Prior Art Database: 2005-Mar-26
Document File: 2 page(s) / 74K

Publishing Venue

IBM

Related People

Johnson, KD: AUTHOR [+2]

Abstract

The behavior of the OS/2* Workplace Shell* concerning icon positioning in a container in icon view with non-grid format is to keep icons in the same positions from the top and the left of the container whenever the size of a container is changed - i.e., by maximizing, minimizing, clicking and dragging the window, etc. This makes sense as default behavior for most cases. However, there are times when it would be more appropriate for the icons to have their relative position within the container maintained. For instance, if an icon is in the center of a container and that container's size is changed, the icon should still be in the relative center of the container.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 52% of the total text.

Maintaining Relative Icon Positions when Sizing a Container

      The behavior of the OS/2* Workplace Shell* concerning icon
positioning in a container in icon view with non-grid format is to
keep icons in the same positions from the top and the left of the
container whenever the size of a container is changed - i.e., by
maximizing, minimizing, clicking and dragging the window, etc.  This
makes sense as default behavior for most cases.  However, there are
times when it would be more appropriate for the icons to have their
relative position within the container maintained.  For instance, if
an icon is in the center of a container and that container's size is
changed, the icon should still be in the relative center of the
container.

      One example of why such a positioning algorithm is desirable is
described in the following scenario.  Icons representing various
entities are displayed in a container against a background bitmap.
The background bitmap might represent the state of Texas and the
defined icons might represent cities within the state of Texas.  The
bitmap is displayed within the viewable region of the container and
when the window is re-sized the bitmap is also re-size in order to
fill the new viewable region.  It makes sense that the icons (cities)
defined against the bitmap (Texas) should stay in their same relative
positions - i.e., Austin should continue to appear in its correct
relative location within the bitmap of Texas when the size of the
container is changed.

      The following is a basic description of the algorithm used to
maintain the relative positions of icons in a non-grid icon view
container when the container is re-sized:

1.  A WM_SIZE message is generated by PM signifying that the window
    is about to be re-sized.  The information sent in this message
    include the horizontal and vertical size of the old window and
    the horizontal and vertical size of the new window.  Processing
    in response to this message is described below.

2.  Obtain the coordinates of the container's old client area (the
    visible region of the container) before the window is resized.
    This is accomplished by sending the CM_QUERYVIEWPORTRECT message
    to the container control.

3.  Call the default panel procedure which cause...