cvsuser     02/04/18 21:36:09

  Modified:    P5EEx/Blue/P5EEx/Blue Widget.pm
  Log:
  remove support for non-implied containers
  
  Revision  Changes    Path
  1.14      +17 -18    p5ee/P5EEx/Blue/P5EEx/Blue/Widget.pm
  
  Index: Widget.pm
  ===================================================================
  RCS file: /cvs/public/p5ee/P5EEx/Blue/P5EEx/Blue/Widget.pm,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -w -r1.13 -r1.14
  --- Widget.pm 5 Apr 2002 22:05:00 -0000       1.13
  +++ Widget.pm 19 Apr 2002 04:36:08 -0000      1.14
  @@ -1,6 +1,6 @@
   
   #############################################################################
  -## $Id: Widget.pm,v 1.13 2002/04/05 22:05:00 spadkins Exp $
  +## $Id: Widget.pm,v 1.14 2002/04/19 04:36:08 spadkins Exp $
   #############################################################################
   
   package P5EEx::Blue::Widget;
  @@ -161,24 +161,23 @@
   
   sub init {
       my ($self, $args) = @_;
  -    my ($name, $absorbable_attribs, $container_name, $container, $attrib);
  +    my ($name, $absorbable_attribs, $container, $container, $attrib);
   
       $name               = $self->{name};
       $absorbable_attribs = $self->absorbable_attribs();
  -    if (!$container_name && $name =~ /^(.*)\.[^\.]+$/) {
  -        $container_name = $1;
  -        $self->{container} = $container_name;
  +    $container          = "session";
  +    if ($name =~ /^(.+)\.[^\.]+$/) {
  +        $container = $1;
       }
   
       # absorb attributes of the container config if ...
       # TODO: sort out whether we need to absorb attributes more often
       #       (i.e. push model rather than a pull model)
   
  -    if ($container_name &&        # ... a container exists
  -        $absorbable_attribs) {    # ... there are known attributes to absorb
  +    if ($absorbable_attribs) {    # ... there are known attributes to absorb
   
           # notice a recursion here on containers
  -        $container = $self->{context}->widget($container_name);
  +        $container = $self->{context}->widget($container);
   
           foreach $attrib (@$absorbable_attribs) {
               if (!defined $self->{$attrib}) {    # incorporate if not set yet
  @@ -217,7 +216,7 @@
   
   sub handle_event {
       my $self = shift;
  -    my ($name, $wc, $container, $w);
  +    my ($name, $context, $container, $w);
       $name = $self->{name};
   
       $self->{context}->dbgprint("Widget($name)->handle_event(@_)")
  @@ -227,18 +226,18 @@
           return 1;
       }
       else {
  -        $container = $self->get("container");
  -        if (defined $container) {
  -            $wc = $self->{context};
  -            return 0 if ($container eq "session");
  -            $w = $wc->widget($container);
  -            return $w->handle_event(@_);  # bubble the event to container widget
  -        }
  -        else {   # handle all known events
  -            $wc = $self->{context};
  -            $wc->add_message("Event not handled: @_\n");
  +        $container = "session";
  +        if ($name =~ /^(.+)\.[^\.]+$/) {
  +            $container = $1;
  +        }
  +        $context = $self->{context};
  +        if ($container eq "session") {
  +            $context = $self->{context};
  +            $context->add_message("Event not handled: @_\n");
               return 0;
           }
  +        $w = $context->widget($container);
  +        return $w->handle_event(@_);  # bubble the event to container widget
       }
   }
   
  
  
  


Reply via email to