Re: Best way to compose panes
I made my simple example with output-pane because simple-pane doesn't accept
to show a colored background, and I didn't understand that you are working
with a so big number of data. In this case you need to make something more
sophisticated : As said Martin, create 1200 output-panes when only maybe 20
or 30 of them will be visible on the screen is not very efficient...
Working with pinboard objects and draw directly the record yourself (for
instance as a subclass of pinboard-object), and draw only the visible
portion of the screen, will certainly be much more efficient. But if you
need CAPI dialogs, like text-input-pane and friends, I don't think it's the
good solution.
But, in this case, the link to YstokGrid sent by Dmitriy seems to be the
right tool for you.
Best regards
Denis
Le 24/03/10 0:11, « [NOM] » <[ADRESSE]> a écrit :
> Thank you so much Denis, i didn't notice layouts were subclasses of panes..
> That's what i get for not playing enough with my copy of Lispworks :P
>
> I will try to tackle my needs with this, i'm still afraid of how this will
> behave with big datasets, running your example with 300 instances of 'myrecord
> takes about 7 seconds to display the interface.
>
>
> Cheers,
>
> Alex Paes
>
>
>
> On Tue, Mar 23, 2010 at 9:43 PM, Denis Pousseur <denis.pousseur@gmail.com>
> wrote:
>> Naturally, layout are panes : for instance pinboard-layout is a subclass of
>> output-pane and layout (You can use the Class browser if you want to have an
>> idea of classes inheritance). To scroll, simply set the init-arguments
>> horizontal-scroll and/or vertical-scroll to T when you create the instance of
>> the layout.
>>
>> With the same exemple replace the last form by this :
>>
>> (capi:contain (make-instance 'capi:row-layout :horizontal-scroll t
>> :description (loop for i from 0 to 3 collect (make-instance 'myrecord))))
>>
>> to get a horizontal scroll-bar
>>
>> Best
>>
>> Denis
>>
>>
>> Le 23/03/10 22:20, « [NOM] » <[ADRESSE]> a écrit :
>>
>>> Hi Denis, thank you for your answer, i tried your example and it looks like
>>> i could use this approach if it wasn't for one problem... scrolling. I tried
>>> some approaches and looking into the capi reference guide i could only find
>>> references to scrolling when dealing with panes. Do you have any idea if
>>> it's possible to have scrolling on layouts as well?
>>>
>>> Cheers,
>>>
>>> Alex Paes
>>>
>>> On Tue, Mar 23, 2010 at 8:28 PM, Denis Pousseur <denis.pousseur@gmail.com>
>>> wrote:
>>>> You can also create a subclass of some type of layout. The initialize
>>>> instance of this new class can set the layout-description automatically as
>>>> you want. After that you can create a layout with some instances of this
>>>> new
>>>> class, one for each record. For instance :
>>>>
>>>> (defclass myrecord (capi:grid-layout) ())
>>>>
>>>> (defmethod initialize-instance :after ((self myrecord) &rest initargs)
>>>> (declare (ignore initargs))
>>>> (setf (capi:layout-description self) (loop for color in '(:red :green
>>>> :blue :black)
>>>> collect (make-instance
>>>> 'capi:output-pane :visible-min-width 50 :visible-max-width t
>>>>
>>>> :visible-min-height 50 :visible-max-height t :background color))))
>>>>
>>>> (capi:contain (make-instance 'capi:row-layout :description (loop for i from
>>>> 0 to 3 collect (make-instance 'myrecord))))
>>>>
>>>> Best
>>>>
>>>> Denis
>>>>
>>>>
>>>> Le 23/03/10 20:56, « [NOM] » <[ADRESSE]> a écrit :
>>>>
>>>>> Hi all,
>>>>>
>>>>> I need to show a list of records where each record should show multiple
>>>>> panes.
>>>>> I looked into LIST-PANEL, LIST-VIEW, MULTI-COLUMN-LIST-PANEL but none
>>>>> seems to
>>>>> allow such behavior. Should I just create an interface class with the
>>>>> desired
>>>>> layout and panes and then create an instance of this interface for each
>>>>> record
>>>>> and add them to some layout?
>>>>>
>>>>> Thanks in advance for the help,
>>>>>
>>>>> Alex Paes
>>>>>
>>>>
>>>>
>>>> -------------------------------------------------------
>>>> 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
>> -------------------------------------------------------
>
>
-------------------------------------------------------
Denis Pousseur
70 rue de Wansijn
1180 Bruxelles, Belgique
Tel : 32 (0)2 219 31 09
Mail : denis.pousseur@gmail.com
-------------------------------------------------------