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.337 by root, Mon Jul 24 04:24:43 2006 UTC vs.
Revision 1.339 by root, Sun Jul 30 12:15:19 2006 UTC

96 96
97sub feed_sdl_button_down_event { 97sub feed_sdl_button_down_event {
98 my ($ev) = @_; 98 my ($ev) = @_;
99 my ($x, $y) = ($ev->{x}, $ev->{y}); 99 my ($x, $y) = ($ev->{x}, $ev->{y});
100 100
101 unless ($BUTTON_STATE) { 101 $BUTTON_STATE |= 1 << ($ev->{button} - 1);
102
103 unless ($GRAB) {
102 my $widget = $ROOT->find_widget ($x, $y); 104 my $widget = $ROOT->find_widget ($x, $y);
103 105
104 $GRAB = $widget; 106 $GRAB = $widget;
105 $GRAB->update if $GRAB; 107 $GRAB->update if $GRAB;
106 108
107 $TOOLTIP_WATCHER->cb->(); 109 $TOOLTIP_WATCHER->cb->();
108 } 110 }
109
110 $BUTTON_STATE |= 1 << ($ev->{button} - 1);
111 111
112 if ($GRAB) { 112 if ($GRAB) {
113 if ($ev->{button} == 4 || $ev->{button} == 5) { 113 if ($ev->{button} == 4 || $ev->{button} == 5) {
114 # mousewheel 114 # mousewheel
115 $ev->{dx} = 0; 115 $ev->{dx} = 0;
1294 my ($self, $ev, $x, $y) = @_; 1294 my ($self, $ev, $x, $y) = @_;
1295 1295
1296 $self->{motion}->($ev, $x, $y) if $self->{motion}; 1296 $self->{motion}->($ev, $x, $y) if $self->{motion};
1297 1297
1298 ! ! $self->{motion} 1298 ! ! $self->{motion}
1299}
1300
1301sub invoke_visibility_change {
1302 my ($self, $visible) = @_;
1303
1304 delete $self->{motion} unless $visible;
1305
1306 0
1299} 1307}
1300 1308
1301sub _draw { 1309sub _draw {
1302 my ($self) = @_; 1310 my ($self) = @_;
1303 1311
2755 $self->{height} = 0; 2763 $self->{height} = 0;
2756 $self->{children}[1]->set_range ([0, 0, 0, 1, 1]); 2764 $self->{children}[1]->set_range ([0, 0, 0, 1, 1]);
2757} 2765}
2758 2766
2759sub add_paragraph { 2767sub add_paragraph {
2760 my ($self, $color, $para, $indent) = @_; 2768 my $self = shift;
2761 2769
2762 my ($text, @w) = ref $para ? @$para : $para; 2770 for my $para (@_) {
2763
2764 $para = { 2771 $para = {
2772 fg => [1, 1, 1, 1],
2773 indent => 0,
2774 markup => "",
2775 widget => [],
2776 ref $para ? %$para : (markup => $para),
2765 w => 1e10, 2777 w => 1e10,
2766 wrapped => 1, 2778 wrapped => 1,
2767 fg => $color,
2768 indent => $indent,
2769 markup => $text,
2770 widget => \@w,
2771 }; 2779 };
2772 2780
2773 $self->add (@w) if @w; 2781 $self->add (@{ $para->{widget} }) if @{ $para->{widget} };
2774 push @{$self->{par}}, $para; 2782 push @{$self->{par}}, $para;
2783 }
2775 2784
2776 $self->{need_reflow}++; 2785 $self->{need_reflow}++;
2777 $self->update; 2786 $self->update;
2778} 2787}
2779 2788

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines