Step 3 Make the Find Image Form Useful

VLF Windows Application Development

Step 3. Make the Find Image Form Useful

VFW080 – Using an Explorer Component

1.  Switch to the Source tab. Define an uImageSelected event with a map for input of class STD_STRNG:

Define_Evt Name(uImageSelected)
  Define_Map For(*input) Class(#std_strng) Name(#uFilename)

 

     The event, when signalled, will pass the full filename for the selected image.

2.  Create an ItemGotSelection event for Explorer DCBX_2, using the Design view and the context menu  on DCBX_2:

Evtroutine Handling(#DCBX_2.ItemGotSelection) Options(*NOCLEARMESSAGES *NOCLEARERRORS)

Endroutine

 

3.  This routine should set the FileName property for the Image component (IMGE_1) from the Explorer DCBX_2, Path and Filename  Your code should look like the following:

#IMGE_1.fileName := #DCBX_2.path + #DCBX_2.filename

 

4.  In the PHBN_OK.Click event routine

a.  Signal the uImageSelected event.

b.  Populate the uFilename parameter using the DCBX_2 Explorer properties.

c.  Then close the form.

     Your OK push button Click event should look like the following:

Evtroutine Handling(#PHBN_OK.Click)
Signal Event(uImageSelected) Ufilename(#DCBX_2.path + #DCBX_2.filename)
#com_owner.closeForm
Endroutine

 

5.  Complete the PHBN_CANCL Push button Click event, to close the form:

Evtroutine Handling(#PHBN_CANCL.Click)
#com_owner.closeForm
Endroutine
 

6.  Compile your form.