static public void CloseProject() { //Close all the open levels CloseAllLevels(); //Set the status message Ogmo.MainWindow.StatusText = "Closed project " + Ogmo.Project.Name; //Call closed event if (OnProjectClose != null) { OnProjectClose(Project); } //Remove it! Project = null; //Tool and layer selection can be cleared now LayersWindow.SetLayer(-1); ToolsWindow.ClearTool(); //Force a garbage collection Ogmo.MainWindow.AddStartPage(); System.GC.Collect(); }
public override void OnEnable() { base.OnEnable(); toolsWindow = new ToolsWindow(this); mCameraOffset = new Vector2(0, 0); mCameraZoom = 1; }
public HUD() { fileWindow = new FileWindow(new Vector2(896, 0), new Vector2(256, 256)); assetsWindow = new AssetsWindow(new Vector2(0, 256), new Vector2(256, 512)); toolsWindow = new ToolsWindow(new Vector2(896, 256), new Vector2(256, 512)); layerEditWindow = new LayerEditWindow(Vector2.Zero, new Vector2(256, 256)); }
static private void Initialize() { //Figure out the program directory ProgramDirectory = Application.ExecutablePath.Remove(Application.ExecutablePath.IndexOf(Path.GetFileName(Application.ExecutablePath))); //Initialize global pens/brushes/bitmaps DrawUtil.Initialize(); //Make sure the recent project list is valid InitRecentProjects(); //The levels holder Levels = new List <Level>(); CurrentLevelIndex = -1; //The windows MainWindow = new MainWindow(); MainWindow.Shown += new EventHandler(MainWindow_Shown); LayersWindow = new LayersWindow(); ToolsWindow = new ToolsWindow(); TilePaletteWindow = new TilePaletteWindow(); EntitiesWindow = new EntitiesWindow(); EntitySelectionWindow = new EntitySelectionWindow(); LayersWindow.Show(MainWindow); ToolsWindow.Show(MainWindow); TilePaletteWindow.Show(MainWindow); EntitiesWindow.Show(MainWindow); EntitySelectionWindow.Show(MainWindow); LayersWindow.EditorVisible = ToolsWindow.EditorVisible = TilePaletteWindow.EditorVisible = EntitiesWindow.EditorVisible = EntitySelectionWindow.EditorVisible = false; //Add the exit event Application.ApplicationExit += onApplicationExit; }
private void ExecutedAddToolsCommand(object sender, ExecutedRoutedEventArgs e) { var wnd = new ToolsWindow { AvailableTasks = _availableTasks.Where(t => t.IsCategoryOf(TaskCategories.Tool)).ToArray() }; if (!wnd.ShowModal(this)) return; AddTasks(wnd.SelectedTasks); }
private void OpenToolsExecute() { _dispatcher.InvokeAsync(() => { _toolsWindow = new ToolsWindow() { Topmost = true }; _toolsWindow.DataContext = ObservationViewModel; _toolsWindow.Show(); }); }
public void ShowToolsWindow(ToolWindowEnum activeToolWindow) { if ((toolsWindow == null) || toolsWindow.IsDisposed) { toolsWindow = new ToolsWindow(); toolsWindow.Closed += new EventHandler(toolsWindow_Closed); } toolsWindow.Owner = this; toolsWindow.Show(); showToolsButton.Pushed = true; toolsWindow.ActiveToolWindow = activeToolWindow; }
public MainWindow() { InitializeComponent(); //create but hide the extra windows so that their state is always persistent if opened //they can be toggled on by clicking their button and close will be overridden to hide and not delete _settingsWindow = new SettingsWindow(); _toolsWindow = new ToolsWindow(); _playerWindow = new PlayerWindow(); _settingsWindow.Hide(); _toolsWindow.Hide(); _playerWindow.Hide(); // ReSharper disable once InconsistentNaming bool validDB = false; try { validDB = DatabaseStorage.InitDatabase(); } catch (Exception e) { Debug.Print(e.Message); Close(); } var names = DatabaseStorage.GetAllShowNames(); foreach (var name in names) { try { var showCard = new ShowCard(name, this); Wrapper.Children.Add(showCard); showCard.Width = 75; showCard.Height = 75; showCard.Background = Brushes.Green; showCard.Margin = new Thickness(10, 10, 10, 10); } catch (Exception e) { Debug.Print(e.Message); } } }
public MainGame(ILogger logger, IServiceProvider serviceProvider) { _logger = logger; _graphics = new GraphicsDeviceManager(this) { PreferredBackBufferWidth = 1200, PreferredBackBufferHeight = 768, PreferMultiSampling = true, IsFullScreen = false, SupportedOrientations = DisplayOrientation.LandscapeLeft | DisplayOrientation.LandscapeRight, GraphicsProfile = GraphicsProfile.HiDef, }; IsMouseVisible = true; Window.AllowUserResizing = true; _dockSpaceWindow = (DockSpaceWindow)serviceProvider.GetService(typeof(DockSpaceWindow)); _infoOverlayWindow = (InfoOverlayWindow)serviceProvider.GetService(typeof(InfoOverlayWindow)); _debugWindow = (DebugWindow)serviceProvider.GetService(typeof(DebugWindow)); _toolsWindow = (ToolsWindow)serviceProvider.GetService(typeof(ToolsWindow)); }
private void MainWindowLoaded(object sender, RoutedEventArgs e) { BusyIndicator.BusyContent = LocalizedStrings.Str2941; BusyIndicator.IsBusy = true; Task.Factory.StartNew(() => { InitializeDataSource(); var tasks = InitializeTasks(); GuiDispatcher.GlobalDispatcher.AddSyncAction(() => BusyIndicator.BusyContent = LocalizedStrings.Str2942.Put(LocalizedStrings.Securities)); ConfigManager.RegisterService <ISecurityProvider>(new FilterableSecurityProvider(_entityRegistry.Securities)); return(tasks); }) .ContinueWith(res => { BusyIndicator.IsBusy = false; if (res.IsFaulted && res.Exception != null) { var ex = res.Exception.InnerException; ex.LogError(); Mouse.OverrideCursor = null; new MessageBoxBuilder() .Caption(ex is DbException ? LocalizedStrings.Str2943 : LocalizedStrings.Str2915) .Text(ex.ToString()) .Error() .Owner(this) .Show(); Close(); return; } Tasks.AddRange(res.Result); var collectionView = (AutoRefreshCollectionViewSource)FindResource("SortedSources"); if (collectionView != null) { var view = (ListCollectionView)collectionView.View; view.CustomSort = new LanguageSorter(); } HydraEntityRegistry = _entityRegistry; var settings = _entityRegistry.Settings; try { _customAutorization = ConfigManager.TryGetService <IRemoteStorageAuthorization>(); } catch (Exception ex) { ex.LogError(); } if (_customAutorization == null) { _customAutorization = new DummyRemoteStorageAuthorization(); } ApplySettings(); InitializeGuiEnvironment(); if (settings.AutoStart) { Start(true); } AutomaticUpdater.ForceCheckForUpdate(true); if (Tasks.Count == 0) { var newTasks = new List <Type>(); var sourcesWnd = new SourcesWindow { AvailableTasks = _availableTasks.Where(t => !t.IsCategoryOf(TaskCategories.Tool)).ToArray() }; if (sourcesWnd.ShowModal(this)) { newTasks.AddRange(sourcesWnd.SelectedTasks); } var toolsWnd = new ToolsWindow { AvailableTasks = _availableTasks.Where(t => t.IsCategoryOf(TaskCategories.Tool)).ToArray() }; if (toolsWnd.ShowModal(this)) { newTasks.AddRange(toolsWnd.SelectedTasks); } if (newTasks.Any()) { AddTasks(newTasks); } } }, TaskScheduler.FromCurrentSynchronizationContext()); try { AdvertisePanel.Client = new NotificationClient(); } catch (Exception ex) { ex.LogError(); } }
public static void Initialize() { mMenuStrip = new Menu(); CreateInfoBar(); mToolsWindow = new ToolsWindow(); mToolsWindow.HasCloseButton = true; mGeometryWindow = new GeometryWindow(); mGeometryWindow.HasCloseButton = true; CreatePropertyGrids(); #region Scene PropertyGrid mScenePropertyGrid = new ScenePropertyGrid(GuiManager.Cursor); GuiManager.AddWindow(mScenePropertyGrid); mScenePropertyGrid.HasCloseButton = true; mScenePropertyGrid.Visible = false; mScenePropertyGrid.ShowPropertyGridOnStrongSelect = true; mScenePropertyGrid.UndoInstructions = UndoManager.Instructions; #endregion #region ShapeCollection PropertyGrid CreateShapeCollectionPropertyGrid(); #endregion #region Set type/IObjectDisplayer associations PropertyGrid.SetPropertyGridTypeAssociation(typeof(Polygon), typeof(PolygonEditor.Gui.PolygonPropertyGrid)); #endregion EditorData.EditingLogic.NodeNetworkEditorManager.AddNodeNetworkMenus(mMenuStrip); GuiManager.ObjectDisplayManager.NewWindowLimitation = NewWindowLimitation.ByRequestingWindow; }
public static void OpenWindow() { ToolsWindow myWindow = (ToolsWindow)GetWindow(typeof(ToolsWindow)); }
public static void Initialize() { Window.KeepWindowsInScreen = false; #region Assign engine references camera = GameForm.camera; #endregion fileButtonWindow = new FileButtonWindow(GuiManager.Cursor); ToolsWindow = new ToolsWindow(); mVisibleToggleWindows.Add(ToolsWindow); ListWindow = new ListWindow(ToolsWindow); mVisibleToggleWindows.Add(ListWindow); //#region Create AttributesWindow //mAttributesWindow = new AttributesWindow(messages); //mAttributesWindow.SetPositionTL(84.5f, 25.8f); //mAttributesWindow.Visible = false; //GuiManager.AddWindow(mAttributesWindow); //#endregion spriteGridPropertiesWindow = new SpriteGridCreationPropertiesWindow(GuiManager.Cursor); srSaveOptions = new SpriteRigSaveOptions(messages, GuiManager.Cursor); #region TextureCoordinateSelectionWindow mTextureCoordinateSelectionWindow = new TextureCoordinatesSelectionWindow(); GuiManager.AddWindow(mTextureCoordinateSelectionWindow); // set AddToListButtonShown to true before setting the visibility to false so that it updates correclty mTextureCoordinateSelectionWindow.AddToListButtonShown = true; mTextureCoordinateSelectionWindow.Visible = false; mTextureCoordinateSelectionWindow.HasCloseButton = true; mTextureCoordinateSelectionWindow.AddToListClickEventAdd(messages.AddDisplayRegion); mVisibleToggleWindows.Add(mTextureCoordinateSelectionWindow); #endregion #region MenuStrip mMenuStrip = new SpriteEditor.Gui.MenuStrip(); mMenuStrip.SavedSuccess += new EventHandler(mMenuStrip_SavedSuccess); #endregion GameData.EditorLogic.NodeNetworkEditorManager.AddNodeNetworkMenus(MenuStrip); CreateInfoBar(); CreatePropertyGrids(); CreateListDisplayWindows(); List<string> windowsToExclude = new List<string>(); windowsToExclude.Add(mMenuStrip.Name); LayoutManager.LoadWindowLayout(windowsToExclude); Window.KeepWindowsInScreen = true; }
/// <summary> /// Loads up the PDF maker window. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void PdfmakerButton_Click(object sender, RoutedEventArgs e) { ToolsWindow toolsWindow = new ToolsWindow(); toolsWindow.Show(); }
public static void Initialize() { mMenuStrip = new Menu(); mToolsWindow = new ToolsWindow(); CreatePropertyGrids(); mCommandDisplay = new CommandDisplay(); CreateListDisplayWindows(); }