SchemaView-Plus
view release on metacpan or search on metacpan
$list2->selectionClear(0,'end');
$list1->see(0);
$list2->see(0);
})->grid(-column => 2, -row => 9);
$d->Label(-text => 'Available tables and views:')
->grid(-column => 1, -row => 1, -sticky => 'w');
$d->Label(-text => 'Tables and views to retrieve:')
->grid(-column => 3, -row => 1, -sticky => 'w');
$d->Label(-text => 'Filters are used only for showing in this dialog and not for retrieving objects from database.')
->grid(-column => 1, -columnspan => 3, -row => 12);
$d->gridRowconfigure(1, -weight => 0, -minsize => 30);
$d->gridRowconfigure(2, -weight => 0, -minsize => 90);
$d->gridRowconfigure(3, -weight => 0, -minsize => 30);
$d->gridRowconfigure(4, -weight => 0, -minsize => 30);
$d->gridRowconfigure(5, -weight => 0, -minsize => 30);
$d->gridRowconfigure(6, -weight => 0, -minsize => 30);
$d->gridRowconfigure(7, -weight => 0, -minsize => 30);
$d->gridRowconfigure(8, -weight => 0, -minsize => 30);
$d->gridRowconfigure(9, -weight => 0, -minsize => 30);
A3 => { x => 842, y => 1191 } );
my @formats = qw/A4 A3 Fit Poster/;
my $poster = new PostScript::Poster;
my $format = '';
my $ftype = 'predefined';
my $fori = 0;
my $printx = ''; my $printy = '';
$psop->Label(-justify => 'left', -text => 'Page format:')
->grid(-column => 1, -columnspan => 2, -row => 1,
-sticky => 'w');
$psop->Radiobutton(-variable => \$ftype, -value => 'predefined',
-text => 'Predefined ', -anchor => 'w')
->grid(-column => 1, -row => 2, -sticky => 'w');
$psop->Radiobutton(-variable => \$ftype, -value => 'manual',
-text => 'Manual ', -anchor => 'w')
->grid(-column => 1, -row => 3, -sticky => 'w');
$psop->Optionmenu(-options => \@formats, -variable => \$format)
->grid(-column => 2, -row => 2, -sticky => 'ew');
$psop->Label(-justify => 'left', -text => 'X: ')
->grid(-column => 1, -row => 4, -sticky => 'e');
$psop->Entry(-textvariable => \$printx)
->grid(-column => 2, -row => 4, -sticky => 'ew');
$psop->Label(-justify => 'left', -text => 'Y: ')
->grid(-column => 1, -row => 5, -sticky => 'e');
$psop->Entry(-textvariable => \$printy)
->grid(-column => 2, -row => 5, -sticky => 'ew');
$psop->Label(-justify => 'left', -text => 'Page orientation:')
->grid(-column => 1, -columnspan => 2, -row => 7,
-sticky => 'w');
$psop->Radiobutton(-variable => \$fori, -value => 0,
-text => 'Portrait ', -anchor => 'w')
->grid(-column => 1, -row => 8, -sticky => 'ew');
$psop->Radiobutton(-variable => \$fori, -value => 1,
-text => 'Landscape ', -anchor => 'w')
->grid(-column => 2, -row => 8, -sticky => 'ew');
return unless $psop->Show eq 'OK';
return sprintf '%s_%08d',$a,$b;
}
sub new_object {
my $d = $main->DialogBox(-title => 'Type of object',
-buttons => [ 'Create', 'Cancel' ]);
my $type = 'table';
$d->Label(-text => 'Please select type of created object:')
->grid(-column => 1, -row => 1, -sticky => 'ew',
-columnspan => 3);
$d->Radiobutton(-variable => \$type, -value => 'table',
-text => 'Table', -anchor => 'w')
->grid(-column => 2, -row => 2, -sticky => 'ew');
$d->Radiobutton(-variable => \$type, -value => 'view', -text => 'View',
-anchor => 'w')
->grid(-column => 2, -row => 3, -sticky => 'ew');
if (@{$data{tables}}) {
$d->Radiobutton(-variable => \$type, -value => 'relationship',
-text => 'Relationship', -anchor => 'w')
}
sub edit_table {
my $table = shift;
my $d = $main->DialogBox(-title => 'Edit '.type_desc($table->{type}),
-buttons => [ 'Accept', 'Cancel' ]);
$d->Label(-text => 'Current structure of '.type_desc($table->{type}).
':')
->grid(-column => 1, -row => 1, -sticky => 'ew',
-columnspan => 3);
my $structure = $d->Scrolled('MListbox', # -setgrid => 1,
-scrollbars => 'e', -selectmode => 'multiple', -sortable => 0,
-columns => [ [ -text => 'Column' ],
[ -text => 'PK', -width => 4 ],
[ -text => 'Indexes', -width => 8 ] ])
->grid(-column => 1, -row => 2, -sticky => 'ew',
-columnspan => 3);
$d->Label(-text => 'Item:')
->grid(-column => 1, -row => 6, -sticky => 'ew');
my $item = '';
my %reserved = (); my %redraw = ();
for my $rel (@{$data{relationships}}) {
if ($rel->{from_table} eq $table->{name}) {
for (@{$rel->{from_columns}}) {
++$reserved{$_->{column}};
} else {
delete $pk{$_} if exists $pk{$_};
$structure->delete($_);
}
}
$main->messageBox(-icon => 'error', -type => 'OK',
-title => 'Check error',
-message => 'You try to delete item which is part of relationship. This operation is not allowed. You must drop relationship before this delete.')
if $res;
})->grid(-column => 1, -row => 4, -sticky => 'ew',
-columnspan => 3);
$d->Button(-text => 'Set selected items as PK', -command => sub {
%pk = ();
for ($structure->curselection()) {
my @it = $structure->get($_);
++$pk{$it[0]->[0]};
}
my @all = map { $_->[0]; } $structure->get(0,'end');
$structure->delete(0,'end');
for (@all) {
$structure->insert('end',
[$_,(exists $pk{$_})?'yes':'']);
}
})->grid(-column => 1, -row => 5, -sticky => 'ew',
-columnspan => 3);
# changing items order
$d->Button(-text => 'Up', -command => sub {
my $first = 0;
for (sort $structure->curselection()) {
if ($_ > $first) {
my @it = $structure->get($_);
$structure->delete($_);
$structure->insert($_-1,$it[0]);
$structure->selectionSet($_-1);
}
sub edit_relationship {
my $relationship = shift;
my $d = $main->DialogBox(-title => 'Edit '.$relationship->{name}.
' relationship', -buttons => [ 'Accept', 'Cancel' ]);
$d->Label(-text => 'From table: '.$relationship->{from_table})
->grid(-column => 0, -row => 0, -sticky => 'w',
-columnspan => 2);
$d->Label(-text => ' --> ')->grid(-column => 2, -row => 1);
$d->Label(-text => 'To table: '.$relationship->{to_table})
->grid(-column => 3, -row => 0, -sticky => 'w',
-columnspan => 2);
my $lb1 = $d->Scrolled('Listbox', -selectmode => 'multiple',
-setgrid => 1, -scrollbars => 'e')
->grid(-column => 0, -row => 1, -sticky => 'nsew',
-columnspan => 2);
my $lb2 = $d->Scrolled('Listbox', -selectmode => 'multiple',
-setgrid => 1, -scrollbars => 'e')
->grid(-column => 3, -row => 1, -sticky => 'nsew',
-columnspan => 2);
$d->Button(-text => 'Delete', -command => sub {
for (sort $lb1->curselection) {
$lb1->delete($_);
}
})->grid(-column => 0, -row => 2, -sticky => 'nsew');
$d->Button(-text => 'Add', -command => sub {
my %all = ();
for ($lb1->get(0,'end')) {
++$all{$_};
( run in 0.220 second using v1.01-cache-2.11-cpan-a5abf4f5562 )