Scalable three-dimensional window borders

Abstract: In a data processing system having memory means, a processor that produces a user interface and an output device with a resolution of a number of horizontal dots per inch and a number of vertical dots per inch, a method comprising the steps of (a) determining with the processor a minimum border width for each border in the interface for the border to be sufficiently visible, based on the resolution of the output device, each border having vertical edges and horizontal edges, (d) determining with the processor a minimum border height for each border in the user interface for the border to be sufficiently visible, based on the resolution of the output device, and (c) drawing the vertical edges of the borders in the user interface to have the minimum border width and drawing the horizontal edges of the borders to have the minimum border height.

Description: Technical Field The present invention relates to the use of scalable three-dimensional borders in a user interface of a data processing system. Background of the Invention Many operating systems provide user interfaces that are well adapted for display on video displays of a given type but are not well adapted for display on video displays of other types. For instance, the borders of items in a user interface may not be clearly legible on video displays with high resolution. In addition, the colors of borders in the user interface may also not be well suited for given types of video displays. The borders that are provided in user interfaces are typically two dimensional borders that provide no sense of depth. As a result, the user interfaces do not provide visual cues to users regarding the nature of items (like buttons) which are presumed to be three dimensional. Three dimensional borders have been used in certain user interfaces, but have generally been unsatisfactory. Summary of the Invention In accordance with the present invention, a method is practiced in the data processing system having a memory means, an output device, such as a printer or video display, and a processor that produces a user interface. The output device has a resolution that may be specified in terms of number of horizontal dots (e.g., pixels) per inch and number of vertical dots per inch. In accordance with the method, a minimum border width for each border in the user interface is determined by the processor. The minimum border width is chosen to be sufficiently visible for the given resolution of the output device. The processor is also used to determine a minimum border height for each border in the user interface. The minimum border height is chosen to be sufficiently visible for the given resolution of the output device. Vertical edges of the borders are drawn in the user interface to have the minimum border width, and horizontal edges of the borders are drawn to have the minimum border height. The memory means of the data processing system may hold system metrics, including the minimum border height and the minimum border width. In addition, other system metrics may be scaled to have values that are proportional to the minimum border height or the minimum border width. These other system metrics are stored in the memory means as well. The minimum border width may be calculated as an integer portion of the sum of the number of horizontal dots per inch on the output device and seventy-one, divided by seventy-two. Likewise, the minimum border height may be calculated as an integer portion of (the sum of the number of vertical dots per inch on the output device and 71) divided by 72. The borders may be drawn as three-dimensional borders. Brief Description of the Drawings A preferred embodiment of the present invention will be described hereinafter with reference to the drawings. The drawings include the following figures. Figure 1 is a block diagram of a data processing system that is suitable for practicing the preferred embodiment of the present invention. Figure 2 is a flowchart illustrating the steps that are performed to scale border dimensions relative to video display resolution and to scale system metrics relative to the border dimensions in accordance with the preferred embodiment of the present invention. Figure 3 is an example of a combined border generated in accordance with the preferred embodiment of the present invention. Figure 4 is a flowchart illustrating the steps performed to determine a range of luminance values for shades that are assigned to border edges in accordance with the preferred embodiment of the present invention. Figures 5a, 5b, 5c and 5d each show inner or outer borders for combined borders generated in accordance with the preferred embodiment of the present invention. Figures 6a, 6b, 6c, 6d and 6e each show combined borders that are generated in accordance with the preferred embodiment of the present invention. Detailed Description of the Invention A preferred embodiment of the present invention provides scalable three-dimensional borders for graphic elements of a system user interface. The borders are scalable in that they may be scaled for display with different types of systems. The borders provided by the preferred embodiment of the present invention are three dimensional in that they are shaded to give the illusion of depth. Figure 1 is a block diagram illustrating a data processing system 10 for implementing the preferred embodiment of the present invention. The data processing system 10 includes a single central processing unit (CPU) 12. Those skilled in the art will appreciate that the present invention is not limited to use within a single processor data processing system; rather, the present invention may also be implemented in data processing systems having more than one processor, such as a distributed system. The daca processing system 10 includes a memory 14 that may include different types of storage, such as RAM, ROM and/or secondary storage. The memory 14 holds numerous items, including a copy of an operating system 15. The preferred embodiment of the present invention is implemented by code that is incorporated into the operating system 16. A keyboard 18, a mouse 20, a video display 22, and a printer 23 are also provided in the data processing system 10. The preferred embodiment of the present invention will be described hereinafter relative to output on the video display 22. It should be appreciated that the present invention also is applicable to borders that are printed on printers, such as printer 23. A first type of scalability provided by the preferred embodiment of the present invention concerns the scalability of dimensions of the borders (i.e., border width and border height). The border height and border width are scalable to compensate for the resolution of the video display 22 so that the borders are readily visible. Border width is set in the preferred embodiment as the minimum number of pixels that are required to clearly see a vertical border line on the video display 22. Border height, in contrast, is set as the minimum number of pixels required to clearly see a horizontal border line on the video display 22. If the output is destined instead for printer 23, the minimum border height and minimum border width are specified in terms of dots. In general, "dots" is used hereinafter to encompass both pixels and dots generated by a printer (such as a dot matrix printer). A border is formed by a rectangular frame whose vertical border edges are 1 border width wide and whose horizontal border edges are 1 border height high. The border height and border width are determined primarily by the size of the pixels provided on the video display 22. Large pixels imply a small border height and a small border width, whereas small pixels imply a large border height and a large border width. In general, given a resolution or 72 pixels per inch, a border width of 1 and a border height of 1 are sufficient for the border edges to be clearly visible. Many video displays 22, however, have a greater resolution than 72 pixels per inch and, thus, have smaller pixels. In such video displays, a border width of 1 and a border height of 1 result in a border that is not clearly visible to most viewers. The preferred embodiment of the present invention, in contrast, provides a border having a greater border width and a greater border height that results in the borders being more visible. Figure 2 is a flowchart showing the steps performed by the preferred embodiment of the present invention to scale the border height and border width of the borders to account for the resolution of the video display 22. First, a border width that has the minimum number of pixels that are necessary to make the border sufficiently visible, given the resolution of the video display 22, is calculated (step 24). The border width is calculated to be equal to (the sum of the number of horizontal pixels per inch on the video display and 71) divided by 72. The border height is also calculated in an analogous manner (step 26). The border height is calculated as (the sum of the number of vertical pixels per inch and 71) divided by 72. If the border output is destined for printer 23, resolution is measured in terms of dots per inch. The calculated values of the border width and the border height are stored as "system metrics" (such as found in the Microsoft WINDOWS, version 3.1, operating system). The operating system 16 provides a number of system metrics that may be accessed using the GetSystemMetrics() function. The system metrics provide a convenient means for quickly obtaining metrics for graphical activities. A parameter that is passed to the GetSystemMetrics() function is an index to one of the system metrics. The border width and the border height are stored as separately indexed system metrics (SM_CXBORDER and SM_CYBORDER, respectively). To preserve relative dimensions among the system metrics, the preferred embodiment of the present invention scales the other system metrics relative to the border width and/or the border height (step 28). In particular, the system metrics that relate to the X dimension are scaled relative to the border width, and the system metrics that relate to the Y dimension are scaled relative to the border height. The system metrics that do not relate to either the X dimension or the Y dimension are not scaled. For example, a system metric is provided to specify the tolerance in the X direction for a double click of the mouse (i.e., how close the cursor must be to an object in the X direction before a double click of the mouse is deemed to be a double click on the object). This system metric is scaled relative to border width. Thus, not only are border width and border height scalable, but the outer system metrics are also scalable in the preferred embodiment of the present invention. The preferred embodiment of the present invention provides three-dimensional borders. Several assumptions are made in order to provide three-dimensional borders. First, the surfaces of all borders are assumed to be composed of a solid-color metallic material which reflects all light that strikes them. Moreover, since each surface is assumed to be a solid, depth changes are rendered as linear color changes. A "shadow" border edge is a border edge which neither receives direct light nor has a line of sight with a light source. A "glare" border edge is a border edge which receives both direct light and has a line of sight with the light source. Shadow border edges and glare border edges are rendered in a linear fashion. Border edges which are not shadows border edges or glare border edges are glance border edges that receive diffuse lighting. Another assumption made by the preferred embodiment of the present invention is that the light source for all displayed objects is in the top left-hand corner of the video display 22. The preferred embodiment further assumes that all border surfaces are composed of planes that are either parallel to the video display surface or perpendicular to the video display surface. The border surfaces that are parallel to the screen are flat, whereas the border surfaces that are perpendicular to the video display surface lead to flat border surfaces that appear raised above or sunken below the level of another parallel surface. The border surfaces are assumed to be rectangular. As a result of these constraints, the borders provided by the preferred embodiment are rectangular frames having glare border edges and shadow border edges that vary from the surface color by being lighter or darker than the surface color, respectively. The glare border edges mark transitions from a flat surface below the level of another flat surface. The shadow border edges mark transitions from a flat surface above the level of another flat surface. Each border is divided into an outer border 30 (Figure 3) and an inner border 32. The outer border 30 and inner border 32 are concentric, as shown in Figure 3. The outer border 30 and the inner border 32 each have a relative depth that specifies how the border should appear relative to the video display surface (i.e., surface below the surface or raised above the surface). Shading is used provide the illusion of depth of the outer border and the inner border. The shades that are used for the different depths of the inner border and outer border are defined in relative terms that may be easily scaled to the range of colors available on different systems. The range of available colors is defined by the video display and/or a video adapter for the display 22. In the preferred embodiment, the maximum transition of depth between two flat border surfaces is 2. In other words, if the depths are divided into logical levels, the minimum transition is two levels. Using this maximum transition of depth, the total number of shades required to properly shade the outer border 30 and the inner border 32 may be calculated as the sum of 1 plus 2 times the maximum depth (i.e., 1 + (2 x 2), which equals 5). The maximum depth is multiplied by 2 in the calculation to account for the border having two parts (i.e., inner border and outer border). The changes in the shading to differentiate depths of borders are performed by varying the luminance of portions of the borders. The luminance is a measure of the brightness or darkness of a color as it appears on the video display 22 (Figure 1). Figure 4 shows a flowchart of the steps performed by the preferred embodiment of the present invention to scale the luminance values for the borders. In general, most video displays 22 (Figure 1) and their adapters specify colors according to a red, green and blue (RGB) scale. The preferred embodiment of the present invention performs a conversion from the RGB scale to a hue, saturation and value (HSV) scale at system startup (i.e., each color is defined as a combination of hue, saturation and luminance). Saturation refers to the amount of intensity, and hue refers to a color family (e.g., pink). Value may be viewed as a grey scale version of a color, wherein the magnitude of the value specifies the amount of white in the color. The result of the conversion is used to obtain a range of luminances (which is quantified as the "value") that are available on the video display 22 (step 34 in Figure 4). A midpoint is then found in the range of luminances (step 36). The midpoint corresponds with the luminance of a "basic color" for border edges at depth 0. The remainder of the luminances are then partitioned to locate the required number of shades (step 38). In particular, the luminance values are partitioned to find shades that are evenly distributed across the range of luminances. For example, suppose that the luminances available on the video display 22 span a range from 0 to 240 in the HSV scale. The midpoint, at luminance 120, is a medium gray color in a monochrome scale. The remaining luminances are partitioned to locate four other shades that are equally spread across the range of available luminances. In the example range of 0 to 240, the four other shades are at 0 (i.e., black), 60 (i.e., dark gray), 180 (i.e., light gray) and 240 (i.e., white). The darker shades, 0 and 60, are used for the shadow border edges, whereas the lighter shades, 180 and 240, are used for the glare border edges. In addition to adjustments in luminances, the shadow border edges and glare border edges also differ slightly as to luminance values. Specifically, saturation values are increased by 10% for glare border edges and decreased by 10% for shadow border edges. The saturation values are increased for glare border edges because light reflects strongly off such border edges. In contrast, the saturation values are decreased for shadow border edges because light reflects weakly off such border edges. A number of "equivalence classes" are defined for each of the depths, which range from -2 to +2 in the preferred embodiment of the present invention. The +1 equivalence class is for a raised outer border; the +2 border equivalence class is for a raised inner border; the -1 equivalence class is for a sunken outer border; and the -2 equivalence class is for a sunken inner border. Depth 0 is ignored because it represents the border surface at the video display surface. Each equivalence class has a number of colors that are uniquely associated with it. In particular, a glare border edge color, a glance border edge color and a shadow border edge color are associated with each equivalence class. As was discussed above, each border edge of a border is either a glare border edge, a glance border edge or a shadow border edge. In the preferred embodiment of the present invention, it is assumed that the light source is in the top left-hand corner of the video display 22 (Figure 1). As a result, each border includes only glare border edges and shadow border edges. The preferred embodiment of the present invention utilizes a set of single borders (i.e., raised inner border, raised outer border, sunken inner border and sunken outer border) as building blocks. When the borders are raised, the borders are constructed by combining a lighter shade for the top and left border edges (glare border edges) with a darker shade for the bottom and right border edges (shadow border edges). However, when the borders are sunken, the roles are reversed such that the top and left border edges are given a darker shade (shadow border edges) and the right and bottom border edges are given a lesser shade (glare border edges). Figures 5a-5d provide depictions of the resulting four building block borders. Figure 5a shows a raised inner border 41 (+2 equivalence class). The top and left border edges 40a are glare border edges and are assigned a white color with a luminance of 240 in the HSV scale. In contrast, the right and bottom border edges 40b are shadow border edges, and the border edges 40b are assigned a dark gray color with a luminance of 60 in the HSV scale. The luminances are assigned to the border edges in this fashion to give the illusion of height. The human eye perceives transitions from lighter to darker as the eye moves from left to right as a raised surface. Figure 5b shows a raised outer border 43 (+1 equivalence class). Like the raised inner border 41, in the raised outer border 43 the top and left border edges 42a are glare border edges and the right and bottom border edges 42b are shadow border edges. The top and left border edges 42a are given a light gray color with a luminance of 180 in the HSV scale, while the right and bottom border edges 42b are given a black color with a luminance of 0 in the HSV scale. As mentioned above, when the borders are sunken, the border edges that are glare border edges and the border edges that are shadow border edges are reversed relative to the border edges of the raised borders. Figure 5c shows an example of a sunken outer border 45 (+1 equivalence class). In the sunken outer border 45, the top and left border edges 42a are shadow border edges and assigned a dark gray color with a luminance of 60 in the HSV scale. The right and bottom border edges 42b are assigned a white color with a luminance of 240 in the HSV scale. The transition as one moves from left to right from a darker color to a lighter color is perceived as sunken. The shading of the inner border, likewise, changes when the inner border is sunken. Figure 5d shows an example of a sunken inner border 47 (-2 equivalence class). The top and left border edges 40a are shadow border edges and assigned a black color with a luminance of 0 in the HSV scale. The right and bottom border edges are glare border edges and assigned a color of light gray with a luminance of 180 in the HSV scale. Unfortunately, the inner borders 41 and 47 and the outer borders 43 and 45 do not alone provide a robust enough perception of height or depth. As such, the preferred embodiment of the present invention combines the inner and outer borders into pairs to improve the perception of depth. Figures 6a-6e illustrate the combined borders, consisting of combinations of inner and outer borders, that are provided by the preferred embodiment of the present invention. Figure 6a shows an example of a combined border 50 having a raised outer border 43' and a raised inner border 41'. This combined border 50 is used to achieve the appearance of height and is useful in providing borders for push buttons, graphic buttons, text buttons and scroll bar buttons. Since, however, push buttons and the like are likely to appear on the video display 22 adjacent to a gray background, the colors assigned to the top and left border edges for the outer border 43 and the inner border 41' are swapped from the raised outer border 43 (Figure 5b) and the raised lower border 41 (Figure 5a), that are described above. The colors are swapped because, otherwise, it is difficult to see the top and left border edges of the outer border against the gray background. Figure 6b shows an example of a combined border 52 that combines a sunken outer border 45 with a sunken inner border 47. This combined border 52 is useful to specify entry fields because the combined border provides the user with a visual cue that the entry field must be filled in. Figure 6c shows an example of a combined border 54 that combines a sunken outer border 45 with a raised inner border 41. Combined border 54 is useful as a group border that provides the user with a visual cue that objects surrounded by the group bcrder are related. Combined border 54 provides a visual perception of depth but at a lesser degree than combined border 52 (Figure 6b). Figure 6d shows an example of a combined border 56 that is used for push buttons. The combined border 56 includes a sunken outer border 45' and a sunken inner border 45'. The combined border 56 differs from the combined border 52 (Figure 6b) in that the colors assigned to the top and left border edges of the outer border and inner border are swapped. The colors for the top and left border edges are swapped because push buttons are typically adjacent to a gray background. By making the top and left border edges of the outer border 45' black, the necessary contrast exists to differentiate the push buttons from the background. A final combined border 58 that is provided in the preferred embodiment of the present invention is shown in Figure 6e. Combined border 58 combines a raised outer border 43 with a raised inner border 41. The colors of the top and left border edges of the outer border 43 and the inner border 41 are not reversed in this case, because the combined border 58 is used with window tiles that are most likely to be adjacent to a white background rather than a gray background. Accordingly, there is no need to swap the colors, as was done in combined border 50 of Figure 6a. The border styles provided by the preferred embodiment of the present invention differentiate controls on the system user interface such that the user has some visual indicator of the type of control. Moreover, the border styles indicate to the user what action may be performed on the control. As such, the preferred embodiment of the present invention enhances the ease with which controls may be utilized.

