SYSCLR Information: Difference between revisions

From OS2World.Com Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
By [[Dean Roddey]]
==Intro==
==Intro==
Ok boys and girls. Here is some information that you've all been waiting for
Ok boys and girls. Here is some information that you've all been waiting for
Line 500: Line 502:
  The CIDLib Class Libraries
  The CIDLib Class Libraries
  http://www.jagunet.com/~droddey/
  http://www.jagunet.com/~droddey/
[[Category:Programming]]

Latest revision as of 20:54, 5 May 2024

By Dean Roddey

Intro

Ok boys and girls. Here is some information that you've all been waiting for I'm sure. I recently have started replacing more and more of the standard controls (within my class libraries) with custom controls of my own in order to avoid all of the compromises necessary to wrap existing windows.

One of the obvious things I needed to know is what system colors and presentation params control what. This is very poorly documented. Basically they say "we use this and that, override using that or the other", but they don't say what attributes of the window is affected and what overrides what. So, I wrote a program to figure all of this out and here are my results. I'm sure I missed some small stuff and/or some more obscure interactions, but this should go a long way.

It will probably get split into two messages because of the size. Anyway, enjoy it. Please, if you repost it, pass the whole thing with my name and address at the end so that A) I get credit for the work I did and B) people can contact me with errors or omissions that I can incorporate and repost. Thanks.

System Colors

SYSCLR_SHADOWHILITEBGND
SYSCLR_SHADOWHILITEFGND
   These values drive the colors of the text of a WPS
   Shadow icon when it is 'hilited' i.e., its the selected
   WPS object. The foreground color drives the text and
   the background drives the background color of the text.
SYSCLR_SHADOWTEXT
   This value drives the foreground of the text of a WPS
   Shadow icon when it is not the 'hilited' object, i.e.
   some other object has the selected emphasis.
SYSCLR_ENTRYFIELD
   This value is kind of overloaded. It controls the
   background of an entryfield control, as the name would
   suggest. But is also controls the backgrounds of list
   boxes and MLEs.
SYSCLR_MENUDISABLEDTEXT
   As the name would suggest, the foreground color of
   the text in disabled menu entries is controlled by
   this value.
SYSCLR_MENUHILITE
SYSCLR_MENUHILITEBGND
   These values control the foreground and background
   colors of the text of menu items that are 'depressed',
   i.e. the one that you've moved the selection to via
   the keyboard or the submenu item that's depressed
   when you drop down its submenu. It does not affect
   disabled menu items.
SYSCLR_PAGEBACKGROUND
   This value controls the background of notebook pages,
   but usually this seems to be overridden by pres
   params.
SYSCLR_FIELDBACKGROUND
   This value controls the color of the shaft of scroll
   bars that are disabled because there is not enough
   data to need them. It is also used as the background
   color of the frames that WPS settings dialogs are in.
   It is also used to color that little lieft over
   square at the bottom right of list boxes when they
   have a horizontal scroll bar.
SYSCLR_BUTTONDARK
SYSCLR_BUTTONLIGHT
   These values are used to drive the 3D look of
   controls when they want to do a raised or sunken
   look. Frame size borders, menus, scroll bars, system
   menus, disabled title bars, buttons, entry fields,
   spin boxes, group boxes, and MLEs all use these
   colors for this purpose.
   On MLE's, which use two interwoven boxes around them
   (of different colors) to achieve a sunken look, this
   controls the color that's usually the lighter color.
SYSCLR_BUTTONMIDDLE
   This value is often used on the inside of any area
   that is surrounded by a 3D effect caused by the
   previous two values. For instance, the middle of the
   thumb slider on scroll bars and the middle of
   buttons.
SYSCLR_BUTTONDEFAULT
   This value is used to control the color of the
   'default pushbutton emphasis.' You will notice that a
   DEFPUSHBUTTON has an extra (usually black) border
   around it and this border moves to the button that
   currently has the focus.
   The color of this extra border is controlled by this
   value. If you tab such that a non-pushbutton has the
   focus, the dialog code will find the first push button
   that has the DEFBUTTON style and put the default
   emphasis back on it.
SYSCLR_TITLEBOTTOM
   When a frame is activated, its title bar paints
   itself in the activated mode. When it paints in this
   way, it will draw a line of this color along its
   bottom border to separate it from the menu or client
   area.
SYSCLR_ICONTEXT
   This value drives the color of the text in the task
   list. It also drives the color of the title text in
   container windows.
SYSCLR_DIALOGBACKGROUND
   This value is used to color the client area of
   dialogs, which have no client window. It colors the
   background of the toolbar and the backgrounds of WPS
   settings dialogs.
