Lisp HUG Maillist Archive

capi:Multi-column-list-panel

capi:Multi-column-list-panel Hello,

When the action-callback is used on a multi-column-list-panel, the callback returns the item or the item-data and gives me an info on the row clicked. Is it a way to get also an info on the column clicked ?

Thanks in advance

Denis

-------------------------------------------------------
Denis Pousseur
70 rue de Wansijn
1180 Bruxelles, Belgique

Tel : 32 (0)2 219 31 09
Mail :  denis.pousseur@gmail.com
-------------------------------------------------------

Re: capi:Multi-column-list-panel


* Denis Pousseur <C5582FA7.6648%denis.pousseur@gmail.com> :
Wrote on Sun, 30 Nov 2008 11:55:19 +0100:

| When the action-callback is used on a multi-column-list-panel, the
| callback returns the item or the item-data and gives me an info on the
| row clicked. Is it a way to get also an info on the column clicked ?

The following callback worked on windows with an earlier lw version. It
failed/would not work the motif backend where IIRC I figured it was not
possible and gave up --- I'm also looking for a real solution though.

;; Assuming your interface has a slot called mclp
(lambda (data intf)
  (multiple-value-bind (x y)
      (capi:current-pointer-position :relative-to intf)
    (with-slots (mclp) intf
      (let* ((hpos (capi:get-scroll-position mclp :horizontal))
	     (colno
	      (let ((widths
		     (map 'list #'car (capi::list-panel-column-info mclp))))
		(loop with needle = (+ hpos x)
		      for beg = 0 then total-width
		      for colno from 0
		      for width in widths
		      summing width into total-width
		      if (<= beg needle total-width) return colno))))
	(capi:display-message
	 "The arguments were data(arg1) ~S and intf(arg2) ~S
Mouse Position is: ~S ~S.
Scroll: ~S
Column: is ~S"
	 data intf x y hpos colno)))))

--
Madhu


Re: capi:Multi-column-list-panel

Hi Madhu,

Thanks for your answer. In my version (LWM 5.1) the  capi::column-info slot
contains just NIL. I suspect that the CAPI does not memorize the column
widths (I do not see any slot witch contains this info) and let this to
COCOA (at least on Mac).

On Mac this code returns the column index :

(multiple-value-bind (x y) (capi:current-pointer-position :relative-to mclp)
  (let ((NSTableView (sr capi-cocoa-library::main-view
(capi-internals:representation mclp))))
    (objc:invoke NSTableView "columnAtPoint:" (make-array 2
:initial-contents (list x y)))))


Best regards


Denis




Le 2/12/08 13:16, « [NOM] » <[ADRESSE]> a écrit :

> 
> 
> * Denis Pousseur <C5582FA7.6648%denis.pousseur@gmail.com> :
> Wrote on Sun, 30 Nov 2008 11:55:19 +0100:
> 
> | When the action-callback is used on a multi-column-list-panel, the
> | callback returns the item or the item-data and gives me an info on the
> | row clicked. Is it a way to get also an info on the column clicked ?
> 
> The following callback worked on windows with an earlier lw version. It
> failed/would not work the motif backend where IIRC I figured it was not
> possible and gave up --- I'm also looking for a real solution though.
> 
> ;; Assuming your interface has a slot called mclp
> (lambda (data intf)
>   (multiple-value-bind (x y)
>       (capi:current-pointer-position :relative-to intf)
>     (with-slots (mclp) intf
>       (let* ((hpos (capi:get-scroll-position mclp :horizontal))
>     (colno
>      (let ((widths
>     (map 'list #'car (capi::list-panel-column-info mclp))))
> (loop with needle = (+ hpos x)
>      for beg = 0 then total-width
>      for colno from 0
>      for width in widths
>      summing width into total-width
>      if (<= beg needle total-width) return colno))))
> (capi:display-message
> "The arguments were data(arg1) ~S and intf(arg2) ~S
> Mouse Position is: ~S ~S.
> Scroll: ~S
> Column: is ~S"
> data intf x y hpos colno)))))
> 
> --
> Madhu
> 

-------------------------------------------------------
Denis Pousseur
70 rue de Wansijn
1180 Bruxelles, Belgique

Tel : 32 (0)2 219 31 09
Mail :  denis.pousseur@gmail.com
-------------------------------------------------------



Re: capi:Multi-column-list-panel

