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.163 by root, Mon Apr 24 06:40:29 2006 UTC vs.
Revision 1.166 by root, Mon Apr 24 08:38:36 2006 UTC

137 137
138sub new { 138sub new {
139 my $class = shift; 139 my $class = shift;
140 140
141 my $self = bless { 141 my $self = bless {
142 x => 0, 142 x => 0,
143 y => 0, 143 y => 0,
144 z => 0, 144 z => 0,
145 can_events => 1, 145 can_events => 1,
146 @_ 146 @_
147 }, $class; 147 }, $class;
148 148
149 for (keys %$self) { 149 for (keys %$self) {
492sub new { 492sub new {
493 my ($class, %arg) = @_; 493 my ($class, %arg) = @_;
494 494
495 my $children = delete $arg{children} || []; 495 my $children = delete $arg{children} || [];
496 496
497 my $self = $class->SUPER::new (children => [], can_events => 0, %arg); 497 my $self = $class->SUPER::new (
498 children => [],
499 can_events => 0,
500 %arg,
501 );
498 $self->add ($_) for @$children; 502 $self->add ($_) for @$children;
499 503
500 $self 504 $self
501} 505}
502 506
748 my $class = shift; 752 my $class = shift;
749 753
750 # TODO: user_x, user_y, overwrite moveto? 754 # TODO: user_x, user_y, overwrite moveto?
751 755
752 my $self = $class->SUPER::new ( 756 my $self = $class->SUPER::new (
753 bg => [1, 1, 1, 1], 757 bg => [1, 1, 1, 1],
754 border_bg => [1, 1, 1, 1], 758 border_bg => [1, 1, 1, 1],
755 border => 0.8, 759 border => 0.8,
756 can_events => 1, 760 can_events => 1,
757 @_ 761 @_
758 ); 762 );
759 763
760 $self->{title} &&= new CFClient::UI::Label 764 $self->{title} &&= new CFClient::UI::Label
1151 1155
1152sub new { 1156sub new {
1153 my ($class, %arg) = @_; 1157 my ($class, %arg) = @_;
1154 1158
1155 my $self = $class->SUPER::new ( 1159 my $self = $class->SUPER::new (
1156 fg => [1, 1, 1], 1160 fg => [1, 1, 1],
1157 #font => default_font 1161 #font => default_font
1158 fontsize => 1, 1162 fontsize => 1,
1159 text => "", 1163 text => "",
1160 align => -1, 1164 align => -1,
1161 valign => -1, 1165 valign => -1,
1162 padding => 2, 1166 padding => 2,
1163 layout => new CFClient::Layout, 1167 layout => new CFClient::Layout,
1164 can_events => 0, 1168 can_events => 0,
1165 %arg 1169 %arg
1166 ); 1170 );
1167 1171
1168 if (exists $self->{template}) { 1172 if (exists $self->{template}) {
1292 1296
1293sub new { 1297sub new {
1294 my $class = shift; 1298 my $class = shift;
1295 1299
1296 $class->SUPER::new ( 1300 $class->SUPER::new (
1297 fg => [1, 1, 1], 1301 fg => [1, 1, 1],
1298 bg => [0, 0, 0, 0.2], 1302 bg => [0, 0, 0, 0.2],
1299 active_bg => [1, 1, 1, 0.5], 1303 active_bg => [1, 1, 1, 0.5],
1300 active_fg => [0, 0, 0], 1304 active_fg => [0, 0, 0],
1301 can_hover => 1, 1305 can_hover => 1,
1302 can_focus => 1, 1306 can_focus => 1,
1303 valign => 0, 1307 valign => 0,
1304 can_events => 1, 1308 can_events => 1,
1305 @_ 1309 @_
1306 ) 1310 )
1307} 1311}
1308 1312
1487 1491
1488sub new { 1492sub new {
1489 my $class = shift; 1493 my $class = shift;
1490 1494
1491 $class->SUPER::new ( 1495 $class->SUPER::new (
1492 padding => 4, 1496 padding => 4,
1493 fg => [1, 1, 1], 1497 fg => [1, 1, 1],
1494 bg => [1, 1, 1, 0.2], 1498 bg => [1, 1, 1, 0.2],
1495 active_fg => [0, 0, 1], 1499 active_fg => [0, 0, 1],
1496 can_hover => 1, 1500 can_hover => 1,
1497 align => 0, 1501 align => 0,
1498 valign => 0, 1502 valign => 0,
1499 can_events => 1, 1503 can_events => 1,
1500 @_ 1504 @_
1501 ) 1505 )
1502} 1506}
1503 1507
1794 1798
1795sub new { 1799sub new {
1796 my ($class, %arg) = @_; 1800 my ($class, %arg) = @_;
1797 1801
1798 my $self = $class->SUPER::new ( 1802 my $self = $class->SUPER::new (
1799 tooltip => $arg{type}, 1803 tooltip => $arg{type},
1800 can_events => 1,
1801 can_hover => 1, 1804 can_hover => 1,
1802 %arg, 1805 %arg,
1803 ); 1806 );
1804 1807
1805 $self->add ($self->{value} = new CFClient::UI::Label valign => +1, align => 0, template => "999"); 1808 $self->add ($self->{value} = new CFClient::UI::Label valign => +1, align => 0, template => "999");
1978 1981
1979sub new { 1982sub new {
1980 my $class = shift; 1983 my $class = shift;
1981 1984
1982 my $self = $class->SUPER::new ( 1985 my $self = $class->SUPER::new (
1983 fontsize => 1, 1986 fontsize => 1,
1987 can_events => 0,
1984 #font => default_font 1988 #font => default_font
1985 @_, 1989 @_,
1986 1990
1987 layout => (new CFClient::Layout), 1991 layout => (new CFClient::Layout),
1988 par => [], 1992 par => [],
1989 height => 0, 1993 height => 0,
1990 children => [ 1994 children => [
1991 (new CFClient::UI::Empty expand => 1), 1995 (new CFClient::UI::Empty expand => 1),
1992 (new CFClient::UI::Slider vertical => 1), 1996 (new CFClient::UI::Slider vertical => 1),
1993 ], 1997 ],
1994 ); 1998 );
1995 1999
2180 2184
2181sub new { 2185sub new {
2182 my $class = shift; 2186 my $class = shift;
2183 2187
2184 my $self = $class->SUPER::new ( 2188 my $self = $class->SUPER::new (
2185 state => 0, 2189 state => 0,
2186 connect_activate => \&toggle_flopper, 2190 connect_activate => \&toggle_flopper,
2187 can_events => 1,
2188 @_ 2191 @_
2189 ); 2192 );
2190 2193
2191 if ($self->{state}) { 2194 if ($self->{state}) {
2192 $self->{state} = 0; 2195 $self->{state} = 0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines