Package Qt

Source Code of Qt.MenuBar

package Qt;

import org.kde.qt.QKeySequence;
import org.kde.qt.QMenuBar;
import org.kde.qt.QPopupMenu;
import org.kde.qt.QWidget;

public class MenuBar extends QMenuBar {

  public MenuBar() {

        //menu.setSeparator(QMenuBar.InWindowsStyle);
    /*
      QPopupMenu options = new QPopupMenu( this );
      options.insertTearOffHandle();
      options.setCaption("Options");
      options.insertItem( "&Normal Font", this, SLOT("normal()") );
      options.insertSeparator();

      options.polish(); // adjust system settings
      QFont f = options.font();
      f.setBold( true );
//      boldID = options.insertItem( new MyMenuItem( "&Bold", f ) );
      options.setAccel( new QKeySequence(CTRL+Key_B), boldID );
      options.connectItem( boldID, this, SLOT("bold()") );
      f = font();
      f.setUnderline( true );
//      underlineID = options.insertItem( new MyMenuItem( "&Underline", f ) );
      options.setAccel( new QKeySequence(CTRL+Key_U), underlineID );
      options.connectItem( underlineID, this, SLOT("underline()") );

      isBold = false;
      isUnderline = false;
      options.setCheckable( true );


      QPopupMenu help = new QPopupMenu( this );
      help.insertItem( "&About", this, SLOT("about()"), new QKeySequence(CTRL+Key_H) );
      help.insertItem( "About &Qt", this, SLOT("aboutQt()") );

      menu = new QMenuBar( this );
      menu.insertItem( "&File", file );
      menu.insertItem( "&Edit", edit );
      menu.insertItem( "&Options", options );
      menu.insertSeparator();
      menu.insertItem( "&Help", help );
      menu.setSeparator( QMenuBar.InWindowsStyle );

      label = new QLabel( this );
      label.setGeometry( 20, rect().center().y()-20, width()-40, 40 );
      label.setFrameStyle( QFrame.Box | QFrame.Raised );
      label.setLineWidth( 1 );
      label.setAlignment( AlignCenter );

      connect( this,  SIGNAL("explain(String)"),
         label, SLOT("setText(String)") );

      setMinimumSize( 100, 80 );*/

  }

  public MenuBar(QWidget arg0, String arg1) {
    //super(arg0, arg1);
   
    QPopupMenu file = new QPopupMenu(arg0);
    file.insertItem("E&xit", qApp(), SLOT("quit()"), new QKeySequence(CTRL
        + Key_Q));

    QPopupMenu tools = new QPopupMenu(arg0);
    tools.insertItem("Attach to Project", arg0, SLOT("attachToProject()"),
        new QKeySequence(CTRL + Key_W));
    tools.insertItem("Account manager", arg0, SLOT("accountManager()"), new QKeySequence(
        CTRL + Key_A));
    QPopupMenu activity = new QPopupMenu(arg0);
    activity.insertItem("Run always", arg0, SLOT("runAlways()"));
    activity.insertItem("Run based on preferences", arg0, SLOT("runBasedOnPreferences()"));
    activity.insertItem("Suspend", arg0, SLOT("suspend()"));
    activity.insertSeparator();
    activity
        .insertItem("Network activity always available", arg0, SLOT("networkAlwaysAvailable()"));
    activity.insertItem("Network activity based on preferences", arg0,
        SLOT("networkAuto()"));
    activity.insertItem("Network activity suspended", arg0, SLOT("networkSuspend()"));

    QPopupMenu advanced = new QPopupMenu(arg0);
    advanced.insertItem("Options", arg0, SLOT("options()"));
    advanced.insertItem("Select computer...", arg0, SLOT("selectComputer()"));
    advanced.insertItem("Run CPU benchmark", arg0, SLOT("benchark()"));
    advanced.insertItem("Retry communication", arg0, SLOT("retryCommunication()"));

    QPopupMenu help = new QPopupMenu(arg0);
    help.insertItem("JBoinc Manager", arg0, SLOT("jboincManager()"));
    help.insertItem("JBoinc Website", arg0, SLOT("jboincWebsite()"));
    help.insertItem("BOINC Website", arg0, SLOT("BOINCWebsite()"));
    help.insertSeparator();
    help.insertItem("About JBoinc Manager", arg0, SLOT("about()"));
    help.insertItem("About &Qt", this, SLOT("aboutQt()"));

    QMenuBar menu = new QMenuBar(arg0);
    menu.insertItem("&File", file);
    menu.insertItem("&Tools", tools);
    menu.insertItem("&Activity", activity);
    menu.insertItem("A&dvanced", advanced);
    menu.insertSeparator();
    menu.insertItem("&Help", help);

  }

}
TOP

Related Classes of Qt.MenuBar

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.