Qt
    
    
  
  
  
view release on metacpan or search on metacpan
qtgui/examples/mainwindows/mdi/MainWindow.pm view on Meta::CPAN
}
sub updateMenus {
    my $hasMdiChild = (activeMdiChild() != 0);
    this->{saveAct}->setEnabled($hasMdiChild);
    this->{saveAsAct}->setEnabled($hasMdiChild);
    this->{pasteAct}->setEnabled($hasMdiChild);
    this->{closeAct}->setEnabled($hasMdiChild);
    this->{closeAllAct}->setEnabled($hasMdiChild);
    this->{tileAct}->setEnabled($hasMdiChild);
    this->{cascadeAct}->setEnabled($hasMdiChild);
    this->{nextAct}->setEnabled($hasMdiChild);
    this->{previousAct}->setEnabled($hasMdiChild);
    this->{separatorAct}->setVisible($hasMdiChild);
    my $hasSelection = (this->activeMdiChild() &&
                        this->activeMdiChild()->textCursor()->hasSelection());
    this->{cutAct}->setEnabled($hasSelection);
    this->{copyAct}->setEnabled($hasSelection);
}
sub updateWindowMenu {
    this->{windowMenu}->clear();
    this->{windowMenu}->addAction(this->{closeAct});
    this->{windowMenu}->addAction(this->{closeAllAct});
    this->{windowMenu}->addSeparator();
    this->{windowMenu}->addAction(this->{tileAct});
    this->{windowMenu}->addAction(this->{cascadeAct});
    this->{windowMenu}->addSeparator();
    this->{windowMenu}->addAction(this->{nextAct});
    this->{windowMenu}->addAction(this->{previousAct});
    this->{windowMenu}->addAction(this->{separatorAct});
    my @windows = @{this->{mdiArea}->subWindowList()};
    this->{separatorAct}->setVisible(scalar @windows);
    foreach my $i ( 0..$#windows ) {
        my $child = $windows[$i]->widget();
qtgui/examples/mainwindows/mdi/MainWindow.pm view on Meta::CPAN
    this->{closeAllAct} = $closeAllAct;
    $closeAllAct->setStatusTip("Close all the windows");
    this->connect($closeAllAct, SIGNAL 'triggered()',
            this->{mdiArea}, SLOT 'closeAllSubWindows()');
    my $tileAct = Qt::Action("&Tile", this);
    this->{tileAct} = $tileAct;
    $tileAct->setStatusTip("Tile the windows");
    this->connect($tileAct, SIGNAL 'triggered()', this->{mdiArea}, SLOT 'tileSubWindows()');
    my $cascadeAct = Qt::Action("&Cascade", this);
    this->{cascadeAct} = $cascadeAct;
    $cascadeAct->setStatusTip("Cascade the windows");
    this->connect($cascadeAct, SIGNAL 'triggered()', this->{mdiArea}, SLOT 'cascadeSubWindows()');
    my $nextAct = Qt::Action("Ne&xt", this);
    this->{nextAct} = $nextAct;
    $nextAct->setStatusTip("Move the focus to the next window");
    this->connect($nextAct, SIGNAL 'triggered()',
            this->{mdiArea}, SLOT 'activateNextSubWindow()');
    my $previousAct = Qt::Action("Pre&vious", this);
    this->{previousAct} = $previousAct;
    $previousAct->setStatusTip("Move the focus to the previous " .
( run in 0.593 second using v1.01-cache-2.11-cpan-5dc5da66d9d )