*******************************************************************
*** Name.....: browse_replacement
*** Function.: Show possible replacement exhibits - non image
*** Called From: getfiles2
********************************************************************
PUBLIC oForm
logging('gsbrowse_replacement')
DECLARE INTEGER ShellExecute ;
IN SHELL32.DLL ;
INTEGER nWinHandle,;
STRING cOperation,;
STRING cFileName,;
STRING cParameters,;
STRING cDirectory,;
INTEGER nShowWindow
if !used('foundex')
USE foundexh IN 0
endif
SELECT foundexh
SELECT * FROM foundexh INTO TABLE mycursor
SELECT foundexh
USE
SELECT mycursor
SET DEFAULT TO (mysystempath)
DO openings -&& check for open tables
SET DEFAULT TO (mydatapath)
GO TOP
oForm = CREATEOBJECT("EDITOR")
oForm.SHOW()
RETURN
DEFINE CLASS EDITOR AS FORM
TOP = 0
LEFT = 0
HEIGHT = 450
WIDTH =700
BACKCOLOR = RGB(192,192,192)
DOCREATE = .T.
CAPTION = 'New exhibit Selection'
NAME = "MyForm2"
ICON = 'pw16_1.ico'
AUTOCENTER = .T.
MOVABLE = .F.
CONTROLBOX = .F.
SHOWTIPS = .T.
ADD OBJECT cmdExit AS COMMANDBUTTON WITH ;
TOP = 420, ;
LEFT = 550, ;
HEIGHT = 27, ;
WIDTH = 84, ;
FONTBOLD = .T. ,;
FORECOLOR = RGB(255,0,0), ;
CAPTION ='Exit' ,;
NAME = "cmdExit"
ADD OBJECT cmdList AS COMMANDBUTTON WITH ;
TOP = 420, ;
LEFT = 450, ;
HEIGHT = 27, ;
WIDTH = 84, ;
FONTBOLD = .T. ,;
FORECOLOR = RGB(255,0,0), ;
CAPTION ='List' ,;
NAME = "cmdList"
ADD OBJECT helplable AS LABEL WITH ;
TOP = 410, ;
LEFT = 10, ;
HEIGHT = 27, ;
WIDTH = 400, ;
CAPTION = 'Click fullpath to select,Memo to view contents and P/O to Play/Open' ,;
BACKCOLOR = RGB(192,192,192) , ;
FORECOLOR = RGB(255,0,0), ;
FONTBOLD = .T., ;
NAME = "helplable "
ADD OBJECT grid1 AS GRID WITH ;
HEIGHT = 400, ;
LEFT = 4, ;
TOP = 4, ;
WIDTH = 650, ;
READONLY=.F., ;
ROWHEIGHT = 20,;
DELETEMARK = .F. ,;
RECORDSOURCE = "" , ;
COLUMNCOUNT = -1,;
CAPTION = 'Select Replacement' ,;
ROWHEIGHT = 22 ,;
NAME = "Grid1"
PROCEDURE INIT && form init - this is first after form opened
logging('gsbrowse_replacement - init')
ENDPROC
PROCEDURE grid1.INIT
THIS.RECORDSOURCE = "mycursor"
WITH THIS.Column1
.Header1.CAPTION = 'Fullpath'
.CONTROLSOURCE = 'mycursor.FULL_PATH'
.ADDOBJECT("mycmd","make_repl") && fname2
.WIDTH = 450
.MOVABLE = .F.
.READONLY = .T.
.FONTBOLD = .T.
.CURRENTCONTROL = "mycmd"
.VISIBLE = .T.
ENDWITH
THISFORM.grid1.ADDOBJECT('Column2','Column')
WITH THIS.Column2
.Header1.CAPTION = 'P/O'
.CONTROLSOURCE = 'mycursor.PLAY'
.ADDOBJECT("mycmd","play_repl") && fname2
.WIDTH = 40
.MOVABLE = .F.
.READONLY = .T.
.FONTBOLD = .T.
.ForeColor = Rgb(0,0,255)
.BackColor= Rgb(255,255,255)
.CURRENTCONTROL = "mycmd"
.VISIBLE = .T.
ENDWITH
THISFORM.grid1.ADDOBJECT('Column3','Column')
WITH THIS.Column3
.CONTROLSOURCE = 'mycursor.FILESIZE'
.Header1.CAPTION = 'FSIZE'
.VISIBLE = .T.
.WIDTH = 70
.MOVABLE = .F.
.READONLY = .T.
.FONTBOLD = .T.
ENDWITH
ENDPROC
PROCEDURE cmdExit.CLICK && <<<<<<<<<<<<<<<<<<<<<<<<< EXIT <<<<<<<<<<<<<<<<<<<<<<<<<<<
THISFORM.RELEASE
THISFORM.DESTROY
ENDPROC
PROCEDURE cmdList.CLICK && <<<<<<<<<<<<<<<<<<<<<<<<< LIST<<<<<<<<<<<<<<<<<<<<<<<<<<<
ENDPROC
*!* ****************************************************************
ENDDEFINE
DEFINE CLASS play_repl AS TEXTBOX
READONLY =.F.
PROCEDURE CLICK
myfile = mycursor.full_path
SET DEFAULT TO (mysystempath)
cAction = "open"
ShellExecute(0,cAction,myfile ,"","",1)
*!* DO gsbrowse_all
ENDPROC
ENDDEFINE
DEFINE CLASS make_repl AS TEXTBOX && this is the image selection
READONLY =.F.
PROCEDURE CLICK
SET DEFAULT TO (mysystempath)
cMessageText = 'Are you sure you want to replace the exhibit?'
nAnswer = MyMsgBox(cMessageText, cMessageButtons1,cMsgTitle)
IF nAnswer = 1
SELECT EDITING_
logging(ALIAS())
newexh = mycursor.full_path
IF !EMPTY(newpic)
REPLACE FNAME2 WITH JUSTFNAME(newexh )
REPLACE NEWPATH WITH JUSTPATH(newexh )
REPLACE up_dated WITH .T.
isupdated = .T.
ENDIF
ENDIF
SELECT EDITING_
USE
USE IN SELECT("MyCursor")
THISFORM.RELEASE
THISFORM.DESTROY
myForm2.RELEASE()
myForm2 = .NULL.
oForm.RELEASE()
oForm = .NULL.
ENDPROC
ENDDEFINE