00001 #ifndef ORTHOCONTEXTMENU_H_ 00002 #define ORTHOCONTEXTMENU_H_ 00003 00004 #include <gtk/gtk.h> 00005 00006 #include "math/Vector3.h" 00007 00008 namespace ui 00009 { 00014 class OrthoContextMenu 00015 { 00016 private: 00017 00018 // The GtkWidget representing the menu 00019 GtkWidget* _widget; 00020 00021 // Last provided 3D point for action 00022 Vector3 _lastPoint; 00023 00027 void checkConnectEntities (); 00028 00031 void checkFitTexture (); 00032 00035 void checkGenerateMaterial (); 00036 00039 void checkGenerateTerrain (); 00040 00041 // GTK widgets that are context dependent 00042 GtkWidget* _connectEntities; 00043 GtkWidget* _fitTexture; 00044 GtkWidget* _generateMaterials; 00045 GtkWidget* _generateTerrain; 00046 00047 private: 00048 00049 // Enable or disable the "convert to static" option based on the number 00050 // of selected brushes. 00051 void checkConvertStatic (); 00052 00053 /* Gtk Callbacks */ 00054 00055 static void callbackAddEntity (GtkMenuItem* item, OrthoContextMenu* self); 00056 static void callbackAddLight (GtkMenuItem* item, OrthoContextMenu* self); 00057 static void callbackAddModel (GtkMenuItem* item, OrthoContextMenu* self); 00058 static void callbackGenerateMaterials (GtkMenuItem* item, OrthoContextMenu* self); 00059 static void callbackGenerateTerrain (GtkMenuItem* item, OrthoContextMenu* self); 00060 static void callbackConnectEntities (GtkMenuItem* item, OrthoContextMenu* self); 00061 static void callbackFitTexture (GtkMenuItem* item, OrthoContextMenu* self); 00062 static void callbackAddSound (GtkMenuItem* item, OrthoContextMenu* self); 00063 00064 public: 00065 00068 OrthoContextMenu (); 00069 00077 void show (const Vector3& point); 00078 00086 static void displayInstance (const Vector3& point); 00087 }; 00088 } 00089 00090 #endif /*ORTHOCONTEXTMENU_H_*/