BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

tDriveComboBox on component palate?
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.misc
View previous topic :: View next topic  
Author Message
Jud McCranie
Guest





PostPosted: Thu Dec 11, 2003 6:25 pm    Post subject: tDriveComboBox on component palate? Reply with quote



Is tDriveComboBox on the component palate? I can't find it in Delphi
6, pro.

Back to top
Kent Briggs
Guest





PostPosted: Thu Dec 11, 2003 6:40 pm    Post subject: Re: tDriveComboBox on component palate? Reply with quote



Jud McCranie wrote:
Quote:
Is tDriveComboBox on the component palate? I can't find it in Delphi
6, pro.


Don't know about D6 but it's on the "Win 3.1" palette in D5.

--
Kent Briggs, [email]kbriggs (AT) spamcop (DOT) net[/email]
Briggs Softworks, http://www.briggsoft.com


Back to top
Jud McCranie
Guest





PostPosted: Thu Dec 11, 2003 6:53 pm    Post subject: Re: tDriveComboBox on component palate? Reply with quote



On Thu, 11 Dec 2003 18:40:42 GMT, Kent Briggs <kbriggs (AT) spamcop (DOT) net>
wrote:

Quote:
Is tDriveComboBox on the component palate? I can't find it in Delphi
6, pro.

Don't know about D6 but it's on the "Win 3.1" palette in D5.

That's where it is! I didn't look on the Win 3.1tab because I don't
normally use any of the 3.1 stuff.

Thanks!


Back to top
Maarten Wiltink
Guest





PostPosted: Thu Dec 11, 2003 8:47 pm    Post subject: Re: tDriveComboBox on component palate? Reply with quote

"Jud McCranie" <j.mccranieNOSPAMMM (AT) adelphia (DOT) net> wrote

Quote:
On Thu, 11 Dec 2003 18:40:42 GMT, Kent Briggs wrote:

Is tDriveComboBox on the component palate? I can't find it in Delphi
6, pro.

Don't know about D6 but it's on the "Win 3.1" palette in D5.

That's where it is! I didn't look on the Win 3.1tab because I don't
normally use any of the 3.1 stuff.

That in itself should tell you something.

Groetjes,
Maarten Wiltink



Back to top
Jud McCranie
Guest





PostPosted: Thu Dec 11, 2003 11:44 pm    Post subject: Re: tDriveComboBox on component palate? Reply with quote

On Thu, 11 Dec 2003 21:47:53 +0100, "Maarten Wiltink"
<maarten (AT) kittensandcats (DOT) net> wrote:

Quote:
That in itself should tell you something.

Yes, I'd like to avoid using the Win 3.1 stuff, but right now I'm
using it.

So, is there a better way to let the user pick a drive?

I considered OpenDialog and SaveDialog, but I don't want them to pick
a folder - just a drive. I couldn't find any way to restrict those to
drives only.

Back to top
AlanGLLoyd
Guest





PostPosted: Fri Dec 12, 2003 7:44 am    Post subject: Re: tDriveComboBox on component palate? Reply with quote

In article <k50itv8orod7ln2pn2rvjo4kbmgf51601o (AT) 4ax (DOT) com>, Jud McCranie
<j.mccranieNOSPAMMM (AT) adelphia (DOT) net> writes:

Quote:
Yes, I'd like to avoid using the Win 3.1 stuff, but right now I'm
using it.

So, is there a better way to let the user pick a drive?

I considered OpenDialog and SaveDialog, but I don't want them to pick
a folder - just a drive. I couldn't find any way to restrict those to
drives only.


You could use ShBrowseForFolder and send an apprpriate BFFM_ENABLEOK message to
the dialog (from the callback proc) when the user does not select a drive.

Or create your own "Select Drive" dialog.

Alan Lloyd
[email]alanglloyd (AT) aol (DOT) com[/email]

Back to top
J French
Guest





PostPosted: Fri Dec 12, 2003 9:39 am    Post subject: Re: tDriveComboBox on component palate? Reply with quote

On 12 Dec 2003 07:44:28 GMT, [email]alanglloyd (AT) aol (DOT) com[/email] (AlanGLLoyd) wrote:

Quote:
In article <k50itv8orod7ln2pn2rvjo4kbmgf51601o (AT) 4ax (DOT) com>, Jud McCranie
[email]j.mccranieNOSPAMMM (AT) adelphia (DOT) net[/email]> writes:

Yes, I'd like to avoid using the Win 3.1 stuff, but right now I'm
using it.

So, is there a better way to let the user pick a drive?

I considered OpenDialog and SaveDialog, but I don't want them to pick
a folder - just a drive. I couldn't find any way to restrict those to
drives only.


