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.

Dark GDK / The windows GetFileSelector() working...

Author
Message
WLGfx
17
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 5th Mar 2011 04:14 Edited at: 5th Mar 2011 04:17
Had to post this for those that need to use a file selector in their own code:



I ripped it apart from someone else code from another forum to get it working...

Warning! May contain Nuts!
WLGfx
17
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 6th Mar 2011 23:46
I've wrapped it up in a class very quickly and probably needs some tweaking but it works great.

Main: (shows how simple it is to use)



WL_FSel.h: (to include in your code)


WL_FSel.cpp: (compiled to create the object)


More snippets to come to help anyone out...

Warning! May contain Nuts!
Cetobasilius
14
Years of Service
User Offline
Joined: 29th Dec 2009
Location: Mexico
Posted: 7th Mar 2011 13:30 Edited at: 7th Mar 2011 13:41
this is really usefull and for those who are afraid of objects and want a simpler way:



you just call the function like any other


this method does not use a namespace, it can be polished a lot more though.

hi
WLGfx
17
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 7th Mar 2011 16:39 Edited at: 7th Mar 2011 16:41
My initial thought was to wrap it in a class so you can assign multiple file selectors and each can store its own info such as the directory it was last in. Useful for picking textures from one drive, saving the main file to another drive.

At the moment I've not polished anything with it yet. It works so I don't want to break it.

I'll be keeping both of them though because the function and the class are both useful.

Warning! May contain Nuts!
Cetobasilius
14
Years of Service
User Offline
Joined: 29th Dec 2009
Location: Mexico
Posted: 7th Mar 2011 17:45
yes lol great contribution i will need it sometime in the future.

hi

Login to post a reply

Server time is: 2024-11-19 12:17:12
Your offset time is: 2024-11-19 12:17:12