OpenFileRequester ?

Just starting out? Need help? Post your questions and find answers here.
TerryHough
Enthusiast
Enthusiast
Posts: 781
Joined: Fri Apr 25, 2003 6:51 pm
Location: NC, USA
Contact:

OpenFileRequester ?

Post by TerryHough »

Is it possible to specify where the OpenFileRequester dialog appears on the screen?

TIA,
Terry
Justin
Addict
Addict
Posts: 948
Joined: Sat Apr 26, 2003 2:49 pm

Post by Justin »

No, windows chooses the place. your only chance is to build a custom dialog.
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

> windows chooses the place

Actually, it opens it based on where your app's current window is located.
Thus, just open another window first, and then use OpenFileRequester.

Here is a crude example which shows how to open the requester at any
of the four corners of the screen:

Code: Select all

If OpenWindow(0,300,250,400,200,#PB_Window_SystemMenu,"Main App Window")
  CreateGadgetList(WindowID())
  ButtonGadget(1,20,50,250,25,"Click to open file requester at top-left of screen")
  Repeat
    ev=WindowEvent()
    If ev=#PB_EventGadget
      OpenWindow(1,-9999,-9999,0,0,0,"Temp Hidden Window") ; Opens at top-left.
      ;OpenWindow(1,9999,-9999,0,0,0,"Temp Hidden Window") ; Opens at top-right.
      ;OpenWindow(1,9999,9999,0,0,0,"Temp Hidden Window") ; Opens at bottom-right.
      ;OpenWindow(1,-9999,9999,0,0,0,"Temp Hidden Window") ; Opens at bottom-left.
      OpenFileRequester("title","","*.*",0)
      CloseWindow(1)
    EndIf
  Until ev=#PB_EventCloseWindow
EndIf
TronDoc
Enthusiast
Enthusiast
Posts: 310
Joined: Wed Apr 30, 2003 3:50 am
Location: 3DoorsDown

Post by TronDoc »

nice tip..thanks!
Joe
peace
[pI 166Mhz 32Mb w95]
[pII 350Mhz 256Mb atir3RagePro WinDoze '98 FE & 2k]
[Athlon 1.3Ghz 160Mb XPHome & RedHat9]
Post Reply