Drop EVERYTHING into your Xbase++ application

This forum is for eXpress++ general support.
Post Reply
Message
Author
skiman
Posts: 957
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Drop EVERYTHING into your Xbase++ application

#1 Post by skiman »

Hi,

Some time ago I was looking to drop an email attachment into my application. There was no solution found at that moment.

Now I have a solution where I can drop everything into my application. It is a very simple way by using dchtmlviewer. This way Windows will do all the hard work for you.

When you open the viewer and you navigate to a folder, Windows explorer is opened in the viewer with the folder already open. Now you can drop everything into this viewer. A file, an attachment of a mail, a complete mail, ... Since you have navigated to a folder of your choice, you have the possibility to 'scan' that folder, and get all the files from it.

Code: Select all

cFolder := "c:\yourfolder"
@ x,x DCHTMLVIEWER oDrop SIZE x,x, NAVIGATE cFolder 
This will give you a zone to drop all the files you want. And then you can process the files from your folder.

This is how I implemented it in my application. A user can see the list, can drop new files in it, and can also open files to process.

Image
Attachments
drophtmlviewer.JPG
drophtmlviewer.JPG (233.4 KiB) Viewed 1357 times
Best regards,

Chris.
www.aboservice.be

richardc
Posts: 18
Joined: Sat May 11, 2013 3:46 pm

Re: Drop EVERYTHING into your Xbase++ application

#2 Post by richardc »

This is a great solution. Thanks for posting it.

Richard

Wolfgang Ciriack
Posts: 424
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Re: Drop EVERYTHING into your Xbase++ application

#3 Post by Wolfgang Ciriack »

Very nice !
Is there a possibility to show the content of the file in an extra frame, when selecting an file ?
_______________________
Best Regards
Wolfgang

skiman
Posts: 957
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Drop EVERYTHING into your Xbase++ application

#4 Post by skiman »

Wolfgang Ciriack wrote: Mon Oct 04, 2021 1:13 pm Is there a possibility to show the content of the file in an extra frame, when selecting an file ?
Since the list is using Explorer, selecting a file in it will open it with the default application according to the extention.

I'm doing it the following way:
- A button with an ondrop action.
- I can drag and drop a file from the list to that button.
- The action of the button navigates my htmlviewer to that file. The dchtmlviewer shows me the document in the same frame as the list
- I also have a button to return to the list in that frame.
- If the file can't be opened by the htmlviewer (example XLS) it will open Excel to show it.

Of course, you could have two frames on the screen.
Best regards,

Chris.
www.aboservice.be

skiman
Posts: 957
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Drop EVERYTHING into your Xbase++ application

#5 Post by skiman »

Hi,

Meanwhile I created a button in my main menu as a dropzone. You can drop any file into the rectangle of the button..

I changed the handler of the main menu, so I can detect when someone has dropped a file onto it. Then a popup appears to ask what you want to do with the file. In my application files can be attached to customers, suppliers, documents, products, ...

- The button is a dcpushbuttonxp with the STATIC clause. This way it has the same look as my other buttons.
- The black rectangle you see is a dcstatic.
- The inside of the black rectangle is my dchtmlviewer
- The dchtmlviewer is navigated to a specific folder.

I added this to my handler:

Code: Select all

IF Valtype(oXbp) = 'O' .and. oXbp:ClassName() = "DC_XbpHTMLViewer" 
	oThread:=Thread():new()
	oThread:start({||searchdropfile() ,dc_clearevents()})
endif
As soon as a file is dropped onto the dchtmlviewer, the function searchdropfile is called. It is called multiple times, but that's not a problem to solve. The searchdropfile does the processing of the file according to the user input, and then moves the file away.

Now I can drop an attachment as an invoice from my mail to my application. The searchdropfile dialog appears and I select the button 'incoming invoice'. So the invoice is saved in the correct folder, which will be processed by the accountant.
Attachments
dropbutton.JPG
dropbutton.JPG (68.27 KiB) Viewed 1272 times
Best regards,

Chris.
www.aboservice.be

Wolfgang Ciriack
Posts: 424
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Re: Drop EVERYTHING into your Xbase++ application

#6 Post by Wolfgang Ciriack »

It is a pity, that i can not see your jpg attachments. Can you send them to me as private post or as mail.
I like to see other solutions... :D
_______________________
Best Regards
Wolfgang

Post Reply