


XmDrawnButton(3X)					    XmDrawnButton(3X)
OSF/Motif							    OSF/Motif



NAME
  XXmmDDrraawwnnBBuuttttoonn	- The DrawnButton widget class

SYNOPSIS


  ##iinncclluuddee <<XXmm//DDrraawwnnBB..hh>>

DESCRIPTION
  The DrawnButton widget consists of an	empty widget window surrounded by a
  shadow border.  It provides the application developer	with a graphics	area
  that can have	PushButton input semantics.

  Callback types are defined for widget	exposure and widget resize to allow
  the application to redraw or reposition its graphics.	 If the	DrawnButton
  widget has a highlight and shadow thickness, the application should not
  draw in that area.  To avoid drawing in the highlight	and shadow area,
  create the graphics context with a clipping rectangle	for drawing in the
  widget.  The clipping	rectangle should take into account the size of the
  widget's highlight thickness and shadow.

  Classes

  DrawnButton inherits behavior	and resources from CCoorree, XXmmPPrriimmiittiivvee, and
  XXmmLLaabbeell Classes.

  The class pointer is xxmmDDrraawwnnBBuuttttoonnWWiiddggeettCCllaassss.

  The class name is XXmmDDrraawwnnBBuuttttoonn.

  New Resources

  The following	table defines a	set of widget resources	used by	the program-
  mer to specify data.	The programmer can also	set the	resource values	for
  the inherited	classes	to set attributes for this widget.  To reference a
  resource by name or by class in a .Xdefaults file, remove the	XXmmNN or XXmmCC
  prefix and use the remaining letters.	 To specify one	of the defined values
  for a	resource in a .Xdefaults file, remove the XXmm prefix and	use the
  remaining letters (in	either lowercase or uppercase, but include any under-
  scores between words).  The codes in the access column indicate if the
  given	resource can be	set at creation	time (C), set by using XXttSSeettVVaalluueess
  (S), retrieved by using XXttGGeettVVaalluueess (G), or is not applicable	(N/A).

			  XXmmDDrraawwnnBBuuttttoonn	RReessoouurrccee SSeett
	  ___________________________________________________________
	  NNaammee			       DDeeffaauulltt		       AAcccceessss
		CCllaassss			     TTyyppee
	  ___________________________________________________________
	  ___________________________________________________________
	  XmNactivateCallback	       NULL		       C
		XmCCallback		      XtCallbackList
	  ___________________________________________________________
	  XmNarmCallback	       NULL		       C
		XmCCallback		      XtCallbackList
	  ___________________________________________________________
	  XmNdisarmCallback	       NULL		       C
		XmCCallback		      XtCallbackList
	  ___________________________________________________________
	  XmNexposeCallback	       NULL		       C
		XmCCallback		      XtCallbackList
	  ___________________________________________________________
	  XmNmultiClick		       dynamic		       CSG
		XmCMultiClick		      unsigned char
	  ___________________________________________________________
	  XmNpushButtonEnabled	       False		       CSG
		XmCPushButtonEnabled	      Boolean
	  ___________________________________________________________
	  XmNresizeCallback	       NULL		       C
		XmCCallback		      XtCallbackList
	  ___________________________________________________________
	  XmNshadowType		       XmSHADOW_ETCHED_IN      CSG
		XmCShadowType		      unsigned char
	  ___________________________________________________________

  XXmmNNaaccttiivvaatteeCCaallllbbaacckk
	    Specifies the list of callbacks that is called when	the widget
	    becomes selected.  The reason sent by the callback is
	    XXmmCCRR__AACCTTIIVVAATTEE.

  XXmmNNaarrmmCCaallllbbaacckk
	    Specifies the list of callbacks that is called when	the widget
	    becomes armed.  The	reason sent by the callback is XXmmCCRR__AARRMM.

  XXmmNNddiissaarrmmCCaallllbbaacckk
	    Specifies the list of callbacks that is called when	the widget
	    becomes disarmed.  The reason sent by the callback is
	    XXmmCCRR__DDIISSAARRMM.

  XXmmNNeexxppoosseeCCaallllbbaacckk
	    Specifies the list of callbacks that is called when	the widget
	    receives an	exposure event.	 The reason sent by the	callback is
	    XXmmCCRR__EEXXPPOOSSEE.

  XXmmNNmmuullttiiCClliicckk
	    If a button	click is followed by another button click within the
	    time span specified	by the display's multi-click time, and this
	    resource is	set to XXmmMMUULLTTIICCLLIICCKK__DDIISSCCAARRDD, do	not process the
	    second click.  If this resource is set to XXmmMMUULLTTIICCLLIICCKK__KKEEEEPP, pro-
	    cess the event and increment _c_l_i_c_k__c_o_u_n_t in	the callback struc-
	    ture.  When	the button is not in a menu, the default value is
	    XXmmMMUULLTTIICCLLIICCKK__KKEEEEPP.

  XXmmNNppuusshhBBuuttttoonnEEnnaabblleedd
	    Enables or disables	the three-dimensional shadow drawing as	in
	    PushButton.

  XXmmNNrreessiizzeeCCaallllbbaacckk
	    Specifies the list of callbacks that is called when	the widget
	    receives a resize event.  The reason sent by the callback is
	    XXmmCCRR__RREESSIIZZEE.  The event returned for this callback is NULL.

  XXmmNNsshhaaddoowwTTyyppee
	    Describes the drawing style	for the	DrawnButton.  This resource
	    can	have the following values:

	      oo++
	      XXmmSSHHAADDOOWW__IINN-draws	the DrawnButton	so that	the shadow appears
	      inset.  This means that the bottom shadow	visuals	and top
	      shadow visuals are reversed.

	      oo++
	      XXmmSSHHAADDOOWW__OOUUTT-draws the DrawnButton so that the shadow appears
	      outset.


	      oo++
	      XXmmSSHHAADDOOWW__EETTCCHHEEDD__IINN-draws the DrawnButton using a double line.
	      This gives the effect of a line etched into the window.  The
	      thickness	of the double line is equal to the value of XXmmNNsshhaa--
	      ddoowwTThhiicckknneessss.

	      oo++
	      XXmmSSHHAADDOOWW__EETTCCHHEEDD__OOUUTT-draws	the DrawnButton	using a	double line.
	      This gives the effect of a line coming out of the	window.	 The
	      thickness	of the double line is equal to the value of XXmmNNsshhaa--
	      ddoowwTThhiicckknneessss.

  Inherited Resources

  DrawnButton inherits behavior	and resources from the following superc-
  lasses.  For a complete description of each resource,	refer to the man page
  for that superclass.

			     XXmmLLaabbeell RReessoouurrccee SSeett
      ___________________________________________________________________
      NNaammee				DDeeffaauulltt			   AAcccceessss
	    CCllaassss			      TTyyppee
      ___________________________________________________________________
      ___________________________________________________________________
      XmNaccelerator			NULL			   N/A
	    XmCAccelerator		       String
      ___________________________________________________________________
      XmNacceleratorText		NULL			   N/A
	    XmCAcceleratorText		       XmString
      ___________________________________________________________________
      XmNalignment			dynamic			   CSG
	    XmCAlignment		       unsigned	char
      ___________________________________________________________________
      XmNfontList			dynamic			   CSG
	    XmCFontList			       XmFontList
      ___________________________________________________________________
      XmNlabelInsensitivePixmap		XmUNSPECIFIED_PIXMAP	   CSG
	    XmCLabelInsensitivePixmap	       Pixmap
      ___________________________________________________________________
      XmNlabelPixmap			XmUNSPECIFIED_PIXMAP	   CSG
	    XmCLabelPixmap		       Pixmap
      ___________________________________________________________________
      XmNlabelString			"\0"			   CSG
	    XmCXmString			       XmString
      ___________________________________________________________________
      XmNlabelType			XmSTRING		   CSG
	    XmCLabelType		       unsigned	char
      ___________________________________________________________________
      XmNmarginBottom			0			   CSG
	    XmCMarginBottom		       Dimension
      ___________________________________________________________________
      XmNmarginHeight			2			   CSG
	    XmCMarginHeight		       Dimension
      ___________________________________________________________________
      XmNmarginLeft			0			   CSG
	    XmCMarginLeft		       Dimension
      ___________________________________________________________________
      XmNmarginRight			0			   CSG
	    XmCMarginRight		       Dimension
      ___________________________________________________________________
      XmNmarginTop			0			   CSG
	    XmCMarginTop		       Dimension
      ___________________________________________________________________
      XmNmarginWidth			2			   CSG
	    XmCMarginWidth		       Dimension
      ___________________________________________________________________
      XmNmnemonic			NULL			   N/A
	    XmCMnemonic			       KeySym
      ___________________________________________________________________
      XmNmnemonicCharSet		XmFONTLIST_DEFAULT_TAG	   N/A
	    XmCMnemonicCharSet		       String
      ___________________________________________________________________
      XmNrecomputeSize			True			   CSG
	    XmCRecomputeSize		       Boolean
      ___________________________________________________________________
      XmNstringDirection		dynamic			   CSG
	    XmCStringDirection		       XmStringDirection
      ___________________________________________________________________

			   XXmmPPrriimmiittiivvee RReessoouurrccee	SSeett
	______________________________________________________________
	NNaammee			      DDeeffaauulltt			AAcccceessss
	      CCllaassss			    TTyyppee
	______________________________________________________________
	______________________________________________________________
	XmNbottomShadowColor	      dynamic			CSG
	      XmCBottomShadowColor	     Pixel
	______________________________________________________________
	XmNbottomShadowPixmap	      XmUNSPECIFIED_PIXMAP	CSG
	      XmCBottomShadowPixmap	     Pixmap
	______________________________________________________________
	XmNforeground		      dynamic			CSG
	      XmCForeground		     Pixel
	______________________________________________________________
	XmNhelpCallback		      NULL			C
	      XmCCallback		     XtCallbackList
	______________________________________________________________
	XmNhighlightColor	      dynamic			CSG
	      XmCHighlightColor		     Pixel
	______________________________________________________________
	XmNhighlightOnEnter	      False			CSG
	      XmCHighlightOnEnter	     Boolean
	______________________________________________________________
	XmNhighlightPixmap	      dynamic			CSG
	      XmCHighlightPixmap	     Pixmap
	______________________________________________________________
	XmNhighlightThickness	      2				CSG
	      XmCHighlightThickness	     Dimension
	______________________________________________________________
	XmNnavigationType	      XmNONE			CSG
	      XmCNavigationType		     XmNavigationType
	______________________________________________________________
	XmNshadowThickness	      2				CSG
	      XmCShadowThickness	     Dimension
	______________________________________________________________
	XmNtopShadowColor	      dynamic			CSG
	      XmCTopShadowColor		     Pixel
	______________________________________________________________
	XmNtopShadowPixmap	      dynamic			CSG
	      XmCTopShadowPixmap	     Pixmap
	______________________________________________________________
	XmNtraversalOn		      True			CSG
	      XmCTraversalOn		     Boolean
	______________________________________________________________
	XmNunitType		      dynamic			CSG
	      XmCUnitType		     unsigned char
	______________________________________________________________
	XmNuserData		      NULL			CSG
	      XmCUserData		     XtPointer
	______________________________________________________________

			      CCoorree RReessoouurrccee SSeett
     ____________________________________________________________________
     NNaammee				   DDeeffaauulltt		   AAcccceessss
	   CCllaassss				 TTyyppee
     ____________________________________________________________________
     ____________________________________________________________________
     XmNaccelerators			   dynamic		   CSG
	   XmCAccelerators			  XtAccelerators
     ____________________________________________________________________
     XmNancestorSensitive		   dynamic		   G
	   XmCSensitive				  Boolean
     ____________________________________________________________________
     XmNbackground			   dynamic		   CSG
	   XmCBackground			  Pixel
     ____________________________________________________________________
     XmNbackgroundPixmap		   XmUNSPECIFIED_PIXMAP	   CSG
	   XmCPixmap				  Pixmap
     ____________________________________________________________________
     XmNborderColor			   XtDefaultForeground	   CSG
	   XmCBorderColor			  Pixel
     ____________________________________________________________________
     XmNborderPixmap			   XmUNSPECIFIED_PIXMAP	   CSG
	   XmCPixmap				  Pixmap
     ____________________________________________________________________
     XmNborderWidth			   0			   CSG
	   XmCBorderWidth			  Dimension
     ____________________________________________________________________
     XmNcolormap			   dynamic		   CG
	   XmCColormap				  Colormap
     ____________________________________________________________________
     XmNdepth				   dynamic		   CG
	   XmCDepth				  int
     ____________________________________________________________________
     XmNdestroyCallback			   NULL			   C
	   XmCCallback				  XtCallbackList
     ____________________________________________________________________
     XmNheight				   dynamic		   CSG
	   XmCHeight				  Dimension
     ____________________________________________________________________
     XmNinitialResourcesPersistent	   True			   C
	   XmCInitialResourcesPersistent	  Boolean
     ____________________________________________________________________
     XmNmappedWhenManaged		   True			   CSG
	   XmCMappedWhenManaged			  Boolean
     ____________________________________________________________________
     XmNscreen				   dynamic		   CG
	   XmCScreen				  Screen *
     ____________________________________________________________________
     XmNsensitive			   True			   CSG
	   XmCSensitive				  Boolean
     ____________________________________________________________________
     XmNtranslations			   dynamic		   CSG
	   XmCTranslations			  XtTranslations
     ____________________________________________________________________
     XmNwidth				   dynamic		   CSG
	   XmCWidth				  Dimension
     ____________________________________________________________________
     XmNx				   0			   CSG
	   XmCPosition				  Position
     ____________________________________________________________________
     XmNy				   0			   CSG
	   XmCPosition				  Position
     ____________________________________________________________________



  Callback Information

  A pointer to the following structure is passed to each callback:


  ttyyppeeddeeff ssttrruucctt
  {{
    iinntt	     _r_e_a_s_o_n;;
    XXEEvveenntt   * _e_v_e_n_t;;
    WWiinnddooww   _w_i_n_d_o_w;;
    iinntt	     _c_l_i_c_k__c_o_u_n_t;;
  }} XXmmDDrraawwnnBBuuttttoonnCCaallllbbaacckkSSttrruucctt;;

  _r_e_a_s_o_n Indicates why the callback was	invoked.

  _e_v_e_n_t	 Points	to the XXEEvveenntt that triggered the callback.  This is  NULL for
	 XXmmNNrreessiizzeeCCaallllbbaacckk.

  _w_i_n_d_o_w Is set	to the window ID in which the event occurred.

  _c_l_i_c_k__c_o_u_n_t
	 Contains the number of	clicks in the last multiclick sequence if the
	 XXmmNNmmuullttiiCClliicckk resource	is set to XXmmMMUULLTTIICCLLIICCKK__KKEEEEPP, otherwise it
	 contains 11.  The activate callback is invoked for each	click if
	 XXmmNNmmuullttiiCClliicckk is set to XXmmMMUULLTTIICCLLIICCKK__KKEEEEPP.

  Translations

  XmDrawnButton	includes translations from Primitive.  Additional XmDrawnBut-
  ton translations are listed below.  These translations may not directly
  correspond to	a translation table.

       BBSSeelleecctt PPrreessss:: AArrmm(())
       BBSSeelleecctt CClliicckk:: AAccttiivvaattee(())
		      DDiissaarrmm(())
       BBSSeelleecctt RReelleeaassee::AAccttiivvaattee(())
		      DDiissaarrmm(())
       BBSSeelleecctt PPrreessss 22++::MMuullttiiAArrmm(())
       BBSSeelleecctt RReelleeaassee 22++::MMuullttiiAAccttiivvaattee(())
       KKSSeelleecctt::	      AArrmmAAnnddAAccttiivvaattee(())
       KKHHeellpp::	      HHeellpp(())




















  Action Routines

  The XmDrawnButton action routines are	described below:

  AAccttiivvaattee(()):
	    If XXmmNNppuusshhBBuuttttoonnEEnnaabblleedd is True, redraws the shadow	in the
	    unselected state; otherwise, redraws the shadow according to
	    XXmmNNsshhaaddoowwTTyyppee.  If the pointer is within the DrawnButton, calls
	    the	XXmmNNaaccttiivvaatteeCCaallllbbaacckk callbacks.

  AArrmm(()):    If XXmmNNppuusshhBBuuttttoonnEEnnaabblleedd is True, redraws the shadow	in the
	    selected state; otherwise, redraws the shadow according to
	    XXmmNNsshhaaddoowwTTyyppee.  Calls the callbacks	for XXmmNNaarrmmCCaallllbbaacckk.

  AArrmmAAnnddAAccttiivvaattee(()):
	    If XXmmNNppuusshhBBuuttttoonnEEnnaabblleedd is True, redraws the shadow	in the
	    selected state; otherwise, redraws the shadow according to
	    XXmmNNsshhaaddoowwTTyyppee.  Calls the callbacks	for XXmmNNaarrmmCCaallllbbaacckk.
	    Arranges for the following to happen, either immediately or	at a
	    later time:	If XXmmNNppuusshhBBuuttttoonnEEnnaabblleedd	is True, the shadow is
	    redrawn in the unselected state; otherwise,	the shadow is redrawn
	    according to XXmmNNsshhaaddoowwTTyyppee.	 The callbacks for XXmmNNaaccttiivvaatteeCCaallll--
	    bbaacckk and XXmmNNddiissaarrmmCCaallllbbaacckk are called.

  DDiissaarrmm(()): Marks the DrawnButton as unselected	and calls the callbacks	for
	    XXmmNNddiissaarrmmCCaallllbbaacckk.

  HHeellpp(()):   Calls the callbacks	for XXmmNNhheellppCCaallllbbaacckk if any exist.  If there
	    are	no help	callbacks for this widget, this	action calls the help
	    callbacks for the nearest ancestor that has	them.

  MMuullttiiAAccttiivvaattee(()):
	    If XXmmNNmmuullttiiCClliicckk is	XXmmMMUULLTTIICCLLIICCKK__DDIISSCCAARRDD, this action does noth-
	    ing.
	    If XXmmNNmmuullttiiCClliicckk is	XXmmMMUULLTTIICCLLIICCKK__KKEEEEPP, this	action does the	fol-
	    lowing: Increments _c_l_i_c_k__c_o_u_n_t in the callback structure.  If
	    XXmmNNppuusshhBBuuttttoonnEEnnaabblleedd is True, redraws the shadow in	the
	    unselected state; otherwise, redraws the shadow according to
	    XXmmNNsshhaaddoowwTTyyppee.  If the pointer is within the DrawnButton,  calls
	    the	XXmmNNaaccttiivvaatteeCCaallllbbaacckk callbacks.	Calls the callbacks for
	    XXmmNNddiissaarrmmCCaallllbbaacckk.

























  MMuullttiiAArrmm(()):
	    If XXmmNNmmuullttiiCClliicckk is	XXmmMMUULLTTIICCLLIICCKK__DDIISSCCAARRDD, this action does noth-
	    ing.
	    If XXmmNNmmuullttiiCClliicckk is	XXmmMMUULLTTIICCLLIICCKK__KKEEEEPP, this	action does the	fol-
	    lowing: If XXmmNNppuusshhBBuuttttoonnEEnnaabblleedd is True, redraws the shadow	in
	    the	selected state;	otherwise, redraws the shadow according	to
	    XXmmNNsshhaaddoowwTTyyppee.  Calls the callbacks	for XXmmNNaarrmmCCaallllbbaacckk.

  Additional Behavior

  This widget has the additional behavior described below:

  <<EEnntteerrWWiinnddooww>>:
	    Draws the shadow in	its selected state if XXmmNNppuusshhBBuuttttoonnEEnnaabblleedd is
	    True and if	the cursor leaves and re-enters	the window while
	    BBSSeelleecctt is pressed.

  <<LLeeaavveeWWiinnddooww>>:
	    Draws the shadow in	its unselected state if	XXmmNNppuusshhBBuuttttoonnEEnnaabblleedd
	    is True and	if the cursor leaves the window	while BBSSeelleecctt is
	    pressed.

  Virtual Bindings

  The bindings for virtual keys	are vendor specific.  For information about
  bindings for virtual buttons and keys, see VViirrttuuaallBBiinnddiinnggss((33XX)).

RELATED	INFORMATION
  CCoorree((33XX)), XXmmCCrreeaatteeDDrraawwnnBBuuttttoonn, XXmmLLaabbeell((33XX)), XXmmPPrriimmiittiivvee((33XX)), XXmmPPuusshhBBuuttttoonn,
  and XXmmSSeeppaarraattoorr((33XX)).









