>>>>> On Tue, 02 Dec 2008 16:50:26 +0100, Denis Pousseur said:
> 
> Hi Madhu,
> 
> Thanks for your answer. In my version (LWM 5.1) the  capi::column-info slot
> contains just NIL. I suspect that the CAPI does not memorize the column
> widths (I do not see any slot witch contains this info) and let this to
> COCOA (at least on Mac).
> 
> On Mac this code returns the column index :
> 
> (multiple-value-bind (x y) (capi:current-pointer-position :relative-to mclp)
>   (let ((NSTableView (sr capi-cocoa-library::main-view
> (capi-internals:representation mclp))))
>     (objc:invoke NSTableView "columnAtPoint:" (make-array 2
> :initial-contents (list x y)))))

I need post the usual caveat here: using undocumented internals of CAPI (or
any other LW package) is not something that we support or recommend.

Do other applications have this column-specific clicking behavior?  If not,
then you are potentially making your interface confusing for end users.


> Le 2/12/08 13:16, « [NOM] » <[ADRESSE]> a écrit :
> 
> > 
> > 
> > * Denis Pousseur <C5582FA7.6648%denis.pousseur@gmail.com> :
> > Wrote on Sun, 30 Nov 2008 11:55:19 +0100:
> > 
> > | When the action-callback is used on a multi-column-list-panel, the
> > | callback returns the item or the item-data and gives me an info on the
> > | row clicked. Is it a way to get also an info on the column clicked ?
> > 
> > The following callback worked on windows with an earlier lw version. It
> > failed/would not work the motif backend where IIRC I figured it was not
> > possible and gave up --- I'm also looking for a real solution though.
> > 
> > ;; Assuming your interface has a slot called mclp
> > (lambda (data intf)
> >   (multiple-value-bind (x y)
> >       (capi:current-pointer-position :relative-to intf)
> >     (with-slots (mclp) intf
> >       (let* ((hpos (capi:get-scroll-position mclp :horizontal))
> >     (colno
> >      (let ((widths
> >     (map 'list #'car (capi::list-panel-column-info mclp))))
> > (loop with needle = (+ hpos x)
> >      for beg = 0 then total-width
> >      for colno from 0
> >      for width in widths
> >      summing width into total-width
> >      if (<= beg needle total-width) return colno))))
> > (capi:display-message
> > "The arguments were data(arg1) ~S and intf(arg2) ~S
> > Mouse Position is: ~S ~S.
> > Scroll: ~S
> > Column: is ~S"
> > data intf x y hpos colno)))))
> > 
> > --
> > Madhu
> > 
> 
> -------------------------------------------------------
> Denis Pousseur
> 70 rue de Wansijn
> 1180 Bruxelles, Belgique
> 
> Tel : 32 (0)2 219 31 09
> Mail :  denis.pousseur@gmail.com
> -------------------------------------------------------
> 
> 

-- 
Martin Simmons
LispWorks Ltd
http://www.lispworks.com/


Re: capi:Multi-column-list-panel

Hi Martin,

> I need post the usual caveat here: using undocumented internals of CAPI (or
> any other LW package) is not something that we support or recommend.

Yes I know. But why not to give us an exported and documented access to the
NSPointers ? It could be a great facilities for some Mac users/developpers
and should be the natural complement of the objc package.

> Do other applications have this column-specific clicking behavior?  If not,
> then you are potentially making your interface confusing for end users.

If the COCOA Application Kit propose the function "columnAtPoint:", I
suppose it's because it has some interest for some people.
For instance, double-clicking in a cell to open a box and change a value is
something extensively used by the Plist editor on mac OS X. Xcode has also
some checkbox in columns. So it doesn't appear very clear to me that this
usage is a source of "confusion" (is it not the contrary ?).

Best regards

Denis

Le 2/12/08 21:56, « [NOM] » <[ADRESSE]> a écrit :

>>>>>> On Tue, 02 Dec 2008 16:50:26 +0100, Denis Pousseur said:
>> 
>> Hi Madhu,
>> 
>> Thanks for your answer. In my version (LWM 5.1) the  capi::column-info slot
>> contains just NIL. I suspect that the CAPI does not memorize the column
>> widths (I do not see any slot witch contains this info) and let this to
>> COCOA (at least on Mac).
>> 
>> On Mac this code returns the column index :
>> 
>> (multiple-value-bind (x y) (capi:current-pointer-position :relative-to mclp)
>>   (let ((NSTableView (sr capi-cocoa-library::main-view
>> (capi-internals:representation mclp))))
>>     (objc:invoke NSTableView "columnAtPoint:" (make-array 2
>> :initial-contents (list x y)))))
> 
> I need post the usual caveat here: using undocumented internals of CAPI (or
> any other LW package) is not something that we support or recommend.
> 
> Do other applications have this column-specific clicking behavior?  If not,
> then you are potentially making your interface confusing for end users.
> 
> 
>> Le 2/12/08 13:16, « [NOM] » <[ADRESSE]> a écrit :
>> 
>>> 
>>> 
>>> * Denis Pousseur <C5582FA7.6648%denis.pousseur@gmail.com> :
>>> Wrote on Sun, 30 Nov 2008 11:55:19 +0100:
>>> 
>>> | When the action-callback is used on a multi-column-list-panel, the
>>> | callback returns the item or the item-data and gives me an info on the
>>> | row clicked. Is it a way to get also an info on the column clicked ?
>>> 
>>> The following callback worked on windows with an earlier lw version. It
>>> failed/would not work the motif backend where IIRC I figured it was not
>>> possible and gave up --- I'm also looking for a real solution though.
>>> 
>>> ;; Assuming your interface has a slot called mclp
>>> (lambda (data intf)
>>>   (multiple-value-bind (x y)
>>>       (capi:current-pointer-position :relative-to intf)
>>>     (with-slots (mclp) intf
>>>       (let* ((hpos (capi:get-scroll-position mclp :horizontal))
>>>     (colno
>>>      (let ((widths
>>>     (map 'list #'car (capi::list-panel-column-info mclp))))
>>> (loop with needle = (+ hpos x)
>>>      for beg = 0 then total-width
>>>      for colno from 0
>>>      for width in widths
>>>      summing width into total-width
>>>      if (<= beg needle total-width) return colno))))
>>> (capi:display-message
>>> "The arguments were data(arg1) ~S and intf(arg2) ~S
>>> Mouse Position is: ~S ~S.
>>> Scroll: ~S
>>> Column: is ~S"
>>> data intf x y hpos colno)))))
>>> 
>>> --
>>> Madhu
>>> 
>> 
>> -------------------------------------------------------
>> Denis Pousseur
>> 70 rue de Wansijn
>> 1180 Bruxelles, Belgique
>> 
>> Tel : 32 (0)2 219 31 09
>> Mail :  denis.pousseur@gmail.com
>> -------------------------------------------------------
>> 
>> 

-------------------------------------------------------
Denis Pousseur
70 rue de Wansijn
1180 Bruxelles, Belgique

Tel : 32 (0)2 219 31 09
Mail :  denis.pousseur@gmail.com
-------------------------------------------------------



Re: capi:Multi-column-list-panel

I have also been working on my first major CAPI application recently,
and my first expectation for multi-column list was that I could either
create (input and checkbox) panes directly inside columns, or at least
popup an editor for cells and have a checkbox for each row.

We are rewriting an application where selecting and marking rows are
two seperate concepts, like in iTunes. It has been very popular among
users.

Best regards,

Mikko Ahonen

On Wed, Dec 3, 2008 at 8:04 PM, Brian Connoy
<BConnoy@morrisonhershfield.com> wrote:
>
> Denis Pousseur <denis.pousseur@gmail.com> writes:
>
>> Hi Martin,
>>
>>> I need post the usual caveat here: using undocumented internals of CAPI (or
>>> any other LW package) is not something that we support or recommend.
>>
>> Yes I know. But why not to give us an exported and documented access to the
>> NSPointers ? It could be a great facilities for some Mac users/developpers
>> and should be the natural complement of the objc package.
>>
>>> Do other applications have this column-specific clicking behavior?  If not,
>>> then you are potentially making your interface confusing for end users.
>>
>> If the COCOA Application Kit propose the function "columnAtPoint:", I
>> suppose it's because it has some interest for some people.
>> For instance, double-clicking in a cell to open a box and change a value is
>> something extensively used by the Plist editor on mac OS X. Xcode has also
>> some checkbox in columns. So it doesn't appear very clear to me that this
>> usage is a source of "confusion" (is it not the contrary ?).
>>
>> Best regards
>>
>> Denis
>
> Hi all,
>
> FWIW, I've been chipping away at my first major CAPI application. My
> very first expectation, on discovering multi-column-list-panel, was the
> ability to double click on individual "fields" and edit values contained
> therein. Got stumped at that point and took a different approach.
>
> My computer exposure has been exclusively MS Windows based.
>
> Brian C.
>
>


Updated at: 2020-12-10 08:41 UTC