Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit/AppGameKit Studio Showcase / [Plugin] FileExplore (File, Folder and System-Drives Handling)

Author
Message
MadBit
Valued Member
10
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 23rd Apr 2017 00:02 Edited at: 10th Jul 2019 07:09
Hello,
Here is a new plugin for you. Lately, the insufficient support for desktop file browsing was a few times a topic here in the forum.
Now I offer you a plugin, that treats exactly this problem. I hope you can use it.

Plugin: FileExplore

Here is the command list:


The commands starting with 'GetCurrentFile ...'. Refer to the file obtained with GetFirstFile and GetNextFile.

[UPDATE:27-04-2017]
New Function ChooseFileDialog
New Function SaveAsDialog
New Function MessageBox

Function in detail:


[UPDATE:06-05-2017]
New Function - String GetCL()

[UPDATE:16-10-2018]
Added 64Bit DLL

[UPDATE:02-03-2019]
Added New Function - Void SetDialogPosition(Integer PosX, Integer PosY) -> Set the Position for ChooseFileDialog and SaveAsDialog
Added New Function - Void SetInitialDir(String Directory) -> Set the Initial Directory for ChooseFileDialog and SaveAsDialog

[UPDATE:07-04-2019]
Added New Function - Void SetWindowStyle(Integer Style) -> Set the Style of AppGameKit output window -> StyleFlags
Added New Function - Void SetWindowExStyle(Integer ExStyle) -> Set the ExStyle of AppGameKit output window -> ExStyleFlags

[UPDATE:03-07-2019]
Added New Function - Void OpenDateTimePicker() -> Open a modal DateTimePicker dialog
Added New Function - Integer GetDateYear() -> returns the selected year.
Added New Function - Integer GetDateMonth() -> returns the selected month.
Added New Function - Integer GetDateDay() -> returns the selected day.
Added New Function - Integer GetDateDayOfWeek() -> returns the selected day of week. 0 = Sunday, 1 = Monday ...
Added New Function - Integer GetDateHour() -> returns the selected hour.
Added New Function - Integer GetDateMinute() -> returns the selected minute.
Added New Function - Integer GetDateSecond() -> returns the selected second.
Added New Function - String GetDateString(String format) -> returns the selected date as a formated string

Added New Function - String GetTimeString(String format) -> returns the selected time as a formated string


[UPDATE:06-07-2019]
Change OpenDateTimePicker - returns now 0 - clicking on cancel, 1- clicking on ok.

And some code snippets.
System-Drive-Enumeration:


Folder Enumeration:


File Enumeration:


Please tell me if you find bugs or have some suggestions.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)

Attachments

Login to view attachments
nz0
AGK Developer
12
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 23rd Apr 2017 00:55
Nice work. We should really have a sticky for plugins.

BatVink
Moderator
16
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 23rd Apr 2017 10:29
Good work, and thank you sir!
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
blink0k
AGK Developer
Gold Codemaster
6
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 24th Apr 2017 01:25
Would it be possible to add the openfile dialog to this .dll?
Stab in the Dark software
Valued Member
16
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 24th Apr 2017 14:03 Edited at: 24th Apr 2017 14:03
Quote: "Would it be possible to add the openfile dialog to this .dll?"


AGK has a open file dialog. It needs a save file dialog.
The coffee is lovely dark and deep,and I have code to write before I sleep.
BatVink
Moderator
16
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 24th Apr 2017 18:09
The AppGameKit OpenFile dialog doesn't return the full path of the file. It would be really good to add it, because it would save the effort of having to hand-craft a solution.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
MadBit
Valued Member
10
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 25th Apr 2017 15:44
So after some problems I have now managed to create a file dialog.
Any other suggestion?

To be added.
ChooseFileDialog
SaveAsDialog

Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Pixie-Particle-Engine
blink0k
AGK Developer
Gold Codemaster
6
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 25th Apr 2017 22:28
Message dialog would be cool too
BatVink
Moderator
16
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 26th Apr 2017 08:34
Quote: "Message dialog would be cool too"


Message() already exists
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
blink0k
AGK Developer
Gold Codemaster
6
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 26th Apr 2017 10:06
Damn. Forgot about that!
Jack
15
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 27th Apr 2017 21:19 Edited at: 27th Apr 2017 21:21
Good work!
+1 for good and easy mass selection

[/url]
MadBit
Valued Member
10
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 27th Apr 2017 22:21 Edited at: 27th Apr 2017 22:25
Thanks Jack and all others.

So, as far as no further requests are available. Here are 3 additional functions. ChooseFileDialog, SaveAsDialog and MessageBox. The MesaageBox offers more flexibility than that of AGK.

Here the NEW Functions in detail.


Download see the first post
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Pixie-Particle-Engine
blink0k
AGK Developer
Gold Codemaster
6
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 2nd May 2017 23:41
Super duper want: Get command line arguments
MadBit
Valued Member
10
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 6th May 2017 02:37
blink0k wrote: "Super duper want: Get command line arguments"


Added
GetCL()

The strange thing about this is that Paul has already implemented this function but it does not work.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Pixie-Particle-Engine
blink0k
AGK Developer
Gold Codemaster
6
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 7th May 2017 00:16
Superb! Thanks!
blink0k
AGK Developer
Gold Codemaster
6
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 7th May 2017 08:45 Edited at: 7th May 2017 08:46
One last request;
Functions to access the copy/paste buffer
Functions to allow access to the right-click menu for file explorer
JohnnyMeek
6
Years of Service
User Offline
Joined: 23rd Apr 2013
Location: Slovenia
Posted: 7th May 2017 16:21
Mac version would be great to have......
MadBit
Valued Member
10
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 16th Oct 2018 13:47
Hi,

I've updated this plugin for support 64bit-Windows.
You find the download at the first post.

Thanks for your attention.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Cliff Mellangard 3DEGS
Developer
13
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 17th Oct 2018 17:14
MadBit
Valued Member
10
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 2nd Mar 2019 19:55
The first post has a updates with a new version.
Contains two new Commands.

[UPDATE:02-03-2019]
Added New Function - Void SetDialogPosition(Integer PosX, Integer PosY) -> Set the Position for ChooseFileDialog and SaveAsDialog
Added New Function - Void SetInitialDir(String Directory) -> Set the Initial Directory for ChooseFileDialog and SaveAsDialog
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
blink0k
AGK Developer
Gold Codemaster
6
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 2nd Mar 2019 22:47
Thanks MadBit. My favorite plugin!
Ortu
DBPro Master
11
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 3rd Mar 2019 00:31
Nice work MadBit
http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
MadBit
Valued Member
10
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 3rd Mar 2019 06:34
Thankyou!
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Scraggle
Moderator
16
Years of Service
Recently Online
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 1st Apr 2019 16:54
I'd really like to use this plugin but I can't get it working.
I haven't used any plugins before so maybe the problem is at my end but I'd appreciate any help.
Here's what I have done:

Downloaded the plugin and extracted it to e:\AGK\Plugins\
Set my preferences for plugins to point to that folder.
Added the line#import_plugin FileExplore to my code


When I compile I get the error:
Quote: "error: Failed to open file for reading /Plugins/FileExplore/Commands.txt"


I read somewhere that you need to add the plugin to your projects folder, so I did that next. I created a Plugins folder in my project folder and copied all of the FileExplore folder into it.
But when I compile now, I get the following error and the FileExplorer folder is deleted from {project}/Plugins/


What am I doing wrong?

Attachments

Login to view attachments
MadBit
Valued Member
10
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 1st Apr 2019 19:47 Edited at: 1st Apr 2019 19:49
Where you want to specify your plugin path. This is the plugin path of geany and has nothing to do with AGK.
If you want to use a plugin from AppGameKit, you have to copy the directory into the plugin folder of AppGameKit as shown in the picture.
Compiling your project will automatically copy all used plugins to your project directory.



And thank you for using this Plugin.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)

Attachments

Login to view attachments
Scraggle
Moderator
16
Years of Service
Recently Online
Joined: 10th Jul 2003
Location: Yorkshire
blink0k
AGK Developer
Gold Codemaster
6
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 4th Apr 2019 07:35 Edited at: 4th Apr 2019 07:35
Hey Mr Bit!
Would it be possible to have a function that removes the windows border for the AppGameKit App that calls your DLL?
Thanks for your awesome .DLL!
MadBit
Valued Member
10
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 7th Apr 2019 07:32
Okay, new version in the first post.
Two new commands SetWindowStyle and SetWindowStyleEx. This allows you to define your own style for the AppGameKit window. Use the flags required by Microsoft you can find here.

StyleFlags
ExStyleFlags

You may have to link them with '||'. Make sure that you set the flags for visibility (WS_VISIBLE).

@blink0k
The following line is recommended for your borderless window.


Think about it, the resolution and aspect ratio change. Since the space needed for the frame is now available for drawing.

I hope it works without a problem.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
blink0k
AGK Developer
Gold Codemaster
6
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 7th Apr 2019 21:27
Superb! Thanks heaps!
Rich Dersheimer
AGK Developer
10
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 14th Jun 2019 03:30
I would love to see a windows date/time picker added, if you are still working on this.

Rich
MadBit
Valued Member
10
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 14th Jun 2019 06:26
I'll see what I can do for you.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
MadBit
Valued Member
10
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 3rd Jul 2019 07:17
Okay. Wasn't as easy as I thought. There is no standard dialog for selecting the date.
After all, I had to create my own. My knowledge with the windows controls and dialog boxes is a bit rusty.
Now I did it.

With
Void SetDialogPosition(Integer PosX, Integer PosY)
you define the position of the dialog box.

Void OpenDateTimePicker() opens a modal DateTimePicker dialog.

After selecting the date and time, you can use the commands

Integer GetDateYear()
Integer GetDateMonth()
Integer GetDateDay()
Integer GetDateDayOfWeek() <-- 0=Sunday, 1=Monday, ...
Integer GetDateHour()
Integer GetDateMinute()
Integer GetDateSecond()


query your input.

And with
String GetDateString(String format)
String FetTimeSTring(String format)


you will finally get your date or time back as a formatted string.