You could use ShBrowseForFolder and send an apprpriate BFFM_ENABLEOK message to
the dialog (from the callback proc) when the user does not select a drive.

Or create your own "Select Drive" dialog.

Which would probably end up looking like a drop down Drive Combo ....

Back to top
Martin Strand
Guest





PostPosted: Fri Dec 12, 2003 12:45 pm    Post subject: Re: tDriveComboBox on component palate? Reply with quote

J French wrote:
Quote:
On 12 Dec 2003 07:44:28 GMT, [email]alanglloyd (AT) aol (DOT) com[/email] (AlanGLLoyd) wrote:

Or create your own "Select Drive" dialog.

Which would probably end up looking like a drop down Drive Combo ....

....which would contain modern icons.

There is an example on the sample page, ShellComboBox. If you look in the
source, at TCustomShellComboBox.Init, you'll probably find the code you
need. In Delphi 7, it's on line 2520.

I think the clue is
SHGetSpecialFolderLocation(0, CSIDL_DRIVES, MyComputer);
Index := IndexFromID(MyComputer);
if Index <> -1 then
AddItems(Index, Folders[Index]);

where MyComputer is a PItemIDList.

Martin

--
I didn't intend to do a thing today
and so far I'm right on schedule!



Back to top
Maarten Wiltink
Guest





PostPosted: Fri Dec 12, 2003 3:53 pm    Post subject: Re: tDriveComboBox on component palate? Reply with quote

"Jud McCranie" <j.mccranieNOSPAMMM (AT) adelphia (DOT) net> wrote

Quote:
On Thu, 11 Dec 2003 21:47:53 +0100, "Maarten Wiltink"
[email]maarten (AT) kittensandcats (DOT) net[/email]> wrote:

<TDrivePicker is on the "Obsoleted" tab>

Quote:
That in itself should tell you something.

Yes, I'd like to avoid using the Win 3.1 stuff, but right now I'm
using it.

So, is there a better way to let the user pick a drive?

I considered OpenDialog and SaveDialog, but I don't want them to pick
a folder - just a drive. I couldn't find any way to restrict those to
drives only.

So you really want a drive and not a folder. Why?

Groetjes,
Maarten Wiltink



Back to top
Bruce Roberts
Guest





PostPosted: Fri Dec 12, 2003 4:28 pm    Post subject: Re: tDriveComboBox on component palate? Reply with quote


"Jud McCranie" <j.mccranieNOSPAMMM (AT) adelphia (DOT) net> wrote


Quote:
I considered OpenDialog and SaveDialog, but I don't want them to pick
a folder - just a drive. I couldn't find any way to restrict those to
drives only.

This is not really a good idea. The Windows storage paradigm is quickly
moving away from the concept of drives with associated single letter
identifiers. If you really want to restrict things to valid drive letters on
a particular station you could use GetLogicalDriveStrings

var c : array [0 .. 1024] of char;
i, lth : integer;

begin
FillChar (c, SizeOf (c), 0);
lth := GetLogicalDriveStrings (SizeOf (c), c);
if lth <= SizeOf (c)
then begin
for i := 0 to (lth - 1) do
begin
if c [i] = #0
then c [i] := #13;
end;
ComboBox1.Items.Text := c;
end;
end;

But I'd suggest that you consider Alan's idea to use shBrowseForFolder with
a callback to limit its depth, or use the iShellFolder interface (in
particular eNumObjects and GetAttributesOf methods) to obtain an appropriate
list of top level objects in Desktop. This later is more work but will give
you total control over what to include in the list.



Back to top
Jud McCranie
Guest





PostPosted: Fri Dec 12, 2003 7:26 pm    Post subject: Re: tDriveComboBox on component palate? Reply with quote

On 12 Dec 2003 07:44:28 GMT, [email]alanglloyd (AT) aol (DOT) com[/email] (AlanGLLoyd) wrote:

Quote:
You could use ShBrowseForFolder and send an apprpriate BFFM_ENABLEOK message to
the dialog (from the callback proc) when the user does not select a drive.

I'll have to look that up.
Quote:

Or create your own "Select Drive" dialog.

I did that, using GetLogicalDrives, GetDriveType and
GetVolumeInformation. I did it for two reasons (1) to avoid the Win
3.1 stuff, (2) I want to omit CD drives.

A problem with this is that GetVolumeInformation takes a very long
time on the floppy. But I'm going to assume that if A: (and BSmile
exists then assume that it is a floppy and skip the lime-consuming
GetVolumeInformation for A: (and BSmile.



Back to top
Jud McCranie
Guest





PostPosted: Fri Dec 12, 2003 7:57 pm    Post subject: Re: tDriveComboBox on component palate? Reply with quote

On Fri, 12 Dec 2003 16:53:55 +0100, "Maarten Wiltink"
<maarten (AT) kittensandcats (DOT) net> wrote:

Quote:
So you really want a drive and not a folder. Why?

First, I want to keep the users from trying to write to a CD reader.
Secondly, they have specified a complicated system of places where the
data is written to and read from; and it would be less likely that it
would get messed up if I kept control over the subdirectories. There
are up to eight locations specified.

They have a company network drive and each department has a
departmental drive. Some users within the department can make changes
to the dept network and others can only read it (but they can write to
their local HD). Some can make changes to the company network drive
but others can only read it. Some departments allow some others to
read their data. Potentially, one particular department will make
data available to other departments that can make changes to the
company network drive.

With all of these people reading data from one place and often writing
it to another, I fear that if I let them chose a folder to put the
data in, some of it will wind up in the wrong place.



Back to top
Jud McCranie
Guest





PostPosted: Fri Dec 12, 2003 8:01 pm    Post subject: Re: tDriveComboBox on component palate? Reply with quote

On Fri, 12 Dec 2003 11:28:10 -0500, "Bruce Roberts"
<ber (AT) bounceitattcanada (DOT) xnet> wrote:

Quote:
This is not really a good idea. The Windows storage paradigm is quickly
moving away from the concept of drives with associated single letter
identifiers.

Yes. Currently the program has them choose a drive letter. But I'm
in the process of making it more flexible.

Quote:
But I'd suggest that you consider Alan's idea to use shBrowseForFolder with
a callback to limit its depth,

I haven't heard about that. Is it an API call? Is there a good book
that covers things like that?

I've heard two "Tomes of Delphi" books recommended for API calls, but
both have a lot of negative reviews and I don't know which of the two
has the stuff I need. (I looked to see if the bookstore had them, and
they didn't).



Back to top
Maarten Wiltink
Guest





PostPosted: Fri Dec 12, 2003 8:17 pm    Post subject: Re: tDriveComboBox on component palate? Reply with quote

"Jud McCranie" <j.mccranieNOSPAMMM (AT) adelphia (DOT) net> wrote

Quote:
On Fri, 12 Dec 2003 16:53:55 +0100, "Maarten Wiltink"
[email]maarten (AT) kittensandcats (DOT) net[/email]> wrote:

So you really want a drive and not a folder. Why?

First, I want to keep the users from trying to write to a CD reader.
Secondly, they have specified a complicated system of places where the
data is written to and read from; and it would be less likely that it
would get messed up if I kept control over the subdirectories. There
are up to eight locations specified.

They have a company network drive and each department has a
departmental drive. Some users within the department can make changes
to the dept network and others can only read it (but they can write to
their local HD). Some can make changes to the company network drive
but others can only read it. Some departments allow some others to
read their data. Potentially, one particular department will make
data available to other departments that can make changes to the
company network drive.

With all of these people reading data from one place and often writing
it to another, I fear that if I let them chose a folder to put the
data in, some of it will wind up in the wrong place.

I figured it would be something like that. That still doesn't make it
a good idea.

Something will _always_ wind up in the wrong place.

As Bruce said, drive letters are on their way out, although obviously
people will keep thinking on those terms for decades to come. From your
description, the list is "my space", "our space", "their space". Why
bother with drive letters at all?

Never stop thinking about the essence of things.

Groetjes,
Maarten Wiltink



Back to top
Jud McCranie
Guest





PostPosted: Fri Dec 12, 2003 8:48 pm    Post subject: Re: tDriveComboBox on component palate? Reply with quote

On Fri, 12 Dec 2003 21:17:45 +0100, "Maarten Wiltink"
<maarten (AT) kittensandcats (DOT) net> wrote:

Quote:
Something will _always_ wind up in the wrong place.

Yes, but I'm trying to reduce that. It is so complicated that they
could be reading data that they think is current, but isn't, etc.

Quote:
As Bruce said, drive letters are on their way out, although obviously
people will keep thinking on those terms for decades to come. From your
description, the list is "my space", "our space", "their space". Why
bother with drive letters at all?

It doesn't specifically have to be drive letters, in fact I'm getting
away from that. The version they currently use does have a 1-char
drive letter and leaves it up to them to make sure they have the right
one. But one of the reasons for the combo box to pick it is that it
shows the network path.

Yesterday (in the version I'm working on) I added the Win 3.1
DriveComboBox, but since then I've worked on my own combo box.
Their original specification was even more complex, but once I
understood what they were getting at, I was able to simplify it a
little. But mostly it is Company, Department, local HD, local backup,
and the pooled department. But there is a place where each user reads
data (may be local or network), up to four places that data is written
(which may or may not be the same as the read drive), the drive for
the pooled department, and a local backup. So 7, instead of 8.


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.misc All times are GMT
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.