ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/DC/UI.pm
(Generate patch)

Comparing deliantra/Deliantra-Client/DC/UI.pm (file contents):
Revision 1.340 by root, Sun Jul 30 13:16:44 2006 UTC vs.
Revision 1.343 by root, Sun Aug 13 15:14:17 2006 UTC

6use Scalar::Util (); 6use Scalar::Util ();
7use List::Util (); 7use List::Util ();
8use Event; 8use Event;
9 9
10use CFPlus; 10use CFPlus;
11use CFPlus::Pod;
11use CFPlus::Texture; 12use CFPlus::Texture;
12 13
13our ($FOCUS, $HOVER, $GRAB); # various widgets 14our ($FOCUS, $HOVER, $GRAB); # various widgets
14 15
15our $LAYOUT; 16our $LAYOUT;
1617 #active_bg => none 1618 #active_bg => none
1618 #font => default_font 1619 #font => default_font
1619 #text => initial text 1620 #text => initial text
1620 #markup => initial narkup 1621 #markup => initial narkup
1621 #max_w => maximum pixel width 1622 #max_w => maximum pixel width
1623 #style => 0, # render flags
1622 ellipsise => 3, # end 1624 ellipsise => 3, # end
1623 layout => (new CFPlus::Layout), 1625 layout => (new CFPlus::Layout),
1624 fontsize => 1, 1626 fontsize => 1,
1625 align => -1, 1627 align => -1,
1626 valign => -1, 1628 valign => -1,
1777 }; 1779 };
1778 1780
1779 my $w = List::Util::min $self->{w} + 4, $size->[0]; 1781 my $w = List::Util::min $self->{w} + 4, $size->[0];
1780 my $h = List::Util::min $self->{h} + 2, $size->[1]; 1782 my $h = List::Util::min $self->{h} + 2, $size->[1];
1781 1783
1782 $self->{layout}->render ($self->{ox}, $self->{oy}); 1784 $self->{layout}->render ($self->{ox}, $self->{oy}, $self->{style});
1783} 1785}
1784 1786
1785############################################################################# 1787#############################################################################
1786 1788
1787package CFPlus::UI::EntryBase; 1789package CFPlus::UI::EntryBase;
2977} 2979}
2978 2980
2979sub set_tooltip_from { 2981sub set_tooltip_from {
2980 my ($self, $widget) = @_; 2982 my ($self, $widget) = @_;
2981 2983
2984 $widget->{tooltip} = CFPlus::Pod::section_label tooltip => $1
2985 if $widget->{tooltip} =~ /^#(.*)$/;
2986
2982 my $tooltip = $widget->{tooltip}; 2987 my $tooltip = $widget->{tooltip};
2983 2988
2984 if ($ENV{CFPLUS_DEBUG} & 2) { 2989 if ($ENV{CFPLUS_DEBUG} & 2) {
2985 $tooltip .= "\n\n" . (ref $widget) . "\n" 2990 $tooltip .= "\n\n" . (ref $widget) . "\n"
2986 . "$widget->{x} $widget->{y} $widget->{w} $widget->{h}\n" 2991 . "$widget->{x} $widget->{y} $widget->{w} $widget->{h}\n"
2993 2998
2994 $self->add (new CFPlus::UI::Label 2999 $self->add (new CFPlus::UI::Label
2995 markup => $tooltip, 3000 markup => $tooltip,
2996 max_w => ($widget->{tooltip_width} || 0.25) * $::WIDTH, 3001 max_w => ($widget->{tooltip_width} || 0.25) * $::WIDTH,
2997 fontsize => 0.8, 3002 fontsize => 0.8,
2998 fg => [0, 0, 0, 1], 3003 style => 1, # FLAG_INVERSE
2999 ellipsise => 0, 3004 ellipsise => 0,
3000 font => ($widget->{tooltip_font} || $::FONT_PROP), 3005 font => ($widget->{tooltip_font} || $::FONT_PROP),
3001 ); 3006 );
3002} 3007}
3003 3008

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines