view release on metacpan or search on metacpan
lib/Games/Sudoku/Preset.pm view on Meta::CPAN
my ($fieldID) = shift; # ID of button to be covered
# ignore re-entering the active field
# (this happens when withdrawing the clickfield)
# Color change and popup required when returning from the bottom row,
# so no return to caller in this case
return
if ( $fieldID == ( 'Cell'->activefield() || 0 )
and $clickfield->state eq 'normal' );
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Gantry/Plugins/Calendar.pm view on Meta::CPAN
# prepend document. to form_id id is not specified
if ( $form_id !~ /^document\./i ) {
$form_id = 'document.' . $form_id;
}
my $popup_url = $site->location . "/calendar_month/";
return( qq!
<script type="text/javascript">
function SetDate(field, date) {
eval( '${form_id}.' + field + '.value = date;' );
}
function datepopup(name) {
window.open('$popup_url'+name, 'Shortcut',
'height=250,width=250' +
',screenX=' + (window.screenX+150) +
',screenY=' + (window.screenY+100) +
',scrollbars,resizable' );
lib/Gantry/Plugins/Calendar.pm view on Meta::CPAN
calendar_month_js creates two Javascript functions:
=over 4
=item datepopup(form_name)
makes the calendar window popup.
=item SetDate(field_name, date)
sets the date when the user clicks on a date in the popup window.
=back
You must pass the name of the form to calendar_month_js, otherwise
its Javascript won't be able to tell the name to the popup window,
which will then be unable to set any dates on your form.
do_calendar_month is the method called by the handler when the window
pops up. It generates the calendar and manages user interaction with
it. It relies on the internal _calendar_month to make the actual
output. When the user clicks on a date, its Javascript first
calls SetDate with the field name and the date value
and then closes the popup window.
=head1 FUNCTIONS
The other functions are not directly useful to normal callers
but here is a complete list.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Gapp/Menu.pm view on Meta::CPAN
}
}
}
sub popup {
my ( $self, @args ) = @_;
$self->run_visible_funcs;
$self->gobject->popup( @args );
}
__END__
view all matches for this distribution
view release on metacpan or search on metacpan
t/sandbox/usr/portage/app-shells/tcsh/files/tcsh-complete view on Meta::CPAN
hiddenlinks= historical homepage= image_links index= \
ismap link= localhost mime_header minimal \
newschunksize= newsmaxchunk= nobrowse nocc nocolor \
nofilereferer nolist nolog nopause noprint noredir \
noreferer nostatus number_links partial partial_thres \
pauth= popup post_data preparsed print pseudo_inlines \
raw realm reload restrictions= resubmit_posts rlogin \
selective show_cursor soft_dquotes source stack_dump \
startfile_ok tagsoup telnet term= tlog trace traversal \
underscore useragent= validate verbose version vikeys \
width=)/' 'c/(http|ftp)/$URLS/' 'p/*/f:*.{html,htm,shtml}/'
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Geo/FIT.pm view on Meta::CPAN
2 => +{'name' => 'enabled', 'type_name' => 'bool'},
3 => +{'name' => 'alarm_type', 'type_name' => 'dive_alarm_type'},
4 => +{'name' => 'sound', 'type_name' => 'tone'},
5 => +{'name' => 'dive_types', 'type_name' => 'sub_sport'},
6 => +{ 'name' => 'id' }, # Alarm ID
7 => +{ 'name' => 'popup_enabled', 'type_name' => 'bool' }, # Show a visible pop-up for this alarm
8 => +{ 'name' => 'trigger_on_descent', 'type_name' => 'bool' }, # Trigger the alarm on descent
9 => +{ 'name' => 'trigger_on_ascent', 'type_name' => 'bool' }, # Trigger the alarm on ascent
10 => +{ 'name' => 'repeating', 'type_name' => 'bool' }, # Repeat alarm each time threshold is crossed?
11 => +{ 'name' => 'speed', 'scale' => 1000 }, # Ascent/descent rate (mps) setting for speed type alarms
},
lib/Geo/FIT.pm view on Meta::CPAN
2 => +{ 'name' => 'enabled', 'type_name' => 'bool' }, # Enablement flag
3 => +{ 'name' => 'alarm_type', 'type_name' => 'dive_alarm_type' }, # Alarm type setting
4 => +{ 'name' => 'sound', 'type_name' => 'tone' }, # Tone and Vibe setting for the alarm.
5 => +{ 'name' => 'dive_types', 'type_name' => 'sub_sport' }, # Dive types the alarm will trigger on
6 => +{ 'name' => 'id' }, # Alarm ID
7 => +{ 'name' => 'popup_enabled', 'type_name' => 'bool' }, # Show a visible pop-up for this alarm
8 => +{ 'name' => 'trigger_on_descent', 'type_name' => 'bool' }, # Trigger the alarm on descent
9 => +{ 'name' => 'trigger_on_ascent', 'type_name' => 'bool' }, # Trigger the alarm on ascent
10 => +{ 'name' => 'repeating', 'type_name' => 'bool' }, # Repeat alarm each time threshold is crossed?
11 => +{ 'name' => 'speed', 'unit' => 'mps', 'scale' => 1000 }, # Ascent/descent rate (mps) setting for speed type alarms
},
view all matches for this distribution
view release on metacpan or search on metacpan
example/quick-start-example.pl view on Meta::CPAN
my $map = Geo::Leaflet->new(center=>[51.505, -0.09], zoom=>13, width=>'100%', height=>'100%');
$map->marker( lat => 51.5,
lon => -0.09,
popup => 'marker popup',
tooltip => "marker tooltip");
$map->circle( lat => 51.508,
lon => -0.11,
radius => 500,
options => {color=>'red', fillColor=>'#f03', fillOpacity=>0.5},
popup => 'circle popup',
tooltip => 'circle tooltip');
$map->polygon( coordinates => [[51.509, -0.08], [51.503, -0.06], [51.51, -0.047]],
options => {color=>"blue"},
popup => 'polygon popup',
tooltip => 'polygon tooltip');
$map->polyline(coordinates => [[51.508, -0.08], [51.502, -0.06], [51.50, -0.047]],
options => {color=>"green"},
popup => 'polyline popup',
tooltip => 'polyline tooltip');
$map->rectangle(llat => 51.496,
llon => -0.08,
ulat => 51.500,
ulon => -0.047,
options => {color=>"orange"},
popup => 'rectangle popup',
tooltip => 'rectangle tooltip');
my $icon = $map->icon(
options => {
iconUrl => 'https://maps.google.com/mapfiles/kml/paddle/1.png',
iconSize => [64, 64],
iconAnchor => [32, 64],
popupAnchor => [0, -48],
tooltipAnchor => [0,-48],
},
);
$map->marker( lat => 51.498,
lon => -0.10,
popup => 'marker icon popup',
tooltip => "marker icon tooltip",
options => {
icon => $icon->name,
},
);
example/quick-start-example.pl view on Meta::CPAN
icon_name => "bicycle", #defaults icon_set = fa, icon_size = 48, iconAnchor ~ [middle]
);
$map->marker( lat => 51.498,
lon => -0.12,
popup => 'marker divIcon popup',
tooltip => "marker divIcon tooltip",
options => {
icon => $divIcon->name,
},
);
example/quick-start-example.pl view on Meta::CPAN
},
);
$map->marker( lat => 51.498,
lon => -0.105,
popup => 'icon_map_marker',
tooltip => "icon_map_marker",
options => {
icon => $icon_map_marker->name,
},
);
example/quick-start-example.pl view on Meta::CPAN
},
);
$map->marker( lat => 51.498,
lon => -0.11,
popup => 'icon_dot_circle',
tooltip => "icon_dot_circle",
options => {
icon => $icon_dot_circle->name,
},
);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Getopt/Long/CGI.pm view on Meta::CPAN
print $cgi->start_div({-id => "__opt_$name", -class => "setOption"});
print $cgi->h2($name);
if (($modifier || "") eq '+') {
die "Cannot mix + and params" if $value_type;
print $cgi->label("Value for option:", $cgi->popup_menu(-name => $name, -values => [1..9]));
} elsif (($modifier || "") eq '!') {
die "Cannot mix ! and params" if $value_type;
print $cgi->checkbox(-name => $name, -checked => 1, -label => "Activate this option");
} elsif ($value_type) {
if (($modifier || "") eq '%' or ref($val) eq 'HASH') {
view all matches for this distribution
view release on metacpan or search on metacpan
Glade/Two/Generate.pm view on Meta::CPAN
# We probably have a parent to pack into somehow
eval "\$refpar = (ref ${current_form}\{'$parentname'})||'UNDEFINED !!';";
$Glade_Perl->diag_print(5, "Adding %s to %s", $refwid, $refpar);
unless (eval "exists ${current_form}\{'$parentname'}") {
if ($Glade_Perl->source->quick_gen or 'Gtk2::Menu' eq $refwid) {
# We are a popup menu so we don't have a root window
# $class->add_to_UI($depth, "${first_form}->popup_enable;");
$class->add_to_UI($depth,
"${current_form}\{'tooltips'} = new Gtk2::Tooltips;");
$class->add_to_UI($depth,
"${current_form}\{'accelgroup'} = new Gtk2::AccelGroup;");
$class->add_to_UI($depth,
Glade/Two/Generate.pm view on Meta::CPAN
},
'GtkMenuItem' => {
'right_justify' => $OBSOLETE,
},
'GtkNotebook' => {
'popup_enable' => 'enable-popup',
},
'GtkOptionMenu' => {
'initial_choice' => 'history',
},
'GtkPacker' => {
view all matches for this distribution
view release on metacpan or search on metacpan
Glade/PerlUI.pm view on Meta::CPAN
} else {
# We probably have a parent to pack into somehow
eval "\$refpar = (ref ${current_form}\{'$parentname'})||'UNDEFINED !!';";
unless (eval "exists ${current_form}\{'$parentname'}") {
if ($Glade_Perl->source->quick_gen or 'Gtk::Menu' eq $refwid) {
# We are a popup menu so we don't have a root window
# $class->add_to_UI( $depth, "${first_form}->popup_enable;" );
$class->add_to_UI($depth,
"${current_form}\{'tooltips'} = new Gtk::Tooltips;" );
$class->add_to_UI($depth,
"${current_form}\{'accelgroup'} = new Gtk::AccelGroup;" );
$class->add_to_UI( $depth,
view all matches for this distribution
view release on metacpan or search on metacpan
t/widget_allocation.t view on Meta::CPAN
#-----------------------------------------------------------------------------
# windowed DrawingArea widget
{
my $toplevel = Gtk2::Window->new('popup');
my $fixed = Gtk2::Fixed->new;
$toplevel->add ($fixed);
my $draw = Gtk2::DrawingArea->new;
t/widget_allocation.t view on Meta::CPAN
package MyNoWindow;
use Glib::Object::Subclass 'Gtk2::Widget';
}
{
my $toplevel = Gtk2::Window->new('popup');
my $fixed = Gtk2::Fixed->new;
$toplevel->add ($fixed);
my $nowin = Gtk2::DrawingArea->new;
view all matches for this distribution
view release on metacpan or search on metacpan
ChangeLog.pre-git view on Meta::CPAN
way, though)
* Gtk2/xs/GtkItemFactory.xs: bracket callback with ENTER/SAVETMPS &
FREETMPS/LEAVE
* Gtk2/xs/GtkMenu.xs: implemented gtk_menu_popup
* Gtk2/xs/GtkTreeModel.xs: it's possible for gtk_tree_model_iter_next
to return NULL
* Gtk2/xs/GtkTreeView.xs: implemented
view all matches for this distribution
view release on metacpan or search on metacpan
examples/perl-applet view on Meta::CPAN
if ($iid ne 'OAFIID:PerlSampleApplet') {
return FALSE;
}
my $menu_xml = <<EOX;
<popup name="button3">
<menuitem name="Properties Item"
verb="Properties"
_label="Properties ..."
pixtype="stock"
pixname="gtk-properties"/>
examples/perl-applet view on Meta::CPAN
<menuitem name="About Item"
verb="About"
_label="About ..."
pixtype="stock"
pixname="gnome-stock-about"/>
</popup>
EOX
my $cb_mapping = {
Properties => [\&properties_callback, 'default!'],
Help => \&help_callback,
view all matches for this distribution
view release on metacpan or search on metacpan
=item gnome_program_get
Gnome2::Program->get has been renamed to ->get_program to avoid a clash with
GObject->get.
=item gnome_popup_menu_attach
Gtk2::Menu->attach has been renamed to ->attach_to to avoid a clash with
gtk_menu_attach.
=item gnome_popup_menu_append
Gtk2::Menu->append has been renamed to ->append_from to avoid a clash with
gtk_menu_shell_append.
=back
view all matches for this distribution
view release on metacpan or search on metacpan
t/unit/Test/Google/RestApi/CalendarApi3/CalendarList.pm.exchanges view on Meta::CPAN
"foregroundColor": "#000000",
"selected": true,
"accessRole": "owner",
"defaultReminders": [
{
"method": "popup",
"minutes": 30
}
],
"notificationSettings": {
"notifications": [
view all matches for this distribution
view release on metacpan or search on metacpan
docs/_includes/navbar-content.en.html view on Meta::CPAN
<li><a href="{{ site.baseurl }}/news/">News</a></li>
<li class="dropdown">
<a class="dropdown-toggle"
data-toggle="dropdown"
role="button"
aria-haspopup="true"
aria-expanded="false">
Documents <span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li><a href="{{ site.baseurl }}/install/">Install</a></li>
view all matches for this distribution
view release on metacpan or search on metacpan
Gtk/samples/gslide.pl view on Meta::CPAN
$started = 0;
Gtk->main_quit;
});
$m->append($mi);
}
$m->popup(undef, undef, 3, 0, undef);
}
__DATA__
################# load needed resources
eval $fsize = int ($height*.6)
view all matches for this distribution
view release on metacpan or search on metacpan
h = newHV();
pGtkType[48] = h;
pGtkTypeName[48] = "Gtk::WindowType";
hv_store(h, "toplevel", 8, newSViv(GTK_WINDOW_TOPLEVEL), 0);
hv_store(h, "dialog", 6, newSViv(GTK_WINDOW_DIALOG), 0);
hv_store(h, "popup", 5, newSViv(GTK_WINDOW_POPUP), 0);
hv_store(pG_EnumHash, "Gtk::WindowType", 15, newRV((SV*)h), 0);
SvREFCNT_dec(h);
h = newHV();
pGtkType[49] = h;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Gtk2/AppIndicator.pm view on Meta::CPAN
Returns the current state of the application indicator.
$ind->set_menu($menu)
Sets the popup menu for the indicator icon.
$ind->get_menu()
Returns the current menu (not from the C code, but as stored in the perl object)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Gtk2/CV/ImageWindow.pm view on Meta::CPAN
$self->signal_connect (destroy => sub { $self->kill_player });
$self->signal_connect (realize => sub { $_[0]->do_realize; 0 });
$self->signal_connect (map_event => sub { $_[0]->check_screen_size; $_[0]->auto_position (($_[0]->allocation->values)[2,3]) });
$self->signal_connect (expose_event => sub {
# in most cases, we get no expose events, except when our _own_ popups
# obscure some part of the window. se we have to do lots of unneessary refreshes :(
$self->{window}->clear_area ($_[1]->area->values);
$self->draw_drag_rect ($_[1]->area);
1
});
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Gtk2/Ex/CalendarButton.pm view on Meta::CPAN
my $hbox = Gtk2::HBox->new;
$hbox->pack_start($ok, TRUE, TRUE, 0);
$hbox->pack_start($cancel, TRUE, TRUE, 0);
$vbox->pack_start($self->{calendar}, TRUE, TRUE, 0);
$vbox->pack_start($hbox, TRUE, TRUE, 0);
my $calwindow = Gtk2::Window->new('popup');
$calwindow->add($vbox);
$ok->signal_connect('clicked' =>
sub {
my ($okself, $event) = @_;
$self->_update_button_label;
view all matches for this distribution
view release on metacpan or search on metacpan
examples/gtk2-ex-clock.pl view on Meta::CPAN
my ($toplevel, $event) = @_;
if ($event->button == 1) {
$drag_last_x_root = $event->x_root;
$drag_last_y_root = $event->y_root;
} elsif ($event->button == 3) {
$menu->popup (undef, undef, undef, undef,
$event->button, $event->time);
}
}
sub motion_notify {
my ($toplevel, $event) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Gtk2/Ex/ComboBox.pm view on Meta::CPAN
'flag' => 'bool',
'' => 'text',
);
$self->{slist} = $slist;
$self->{type} = $type;
my $popup = Gtk2::Ex::PopupWindow->new($parent);
$self->{popup} = $popup;
$self->{signals} = undef;
my $frame = Gtk2::Frame->new;
$type = 'with-buttons' unless $type;
unless ($type eq 'with-buttons' or $type eq 'with-checkbox' or $type eq 'no-checkbox') {
carp "Error: Expecting 'with-buttons' or 'with-checkbox'. Got $type\n";
lib/Gtk2/Ex/ComboBox.pm view on Meta::CPAN
$slist->{data}->[$x]->[0] = TRUE;
}
}
);
}
$popup->{window}->add($frame);
$popup->{window}->set_default_size(200, 200);
return $self;
}
sub signal_connect {
my ($self, $signal, $callback) = @_;
lib/Gtk2/Ex/ComboBox.pm view on Meta::CPAN
return 0;
}
sub show {
my ($self) = @_;
$self->{popup}->show;
}
sub hide {
my ($self) = @_;
$self->{popup}->hide;
}
sub _make_selectable {
my ($self) = @_;
my $slist = $self->{slist};
lib/Gtk2/Ex/ComboBox.pm view on Meta::CPAN
}
}
);
$okbutton->signal_connect ('button-release-event' =>
sub {
$self->{popup}->hide;
}
);
my $scrolledwindow = Gtk2::ScrolledWindow->new;
$scrolledwindow->set_policy('automatic', 'automatic');
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Gtk2/Ex/DBI.pm view on Meta::CPAN
# See http://bugzilla.gnome.org/show_bug.cgi?id=156017
# Note that while the above bug page shows this bug as being 'FIXED', I've yet to see this
# fix materialise in Gtk2 - when it does I will limit our work-around to those affected
# versions of Gtk2.
# - Use the populate-popup signal of Gtk2::Entry widgets to add the 'find' menu item
# - Connect to the 'key-press-event' signal of various widgets to move the focus along
# ( ie as if the TAB key was pressed )
# We also keep an array of widgets and signal ids so that we can disconnect all signal handlers
lib/Gtk2/Ex/DBI.pm view on Meta::CPAN
$signal
];
# We also want a right-click menu for a Combo's child ( entry )
$signal = $child_widget->signal_connect_after(
'populate-popup' => sub { $self->build_right_click_menu(@_) } );
if ( $self->{debug} ) {
warn "Remembering object / signal pair for later disconnection ...\n"
. " Field: $fieldname\n"
. " Widget: $child_widget\n"
lib/Gtk2/Ex/DBI.pm view on Meta::CPAN
} elsif ( $type eq "Gtk2::Entry" ) {
push @signals, $widget->signal_connect_after(
changed => sub { $self->changed( $fieldname ) } );
push @signals, $widget->signal_connect_after(
'populate-popup' => sub { $self->build_right_click_menu(@_) } );
push @signals, $widget->signal_connect(
'activate' => sub { $self->{window}->child_focus('tab-forward') } );
} elsif ( $type eq "Gtk2::SpinButton" ) {
push @signals, $widget->signal_connect_after(
changed => sub { $self->changed( $fieldname ) } );
push @signals, $widget->signal_connect_after(
'populate-popup' => sub { $self->build_right_click_menu(@_) } );
push @signals, $widget->signal_connect(
'key-press-event' => sub { $self->process_entry_keypress(@_) } );
} else {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Gtk2/Ex/DBITableFilter/FilterWidget.pm view on Meta::CPAN
$labelbox->show_all;
my $button = $col->get_widget; # not a button
do {
$button = $button->get_parent;
} until ($button->isa ('Gtk2::Button'));
my $popupwindow = Gtk2::Ex::PopupWindow->new($labelbox);
my $frame = Gtk2::Frame->new;
my $entry = Gtk2::Entry->new;
$entry->signal_connect( 'changed' =>
sub {
my $pattern_string;
lib/Gtk2/Ex/DBITableFilter/FilterWidget.pm view on Meta::CPAN
$parent->{params}->{columnfilter}->{$columnnumber} = $pattern_string;
}
);
$frame->add($entry);
$frame->set_size_request(0, 0);
$popupwindow->{window}->add($frame);
$button->signal_connect ('button-release-event' =>
sub {
my ($self, $event) = @_;
$popupwindow->show;
}
);
}
sub add_choice {
lib/Gtk2/Ex/DBITableFilter/FilterWidget.pm view on Meta::CPAN
($command1, $date1, $joiner1, $command2, $date2) = @$preselected if $preselected;
#print "$date1, $command1, $joiner1, $date2, $command2\n";
my $parent = $self->{parent};
my $button = $self->_get_column_header_button($columnnumber);
my $popupwindow = Gtk2::Ex::PopupWindow->new($button);
$popupwindow->set_move_with_parent(TRUE);
my $choices = ['before', 'after'];
my $joiner = [ '', 'and', 'or'];
my $datelabel1 = Gtk2::Label->new;
my $datelabelbox1 = _calendar_popup($datelabel1, $date1);
my $combobox1 = Gtk2::ComboBox->new_text;
$combobox1->append_text($choices->[0]);
$combobox1->append_text($choices->[1]);
my $index1 = 1;
if ($command1) {
lib/Gtk2/Ex/DBITableFilter/FilterWidget.pm view on Meta::CPAN
$index1 = { map { $_ => $i++ } @$choices }->{$command1};
}
$combobox1->set_active($index1);
my $datelabel2 = Gtk2::Label->new;
my $datelabelbox2 = _calendar_popup($datelabel2, $date2);
my $combobox2 = Gtk2::ComboBox->new_text;
$combobox2->append_text($choices->[0]);
$combobox2->append_text($choices->[1]);
my $index2 = 0;
if ($command1) {
lib/Gtk2/Ex/DBITableFilter/FilterWidget.pm view on Meta::CPAN
$parent->{params}->{columnfilter}->{$columnnumber} = &$refreshparams if $preselected;
$apply->signal_connect ('button-release-event' =>
sub {
$parent->{params}->{columnfilter}->{$columnnumber}
= &$refreshparams;
$popupwindow->hide;
}
);
my $clear = Gtk2::Button->new_from_stock('gtk-clear');
$clear->signal_connect ('button-release-event' =>
sub {
$parent->{params}->{columnfilter}->{$columnnumber} = undef;
$and_or_combobox->set_active(0);
$datelabel1->set_text('none');
$popupwindow->hide;
}
);
my $hbox = Gtk2::HBox->new (TRUE, 0);
$hbox->pack_start ($apply, TRUE, TRUE, 0);
$hbox->pack_start ($clear, TRUE, TRUE, 0);
my $vbox = Gtk2::VBox->new (FALSE, 0);
$vbox->pack_start ($table, TRUE, TRUE, 0);
$vbox->pack_start ($hbox, FALSE, FALSE, 0);
$popupwindow->{window}->add($vbox);
$button->signal_connect ('button-release-event' =>
sub {
my ($self, $event) = @_;
$popupwindow->show;
unless ($and_or_combobox->get_active()) {
$combobox2->hide;
$datelabelbox2->hide;
}
}
lib/Gtk2/Ex/DBITableFilter/FilterWidget.pm view on Meta::CPAN
$button = $button->get_parent;
} until ($button->isa ('Gtk2::Button'));
return $button;
}
sub _calendar_popup {
my ($datelabel, $datestr) = @_;
my $datelabelbox = _add_button_press(_add_arrow($datelabel));
my $datepopup = Gtk2::Ex::PopupWindow->new($datelabelbox);
my $date = Gtk2::Calendar->new;
if ($datestr) {
my ($year, $mon, $day) = split '-', $datestr;
$date->select_month($mon-1, $year);
$date->select_day($day);
lib/Gtk2/Ex/DBITableFilter/FilterWidget.pm view on Meta::CPAN
$vbox->pack_start ($apply, FALSE, FALSE, 0);
$apply->signal_connect ('button-release-event' =>
sub {
my ($year, $mon, $day) = $date->get_date();
$datelabel->set_text("$year-$mon-$day");
$datepopup->hide;
}
);
$datepopup->{window}->add($vbox);
$datelabelbox->signal_connect ('button-release-event' =>
sub {
$datepopup->show;
}
);
return $datelabelbox;
}
view all matches for this distribution
view release on metacpan or search on metacpan
devel/tearoff.pl view on Meta::CPAN
$menu->append ($zitem);
$dashesitem->set_direction ('rtl');
print "$progname: child direction is ",$dashes->get_direction,"\n";
print "$progname: popup\n";
$menu->popup (undef, undef, undef, undef,
1, 0);
print "$progname: dashes ypad ",$dashes->get('ypad'),"\n";
print "$progname: main loop\n";
Gtk2->main;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Gtk2/Ex/Datasheet/DBI.pm view on Meta::CPAN
use constant y_padding => 3;
use constant arrow_width => 15;
use constant arrow_height => 15;
sub hide_popup {
my ( $cell ) = @_;
Gtk2->grab_remove( $cell->{ _popup } );
$cell->{ _popup }->hide();
}
sub get_today {
lib/Gtk2/Ex/Datasheet/DBI.pm view on Meta::CPAN
sub INIT_INSTANCE {
my ( $cell ) = @_;
my $popup = Gtk2::Window->new ('popup');
my $vbox = Gtk2::VBox->new( 0, 0 );
my $calendar = Gtk2::Calendar->new();
$calendar->modify_font( Gtk2::Pango::FontDescription->from_string( "Arial " . $cell->get( "font" ) ) );
lib/Gtk2/Ex/Datasheet/DBI.pm view on Meta::CPAN
# Find out if the click happended outside of our window. If so, hide it.
# Largely copied from Planner (the former MrProject).
# Implement via Gtk2::get_event_widget?
$popup->signal_connect( button_press_event => sub {
my ( $popup, $event ) = @_;
if ( $event->button() == 1 ) {
my ( $x, $y ) = ( $event->x_root(), $event->y_root() );
my ( $xoffset, $yoffset ) = $popup->window()->get_root_origin();
my $allocation = $popup->allocation();
my $x1 = $xoffset + 2 * $allocation->x();
my $y1 = $yoffset + 2 * $allocation->y();
my $x2 = $x1 + $allocation->width();
my $y2 = $y1 + $allocation->height();
unless ( $x > $x1 && $x < $x2 && $y > $y1 && $y < $y2 ) {
$cell->hide_popup();
return 1;
}
}
return 0;
} );
$popup->add( $vbox );
$cell->{ _popup } = $popup;
$cell->{ _calendar } = $calendar;
}
sub START_EDITING {
my ( $cell, $event, $view, $path, $background_area, $cell_area, $flags ) = @_;
my $popup = $cell -> { _popup };
my $calendar = $cell->{ _calendar };
# Specify the callbacks. Will be called by the signal handlers set up in
# INIT_INSTANCE.
$cell->{ _today_clicked_callback } = sub {
my ($button) = @_;
my ($year, $month, $day) = $cell -> get_today();
$cell->signal_emit( edited=>$path, join( "-", $cell->add_padding( $year, $month, $day ) ) );
$cell->hide_popup();
};
$cell->{ _none_clicked_callback } = sub {
my ( $button ) = @_;
$cell->signal_emit( edited=>$path, "" );
$cell->hide_popup();
};
$cell->{ _day_selected_double_click_callback } = sub {
my ( $calendar ) = @_;
my ( $year, $month, $day ) = $calendar->get_date();
$cell->signal_emit( edited => $path, join( "-", $cell -> add_padding( $year, ++$month, $day ) ) );
$cell->hide_popup();
};
$cell->{ _month_changed } = sub {
lib/Gtk2/Ex/Datasheet/DBI.pm view on Meta::CPAN
my ( $year, $month, $day ) = $cell->get_date();
$calendar->select_month( $month - 1, $year );
$calendar->select_day( $day );
# Necessary to get the correct allocation of the popup.
$popup->move( -500, -500 );
$popup->show_all();
# Figure out where to put the popup - ie don't put it offscreen,
# as it's not movable ( by the user )
my $screen_height = $popup->get_screen->get_height;
my $requisition = $popup->size_request();
my $popup_width = $requisition->width;
my $popup_height = $requisition->height;
my ( $x_origin, $y_origin ) = $view->get_bin_window()->get_origin();
my ( $popup_x, $popup_y );
$popup_x = $x_origin + $cell_area->x() + $cell_area->width() - $popup_width;
$popup_x = 0 if $popup_x < 0;
$popup_y = $y_origin + $cell_area->y() + $cell_area->height();
if ( $popup_y + $popup_height > $screen_height ) {
$popup_y = $y_origin + $cell_area->y() - $popup_height;
}
$popup->move( $popup_x, $popup_y );
# Grab the focus and the pointer.
Gtk2->grab_add( $popup );
$popup->grab_focus();
Gtk2::Gdk -> pointer_grab(
$popup -> window(),
1,
[ qw( button-press-mask button-release-mask pointer-motion-mask ) ],
undef,
undef,
0
lib/Gtk2/Ex/Datasheet/DBI.pm view on Meta::CPAN
use constant y_padding => 3;
use constant arrow_width => 15;
use constant arrow_height => 15;
sub hide_popup {
my $cell = shift;
Gtk2->grab_remove( $cell->{ _popup } );
$cell->{ _popup }->hide();
}
sub get_time {
lib/Gtk2/Ex/Datasheet/DBI.pm view on Meta::CPAN
sub INIT_INSTANCE {
my $cell = shift;
my $popup = Gtk2::Window -> new ('popup');
my $vbox = Gtk2::VBox -> new( 0, 0 );
my $h_spinbutton = Gtk2::SpinButton -> new_with_range( 0, 23, 1 );
my $m_spinbutton = Gtk2::SpinButton -> new_with_range( 0, 59, 1 );
my $s_spinbutton = Gtk2::SpinButton -> new_with_range( 0, 59, 1 );
lib/Gtk2/Ex/Datasheet/DBI.pm view on Meta::CPAN
# Find out if the click happended outside of our window. If so, hide it.
# Largely copied from Planner (the former MrProject).
# Implement via Gtk2::get_event_widget?
$popup -> signal_connect(button_press_event => sub {
my ($popup, $event) = @_;
if ($event -> button() == 1) {
my ($x, $y) = ($event -> x_root(), $event -> y_root());
my ($xoffset, $yoffset) = $popup -> window() -> get_root_origin();
my $allocation = $popup -> allocation();
my $x1 = $xoffset + 2 * $allocation -> x();
my $y1 = $yoffset + 2 * $allocation -> y();
my $x2 = $x1 + $allocation -> width();
my $y2 = $y1 + $allocation -> height();
unless ($x > $x1 && $x < $x2 && $y > $y1 && $y < $y2) {
$cell -> hide_popup();
return 1;
}
}
return 0;
});
$popup -> add($vbox);
$cell -> { _popup } = $popup;
$cell -> { _h_spinbutton } = $h_spinbutton;
$cell -> { _m_spinbutton } = $m_spinbutton;
$cell -> { _s_spinbutton } = $s_spinbutton;
}
sub START_EDITING {
my ( $cell, $event, $view, $path, $background_area, $cell_area, $flags ) = @_;
my $popup = $cell -> { _popup };
my $h_spinbutton = $cell -> { _h_spinbutton };
my $m_spinbutton = $cell -> { _m_spinbutton };
my $s_spinbutton = $cell -> { _s_spinbutton };
my ( $h, $m, $s ) = $cell -> get_time();
lib/Gtk2/Ex/Datasheet/DBI.pm view on Meta::CPAN
$cell -> signal_emit(
edited => $path,
join( ":", $cell -> add_padding($h, $m, $s ) )
);
$cell -> hide_popup();
};
# Necessary to get the correct allocation of the popup.
$popup -> move(-500, -500);
$popup -> show_all();
# Figure out where to put the popup - ie don't put it offscreen,
# as it's not movable ( by the user )
my $screen_height = $popup->get_screen->get_height;
my $requisition = $popup->size_request();
my $popup_width = $requisition->width;
my $popup_height = $requisition->height;
my ( $x_origin, $y_origin ) = $view -> get_bin_window() -> get_origin();
my ( $popup_x, $popup_y );
$popup_x = $x_origin + $cell_area->x() + $cell_area->width() - $popup_width;
$popup_x = 0 if $popup_x < 0;
$popup_y = $y_origin + $cell_area -> y() + $cell_area -> height();
if ( $popup_y + $popup_height > $screen_height ) {
$popup_y = $y_origin + $cell_area -> y() - $popup_height;
}
$popup -> move( $popup_x, $popup_y );
# Grab the focus and the pointer.
Gtk2 -> grab_add($popup);
$popup -> grab_focus();
Gtk2::Gdk->pointer_grab(
$popup->window(),
1,
[ qw( button-press-mask button-release-mask pointer-motion-mask ) ],
undef,
undef,
0
view all matches for this distribution
view release on metacpan or search on metacpan
examples/show-range-popup.pl view on Meta::CPAN
}
);
my $label = Gtk2::Label->new('Click-Here');
my $labelbox = _add_button_press($label);
my $popup = $daterange->attach_popup_to($label);
$labelbox->signal_connect('button-press-event' =>
sub {
$popup->show;
return TRUE; # Very Important...
# If you don't return true, then the popup will get closed
}
);
my $window = Gtk2::Window->new;
$window->signal_connect('destroy' => sub { Gtk2->main_quit });
my $hbox = Gtk2::HBox->new (FALSE);
view all matches for this distribution
view release on metacpan or search on metacpan
devel/entry-completion.pl view on Meta::CPAN
$model->insert_with_values (2, 0 => 'xyzzy');
my $completion = Gtk2::EntryCompletion->new;
$completion->set_model ($model);
$completion->set_text_column (0);
$completion->set_popup_completion (1);
my $setname = 'Gtk2::Ex::Entry::WithCancel';
$setname =~ tr/:/_/;
$setname .= '_keys';
view all matches for this distribution
view release on metacpan or search on metacpan
examples/cellrenderer_date.pl view on Meta::CPAN
use constant y_padding => 3;
use constant arrow_width => 15;
use constant arrow_height => 15;
sub hide_popup {
my ($cell) = @_;
Gtk2 -> grab_remove($cell -> { _popup });
$cell -> { _popup } -> hide();
}
sub get_today {
my ($cell) = @_;
examples/cellrenderer_date.pl view on Meta::CPAN
}
sub INIT_INSTANCE {
my ($cell) = @_;
my $popup = Gtk2::Window -> new ('popup');
my $vbox = Gtk2::VBox -> new(0, 0);
my $calendar = Gtk2::Calendar -> new();
my $hbox = Gtk2::HBox -> new(0, 0);
examples/cellrenderer_date.pl view on Meta::CPAN
# Find out if the click happended outside of our window. If so, hide it.
# Largely copied from Planner (the former MrProject).
# Implement via Gtk2::get_event_widget?
$popup -> signal_connect(button_press_event => sub {
my ($popup, $event) = @_;
if ($event -> button() == 1) {
my ($x, $y) = ($event -> x_root(), $event -> y_root());
my ($xoffset, $yoffset) = $popup -> window() -> get_root_origin();
my $allocation = $popup -> allocation();
my $x1 = $xoffset + 2 * $allocation -> x();
my $y1 = $yoffset + 2 * $allocation -> y();
my $x2 = $x1 + $allocation -> width();
my $y2 = $y1 + $allocation -> height();
unless ($x > $x1 && $x < $x2 && $y > $y1 && $y < $y2) {
$cell -> hide_popup();
return 1;
}
}
return 0;
});
$popup -> add($vbox);
$cell -> { _popup } = $popup;
$cell -> { _calendar } = $calendar;
}
sub START_EDITING {
my ($cell, $event, $view, $path, $background_area, $cell_area, $flags) = @_;
my $popup = $cell -> { _popup };
my $calendar = $cell -> { _calendar };
# Specify the callbacks. Will be called by the signal handlers set up in
# INIT_INSTANCE.
$cell -> { _today_clicked_callback } = sub {
my ($button) = @_;
my ($year, $month, $day) = $cell -> get_today();
$cell -> signal_emit(edited => $path, join("-", $cell -> add_padding($year, $month, $day)));
$cell -> hide_popup();
};
$cell -> { _none_clicked_callback } = sub {
my ($button) = @_;
$cell -> signal_emit(edited => $path, "");
$cell -> hide_popup();
};
$cell -> { _day_selected_double_click_callback } = sub {
my ($calendar) = @_;
my ($year, $month, $day) = $calendar -> get_date();
$cell -> signal_emit(edited => $path, join("-", $cell -> add_padding($year, ++$month, $day)));
$cell -> hide_popup();
};
$cell -> { _month_changed } = sub {
my ($calendar) = @_;
examples/cellrenderer_date.pl view on Meta::CPAN
my ($year, $month, $day) = $cell -> get_date();
$calendar -> select_month($month - 1, $year);
$calendar -> select_day($day);
# Figure out where to put the popup - i.e., don't put it offscreen,
# as it's not movable (by the user).
$popup -> get_child -> show_all(); # all but $popup itself
$popup -> realize;
my ($requisition) = $popup->size_request;
my ($popup_width, $popup_height) = ($requisition->width, $requisition->height);
my $screen_height = $popup->get_screen->get_height;
my ($x_origin, $y_origin) = $view -> get_bin_window() -> get_origin();
my $popup_x = $x_origin + $cell_area->x + $cell_area->width - $popup_width;
if ($popup_x < 0) {
$popup_x = 0;
}
my $popup_y = $y_origin + $cell_area->y + $cell_area->height;
if ($popup_y + $popup_height > $screen_height) {
$popup_y = $y_origin + $cell_area->y - $popup_height;
}
$popup -> move($popup_x, $popup_y);
$popup -> show();
# Grab the focus and the pointer.
Gtk2 -> grab_add($popup);
$popup -> grab_focus();
Gtk2::Gdk -> pointer_grab($popup -> window(),
1,
[qw(button-press-mask
button-release-mask
pointer-motion-mask)],
undef,
view all matches for this distribution