home *** CD-ROM | disk | FTP | other *** search
- AlexSoft Component Library (freeware edition).
- Author - Alex Rabichooc.
- a_rabichooc@yahoo.com
- alex@carmez.mldnet.com
-
- This package was designed for easier development of clients for database
- applications.
- It was created in 1998 for personal purposes, therefore any Help or
- documentation is missing.
- I decided to publish it for public use in slightly simplified edition. If
- you will find some bugs in this edition, please let me know - I didn't check
- this edition for bugs.
- I will describe only key properties of my components. For more information
- see source code.
-
- 1)TRaDBedit - Dbedit/DbLookup/DbImage/DbMemo(depending on Field's type) Field
- with Text Label.
- properties:
- published
- DataSource, DataField - DataSource and Field.FieldName.
- EditKind (ekCommon, ekView, ekControl) - type of the field.
- - ekCommon - ordinary field,
- - ekView - non edited field (like TDBText)
- - ekControl - control field. Depending on the Fields type, clicking on the
- button (by default) will result following action(see DoButtonClick method):
- * if Field.DataType = ftMemo, ftFmtMemo - Start Rich text editor for the
- Field
- * ftGraphic, ftTypedBinary, ftBlob - Start Image Editor for the Field
- (in this edition it highly simplified)
- * ftDataSet - Start Edit/View form for the NestedDataSet
- * ftDate, ftDateTime - Start Calendar form.
- * If the Field is Lookup field or it is key field for another lookup
- field, by clicking on the button you will launch Editor/Viewer form for
- the corresponding Lookup DataSet.
- To override the default click action, you can write OnButtonClick event
- handler.
- ShowBLOB - for BLOBs. If True, Memo or Image will be visible in the TRaDBedit.
- public
- Field: TField - pointer to the linked TField.
- Glyph, NumGlyphs - for the button
- ReadOnly - if true, user can't change the value of the field.
-
- events:
- OnButtonClick - occurs when the user clicks the button (default action -
- DoEditButtonClick in unit dbtools)
- OnReplaceField - occurs when the user closes Lookup DataSet Editor/Viewer
- Form and replaces the value of the key field with the current value of
- lookup key field (default action - ReplaceField in unit dbtools)
-
- 2)TRaDBBox - ScrollBox, containing TRaDBedits (it can also contain other
- controls) - like TDBCtrlGrid.
- properties:
- DataSource - points to the linked DataSource
- CreateMode (cmAuto, cmManual) - creation mode of TRaDBedit components
- - cmAuto - creates it automatically from DataSource.DataSet
- - cmManual - user can add/delete/modify TRaDBedits (and other controls)
- manually.
- Orientation (orVertical, orHorizontal)- disposition of TRaDBedits when
- CreateMode = cmAuto.
- ReadOnly - if true, user can't edit the linked DataSet.
- ShowBlobs - the same as for TRaDBedit
- AllowMove, AllowDelete, AllowInsert - determines ability of movement trough
- DataSet, deleting from it and inserting new rows into it using keyboard.
- ConfirmDelete - when true, a message box appears, asking for confirmation,
- when the user trying to delete a row from DataSet using keyboard.
-
- navigate Keys:
- Ctrl-F1: Click to TRaDBedit button
- LEFT,RIGHT,UP,DOWN,TAB,SHIFT-TAB,ENTER: Field movement
- PgDn,PgUp,Ctrl-PgDn,Ctrl-PgUp: Record movement
- F2: Changing edit mode
- INSERT, Ctrl-INSERT: Append, Insert into DataSet.
- F8: Delete from DataSet.
-
- 3) TRaDBGrid - like TDBGrid. Automatically determines whether a column should
- have ButtonStyle=cbsEllipsis using same criteria (and with the same effect) as
- TRaDBedit.EditKind = ekControl. Navigation was changed - added keys
- Ctrl-F1, Enter, F8 (same actions as in TRaDBBox)
- properties:
- RedMinus - determines whether negative values of numeric data fields are drawn
- in red color.
- VisibleColCount, VisibleRowCount - the number of completely visible columns and
- rows.
-
- events:
- OnReplaceField - the same as in TRaDBedit.
-
- 4) TRaDBPanel - aggregate of TRaDBGrid and TRaDBBox - suitable for Master-Detail.
- properties:
- DataSource - linked DataSource
- PanelStyle (psAuto, psBox, psGrid) - style of panel.
- - psBox - Panel looks like TRaDBBox
- - psGrid - like TRaDBGrid
- - psAuto - if DataSource.DataSet is Detail DataSet for Master-Detail
- relationship, then in the panel both TRaDBBox(Master) and
- TRaDBGrid(Detail) are visible, otherwise panel looks like TRaDBGrid.
- Box - points to TRaDBBox
- Grid - points to TRaDBGrid
- BoxFields - collection of TRaDBedits in TRaDBPanel.Box.
- GridColumns - TRaDBPanel.Grid.Columns.
- BoxHeight - for Master-Detail (when PanelStyle=psAuto), Box's height. For
- automatic calculation of Box's height, set BoxHeight = -1.
- CloseOnEscape - when true, pressing Esc key will close parent form.
-
- navigation keys are the same as in TRaDBBox and TRaDBGrid +
- Ctrl-1: Move to first level (Box)
- Ctrl-2: Move to second level (Grid)
- Esc - When CloseOnEscape = true - closes parent form.
-
- 5) TRaDBSearch - searches field values in the linked DataSet.(It performs
- search on the client side, not on the server side (!!!) so only in rows, which
- currently exist in the DataSet)
- properties:
- DataSet - linked DataSet.
- SearchKind(skNormal, skExtended, skContext) - determines search kind:
- ordinary search, extended and context search. User can define fields (by
- double clicking on the component in designtime). To Start search in runtime,
- call method
- Execute(DefaultField: TField): Boolean;
- where DataField - Dataset's field which is used for searching (or nil).
-
- 6)TRaDBNavigator - like TDBNavigator. Added search button.
- properties:
- DataSourceAuto - if true then Navigator is linked to the DataSet of current
- active data aware control (if exists).
- SearchComponent - points to TRaDBSearch component (can be nil).
- DefaultAction - if defined event handler OnClick, then this property
- determines whether default action should be done when the user clicks
- navigator button (default action - DoDefaultClick(buttonIndex));
-
- 7)TRaDBInsert - CheckBox.
- If RaDBInsert.Checked = true then when user inserts rows into the linked
- DataSet, Values for all dataset fields are taken from the current record.
-
- 8)TRaTable, TRaQuery, TRaStoredProc, TRaClientDataSet - like TTable, TQuery,
- TStoredProc, TClientDataSet
- new properties:
- FormCaption, FormClassName, ModalForm, FreeOnClose. This properties are
- related to the Form, which is a Editor/Viewer form to the DataSet. When
- the user presses Ctrl-F1 (see TRaDBEdit) or clicks TRaDBEdit button,
- Editor/Viewer form for the Lookup Dataset is launched. If the property
- FormClassName is not defined, this form is TDefaultForm (unit DBForms).
- However in many cases user needs more complex forms. To do this you need:
- a) Design such Form
- b) In Delphi source code editor in "uses" clause add unit DBForms
- c) In Delphi source code editor change the declaration. This form
- should inherit from TDBForm instead of TForm:
- Ex: TmyForm1 = class(TDBForm)
- d) Register the class of this form
- Ex: RegisterClass(TmyForm1)
- You can do this in "initialization" section of the unit.
- e) Set property FormClassName of corresponding DataSet to this class
- Ex:FormClassName = TmyForm1
- f) Set property FormCaption of corresponding DataSet to form's caption
- If all of this steps is done then the Editor/Viewer form for this
- DataSet will be TmyForm1 instead of TDefaultForm.
- ModalForm determines whether DataSet form is modal.
- FreeOnClose determines whether DataSet form will be destroyed after closing.
-
- To launch manually Dataset form in runtime call function:
- function InitDBForm(DataSet:TDataSet; Field:TField; AOwner:TComponent): Integer;
- where DataSet - DataSet, Field - control field (Lookup or key field for lookup
- field) or nil.
- Return value - if Form is a modal form - ModalResult, otherwise 0.
-
- This package also contains some QuickReport components designed for printing on
- matrix printers using built-in fonts (ASCII printers). If it is interesting for you
- I will describe them by e-mail.
-