ExplorerTree - Windows Open Window

Just starting out? Need help? Post your questions and find answers here.
reisve
User
User
Posts: 86
Joined: Sat Nov 08, 2008 4:52 pm
Location: Luanda, Angola

ExplorerTree - Windows Open Window

Post by reisve »

I need to make a Explorer Tree to work as the Windows Open (new file) Explorer or I can use the Windows Open Explorer.

Can any one point me to a solution?
Inf0Byt3
PureBasic Fanatic
PureBasic Fanatic
Posts: 2236
Joined: Fri Dec 09, 2005 12:15 pm
Location: Elbonia

Post by Inf0Byt3 »

Is this what you need?

Code: Select all

If OpenWindow(0, 0, 0, 300, 300, "ExplorerTreeGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    ExplorerTreeGadget(0, 10, 10, 280, 280, "*.*")
    Repeat 
      Event = WaitWindowEvent()
      If Event = #PB_Event_Gadget
        Select EventGadget()
          Case 0
            If EventType() = #PB_EventType_LeftDoubleClick
              Item = GetGadgetState(0)
              If Item = #PB_Explorer_File
                FilePath.s = GetGadgetText(0)
                If FilePath <> ""
                  If RunProgram(FilePath) <> 0
                    Debug FilePath+" was launched"
                  Else
                    Debug "Error running: "+FilePath
                  EndIf
                EndIf
              EndIf
            EndIf
        EndSelect
      EndIf
    Until Event = #PB_Event_CloseWindow
  EndIf
I hope I understood correctly.
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
reisve
User
User
Posts: 86
Joined: Sat Nov 08, 2008 4:52 pm
Location: Luanda, Angola

Post by reisve »

The code just give me an empty window.

I need sometng to let me save/create a file, with options to navigate in the directory tree, and create a new folder if necessary
harff182
Enthusiast
Enthusiast
Posts: 105
Joined: Thu Dec 08, 2005 4:58 pm
Location: Duesseldorf, Germany

Post by harff182 »

reisve wrote:The code just give me an empty window.
Not here. It opens an Explorer-like TreeView.
What version of PB are you using?
I need sometng to let me save/create a file, with options to navigate in the directory tree, and create a new folder if necessary
:o
Why don't OpenFileRequester() and SaveFileRequester() fit your needs?
Sorry 4 my poor English, it's the only one I learned 40 years ago...
since 17.12.08: XPHome(SP3) + PB 4.30
reisve
User
User
Posts: 86
Joined: Sat Nov 08, 2008 4:52 pm
Location: Luanda, Angola

Post by reisve »

Thanks

OpenfileRequester was exactely what I was looking for
Post Reply