Solved

comboboxes and listboxes

Posted on 1999-01-11
9
146 Views
Last Modified: 2010-04-06
Hi experts,

with the help of a drivecombobox, filtercombobox,directorylistbox  and a filelistbox control I would like to create
a SAVE file dialogue. Can you please show me how this can be done with Delphi 3.0 ? In my books I unfortunately
find only examples for a LOAD file dialogue.


With kind regards

Mathes
0
Comment
Question by:mathes
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1355892
Well, in terms of the UI they are basically identical except for the titles. When the execute method finishes you save a file rather than load one.

Cheers,

Raymond.
0
 

Author Comment

by:mathes
ID: 1355893
Dear rwilson,

thank you for your comment. Can you please provide me with a small demo program in order to clarify this thing ?

With kind regards

Mathes
0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1355894
You already have one! Its the load demo in your D3 book. Just change the title to 'Save...' and save a file instead of opening it!

Cheers,

Raymond.
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1355895
Hi mathes,

like rwilson... if you already have a demo of a load dialog... then you can easely adjust it to save dialog...

Why? Normally a load dialog allows you to select a file name. A save dialog lets you to select one, or to fill in one...

So what's the difference? I the save dialog, you need only make it possible to write in the editbox where the selected file is written.. And change the title to save offcourse.

If the problem still persists, please paste some code or send the 'load'-demo to me.

Zif.
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 1

Expert Comment

by:martin_g
ID: 1355896
Hi,
You do have a SaveDialog component already in Delphi 3 (as the other guys have mentioned).Look under the Dialogs components tab.  You just use SaveDialog1.Execute to start it (once you have dragged it to your form).

However, I was wondering what you were trying to save.  Are they files in memory but not on the harddrive yet? Therefore, they won't show up on your files list?  If that's the case, you might want to use a different approach.  Something I'm sure we can help you with if you want.  

Thanks for taking my "Two cents" worth!
Regards,
Martin
0
 
LVL 10

Accepted Solution

by:
viktornet earned 10 total points
ID: 1355897
You ust go to the palette with the dialog boxes and choose TSaveDialog or something then do this...

if SaveDialog1.Execute then
  MyItems.SaveToFile(SaveDialog1.FileName);

That's all...

-Viktor
--Ivanov
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1355898
oppps... Martin_G has mentioned something similar to what i have...****
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1355899
actually here is what you do...

OnFileListBoxDoubleClick()
begin
  SaveDialog1.FileName := FileListBox.Items[FileListBox.ItemIndex];
  if SaveDialog1.Execute then
     Memo.Lines.SaveToFile(SaveDialog1.FileName);
end;

That was an example.... It's more like of a pseude code since I don't have Delphi open... if you need more helkp with anything let me know....

-Viktor
--Ivanov
0
 

Author Comment

by:mathes
ID: 1355900
Hi experts,

thank you all for your help and comments.

Yes, the solution is really easy. I simply have to add a savedialog control and a
command button to a form, that is all I nbeed to do. When I click on the button,
I call the statement

SaveDialog1.Execute


and no further lines of code are required. I think I was confused by the drivecombobox,
filtercombobox, directorylistbox and filelistbox controls. I didn't realize that I don't
need these items in this case.
I guess this blackout was my problem. I am happy that this problem is solved now.


With kind regards

Mathes


0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now