|
DXmCreateColorMixDialog(3X)
Contents
|
DXmCreateColorMixDialog - Creates a color mixing widget
with a dialog box.
Widget DXmCreateColorMixDialog(
Widget parent,
String name,
ArgList arglist,
Cardinal argcount );
The identifier (widget ID) of the parent widget. The name
of the created widget. The application argument list.
The number of arguments in the application argument list.
DXmCreateColorMixDialog allows your DECwindows Motif
applications to query users for a color. The color mixing
widget provides users with immediate feedback, displaying
each new color as it is selected. This widget uses a popup
dialog box (or nonpop-up dialog box if you use the DXmCreateColorMix
routine) that is preconfigured to contain
the following subwidgets:
----------------------------------------------------------------------------
Subwidget Description
----------------------------------------------------------------------------
Scratch pad Stores intermediate colors for later use in
color mixing.
Color display subwidget Displays the original color and the new
color.
Color model option menu sub- Implements choice of color model.
widget
Color mixer subwidget Provides graphic tools users can use to
define new colors.
Push button subwidgets Activate color mixing widget functions.
Label subwidgets Provide descriptive information.
----------------------------------------------------------------------------
The color mixing widget allows a user to choose from up to
five different color models: The default color model for
the color mixing widget on color systems (it does not display
on non-color systems or on systems with too few
resources).
The color picker consists of a"-color color spectrum
and a color palette option menu, a color
interpolator and its title, a smear button, and
undo button, two paint bucket buttons, and arrow
buttons to control the warmth and lightness of
interpolator colors. In the HLS color model, a
color is specified by three characteristics: hue,
lightness, and saturation. Hue is color. Lightness
describes the intensity of the color (the
amount of the color). Saturation describes the
purity of the color or how much the color is
diluted by white.
To support the HLS color model, the color mixer
subwidget contains three scales that represent the
ranges of hue, lightness, and saturation. The hue
scale presents color values as a range between 0
and 360. The lightness and saturation scales present
their values as a range of percentages between
0 and 100. The default color model for the color
mixing widget on monochrome systems.
In the RGB color model, a color is specified as a
mixture of different intensities of red, green, and
blue. In the X Window System, Version 11, you
specify the intensity of red, green, or blue as a
value between 0 and 65,535. Zero is the lowest
intensity. Black is defined as a zero-intensity
value for all three colors; white is"0 percent
intensity for all three colors.
To support the RGB color model, the color mixer
subwidget contains three scales that represent the
ranges of intensity of red, green, and blue. Each
scale presents these color values as a percentage
between 0 and 100. In addition, the color mixer
subwidget contains text widgets in which users of
your application can enter RGB values directly as
text. The text widgets and the scales are linked:
a change in one effects a corresponding change in
the other. A scrolled window that presents the
user with a list of X11 named colors. Each button
in the scrolled window shows the name of an X11
color. If enough resources are available, the background
is set to that color. (If the new color is
not further modified by other color models, the X11
name of this color is also returned to the application
as part of the color mixing widget's callback
structure.) You can use the scroll bar to scroll
through this color list. Clicking MB1 on a color
in the list causes the color display subwidget to
become filled with that color. The color browser is
available on all systems.
A complete list of all the X color values available
to you is located on your system. To find it, type
the following command: % find / -name '*rgb*'
-print A scale widget that allows generation of
gray shades ranging from black to white. When the
Greyscale mixer is selected, the current new color
is converted to an appropriate shade of gray, which
can then be adjusted with the scale widget. All
shades of gray generated by this model are a mixture
of equal portions of red, green, and blue,
which means that they appear identically on both
color and gray scale systems.
The Greyscale mixer is available on all systems.
Note
When considering whether to use a pop-up or nonpopup
color mixing widget, the following conditions
are in effect: The pop-up color mixing widget
(which you create with the DXmCreateColorMixDialog
routine) allocates the necessary color cells each
time it is mapped and then releases them each time
the widget is unmapped. The nonpop-up color mixing
widget (which you create with the DXmCreateColorMix
routine) allocates the necessary color cells at
creation time but does not release them until the
widget is destroyed. As such, if color resources
are limited, your application should use the pop-up
color mixing widget instead of the nonpop-up version.
Resource Information [Toc] [Back]
You can set the following widget-specific resources in the
arglist when using any combination of default or application-provided
color display and color mixer subwidgets:
XmString DXmNclearLabel; XmString DXmNdisplayLabel;
Widget DXmNdisplayWindow; XmString
DXmNhelpLabel; XmString DXmNmainLabel; XmString
DXmNmixerLabel; Widget DXmNmixerWindow; unsigned
short DXmNnewBlueValue; unsigned short DXmNnewGreenValue;
unsigned short DXmNnewRedValue; unsigned short
DXmNorigBlueValue; unsigned short DXmNorigGreenValue;
unsigned short DXmNorigRedValue; XmString DXmNresetLabelString;
XmString DXmNscratchPadInfoLabel;
XmString DXmNscratchPadLabel; void proc
DXmNsetMixerColorProc; void proc DXmNsetNewColorProc;
XtCallbackList XmNapplyCallback; XmString
XmNapplyLabelString; XtCallbackList XmNcancelCallback;
XmString XmNcancelLabelString; XtCallbackList
XmNokCallback; XmString XmNokLabelString; Widget
XmNworkWindow;
You can set the following widget-specific resources in the
arglist only when using the default color display subwidget:
unsigned short DXmNbackBlueValue; unsigned short DXmNbackGreenValue;
unsigned short DXmNbackRedValue; Dimension
DXmNdisplayColWinHeight; Dimension DXmNdisplayColWinWidth;
Dimension DXmNdispWinMargin;
Boolean DXmNmatchColors;
You can set the following widget-specific resources in the
arglist only when using the default color mixer subwidget:
XmString DXmNblackLabel; XmString DXmNblueLabel;
short DXmNbrowserItemCount; XmString
DXmNbrowserLabel; unsigned char DXmNcolorModel; XmString
DXmNcoolerLabel; XmString DXmNdarkerLabel; XmString
DXmNearthtoneLabel; XmString DXmNfullLabel;
XmString DXmNgrayLabel; XmString DXmNgreenLabel;
XmString DXmNgreyscaleLabel; Boolean
DXmNgreyscaleOnGreyscale; XmString DXmNhlsLabel;
XmString DXmNhueLabel; short DXmNinterpTileCount;
short DXmNinterpTileHeight; short
DXmNinterpTileWidth; XmString DXmNinterpTitleLabel;
XmString DXmNlighterLabel; XmString DXmNlightLabel;
short DXmNlightnessIncrement;
XmString DXmNoptionLabel; XmString DXmNpastelLabel;
unsigned short DXmNpickerColors; XmString
DXmNpickerLabel; short DXmNpickerTileHeight;
short DXmNpickerTileWidth; XmString DXmNpickerTitleLabel;
XmString DXmNredLabel; XmString
DXmNrgbLabel; XmString DXmNsatLabel; XmString
DXmNsliderLabel; XmString DXmNsmearLabel; XmString
DXmNspectrumLabel; XmString DXmNundoLabel; XmString
DXmNuserPaletteLabel; XmString DXmNvalueLabel;
XmString DXmNvividLabel; XmString DXmNwarmerLabel;
unsigned short DXmNwarmthIncrement; XmString
DXmNwhiteLabel;
Resources [Toc] [Back]
(Default or Application-Provided Color Display/Mixer Subwidgets)
Specifies the text that appears as the label of
the scratch pad clear push button. The default text is
"Clear". Access is CSG. Specifies the text that appears
above the color display subwidget, centered between the
left and right borders. There is no default. Access is
CSG. The color display subwidget. The default is the
color mixing widget's color display subwidget. Access is
CSG.
Note the following: Setting this resource to Null
at widget creation time prevents the color display
subwidget from being displayed. If an application
substitutes its own color display subwidget for the
default color display subwidget, the application is
completely responsible for managing the subwidget
(making it visible and controlling its geometry
management). An application can return to the
default color display subwidget by using the
Intrinsic routine XtSetValues to set the DXmNdisplayWindow
resource to Null. Specifies the text
that appears inside the Help push button. The
default text is "Help". Access is CSG. Specifies
the text that appears at the top of the color mixing
widget, centered between the left and right
borders. There is no default. Access is CSG.
Specifies the text that appears above the color
mixer subwidget, centered between the left and
right borders. There is no default. Access is
CSG. The color mixer subwidget. The default color
mixer subwidget supports the Hue Lightness Saturation
(HLS), Red, Green, Blue (RGB), Color Picker,
Browser, and Greyscale Mixer color models. Setting
this resource to Null at widget creation time prevents
the color mixer subwidget from being displayed.
Access is CSG.
Note the following: If an application substitutes
its own color mixer subwidget for the default color
mixer subwidget, the application is completely
responsible for managing the subwidget (making it
visible and controlling its geometry management).
An application can later return to the default
color mixer subwidget by using the Intrinsic routine
XtSetValues to set the DXmNmixerWindow
resource to Null. Applications that use the
default color mixer subwidget are not required to
update the new color value. However, applications
that provide their own color mixer subwidget must
update the new color value, by using either the
Intrinsic routine XtSetValues or the DXmColorMixSetNewColor
routine (which is faster). The
new blue color value for the color mixing widget.
The default is 0 unless DXmNmatchColors is True.
If DXmNmatchColors is True, then DXmNnewBlueValue
is always set by default to match DXmNorigBlueValue
whenever the widget is created or made visible.
Access is CSG. The new green color value for the
color mixing widget. The default is 0 unless DXmNmatchColors
is True. If DXmNmatchColors is True,
then DXmNnewGreenValue is always set by default to
match DXmNorigGreenValue whenever the widget is
created or made visible. Access is CSG. The new
red color value for the color mixing widget. The
default is 0 unless DXmNmatchColors is True. If
DXmNmatchColors is True, then DXmNnewRedValue is
always set by default to match DXmNorigRedValue
whenever the widget is created or made visible.
Access is CSG. The original blue color value for
the color mixing widget. The default is 0; however,
applications should set the original blue
value. Access is CSG. The original green color
value for the color mixing widget. The default is
0; however, applications should set the original
green value. Access is CSG. The original red
color value for the color mixing widget. The
default is 0; however, applications should set the
original red value. Access is CSG. Specifies the
text that appears inside the Reset push button.
The default is "Reset". Access is CSG. Specifies
the text that appears as the label centered at the
top of the scratch pad pop-up. The default text is
"Save colors here...". Access is CSG. Specifies
the text that appears as the label of the scratch
pad push button. The default text is "Scratch
Pad...". Access is CSG. The resource used by the
color mixing widget to update the current color
mixer controls when the application sets a new
color. (It is intended for applications that use a
non-default color mixer subwidget.) The default is
a procedure (specific to the color mixing widget)
that updates the appropriate default color model
(Picker, HLS, RGB, Browser, or Greyscale). Access
is CSG. The resource used by the color mixing widget
to update the new color values displayed in the
color display subwidget. If the application
replaces the default color display subwidget and
requires that the color mixing widget update the
new color, the application must set this resource.
Otherwise, replacing the default color display subwidget
sets this resource to Null. Access is CSG.
If this resource is set and the application manages
this subwidget, the work window is placed below the
color display and color mixer subwidgets (if present)
and above the color mixing widget push buttons.
Callback (or callbacks) made when the user
clicks the Apply push button widget in the color
mixing widget. The reason for this callback is
XmCR_APPLY. The default is Null. Access is CSG.
Specifies the text that appears inside the Apply
push button. The default is "Apply". Access is
CSG. Callback (or callbacks) made when the user
clicks the Cancel push button widget in the color
mixing widget. The reason for this callback is
XmCR_CANCEL. The default is Null. Access is CSG.
Specifies the text that appears inside the Cancel
push button. The default is "Cancel". Access is
CSG. Callback (or callbacks) made when the user
clicks the OK push button widget in the color mixing
widget. The reason for this callback is
XmCR_ACTIVATE. The default is Null. Access is CSG.
Specifies the text that appears inside the OK push
button. The default is "OK". Access is CSG. An
optional work area subwidget. The default is Null.
Access is CSG.
Resources [Toc] [Back]
(Default Color Display Subwidget Only) The value of the
default color display subwidget's blue background color.
The default value is 32767 (gray). Access is CSG.
This resource is valid only if the default color
display subwidget is used; otherwise, the resource
is ignored. The value of the default color display
subwidget's green background color. The default
value is 32767 (gray). Access is CSG.
This resource is valid only if the default color
display subwidget is used; otherwise, the resource
is ignored. The value of the default color display
subwidget's red background color. The default
value is 32767 (gray). Access is CSG.
This resource is valid only if the default color
display subwidget is used; otherwise, the resource
is ignored. The height of the original and new
color display windows. The default is 80 pixels.
Access is CSG.
This resource is valid only if the default color
display subwidget is used; otherwise, the resource
is ignored. The width of the original and new
color display windows. The default is 80 pixels.
Access is CSG.
This resource is valid only if the default color
display subwidget is used; otherwise, the resource
is ignored. The margin between the original and
the new color display windows and the outsides
edges of the color display subwidget. The margin
is the area affected by the background resources
(set gray by default). The default width is 20 pixels.
Access is CSG.
This resource is valid only if the default color
display subwidget is used; otherwise, the resource
is ignored. A Boolean resource that specifies
whether new color values are matched to original
color values whenever the color mixing widget is
created and made visible. When True, new color
values are matched to original color values. When
False, new color values are not matched to original
color values. The default is True. Access is CSG.
This resource is valid only if the default color
display subwidget is used; otherwise, the resource
is ignored.
Resources [Toc] [Back]
(Default Color Mixer Subwidget Only) Specifies the text
that appears below the left end of the middle scale subwidget.
The default is "Black". Access is CSG.
This resource is used in the HLS mixer if the
default color mixer subwidget is used; otherwise,
the resource is ignored. Specifies the text that
appears below the left end of the bottom scale subwidget.
The default is "Blue". Access is CSG.
This resource is used in the RGB mixer if the
default color mixer subwidget is used; otherwise,
the resource is ignored. The number of visible
items in the browser's color list. You can set
this resource only at widget creation time. Each
visible item requires that the color mix widget
allocate its own color cell. The default is 5.
Access is CG.
This resource is valid only if the default color
mixer subwidget is used; otherwise, the resource is
ignored. Specifies the text that appears as the
fourth item in the color model option menu. The
default text is "Browser". Access is CSG.
This resource is valid only if the default color
mixer subwidget is used; otherwise, the resource is
ignored. The color model currently being used.
The values for this resource are as follows:
----------------------------------------------------------
Color Model Value When Default
----------------------------------------------------------
Color Picker DXmColorModelPicker Color systems
HLS DXmColorModelHLS Not used as
default
RGB DXmColorModelRGB Monochrome systems
Browser DXmColorModelBrowser Not used as
default
Greyscale DXmColorModelGreyscale Gray scale systems
----------------------------------------------------------
Applications should set this resource before the
widget is managed (if at all), and allow users to
switch color models by using the option menu.
Access is CSG.
This resource is valid only if the default color
mixer subwidget is used; otherwise, the resource is
ignored. Specifies the text of the Cooler arrow
button. The default text is "Cooler". Access is
CSG.
This resource is valid only if the default color
mixer subwidget is used; otherwise, the resource is
ignored. Specifies the text of the Darker arrow
button. The default text is "Darker". Access is
CSG.
This resource is valid only if the default color
mixer subwidget is used; otherwise, the resource is
ignored. The label used to represent the earthtones
palette in the picker spectrum option menu.
The default text is "Earthtones". Access is CSG.
This resource is valid only if the default color
mixer subwidget is used; otherwise, the resource is
ignored. Specifies the text that appears below the
right end of the bottom scale subwidget. The
default is "Full". Access is CSG.
This resource is used in the HLS mixer if the
default color mixer subwidget is used; otherwise,
the resource is ignored. Specifies the text that
appears below the left of the bottom scale subwidget.
The default is "Gray". Access is CSG.
This resource is used in the HLS mixer if the
default color mixer subwidget is used; otherwise,
the resource is ignored. Specifies the text that
appears below the left end of the middle scale subwidget.
The default is "Green". Access is CSG.
This resource is used in the RGB mixer if the
default color mixer subwidget is used; otherwise,
the resource is ignored. Specifies the text that
appears as the bottom item in the color model
option menu. The default text is "Grayscale".
Access is CSG.
This resource is valid only if the default color
mixer subwidget is used; otherwise, the resource is
ignored. A Boolean resource that, when True, specifies
that the greyscale mixing color model is to
be the default on greyscale systems. The default
is True. Access is CSG.
This resource is valid only if the default color
mixer subwidget is used; otherwise, the resource is
ignored. Specifies the text that appears as the
second item in the color model option menu. The
default is "HLS". Access is CSG.
This resource is valid only if the default color
mixer subwidget is used; otherwise, the resource is
ignored. Specifies the text that appears to the
left of the top scale subwidget. The default is
"Hue:". Access is CSG.
This resource is used in the HLS mixer if the
default color mixer subwidget is used; otherwise,
the resource is ignored. The number of interpolator
tiles used. (The color mixing widget must
allocate a color cell for each interpolator tile.)
You can set this resource only at widget creation
time. The default is 10. Access is CG.
This resource is valid only if the default color
mixer subwidget is used; otherwise, the resource is
ignored. The height of each interpolator tile, in
pixels. The default is 30. Access is CSG.
This resource is valid only if the default color
mixer subwidget is used; otherwise, the resource is
ignored. The width of each interpolator tile, in
pixels. The default is 30. Access is CSG.
This resource is valid only if the default color
mixer subwidget is used; otherwise, the resource is
ignored. Specifies the text that appears centered
above the interpolator widget. The default text is
"Interpolator". Access is CSG.
This resource is valid only if the default color
mixer subwidget is used; otherwise, the resource is
ignored. Specifies the text of the Lighter arrow
button. The default text is "Lighter". Access is
CSG.
This resource is valid only if the default color
mixer subwidget is used; otherwise, the resource is
ignored. Specifies the text that appears to the
left of the bottom scale subwidget. The default is
"Lightness:". Access is CSG.
This resource is used in the HLS mixer if the
default color mixer subwidget is used; otherwise,
the resource is ignored. The percentage by which
to increase or decrease the lightness of the color
of each interpolator tile when the lighter or
darker buttons are pressed. The default is 5.
Access is CSG.
This resource is valid only if the default color
mixer subwidget is used; otherwise, the resource is
ignored. Specifies the text that appears inside
the color model option menu subwidget. The default
is "Color Model:". Access is CSG.
This resource is valid only if the default color
mixer subwidget is used; otherwise, the resource is
ignored. The label used to represent the pastels
palette in the picker spectrum option menu. The
default text is "Pastels". Access is CSG.
This resource is valid only if the default color
mixer subwidget is used; otherwise, the resource is
ignored. A palette of ten colors that will be
available through the user palette menu option. If
not specified, no user palette will appear in the
menu; otherwise, the user palette will become the
default picker palette. You can set this resource
only at widget creation time. Access is CG.
Note that the first item in the array is the red
value of the first spectrum tile, the second item
is its green value, the third item is its blue
value, the fourth item is the second tile's red
value, and so on. Thus, this array must contain
thirty elements if it is set.
This resource is valid only if the default color
mixer subwidget is used; otherwise, the resource is
ignored. Specifies the text that appears as the
top item in the color model option menu. The
default text is "Picker". Access is CSG.
This resource is valid only if the default color
mixer subwidget is used; otherwise, the resource is
ignored. The height of each individual spectrum
tile, in pixels. The default is 30. Access is CSG.
This resource is valid only if the default color
mixer subwidget is used; otherwise, the resource is
ignored. The width of each individual spectrum
tile, in pixels. The default is 30. Access is CSG.
This resource is valid only if the default color
mixer subwidget is used; otherwise, the resource is
ignored. Specifies the text that appears centered
above the picker widget. The default text is "Spectrum".
Access is CSG.
This resource is valid only if the default color
mixer subwidget is used; otherwise, the resource is
ignored. Specifies the text that appears below the
left end of the top scale subwidget. The default is
"Red". Access is CSG.
This resource is used in the RGB mixer if the
default color mixer subwidget is used; otherwise,
the resource is ignored. Specifies the text that
appears as the third item in the color model option
menu. The default is "RGB". Access is CSG.
This resource is valid only if the default color
mixer subwidget is used; otherwise, the resource is
ignored. Specifies the text that appears to the
left of the middle scale subwidget. The default is
"Saturation:". Access is CSG.
This resource is used in the HLS mixer if the
default color mixer subwidget is used; otherwise,
the resource is ignored. Specifies the text that
appears above the left end of the top scale subwidget.
The default is "Percentage". Access is CSG.
This resource is used in the RGB mixer if the
default color mixer subwidget is used; otherwise,
the resource is ignored. Specifies the text of the
Smear push button. The default text is "Smear".
Access is CSG.
This resource is valid only if the default color
mixer subwidget is used; otherwise, the resource is
ignored. The label used to represent the "rainbow"
palette in the picker spectrum option menu. The
default text is "Spectrum". Access is CSG.
This resource is valid only if the default color
mixer subwidget is used; otherwise, the resource is
ignored. Specifies the text of the Undo push button.
The default text is "Undo". Access is CSG.
This resource is valid only if the default color
mixer subwidget is used; otherwise, the resource is
ignored. The label used to represent the application-defined
user palette in the spectrum option
menu. The default text is "User palette". Access
is CSG.
This resource is valid only if the default color
mixer subwidget is used; otherwise, the resource is
ignored. Specifies the text that appears above the
column of text subwidgets. The default is "Value".
Access is CSG.
This resource is used in the RGB mixer if the
default color mixer subwidget is used; otherwise,
the resource is ignored. The label used to represent
the vivids palette in the picker spectrum
option menu. The default text is "Vivids". Access
is CSG.
This resource is valid only if the default color
mixer subwidget is used; otherwise, the resource is
ignored. Specifies the text of the Warmer arrow
button. The default text is "Warmer". Access is
CSG.
This resource is valid only if the default color
mixer subwidget is used; otherwise, the resource is
ignored. The amount of red or blue added to the
color of each interpolator tile when the warmer or
cooler buttons are pressed. The default is 5000.
Access is CSG.
This resource is valid only if the default color
mixer subwidget is used; otherwise, the resource is
ignored. Specifies the text that appears below the
right end of the middle scale subwidget. The
default is "White". Access is CSG.
This resource is used in the HLS mixer if the
default color mixer subwidget is used; otherwise,
the resource is ignored.
Resource Information [Toc] [Back]
The following resources inherited from XmBulletinBoard are
supported differently: The default for XmNdialogStyle is
XmDIALOG_MODELESS. The default for XmNdialogTitle is
"Color Mixing". The default for XmNresizePolicy is XmRESIZE_NONE.
Resource Information [Toc] [Back]
typedef struct {
int reason;
XEvent *event;
unsigned short newred;
unsigned short newgrn;
unsigned short newblu;
char *newname;
unsigned short origred;
unsigned short origgrn;
unsigned short origblu*L; } DXmColorMixCallbackStruct;
Callback Field Descriptions [Toc] [Back]
An integer set to the callback reason. See the Callback
Reasons section for the values that are valid for this
widget. A pointer to the X event structure describing the
event that generated this callback. The new red color
value for the color mixing widget. The new green color
value for the color mixing widget. The new blue color
value for the color mixing widget. Passes a color name to
an application. If the user selects a named color from
the Browser and then triggers a callback to the application
without modifying the new color, the newname field of
the callback data structure is filled in with a pointer to
an ASCII, null-terminated string that contains the color's
X11 name. This string is read-only, and should not be
freed or modified.
If a color is generated in one of the other color
models, or generated in the browser and subsequently
modified, the newname field in the callback
structure is set to Null. The original red color
value for the color mixing widget. The original
green color value for the color mixing widget. The
original blue color value for the color mixing widget.
Callback Reasons [Toc] [Back]
The user has activated the OK push button. The user has
activated the Apply push button. The user has activated
the Cancel push button.
Resource Information [Toc] [Back]
The color mixing widget completely controls the layout of
its children.
Resizing [Toc] [Back]
The color mixing widget computes the smallest possible
size required to enclose all of its children, including
any of the variably sized color mixing subwidgets. The
size remains fixed while the user selects different color
models from the option menu.
Inherited Resources [Toc] [Back]
DXmCreateColorMixDialog inherits behaviour and resources
from the following superclasses:
Core Resource Set Composite Resource Set Constraint
Resource Set XmManager Resource Set XmBulletinBoard
Resource Set
The identifier (widget ID) of the created color mixing
widget.
DXmCreateColorMix(3X), DXmColorMixGetNewColor(3X), DXmColorMixSetNewColor(3X)
DXmCreateColorMixDialog(3X)
[ Back ] |