Class TRkDBSpinEdit (unit RkDBSpin) |
TSpinEdit
Constructors |
Functions |
Properties |
Events |
Variables |
Constructors |
===========================} {== TRkDBSpinEdit Methods ==} {===========================
Functions |
Assign event handlers
Increment only if in edit mode
Tell the FDataLink that the data has changed
Need to handle Old Fashioned Cut, Paste, and Delete keystrokes
Escape key pressed
========================================================================= TRkDBSpinEdit.ActiveChange This method gets called whenever the Active property of the attached Dataset changes. NOTE: You can use the FDataLink.Active property to determine the *new* state of the Dataset. =========================================================================
========================================================================= TRkDBSpinEdit.CheckFieldType This method checks to make sure the field type corresponding to the column referenced by Value is either ftInteger, ftSmallInt, or ftWord. If it is not, then an EInvalidFieldType exception is raised. =========================================================================
Because Alignment automatically reverts back to taLeftJustify when control gets the focus, the control must be repainted, when the focus changes.
Reraise the exception
========================================================================= TRkDBSpinEdit.DataChange This method gets called as a result of a number of different events: 1. The underlying field value changes. Occurs when changing the value of the column tied to this control and then move to a new column or a new record. 2. The corresponding Dataset goes into Edit mode. 3. The corresponding Dataset referenced by DataSource changes. 4. The current cursor is scrolled to a new record in the table. 5. The record is reset through a Cancel call. 6. The DataField property changes to reference another column. =========================================================================
========================================================================= TRkDBSpinEdit.EditingChange This method gets called when the State of the attached Dataset (via the DataSource) changes between an Editing state and a Non-Editing state. The different states are described below: Editing States Non-Editing States -------------- ------------------ dsEdit dsInactive dsInsert dsBrowse dsSetKey dsCalcFields NOTE: This method only gets called if the DataLink is not ReadOnly. =========================================================================
Check that field type is Integer
= TRkDBSpinEdit.DataChange =} {========================================================================= TRkDBSpinEdit.UpdateData This method gets called when the corresponding field value and the contents of the SpinEdit need to be synchronized. Note that this method only gets called if this control was responsible for altering the data. =========================================================================
Draw the text
EditorEnabled is defined in TSpinEdit
========================================================================= TRkDBSpinEdit.WMPaint This method takes a trick provided in the DBCtrls unit for handling the display of right justified text into an edit field. If the text needs to be drawn right-justified, then the text is drawn manually. Otherwise, the default message handler handles it. The contents are always drawn left-justified when the control has the focus. =========================================================================
========================================================================= Both the WMPaste and WMCut methods had to be copied from the TSpinEdit class because placing the Dataset into Edit mode must come before altering the text, but after checking for ReadOnly. =========================================================================
Properties |
Inherited Properties
This property controls the ReadOnly state of the DataLink
Events |
Variables |