Board index » cppbuilder » File Selecting

File Selecting


2004-12-14 05:04:06 AM
cppbuilder42
I have been searching around for an answer to this problem and now doubt I
am over thinking this.
I am trying build an app that will back up certain files and would like to
offer the user a check box style selector where the user can simply check
off the items they want to add to the back up list. I have hit a wall and
can't figure out how to connect a either a TreeView, ListView or
CheckBoxList any drives, folders, files etc.
Can any one suggest a place to start?
Thank you for any help you can send my way.
 
 

Re:File Selecting

"Eskimo" < XXXX@XXXXX.COM >wrote in message
Quote
I have hit a wall and can't figure out how to connect a either a
TreeView, ListView or CheckBoxList any drives, folders, files etc.
What EXACTLY are you having a problem with? Please be more specific.
Gambit
 

Re:File Selecting

Here is the code that I have been playing with. I know that it is not
likely the right idea to work with Win 3.11 but it's as close as I can
figure how to get started.
I would like to be able to see the Drive, Directory and File list in a
Hierarchal checklist. Then as the user selects Directory or File the
selected items are added to the backup project with the Zip1->FilesToProcess
routine (from xceed software)
I hope I am making sense with what I am asking.
-----Paste-----
void __fastcall TForm1::DriveCBChange(TObject *Sender)
{
//Send info around to various lists
DirectoryListBox1->Drive = DriveCB->Drive;
FileListBox1->Directory = DirectoryListBox1->Directory;
}
void __fastcall TForm1::DirectoryListBox1Change(TObject *Sender)
{
FileListBox1->Directory = DirectoryListBox1->Directory;
}
void __fastcall TForm1::FileListBox1Change(TObject *Sender)
{
CheckLB->Items->Text = FileListBox1->Directory;
}
"Remy Lebeau (TeamB)" < XXXX@XXXXX.COM >wrote in message
Quote

"Eskimo" < XXXX@XXXXX.COM >wrote in message
news: XXXX@XXXXX.COM ...

>I have hit a wall and can't figure out how to connect a either a
>TreeView, ListView or CheckBoxList any drives, folders, files etc.

What EXACTLY are you having a problem with? Please be more specific.


Gambit



 

{smallsort}

Re:File Selecting

"Eskimo" < XXXX@XXXXX.COM >wrote in message
Quote
I would like to be able to see the Drive, Directory and File list
in a Hierarchal checklist.
How about using a standard TreeView with its TVS_CHECKBOXES style enabled?
There are several third-party TreeView components available at
www.torry.net that have checkboxes enabled.
You can then use GetLogicalDriveStrings() from the Win32 API to enumerate
the available drives and add them to your TreeView. Each time a node is
expanded, you can calculate its Path and then enumerate the files and
subfolders inside that folder, adding them to the node that is being
expanded.
This way, you get a nice clean hierarchal display of all drives, folders,
and files using a single component. For a more standardized display, you
can display just the files in a TCheckListBox or a TListView, leaving just
the drives and folders in the TTreeView.
Gambit
 

Re:File Selecting

Yes! This exactly what I needed thank you very much. I am a hobbiest and I
enjoy solving problems but when the get the better of me I turn to the
Proffesional. Thank you!
Eskimo
"Remy Lebeau (TeamB)" < XXXX@XXXXX.COM >wrote in message
Quote

"Eskimo" < XXXX@XXXXX.COM >wrote in message
news: XXXX@XXXXX.COM ...

>I would like to be able to see the Drive, Directory and File list
>in a Hierarchal checklist.

How about using a standard TreeView with its TVS_CHECKBOXES style enabled?
There are several third-party TreeView components available at
www.torry.net that have checkboxes enabled.

You can then use GetLogicalDriveStrings() from the Win32 API to enumerate
the available drives and add them to your TreeView. Each time a node is
expanded, you can calculate its Path and then enumerate the files and
subfolders inside that folder, adding them to the node that is being
expanded.

This way, you get a nice clean hierarchal display of all drives, folders,
and files using a single component. For a more standardized display, you
can display just the files in a TCheckListBox or a TListView, leaving just
the drives and folders in the TTreeView.


Gambit