Download as usual in the first post.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Resourceful
5
Years of Service
User Offline
Joined: 29th Jan 2014
Location: every ware
Posted: 5th Jul 2019 18:26
@MadBit

I'm glad you created this

but since I am a bit slow out of the gate
it would be nice to have a complete example to work from

thanks
MadBit
Valued Member
10
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 6th Jul 2019 07:35
Thank you for your interest in this plugin.

A small change to the plugin. OpenDateTimePicker now returns 0 - when clicking cancel in dialog or 1 - when clicking ok.

Please download it again from the first post.

Here is a short example:

Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Rich Dersheimer
AGK Developer
10
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 8th Jul 2019 22:00 Edited at: 8th Jul 2019 22:10
Uh oh. When I try to use the plugin I get something unexpected. The message box function works, so I believe I have everything set up correctly.



That is what I see when I call the date/time picker function.

Attachments

Login to view attachments
MadBit
Valued Member
10
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 9th Jul 2019 06:09
Can you give me some code to show me the problem?
The previously shown code works fine for me. Here again the whole code.


Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Rich Dersheimer
AGK Developer
10
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 9th Jul 2019 15:18
I'm using the exact code from your post right above this. Same problem, so perhaps I don't have my plugins set up correctly.

I have your FileExplore folder in my project Plugins folder.

I've also put it in my AGK2 compiler Plugins folder.

And I've also put it in the main project folder for my FileExplore test project. Still getting the small window with the FFF's.

I put this line in the code...

M = fe.MessageBox("FE Test","FE Test Title")

and it works fine.

I'm perplexed.
MadBit
Valued Member
10
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 9th Jul 2019 21:46
Hmm, you just need to copy the plugin in the compiler path the compiler will automatically copy it into your project path.

When you create a new project and copy the above code into it. Do you get the same error then?

Which Windows version do you use?
32 or 64 bit?
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Rich Dersheimer
AGK Developer
10
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 10th Jul 2019 04:18
Yes, brand new project, named "FileExplore", the folder in the zip file in my compiler>plugins folder. Windows 7, 64 bit. Still getting the problem. I even just re-installed the latest version of AGK2, still no joy.

I am sad.
fubarpk
Moderator
14
Years of Service
Recently Online
Joined: 11th Jan 2005
Location: Adelaide
Posted: 10th Jul 2019 06:08
I think the problem lies with it not being in the compiler path properly and should be deleted from everywhere else and try again

fubarpk
fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
MadBit
Valued Member
10
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 10th Jul 2019 07:21 Edited at: 10th Jul 2019 07:22
Yeah, you can try again, like Fubarpk said.

Nevertheless I find it very strange.
I test / program on almost the same platform (win7 64 bit) and have no problems.

I remembered that I ignored a compiler warning before (bad habit). I have now fixed it. When calling the OpenDateTimePicker function, you can now also specify a title for the dialog box.

So download it again and test it. Since it works with me, it is rather a shot in the dark.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
blink0k
AGK Developer
Gold Codemaster
6
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 11th Jul 2019 01:20
Could it be that it is being tested in AppGameKit Studio?
MadBit
Valued Member
10
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 11th Jul 2019 06:58
Hmm, that could be, too. But I assume that classic and studio have the same code base and only differ in the IDE and the renderer.

I know you also use this plugin and have AGKS. Do you have similar problems with it?

I just tested it on my laptop with Win10 64bit - everything works.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
blink0k
AGK Developer
Gold Codemaster
6
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 11th Jul 2019 07:32
I haven't tried it but Studio has no install app yet. you just copy it to a directory
I'll have a look later and report back
blink0k
AGK Developer
Gold Codemaster
6
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 11th Jul 2019 23:34 Edited at: 12th Jul 2019 03:12
EDIT EDIT EDIT: I created a Plugins folder in the AgkStudio folder and copied FileExplore there and it worked

This has been reported in the AGKS GitHub, maybe need to wait for official release, or bug fix

EDIT: Compiling with Studio i get other errors but re the plugin i get this compile error;

Error: Failed to open file for reading /Plugins/FileExplore/Commands.txt
main.agc:1:Error: Failed to load plugin command list from /Plugins/FileExplore/Commands.txt for plugin FileExplore

EDIT: My bad. When I copy it to C:\Program Files (x86)\The Game Creators\AGK2\Tier 1\Compiler\Plugins. It works fine.

I have tried this with AppGameKit Classic 2019-06-11 (Not AppGameKit Studio)
I can confirm that upon executing the app it deleted the contents of the Plugins folder
I have attached the project

Attachments

Login to view attachments
Rich Dersheimer
AGK Developer
10
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 12th Jul 2019 14:18
This is all sorted - I just had to check the "Windows 64-bit" checkbox in the build preferences.

Sorry about all the fuss, but thank you so much for adding the date/time picker!

Rich
Rick Nasher
2
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 12th Jul 2019 18:03
Awsome stuff MadBit!
MadBit
Valued Member
10
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 13th Jul 2019 06:12
Thank you, guys.
Always at your service.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)

Login to post a reply

Server time is: 2019-10-14 13:45:33
Your offset time is: 2019-10-14 13:45:33