PtFileSelect for backups

I’m writing a kind of a backup routine. I’d like to use the PtFileSelect
widget to indicate which files and directories to backup. This is
essentially working, but I’d like to get the appearence that you usually
see on MS systems where there would be a check mark next to the files that
are selected. I also want to be able to select a directory and “check” all
of the files under it.

Is this behavour possible with the out of the box PtFileSelect?

No.

“Bill Caroselli” <qtps@earthlink.net> wrote in message
news:cp7dk3$n6q$1@inn.qnx.com

I’m writing a kind of a backup routine. I’d like to use the PtFileSelect
widget to indicate which files and directories to backup. This is
essentially working, but I’d like to get the appearence that you usually
see on MS systems where there would be a check mark next to the files that
are selected. I also want to be able to select a directory and “check”
all
of the files under it.

Is this behavour possible with the out of the box PtFileSelect?

Misha Nefedov wrote:

No.

“Bill Caroselli” <> qtps@earthlink.net> > wrote in message
news:cp7dk3$n6q$> 1@inn.qnx.com> …

I’m writing a kind of a backup routine. I’d like to use the PtFileSelect
widget to indicate which files and directories to backup. This is
essentially working, but I’d like to get the appearence that you usually
see on MS systems where there would be a check mark next to the files that
are selected. I also want to be able to select a directory and “check”
all
of the files under it.

Is this behavour possible with the out of the box PtFileSelect?
\

I think you would need one of the ‘raw’ list variations.

One more file selector question/problem.

I am using a format string of “130k120nd”, but the widget doesn’t seem to
allow more than about 70 pixels to be used for teh size column ‘k’.

I am trying to display file sizes that are under 3 levels of directories.
I.E.
Dir
Dir
Dir
File
but the size column isn’t big enough to display the size unless I move
the divider on top. AND teh size field isn’t as big as I requested.
(130 pixels)

This widget is created using PhAB. I am not trying to set any resources
in my own code.

What am I doing wrong?

Garry wrote:

“Bill Caroselli” <> qtps@earthlink.net> > wrote in message
news:cp7dk3$n6q$> 1@inn.qnx.com> …
I’m writing a kind of a backup routine. I’d like to use the
PtFileSelect
widget to indicate which files and directories to backup. This is
essentially working, but I’d like to get the appearence that you usually
see on MS systems where there would be a check mark next to the files
that
are selected. I also want to be able to select a directory and
“check” all
of the files under it.

Is this behavour possible with the out of the box PtFileSelect?

I think you would need one of the ‘raw’ list variations.

It might be easier to use a regular PtTree, especially if you don’t mind
having all the checkboxes in one column rather than next to the
expand/collapse button like they are in Windows. But even that could be
done with a PtTree – you’d just need to fake it by using an image that
looks like a checkbox next to a folder/file image, and doing your own
math to find out whether a click hits a checkbox or not. Of course, the
worst part is that you’d have to read the directories yourself.

Bill Caroselli <qtps@earthlink.net> wrote:
BC > One more file selector question/problem.

BC > I am using a format string of “130k120nd”, but the widget doesn’t seem to
BC > allow more than about 70 pixels to be used for teh size column ‘k’.

BC > I am trying to display file sizes that are under 3 levels of directories.
BC > I.E.
BC > Dir
BC > Dir
BC > Dir
BC > File
BC > but the size column isn’t big enough to display the size unless I move
BC > the divider on top. AND teh size field isn’t as big as I requested.
BC > (130 pixels)

BC > This widget is created using PhAB. I am not trying to set any resources
BC > in my own code.

BC > What am I doing wrong?

Is this a bug with the widget (as I assume),
or am I doing something wrong?

One more PtFileSelect issue.

If I try to hadle an FS_BACKGROUND callback for a directory entry,
and I change the name, it will no longer read that directory.

I assume it is trying to read the new directory name.

I just want to change the name for display purposes. I want to use
something less computer-ees.

Is this a bug or the way it is supposed to work? If this is how it is
supposed to work, it should say so in the documentation.

Bill Caroselli <qtps@earthlink.net> wrote:
BC > One more file selector question/problem.

BC > I am using a format string of “130k120nd”, but the widget doesn’t seem to
BC > allow more than about 70 pixels to be used for teh size column ‘k’.

BC > I am trying to display file sizes that are under 3 levels of directories.
BC > I.E.
BC > Dir
BC > Dir
BC > Dir
BC > File
BC > but the size column isn’t big enough to display the size unless I move
BC > the divider on top. AND teh size field isn’t as big as I requested.
BC > (130 pixels)

BC > This widget is created using PhAB. I am not trying to set any resources
BC > in my own code.

BC > What am I doing wrong?

Could someone please comment on this.

I am not even able to fix this bug by explicitly doing a SetResource on
Pt_ARG_FS_FORMAT in the setup code.

What can I do to fix this?

How can I know on a Pt_FS_SELECTION if the item returned is selected or
unselected?

I get the same results in either case.

Bill Caroselli wrote:

How can I know on a Pt_FS_SELECTION if the item returned is selected or
unselected?

There’s a flag in the item that you can check:

PtFileSelItem_t *item;

if ( item->gen.list.flags & Pt_LIST_ITEM_SELECTED ) …

Bill Caroselli wrote:

Could someone please comment on this.

Looks like a bug in the widget… Thanks for reporting it and sorry for
the inconvenience…

I am not even able to fix this bug by explicitly doing a SetResource on
Pt_ARG_FS_FORMAT in the setup code.

What can I do to fix this?

Doing the SetResource after the widget has been realized seems to
work. I’ll let you know if I find a better workaround.

Bill Caroselli wrote:

One more PtFileSelect issue.

If I try to hadle an FS_BACKGROUND callback for a directory entry,
and I change the name, it will no longer read that directory.

I assume it is trying to read the new directory name.

It appears so. Bad widget! :-/

I just want to change the name for display purposes. I want to use
something less computer-ees.

Is this a bug or the way it is supposed to work? If this is how it is
supposed to work, it should say so in the documentation.

No, it’s definitely not the way it’s supposed to work. The purpose of
the callback is not to make the widget stop working.

Are you ready to talk about how to do it with a PtTree instead of a
PtFileSel yet?.. :wink:

Wojtek Lerch <Wojtek_L@yahoo.ca> wrote:
WL > Bill Caroselli wrote:

How can I know on a Pt_FS_SELECTION if the item returned is selected or
unselected?

WL > There’s a flag in the item that you can check:

WL > PtFileSelItem_t *item;
WL > …
WL > if ( item->gen.list.flags & Pt_LIST_ITEM_SELECTED ) …

Thank you

Wojtek Lerch <Wojtek_L@yahoo.ca> wrote:

WL > Are you ready to talk about how to do it with a PtTree instead of a
WL > PtFileSel yet?.. :wink:

LOL. OK, let me start reading about PtTree.
If I have questions, I’ll ask.

Bill Caroselli <qtps@earthlink.net> wrote:
BC > Wojtek Lerch <Wojtek_L@yahoo.ca> wrote:

BC > WL > Are you ready to talk about how to do it with a PtTree instead of a
BC > WL > PtFileSel yet?.. :wink:

BC > LOL. OK, let me start reading about PtTree.
BC > If I have questions, I’ll ask.

PtTree looks very versitile. But it also looks like a lot of work.
For now, I can live with the behavour I have.