OK and Cancel Push Buttons

The four methods described in this section add OK and Cancel push buttons to the dialog. The standard IDs (1 for OK and 2 for Cancel) are assigned to the buttons.

AddOkCancelRightBottom

>>-aUserDialog~AddOkCancelRightBottom--------------------------><


The AddOkCancelRightBottom method adds an OK and a Cancel push button to the lower-right edge of the dialog.

Example:

The following example adds the two push buttons to the bottom of the dialog. It further overrides the standard OK and Cancel methods.

::class MyClass subclass UserDialog

::method DefineDialog
      .
      .
      .
   self~AddOkCancelRightBottom

::method OK
   ret = MessageBox("Are you sure?", "Please confirm", "OK")
   if ret=1 then self~OK:super

::method Cancel
   ret = MessageBox("Do you really want to quit?", "Please confirm", "OK")
   if ret=1 then self~CANCEL:super

AddOkCancelLeftBottom

>>-aUserDialog~AddOkCancelLeftBottom---------------------------><


The AddOkCancelLeftBottom method adds an OK and a Cancel push button to the lower-left edge of the dialog.

AddOkCancelRightTop

>>-aUserDialog~AddOkCancelRightTop-----------------------------><


The AddOkCancelRightTop method adds an OK and a Cancel push button vertically to the upper-right edge of the dialog.

AddOkCancelLeftTop

>>-aUserDialog~AddOkCancelLeftTop------------------------------><


The AddOkCancelLeftTop method adds an OK and a Cancel push button vertically to the upper-left edge of the dialog.