Class: Table_DS_mixin

Module location: Table_ds.pkg line 98 (view source)

Class Hierarchy:

cObjectMixinTable_DS_mixin

Mixins:

Clear_Defaults_Mixin, DEO_Delegate_Mixin, DEO_Dependent_item_mixin, Entry_CheckBox_Mixin, FIND_EDIT_Mixin, Validate_Mixin, VERIFY_Mixin,

Class Definition

Properties

IntegerAllow_Bottom_Add_State
IntegerAllow_Insert_Add_State
IntegerAllow_Top_Add_State
IntegerAuto_Regenerate_State
IntegerChild_Table_State
IntegerNo_Create_State
IntegerNo_Delete_State
BooleanpbInRowSave
used to stop recursive saves
IntegerUnsorted_State
IntegerWrapping_State

Functions and Procedures

Add_New_Row(Integer iLoc)
public message: Add_new_row Pass: loc as: -1=top, 0=current row, 1=bottom
add_or_Remove_row()
internal Add_or_Remove_row: This is the table clearing handler. If: A. New row / Unchanged: Delete empty row if this is not the only row. B. old row / unchanged: If Allow_Insert_Add_State and not no_create_state, insert new row and enter. C. New row / changed: Verify_loss and create emtpy row. Goto 1st enterable column. D. old row / changed: Verify_loss and insert row. (was: restore to what was) 03/06/95 JJT Altered logic. Case A: If row is new and unchanged and there is only 1 row do nothing. Case C: Goto first enterable column (not col 0)
IntegerAllow_Row_Change()
Internal Function: Allow_row_Change - Rets 0 if ok to change We want to change row...See if it is allowed. it is allowed if: 1. There is no change - no problem 2. If changes and auto_save - attempt to make the save 3. If changes and not auto_save - verify_data Loss
Beginning_of_Data()
public
IntegerChild_Entering()
Child_Entering and Child_Exiting are only called when Child_Table_State is true. When a table is nested inside another DEO (a header / table condition) you have different needs. Function Child_Entering By default this does nothing. If you return a non-zero value the table will not be entered. Very useful. You will often use this to make sure that 1) it is valid to enter the table and 2) that the header is saved before entering the table.
IntegerChild_Exiting(Integer toObj#)
Function Child_Exiting You can stop the exiting by returning a non-zero value. By default this save the current record. If the save fails the exiting is stopped. Note that the object ID you are entering is passed. This can be useful to know. If you are exiting to a form or editor that is part of the table (often a child of the table object) you may not want to save the table line. If the object you are entering is part of the header, you would probably want to save the table. Note that the default errs on the side of caution (it always saves the table).
Child_Wrapping(integer direction integer xorigID)
Internal procedure Child_Wrapping integer direction integer base targetItem send activate get base_item to base if direction ne 0 begin Move (base + item_limit(self)) to targetItem if targetItem ge (item_count(self)) send add_row end else begin Move (base - 1) to targetItem if targetItem lt 0 move 0 to targetItem end set current_item to targetItem procedure_return 1 end_procedure
Clear()
clear inserts a new line and goes to that line 03/06/95 JJT - adjust so a clear returns to the first enterable item and not the first column.
integerClear_a_row()
internal Clear_a_row: This is the table clearing handler. If: A. New row / Unchanged: Delete empty row (should it be ignore?)_ Only do this, if this is not the only row. B. old row / unchanged: ignore C. New row / changed: verify_loss and create emtpy row, goto 1st enterable column D. old row / changed: verify_loss and restore to what was 03/06/95 JJT Altered logic. Case A: If row is new and unchanged and there is only 1 row do nothing. Case C: Goto first enterable column (not col 0)
Construct_Object(integer img)
New Properties: Allow_Top_Add_State Dflt:False If true then you may cursor up to the top of the list and an empty space will open up Allow_Bottom_Add_State Dflt: TRUE If true then you may cursor down to the end of the list and an empty space will open up Allow_Insert_Add_State Dflt: TRUE If true then you may insert a new row at the current position. No_Create_State Dflt: False If True you can not add any new row (it overrides the above three states). No_Delete_State Dflt: False If True deletes are disabled in table Read_Only_State Dflt: False If true no edits, adds, or deletes are allowed. Auto_Refresh_State Dflt:True If true the the table updates itself after a save with the exception of being in add mode.. It will rebuild after you exit add mode. If False it will not rebuild until screen is refreshed Needs_Refresh_State Dflt:False Maintained by system. If true than a save might have changed the table order.
IntegerCreate_Cbox_Object()
Create the cbox object. This only gets created if required. We create this in the class and not the mixin because you seem to get odd results if objects are created in mixin procedures returns ID of object
DoSetOrderingDirection(integer bReverse)
disallow if row cannot be changed or it the record is new but still set the new ordering
End_Construct_Object()
fix for RT bug in dependent_items that causes invalid item number error if items don't exist when update_dependent_items occurs.
End_of_Data()
public
Entering()
Entering is augmented to call Child_Entering if Child_Table_State=T
Entry_Autofind(integer eFindMode integer iItem)
Support passing of optinal Item to autofind on. If not passed the runtine will figure it out. Always pass the autofind-item. The runtime also calls this not passing an item but it figure it out.
IntegerExiting(Handle hoDestination)
Exiting is augmented to call Child_Exiting if Child_Table_State=T
integerFirstEnterableColumn()
private. Figure out what the first enterable column is likely to be. We use this to figure out if an exit message will need to get sent
IntegerLoad_Page(Integer Row#)
Augment to unset the UnSorted_State Flag
Mouse_Down(Integer iWindowNumber Integer iPosition)
Private: Control Mouse down so that it will move into an empty row just like down arrow does. Also if pressed anyhwere at the bottom of an empty then move to the last valid row.
Refresh(integer notifyMode)
05/16/95 -Augment so that refreshes that are part of a save sets the sorted state to false. This probably belongs in data_list but this would require moving all of the unsorted_state logic into that class. Not for now.
Remove_Row(Integer CurRow)
internal: Remove row. Add another line in the table to replace the missing row. Make sure the current record remains active 03/06/95 JJT - make sure we stay in the same column when we remove the last row in a table
Reorder_List(Integer iNewCol)
disallow if row cannot be changed or it the record is new
Request_Clear()
public
Request_Clear_All()
------------------------------------------------------------------- messages requiring server services ------------------------------------------------------------------ public
Request_Delete()
public Sun 07-05-1992 Added send Append_Blank_Row to leave an blank line 03/06/95 - Move to first enterable item if a blank-row is added.
Request_Find(integer mode integer entUpdtFlag)
public FindEdit support behavior
Request_Save()
public
Request_Save_No_Clear()
this allows us to save a record without it clearing regardless of the Auto_Clear_DEO_State value
Request_Superfind(integer mode)
public FindEdit support behavior
IntegerRow_Changed()
internal
integerRow_Changing(integer from# integer to#)
internal Function: Row Changing New row / Unchanged: Delete empty row..then move old row / unchanged: Move Auto_Save -New row / changed: Save then move Auto_Save -old row / changed: Save then move ~Auto_Save -New row / changed: Verify data loss / empty / move ~Auto_Save -old row / changed: Verify data loss / restore /move 10/04/94 -JJT changed to make add mode items insert new rows instead of overwriting
Row_Delete()
internal
integerRow_save()
This isbeing marked public because it is the one message that is always sent when a row in a grid is saved All other DEOs can use request_save for both sending and augmentation to catch a save. Here we need to send request_save but augment row_save (which i scalled by request_save and others).
Save_row()
internal This exists to maintain compatability with the DAC table interface (people might have augmented this). Note: It is better to augment the row_save function because it returns a status value
Scroll(Integer eDirection Integer iNumLines)
public
IntegerShould_Save()
added 07-24-1992 - could replace row_changed
integervalidate_range(integer from# integer to#)
internal