SYSCLR_HILITEFOREGROUND
SYSCLR_HILITEBACKGROUND
   These values drive the color of the text in any
   non-disabled, hilited text. So if you drop down a menu,
   or select some text in an entry field, or select an
   item in a list box or container, these will control
   the colors used. Strangely it does not appear to color
   the selected text of an MLE.
   These also control the text drawn under non-shadow WPS
   icons, when they are selected, i.e. you click on them
   and put the selection emphasis on them. The foreground
   color drives the text foregroun. The background color
   drives the block of color that the WPS draws behind
   the icon to indicate that it is selected. If the icon
   is also active, then this color is just cross hatched.
SYSCLR_INACTIVETITLETEXTBGND
SYSCLR_ACTIVETITLETEXTBGND
   These values drive the color used to draw the text of
   the titlebars of active or inactive frame windows. The
   background just affects the background of the text
   itself, it is not the color used to fill the title
   bar.
SYSCLR_INACTIVETITLETEXT
SYSCLR_ACTIVETITLETEXT
   Cousins of the previous two values, these control the
   foreground color of the text of active and inactive
   title bars.
SYSCLR_OUTPUTTEXT
   This value drives the foreground color of unselected
   text in entry fields.
SYSCLR_WINDOWSTATICTEXT
   As the name would suggest, this value drives the
   foreground color of text in static controls such as
   static text and group boxes.
SYSCLR_SCROLLBAR
   This value drives the background color of the shafts
   of enabled scroll bars.
SYSCLR_BACKGROUND
   This value drives the default background color of the
   desktop.
SYSCLR_ACTIVETITLE
SYSCLR_INACTIVETITLE
   These values drive the background color used to fill
   in the titlebars of active and inactive frames. For
   dialog borders, this color also is used to draw the
   border of the dialog.
SYSCLR_MENU
   This value drives the background color of menus,
   except for the 'depressed' menu items that are
   clicked on, or keyboarded to, or submenu items
   whose sub menus are dropped down.
SYSCLR_WINDOW
   This color is generally used to color the
   backgrounds of user windows or non-dialog frames that
   have no client window. It is also used as the
   disabled background color of the arrow buttons on
   notebook windows and the background color of
   containers.
   Like SYSCLR_FIELDBACKGROUND, discussed above, it
   also seems to drive the color of that little blank
   area at the bottom right of list boxes that have a
   horizontal scroll bar.
   It controls the color of SS_BKGNDFRAME style static
   windows.
SYSCLR_WINDOWFRAME
   This value drives a couple of things. Drop down and
   popup menus use it as their border. It is also used
   by buttons and list boxes on their left and bottom
   sides, in conjuction with the 3D colors discussed
   above, to provide contrast in case they are placed on
   a window that has a background color similar to their
   'light' 3D color. This avoids having the 3D color
   just blend into the background and look bad.
   Pushbuttoms draw a single pixel all the way around the
   button in this color, then  do the 3D effect inside of
   it. The default pushbutton emphasis is done outside of
   this border.
   This color is drawn around the outside of a frame with
   a dialog border. When a dialog border is not active, a
   single pixel of this color is used as the border. Thin
   dialog borders are always drawn using this color,
   whether active or not.
   On MLE's, which use two interwoven boxes around them
   (of different colors) to achieve a sunken look, this
   controls the color that's usually the darker color.
   In details mode containers, this controls the color of
   the horizontal and vertical separator lines.
   It controls the color of SS_FGNDFRAME type static
   windows.
SYSCLR_MENUTEXT
   This value drives the foreground color of the text in
   menus. Only menu items that are not depressed or
   disabled are affected by this values.
   This value also controls the foreground color of the
   text in buttons, whether enabled or disabled.
SYSCLR_WINDOWTEXT
   This value drives the foreground color of the text
   in most of the standard controls. In listboxes, it
   colors the text of the non-selected items. In entry
   fields, spinboxes, and MLEs, it colors the text when
   its not selected. It is used by the 'page text' on
   the pages of a notebook control.
SYSCLR_TITLETEXT
   The docs say its colors title bars, size box, and
   and scroll bar arrow boxes, but it does not seem to
   as far as I can tell.


SYSCLR_ACTIVEBORDER
SYSCLR_INACTIVE
   These values drive the color of the center part of
   an active or inactive frame's sizing border, usually
   a pale yellow and gray, respectively. The outside
   colors of these borders are driven by other colors
   in order to make them look 3D. It does not affect
   dialog or thin borders.
SYSCLR_APPWORKSPACE
   This value is often used to drive the color of the
   client areas of windows that implement a 'multi-
   document interface', i.e. they have a number of child
   frames within themselves.
SYSCLR_HELPBACKGROUND
   This value drives the background color of the help
   panels displayed by OS/2's online help system.
SYSCLR_HELPTEXT
   This value drives the foreground color of the text
   displayed in the help panels of OS/2's online help
   system. It only controls text that is not colored
   specifically by the help author or which is a
   hyperlink.
SYSCLR_HELPHILITE
   This value drives the foreground color of hyperlink
   text in the OS/2 online help system.


Presentation Parameters

Buttons

