Prima
view release on metacpan or search on metacpan
Prima/Docks.pm view on Meta::CPAN
$caps{position} = [ @$pos] if $pos;
$caps{self} = $self;
$sid = $dm-> open_session( \%caps);
}
}
$self-> {sessions}-> {$dm} = $sid;
} else {
$sid = $self-> {sessions}-> {$dm};
}
return unless $sid;
my $relocationCount;
AGAIN:
#print "{$dm:@$pos:";
my @retval;
my @rc = $dm-> query( $sid, $pos ? @$pos : ());
#print "(@rc)\n";
goto EXIT unless scalar @rc;
if ( 4 == scalar @rc) { # rect returned
my $sd = $self-> {snapDistance};
if ( $pos && defined($sd)) {
if ( $self-> {drag} &&
Prima/Docks.pm view on Meta::CPAN
my $pdist = $lb ? $pp[$a] - $$pos[$a] : $$pos[$b] - $pp[$a];
my $sz1 = $rc[$b] - $rc[$a];
if ( $sz1 <= $pdist * 2) {
$newpos[$a] = $pp[$a] - int( $sz1/2);
} else {
$newpos[$a] = $lb ? ( $pp[$a] - $pdist) : ( $pp[$a] + $pdist - $sz1);
}
$newpos[$b] = $newpos[$a] + $sz1;
}
# asking for the new position for the shape, if $dm can accept that...
if ( 2 >= $relocationCount++) {
#print "case1: @newpos\n";
$pos = \@newpos;
goto AGAIN;
}
} elsif ( $self-> {drag} && ( # have to change the position
( $$pos[0] != $rc[0]) || ( $$pos[1] != $rc[1]))) {
my @pp = $::application-> pointerPos;
my @newpos = @pp;
#print ',';
for ( 0, 1) {
my ( $a, $b) = ( $_, $_ + 2);
$newpos[$a] = $rc[$a] if $newpos[$a] < $rc[$a];
$newpos[$a] = $rc[$b] if $newpos[$a] > $rc[$b];
}
goto EXIT if ( $sd < abs($pp[0] - $newpos[0])) || ( $sd < abs($pp[1] - $newpos[1]));
# asking for the new position, and maybe new shape...
if ( 2 >= $relocationCount++) {
#print "case2: @rc\n";
$pos = [@rc];
goto AGAIN;
}
}
goto EXIT if ($sd < abs($rc[0] - $$pos[0])) || ($sd < abs($rc[1] - $$pos[1]));
}
goto EXIT unless $self-> notify(q(Landing), $dm, @rc);
#print "@rc\n";
@retval = ($dm, \@rc);
Prima/Docks.pm view on Meta::CPAN
Docks to the recent dock widget, if it is still available.
=item drag STATE, RECT, ANCHOR_X, ANCHOR_Y
Initiates or aborts the dragging session, depending on STATE boolean
flag.
If it is 1, RECT is an array with the coordinates of the shuttle rectangle
before the drag has started; ANCHOR_X and ANCHOR_Y are coordinates of the
aperture point where the mouse event occurred that has initiated the drag.
Depending on how the drag session ended, the shuttle can be relocated to
another dock, undocked, or left intact. Also, C<Dock>, C<Undock>, or
C<FailDock> notifications can be triggered.
If STATE is 0, RECT, ANCHOR_X ,and ANCHOR_Y parameters are not used.
=item find_docking DOCK, [ POSITION ]
Opens a session with DOCK, unless it is already opened,
and negotiates about the possibility of landing (
at particular POSITION, if this parameter is present ).
Prima/VB/prima-cfgmaint.pl view on Meta::CPAN
parameter, it is treated as a page name and only widgets from
the page are printed.
=item r
Renames an object to a new name, which is passed as additional parameter.
Can be either a widget or a page.
=item m
If C<object> is a widget, relocates one or more widgets to a new page.
If C<object> is a page, moves the page before the page specified as an additional parameter,
or to the end if no additional page specified.
=back
=head1 EXAMPLE
Add a new module to the system-wide configuration:
cfgmaint -r a m CPAN/Prima/VB/New/MyCtrls.pm
( run in 1.291 second using v1.01-cache-2.11-cpan-5511b514fd6 )