public wnd1(EndianBinaryReader er) : base(er) { long basepos = er.BaseStream.Position - 0x4C; InflationLeft = er.ReadUInt16() / 16f; InflationRight = er.ReadUInt16() / 16f; InflationTop = er.ReadUInt16() / 16f; InflationBottom = er.ReadUInt16() / 16f; FrameSizeLeft = er.ReadUInt16(); FrameSizeRight = er.ReadUInt16(); FrameSizeTop = er.ReadUInt16(); FrameSizeBottom = er.ReadUInt16(); NrFrames = er.ReadByte(); byte tmp = er.ReadByte(); UseLTMaterial = (tmp & 1) == 1; UseVtxColorForAllWindow = (tmp & 2) == 2; Kind = (WindowKind)((tmp >> 2) & 3); DontDrawContent = (tmp & 8) == 16; Padding = er.ReadUInt16(); ContentOffset = er.ReadUInt32(); FrameOffsetTableOffset = er.ReadUInt32(); er.BaseStream.Position = basepos + ContentOffset; Content = new WindowContent(er); er.BaseStream.Position = basepos + FrameOffsetTableOffset; WindowFrameOffsets = er.ReadUInt32s(NrFrames); WindowFrames = new WindowFrame[NrFrames]; for (int i = 0; i < NrFrames; i++) { er.BaseStream.Position = basepos + WindowFrameOffsets[i]; WindowFrames[i] = new WindowFrame(er); } er.BaseStream.Position = basepos + SectionSize; }
protected void CreateDockingWindows() { // Create the docking manager instance _manager = new DockingManager(this, VisualStyle.IDE); // Define innner/outer controls for correct docking operation _manager.InnerControl = tabControl1; _manager.OuterControl = menuControl1; // Create the tree control TreeView tv = new DragTree(); tv.Nodes.Add(new TreeNode("First")); tv.Nodes.Add(new TreeNode("Second")); tv.Nodes.Add(new TreeNode("Third")); tv.Nodes.Add(new TreeNode("Fourth")); // Create a rich text box for the second content _global = new RichTextBox(); // Create content instances Content c1 = _manager.Contents.Add(tv, "TreeView"); Content c2 = _manager.Contents.Add(_global, "Another Window"); // Add to the display on the left hand side WindowContent wc = _manager.AddContentWithState(c1, State.DockLeft); // Add at the bottom of the same column _manager.AddContentToZone(c2, wc.ParentZone, 1); }
/// <summary> /// Sets the initial position of all Players /// </summary> /// <param name="positionID">The position ID</param> public void SetAllPlayerInitialPosition(int positionID) { foreach (PlayerViewModel player in AllPlayers) { player.CurrentPosition = 0; WindowContent.GetWindowContent().GetViewModel <GameBoardViewModel>().GamePool.GetGameCard(positionID).AddPlayerOnCard(player); } }
public void OpenStreetBuyingWindow(PlayerViewModel player, GameCardViewModel gameCard) { SetStreetBuyingGameCard(gameCard); SetEnableBuying(player.PlayerCheckBalance(gameCard.StreetPrice)); SetCashAfterBuying(player.PlayerCashAfterBuying(gameCard)); WindowContent.GetWindowContent().GetAdditionalViewModel <DoneButtonViewModel>().SetDoneButton(false); WindowContent.GetWindowContent().SetDetailsViewModelActive <StreetBuyingViewModel>(); }
protected override void OnNavigatedTo(NavigationEventArgs e) { WindowFlyoutContent Content = e.Parameter as WindowFlyoutContent; IconTitle.Text = Content.WindowIcon; TextTitle.Text = Content.WindowTitle; WindowContent.Navigate(Content.Content); }
/// <summary> /// 显示pad的位置 /// </summary> /// <param name="pad"></param> /// <param name="State"></param> protected void ShowPad(Content pad, State State) { WindowContent wc = new WindowContent(this.dockingManager, VisualStyle.IDE); wc = this.dockingManager.AddContentWithState(pad, State); this.dockingManager.AddContentToWindowContent(pad, wc); this.dockingManager.ShowContent(pad); }
public ApiResult GetContent(IntPtr hwnd) { Rectangle rect = Interop.GetWindowRect(hwnd); SystemWindow w = SystemWindow.FromPoint(rect.X, rect.Y); WindowContent content = w.Content; return(ApiResult.Unknown); }
new protected void Awake() { base.Awake(); content = GetComponentInChildren <WindowContent>(true); toolbar = GetComponentInChildren <WindowToolbar>(true); scrollRect = GetComponentInChildren <WindowScrollRect>(true); GetComponentsInChildren <WindowResizer>(true, resizers); }
public void ShowPad(IPadContent content) { if (contentHash[content] == null) { IProperties properties = (IProperties)propertyService.GetProperty("Workspace.ViewMementos", new DefaultProperties()); string type = content.GetType().ToString(); content.Control.Dock = DockStyle.None; Content c1; if (content.Icon != null) { ImageList imgList = new ImageList(); imgList.Images.Add(content.Icon); c1 = dockManager.Contents.Add(content.Control, content.Title, imgList, 0); } else { c1 = dockManager.Contents.Add(content.Control, content.Title); } c1.DisplaySize = new Size(270, 200); contentHash[content] = c1; if (properties.GetProperty(type, "Left") == "Left") { if (leftContent == null) { leftContent = dockManager.AddContentWithState(c1, State.DockLeft); } else { dockManager.AddContentToWindowContent(c1, leftContent); } } else if (properties.GetProperty(type, "Left") == "Bottom") { if (bottomContent == null) { bottomContent = dockManager.AddContentWithState(c1, State.DockBottom); } else { dockManager.AddContentToWindowContent(c1, bottomContent); } } } else { Content c = (Content)contentHash[content]; if (c != null) { dockManager.ShowContent(c); } } }
private void goCompare_Click(object sender, MouseButtonEventArgs e) { drawerUnbold(); Label lbl = sender as Label; lbl.FontWeight = FontWeights.SemiBold; actionBar_Text.Content = "osu!rank - " + Tx.T("osu rank.Compare"); WindowContent.Navigate(new osuPages.Compare()); closeDrawer(); }
void ShowMenu() { var windowContent = new WindowContent(); windowContent.onSelectionChanged += selected => value = selected; var content = getContent?.Invoke() ?? default; windowContent.Show(visualInput.worldBound, value, content.Items); }
private void goRippleOneUser_Click(object sender, MouseButtonEventArgs e) { drawerUnbold(); Label lbl = sender as Label; lbl.FontWeight = FontWeights.SemiBold; actionBar_Text.Content = "Ripple!rank - " + Tx.T("osu rank.One player"); WindowContent.Navigate(new RipplePages.OneUser()); closeDrawer(); }
private void goAbout_MouseDown(object sender, MouseButtonEventArgs e) { drawerUnbold(); Label lbl = sender as Label; lbl.FontWeight = FontWeights.SemiBold; actionBar_Text.Content = "osu!rank - " + Tx.T("osu rank.About"); WindowContent.Navigate(new About()); closeDrawer(); }
private void Return_To_MainPage(object sender, RoutedEventArgs e) { if (WindowContent.Content is SalesProducts sale) { sale.resetFilter(); } else { WindowContent.Navigate(new SalesProducts()); } }
public CommunityChestTests() { contentTest = WindowContent.GetWindowContent(); communityChestRef = WindowContent.GetWindowContent().CommunityChest; testPlayer = new PlayerViewModel(new PlayerModel() { CurrentPosition = 0, AmountHotels = 0, AmountHouses = 0, FirstThrow = 0, PlayerCash = 2000, PlayerID = 0, PlayerName = "Test", PrisonRoll = 7 }); WindowContent.GetWindowContent().ManagingPlayer.AddPlayer(testPlayer); WindowContent.GetWindowContent().ManagingPlayer.SetAllPlayerCollection(); }
private void controlBox_Format(object sender, ListControlConvertEventArgs e) { if (e.ListItem is string) { e.Value = "(whole window)"; } else { WindowContent wc = ((SystemWindow)e.ListItem).Content; e.Value = wc == null ? "<Unknown Type>" : wc.ShortDescription; } }
private void appendContent(StringBuilder sb, SystemWindow sw, WindowContent c) { if (c == null) { sb.AppendLine("<Unknown Type>"); return; } sb.AppendLine(c.ShortDescription); sb.AppendLine("Class Name: " + sw.ClassName); String ldesc = c.LongDescription.Replace("\n", "\r\n").Replace("\r\r\n", "\r\n"); if (ldesc != null && c.ShortDescription != ldesc) { sb.AppendLine("------------------------------------------------------------"); sb.AppendLine(ldesc); } }
private async void apiDialog_DialogClosing(object sender, MaterialDesignThemes.Wpf.DialogClosingEventArgs eventArgs) { if ((Int16)eventArgs.Parameter == 1) { if (keyBox.Text == "") { MessageBox.Show(Tx.T("errors.No key entered"), Tx.T("errors.Error"), MessageBoxButton.OK, MessageBoxImage.Error); eventArgs.Cancel(); } else { string test; try { using (HttpClient wc = new HttpClient()) { test = await wc.GetStringAsync("https://osu.ppy.sh/api/get_user?k=" + keyBox.Text + "&u=Cookiezi&m=3"); Settings.Default.apikey = keyBox.Text; } hasApiKey = true; osuExpander.IsEnabled = true; Settings.Default.RippleOnly = false; Settings.Default.Save(); } catch (Exception) { MessageBox.Show(Tx.T("errors.Invalid key"), Tx.T("errors.Error"), MessageBoxButton.OK, MessageBoxImage.Error); eventArgs.Cancel(); } } } else if ((Int16)eventArgs.Parameter == 0) { MessageBox.Show(Tx.T("errors.You need a key"), Tx.T("errors.Error"), MessageBoxButton.OK, MessageBoxImage.Error); Application.Current.Shutdown(); } else if ((Int16)eventArgs.Parameter == -1) { osuExpander.IsEnabled = false; hasApiKey = false; Settings.Default.RippleOnly = true; Settings.Default.Save(); drawerUnbold(); goRippleOnePlayer.FontWeight = FontWeights.SemiBold; actionBar_Text.Content = "Ripple!rank - " + Tx.T("osu rank.One player"); WindowContent.Navigate(new RipplePages.OneUser()); } }
internal static void show(Form form, string id = null) { if (id == null) { id = Assembly.GetExecutingAssembly().GetName().Name + "_" + form.GetType().Name; } WindowManager winMngr = // ! вычислит только если Addin загружено в DefaultDomain WindowManager.GetForMicroStation(); if (winMngr == null) { form.Show(); return; } WindowContent m_window = null; if (cache.ContainsKey(form)) { m_window = cache[form]; } else { try { m_window = winMngr.DockPanel(form, id, form.Text, DockLocation.Floating); // здесь вызов Frm_Load } catch (System.Exception ex) { ex.Alert(); return; } cache.Add(form, m_window); form.FormClosed += Form_FormClosed; } FormWindowState state = form.WindowState; form.WindowState = state != FormWindowState.Normal ? FormWindowState.Normal : state; m_window.MinimumSize = new System.Drawing.Size( form.MinimumSize.Width + 5, form.MinimumSize.Height + 5); m_window.Show(); m_window.FloatingHostForm?.Refresh(); form.Refresh(); }
public MainWindowView() { InitializeComponent(); // Reference for this application curApp = (App)Application.Current; // Initialize views for Window mappingSetView = new MappingSetView(); // Initialize ViewModel and assign to DataContext for window/page mappingSetView.DataContext = new ViewModel.MappingSetViewModel(curApp.FileDialog, curApp.StandardMappingSetRepository, curApp.ErrorHandler); //Only one view for now WindowContent.Navigate(mappingSetView); }
public bool windowAlreadyExists(WindowContent contents) { //checks to see if the window already exists bool result = false; int counter = 0; while (!result && counter < this.windows.Count) { if (this.windows[counter].Data.Contents.sameContent(contents)) { result = true; } counter++; } return(result); }
/// <summary> /// Returns a HouseViewModel reference of a house that is not yet in use. /// If no house is available it returns nothing and shows a MessageBox with information regarding this case. /// Sets all neccessary fields in the HouseViewModel. /// </summary> /// <param name="street"></param> /// <returns></returns> public HouseViewModel BuildHouse(GameCardViewModel street) { foreach (HouseViewModel house in Houses) { if (house.IsHouseNotNull() && house.IsHouseNotInUse()) { UnavailableHouses[house.GetUniqueID()] = house; Houses[house.GetUniqueID()] = null; house.SetBuiltStreet(street); house.SetHouseInUse(true); UpdateAvailableHouses(); street.AddHouseToStreet(house); WindowContent.GetWindowContent().OpenMessageBox(String.Format("{0} Häuser übrig", AvailableHouses)); return(house); } } WindowContent.GetWindowContent().OpenMessageBox("Keine Häuser mehr verfügbar!"); return(null); }
private string getWindowProperties(SystemWindow sw) { string content; if (includeContents.Checked) { try { WindowContent cc = sw.Content; if (cc == null) { content = "Unknown"; } else { content = "\"" + cc.ShortDescription + "\"\r\n" + cc.LongDescription.Replace("\n", "\r\n").Replace("\r\r\n", "\r\n"); } } catch (Exception ex) { content = "\"Exception\"\r\n" + ex.ToString(); } } else { content = "(Enable in Options tab if desired)"; } return(" Handle:\t\t0x" + sw.HWnd.ToString("x8") + " (" + sw.HWnd + ")\r\n" + " DialogID:\t0x" + sw.DialogID.ToString("x8") + " (" + sw.DialogID + ")\r\n" + " Position:\t\t(" + sw.Position.Left + ", " + sw.Position.Top + "), " + sw.Position.Width + "x" + sw.Position.Height + "\r\n" + " Parent:\t\t" + (sw.Parent == null ? "None" : (sw.ParentSymmetric == null ? "Asymmetric" : "Symmetric") + " 0x" + sw.Parent.HWnd.ToString("x8")) + "\r\n" + " Appearance:\t" + (sw.Enabled ? "Enabled " : "Disabled ") + (sw.Visible ? "Visible" : "Invisible") + "\r\n" + " Changable:\t" + (sw.Movable ? "Movable " : "NotMovable ") + (sw.Resizable ? "Resizable" : "FixedSize") + "\r\n" + " WindowState:\t" + (sw.TopMost ? "TopMost " : "") + sw.WindowState.ToString() + "\r\n" + " Process:\t\t" + sw.Process.ProcessName + " (0x" + sw.Process.Id.ToString("x8") + "), " + "\r\n" + " ClassName:\t\"" + sw.ClassName + "\"\r\n" + " Title:\t\t\"" + sw.Title + "\"\r\n\r\n" + "Content:\t" + content); }
public WindowController getControllerByData(WindowContent content) { //gets the controller based by the content WindowController result = null; int counter = 0; while (result == null && counter < this.windows.Count) { if (this.windows[counter].Data.Contents.sameContent(content)) { result = this.windows[counter]; } counter++; } return(result); }
public HouseViewModel BuildHotel(GameCardViewModel street) { AddHousesToPool(street); street.Houses.Clear(); foreach (HouseViewModel hotel in Hotels) { if (hotel.IsHouseNotNull() && hotel.IsHouseNotInUse()) { UnavailableHotels[hotel.GetUniqueHotelID()] = hotel; Hotels[hotel.GetUniqueHotelID()] = null; hotel.SetBuiltStreet(street); hotel.SetHouseInUse(true); UpdateAvailableHouses(); street.AddHouseToStreet(hotel); return(hotel); } } WindowContent.GetWindowContent().OpenMessageBox("Keine Hotels mehr verfügbar!"); return(null); }
public static void SetBorderFixed(WindowContent content) { if (!_setBorderFixed(content.Zone)) { if (content.Zone != null) { content.Zone.ParentChanged += ParentChangedEvent; if (ZoneContentsList.ContainsKey(content.Zone)) { ZoneContentsList[content.Zone].Add(content); } else { List <WindowContent> wcList = new List <WindowContent>(); wcList.Add(content); ZoneContentsList.Add(content.Zone, wcList); } } } }
private void InitDockingWindows() { dockingManager = new DockingManager(this, VisualStyle.IDE); //Add the tab control first. tabControl = new Crownwood.Magic.Controls.TabControl(); Panel welcomePanel = new Panel(); Panel welcomePanel2 = new Panel(); welcomePanel.Dock = DockStyle.Fill; Crownwood.Magic.Controls.TabPage welcomePage = new Crownwood.Magic.Controls.TabPage("Welcome", welcomePanel); tabControl.TabPages.Add(welcomePage); tabControl.Appearance = Crownwood.Magic.Controls.TabControl.VisualAppearance.MultiDocument; tabControl.Dock = DockStyle.Fill; tabControl.ClosePressed += new EventHandler(DoTabControlClosePressed); Controls.Add(tabControl); //Add Message form messageForm = new MessagesForm(); Content messageContent = dockingManager.Contents.Add(messageForm, "System Messages"); WindowContent messageWindowContent = dockingManager.AddContentWithState(messageContent, State.DockBottom) as WindowContent; //Add Menus topMenu = CreateMenus(); Controls.Add(topMenu); //Add status bar statusBar = new StatusBar(); statusBar.Dock = DockStyle.Bottom; statusBar.ShowPanels = true; StatusBarPanel statusBarPanel = new StatusBarPanel(); statusBarPanel.AutoSize = StatusBarPanelAutoSize.Spring; statusBar.Panels.Add(statusBarPanel); Controls.Add(statusBar); dockingManager.InnerControl = tabControl; dockingManager.OuterControl = statusBar; }
private void DockingPanel() { DockingManager _dockingManager = new DockingManager(this, VisualStyle.IDE); _dockingManager.OuterControl = panel_right; _dockingManager.InnerControl = panel_all; //panel_tj.Dock = DockStyle.Fill; panel_tj.Visible = true; panel_br.Visible = true; Content content = _dockingManager.Contents.Add(this.panel_left, "条件选择"); content.CloseButton = false; content.HideButton = true; content.DisplaySize = panel_left.Size; content.AutoHideSize = panel_left.Size; WindowContent wc = _dockingManager.AddContentWithState(content, State.DockLeft) as WindowContent; }
/// <summary> /// The player buys a hotel. /// </summary> /// <param name="gameCard"></param> public void SellHotel(GameCardViewModel gameCard) { if (gameCard.IsActivePlayerOwningPlayer()) { if (WindowContent.GetWindowContent().GetManagingPlayer().GetActivePlayer().IsMonopolyComplete(gameCard)) { gameCard.SetMinMonopolyHouses(gameCard); if (gameCard.NrOfHousesGreaterThanMonopolyMin()) { gameCard.SetMaxMonopolyHouses(gameCard); gameCard.DecreaseHouseAmount(); gameCard.GetOwningPlayer().PlayerAddMoney(gameCard.GetSellPrice()); gamePool.SellHotel(gameCard); } else { WindowContent.GetWindowContent().OpenMessageBox("Verkaufen nicht möglich! Um auf dieser Straße ein weiteres Haus verkaufen zu können müssen zunächst auf allen Straßen des Monopols gleich viele Häuser stehen!"); } } } }
/// <summary> /// The player buys a hotel. /// </summary> /// <param name="gameCard"></param> public void BuyHotel(GameCardViewModel gameCard) { if (gameCard.IsActivePlayerOwningPlayer()) { if (WindowContent.GetWindowContent().GetManagingPlayer().GetActivePlayer().IsMonopolyComplete(gameCard)) { gameCard.SetMaxMonopolyHouses(gameCard); if (gameCard.NrOfHousesLessThanMonopolyMax()) { gameCard.DecreaseHouseAmount(); gameCard.GetOwningPlayer().PlayerRemoveMoney(gameCard.GetHousePrice()); gamePool.BuildHotel(gameCard); gameCard.SetMinMonopolyHouses(gameCard); } else { WindowContent.GetWindowContent().OpenMessageBox("Bauen nicht möglich! Bauen Sie zunächst gleichmäßig viele Häuser auf diesem Monopol!"); } } } }
private void update(SystemWindow sw, bool finished) { current = sw; if (sw == null) { shortText.Text = ""; saveButton.Enabled = saveAllButton.Enabled = false; } else { saveAllButton.Enabled = true; className.Text = sw.ClassName; content = finished ? sw.Content: sw.PreviewContent; if (content == null) { shortText.Text = "<Unknown Type>"; saveButton.Enabled = false; } else { shortText.Text = content.ShortDescription; saveButton.Enabled = true; } } }