PP_FOREGROUNDCOLOR
PP_BACKGROUNDCOLOR
PP_DISABLEDFOREGROUNDCOLOR
PP_DISABLEDBACKGROUNDCOLOR
   Controls the foreground color of the text in the
   button, or the background color used to fill the
   background of the button. The first set apply to
   enabled buttons and the second to disabled buttons.
PP_BORDERCOLOR
   This controls the border around pushbuttons. This
   border is drawn around buttons in order to make
   their 3D effect more pronounced when they are on a
   background that has a similar color to one of the
   3D colors. Otherwise, it would tend to wash out.
   Applies to both enabled and disabled buttons. Only
   pushbuttons have a border, other button types don't
   use this.

Containers

PP_FOREGROUNDCOLOR
   This controls the color of all of the text titles, of
   the container as a whole or the column titles. Does
   enabled and disabled containers.
PP_BACKGROUNDCOLOR
   The whole background of the container, including
   behind the titles, is filled with this color.
PP_HILITEFOREGROUNDCOLOR
PP_HITLITEBACKGROUNDCOLOR
   Controls the foreground and background color of
   selected text in the continer entries. Does enabled
   and disabled containers.
PP_BORDERCOLOR
   This is used to draw all of the horizontal and
   vertical separator lines in the container.
PP_ICONTEXTBACKGROUNDCOLOR
   This color is kind of strange. It is used as the
   whole background fill of all of the column titles,
   but only as the background of the actual text for
   the overall container title.


Entry Fields

PP_FOREGROUNDCOLOR
PP_BACKGROUNDCOLOR
PP_DISABLEDFOREGROUNDCOLOR
PP_DISABLEDBACKGROUNDCOLOR
   Controls the foreground color of the text in the field,
   or the background color used to fill the background of
   the field. The first set apply to enabled fields and
   the second to disabled fields.
PP_HILITEFOREGROUNDCOLOR
PP_HITLITEBACKGROUNDCOLOR
   Controls the colors of the text in the entry field
   that is selected. There is not a disabled version
   because you cannot select text in a disabled entry
   field.
PP_BORDERCOLOR
   Controls the color of the border around the entry
   field. Note that the border is really made up of two
   colors in a 3D look, but this only controls one of
   them. The other is controlled by the
   SYSCLR_BUTTONLIGHT system color only.


List Boxes

PP_FOREGROUNDCOLOR
PP_BACKGROUNDCOLOR
PP_DISABLEDFOREGROUNDCOLOR
PP_DISABLEDBACKGROUNDCOLOR
   Controls the foreground and background color of
   non-selected items in the list box. The first set
   apply to enabled list boxes, and the second set to
   disabled ones.
PP_HILITEFOREGROUNDCOLOR
PP_HITLITEBACKGROUNDCOLOR
   Controls the foreground and background color of
   selected items in the list box.
PP_BORDERCOLOR
   Controls the dark color of the 3D border around the
   list box. This is very similar to the MLE above, so
   see the previous section.


Multi Line EntryFields

PP_FOREGROUNDCOLOR
PP_BACKGROUNDCOLOR
   Controls the foreground color of the text in the
   field, or the background color used to fill the
   background of the field. There is no disabled version
   because disabled MLE's don't look any different when
   disabled.
PP_BORDERCOLOR
   Controls the color of the border around the multiline
   entry field. Note that the border is really made up of
   two colors in a 3D look, but this only controls one of
   them. If this parm is not present, the
   SYSCLR_WINDOWBORDER system color is used.
   The other is controlled by the SYSCLR_BUTTONLIGHT
   system color only. There is not a pres param for it.
   Note that a disabled MLE does not always pick up new
   presentation parms until its forced to redraw!!


Spin Buttons

PP_FOREGROUNDCOLOR
PP_DISABLEDFOREGROUNDCOLOR
   These control the foreground color of the text in an
   enabled or disabled spin button. The background color
   of the entry field in the spin button is not affected
   by pres params. I assume you must query the entry
   field and set it separately.
PP_HILITEFOREGROUNDCOLOR
PP_HITLITEBACKGROUNDCOLOR
   Controls the foreground and background color of
   selected text in the entry field part of an enabled
   spin button.
PP_BORDERCOLOR
   Controls the dark color of the 3D border around the
   spin button. This is very similar to the MLE above, so
   see the MLE section.


Statics

PP_FOREGROUNDCOLOR
PP_BACKGROUNDCOLOR
   These control the colors used to draw the static text.
   These control the text of both enabled and disabled
   statics.
   These also control the colors of SS_FGNDRECT and
   SS_BGNDRECT type statics.
   PP_FOREGROUNDCOLOR controls the color of both the
   SS_FGNDFRAME and SS_BKGNDFRAME static control.
PP_BORDERCOLOR
   Controls the dark color of the 3D border of a group
   box border.


Dean Roddey

The CIDLib Class Libraries
http://www.jagunet.com/~droddey/