' 'Class description: ' !short:DBrowse class structure: Class DBrowse: ~~~~~~~~~~~~~~ Class Browse is adapted for database editation. It could be more database files with relations (conectedd through relations). Common use: ~~~~~~~~~~~ LOCAL OBJECT Db OF DBrowse //object creation NET USE Personal //database opening Db:Init() //object initialisation Db:AddBlock(,"Meno",,FieldBlock("Meno")) //field is appended for editation Db:AddBlock(,"Plat",,FieldBlock("Plat")) //field is appended for editation As all classes derived from Task, this class don't need processing of methods Process() and Done(). Initialisation adds a new object of this class on the top of the stack of classes, and following is a job for task swapper (method Process() of class Task.) Source code of class DBrowse is in C_DBrows.prg !seealso: c_browse.ngo:Browse c_abrows.ngo:ABrowse c_updbro.ngo:UpDBrowse c_upabro.ngo:UpABrowse c_task.ngo:Task c_color.ngo:Color ob_class.ngo:"Class hierarchy" !short:~~~~~~~~~~~~~~~~~~~~~~~~ !short:create class DBrowse from Browse !short: export: !short: var Alias //"" ^BDBrowse:Alias^N: public: character Stored Alias workarea, which should be selected when the task is active. !short: var RecNo //0 ^BDBrowse:RecNo^N: public: numeric Database record number for this task is stored here. It is because the other task can during its activity process the command Skip ñN and change the selected record of this database. If RecNo==0, after the task switching is command Go TOP issued. !short: var IndexNo //0 ^BDBrowse:IndexNo^N: public: numeric The same as the DBrowse:RecNo, other task can use anything included the command SET ORDER. Attention: No other task exept the methods of class Task should open or close the databases. All methods of the library Object.lib assume that at start the databases will be opened and closed at the end. !short: var FilterNo //0 ^BDBrowse:FilterNo^N: public: numeric Information about the filter number (as order number in user defined filters (in menu) ), which is written to bottom window border. !short: var FilterExp //"" ^BDBrowse:FilterExp^N: public: numeric Active filter of selected database of current task (DBrowse:Alias) is saved here. !short: var FilterBExp //{||false} ^BDBrowse:FilterBExp^N: public: code_block If variable FilterExp is not empty (i.e. it contains a valid clipper expression in a for of a text string), so the FilterBExp contais this expression transformed to form of code block. The reason for this is the evaluation speed of the expression. !short: var FilterMark //false ^BDBrowse:FilterMark^N: public: :public: logical Checkmark of filter type (true = coloring, false = dismissing). !short: var OneDbf //(object of OneDbf) ^BDBrowse:OneDbf^N: public: object_of_OneDbf This object contain index, filter & relations definitions. See the OneDbf class. !short: method New=DBrowseNew //o:New() --> self ^BDBrowse:New()^N: public: return self The object is filled with default values, the following predcessor variables are changed: ^UDBrowse:InsBlock^N: public: code_block Code block for one row appending to edited table. ^UDBrowse:DelBlock^N: public: code_block Code block for deleting of current row of edited table. ^UDBrowse:InfoBlock^N: public: code_block Code block for actual record number, filter and index displaying at the bottom window border of current task. !short: method DoGet=DBrowseDoGet //o:DoGet() --> true/false ^BDBrowse:DoGet()^N: private: return true/false The method DoGet() of DBrowse class is appended with the virtual record management and relations keeping. Look at method TestVrecord() of Browse class. !short: method PostInit=DBrowsePostInit //o:PostInit() --> true ^BDBrowse:PostInit()^N: private: return true Used for correct window dimensions counting in the Form mode. The DoGet() method of Browse class is appended with filling of instvar variable DBrowse:Alias with the value returned from clipper function Alias(), when it was not entered (was Empty()). !short: method SwapForm=DBrowseSwapForm //o:SwapForm() --> true ^BDBrowse:SwapForm()^N: private: return true It is for speed optimalization, the filter setting is not necessary everytime. !short: method UpDatabase=DBrowseUpDatabase //o:UpDatabase() --> true ^BDBrowse:UpDatabase()^N: private: return true The clipper DbfNtx system is set correctly for this task, the right workarea is selected, index, filter and relationskeeping is done and the right database record is jumped to in all necessary database files. !short: method UpFilter=DBrowseUpFilter //o:UpFilter() --> true ^BDBrowse:UpFilter()^N: private: return true Help method for DBrowse:UpDatabase(). The filter is set. !short: method VPaint=DBrowseVPaint //o:VPaint() --> true ^BDBrowse:VPaint()^N: private: return true The parent method is appended with database switching. !short: method VProcess=DBrowseVProcess //o:VProcess() --> true ^BDBrowse:VProcess()^N: private: return true The parent method is appended with database switching before the proces and currend record number keeping after the process. !short: endclass