PDA

View Full Version : INPUT.List and overlayRef -> display hash



Triode
2005-08-27, 13:56
I've been looking at how overlays are identfied for input lists and was wondering whether something which allowed more of the
display hash would be appropriate going forward.

My proposal would be to add a new hash elements to the input list params: baseDisplayRef & baseDisplayRefArgs which would acts like
overlayRef but define a display hash which is used as the base of the display [with input list defining line1 and line2]. This
would allow users of INPUT.List to force the font, scrollmode and overlays and possibly centered text & bitmap for the input list
display.

As most INPUT.List calls specify a function today, I would expect it to be used as:

$params->{'baseDisplayRef'} = sub {
my $client = shift;
return {
'overlay2' => $client->symbols('notesymbol'),
'scrollmode' => 'noscroll',
'fonts' => {
'graphic-320x32' => 'standard',
'graphic-280x16' => 'small',
'text' => 2
};
}

Views?

Adrian

dean
2005-08-27, 14:16
I like it.

On Aug 27, 2005, at 1:56 PM, Triode wrote:

> I've been looking at how overlays are identfied for input lists and
> was wondering whether something which allowed more of the display
> hash would be appropriate going forward.
>
> My proposal would be to add a new hash elements to the input list
> params: baseDisplayRef & baseDisplayRefArgs which would acts like
> overlayRef but define a display hash which is used as the base of
> the display [with input list defining line1 and line2]. This would
> allow users of INPUT.List to force the font, scrollmode and
> overlays and possibly centered text & bitmap for the input list
> display.
>
> As most INPUT.List calls specify a function today, I would expect
> it to be used as:
>
> $params->{'baseDisplayRef'} = sub {
> my $client = shift;
> return {
> 'overlay2' => $client->symbols('notesymbol'),
> 'scrollmode' => 'noscroll',
> 'fonts' => {
> 'graphic-320x32' => 'standard',
> 'graphic-280x16' => 'small',
> 'text' => 2
> };
> }
>
> Views?
>
> Adrian
>

Grotus
2005-08-28, 20:02
Sounds good to me too, how would this work exactly? Would we call
baseDisplayRef first and then set the lines part with the standard
INPUT.List stuff and possibly the overlay with the overlayRef?

dean blackketter blurted out:
> I like it.
>
> On Aug 27, 2005, at 1:56 PM, Triode wrote:
>
>> I've been looking at how overlays are identfied for input lists and
>> was wondering whether something which allowed more of the display
>> hash would be appropriate going forward.
>>
>> My proposal would be to add a new hash elements to the input list
>> params: baseDisplayRef & baseDisplayRefArgs which would acts like
>> overlayRef but define a display hash which is used as the base of the
>> display [with input list defining line1 and line2]. This would allow
>> users of INPUT.List to force the font, scrollmode and overlays and
>> possibly centered text & bitmap for the input list display.
>>
>> As most INPUT.List calls specify a function today, I would expect it
>> to be used as:
>>
>> $params->{'baseDisplayRef'} = sub {
>> my $client = shift;
>> return {
>> 'overlay2' => $client->symbols('notesymbol'),
>> 'scrollmode' => 'noscroll',
>> 'fonts' => {
>> 'graphic-320x32' => 'standard',
>> 'graphic-280x16' => 'small',
>> 'text' => 2
>> };
>> }
>>
>> Views?
>>
>> Adrian

Triode
2005-08-29, 03:59
> Sounds good to me too, how would this work exactly? Would we call baseDisplayRef first and then set the lines part with the
> standard INPUT.List stuff and possibly the overlay with the overlayRef?
>

My current proposal would be to call baseDisplayRef and then set add line1/line2 to this in input list. If baseDisplayRef returns
undef then create a new display hash and add overlays based on overlayRef, i.e. over time I would expect overlays to be defined by
the baseDisplayRef rather than overlayRef.

Are there cases you can think of where it would be beneficial to encode the overlays separately in overlayRef..?

Current List.pm lines code for something like this I've been playing with is:

my $display = getExtVal($client,$listRef->[$listIndex],$listIndex,'baseDisplayRef');
if (defined($display)) {
$display->{line1} = $line1;
$display->{line2} = $line2;
return $display;
} else {
my @overlay = getExtVal($client,$listRef->[$listIndex],$listIndex,'overlayRef');
return {
'line1' => $line1,
'line2' => $line2,
'overlay1' => exists($overlay[0]) ? $client->symbols($overlay[0]) : undef,
'overlay2' => exists($overlay[1]) ? $client->symbols($overlay[1]) : undef,
};
}