Browse Prior Art Database

Implementing the Grid Control in an OS/2 PM Environment

IP.com Disclosure Number: IPCOM000114042D
Original Publication Date: 1994-Nov-01
Included in the Prior Art Database: 2005-Mar-27
Document File: 4 page(s) / 156K

Publishing Venue

IBM

Related People

Dankovich, JA: AUTHOR [+3]

Abstract

The OS/2* operating system, with its Presentation Manager* (PM) graphical user interface, provides an application developer with the choice of many different controls and control types. These include lists, entry fields, containers, text, combo boxes, buttons and many more. However, there is no control provided that can be used to present a matrix to the user.

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

Implementing the Grid Control in an OS/2 PM Environment

      The OS/2* operating system, with its Presentation Manager* (PM)
graphical user interface, provides an application developer with the
choice of many different controls and control types.  These include
lists, entry fields, containers, text, combo boxes, buttons and many
more.  However, there is no control provided that can be used to
present a matrix to the user.

      A matrix, or grid, control, is one that presents a rectangular
grid of interconnected squares to the user.  Each square in the grid
can be independently selected and displayed in a selected or
unselected state.  The grid can be used to represent the
two-dimensional relationship between any number of objects.  An
example of the use of the grid control is for calendars and
scheduling.  With the columns representing the days of the week, and
the rows representing hours of the day, we have a 7x24 grid.  The
squares within the grid can be selected to represent an individual's
scheduled meetings for any given hour of each day of the week, or the
scheduling of a conference room.  The uses of the grid for calendars
and scheduling are limitless, and greatly increase the ease with
which a schedule can be established or understood at a glance.

      While the concept of the grid control itself is not new, it is
not provided by OS/2 as a pre-existing PM control and must therefore
be implemented from scratch by any application that wishes to use it
in its user interface.  This disclosure describes the properties and
implementation details of the new grid control as implemented in PM,
along with the PM messages that need to be handled to provide that
implementation.

      The grid control at its foundation is a collection of
interlocked squares.  This grid can be drawn on the screen using the
GpiPolyLineDisjoint API, passing in an array of the endpoints of each
of the lines needing to be drawn to present the grid.  The endpoints
are calculated by first querying the size of the space available to
the grid, using the WinQueryWindowRect API.  The column width is the
grid width divided by the number of columns.  The row height is the
grid height divided by the number of rows.  When the dialog in which
the grid exists is resized, the grid will reflow to fill the newly
available space.

      Column heading and row prefixes can be drawn above and to the
left of the grid, respectively, to indicate the meaning of the
current use of the grid.  When the grid resizes, the column headings
will reposition themselves to remain over their respective columns,
and the row prefixes will reposition to remain opposite their
respective rows.

      The grid will be specified by the panel designer in terms of
the initial size of the grid in the dialog, and by number of rows and
columns desired.  The size of the individual squares is dependent on
all of these factors, and can change as the dialog is resized.

 ...