Claims: In a data processing system having memory means, a processor that produces a user interface and an output device with a resolution of a number of horizontal dots per inch and a number of vertical dots per inch, a method comprising the steps of: (a) determining with the processor a minimum border width for each border in the interface for the border to be sufficiently visible, based on the resolution of the output device, each border having vertical edges and horizontal edges; (d) determining with the processor a minimum border height for each border in the user interface for the border to be sufficiently visible, based on the resolution of the output device; and (c) drawing the vertical edges of the borders in the user interface to have the minimum border width and drawing the horizontal edges of the borders to have the minimum border height. The method of claim 1 wherein the memory means holds system metrics and the method further comprises the steps of: storing the minimum border height and the minimum border width in the memory means as system metrics; scaling other system metrics to have scaled values that are proportional to the minimum border height or the minimum border width; and storing the other system metrics in the memory means. The method as recited in claim 1 wherein the step of determining with the processor the minimum border width further comprises the step of calculating the minimum border with as a integer portion of: a sum of the number of horizontal dots per inch on the output device with seventy-one, divided by seventy two. The method as recited in claim 1 wherein the step of determining with the processor the minimum border height further comprises the step of calculating the minimum border height as an integer portion of: a sum of the number of vertical dots per inch on the output device with seventy-one, divided by seventy-two. The method as recited in claim 1 wherein the step of drawing the borders further comprises the step of drawing the borders as three-dimensional borders.

Inventors: BUTLER LAURA J, GRAUMAN JOYCE A, BUTLER, LAURA J., GRAUMAN, JOYCE A.
Applicants: MICROSOFT CORP, MICROSOFT CORPORATION
Application year: 1994
Main classification: G09G5
IPC codes: G09G5