Code Search for Developers
 
 
  

CFileMenu.h from osgDesigner at Krugle


Show CFileMenu.h syntax highlighted

#ifndef __CFILEMENU_H__
#define __CFILEMENU_H__

#include <osgIntrospectionToolKit/signalslib.hpp>

#include <string>
#include <QtGui/QMenu>

#include <osg/Node>
#define UNTITLED_OSGFILENAME "untitled.osg"

namespace osgDesigner
{

    class CFileMenu : public QMenu
    {
        Q_OBJECT

        public:
        	CFileMenu();
        	virtual ~CFileMenu();
            
            bool                openFile(const std::string& filename);
            
            bool                saveFile();
            bool                saveFile(const std::string& fileName, bool setCurrent = true);
            
            const std::string&  getCurrentOsgFilename() const;
            void                setCurrentOsgFileName(const std::string& fileName);

  
            // ** Action Accessor          
            QAction *           actionNew();
            QAction *           actionOpen();
            QAction *           actionSave();
            QAction *           actionClose();
  
  
            ///////////////////////////////////
            // ** Static Utility Function ** //
            ///////////////////////////////////            
            static osg::Node*   getNodeFromFile(const std::string& fileName);
//          static osg::Image*  getImageFromFile(const std::string& fileName);
  
            static bool         chooseOsgFileOpenDialog(std::string& fileName);
            static bool         chooseOsgFileOpenDialog(std::string& fileName, const std::string& lastOpenDirectory);
            static bool         chooseOsgFileSaveDialog(std::string& fileName, const std::string& currentOsgFileName);
  
            
       public slots:
            
            void                actionNewSlot();
            void                actionOpenSlot();
            void                actionRecentsSlot(QAction * action);
            
            void                actionSaveSlot();
            void                actionSaveAsSlot();
            
            void                actionCloseSlot();
            
            void                actionQuitSlot();
            
        private:


            void                _refreshRecentFileMenu(); 
            bool                _showSaveFileAsDialog();
            bool                _showSaveBeforeCloseDialog();
            void                _retranslateUi(CFileMenu * fileMenu);
        
        
            std::string         _currentOsgFileName;
            
            QAction *           _actionNew;
            QAction *           _actionOpen;
            QMenu *             _menuRecents;
            
            QAction *           _actionSave;
            QAction *           _actionSaveAs;
            
            QAction *           _actionClose;
            
            QAction *           _actionQuit;              
    }; 
    
    inline QAction *            CFileMenu::actionNew()
    { return (_actionNew); }
    inline QAction *            CFileMenu::actionOpen()
    { return (_actionOpen); }
    inline QAction *            CFileMenu::actionSave()
    { return (_actionSave); }
    inline QAction *            CFileMenu::actionClose()
    { return (_actionClose); }
}

#endif /*CFILEMENU_H_*/




See more files for this project here

osgDesigner

osgDesigner is a graphical tool used to modify an OpenSceneGraph (OSG) scene using the osgIntrospection framework. OpenSceneGraph developpers will be able to extend osgDesigner at need using (editor | render | osgIntrospection wrapper) plugin system.

Project homepage: http://sourceforge.net/projects/osgdesigner
Programming language(s): C++,Shell Script
License: other

  CConfig.h
  CFileMenu.h
  CMainWindow.h
  CPropertiesModel.h
  CPropertiesView.h
  CPropertiesWidget.h
  CPropertyInfoModel.h
  CSceneGraphEditMenu.h
  CSceneGraphModel.h
  CSceneGraphView.h
  CSceneGraphWidget.h
  CTypeModel.h
  CTypeWidget.h
  CValueMimeData.h
  CValueModel.h
  CValueView.h
  Export.h
  FlagsConstructorDialog.h
  FlowLayout.h
  IEditorWidgetABC.h
  IListModel.h
  ITreeModel.h
  MACRO.h
  PluginManagerDialog.h
  SConfigManager.h
  SWorkSpace.h