LB Booster
« little problem with file selection dialog »

Welcome Guest. Please Login or Register.
Apr 1st, 2018, 04:44am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
LB Booster Resources
LB Booster documentation
LB Booster Home Page
LB Booster technical Wiki
Just BASIC forum
BBC BASIC Home Page
Liberty BASIC forum (the original)

« Previous Topic | Next Topic »
Pages: 1 2  Notify Send Topic Print
 veryhotthread  Author  Topic: little problem with file selection dialog  (Read 2177 times)
pierscintilla
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 30
xx Re: little problem with file selection dialog
« Reply #12 on: Mar 25th, 2016, 7:34pm »

Obviously I vote for version 3.0.0 and this is because:

1) being windows that decide which is the starting folder (usually the last used folder), the user will have behavior very "familiar" because it will be the behavior of "his Windows"

2) it is certainly possible to adopt the RobM solution (which however may require a first "adjustment" in case the starting folder was not the desired one) but this solution is far more complicated than a simple ".\" that is also an extremely intuitive solution!!

3) are not at all agree with the statement of pnlawrence according to which the problem would arise only in development and that proposes the same mechanism RobM

4) even in the case where the desired starting folder must be always (or almost always be) the DefaultDir$ and for some reason, occasionally, the user select a different folder, even in the case of version 3.0.0 it would be enough return only once at DefaultDir (also without placing this in the code) that this folder remain selected for future selections

5) is not the first time that the LBB behavior differs in part from that of LB to get better results and LBB (!!) has a nice help menu to resolve problems.

Also on Allincon comments I say that the "full path" is almost never available before the selection by the user (if that is not the case, I think that in practice would serve little the filedialog) and the "full path" is also the ".\"...

But, of course, I accept the decision of the people (naturally hoping that increase those who think like me about it) grin
« Last Edit: Mar 25th, 2016, 7:58pm by pierscintilla » User IP Logged

Alincon
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 147
xx Re: little problem with file selection dialog
« Reply #13 on: Mar 25th, 2016, 7:35pm »

I would prefer not going backwards on the file dialog question when it seems so simple to just use the full path, as you mentioned above

r.m.
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: little problem with file selection dialog
« Reply #14 on: Mar 26th, 2016, 11:19am »

on Mar 25th, 2016, 7:34pm, pierscintilla wrote:
the user will have behavior very "familiar" because it will be the behavior of "his Windows"

I'm not sure that's true. Since the behaviour depends on what the application specifies in the lpstrInitialDir and lpstrFile members there is no 'standard' or 'universal' behaviour for the user to have become familiar with. What you are asking for is what happens when lpstrInitialDir is NULL and lpstrFile contains no path, but that's just as much a 'special case' as what LBB 3.04 does now!

Quote:
this solution is far more complicated than a simple ".\" that is also an extremely intuitive solution!!

I agree that RobM's solution is a lot of work, especially if the program doesn't otherwise need to store any custom information from one run to the next.

Quote:
it would be enough return only once at DefaultDir (also without placing this in the code) that this folder remain selected for future selections

That is, I think, the best argument for your case. It's easy to make the v3.00 behaviour 'mimic' the LB4 behaviour (either in code, by explicitly prefixing a ".\" path, or through the user just once selecting that folder) but it's difficult to make v3.04 mimic the v3.00 behaviour (relies on RobM's technique of storing the user's selection).

Quote:
is not the first time that the LBB behavior differs in part from that of LB to get better results

Indeed. However where possible I try to avoid 'enhanced' LBB behaviour compromising compatibility with LB 4, which in this case it does (although in a relatively minor way).

Quote:
But, of course, I accept the decision of the people

The feedback so far has been insufficient to say that there has been a "decision". I will wait a while and hope that more people express their views.

Richard.
« Last Edit: Mar 26th, 2016, 1:44pm by Richard Russell » User IP Logged

RobM
Junior Member
ImageImage


member is online

Avatar




PM


Posts: 91
xx Re: little problem with file selection dialog
« Reply #15 on: Mar 26th, 2016, 3:13pm »

I wouldn't say the way I do it is a lot of work but it is necessary for my program. It only opens one file type but I create and save 4 different file types which the user may want to store in different locations.

This is what I use for setting up the file dialog and how the info is saved. Not too many lines ;)

Code:
      gosub [OpenStandards]
      gettrim #stan, SettingsNum
      close #stan
      if lastcsvfolder$<>"" then
        StartPath$ = lastcsvfolder$;"*.csv"
        else
        StartPath$ = GetSpecialfolder$(5);"*.csv"
      end if
      filedialog "Select CSV file name and save location", StartPath$, CSVfile$
      if CSVfile$<>"" then
        l=len(CSVfile$)
        temp$=CSVfile$
        while right$(temp$,1)<>"\"
          l=l-1
          temp$=left$(temp$,l)
        wend
        gosub [OpenStandards]
        lastcsvfolder$=temp$
        put #stan, SettingsNum
        close #stan
      end if
 
User IP Logged

pierscintilla
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 30
xx Re: little problem with file selection dialog
« Reply #16 on: Mar 27th, 2016, 09:06am »

Happy Easter to everybody and I wish you to enjoy a little rest at least for today!

As for the "referendum" on filedialog, I believe that the answers may be more "weighted" if Richard could provide a short list of the behavioral differences between the two versions in discussion possibly with a short comment on the pros and the cons for each difference and possible ways of passing each against but I realize that it is much to ask....

For RooM: probably is not a "lot of work" in absolut but always much worse than a simple ". \" (especially if you do not need that).
I prefer to spend my time on more important aspects of my sw and I remain faithful to the famous "KISS" principle that we all know (Keep It Simple etc ..) cheesy

Good day
Pier
« Last Edit: Mar 27th, 2016, 09:12am by pierscintilla » User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: little problem with file selection dialog
« Reply #17 on: Mar 27th, 2016, 1:59pm »

on Mar 27th, 2016, 09:06am, pierscintilla wrote:
if Richard could provide a short list of the behavioral differences between the two versions in discussion possibly with a short comment on the pros and the cons for each difference and possible ways of passing each against but I realize that it is much to ask....

I don't think there's much more to say than what has been said already:

Option 1 (status quo):

The second parameter of FILEDIALOG ('template') is handled in the standard way that Windows normally treats filenames:
  • If an absolute path is specified, the FILEDIALOG opens with that directory initially selected.

  • If a relative path is specified, FILEDIALOG opens in the directory which has the specified relationship with the 'current directory' (DefaultDir$).

  • If no path is included, FILEDIALOG opens with the 'current directory' initially selected.
As far as I am aware this is identical to how LB 4.04 and 4.5.0 behave.

Option 2 (change):

If the second parameter of FILEDIALOG ('template') contains an absolute or relative path the behaviour is the same as Option 1 above, but if it contains no path the behaviour is different:
  • If the program has been run before, and the user made a selection in the FILEDIALOG, this most recently selected path is used as the initial directory.

  • Failing that, if the 'current directory' contains any files of the specified filter types, the initial directory is the current directory.

  • Failing that, the initial directory is the personal files directory of the current user (or the Desktop if he doesn't have one).
In most cases, therefore, the application will 'remember' the directory which was most recently selected.

If I don't make a change, an equivalent behaviour to Option 2 above can be emulated by saving the selected path to the registry or file, and using that as the initial directory next time (as RobM described).

If I do make a change, an equivalent behaviour to Option 1 above can be emulated by prefixing the template string with ".\".

Richard.
« Last Edit: Mar 27th, 2016, 2:09pm by Richard Russell » User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: little problem with file selection dialog
« Reply #18 on: Mar 30th, 2016, 11:42am »

on Mar 27th, 2016, 1:59pm, Richard Russell wrote:
Option 1 (status quo):
Option 2 (change):

I described the options in as much detail as I could, but there's been no response since. Let me turn the question around and put pierscintilla's case more directly: would anybody actually have any objection to me making the change he has asked for? Would anybody's program(s) be adversely affected by that change?

Richard.
User IP Logged

Jack Kelly
Full Member
ImageImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 106
xx Re: little problem with file selection dialog
« Reply #19 on: Mar 30th, 2016, 4:16pm »

FileDialog is ok for me either way. Why don't you do what's best for Rob in Cabinet Planner.
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: little problem with file selection dialog
« Reply #20 on: Mar 30th, 2016, 4:25pm »

on Mar 30th, 2016, 4:16pm, Jack Kelly wrote:
FileDialog is ok for me either way. Why don't you do what's best for Rob in Cabinet Planner.

Rob said it would make no difference to CP, because he always explicitly sets the initial directory.

Richard.
User IP Logged

RobM
Junior Member
ImageImage


member is online

Avatar




PM


Posts: 91
xx Re: little problem with file selection dialog
« Reply #21 on: Mar 30th, 2016, 4:39pm »

I think option 2, having the filedialog remember the last directory if none is specified, would be best. That is normal for most programs.
User IP Logged

pierscintilla
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 30
xx Re: little problem with file selection dialog
« Reply #22 on: Mar 30th, 2016, 5:00pm »

Thank once again Richard for the tireless commitment that he shows!!
« Last Edit: Mar 30th, 2016, 5:01pm by pierscintilla » User IP Logged

joker
Global Moderator
ImageImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 157
xx Re: little problem with file selection dialog
« Reply #23 on: Mar 31st, 2016, 09:26am »

Option 2 is actually how I like to operate anyway, by default. I would have no objections.

And ... change is good! Keeps 'em guessing! cheesy
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: little problem with file selection dialog
« Reply #24 on: Apr 19th, 2016, 11:32am »

Just to say that I've not forgotten about this, but it's not high on my list of priorities. It was, after all, more than six months before the change in the behavior of the FILEDIALOG in v3.01, to improve the compatibility with LB 4, was even commented upon!

As the preference, on balance, seems to be to reverse that change I will tentatively aim to do so around June, which is the next date on which I would normally be considering an update (always assuming that by then I've not once again 'abandoned' LBB, which on past experience is entirely possible!).

Richard.
« Last Edit: Apr 19th, 2016, 11:33am by Richard Russell » User IP Logged

pierscintilla
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 30
xx Re: little problem with file selection dialog
« Reply #25 on: Apr 19th, 2016, 4:58pm »

Thanks for your answer and we hope that does not abandon LBB !!

Pier
User IP Logged

Pages: 1 2  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls