FileDropClass Overview

Top  Previous  Next

Future FileDropClasses

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

FileDropClass Concepts

The FileDropClass is a ViewManager that supports a file-loaded scrollable list on a window. By convention, a FileDrop provides a "pick list" for the end user. A pick list is a finite list of mutually exclusive or alternative choices--the end user may choose only one of several items, but need not memorize the choices, because all the choices are displayed.

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--FileDrop for information on the template implementation of these features.

FileDropClass Relationship to Other Application Builder Classes

The FileDropClasss 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, and the FileDropClass is derived from the ViewManager. The FileDropClass 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.

FileDropClass 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 FileDrop control templates.

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

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

FileDropClass Source Files

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



FileDropClass declarations



FileDropClass method definitions

FileDropClass Conceptual Example

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

This example uses the FileDropClass object to let the end user select a valid state code for a given client. The state code comes from the State file. When they are initialized properly, the FileDropClass and WindowManager objects do most of the work (event handling and field assignments) internally.










Record        RECORD,PRE()

StateCode      STRING(2)

StateName      STRING(20)






Record     RECORD,PRE()


Name        STRING(30)

State       STRING(2)




GlobalErrors ErrorClass



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 FileDrop Class with:

! the LISTS's USE variable, LIST control, view POSITION, VIEW, LISTS's FROM QUEUE,

! primary file RelationManager object, WindowManager object


 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