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.95 by root, Thu Apr 13 23:31:43 2006 UTC vs.
Revision 1.96 by root, Fri Apr 14 00:15:52 2006 UTC

1616 glPopMatrix; 1616 glPopMatrix;
1617} 1617}
1618 1618
1619############################################################################# 1619#############################################################################
1620 1620
1621package CFClient::UI::Flopper;
1622
1623our @ISA = CFClient::UI::Button::;
1624
1625sub new {
1626 my $class = shift;
1627
1628 my $self = $class->SUPER::new (
1629 state => 0,
1630 connect_activate => \&toggle_flopper,
1631 @_
1632 );
1633
1634 if ($self->{state}) {
1635 $self->{state} = 0;
1636 $self->toggle_flopper;
1637 }
1638
1639 $self
1640}
1641
1642sub toggle_flopper {
1643 my ($self) = @_;
1644
1645 if ($self->{state} = !$self->{state}) {
1646 $CFClient::UI::TOPLEVEL->add ($self->{other});
1647 $self->{other}->move (
1648 ($::WIDTH - $self->{other}{w}) * 0.5,
1649 ($::HEIGHT - $self->{other}{h}) * 0.5,
1650 );
1651 } else {
1652 $CFClient::UI::TOPLEVEL->remove ($self->{other});
1653 }
1654}
1655
1656#############################################################################
1657
1621package CFClient::UI::Toplevel; 1658package CFClient::UI::Toplevel;
1622 1659
1623our @ISA = CFClient::UI::Container::; 1660our @ISA = CFClient::UI::Container::;
1624 1661
1625sub size_request { 1662sub size_request {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines