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

Comparing deliantra/Deliantra-Client/DC/UI/ChatView.pm (file contents):
Revision 1.10 by root, Sat Sep 1 07:22:21 2007 UTC vs.
Revision 1.11 by root, Wed Dec 26 20:46:39 2007 UTC

1package CFPlus::UI::ChatView; 1package dc::UI::ChatView;
2 2
3use strict; 3use strict;
4use utf8; 4use utf8;
5 5
6our @ISA = CFPlus::UI::Dockable::; 6our @ISA = dc::UI::Dockable::;
7 7
8sub new { 8sub new {
9 my $class = shift; 9 my $class = shift;
10 10
11 my $self = $class->SUPER::new ( 11 my $self = $class->SUPER::new (
12 @_, 12 @_,
13 can_close => 1, 13 can_close => 1,
14 child => (my $vbox = new CFPlus::UI::VBox), 14 child => (my $vbox = new dc::UI::VBox),
15 ); 15 );
16 16
17 $vbox->add ($self->{txt} = new CFPlus::UI::TextScroller ( 17 $vbox->add ($self->{txt} = new dc::UI::TextScroller (
18 expand => 1, 18 expand => 1,
19 font => $::FONT_FIXED, 19 font => $::FONT_FIXED,
20 fontsize => $::CFG->{log_fontsize}, 20 fontsize => $::CFG->{log_fontsize},
21 indent => -4, 21 indent => -4,
22 can_hover => 1, 22 can_hover => 1,
26 $self->{text_tooltip} 26 $self->{text_tooltip}
27 || "<b>Server Log</b>. This text viewer contains all recent messages " 27 || "<b>Server Log</b>. This text viewer contains all recent messages "
28 ."sent by the server.", 28 ."sent by the server.",
29 )); 29 ));
30 30
31 $vbox->add (my $hb = CFPlus::UI::HBox->new); 31 $vbox->add (my $hb = dc::UI::HBox->new);
32 32
33 if ($self->{say_command}) { 33 if ($self->{say_command}) {
34 $hb->add (CFPlus::UI::Label->new (markup => $self->{say_command})); 34 $hb->add (dc::UI::Label->new (markup => $self->{say_command}));
35 } 35 }
36 36
37 $hb->add ($self->{input} = CFPlus::UI::Entry->new ( 37 $hb->add ($self->{input} = dc::UI::Entry->new (
38 expand => 1, 38 expand => 1,
39 tooltip => 39 tooltip =>
40 $self->{entry_tooltip} 40 $self->{entry_tooltip}
41 || "<b>Command Entry</b>. If you enter something and press return/enter here, " 41 || "<b>Command Entry</b>. If you enter something and press return/enter here, "
42 . "the line you entered will be sent to the server as a command.", 42 . "the line you entered will be sent to the server as a command.",
75 on_key_down => sub { 75 on_key_down => sub {
76 my ($input, $ev) = @_; 76 my ($input, $ev) = @_;
77 my $uni = $ev->{unicode}; 77 my $uni = $ev->{unicode};
78 my $mod = $ev->{mod}; 78 my $mod = $ev->{mod};
79 79
80 if ($uni >= ord "0" && $uni <= ord "9" && $mod & CFPlus::KMOD_ALT) { 80 if ($uni >= ord "0" && $uni <= ord "9" && $mod & dc::KMOD_ALT) {
81 $::MAPWIDGET->emit (key_down => $ev); 81 $::MAPWIDGET->emit (key_down => $ev);
82 return 1; 82 return 1;
83 } 83 }
84 84
85 0 85 0

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines