Beispiel #1
0
        void OpenContextMenu()
        {
            if (contextmenu != null)
            {
                contextmenu.Destroy();
            }

            contextmenu = new Menu();

            //MenuItem submenuitem = new MenuItem("About TestPlugin...");
            //submenuitem.Activated += new EventHandler(Testpluginmenuitem_Activated);
            //contextmenu.Add(submenuitem);
            //contextmenu.Add(new MenuItem("item3"));

            MouseCache mousefiltermousecache = MouseCache.GetInstance();

            iMouseX = mousefiltermousecache.MouseX;
            iMouseY = mousefiltermousecache.MouseY;

            entity = Picker3dController.GetInstance().GetClickedEntity(iMouseX, iMouseY);

            contextmenucommanditems = new List <MenuItem>();
            contextmenucallbacks    = new List <ContextMenuHandler>();

            ContextMenuController.GetInstance().OnContextMenuPopup(this, new ContextMenuArgs(iMouseX, iMouseY, entity));

            AddPersistentItems();

            contextmenu.ShowAll();
            contextmenu.Popup(null, null, null, IntPtr.Zero, 3, Gtk.Global.CurrentEventTime);
            LogFile.WriteLine("after contextmenu popup");
        }
 public UIEntityPropertiesDialog()
 {
     selectionmodel = SelectionModel.GetInstance();
     ContextMenuController.GetInstance().ContextMenuPopup += new ContextMenuHandler(_ContextMenuPopup);
     ViewerState.GetInstance().StateChanged += new ViewerState.StateChangedHandler(UIEntityPropertiesDialog_StateChanged);
     //    SetFormSize();
     //KeyNameCache.GetInstance().KeyDown += new KeyNameCache.KeyDownHandler( UIEntityPropertiesDialog_KeyDown );
 }
Beispiel #3
0
        public ImportExportPrimBlender()
        {
            //MenuController.GetInstance().RegisterMainMenu(new string[]{ "&File","&Save World..." }, new MainMenuCallback( SaveWorld ) );
            MenuController.GetInstance().RegisterMainMenu(new string[] { "&File", "&Load Prim Blender file..." }, new MainMenuCallback(LoadWorld));

            //ContextMenuController.GetInstance().RegisterPersistentContextMenu(new string[]{ "World","&Save to File..." }, new ContextMenuHandler( ContextMenuSave ) );
            ContextMenuController.GetInstance().RegisterPersistentContextMenu(new string[] { "World", "&Load Prim Blender file..." }, new ContextMenuHandler(ContextMenuLoad));
        }
Beispiel #4
0
 public void ContextMenuPopup(object source, ContextMenuArgs e)
 {
     entity = e.Entity;
     if (entity != null)
     {
         LogFile.WriteLine("EntityDelete registering in contextmenu");
         ContextMenuController.GetInstance().RegisterContextMenu(new string[] { "Delete" }, new ContextMenuHandler(DeleteClick));
     }
 }
        public WorldPersistToXml()
        {
            //MenuController.GetInstance().RegisterMainMenu(new string[]{ "&File","&Save World..." }, new MainMenuCallback( SaveWorld ) );
            //MenuController.GetInstance().RegisterMainMenu(new string[]{ "&File","&Load World..." }, new MainMenuCallback( LoadWorld ) );

            ContextMenuController.GetInstance().RegisterPersistentContextMenu(new string[] { "World", "&Save to File..." }, new ContextMenuHandler(ContextMenuSave));
            ContextMenuController.GetInstance().RegisterPersistentContextMenu(new string[] { "World", "&Load from File..." }, new ContextMenuHandler(ContextMenuLoad));
            ContextMenuController.GetInstance().RegisterPersistentContextMenu(new string[] { "World", "&Load from Url..." }, new ContextMenuHandler(ContextMenuLoadFromUrl));
        }
Beispiel #6
0
 ServerInfo()
 {
     if (MetaverseServer.GetInstance().Running)
     {
         ContextMenuController.GetInstance().RegisterPersistentContextMenu(new string[] { "Network", "&Server Info..." }, new ContextMenuHandler(ServerInfoDialog));
         //ContextMenuController.GetInstance().RegisterPersistentContextMenu( new string[] { "Network", "&Private server Info..." }, new ContextMenuHandler( PrivateServerInfoDialog ) );
         MetaverseClient.GetInstance().Tick += new MetaverseClient.TickHandler(ServerInfo_Tick);
     }
 }
Beispiel #7
0
        public KeyHandlerQuit()
        {
            LogFile.WriteLine("instantiating keyhandlerquit");
            CommandCombos.GetInstance().RegisterAtLeastCommand("quit", new KeyCommandHandler(QuitKeyDown));
            //KeyFilterComboKeys keyfiltercombokeys = KeyFilterComboKeys.GetInstance();
            //keyfiltercombokeys.RegisterCombo( new string[]{"quit"},null, new KeyComboHandler( QuitKeyDown ) );

            //RendererFactory.GetInstance().RegisterContextMenu(new string[]{ "Quit","&Quit" }, new ContextMenuCallback( ContextMenuQuit ) );
            ContextMenuController.GetInstance().RegisterPersistentContextMenu(new string[] { "Quit", "&Quit" }, new ContextMenuHandler(ContextMenuQuit));
            MenuController.GetInstance().RegisterMainMenu(new string[] { "&File", "&Quit" }, new MainMenuCallback(Quit));
        }
 public void _ContextMenuPopup(object source, ContextMenuArgs e)
 {
     //    if( selectionmodel.GetNumSelected() == 1 )
     //  {
     thisentity = e.Entity;
     if (thisentity != null)
     {
         LogFile.WriteLine("EntityPropertiesDialog registering in contextmenu");
         ContextMenuController.GetInstance().RegisterContextMenu(new string[] { "&Edit" }, new ContextMenuHandler(ContextMenuProperties));
     }
     // }
 }
Beispiel #9
0
 public void ContextMenuPopup( object source, ContextMenuArgs e )
 {
     iMouseX = e.MouseX;
     iMouseY = e.MouseY;
     entity = e.Entity;
     if( entity != null )
     {
         LogFile.WriteLine("AssignTextureHandler registering in contextmenu");
         ContextMenuController.GetInstance().RegisterContextMenu(new string[]{ "Assign &Texture", "&All Faces" }, new ContextMenuHandler( AssignTextureAllFacesClick ) );
         ContextMenuController.GetInstance().RegisterContextMenu( new string[] { "Assign &Texture", "&Single Face" }, new ContextMenuHandler( AssignTextureSingleFaceClick ) );
     }
 }
Beispiel #10
0
        MainTerrainWindow()
        {
            Glade.XML app = new Glade.XML(EnvironmentHelper.GetExeDirectory() + "/TerrainEditing.glade", "mainwindow", "");
            app.Autoconnect(this);
            //raiselower.Activate();
            MetaverseClient.GetInstance().worldstorage.terrainmodel.TerrainModified += new TerrainModel.TerrainModifiedHandler(MainUIWindow_TerrainModified);
            HideWindow();

            mainwindow.Destroyed += new EventHandler(mainwindow_Destroyed);
            ViewerState.GetInstance().StateChanged += new ViewerState.StateChangedHandler(MainTerrainWindow_StateChanged);

            ContextMenuController.GetInstance().RegisterPersistentContextMenu(new string[] { "Edit Terrain..." },
                                                                              new ContextMenuHandler(EditTerrainContextMenuHandler));

            //inittime = DateTime.Now;
            //MetaverseClient.GetInstance().Tick += new MetaverseClient.TickHandler( MainTerrainWindow_Tick );
            KeyNameCache.GetInstance().KeyDown += new KeyNameCache.KeyDownHandler(MainTerrainWindow_KeyDown);
        }
Beispiel #11
0
 // register our contextmenu
 public static void Register()
 {
     ContextMenuController.GetInstance().RegisterPersistentContextMenu(new string[] { "&Create...", "&Box" }, new ContextMenuHandler(Create));
 }
Beispiel #12
0
 EntityDelete()
 {
     ContextMenuController.GetInstance().ContextMenuPopup += new ContextMenuHandler(ContextMenuPopup);
 }
Beispiel #13
0
 ConnectToServerDialog()
 {
     ContextMenuController.GetInstance().RegisterPersistentContextMenu(new string[] { "Network", "&Connect to server..." }, new ContextMenuHandler(ShowDialog));
 }
Beispiel #14
0
 DumpLogfile()
 {
     ContextMenuController.GetInstance().RegisterPersistentContextMenu(new string[] { "Help", "Dump Logfile..." },
                                                                       new ContextMenuHandler(_DumpLogfile));
 }
Beispiel #15
0
 public AssignTextureHandler()
 {
     LogFile.WriteLine("instantiating AssignTextureHandler" );
     ContextMenuController.GetInstance().ContextMenuPopup += new ContextMenuHandler( ContextMenuPopup );
 }
Beispiel #16
0
 public HelpAbout()
 {
     LogFile.WriteLine("instantiating HelpAbout");
     //MenuController.GetInstance().RegisterMainMenu(new string[]{ "&Help","&About..." }, new MainMenuCallback( About ) );
     ContextMenuController.GetInstance().RegisterPersistentContextMenu(new string[] { "&Help", "&About..." }, new ContextMenuHandler(About));
 }