home *** CD-ROM | disk | FTP | other *** search
- ************************************************************************************
- * PROGRAM: Buttons.cc
- *
- * WRITTEN BY: Borland Samples Group
- *
- * DATE: 2/94
- *
- * UPDATED: 6/94
- *
- * REVISION: $Revision: 1.51 $
- *
- * VERSION: dBASE FOR WINDOWS 5.0
- *
- *
- * DESCRIPTION: This is a procedure file containing class definitions for
- * pushbuttons most frequently used in dBASE for Windows forms.
- * These buttons contain both bitmaps, which are located in
- * <_dbwinhome>\bin\dbas0009.dll, and text.
- * Current Classes:
- * OkButton
- * CloseButton
- * CancelButton
- * YesButton
- * NoButton
- * NextButton
- * PrevButton
- * HelpButton
- * InfoButton
- * ToolButton
- * ReportButton
- * BrowseButton
- *
- * PARAMETERS: Each custom button control in this file requires 2 arguments:
- * F -- Object -- Reference to the parent form
- * Name -- String -- Name of the control being created
- * Example:
- * f = new form()
- * p = new OkButton(f,"myOkButton")
- *
- * CALLS: None
- *
- * USAGE: SET PROCEDURE TO Buttons.cc, then use these classes with:
- * NEW syntax: x = new OkButton(f),
- * DEFINE syntax: define OkButton x of f
- * FORMS DESIGNER: select the classes from the DBW Custom Classes
- * inspector when adding controls to your form.
- *
- * NOTE: Right now MarkCustom(control) is executed in the constructor
- * of each custom control so that the control can be streamed out
- * correctly during code generation, when saved through the forms
- * designer. This is temporary, and will be replaced with the
- * CUSTOM keyword in the DEFINE <control> command.
- *******************************************************************************
- #include <Messdlg.h>
-
- *******************************************************************************
- *******************************************************************************
- class OkButton(f,n) of Pushbutton(f,n) custom
- *******************************************************************************
-
- this.height = 1.50
- this.width = 14.11
- this.upbitmap = "Resource #20"
- this.disabledbitmap = "Resource #21"
- this.text = "OK"
-
- endclass
-
- *******************************************************************************
- class CloseButton(f,n) of Pushbutton(f,n) custom
- *******************************************************************************
-
- this.height = 1.50
- this.width = 14.11
- this.upbitmap = "Resource #20"
- this.disabledbitmap = "Resource #21"
- this.text = "C&lose"
- this.OnClick = {;form.Close()}
- this.StatusMessage = "Close this form."
-
- endclass
-
- *******************************************************************************
- *******************************************************************************
- class CancelButton(f,n) of Pushbutton(f,n) custom
- *******************************************************************************
-
- this.height = 1.50
- this.width = 14.11
- this.upbitmap = "Resource #28"
- this.disabledbitmap = "Resource #29"
- this.text = "Cancel"
- this.OnClick = {;form.Close()}
- this.StatusMessage = "Cancel this form."
-
- endclass
-
- *******************************************************************************
- *******************************************************************************
- class HelpButton(f,n) of Pushbutton(f,n) custom
- *******************************************************************************
-
- this.height = 1.50
- this.width = 14.11
- this.upbitmap = "Resource #32"
- this.disabledbitmap = "Resource #33"
- this.text = "Help"
-
- endclass
-
- *******************************************************************************
- *******************************************************************************
- class YesButton(f,n) of Pushbutton(f,n) custom
- *******************************************************************************
-
- this.height = 1.50
- this.width = 14.11
- this.upbitmap = "Resource #20"
- this.disabledbitmap = "Resource #21"
- this.text = "&Yes"
-
- endclass
-
-
- *******************************************************************************
- *******************************************************************************
- class NoButton(f,n) of Pushbutton(f,n) custom
- *******************************************************************************
-
- this.height = 1.50
- this.width = 14.11
- this.upbitmap = "Resource #24"
- this.disabledbitmap = "Resource #25"
- this.text = "&No"
-
- endclass
-
- *******************************************************************************
- *******************************************************************************
- class NextButton(f,n) of Pushbutton(f,n) custom
- *******************************************************************************
-
- this.height = 1.50
- this.width = 14.11
- this.upbitmap = "Resource #100"
- this.text = "&Next"
- this.StatusMessage = "Go to next record."
-
- ****************************************************************************
- procedure OnClick
- ****************************************************************************
- skip
- if eof()
- go bottom
- AlertMessage("At the last record","Alert")
- endif
- endclass
-
- *******************************************************************************
- *******************************************************************************
- class PrevButton(f,n) of Pushbutton(f,n) custom
- *******************************************************************************
-
- this.height = 1.50
- this.width = 14.11
- this.upbitmap = "Resource #104"
- this.text = "&Previous"
- this.StatusMessage = "Go to previous record."
-
- ****************************************************************************
- procedure OnClick
- ****************************************************************************
- skip - 1
- if bof()
- go top
- AlertMessage("At the first record","Alert")
- endif
-
- endclass
-
-
- *******************************************************************************
- *******************************************************************************
- class InfoButton(f,n) of Pushbutton(f,n) custom
- *******************************************************************************
-
- this.height = 1.50
- this.width = 14.11
- this.upbitmap = "Resource #112"
- this.text = "&Info"
-
- endclass
-
- *******************************************************************************
- *******************************************************************************
- class ToolButton(f,n) of Pushbutton(f,n) custom
- *******************************************************************************
-
- this.height = 1.50
- this.width = 4
- this.upbitmap = "Resource #148"
- this.text = ""
- this.tabstop = .f.
-
- endclass
-
- *******************************************************************************
- *******************************************************************************
- class ReportButton(f,n) of Pushbutton(f,n) custom
- *******************************************************************************
-
- this.UpBitmap = "RESOURCE #614"
- this.Text = "Report"
- this.height = 1.50
- this.width = 14.11
-
- ****************************************************************************
- procedure OnClick
- ****************************************************************************
- report form ?
-
- ENDCLASS
-
- *******************************************************************************
- *******************************************************************************
- CLASS BrowseButton(f,n) of PushButton(f,n) custom
- *******************************************************************************
-
- this.UpBitmap = "RESOURCE #610"
- this.Text = "Browse"
- this.height = 1.50
- this.width = 14.11
-
- ****************************************************************************
- procedure OnClick
- ****************************************************************************
- browse
-
- endclass
-