home *** CD-ROM | disk | FTP | other *** search
/ Netrunner 2004 October / NETRUNNER0410.ISO / regular / ActivePerl-5.8.4.810-MSWin32-x86.msi / _cdde65791a2e7d4e604fece231b687c6 < prev    next >
Encoding:
Text File  |  2004-06-01  |  1.2 KB  |  51 lines

  1. # NOTE: Derived from blib\lib\Tk\Wm.pm.
  2. # Changes made here will be lost when autosplit is run again.
  3. # See AutoSplit.pm.
  4. package Tk::Wm;
  5.  
  6. #line 96 "blib\lib\Tk\Wm.pm (autosplit into blib\lib\auto\Tk\Wm\Popup.al)"
  7. sub Popup
  8. {
  9.  my $w = shift;
  10.  $w->configure(@_) if @_;
  11.  $w->idletasks;
  12.  my ($mw,$mh) = ($w->reqwidth,$w->reqheight);
  13.  my ($rx,$ry,$rw,$rh) = (0,0,0,0);
  14.  my $base    = $w->cget('-popover');
  15.  my $outside = 0;
  16.  if (defined $base)
  17.   {
  18.    if ($base eq 'cursor')
  19.     {
  20.      ($rx,$ry) = $w->pointerxy;
  21.     }
  22.    else
  23.     {
  24.      $rx = $base->rootx;
  25.      $ry = $base->rooty;
  26.      $rw = $base->Width;
  27.      $rh = $base->Height;
  28.     }
  29.   }
  30.  else
  31.   {
  32.    my $sc = ($w->parent) ? $w->parent->toplevel : $w;
  33.    $rx = -$sc->vrootx;
  34.    $ry = -$sc->vrooty;
  35.    $rw = $w->screenwidth;
  36.    $rh = $w->screenheight;
  37.   }
  38.  my ($X,$Y) = AnchorAdjust($w->cget('-overanchor'),$rx,$ry,$rw,$rh);
  39.  ($X,$Y)    = AnchorAdjust($w->cget('-popanchor'),$X,$Y,-$mw,-$mh);
  40.  # adjust to not cross screen borders
  41.  if ($X < 0) { $X = 0 }
  42.  if ($Y < 0) { $Y = 0 }
  43.  if ($mw > $w->screenwidth)  { $X = 0 }
  44.  if ($mh > $w->screenheight) { $Y = 0 }
  45.  $w->Post($X,$Y);
  46.  $w->waitVisibility;
  47. }
  48.  
  49. # end of Tk::Wm::Popup
  50. 1;
  51.