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
VIP Member
Gold Codemaster
15
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 20th Oct 2019 05:40
Sorry, I was in a hurry. The link should work again now.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Qugurun
Valued Member
9
Years of Service
User Offline
Joined: 8th Dec 2014
Playing: AppGameKit
Posted: 23rd Oct 2019 00:01 Edited at: 23rd Oct 2019 00:14
Greetings. Thanks for the plugin. I would like to see the GetWindowPosX, GetWindowPosY function and maybe GetGlobalCrursorX, GetGlobalCrursorY.

For implement moving the window to any place.
https://www.instagram.com/qugurun/
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 23rd Oct 2019 01:28
+1 on that one
MadBit
VIP Member
Gold Codemaster
15
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 23rd Oct 2019 19:48
Qugurun wrote: "For implement moving the window to any place."


Is that really necessary?

Test this code.


Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 23rd Oct 2019 23:11 Edited at: 23rd Oct 2019 23:15
Haha. Very cool
Thanks

ps: If i click and drag the title bar it snaps back to it's original position
Qugurun
Valued Member
9
Years of Service
User Offline
Joined: 8th Dec 2014
Playing: AppGameKit
Posted: 24th Oct 2019 00:20 Edited at: 24th Oct 2019 00:24
I feel awkward now. I forgot about GetMaxDeviceWidth (). Thanks a lot, this works great!

blink0k
This is to make a window without a title and drag it by its title. For example, as in Photoshop.
https://www.instagram.com/qugurun/

Attachments

Login to view attachments
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 24th Oct 2019 23:03
Quote: "This is to make a window without a title and drag it by its title. For example, as in Photoshop"

You wouldn't be trying to make separate drag able windows would you?
marvin944
11
Years of Service
User Offline
Joined: 27th Aug 2013
Location:
Posted: 4th Nov 2019 14:05
Any idea why thi is not working?

FileExplorer.SetWindowStyle(0x10000000 || 0x01000000 || 0x80000000) // (WS_VISIBLE | WS_CLIPSIBLINGS | WS_POPUP)

Using Studio and running it from here. Other examples work.
Dutch
marvin944
11
Years of Service
User Offline
Joined: 27th Aug 2013
Location:
Posted: 4th Nov 2019 14:42 Edited at: 4th Nov 2019 14:43
Are there any alternatives to getting rid of the title bar? I know some Windows API calls...
Dutch
Qugurun
Valued Member
9
Years of Service
User Offline
Joined: 8th Dec 2014
Playing: AppGameKit
Posted: 4th Nov 2019 18:28
It works for me.

https://www.instagram.com/qugurun/

Attachments

Login to view attachments
marvin944
11
Years of Service
User Offline
Joined: 27th Aug 2013
Location:
Posted: 11th Nov 2019 21:58
It doesn't for me in AppGameKit Studio.

Other question: is there a command to get files based on joker search? E.g. Name*.png
Dutch
MadBit
VIP Member
Gold Codemaster
15
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 13th Nov 2019 12:27
marvin944 wrote: "Other question: is there a command to get files based on joker search? E.g. Name*.png"


In the first post is an example of file enumeration. Do you mean that?

Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
marvin944
11
Years of Service
User Offline
Joined: 27th Aug 2013
Location:
Posted: 13th Nov 2019 21:19
Yes, exactly, thanks!
Dutch
MadBit
VIP Member
Gold Codemaster
15
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 17th Nov 2019 00:04
I have implemented a new function. At the request of marvin944. I think it is a useful function.

SetWindowPosition(posx, posy, zorder, width, height, flags)

I wrapped the Windows function SetWindowPos. [href=https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowpos]For more information about the flags and the possibilities of zorder (hWndInsertAfter) see the MS website.
[/href]
Here in the example you can see the movable window without title bar and set to Topmost.



I've changed the toolset from 140 (15) to 141 (17) so i hope there are no new problems to use this plugin. And I can't test it with AgkStudio, because I don't have this.
Download see below at the bottom of this post.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)

Attachments

Login to view attachments
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 27th Nov 2019 05:18
First of all let me say this is THE most awesome plugin i have used. Thanks heap matey.
Would it be possible to add a BrowseFolderDialog
If you're too busy or it's too much of a pain then no worries, i could get but with the choose file dialog.
Thanks again matey
Qugurun
Valued Member
9
Years of Service
User Offline
Joined: 8th Dec 2014
Playing: AppGameKit
Posted: 27th Nov 2019 10:42 Edited at: 27th Nov 2019 10:42
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 27th Nov 2019 19:41
Thanks matey. Awesome work
MadBit
VIP Member
Gold Codemaster
15
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 28th Nov 2019 11:25 Edited at: 28th Nov 2019 11:27
Sorry for the late response.
Quote: "First of all let me say this is THE most awesome plugin i have used. Thanks heap matey."

Thank you.

Before I extend this library with the requested function, I want to update AgkSharp first.

I think this weekend.

EDIT:
@Qugurun: good work.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 28th Nov 2019 21:39
Awesome! Thanks
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 30th Nov 2019 20:47 Edited at: 30th Nov 2019 20:55
not sure what i'm doing wrong with my load file dialogue routine:

i define a couple of paths early on:


courses\ currently contains 2 folders: "default" and "test"

then, within the load function itself:

instead of delivering me to courses\, as expected, it dives into courses\default


any thoughts appreciated.

note: the syntax advice shows:
String ChooseFileDialog(String Title, String Filter, Integer MultiSelect)
If you enable multi select, and select multiple files. This returns a string containing the selected directory and then all files in it. All are separated by the pipe ('|').

i'm guessing that the MultiSelect parameter is either 0 or 1?

Attachments

Login to view attachments
MadBit
VIP Member
Gold Codemaster
15
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 30th Nov 2019 22:09 Edited at: 30th Nov 2019 22:11
Instead of SetWorkingDirectory better use SetInitialDir.

Quote: "i'm guessing that the MultiSelect parameter is either 0 or 1?"

Here you are right 0 = only one file can be selected and 1 = you can select multiple files.
Since you cannot pass arrays from a plugin, all selected files are separated with pipes.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 1st Dec 2019 02:08 Edited at: 1st Dec 2019 03:27
Quote: "better use SetInitialDir"

was inconsistent until i set the course directory as such:

CourseDir$ = BaseDir$ + "\courses\" with the backslashes before AND after.

i'm moving forward again; thanks, madbit!


add: still inconsistent. gets/sets the right directory but doesn't find ".hole" files on first attempt. same code as above:


i'm sure i'm missing something; can someone provide full example?

MadBit
VIP Member
Gold Codemaster
15
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 1st Dec 2019 06:20 Edited at: 1st Dec 2019 06:41
You need a string pair seperated by the pipe '|'. Left one is the filter descriptor and the right one the filter mask. Please use in the mask part the joker '*' see below.

Here is my test code for this:
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
MadBit
VIP Member
Gold Codemaster
15
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 1st Dec 2019 06:46 Edited at: 1st Dec 2019 06:48
Ok, version 20191201 is now downloadable in the first post.

[UPDATE:01-12-2019]
Added New Function - Void SetWindowPosition(Integer posX, Integer posY, Integer zOrder, Integer width, Integer height, Integer flags) ->
wraps SetWindowPos function to set the AGK-Window.
posX, posY -> set the position of the AGK-Window
width, height -> set the size of the AGK-Window. Please let it at 0 (zero). I dont know what happens if not. Use instead Agk-Commands.
zOrder, flags -> refer ms documentation of function SetWindowPos for more information. (Parameters hWndInsertAfter and uFlags)

Added New Function - String ChooseFolderDialog(String title, String initialDir) -> A Dialog to select a folder.
Fixed - The ChooseFileDialog filter sometimes has an unusual behavior.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 2nd Dec 2019 07:02
Great job Mr Bit. Awesome work
Softwizz
15
Years of Service
User Offline
Joined: 14th May 2009
Location: U.K.
Posted: 6th Jan 2020 20:15
I just want to thank you for creating this.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 7th Mar 2020 02:59
Question: Seeing as you can access the window handle, what are the chances of implementing controls such as buttons/dialogs/input fields etc?
MadBit
VIP Member
Gold Codemaster
15
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 9th Mar 2020 07:16 Edited at: 9th Mar 2020 07:17
thank you both.

I think theoretically it should be possible. I've left it alone so far, because it's a lot of work to loop through every control element of Windows.

Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 9th Mar 2020 10:33
I imagine it would be.
If there is anything i can do to help just let me know
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 16th Apr 2020 15:27
Hi Madbit,

Any chance of a Get Folder Dialog?

Thanks
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 16th Apr 2020 22:43
It already has the folder dialog ChooseFolderDialog()
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 17th Apr 2020 07:35
So it does!
I didn't have the latest version of the plugin and the command is not in the initial list of included commands.
Go it now though.

Thanks
MadBit
VIP Member
Gold Codemaster
15
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 20th Apr 2020 17:54
I think I need to update the function list in the initial post.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Creative Magic Man
12
Years of Service
User Offline
Joined: 14th Nov 2012
Location: Frinton On Sea, Essex, UK
Posted: 17th Jul 2020 15:49 Edited at: 17th Jul 2020 15:50
The ChooseFileDialog filter parameter doesn't seam to work.

When I put in ".png" ( I have also tried "*.png" and "png" ) for the filter, other extensions show up in the Window.
Amazing creations start with a Fuzzy Vision
Dave - Creator, Developer and Visionary
Fuzzy Visions
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 17th Jul 2020 16:14 Edited at: 17th Jul 2020 16:16
@CMM, you've seen my similar inquiry a few up, and MadBit's response?
Quote: "You need a string pair seperated by the pipe '|'. Left one is the filter descriptor and the right one the filter mask. Please use in the mask part the joker '*' "

does that apply? you haven't shown any code so that's a guess.
[My Itch.io Home]
[CODE lang=AGK] Your Code Here [/CODE]
[VIDEO=youtube] VideoID [/VIDEO]
Creative Magic Man
12
Years of Service
User Offline
Joined: 14th Nov 2012
Location: Frinton On Sea, Essex, UK
Posted: 17th Jul 2020 17:01 Edited at: 17th Jul 2020 17:05
Yes, that works great. Thank's 'Virtual Nomad'

For anyone else, here it is as a more simplified explanation as to what to put in the filter option of the ChooseFileDialog function.

The filter parameter is within quotes.

After the first quote, put in a descriptive text (called filter descriptor ) explaining the filter. You typically see a load of these when you are opening a file ( and click on the 'files of type' arrow) via the file browser.
Here are a few examples . . .
Text Documents
AGK project files
Jpeg files
Portable Network Graphics
etc. etc.

Then type in the pipe symbol ' | ' which is next to the 'Z' key, NOT the '1' key.

Then enter the filter that determines what files are shown in the window.
So for all of the above examples, it would be one of the following . . .
*.txt
*.agk
*.jpg
*.png

Then end with the quotation symbol.

So to list files with just a 'text' extension the filter option would be “Text files |*.txt” and the whole line would look something like . . .
FileName$=FileExplore.ChooseFileDialog(“Title of file browser window goes here","Text Files|*.txt",0)

Hope this helps others.


Many have previously praised 'MadBits' File Browser and I would like to add my thanks as well to 'MadBit' for creating this plug in. TGC should definitely integrate either this Browser or their own in the next update.
Amazing creations start with a Fuzzy Vision
Dave - Creator, Developer and Visionary
Fuzzy Visions
MadBit
VIP Member
Gold Codemaster
15
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 17th Jul 2020 19:23
Thank you for the nice words and for the good and better description of this command.
Writing documentation is not my speciality.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Creative Magic Man
12
Years of Service
User Offline
Joined: 14th Nov 2012
Location: Frinton On Sea, Essex, UK
Posted: 21st Jul 2020 08:50
Graphic files do not display their graphic thumbnails in the window when the appropriate extension ( .png, .jpg, .tiff etc ) is used in the filter.
Amazing creations start with a Fuzzy Vision
Dave - Creator, Developer and Visionary
Fuzzy Visions
MadBit
VIP Member
Gold Codemaster
15
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 21st Jul 2020 18:06
That's strange, it works for me.

how do you call ChooseFileDialog?

It worked for me like this

Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Creative Magic Man
12
Years of Service
User Offline
Joined: 14th Nov 2012
Location: Frinton On Sea, Essex, UK
Posted: 22nd Jul 2020 01:18 Edited at: 22nd Jul 2020 01:20
Yes, my code is pretty much identical.


I will create a few tests in a standalone ( as my project code would be too long on here ) program when I get the time
Amazing creations start with a Fuzzy Vision
Dave - Creator, Developer and Visionary
Fuzzy Visions
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 22nd Jul 2020 01:28 Edited at: 22nd Jul 2020 01:41
Quote: "Graphic files do not display their graphic thumbnails "


(yes, it's just a white "spot" )

oops that was dated usage. changed:

...still does show the same thumbnails (of *.png files (alone)).

*Win8.1
[My Itch.io Home]
[CODE lang=AGK] Your Code Here [/CODE]
[VIDEO=youtube] VideoID [/VIDEO]

Attachments

Login to view attachments
Creative Magic Man
12
Years of Service
User Offline
Joined: 14th Nov 2012
Location: Frinton On Sea, Essex, UK
Posted: 22nd Jul 2020 21:37
Found the problem.

It is not your FileExplorer plugin but a Windows setting. Follow the setting below for anyone with this problem.

* Open up the windows 'File Explorer' App. I am not sure if you can do this with other Explorer apps such as 'Directory opus' etc. so just go with using the Windows one.
* Click on the 'View' tab
* Click on the 'Options' button. NOT the drop down arrow underneath it.
* Click on the 'View tab' of the window that has just opened.
* In the 'Advanced Settings' section, make sure where it says 'always show icons, never thumbnails' is UNTICKED.

Amazing creations start with a Fuzzy Vision
Dave - Creator, Developer and Visionary
Fuzzy Visions
Creative Magic Man
12
Years of Service
User Offline
Joined: 14th Nov 2012
Location: Frinton On Sea, Essex, UK
Posted: 14th Oct 2020 16:47
The SetDialogPosition does not detect which screen ( if you have more than one monitor ) the position comes from.

You can actually move the file Browser window to the left monitor by calculating the position and putting in a minus X value (if the second monitor is on the left).

But it would be easier if it took the positions from the actual window that the program is running in as you have to first detect which monitor the main program is running in etc.
Amazing creations start with a Fuzzy Vision
Dave - Creator, Developer and Visionary
Fuzzy Visions
MadBit
VIP Member
Gold Codemaster
15
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 14th Oct 2020 17:30
Hi,
Would it be okay if SetDialogPosition sets the position relative to the main window?
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Creative Magic Man
12
Years of Service
User Offline
Joined: 14th Nov 2012
Location: Frinton On Sea, Essex, UK
Posted: 14th Oct 2020 17:33
Yes, I think that would work and make it more adaptable for users setups etc.
Amazing creations start with a Fuzzy Vision
Dave - Creator, Developer and Visionary
Fuzzy Visions
MadBit
VIP Member
Gold Codemaster
15
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 14th Oct 2020 17:48
Ok. New Download in the first Post.

Changes:
SetDialogPosition set the position relative to the main window.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Creative Magic Man
12
Years of Service
User Offline
Joined: 14th Nov 2012
Location: Frinton On Sea, Essex, UK
Posted: 14th Oct 2020 20:21
Awsome.

Works perfectly. I can drag my main App window from either monitor and the browser opens in which ever monitor the App is running in.

Thanks again MadBit. Great work
Amazing creations start with a Fuzzy Vision
Dave - Creator, Developer and Visionary
Fuzzy Visions
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 15th Oct 2020 06:10
Someone mentioned that there is no rename file/folder function in AGK.
I thought it might be a good addition to your plugin
MadBit
VIP Member
Gold Codemaster
15
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 18th Oct 2020 07:33
blink0k wrote: "Someone mentioned that there is no rename file/folder function in AGK.
I thought it might be a good addition to your plugin"


This is already included. Use FileMove("old_name", "new_name") and FolderMove("old_name", "new_name")

Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 18th Oct 2020 22:56
Awesome as usual Mr Bit

Login to post a reply

Server time is: 2024-11-23 09:38:54
Your offset time is: 2024-11-23 09:38:54