Delphi Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreDelphi Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 15th, 2003, 05:33 AM
fip0203 fip0203 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 50 fip0203 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 30 m 56 sec
Reputation Power: 5
file open dialog creation

Hi,
how can i create the following GUI component using Delphi:
i have a set of maps and a group of data files corresponding to the maps present in a folder. now i have to create a GUI which contains two icons/images connected by an arrow mark.
by clicking on the first image/icon, a file open dialog box should appear. this dialog box lists the map files that i have . once one of the maps is selected, it should be displayed on the form adjacent to the icons.
by clicking the second icon/image, the same procedure as above is repeated but with data files(which are simple notepad files)
i am not sure if the TOpenDialog box can be used. i may be wrong. i am a newbie to delphi and hence finding it difficult to proceed.can u help me to proceed?
thanks in advance.

Reply With Quote
  #2  
Old December 15th, 2003, 03:42 PM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 7,536 Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 6 h 51 m 7 sec
Reputation Power: 876
Go to the Dialogs tab and drop a TOpenDialog component on the form. Then, set the following properties for the component:
1. Set the DefaultExt property to *.map (or whatever extension you have for the MAP files).
2. Click on Filter and in the dialog box, set the properties like this:
Code:
Filter Name        Filter
--------------------------
Map Files          *.map
All Files          *.*

3. You can also set the Options and OptionsEx properties if you like, but the defaults ought to be ok.

Now on your Icon component (is it a TImage?), create an OnClick event and put the following:
Code:
procedure TForm1.Image1Click(Sender: TObject);
begin
	if OpenDialog1.Execute then
	begin
		// Do something with OpenDialog1.FileName
	end;
end;

The Execute method calls the dialog and returns True, if the user selects a file. Then, OpenDialog1.FileName contains the name of the file that was selected by the user.

Now you can do the same thing for the Data Files as well, using another TOpenDialog component.
__________________
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne

Puzzle of the Month solved by Keath and KevinADC, superior perl programmers of the month
Looking for a perl job with kick-*** programmers in a well-known NASDAQ listed tech company with branches in the US and Europe? We're hiring. PM me for details. Requirements

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreDelphi Programming > file open dialog creation


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway