Ooops
September 29, 2020, 01:38:20 PM

Author Topic: is there a graphical file requester  (Read 258 times)

Offline wadmixfm

  • Jr. Member
  • **
  • Posts: 64
is there a graphical file requester
« on: September 02, 2020, 09:02:43 PM »
in blitzmax ng 64 is there a graphical version of a file requester about

one that can define the folder and then look for a certain extension

cheers

Offline Derron

  • Hero Member
  • *****
  • Posts: 3185
Re: is there a graphical file requester
« Reply #1 on: September 02, 2020, 10:17:00 PM »
If you use a GUI (like MaxGUI) then it should be graphical. Without it, the app does not know "how" you want to display it - and will do via console/terminal.


bye
Ron

Offline wadmixfm

  • Jr. Member
  • **
  • Posts: 64
Re: is there a graphical file requester
« Reply #2 on: September 02, 2020, 10:19:05 PM »
cheers ron

are there any examples for this kind of thing ??


Offline Kryzon

  • Full Member
  • ***
  • Posts: 230
Re: is there a graphical file requester
« Reply #3 on: September 03, 2020, 08:47:47 AM »
The BRL.system.mod module on BlitzMax has the global RequestDir() and RequestFile() functions that call the native file selector dialog.
https://en.wikibooks.org/wiki/BlitzMax/Modules/System/System#RequestFile

If you're using the SDL backed instead of BRL, then RequestDir and RequestFile are not implemented yet. It's still to-do because the SDL libraries don't have such a thing ready, it needs to be coded manually like RequestDir or RequestFile were. That said, you can just copy the includes and functions from the .C file and the BMX definitions from BRL.systemdefault anyway and use those in your programs along with SDL.

Offline Derron

  • Hero Member
  • *****
  • Posts: 3185
Re: is there a graphical file requester
« Reply #4 on: September 03, 2020, 11:58:46 AM »
This only works on Windows and (untested) MacOS.


This is the linux part of requestfile etc:
Code: BlitzMax
  1.         Method RequestFile$( Text$,exts$,save:Int,file$ ) Override
  2.                 WriteStdout "Enter a filename:"
  3.                 Return ReadStdin()
  4.         End Method
  5.        
  6.         Method RequestDir$( Text$,path$ ) Override
  7.                 WriteStdout "Enter a directory name:"
  8.                 Return ReadStdin()
  9.         End Method
  10.  

bye
Ron

Offline TomToad

  • Hero Member
  • *****
  • Posts: 513
Re: is there a graphical file requester
« Reply #5 on: September 03, 2020, 05:40:14 PM »
Problem with RequestFile() is that it doesn't always work with full screen graphics.

There is ifsoGUI which is a graphics GUI instead of a system GUI, which means it will look the same on all systems, and also will work full screen.
------------------------------------------------
8 rabbits equals 1 rabbyte.

Offline wadmixfm

  • Jr. Member
  • **
  • Posts: 64
Re: is there a graphical file requester
« Reply #6 on: September 05, 2020, 12:12:24 PM »
does this mod have to be put in one of the original mod folders like pub.mod or brl.mod for example

so it can be compiled ??

Lee

Offline wadmixfm

  • Jr. Member
  • **
  • Posts: 64
Re: is there a graphical file requester
« Reply #7 on: September 05, 2020, 01:15:52 PM »
hmmmmm i cant get that to work under 156 ng on mac or windows

never mind i will create my own file reader

Offline statto

  • Jr. Member
  • **
  • Posts: 21
Re: is there a graphical file requester
« Reply #8 on: September 23, 2020, 08:57:02 PM »
does this mod have to be put in one of the original mod folders like pub.mod or brl.mod for example

so it can be compiled ??

Lee

Yes, you put it in your mod folder under ifsogui.mod and then rebuild it.

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal