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.336 by root, Sun Jul 23 16:46:06 2006 UTC vs.
Revision 1.338 by root, Mon Jul 24 08:23:28 2006 UTC

2755 $self->{height} = 0; 2755 $self->{height} = 0;
2756 $self->{children}[1]->set_range ([0, 0, 0, 1, 1]); 2756 $self->{children}[1]->set_range ([0, 0, 0, 1, 1]);
2757} 2757}
2758 2758
2759sub add_paragraph { 2759sub add_paragraph {
2760 my ($self, $color, $para, $indent) = @_; 2760 my $self = shift;
2761 2761
2762 my ($text, @w) = ref $para ? @$para : $para; 2762 for my $para (@_) {
2763
2764 $para = { 2763 $para = {
2764 fg => [1, 1, 1, 1],
2765 indent => 0,
2766 markup => "",
2767 widget => [],
2768 ref $para ? %$para : (markup => $para),
2765 w => 1e10, 2769 w => 1e10,
2766 wrapped => 1, 2770 wrapped => 1,
2767 fg => $color,
2768 indent => $indent,
2769 markup => $text,
2770 widget => \@w,
2771 }; 2771 };
2772 2772
2773 $self->add (@w) if @w; 2773 $self->add (@{ $para->{widget} }) if @{ $para->{widget} };
2774 push @{$self->{par}}, $para; 2774 push @{$self->{par}}, $para;
2775 }
2775 2776
2776 $self->{need_reflow}++; 2777 $self->{need_reflow}++;
2777 $self->update; 2778 $self->update;
2778} 2779}
2779 2780
3058 3059
3059############################################################################# 3060#############################################################################
3060 3061
3061package CFClient::UI::Face; 3062package CFClient::UI::Face;
3062 3063
3063our @ISA = CFClient::UI::Base::; 3064our @ISA = CFClient::UI::DrawBG::;
3064 3065
3065use CFClient::OpenGL; 3066use CFClient::OpenGL;
3066 3067
3067sub new { 3068sub new {
3068 my $class = shift; 3069 my $class = shift;
3104 3105
3105sub _draw { 3106sub _draw {
3106 my ($self) = @_; 3107 my ($self) = @_;
3107 3108
3108 return unless $::CONN; 3109 return unless $::CONN;
3110
3111 $self->SUPER::_draw;
3109 3112
3110 my $face; 3113 my $face;
3111 3114
3112 if ($self->{frame}) { 3115 if ($self->{frame}) {
3113 my $anim = $::CONN->{anim}[$self->{anim}]; 3116 my $anim = $::CONN->{anim}[$self->{anim}];
3360 $self->emit (page_changed => $self->{multiplexer}{current}); 3363 $self->emit (page_changed => $self->{multiplexer}{current});
3361} 3364}
3362 3365
3363############################################################################# 3366#############################################################################
3364 3367
3365package CFClient::UI::Combobox; 3368package CFClient::UI::Selector;
3366 3369
3367use utf8; 3370use utf8;
3368 3371
3369our @ISA = CFClient::UI::Button::; 3372our @ISA = CFClient::UI::Button::;
3370 3373
3940 $h = 0 if $h < 0; 3943 $h = 0 if $h < 0;
3941 3944
3942 $w = max $widget->{min_w}, $w; 3945 $w = max $widget->{min_w}, $w;
3943 $h = max $widget->{min_h}, $h; 3946 $h = max $widget->{min_h}, $h;
3944 3947
3948# $w = min $self->{w} - $widget->{x}, $w if $self->{w};
3949# $h = min $self->{h} - $widget->{y}, $h if $self->{h};
3950
3945 $w = min $widget->{max_w}, $w if exists $widget->{max_w}; 3951 $w = min $widget->{max_w}, $w if exists $widget->{max_w};
3946 $h = min $widget->{max_h}, $h if exists $widget->{max_h}; 3952 $h = min $widget->{max_h}, $h if exists $widget->{max_h};
3947 3953
3948 $w = int $w + 0.5; 3954 $w = int $w + 0.5;
3949 $h = int $h + 0.5; 3955 $h = int $h + 0.5;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines