FileDropComboClass Overview  

Top  Previous  Next

The FileDropComboClass is a FileDropClass based on a COMBO control rather than a LIST control. Therefore it supports not only the selection of existing list items but also the selection of values not in the list, and optionally the addition of new values to the list. See Control Templates--FileDropCombo for information on the template implementation of the FileDropCombo control.

Future File DropCombo Classes

The current implementation of the FileDropComboClass is a place-holder implementation. In the future the FileDropComboClass, or its replacement, will be derived from the BrowseClass.

FileDropComboClass Concepts

Based on the end user selection, you can assign one or more values from the selected item to one or more target fields. You may display one field (e.g., a description field) but assign another field (e.g., a code field) from the selected list item.

The FileDropClass also supports filters, range limits, colors, icons, sorting, and multiple item selection (marking). See Control Templates--FileDropCombo for information on the template implementation of these features.

FileDropComboClass Relationship to Other Application Builder Classes

The FileDropComboClass is closely integrated with the WindowManager. These objects register their presence with each other, set each other's properties, and call each other's methods as needed to accomplish their respective tasks.

The FileDropComboClass is derived from the FileDropClass, plus it relies on several of the other Application Builder Classes to accomplish its tasks. Therefore, if your program instantiates the FileDropClass, it must also instantiate these other classes. Much of this is automatic when you INCLUDE the FileDropClass header (ABDROPS.INC) in your program's data section. See the Conceptual Example.

FileDropComboClass ABC Template Implementation

The ABC Templates automatically include all the classes and generate all the code necessary to support the functionality specified in your application's FileDropCombo control templates.

The templates derive a class from the FileDropComboClass and instantiate an object for each FileDropComboControl template in the application. The derived class and obect is called FDCB# where # is the FileDropCombo Control template instance number. The templates provide the derived class so you can use the FileDropComboControl template Classes tab to modify the FileDropCombo's behavior on an instance-by-instance basis.

The derived FileDropComboClass is local to the procedure, is specific to a single FileDropCombo and relies on the global ErrorClass object and the file-specific RelationManager and FileManager objects for the displayed lookup file.

FileDropComboClass Source Files

The FileDropComboClass source code is installed by default to the Clarion \LIBSRC folder. The FileDropComboClass source code and their respective components are contained in:



FileDropComboClass declarations



FileDropComboClass method definitions

FileDropComboClass Conceptual Example

The following example shows a typical sequence of statements to declare, instantiate, initialize, use, and terminate a FileDropComboClass object and related objects.

This example uses the FileDropComboClass object to let the end user select or enter a valid state code for a given client. The state code comes from the state file.










Record        RECORD,PRE()

StateCode      STRING(2)

StateName      STRING(20)






Record    RECORD,PRE()


Name       STRING(30)

State      STRING(2)




GlobalErrors  ErrorClass

VCRRequest    LONG(0),THREAD


Access:State CLASS(FileManager)

Init          PROCEDURE



Relate:State CLASS(RelationManager)

Init          PROCEDURE



Access:Customer CLASS(FileManager)

Init             PROCEDURE



Relate:Customer CLASS(RelationManager)

Init             PROCEDURE



StateQ    QUEUE


ViewPosition STRING(512)


StateView VIEW(State)



CusWindow WINDOW('Add Customer'),AT(,,157,58),IMM,SYSTEM,GRAY










ThisWindow CLASS(WindowManager)





StateDrop  CLASS(FileDropClass)

Q           &StateQ






ThisWindow.Init PROCEDURE()

ReturnValue     BYTE,AUTO





 SELF.Request = InsertRecord

 ReturnValue = PARENT.Init()

 IF ReturnValue THEN RETURN ReturnValue.

 SELF.FirstField = ?CUS:NAME

 SELF.VCRRequest &= VCRRequest

 SELF.Errors &= GlobalErrors



 SELF.OkControl = ?OK



 SELF.Primary &= Relate:Customer

 SELF.InsertAction = Insert:Batch

 IF SELF.PrimeUpdate() THEN RETURN Level:Notify.



!initialize the FileDropCombo Class with:

! the combo's USE variable, COMBO control, view POSITION, VIEW, combo's FROM QUEUE,

! primary file RelationManager object, WindowManager object, ErrorClass object,

! add records flag, hot fields flag, case sensitive flag



 StateDrop.Q &= StateQ






 RETURN ReturnValue


ThisWindow.Kill PROCEDURE()

ReturnValue          BYTE,AUTO


 ReturnValue = PARENT.Kill()

 IF ReturnValue THEN RETURN ReturnValue.






 RETURN ReturnValue


Access:State.Init PROCEDURE



 SELF.FileNameValue = 'State'

 SELF.Buffer &= ST:Record

 SELF.LazyOpen = False



Access:Customer.Init PROCEDURE



 SELF.FileNameValue = 'Customer'

 SELF.Buffer &= CUS:Record

 SELF.Create = True

 SELF.LazyOpen = False



Relate:State.Init PROCEDURE





Relate:Customer.Init PROCEDURE