Page 1 of 1

SaveFileRequester() ~ Position in application window

Posted: Wed Feb 25, 2009 9:30 am
by RichardL
Hi,

Please could the file Save and Open requesters (and others?) centralize themselves in the window of the calling PB application, or at least close to the mouse position.
In my view this should be standard practice and not require special coding tricks to achieve.

A good way to do this would be to add an optional parent window ID along the same lines as OpenWindow(). This would be a consistent and backward compatible way of doing it.

I and my customers run two or more screens on their PC and it is confusing for requesters to appear on the wrong screen!

(In a recent television interview the author Terry Pratchett said that he had six screens on his PC because his desk was not big enough for eight. :) )

RichardL

Posted: Wed Feb 25, 2009 11:35 am
by Michael Vogel
I'll open a (dummy) window before using a file selector to get it cenetered -- crazy, but the only workaround I know...

Michael

Re: SaveFileRequester() ~ Position in application window

Posted: Wed Feb 25, 2009 12:56 pm
by PB
Do a search for setting the requester position, there's millions of examples.

Posted: Wed Feb 25, 2009 3:02 pm
by Trond
But they already do this (the default position is near the top left corner of the window, because that's where the mouse pointer is likely to be after selecting File->Open or File->Save).

Code: Select all

OpenWindow(0, 0, 400, 512, 384, "");, #PB_Window_SystemMenu)

  StandardFile$ = "C:\autoexec.bat"
  Pattern$ = "Text (*.txt)|*.txt;*.bat|PureBasic (*.pb)|*.pb|All files (*.*)|*.*"
  File$ = SaveFileRequester("Please choose file to save", StandardFile$, Pattern$, 0)
  
Repeat
  Select WaitWindowEvent()
    Case #PB_Event_CloseWindow
      Break
  EndSelect
ForEver

Posted: Wed Feb 25, 2009 3:47 pm
by RichardL
Hi,
Michael, you are admitting to a crazy workaround, and PB comments that there are millions of examples… I think that you both make a good case for Pure Basic “doing it properly”, no tricks, no workarounds, just a neat and consistent solution that lets programmers focus on solving the real application problem and not overcoming language deficiencies (of which PB has few).

Trond.
Sorry, but your comment is not always true. My display consists of two 1600 x 1200 screens and requesters have a life of their own. They open almost anywhere; but most often close to where the application originally opened.

Best regards to you all.
RichardL

Posted: Wed Feb 25, 2009 4:17 pm
by blueznl
RichardL, I can confirm that. The other bad choice is in the middle, where they end up one half on the left screen, one half on the right one.

Even worse, one of the programs I use doesn't let you drag their alert widnow, so it's either live with it or go away :-)

Now I like to brag about my two 22" TFT's from DELL, 1680x1050 + 1680x1050... but I feel rather stupid when in the head of the moment (the demo effect :-)) a requester pop's up in the middle...