FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour a Question
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM

a Question

Posted: Sat Jan 11, 2014 05:34 PM
I need to create a procedure to save attachs for customers
samples : pdf, doc, jpg files and show them into a dialog or window

the final user wish a ... on visual mode ( drag and drop of files ..) .

as this
please see on botton part there are file and if the user select one can see it on top bottom




how I can make to create it ?

I made a initial test using the Otto's class xTRich()

Code (fw): Select all Collapse
#include "FiveWin.ch"
#include "constant.ch"

 #define LIGHTCYAN        nRGB( 203, 225, 252 )


STATIC oSay[6]
STATIC cNameImage,dDateModImage,nSizeImage
STATIC oRich

Function ut_allegati(cKdnr)
   Local  oDlg
   Local  oBar
   Local  nBottom   := 35
   Local  nRight    := 110
   Local  nWidth :=  Max( nRight * DLG_CHARPIX_W, 180 )
   Local  nHeight := nBottom * DLG_CHARPIX_H
   Local  oFontDlg
   Local hRichDLL  := LoadLibrary( "riched20.dll" )

   DEFINE FONT oFontDlg NAME "Tahoma"       SIZE 0, -12
   DEFINE DIALOG oDlg  SIZE nWidth, nHeight   FONT oFontDlg ;
                      STYLE nOr( WS_OVERLAPPEDWINDOW ) ;
                      TITLE "Allegati"


  oRich =      xTRich(): New(13, 0, { || "" }, oDlg, , ,,, .f.)

   oRich:cKdNr := cKdNr
   oRich:bMButtonDown  := {|nRow, nCol, nFlags| oRich:end(),oDlg:hide(),oDlg:show(), oDlg:end()}


    @ 120,2 SAY oSay[1] PROMPT "Nome file       :"  of oDlg SIZE 50,10
    @ 130,2 SAY oSay[2] PROMPT "Dimensioni      :"  of oDlg SIZE 50,10
    @ 160,2 SAY oSay[3] PROMPT "Ultima modifica :"  of oDlg SIZE 50,10

    @ 120,10 SAY oSay[4] PROMPT  cNameImage          of oDlg SIZE 200,10  UPDATE
    @ 130,10 SAY oSay[5] PROMPT  nSizeImage          of oDlg SIZE 50,10  UPDATE
    @ 160,10 SAY oSay[6] PROMPT  dDateModImage       of oDlg SIZE 50,10  UPDATE

 oDlg:bResized := {||Rinfresca_oFrm(nHeight,nWidth,oDlg) }

ACTIVATE DIALOG oDlg CENTERED
FreeLibrary( hRichDLL )
return nil

Function Rinfresca_oFrm(nHeight,nWidth,oDlg)

    oRich:ntop :=oDlg:nHeight-180
   oRich:nwidth :=oDlg:nwidth-20
   oRich:nHeight :=oRich:ntop-60

     oRich:refresh()
     return nil




But when I drag a file I cannot see the exactly file
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com

Continue the discussion