void DMainWindow::createToolWindows() { m_bottomDock = new DDockWindow(this, DDockWindow::Bottom); moveDockWindow(m_bottomDock, Qt::DockBottom); m_leftDock = new DDockWindow(this, DDockWindow::Left); moveDockWindow(m_leftDock, Qt::DockLeft); m_rightDock = new DDockWindow(this, DDockWindow::Right); moveDockWindow(m_rightDock, Qt::DockRight); }
// MainWindow ctor ////////////////// MainWindow::MainWindow(QWidget *parent, const char *name) : QMainWindow(parent, name) { // Set the applications icon setIcon(QPixmap::fromMimeSource("applogo.png")); // Here we create and set the main widget twManager = new QTabWidget(this, "Window Manager"); setCentralWidget(twManager); testb = new QTextBrowser(this, "Test"); testb->mimeSourceFactory()->setFilePath("."); testb->mimeSourceFactory()->setImage("startpage-title", QImage::fromMimeSource("startpage-title.png")); testb->setSource("test.htm"); twManager->addTab(testb, testb->documentTitle()); // Create the Solution Explorer Dock Window SolutionExplorer = new CSolutionExplorer(this); SolutionExplorer->setCaption("Solution Explorer"); SolutionExplorer->setHorizontallyStretchable(true); SolutionExplorer->setResizeEnabled(true); SolutionExplorer->setCloseMode(QDockWindow::Always); moveDockWindow(SolutionExplorer, Left); // Create the output dock wndow OutputWindow = new COutputWindow(this); OutputWindow->setCaption("Output"); OutputWindow->setVerticallyStretchable(true); OutputWindow->setResizeEnabled(true); OutputWindow->setCloseMode(QDockWindow::Always); moveDockWindow(OutputWindow, Bottom); OutputWindow->hide(); // Hide the window by default // Create all actions if(!CreateActions()) close(); // Create the status bar if(!CreateStatusbar()) close(); // Now we create all MainWindow toolbars if(!CreateToolbars()) close(); // Now we create all MainWindow Menus if(!CreateMenus()) close(); // Resize the window resize(600,400); }
/************************************************************** * * MainWindow constructor * @param screen_w the width of the screen * @param screen_h the height of the screnn * @param w_app the width of the window * @param h_app the height of the window * @param x_app the x position of the window * @param y_app the y position of the window * *************************************************************/ MainWindow::MainWindow(int screen_w, int screen_h, int w_app, int h_app, int x_app, int y_app, QWidget* parent, const char* name) : QMainWindow(parent, name), TITLE("Another Modeler"), _screen_w(screen_w), _screen_h(screen_h) { _labelStatus = NULL; _controlPanel = new ControlPanel(this); setCentralWidget(_controlPanel); //HelpWindow QDir absoluteManualDir(MANUAL_DIR); absoluteManualDir.convertToAbs(); _helpFrame = new HelpWindow( absoluteManualDir.absFilePath(MANUAL_INDEX) ); //Plugin Manager _pluginManager = new PluginManager(this); _comments = new EventsWindow(); //Toolbar _toolBar = new QToolBar("Operations", this); _toolBar->setHorizontallyStretchable(true); _toolBar->setVerticallyStretchable(true); _toolBar->setResizeEnabled(true); //Geometry stuff resize(w_app, h_app); move(0, 0); setCaption(TITLE); show(); //Other View initViewFrames(800, screen_w, w_app); //Tell the plugin manager to load and unload the available plugins //Plugins will be loaded on demand _pluginManager->recordAvailablePlugins(); //Other GUI Stuff addStaticMenuBarContent(); moveDockWindow(_toolBar, Qt::DockLeft); }
bool DiffAnalystWindow::initViewToolBar() { QIconSet icon; bool ret=false; // //////////////////////////////////////////////////////////////////// // FILE TOOLBAR m_pFileTools = new QToolBar (this, "File Toolbar"); if(m_pFileTools == NULL) return false; icon = QIconSet (QPixmap(XpmFileNew)); m_ToolsToolId [TM_FILENEW] = new QToolButton( icon, "New Diff Session", QString::null, this, SLOT(onFileNew()), m_pFileTools); icon = QIconSet (QPixmap(XpmFileOpen)); m_ToolsToolId [TM_FILEOPEN] = new QToolButton( icon, "Open Diff Session", QString::null, this, SLOT(onFileOpen()), m_pFileTools); icon = QIconSet (QPixmap(XpmFileSave)); m_ToolsToolId [TM_FILESAVE] = new QToolButton( icon, "Save Diff Session", QString::null, this, SLOT(onFileSave()), m_pFileTools); m_ToolsToolId [TM_FILESAVE]->setEnabled(false); // //////////////////////////////////////////////////////////////////// // VIEW TOOLBAR m_pViewTools = new QToolBar (this, "View Toolbar"); if(m_pViewTools == NULL) return false; icon = QIconSet (QPixmap(viewconfig)); m_ToolsToolId [TM_EDITVIEWS] = new QToolButton( icon, "View Management", QString::null, this, SLOT(onViewManage()), m_pViewTools); // //////////////////////////////////////////////////////////////////// // TOOLS TOOLBAR m_pToolTools = new QToolBar (this, "Tools Toolbar"); if(m_pToolTools == NULL) return false; icon = QIconSet (QPixmap((const char**)disassemblyIcon)); m_ToolsToolId [TM_TOOLDASM] = new QToolButton( icon, "Show/Hide Disassembly", QString::null, this, SLOT(onToggleDasmView()), m_pToolTools); icon = QIconSet (QPixmap((const char**)propertyIcon)); m_ToolsToolId [TM_TOOLPROP] = new QToolButton( icon,"Show/Hide Property", QString::null, this, SLOT(onToggleProp()), m_pToolTools); // //////////////////////////////////////////////////////////////////// moveDockWindow (m_pViewTools, Qt::DockTop); ret = true; return ret; }
/** * Funcion encargada de crear la GUI. * @b NOTA: esta funcion hace parte del motor de creacion de GUI en base a archivos XML. */ void sbgui::GUIMdiMainWindow::crearGUI() { if( parser ) { QStringList nombres = parser->obtenerNombres(); HashMenu menusInfo = parser->obtenerMenus(); for(uint i = 0; i < nombres.count(); i++) { QToolBar *toolBarTmp = new QToolBar(this, nombres[i]); moveDockWindow(toolBarTmp, Qt::DockTop); toolBarTmp->show(); QStringList *strlistTmp = menusInfo.find((nombres)[i]); if (strlistTmp == 0) { std::cout << "GADMainWindow::crearGUI(): Error" << std::endl; return; } for (uint j = 0; j < strlistTmp->count(); j+=3) { QAction *actTmp = new QAction(toolBarTmp, (*strlistTmp)[j]); connect( actTmp, SIGNAL( activated() ) , this, SLOT( slotPrincipal() ) ); // FIXME: colocar la ruta bien. QPixmap pm( sbqpack::GUIDATADIR + (*strlistTmp)[j+1]); if ( ! pm.isNull() ) actTmp->setIconSet( pm ); actTmp->setToolTip( (*strlistTmp)[j+2] ); actTmp->addTo(toolBarTmp); } } } }
bool DiffAnalystWindow::initPropDockView() { bool ret=false; m_pPropDockView = new PropDockView(this, "Property"); if(m_pPropDockView == NULL) return false; m_pPropDockView->init(); connect(this, SIGNAL(propDockViewShowChanged(bool)), m_pPropDockView, SLOT(onPropDockViewShowChanged(bool))); connect(m_pPropDockView, SIGNAL(propDockViewNoShow()), this, SLOT(onPropDockViewNoShow())); connect(this, SIGNAL(updateDasmDockView(QListViewItem*)), this, SLOT(onUpdateProp())); moveDockWindow (m_pPropDockView, Qt::DockBottom); ret = true; return ret; }
bool DiffAnalystWindow::initDasmDockView() { bool ret=false; m_pDasmDockView = new DasmDockView(this, "Dasm View"); if(m_pDasmDockView == NULL) return false; m_pDasmDockView->init(); connect(this, SIGNAL(dasmDockViewShowChanged(bool)), m_pDasmDockView, SLOT(onDasmDockViewShowChanged(bool))); connect(m_pDasmDockView, SIGNAL(dasmDockViewNoShow()), this, SLOT(onDasmDockViewNoShow())); // Connect QListView selection signal to DasmDockView connect(this, SIGNAL(updateDasmDockView(QListViewItem*)), m_pDasmDockView, SLOT(onUpdateDasmSymbol(QListViewItem*))); moveDockWindow (m_pDasmDockView, Qt::DockBottom); ret = true; return ret; }
/* * Constructs a KoalaStatus which is a child of 'parent', with the * name 'name' and widget flags set to 'f'. * */ KoalaStatus::KoalaStatus( QWidget* parent, const char* name, WFlags fl ) : QMainWindow( parent, name, fl ) { (void)statusBar(); if ( !name ) setName( "KoalaStatus" ); resize( 600, 480 ); setCaption( trUtf8( "KoalaMUD Status" ) ); // actions Quit = new QAction( this, "Quit" ); Quit->setText( trUtf8( "Quit" ) ); StartNetwork = new QAction( this, "StartNetwork" ); StartNetwork->setText( trUtf8( "StartNetwork" ) ); PlayerDockAct = new QAction( this, "Players" ); PlayerDockAct->setToggleAction(true); PlayerDockAct->setOn(true); PlayerDockAct->setText( trUtf8( "Players" ) ); ListenDockAct = new QAction( this, "Listens" ); ListenDockAct->setToggleAction(true); ListenDockAct->setOn(true); ListenDockAct->setText( trUtf8( "Listens" ) ); // toolbars // menubar menubar = new QMenuBar( this, "menubar" ); System = new QPopupMenu( this ); StartNetwork->addTo( System ); System->insertSeparator(); Quit->addTo( System ); menubar->insertItem( trUtf8( "System" ), System ); Status = new QPopupMenu( this ); PlayerDockAct->addTo( Status ); ListenDockAct->addTo( Status ); menubar->insertItem( trUtf8( "Status" ), Status ); // Dock Windows PlayerStatusDock = new QDockWindow(QDockWindow::InDock, this, "PlrStat"); PlayerStatusList = new QListView(PlayerStatusDock, "PlrStatList"); PlayerStatusList->addColumn("Player"); PlayerStatusList->addColumn("Level"); PlayerStatusList->addColumn("State"); PlayerCountItem = new QListViewItem(PlayerStatusList, "Total", "0", ""); PlayerStatusDock->setWidget(PlayerStatusList); PlayerStatusDock->setResizeEnabled(true); moveDockWindow(PlayerStatusDock, DockLeft); setDockEnabled(PlayerStatusDock, DockTop, false); setDockEnabled(PlayerStatusDock, DockBottom, false); PlayerStatusDock->show(); ListenStatusDock = new QDockWindow(QDockWindow::InDock, this, "ListenStat"); ListenStatusList = new QListView(ListenStatusDock, "ListenStatList"); ListenStatusList->addColumn("Listen Port"); ListenStatusList->addColumn("Listener Status"); ListenCountItem = new QListViewItem(ListenStatusList, "Total Listeners", "0"); ListenStatusDock->setWidget(ListenStatusList); ListenStatusDock->setResizeEnabled(true); moveDockWindow(ListenStatusDock, DockLeft); setDockEnabled(ListenStatusDock, DockTop, false); setDockEnabled(ListenStatusDock, DockBottom, false); ListenStatusDock->show(); // signals and slots connections connect( Quit, SIGNAL( activated() ), this, SLOT( close() ) ); connect(StartNetwork, SIGNAL( activated() ), this, SLOT( portdialog() ) ); connect(PlayerDockAct, SIGNAL(toggled(bool)), this, SLOT(playerstoggled(bool))); connect(ListenDockAct, SIGNAL(toggled(bool)), this, SLOT(listentoggled(bool))); }