PUBLIC oForm
oForm = CREATEOBJECT("clsThumbnails")
oForm.show()
DEFINE CLASS clsthumbnails AS form
Top = 0
Left = 0
Height = 455
Width = 756
DoCreate = .T.
Caption = "Form1"
Name = "Form1"
ADD OBJECT olecontrol1 AS olecontrol WITH ;
Top = 12, ;
Left = 12, ;
Height = 432, ;
Width = 120, ;
Visible = .T., ;
Enabled = .T., ;
Name = "Olecontrol1", ;
OleClass = "Shell.Explorer.2"
ADD OBJECT command1 AS commandbutton WITH ;
Top = 12, ;
Left = 648, ;
Height = 23, ;
Width = 84, ;
Caption = "Go", ;
Name = "Command1"
ADD OBJECT edit1 AS editbox WITH ;
Height = 24, ;
Left = 144, ;
Top = 12, ;
Width = 492, ;
Name = "Edit1"
ADD OBJECT image1 AS image WITH ;
OLEDropMode = 1, ;
Height = 396, ;
Left = 144, ;
Top = 48, ;
Width = 588, ;
Name = "Image1"
PROCEDURE olecontrol1.Refresh
NODEFAULT
ENDPROC
PROCEDURE command1.Click
IF DIRECTORY(thisform.edit1.value)
thisform.olecontrol1.navigate(thisform.edit1.value)
ELSE
MESSAGEBOX("Please enter the path to the directory in which your pictures reside.",16,"INVALID ENTRY")
thisform.edit1.setfocus()
ENDIF
ENDPROC
PROCEDURE edit1.KeyPress
LPARAMETERS nKeyCode, nShiftAltCtrl
IF nKeyCode = 13
thisform.command1.Click()
ENDIF
ENDPROC
PROCEDURE image1.OLEDragDrop
Lparameters oDataObject, nEffect, nButton, nShift, nXCoord, nYCoord
Local cfilename, afiles[ 1 ]
If oDataObject.GetFormat( 15 )
oDataObject.GetData( 15, @afiles )
For Each cfilename In afiles
Thisform.image1.Picture = cfilename
=INKEY(4) &&View each picture dragged over for 4 seconds
Next
Endif
ENDPROC
PROCEDURE image1.OLEDragOver
LPARAMETERS oDataObject, nEffect, nButton, nShift, nXCoord, nYCoord, nState
DO CASE
CASE nstate = 0 && Drag Enter
IF odataobject.GETFORMAT(15)
THIS.OLEDROPHASDATA = 1
THIS.OLEDROPEFFECTS = 4
neffect = 4
ENDIF
CASE nstate = 1 && DRAG_LEAVE
CASE nstate = 2 && DRAG_OVER
ENDCASE
ENDPROC
ENDDEFINE