b3view/UserInterface.h

81 lines
2.4 KiB
C
Raw Normal View History

2010-04-21 07:48:36 -07:00
#ifndef USERINTERFACE_H
#define USERINTERFACE_H
#include "extlib/CGUITTFont.h"
#include <irrlicht/irrlicht.h>
// Forward declaration of class Engine
class Engine;
enum UserInterfaceElements {
2010-04-23 02:00:07 -07:00
UIE_FILEMENU = 1003,
UIE_LOADFILEDIALOG = 1100,
// UIE_LOADBUTTON = 1101,
UIE_LOADTEXTUREDIALOG = 1200,
UIE_VIEWMENU = 2000,
UIE_PLAYBACKWINDOW = 3000,
UIE_PLAYBACKSTARTSTOPBUTTON = 3001,
UIE_PLAYBACKINCREASEBUTTON = 3002,
UIE_PLAYBACKDECREASEBUTTON = 3003,
UIE_PLAYBACKSETFRAMEEDITBOX = 3004,
UIE_TEXTUREPATHSTATICTEXT = 3005,
UIE_TEXTUREPATHEDITBOX = 3006
2010-04-21 07:48:36 -07:00
};
enum UserInterfaceCommands {
UIC_FILE_LOAD = 1000,
UIC_FILE_QUIT = 1001,
UIC_FILE_LOAD_TEXTURE = 1002,
UIC_VIEW_WIREFRAME = 2001,
UIC_VIEW_LIGHTING = 2002,
UIC_VIEW_TEXTURE_INTERPOLATION = 2003
2010-04-21 07:48:36 -07:00
};
class UserInterface : public irr::IEventReceiver {
2010-04-21 07:48:36 -07:00
private:
irr::s32 spacing_y;
Engine* m_Engine;
irr::gui::IGUIEnvironment* m_Gui;
irr::gui::CGUITTFont* m_GuiFont;
irr::gui::CGUITTFace* m_GuiFontFace;
2010-04-21 07:48:36 -07:00
void setupUserInterface();
void displayLoadFileDialog();
2019-03-07 14:17:42 -08:00
void displayLoadTextureDialog();
void handleMenuItemPressed(irr::gui::IGUIContextMenu* menu);
2010-04-21 07:48:36 -07:00
2010-08-16 05:23:20 -07:00
bool m_WireframeDisplay;
bool m_Lighting;
bool m_TextureInterpolation;
irr::gui::IGUIWindow* playbackWindow;
irr::core::dimension2d<irr::u32> m_WindowSize; // previous size
2010-04-21 07:48:36 -07:00
public:
irr::gui::IGUIContextMenu* menu;
irr::gui::IGUIContextMenu* fileMenu;
irr::gui::IGUIContextMenu* viewMenu;
irr::gui::IGUIButton* playbackStartStopButton;
irr::gui::IGUIButton* playbackIncreaseButton;
irr::gui::IGUIButton* playbackDecreaseButton;
irr::gui::IGUIEditBox* playbackSetFrameEditBox;
irr::gui::IGUIStaticText* texturePathStaticText;
irr::gui::IGUIEditBox* texturePathEditBox;
irr::u32 INDEX_VIEW_TEXTURE_INTERPOLATION;
irr::u32 INDEX_VIEW_WIREFRAME_MESH;
irr::u32 INDEX_VIEW_LIGHTING;
void snapWidgets();
2019-03-07 21:52:29 -08:00
UserInterface(Engine* device);
2010-04-21 07:48:36 -07:00
~UserInterface();
irr::gui::IGUIEnvironment* getGUIEnvironment() const;
void drawStatusLine() const;
bool loadNextTexture(int direction);
2010-04-21 07:48:36 -07:00
// IEventReceiver
virtual bool OnEvent(const irr::SEvent& event);
2010-04-21 07:48:36 -07:00
};
#endif // USERINTERFACE_H