Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 File Browsing Module
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
jawaharyousuf




PostPosted: Wed Mar 10, 2004 8:29 am   Post subject: File Browsing Module

This module is kind of like a Open File box in Windows. You can browse for files using GUI, that's the point.

Post your opinion on it, and also some advice as there are two flaws in it.

1. Can't handle path longer than 255 characters.(Turing doesn't allow it)
2. Crashes when you hit a key while browsing.(Turing is showing some error in WidgetModule.tu)

If you have solutions for this please post them.

Usage:-
1. Keep this module and your other files in the same folder
2. import file
Explore.browse(output)
3. Output returns the file path, which can be used in your program

I'm improving it with other stuff soon(Cancel button etc). But i guess you can do it, once you go through the code.



Explore.t
 Description:
Rename to tu. currently shortlists jpg and bmp files. you can change it however you like. wrote about that in the file.

Download
 Filename:  Explore.t
 Filesize:  5.44 KB
 Downloaded:  336 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Homer_simpson




PostPosted: Wed Mar 10, 2004 1:40 pm   Post subject: (No subject)

nice gui interface... try adding some more details about files and directories... like attribute date,etc
+bits
Delos




PostPosted: Wed Mar 10, 2004 7:31 pm   Post subject: (No subject)

Not too shabby at all...now, if only you concentrated as much on discrete as much as you did on this...hehehe.

Ah well. I trust you'll get it to move past the bugs I found in it...and get it to actually open dirs etc...should be interesting.

Bugs:

Click on textfield w/ "C:/" in it...pressed a key...it died.
Odd...I'm on 4.0.5...so I'm not sure why it did that. Unresolved routines.
Oh man...YDJ...you've got horrible var names. ANyhow, I'm guessing that your keystroke handler is not working properly. Fix it...Very Happy
jawaharyousuf




PostPosted: Thu Mar 11, 2004 8:34 am   Post subject: (No subject)

Quote:

and get it to actually open dirs etc


Doesn't it do that already? else, i would not have posted the module.
jawaharyousuf




PostPosted: Thu Mar 11, 2004 10:03 pm   Post subject: New Version

I fixed the bugs. Delos, the problem wasn't the keyhandler. It was about which GUI was declared first, coz apparently that one recieves the text input(although the cursor is blinking in the text field.)

Now the module does this:-

1. Browse through folders(like the previous version)
2.User can type the directory path directly into the First Text Field (this now allows change of drives)
3. or the file path into the second field.

Whether the file that the user enters exists should be decided by your code, coz i don't know what sort of tests you'll put it through before deciding it is the file that your program wants.

I didn't bother putting labels to the text field, i guess you might want to label them according to your needs(current directory, Dir:-, directory etc..)
post your opinions on how else i can improve this. Hope this is useful to you.
Download from the first message in this topic(thats the new version)
jawaharyousuf




PostPosted: Sat Apr 03, 2004 8:40 pm   Post subject: (No subject)

Updates in the module:-
1. Starting directory
2. Custom title

syntax change:-
Explore.Browse(var filename:string,starting directory:string, title:string)

if you find any bugs please post them. I really need this to be perfect(well atleast almost) before May 14th. Thanks

I have uploaded the updated version.
Delos




PostPosted: Sun Apr 04, 2004 9:46 am   Post subject: (No subject)

Here's some suggestions...

- I type in a path, press enter nothing happens.
- I type in a path, press 'Open', the programme closes...
- I double click on any valid directory, and it opens a new window (an ugly window too).

- GUI.SetScrollOnAdd

- Sorting procedures needed...you need to be able to distinguish a folder from a file.
+ you could sort using an index of "." to distinguish between file and folder
+ then display folders in CAPS, or files w/ some mark ("-")
- it closes when I click Open!
- if this module is going to be (fairly) available outside of a limited group, it needs to be a bit more...error trapped and idiot proof. I set the starting directory var to "" and it died...shouldn't happen...

- did you know that if you set the starting directory to the name of any file, then run it, then double click on that name...that it will automatically move to the directory in which explore.t is stored?

I'll post more if and when I find more.
jawaharyousuf




PostPosted: Sun Apr 04, 2004 10:38 am   Post subject: (No subject)

strangely enough, none of those happened when i ran it (except for when you put "" in the starting directory , it dies; thanks for that)no ugly windows, no not responding to path when you type the path in, nothing of that sort. The program closes when you press open coz thats common sense. if the program remains there even when you select a file and press open, how will your main program go ahead? This module returns the path of a filename. Your program will deal with the file path returned and check if thats the type of file you need(or something stupid that user entered manually). in that case you keeping asking for the file untill you get a valid one.This usually happens when the user refuses to use the GUI available and sticks to entering the path manually.

Thanks for the other bugs found delos. I'll update the following soon:-
- GUI.Scroll-thing
-starting directory bugs

BTW:- what version do you have delos? coz no ugly window ever opened to me. There is this main window(where your program runs) and the Open file window(which closes and goes back to the main window when you press open)

if any one else has any such problems please post them. thanks
Sponsor
Sponsor
Sponsor
sponsor
Delos




PostPosted: Sun Apr 04, 2004 1:36 pm   Post subject: (No subject)

"Common sense"

When I type in a path name...let's say...www.compsci.ca...and I press enter...I expect to be taken to compsci.ca.

Similarly, if I select a folder, and click open, I expect that folder to open...besides the fact that I could double click...I may want to click 'Open' instead as I may know very little about computers, and seeing the word 'Open' screams to me that clicking it will open any directory that I have selected...

Interesting, eh?
jawaharyousuf




PostPosted: Sun Apr 04, 2004 8:52 pm   Post subject: (No subject)

cool delos. don't lose your temper so easily. it would make the same amount of sense if you suggested the above things in a cool way. I have nothing against you. i just need suggestions on improving this module. And i thank you for giving them to me.
jawaharyousuf




PostPosted: Mon Apr 05, 2004 5:33 pm   Post subject: (No subject)

New stuff:-
Everything delos said in the above post.
Button title(Open, Select etc.)

Syntax change(var output filepath:string,starting directory:string,display title:string, button title:string)
Any bugs, please post them. and oh yeah...suggestions too.
Delos




PostPosted: Tue Apr 06, 2004 6:39 pm   Post subject: (No subject)

Nice, nice, nice...

But for some reason it's still opening a secondary window when I double click on a directory name...strange...can't figure out why though...

It only happens once, when I click on the first dir...then after that (in the new window), things happen fine.

When I go back to the old window and click on the "Open Button", it returns the correct file path...

Possibly a problem w/ the GUI w/ your textboxchoice?
jawaharyousuf




PostPosted: Tue Apr 06, 2004 7:23 pm   Post subject: (No subject)

no such window opens to me. I'm not sure why thats happening.
Catalyst




PostPosted: Tue Apr 06, 2004 11:01 pm   Post subject: (No subject)

i like it
have 18bits
jawaharyousuf




PostPosted: Tue Apr 13, 2004 10:10 pm   Post subject: Patch

Patch:- The program detects ".jpg" files but not ".JPG" files.
Although that doesn't effect the working of the module, I'm uploading the new version, just coz I have noticed it.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 15 Posts ]
Jump to:   


Style:  
Search: