コード例 #1
0
ファイル: spreadsheet.cpp プロジェクト: aschet/qsaqt5
void SpreadSheet::init()
{
    inInit = true;

    project = new QSProject( this, "spreadsheet_project" );
    interpreter = project->interpreter();
#ifndef QSA_NO_GUI
	QSInputDialogFactory *fac = new QSInputDialogFactory;
    interpreter->addObjectFactory( fac );
#endif

    project->addObject( new SheetInterface( sheet1, this, "sheet1" ) );

    project->load( "spreadsheet.qsa" );
    connect( project, SIGNAL( projectEvaluated() ),
	     project, SLOT( save() ) );

    
    QMenuBar *menuBar = new QMenuBar(this);
    QMenu *fileMenu = menuBar->addMenu("&File");    
    QAction *fileExitAction = fileMenu->addAction("E&xit");
    connect(fileExitAction, SIGNAL(triggered(bool)), this, SLOT(fileExit()));

    scriptsMenu = menuBar->addMenu("&Scripts");
    QAction *scriptsNewAction = scriptsMenu->addAction(QIcon(":/images/hi22-action-run.png"), 
                                                       "&New...");
    connect(scriptsNewAction, SIGNAL(triggered(bool)), this, SLOT(addScript()));
    QAction *scriptsQSA = scriptsMenu->addAction(QIcon(":/images/hi22-action-project_open.png"), 
                                                 "QSA &Workbench");   
    connect(scriptsQSA, SIGNAL(triggered(bool)), this, SLOT(openIDE()));
    setMenuBar(menuBar);

    QToolBar *toolBar = new QToolBar("Calculation Toolbar", this);
    currentCell = new QLabel("A1", toolBar);
        toolBar->addWidget(currentCell);
    formulaEdit = new QLineEdit(toolBar);
        toolBar->addWidget(formulaEdit);
        connect(formulaEdit, SIGNAL(returnPressed()), this, SLOT(formulaEdited()));
    addToolBar(toolBar);

    scriptsToolbar = new QToolBar("Scripts Toolbar", this);
    scriptsToolbar->addAction(scriptsNewAction);
    scriptsToolbar->addAction(scriptsQSA);
    addToolBar(scriptsToolbar);        

    for (int i=0; i<sheet1->rowCount(); ++i) {
        sheet1->setVerticalHeaderItem(i, new QTableWidgetItem(QString::number(i + 1)));

        for (int j=0; j<sheet1->columnCount(); ++j) {
            sheet1->setItem(i, j, new QTableWidgetItem);
            if (i == 0) {
                sheet1->setHorizontalHeaderItem(j, new QTableWidgetItem);
            }
        }
    }

    setupSheet( sheet1 );
    inInit = false;
}
コード例 #2
0
ファイル: UIMachineWindowNormal.cpp プロジェクト: ryenus/vbox
void UIMachineWindowNormal::prepareMenu()
{
    /* Call to base-class: */
    UIMachineWindow::prepareMenu();

    /* Prepare menu-bar: */
    setMenuBar(uisession()->newMenuBar());
}
コード例 #3
0
ファイル: Main.cpp プロジェクト: aaptel/OwlNest
      ~MainWindow(){
#if JUCE_MAC
	MenuBarModel::setMacMainMenu(NULL);
#else
	setMenuBar(NULL);
#endif

      }
コード例 #4
0
void AbstractTableTabAction::On_dataTabs_currentChanged(int iTab)
{
 //table = tabbedTableArray.at(iTab)->dataTable;
 tabbedTableArray.at(currTab)->bottomBox->setVisible(false);
 tabbedTableArray.at(iTab)->bottomBox->setVisible(true);
 currTab = iTab;
 setMenuBar(f);
 ((UserPreferencesManager*)InstanceManager::getDefault("UserPreferencesManager"))->setProperty(getClassName()+"."+getTableClass(),"currTab",currTab);
}
コード例 #5
0
ファイル: MainWindow.cpp プロジェクト: aichunyu/dolphin
void MainWindow::MakeMenuBar()
{
	m_menu_bar = new MenuBar(this);
	setMenuBar(m_menu_bar);
	connect(m_menu_bar, &MenuBar::Open, this, &MainWindow::Open);
	connect(m_menu_bar, &MenuBar::Exit, this, &MainWindow::close);
	connect(m_menu_bar, &MenuBar::ShowTable, m_game_list, &GameList::SetTableView);
	connect(m_menu_bar, &MenuBar::ShowList, m_game_list, &GameList::SetListView);
}
コード例 #6
0
void MainWindow::createMenus()
{
    _menuBar = new QMenuBar(this);
    _menuBar->setObjectName(QString::fromUtf8("menuBar"));
    setMenuBar(_menuBar);

    // MENU FILE
    _menuFile = new QMenu(_menuBar);
    _menuFile->setObjectName(QString::fromUtf8("menuFile"));
    _menuFile->addAction(_actionNew);
    _menuFile->addAction(_actionOpen);
    _menuFile->addSeparator();
    _menuFile->addAction(_actionSave);
    _menuFile->addAction(_actionSaveAs);
    _menuFile->addSeparator();
    _menuFile->addAction(_actionExit);

    // recent files
    _separatorAction = _menuFile->insertSeparator(_actionExit);
    for (int i=0; i<MaxRecentFiles; ++i)
        _menuFile->insertAction(_actionExit, _recentFileActions[i]);
    _menuFile->insertSeparator(_actionExit);

    // MENU DRAW
    _menuDraw = new QMenu(_menuBar);
    _menuDraw->setObjectName(QString::fromUtf8("menuDraw"));
    _menuDraw->addAction(_actionShowGrid);
    _menuDraw->addAction(_actionProperties);

    // MENU SIMULATION
    _menuSimulation = new QMenu(_menuBar);
    _menuSimulation->setObjectName(QString::fromUtf8("menuSimulation"));
    _menuSimulation->addAction(_actionConfigurate);
    _menuSimulation->addAction(_actionLaunch);

    // MENU WINDOW
    _menuWin = new QtWindowListMenu(_menuBar);
    _menuWin->attachToMdiArea(_mdiArea);

    // MENU LANGUAGE
    createLanguageMenu();

    // MENU HELP
    _menuHelp = new QMenu(_menuBar);
    _menuHelp->setObjectName(QString::fromUtf8("menuHelp"));
    _menuHelp->addAction(_actionAbout);
    _menuHelp->addAction(_actionAboutQt);


    // MENUBAR
    _menuBar->addAction(_menuFile->menuAction());
    _menuBar->addAction(_menuDraw->menuAction());
    _menuBar->addAction(_menuSimulation->menuAction());
    _menuBar->addAction(_menuWin->menuAction());
    _menuBar->addAction(_menuLanguage->menuAction());
    _menuBar->addAction(_menuHelp->menuAction());
}
コード例 #7
0
ファイル: jucer_MainWindow.cpp プロジェクト: Frongo/JUCE
//==============================================================================
MainWindow::MainWindow()
    : DocumentWindow ("The Jucer",
                      Colours::azure,
                      DocumentWindow::allButtons)
{
    if (oldLook == 0)
        oldLook = new OldSchoolLookAndFeel();

    setContentOwned (multiDocHolder = new MultiDocHolder(), false);

    setApplicationCommandManagerToWatch (commandManager);

   #if JUCE_MAC
    setMacMainMenu (this);
   #else
    setMenuBar (this);
   #endif

    setResizable (true, false);

    centreWithSize (700, 600);

    // restore the last size and position from our settings file..
    restoreWindowStateFromString (StoredSettings::getInstance()->getProps()
                                    .getValue ("lastMainWindowPos"));

    // Register all the app commands..
    {
        commandManager->registerAllCommandsForTarget (JUCEApplication::getInstance());
        commandManager->registerAllCommandsForTarget (this);

        // use a temporary one of these to harvest its commands..
        JucerDocumentHolder tempDesignHolder (ObjectTypes::createNewDocument (0));
        commandManager->registerAllCommandsForTarget (&tempDesignHolder);
    }

    commandManager->getKeyMappings()->resetToDefaultMappings();

    XmlElement* const keys = StoredSettings::getInstance()->getProps().getXmlValue ("keyMappings");

    if (keys != 0)
    {
        commandManager->getKeyMappings()->restoreFromXml (*keys);
        delete keys;
    }

    addKeyListener (commandManager->getKeyMappings());

    // don't want the window to take focus when the title-bar is clicked..
    setWantsKeyboardFocus (false);

   #ifndef JUCE_DEBUG
    // scan for fonts before the app gets started rather than glitching later
    FontPropertyComponent::preloadAllFonts();
   #endif
}
コード例 #8
0
ファイル: MainWindow.cpp プロジェクト: ssell/OcularEngine
        void MainWindow::setupMenus()
        {
            m_MenuBar = new MainMenuBar();
            m_StatusBar = new MainStatusBar();

            m_StatusBar->showMessage(tr("Ready"));

            setMenuBar((QMenuBar*)(m_MenuBar));
            setStatusBar((QStatusBar*)(m_StatusBar));
        }
コード例 #9
0
void MainWindow::setup_ui()
{
	/*
		MENU BAR
	*/
	setMenuBar(&menu_bar);

	/*
		TOOL BAR
	*/
//	tool_bar.setIconSize(QSize(24, 24));
//	addToolBar(Qt::TopToolBarArea, &tool_bar);

	/*
		CENTRAL WIDGET
	*/
	setCentralWidget(&central_widget);
	hbox_main.addLayout(&vbox_left, 1);
	hbox_main.addLayout(&vbox_right);

	vbox_left.addWidget(&draw_area, 0);
	vbox_right.addWidget(&spacer, 1);
	vbox_right.addWidget(&btn_run);
	vbox_right.addWidget(&btn_step);
	vbox_right.addLayout(&pixel_size_chooser.layout());
	vbox_right.addLayout(&time_interval_chooser.layout());
	ca_type_edit.widget().setText("Select ca");
	vbox_right.addLayout(&ca_type_edit.layout());
	btn_run.setCheckable(true);

	connect(&time_interval_chooser.widget(), SIGNAL(valueChanged(int)),
		&draw_area, SLOT(set_timeout_interval(int)));
	connect(&pixel_size_chooser.widget(), SIGNAL(valueChanged(int)),
		this, SLOT(change_pixel_size(int)));
	connect(&state_machine, SIGNAL(updated(StateMachine::STATE)),
		this, SLOT(state_updated(StateMachine::STATE)));
	connect(&btn_step, SIGNAL(released()),
		&state_machine, SLOT(trigger_step()));
	connect(&btn_run, SIGNAL(released()),
		&state_machine, SLOT(trigger_pause()));
	connect(&ca_type_edit.widget(), SIGNAL(clicked()),
		this, SLOT(change_ca_type()));
	connect(&menu_bar, SIGNAL(toggle_fullscreen()),
		this, SLOT(slot_fullscreen()));

	draw_area.fill_grid();
	draw_area.set_pixel_size(pixel_size_chooser.widget().value());

	/*pixel_size_chooser.widget().setMinimum(1);
	pixel_size_chooser.widget().setMaximum(255);
	pixel_size_chooser.widget().setValue(4);
	time_interval_chooser.widget().setMinimum(0);
	time_interval_chooser.widget().setMaximum(1000);
	time_interval_chooser.widget().setValue(10);*/
}
コード例 #10
0
//==============================================================================
VstPluginWindow::VstPluginWindow (PluginEditorWindowHolder* owner_,
                                  BasePlugin* plugin_)
  : DialogWindow (String::empty, Colours::beige, true, false),
    plugin (0),
    owner (owner_),
    specialEditor (0),
    nativeEditor (0),
    externalEditor (0),
    content (0)
{
    DBG ("VstPluginWindow::VstPluginWindow");

    // add to desktop
    addToDesktop (getDesktopWindowStyleFlags());

    // setup window default values
    setTitleBarHeight (24);
    centreWithSize (400, 300);
    setWantsKeyboardFocus (true);
    setBackgroundColour (Config::getInstance ()->getColour (T("mainBackground")));

    // try to move the window to its old position
    int oldX = -1, oldY = -1, oldW = -1, oldH = -1, lastPage = 0;
    if (plugin_)
    {
        oldX = plugin_->getIntValue (PROP_WINDOWXPOS, -1);
        oldY = plugin_->getIntValue (PROP_WINDOWYPOS, -1);
        oldW = plugin_->getIntValue (PROP_WINDOWWSIZE, -1);
        oldH = plugin_->getIntValue (PROP_WINDOWHSIZE, -1);
        lastPage = plugin_->getIntValue (PROP_WINDOWPAGE, 0);
    }

    // try to move the window to its old position
    if (oldX >= 0 && oldY >= 0)
        setTopLeftPosition (oldX, oldY);

    // try to set the window to its old size
    if ((lastPage == 0 && ! externalEditor)
        || (lastPage == 1 && externalEditor))
    {
        if (oldW >= 0 && oldY >= 0)
            setSize (oldW, oldH);
    }

    // default plugin to open
    setPlugin (plugin_);
    
    // setMenuBar here, after setting the plugin, so the plugin's menu items are there immediately
    setMenuBar (this, getMenuBarHeight ());

    // restore window to front
    toFront (false);
    setVisible (true);
}
コード例 #11
0
ファイル: MainWindow.cpp プロジェクト: sietse/otter-browser
void MainWindow::toolBarModified(int identifier)
{
	if (identifier == ToolBarsManager::MenuBar)
	{
		const bool showMenuBar = (ToolBarsManager::getToolBarDefinition(ToolBarsManager::MenuBar).visibility != AlwaysHiddenToolBar);

		if (m_menuBar && !showMenuBar)
		{
			m_menuBar->deleteLater();
			m_menuBar = NULL;

			setMenuBar(NULL);
		}
		else if (!m_menuBar && showMenuBar)
		{
			m_menuBar = new MenuBarWidget(this);

			setMenuBar(m_menuBar);
		}

		getAction(ActionsManager::ShowMenuBarAction)->setChecked(showMenuBar);
	}
	else if (identifier == ToolBarsManager::StatusBar)
	{
		const bool showStatusBar = (ToolBarsManager::getToolBarDefinition(ToolBarsManager::StatusBar).visibility != AlwaysHiddenToolBar);

		if (m_statusBar && !showStatusBar)
		{
			m_statusBar->deleteLater();
			m_statusBar = NULL;

			setStatusBar(NULL);
		}
		else if (!m_statusBar && showStatusBar)
		{
			m_statusBar = new StatusBarWidget(this);

			setStatusBar(m_statusBar);
		}
	}
}
コード例 #12
0
ファイル: MainWindow.cpp プロジェクト: wose/EyeTER
void MainWindow::createMenus()
{
    setMenuBar(new QMenuBar(this));
    fileMenu = menuBar()->addMenu(tr("&File"));
    fileMenu->addAction(openFileAct);
    fileMenu->addAction(exitAct);

    viewMenu = menuBar()->addMenu(tr("&View"));

    helpMenu = menuBar()->addMenu(tr("&Help"));
    helpMenu->addAction(aboutAct);
}
コード例 #13
0
ファイル: MyMainFrame.cpp プロジェクト: Cartix/BattleShip
PegMenuBar* MyMainFrame::getMenuBar()
{
	if(m_menuBar==NULL) 
	{
		PegMenuDescription defaultMenu[] = 
			{ {"Quitter", DEF_MENU_QUIT, AF_ENABLED|TT_COPY, NULL}, { "", 0,0,NULL } };
		PegMenuBar* t = new PegMenuBar(defaultMenu);
		t->Resize(defaultMenuBarRect());
		setMenuBar(t);
	}
	return m_menuBar;
}
コード例 #14
0
ファイル: mainwindow.cpp プロジェクト: Drakey83/steamlink-sdk
MainWindow::MainWindow()
{
    QMenuBar *menuBar = new QMenuBar;
    QMenu *menuWindow = menuBar->addMenu(tr("&Window"));
    QAction *addNew = new QAction(menuWindow);
    addNew->setText(tr("Add new"));
    menuWindow->addAction(addNew);
    connect(addNew, SIGNAL(triggered()), this, SLOT(onAddNew()));
    setMenuBar(menuBar);

    onAddNew();
}
コード例 #15
0
ファイル: MainWindow.cpp プロジェクト: pgeorges/PGBrowser
MainWindow::MainWindow(const QUrl& url)
: QMainWindow()
{
  MainApplication::application()->setActivationWindow(this);
  MainApplication::application()->registerWindow(this);

  QWebSettings::setIconDatabasePath(MainApplication::temporaryDir().path());

  //ensure the toolbars are unified on mac
  setUnifiedTitleAndToolBarOnMac(true);

  //create the tab widget
  m_tabWidget = new TabWidget(this, this);

  //create the main toolbar
  m_toolBar = new MainToolBar(m_tabWidget, this);

  //create the bookmarks toolbar
  m_bookmarksToolBar = new BookmarksToolBar(this);
  connect(m_bookmarksToolBar, SIGNAL(bookmarkTriggered(const QUrl&)),
          this, SLOT(onBookmarkTriggered(const QUrl&)));

  //create the find toolbar
  m_findToolBar = new QToolBar(this);
  setupFindToolBar();

  //add the widgets
  addToolBar(Qt::TopToolBarArea, m_toolBar);
  addToolBarBreak(Qt::TopToolBarArea);
  addToolBar(Qt::TopToolBarArea, m_bookmarksToolBar);
  addToolBar(Qt::BottomToolBarArea, m_findToolBar);
  setCentralWidget(m_tabWidget);

  //create and set up the menubar
  m_menuBar = new MenuBar(this);
  setMenuBar(m_menuBar);

  //set the window title and restore the state
  setWindowTitle(MainApplication::APPLICATION_NAME);
  restoreWindowState();

  //add a new tab to begin
  if (!url.toString().isEmpty())
    m_tabWidget->addNewTab(url);
  else
    m_tabWidget->addNewTab();

  connect(m_tabWidget, SIGNAL(tabChanged(WebPanel*)),
          this, SLOT(onTabChanged(WebPanel*)));

  show();
}
コード例 #16
0
ファイル: mainwindow.cpp プロジェクト: Robotips/rtprog
void MainWindow::createMenus()
{
    setMenuBar(new QMenuBar(this));

    // ============= file =============
    QMenu *fileMenu = menuBar()->addMenu(tr("&File"));

    QAction *openPrjAction = new QAction(tr("Open &project"), this);
    openPrjAction->setStatusTip(tr("Opens a project as directory"));
    openPrjAction->setShortcut(QKeySequence::Open);
    fileMenu->addAction(openPrjAction);
    connect(openPrjAction, SIGNAL(triggered()), this, SLOT(openProject()));
}
コード例 #17
0
ファイル: ide.cpp プロジェクト: kkodali/apkstudio
AS_NAMESPACE_START

Ide::Ide(QWidget *parent)
    : QMainWindow(parent), _progressDialog(nullptr)
{
    addToolBar(Qt::TopToolBarArea, new ToolBar(this));
    setCentralWidget(new EditorTabs(this));
    setDockOptions(AllowTabbedDocks | AnimatedDocks);
    setMenuBar(new MenuBar(this));
    setMinimumSize(800, 600);
    setStatusBar(_statusBar = new StatusBar(this));
    setWindowTitle(Qrc::text("ide.title"));
}
コード例 #18
0
VstPluginWindow::~VstPluginWindow ()
{
    DBG ("VstPluginWindow::~VstPluginWindow");

    // remove manually the menu !
    setMenuBar (0);

    // remove existent plugin editors
    setPlugin (0);

    // kill this window before it gets killed by juce !
    removeFromDesktop ();
}
コード例 #19
0
ファイル: mainwindow.cpp プロジェクト: reefactor/ply_viewer
MainWindow::MainWindow()
{

  // fit into 80% of a desktop size
  const QRect desk = QApplication::desktop()->availableGeometry(QApplication::desktop()->screenNumber(this));
  resize(desk.width() * .8, desk.height() * .8);

  setWindowTitle(TITLE);
  setMinimumSize(600, 400);

  // create menu
  QMenuBar *menuBar = new QMenuBar;
  setMenuBar(menuBar);
  QMenu *fileMenu = menuBar->addMenu(tr("&File"));
  QAction *openFile = new QAction(tr("&Open"), fileMenu);
  fileMenu->addAction(openFile);
  connect(openFile, &QAction::triggered, this, &MainWindow::_openFileDialog);
  QAction *closeView = new QAction(tr("&Close"), fileMenu);
  fileMenu->addAction(closeView);
  connect(closeView, &QAction::triggered, this, &MainWindow::_closeView);

  // take first command line argument as a path to PLY files
  if (QApplication::arguments().size() > 1) {
    _openView(QApplication::arguments()[1]);
  } else {
    // place some hints on a screen
    auto welcomeHint = new QLabel();
    welcomeHint->setTextFormat(Qt::RichText);
    QString t = "<font color=gray>";
    t += "<h1><u>Welcome</u></h1>";
    t += "<p />";
    t += "<ul>";
    t += "<li>Use menu <b>File</b> -> <b>Open</b> to load PLY file</li>";
    t += "<li>Also first provided command line argument is treated as path to file</li>";
    t += "<li><h2>Navigation hints</h2></li>";
    t += "<ul>";
    t += "<li>Use mouse to rotate camera</li>";
    t += "<li>Use mouse with keyboard <i>SHIFT</i> modifier to pan camera</li>";
    t += "<li>Use mouse scroll to zoom (move camera forward, backward)</li>";
    t += "<li>Use keyboard <i>UP, DOWN, LEFT, RIGHT</i> (or <i>W,S,A,D</i>) to move camera forward, backward, left and right</li>";
    t += "<li>Use keyboard <i>Q, Z</i> (or <i>SPACE, C</i>) to move camera up and down</li>";
    t += "</ul>";
    t += "<ul>";
    t += "</ul>";
    t += "<ul>";
    t += "<font>";
    welcomeHint->setText(t);
    welcomeHint->setMargin(50);
    setCentralWidget(welcomeHint);
  }
}
コード例 #20
0
void NodeEditorWindows::setupWidgets()
{
    _blocksView = new BlockView(this);
    _blocksView->setEditMode(true);
    setCentralWidget(_blocksView);

    QMenuBar *menubar = new QMenuBar(this);
    setMenuBar(menubar);

    QStatusBar *statusBar = new QStatusBar(this);
    setStatusBar(statusBar);

    setGeometry(100, 100, 800, 600);
}
コード例 #21
0
ServerWidget::ServerWidget(QWidget *parent,
		const QString &nodeName, int listenPort)
		: QMainWindow(parent) {
	m_contents = new QTextEdit(this);
	QFont font("Monospace");
	font.setStyleHint(QFont::TypeWriter);
	m_contents->setFont(font);
	m_contents->setReadOnly(true);
	QPalette palette;
	palette.setColor(QPalette::Base, Qt::black);
	m_contents->setPalette(palette);
	setPalette(palette);
	QToolBar *toolBar = new QToolBar(this);
	toolBar->setMovable(false);
	toolBar->setAllowedAreas(Qt::TopToolBarArea);
	toolBar->setIconSize(QSize(32, 32));
	toolBar->setToolButtonStyle(Qt::ToolButtonIconOnly);
	toolBar->setFloatable(false);

	QAction *actionClear = new QAction(this);
	QIcon clearIcon;
	clearIcon.addFile(QString::fromUtf8(":/resources/clear.png"), QSize(), QIcon::Normal, QIcon::Off);
	actionClear->setIcon(clearIcon);
    actionClear->setToolTip(tr("Clear"));
    actionClear->setText(tr("Clear"));
	connect(actionClear, SIGNAL(triggered()), m_contents, SLOT(clear()));
	toolBar->addAction(actionClear);

#if defined(__OSX__)
	toolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
#endif

    addToolBar(Qt::TopToolBarArea, toolBar);
	setCentralWidget(m_contents);
    setUnifiedTitleAndToolBarOnMac(true);
	setMenuBar(NULL);
	setWindowTitle(tr("Server Log"));
	resize(QSize(1000, 500));

	QConsoleAppender *consoleAppender = new QConsoleAppender();

	m_logger = new Logger(Thread::getThread()->getLogger()->getLogLevel());
	m_logger->addAppender(consoleAppender);
	m_logger->setFormatter(new DefaultFormatter());
	connect(consoleAppender, SIGNAL(textMessage(ELogLevel, const QString &)),
		this, SLOT(onTextMessage(ELogLevel, const QString &)), Qt::QueuedConnection);

	m_thread = new ServerThread(m_logger, listenPort, nodeName.toStdString());
	m_thread->start();
}
コード例 #22
0
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
SIMPLView_UI::SIMPLView_UI(QWidget* parent) :
  QMainWindow(parent),
  m_WorkerThread(NULL),
  m_ActivePlugin(NULL),
  m_UpdateCheckThread(NULL),
  m_FilterManager(NULL),
  m_FilterWidgetManager(NULL),
#if !defined(Q_OS_MAC)
  m_InstanceMenuBar(NULL),
#endif
  m_ShouldRestart(false),
  m_OpenedFilePath("")
{
  m_OpenDialogLastDirectory = QDir::homePath();

  // Update first run
  updateFirstRun();

  // Register all of the Filters we know about - the rest will be loaded through plugins
  //  which all should have been loaded by now.
  m_FilterManager = FilterManager::Instance();
  //m_FilterManager->RegisterKnownFilters(m_FilterManager);

  // Register all the known filterWidgets
  m_FilterWidgetManager = FilterWidgetManager::Instance();
  m_FilterWidgetManager->RegisterKnownFilterWidgets();

  // Calls the Parent Class to do all the Widget Initialization that were created
  // using the QDesigner program
  setupUi(this);

  // Set up the menu
#if !defined(Q_OS_MAC)
  // Create the menu
  m_InstanceMenuBar = dream3dApp->getSIMPLViewMenuBar();
  setMenuBar(m_InstanceMenuBar);
#endif
  dream3dApp->registerSIMPLViewWindow(this);

  // Do our own widget initializations
  setupGui();

  this->setAcceptDrops(true);

  // Read various settings
  readSettings();

  // Set window modified to false
  setWindowModified(false);
}
コード例 #23
0
cvImage::cvImage()
: _menu(NULL), _image(NULL)
{
    setWindowTitle(tr("QT Image demo with OpenCV"));
    resize(480, 240);

    _menu = new QMenu("File");
    _menu->addAction("Op3n", this, SLOT(_open()));
    _menu->addSeparator();
    _menu->addAction("Ex1t", this, SLOT(close()));
    _menu_bar.addMenu(_menu);

    setMenuBar(&_menu_bar);
}
コード例 #24
0
//==============================================================================
MainAppWindow::MainAppWindow()
: DocumentWindow (JUCEApplication::getInstance()->getApplicationName(),
                  Colours::black,
                  DocumentWindow::allButtons)
{
    mainComponent = new MainComponent();
   
	setContentOwned (mainComponent, false);
    setMenuBar(mainComponent);
    
#if JUCE_MAC
    MenuBarModel::setMacMainMenu (mainComponent);
    setMenuBar (0);
#endif
    setUsingNativeTitleBar (true);
   
    setResizable (true, false);
	centreWithSize (650, 425);
    
    setVisible (true);
    setWantsKeyboardFocus(false);

}
コード例 #25
0
ファイル: MainWindow.cpp プロジェクト: jcnix/kajammer
MainWindow::MainWindow(QApplication *app, Manager* manager)
{
    m_manager = manager;
    mediaControls = new MediaControls;
    menuBar = new MenuBar;

    setWindowTitle("KaJammer Music Player");
    setMenuBar(menuBar);
    setCentralWidget(mediaControls);

    connect(menuBar, SIGNAL(showPlaylists(bool)), mediaControls,
            SLOT(showPlaylists(bool)));
    connect(menuBar, SIGNAL(exit()), m_manager, SLOT(exit()));
}
コード例 #26
0
ファイル: jucer_MainWindow.cpp プロジェクト: azeteg/HISE
MainWindow::~MainWindow()
{
   #if ! JUCE_MAC
    setMenuBar (nullptr);
   #endif

    removeKeyListener (ProjucerApplication::getCommandManager().getKeyMappings());

    // save the current size and position to our settings file..
    getGlobalProperties().setValue ("lastMainWindowPos", getWindowStateAsString());

    clearContentComponent();
    currentProject = nullptr;
}
コード例 #27
0
ファイル: MainWindow.cpp プロジェクト: vimofthevine/Vaultaire
//--------------------------------------------------------------------------
MainWindow::MainWindow() :
    settings(new Settings(this)),
    scanner(new Scanner(this)),
    engine(new SearchEngine(this)),
    mainMenu(new MainMenu(this)),
    status(new StatusBar(this)),
    stack(new QStackedWidget(this)),
    settingsDialog(new SettingsDialog(this))
{
    // Set up window widgets
    setWindowTitle(tr("Vaultaire"));
    setWindowIcon(QIcon(":/vaultaire.svg"));
    setMenuBar(mainMenu);
    setStatusBar(status);
    setCentralWidget(stack);

    // Connect signals to show scanning in-progress in status bar
    connect(scanner, SIGNAL(started()),
            status, SLOT(startBusyIndicator()));
    connect(scanner, SIGNAL(started()),
            this, SLOT(showScanningMessage()));
    connect(scanner, SIGNAL(finished(Scanner::ScanResult)),
            status, SLOT(stopBusyIndicator()));
    connect(scanner, SIGNAL(finished(Scanner::ScanResult)),
            status, SLOT(clearMessage()));

    // Connect signals to show search in-progress in status bar
    connect(engine, SIGNAL(started()),
            status, SLOT(startBusyIndicator()));
    connect(engine, SIGNAL(finished(QStringList)),
            status, SLOT(stopBusyIndicator()));

    // Create application widgets
    scanView = new ScanView(scanner, this);
    browser = new LibraryBrowser(this);
    search = new SearchView(engine, this);
    stack->addWidget(scanView);
    stack->addWidget(browser);
    stack->addWidget(search);

    // Connect menu signals
    connect(mainMenu, SIGNAL(scanNewFile()), this, SLOT(showScanForm()));
    connect(mainMenu, SIGNAL(browseFiles()), this, SLOT(showFileBrowser()));
    connect(mainMenu, SIGNAL(findFile()), this, SLOT(showSearchForm()));
    connect(mainMenu, SIGNAL(showAboutInfo()), this, SLOT(about()));
    connect(mainMenu, SIGNAL(quit()), this, SLOT(close()));
    connect(mainMenu, SIGNAL(editSettings()), settingsDialog, SLOT(show()));

    readSettings();
}
コード例 #28
0
void WriteMail::init()
{
    m_toolbar = new QToolBar(this);
    addToolBar(m_toolbar);
    m_widgetStack = new QStackedWidget(this);

    m_cancelAction = new QAction(Qtmail::icon("cancel"),tr("Close"),this);
    connect( m_cancelAction, SIGNAL(triggered()), this, SLOT(discard()) );
    addAction(m_cancelAction);

    m_draftAction = new QAction(Qtmail::icon("saveToDraft"),tr("Save in drafts"),this);
    connect( m_draftAction, SIGNAL(triggered()), this, SLOT(draft()) );
    m_draftAction->setWhatsThis( tr("Save this message as a draft.") );
    addAction(m_draftAction);

    m_sendAction = new QAction(Qtmail::icon("sendmail"),tr("Send"),this);
    connect( m_sendAction, SIGNAL(triggered()), this, SLOT(sendStage()) );
    m_sendAction->setWhatsThis( tr("Send the message.") );
    addAction(m_sendAction);

    m_accountSelection = new QComboBox(m_toolbar);
    connect( m_accountSelection, SIGNAL(currentIndexChanged(int)), this, SLOT(accountSelectionChanged(int)) );

    m_selectComposerWidget = new SelectComposerWidget(this);
    m_selectComposerWidget->setObjectName("selectComposer");
    connect(m_selectComposerWidget, SIGNAL(selected(QPair<QString,QMailMessage::MessageType>)),
            this, SLOT(composerSelected(QPair<QString,QMailMessage::MessageType>)));
    connect(m_selectComposerWidget, SIGNAL(cancel()), this, SLOT(discard()));
    m_widgetStack->addWidget(m_selectComposerWidget);

    setCentralWidget(m_widgetStack);

    QMenuBar* mainMenuBar = new QMenuBar();
    setMenuBar(mainMenuBar);

    QMenu* file = mainMenuBar->addMenu("File");
    file->addAction(m_sendAction);
    file->addAction(m_draftAction);
    file->addSeparator();
    file->addAction(m_cancelAction);

    m_toolbar->addAction(m_sendAction);
    m_toolbar->addAction(m_draftAction);
    m_toolbar->addWidget(m_accountSelection);
    m_toolbar->addSeparator();

    setWindowTitle(tr("Compose"));

    setGeometry(0,0,defaultWidth,defaultHeight);
}
コード例 #29
0
void GeneratorWindow::createLayout()
{
    // AJOUT DU WIDGET OPENGL
    setCentralWidget(m_gameWidget);

    // AJOUT DES TOOLBARS
    m_agentsToolbar = new QToolBar(); {
        genAgentToolBars();
    }
    addToolBar(Qt::RightToolBarArea, m_agentsToolbar);

    QToolBar* functionToolbar = new QToolBar(); {
        functionToolbar->addWidget(m_runButton);
        functionToolbar->addWidget(m_stepButton);
        functionToolbar->addWidget(m_InstantButton);
        functionToolbar->addWidget(m_resetButton);

        functionToolbar->addWidget(new QLabel("Ticks/seconde : "));
        functionToolbar->addWidget(m_tickSpeed);

        functionToolbar->addWidget(m_tickInfoLabel);
    }
    addToolBar(Qt::TopToolBarArea, functionToolbar);

    // AJOUT DE LA BARRE DE MENU
    QMenuBar* menuBar = new QMenuBar(); {
        QMenu* fileMenu = new QMenu("Fichier"); {
            QAction* openAction = fileMenu->addAction("Ouvrir la configuration");
            connect(openAction, &QAction::triggered, this, [this]() {
                QString file = QFileDialog::getOpenFileName(this, tr("Open File"),"", tr("Files (*.*)"));
                if (file != QString()) {
                    m_generator.load(file);
                    genAgentToolBars();
                }
            });
            QAction* saveAction = fileMenu->addAction("Enregistrer la configuration");
            connect(saveAction, &QAction::triggered, this, [this]() {
                QString file = QFileDialog::getSaveFileName(this, tr("Save File"), "", tr("Images (*.*)"));
                if (file != QString()) {
                    m_generator.save(file);
                }
            });
            QAction* exportAction = fileMenu->addAction("Exporter le resultat");
            connect(exportAction, &QAction::triggered, this, &GeneratorWindow::saveHeightmap);
        }
        menuBar->addMenu(fileMenu);
    }
    setMenuBar(menuBar);
}
コード例 #30
0
//==============================================================================
MainHostWindow::MainHostWindow()
    : DocumentWindow (JUCEApplication::getInstance()->getApplicationName(), Colours::lightgrey,
                      DocumentWindow::allButtons)
{
    XmlElement* const savedAudioState = ApplicationProperties::getInstance()->getUserSettings()
                                            ->getXmlValue (T("audioDeviceState"));

    deviceManager.initialise (256, 256, savedAudioState, true);

    delete savedAudioState;

    setResizable (true, false);
    setResizeLimits (500, 400, 10000, 10000);
    centreWithSize (800, 600);

    setContentComponent (new GraphDocumentComponent (&deviceManager));

    restoreWindowStateFromString (ApplicationProperties::getInstance()->getUserSettings()->getValue ("mainWindowPos"));

    setVisible (true);

    InternalPluginFormat internalFormat;
    internalFormat.getAllTypes (internalTypes);

    XmlElement* const savedPluginList = ApplicationProperties::getInstance()
                                          ->getUserSettings()
                                          ->getXmlValue (T("pluginList"));

    if (savedPluginList != 0)
    {
        knownPluginList.recreateFromXml (*savedPluginList);
        delete savedPluginList;
    }

    pluginSortMethod = (KnownPluginList::SortMethod) ApplicationProperties::getInstance()->getUserSettings()
                            ->getIntValue (T("pluginSortMethod"), KnownPluginList::sortByManufacturer);

    knownPluginList.addChangeListener (this);

    addKeyListener (commandManager->getKeyMappings());

    Process::setPriority (Process::HighPriority);

#if JUCE_MAC
    setMacMainMenu (this);
#else
    setMenuBar (this);
#endif
}