PreviousNextIndex

DEFINE BUTTON statement

The DEFINE BUTTON statement defines a push button that is created at compile time for use within the current procedure or class.

Note: Does not apply to SpeedScript programming.
Syntax

DEFINE [ PRIVATE ] BUTTON button 
  [ AUTO-GO | AUTO-ENDKEY ] 
  [ DEFAULT ] 
  [ BGCOLOR expression ] 
     [ CONTEXT-HELP-ID expression ] 
  [ DCOLOR expression ] 
  [ DROP-TARGET ] 
  [ FGCOLOR expression ] 
  [ FONT number ] 
  [ IMAGE-DOWN image-phrase ] 
  [ { IMAGE | IMAGE-UP } image-phrase ] 
  [ IMAGE-INSENSITIVE image-phrase ] 
  [ MOUSE-POINTER name ] 
  [ LABEL label ] 
  [ LIKE button ] 
  [ PFCOLOR expression ] 
  [ size-phrase ] 
  [ NO-FOCUS [ FLAT-BUTTON ] ] 
  [ NO-CONVERT-3D-COLORS ] 
  [ TOOLTIP tooltip ] 
  { [ trigger-phrase ] } 

[ PRIVATE ] BUTTON button
BUTTON button
AUTO-END-KEY
AUTO-GO
DEFAULT
BGCOLOR expression
CONTEXT-HELP-ID expression
DCOLOR expression
FGCOLOR expression
FONT number
{IMAGE | IMAGE-UP } image-phrase
IMAGE-DOWN image-phrase
IMAGE-INSENSITIVE image-phrase
MOUSE-POINTER name
LABEL label
LIKE button
PFCOLOR expression
size-phrase
NO-FOCUS [ FLAT-BUTTON ]
FLAT-BUTTON
NO-CONVERT-3D-COLORS
TOOLTIP tooltip
DROP-TARGET
trigger-phrase
Example

This procedure defines two buttons, positions the buttons within a form, assigns triggers to the buttons with ON statements, and enables the buttons by referencing them in an ENABLE statement:

r-button.p
DEFINE BUTTON more-button LABEL "More". 
DEFINE BUTTON next-button LABEL "Next". 
FORM more-button next-button 
  WITH FRAME but-frame ROW 1. 
FORM Customer.CustNum Customer.Name 
  WITH FRAME brief ROW 4. 
FORM Customer EXCEPT Customer.CustNum Customer.Name 
  WITH FRAME full ROW 7. 
ON CHOOSE OF more-button 
  DISPLAY Customer EXCEPT Customer.CustNum Customer.Name WITH FRAME full. 
ON CHOOSE OF next-button DO: 
  HIDE FRAME full. 
  FIND NEXT Customer NO-ERROR. 
  DISPLAY Customer.CustNum Customer.Name WITH FRAME brief. 
END. 
FIND FIRST Customer. 
DISPLAY Customer.CustNum Customer.Name WITH FRAME brief. 
ENABLE more-button next-button WITH FRAME but-frame. 
WAIT-FOR WINDOW-CLOSE OF CURRENT-WINDOW. 

When the procedure is run, the first Customer’s number and name are initially displayed. The user can choose either the MORE button to see the entire Customer record or the NEXT button to see the next Customer’s number and name.

The following example sets up a browse that allows you to drop a file on the browse:

DEFINE BUTTON button-1 LABEL ’’Drop Here’’ DROP-TARGET.  

Notes
See also

Class-based data member access, FORM statement, Image phrase


OpenEdge Release 10.2B
Copyright © 2009 Progress Software Corporation
PreviousNextIndex