private void Start() { priceText = GetComponentInChildren <TextMeshProUGUI>(); display = GetComponentInChildren <IconBox>(); priceText.text = price.ToString(); }
void Awake() { playerStatusScript = GetComponent<PlayerStatus> (); iconBoxScript = GameObject.FindGameObjectWithTag ("IconBox").GetComponent<IconBox> (); colorNormal = new Color (1, 1f, 1f); colorBonus = new Color (0f/255f, 172f/255f, 255f/255f); }
private UIElement CreateTitle() { var border = new Border { Padding = new Thickness(10, 5, 0, 5), BorderBrush = Brushes.Silver, BorderThickness = new Thickness(0, 0, 0, 1) }; var panel = new StackPanel { Orientation = Orientation.Horizontal }; panel.SetValue(TextBlock.ForegroundProperty, Brushes.SkyBlue); //添加图标 var icon = new IconBox { Code = "\uf044", Width = 20, Margin = new Thickness(0, 0, 10, 0) }; panel.Children.Add(icon); //添加标题 var title = new TextBlock { FontSize = 16, FontWeight = FontWeights.Bold, VerticalAlignment = VerticalAlignment.Center }; title.SetBinding(TextBlock.TextProperty, new Binding { Source = this, Path = new PropertyPath(Group.TitleProperty) }); panel.Children.Add(title); border.Child = panel; SetIsFullLine(border, true); return(border); }
void Awake() { playerStatusScript = GetComponent <PlayerStatus> (); iconBoxScript = GameObject.FindGameObjectWithTag("IconBox").GetComponent <IconBox> (); colorNormal = new Color(1, 1f, 1f); colorBonus = new Color(0f / 255f, 172f / 255f, 255f / 255f); }
public void ShowDice(Popup.PopupAction diceAction) { IconPopup dicePopup = new IconPopup(IconPopupType.Dice, diceAction); GameObject dice = boxPools[typeof(IconBox)].TakeObject(); dice.GetComponent <Animator>().SetBool("Dice", true); DiceBox = dice.GetComponent <IconBox>(); DiceBox.Init(dicePopup); }
public MessageBoxResult ShowMessage(string message, MessageBoxButton btns, string caption = "提示信息", Brush icon = null) { var ret = Key.None; switch (btns) { case MessageBoxButton.OK: if (icon == null) { icon = IconBox.GetIconBrush("\uf0eb", Brushes.Yellow); } ShowMessage(message, caption, icon, null); return(MessageBoxResult.OK); case MessageBoxButton.OKCancel: if (icon == null) { icon = IconBox.GetIconBrush("\uf29c", Brushes.SkyBlue); } ret = ShowMessage(message, caption, icon, new List <Tuple <string, Key, Action> > { new Tuple <string, Key, Action>("确定", Key.O, null), new Tuple <string, Key, Action>("取消", Key.C, null) }); return(ret == Key.O ? MessageBoxResult.OK : MessageBoxResult.Cancel); case MessageBoxButton.YesNoCancel: if (icon == null) { icon = IconBox.GetIconBrush("\uf29c", Brushes.SkyBlue); } ret = ShowMessage(message, caption, icon, new List <Tuple <string, Key, Action> > { new Tuple <string, Key, Action>("是", Key.Y, null), new Tuple <string, Key, Action>("否", Key.N, null), new Tuple <string, Key, Action>("取消", Key.C, null) }); return(ret == Key.Y ? MessageBoxResult.Yes : ret == Key.N ? MessageBoxResult.No : MessageBoxResult.Cancel); case MessageBoxButton.YesNo: if (icon == null) { icon = IconBox.GetIconBrush("\uf29c", Brushes.SkyBlue); } ret = ShowMessage(message, caption, icon, new List <Tuple <string, Key, Action> > { new Tuple <string, Key, Action>("是", Key.Y, null), new Tuple <string, Key, Action>("否", Key.N, null) }); return(ret == Key.Y ? MessageBoxResult.Yes : MessageBoxResult.No); default: throw new NotSupportedException("NotSupportedException!"); } }
/// <summary> /// Zamyka popupbox, który zawiera podany pattern /// </summary> /// <param name="source">Popup, który jest zawarty w popupbox-ie</param> public void ClosePopup(Popup source) { if (DiceBox != null && DiceBox.source == source) { DiceBox.Close(); DiceBox = null; } else { showedPopups.FirstOrDefault(box => box.source == source)?.Close(); } }
private void starButton4_ClickButton(object sender, EventArgs e) { BrowseFile.ShowDialog(); var f = BrowseFile.FileName; if (new System.IO.FileInfo(f).Exists == false) { return; } ClassIcon = new Bitmap(f); ClassIcon = new Bitmap(ClassIcon, new Size(IconBox.Width, IconBox.Height)); IconBox.Image = ClassIcon; IconBox.Invalidate(); Invalidate(); }
void SetupIcons() { int count = 0; PlaceCategory[] tempCategories = PlacesRanking.instance.categories; tempCategories = tempCategories.OrderBy(c => c.category).ToArray(); foreach (var item in tempCategories) { GameObject tempIcon = Instantiate(iconBoxPrefab, transform.position, transform.rotation); tempIcon.transform.SetParent(iconsSpawn); tempIcon.transform.localScale = tempIcon.transform.lossyScale; tempIcon.SetActive(true); IconBox tempIconBox = tempIcon.GetComponent <IconBox>(); tempIconBox.SetupIcon(item.smallIcon, item.id, item.Category.color); customIcons.Add(tempIconBox); count++; } }
private void Start() { display = GetComponentInChildren <IconBox>(); }
//-------------------methods------------------ protected void Build() { VBox vbox; Alignment align; Gtk.Image settings_icon; AppPaintable = true; KeepAbove = true; Decorated = false; // This typehint gets the window to raise all the way to top. TypeHint = WindowTypeHint.Splashscreen; try { SetIconFromFile("/usr/share/icons/gnome/scalable/actions/system-run.svg"); } catch { } SetColormap(); resultsWindow = new ResultsWindow(BackgroundColor, NumberResultsDisplayed); resultsWindow.SelectionChanged += OnResultsWindowSelectionChanged; currentPane = Pane.First; frame = new GlossyRoundedFrame(); frame.DrawFill = frame.DrawFrame = true; frame.FillColor = frame.FrameColor = BackgroundColor; frame.FillAlpha = frame.FrameAlpha = WindowTransparency; frame.Radius = Screen.IsComposited ? IconBoxRadius : 0; Add(frame); frame.Show(); vbox = new VBox(false, 0); frame.Add(vbox); vbox.BorderWidth = IconBoxPadding; vbox.Show(); settings_icon = new Gtk.Image(GetType().Assembly, "settings-triangle.png"); align = new Alignment(1.0F, 0.0F, 0, 0); align.SetPadding(3, 0, 0, IconBoxPadding); align.Add(settings_icon); vbox.PackStart(align, false, false, 0); settings_icon.Show(); align.Show(); resultsHBox = new HBox(false, (int)IconBoxPadding * 2); resultsHBox.BorderWidth = IconBoxPadding; vbox.PackStart(resultsHBox, false, false, 0); resultsHBox.Show(); iconbox = new IconBox[3]; iconbox[0] = new IconBox(IconBoxIconSize); iconbox[0].IsFocused = true; iconbox[0].Radius = IconBoxRadius; resultsHBox.PackStart(iconbox[0], false, false, 0); iconbox[0].Show(); iconbox[1] = new IconBox(IconBoxIconSize); iconbox[1].IsFocused = false; iconbox[1].Radius = IconBoxRadius; resultsHBox.PackStart(iconbox[1], false, false, 0); iconbox[1].Show(); iconbox[2] = new IconBox(IconBoxIconSize); iconbox[2].IsFocused = false; iconbox[2].Radius = IconBoxRadius; resultsHBox.PackStart(iconbox[2], false, false, 0); // iconbox[2].Show (); align = new Alignment(0.5F, 0.5F, 1, 1); align.SetPadding(0, 2, 0, 0); label = new SymbolDisplayLabel(); align.Add(label); vbox.PackStart(align, false, false, 0); label.Show(); align.Show(); ScreenChanged += OnScreenChanged; ConfigureEvent += OnConfigureEvent; SizeAllocated += delegate { Reposition(); }; iconbox[0].LinesChanged += OnLineChangedEvent; iconbox[1].LinesChanged += OnLineChangedEvent; iconbox[2].LinesChanged += OnLineChangedEvent; Reposition(); }
private void Analysis_Load(object sender, EventArgs e) { dfOlap.AutoApply = true; dfOlap.AutoGenerateFilters = false; dfOlap.FilterChanged += DfOlap_FilterChanged; dfMap = new C1DataFilter(); dfMap.AutoApply = true; dfMap.AutoGenerateFilters = false; dfMap.FilterChanged += DfMap_FilterChanged; var dashboardLayout = new C1DashboardLayout(); _vectorLayer = new C1.Win.Map.VectorLayer() { LabelVisibility = LabelVisibility.Visible }; _vectorLayer.LabelStyle.Font = new Font(Font.FontFamily, 7); Map.TileLayer.TileSource = new VirtualEarthRoadSource(); Map.Layers.Add(_vectorLayer); var engine = OlapPanel.FlexPivotEngine; engine.DataSource = DataService.GetService().ProductWiseSaleCollection; InitOlap(engine); var selector = new ValRangeSelector() { Dock = DockStyle.Bottom }; ChecklistFilter fCategories = new ChecklistFilter("Category", true); fCategories.HeaderText = Strings.Resource.DataFilter_Categories; fCategories.ItemsSource = DataService.GetService().ProductWiseSaleCollection; fCategories.ValueMemberPath = "Category"; fCategories.SelectAll(); dfOlap.Filters.Add(fCategories); dfMap.Filters.Add(fCategories); ChecklistFilter fModels = new ChecklistFilter("Product", true); fModels.HeaderText = Strings.Resource.DataFilter_Products; fModels.ItemsSource = fCategories.ItemsSource; fModels.ValueMemberPath = "Product"; fModels.SelectAll(); dfOlap.Filters.Add(fModels); dfMap.Filters.Add(fModels); RangeFilter fSales = new RangeFilter("Sales", true); fSales.HeaderText = Strings.Resource.DataFilter_Sales; var list = from prod in DataService.GetService().ProductWiseSaleCollection.Cast <ProductsWiseSaleItem>() select prod.Sales; fSales.Maximum = list.Max(); fSales.Minimum = list.Min(); dfOlap.Filters.Add(fSales); dfMap.Filters.Add(fSales); selector.DateRangeChanged += (s, ev) => { dfOlap.DataSource = DataService.GetService().ProductWiseSaleCollection; dfMap.DataSource = DataService.GetService().GetRegionWiseSalesWithCategory(); DataService.GetService().GetRegionWiseSaleCollection = () => dfMap.View.ToList(); DataService.GetService().DateRange = ev.NewValue; UpdataMapMark(); chartOpportunities.DataSource = DataService.GetService().OpportunityItemList; chartOpportunities.Series.Clear(); var series = new Series(); series.Binding = series.Name = "Sales"; chartOpportunities.Series.Add(series); chartOpportunities.BindingX = "Level"; chartOpportunities.DataLabel.Position = C1.Chart.LabelPosition.Center; chartOpportunities.DataLabel.Content = "{}{y:C0}"; chartOpportunities.ChartType = C1.Chart.ChartType.Funnel; }; Controls.Add(selector); dashboardLayout.Options.ToolIconAppearance = ToolIconAppearance.UpperRight; dashboardLayout.AttachToLayout(new SplitLayout(c1SplitContainerMain)); IconBox settings = new IconBox() { BackgroundImage = Properties.Resources.settings_work_tool }; settings.Click += (s, ev) => { OlapPanel.Location = PointToClient(settings.PointToScreen(new Point(-2, settings.Height + 2))); if (OlapPanel.Right > Right) { OlapPanel.Left = Right - OlapPanel.Width - 2; } OlapPanel.Parent = this; OlapPanel.Visible = true; OlapPanel.BringToFront(); }; OlapPanel.MouseLeave += (s, ev) => OlapPanel.Visible = false; IconBox dataFilter = new IconBox() { BackgroundImage = Properties.Resources.C1DataFilter }; dataFilter.Click += (s, ev) => { dfOlap.Location = PointToClient(dataFilter.PointToScreen(new Point(-2, dataFilter.Height + 2))); if (dfOlap.Right > Right) { dfOlap.Left = Right - dfOlap.Width - 2; } dfOlap.Parent = this; dfOlap.Visible = true; dfOlap.BringToFront(); }; settings.VisibleChanged += (s, ev) => { settings.Visible = dashboardLayout.GetSelectedItem()?.ItemContainer == c1SplitterPanelGrid; dataFilter.Visible = settings.Visible; }; dfOlap.MouseLeave += (s, ev) => dfOlap.Visible = false; OlapGrid.Resize += (s1, ev1) => { OlapPanel.Visible = false; dfOlap.Visible = false; }; dashboardLayout.ItemContainerSelected += (s, ev) => { settings.Visible = dashboardLayout.GetSelectedItem()?.ItemContainer == c1SplitterPanelGrid; dataFilter.Visible = settings.Visible; }; dashboardLayout.Options.HeaderElements.Add(dataFilter); dashboardLayout.Options.HeaderElements.Add(settings); dashboardLayout.SetCaption(c1SplitterPanelGrid, Strings.Resource.ProductWise_Header); dashboardLayout.SetCaption(c1SplitterPanel3, Strings.Resource.RegionWise_Header); dashboardLayout.SetCaption(c1SplitterPanel4, Strings.Resource.Opportunities_Header); this.c1SplitterPanelGrid.Width = 565; selector.SendToBack(); ScanControls(this); }
void ReleaseDesignerOutlets() { if (Avatar != null) { Avatar.Dispose(); Avatar = null; } if (BottomConstraint != null) { BottomConstraint.Dispose(); BottomConstraint = null; } if (BottomRuler2 != null) { BottomRuler2.Dispose(); BottomRuler2 = null; } if (IconBox != null) { IconBox.Dispose(); IconBox = null; } if (ImageCollection != null) { ImageCollection.Dispose(); ImageCollection = null; } if (Input != null) { Input.Dispose(); Input = null; } if (InputBoxHieghtConstraint != null) { InputBoxHieghtConstraint.Dispose(); InputBoxHieghtConstraint = null; } if (MentionUser != null) { MentionUser.Dispose(); MentionUser = null; } if (PickImage != null) { PickImage.Dispose(); PickImage = null; } if (TakeImage != null) { TakeImage.Dispose(); TakeImage = null; } }
private void Timer_Tick(object sender, EventArgs e) { lock (Locker) { if (!(sender is Timer timer)) { return; } if (_count == 0 && _panel.Controls.Count > 0) { _panel.Controls.Clear(); } for (var i = 0; i < 3; i++) { _panel.SuspendLayout(); try { var box = new IconBox(_path, _count++, _button.BackColor, _button.ForeColor, _button.FlatAppearance.MouseOverBackColor); if (_panel.Controls.Contains(box)) { box.Dispose(); continue; } _iconBoxes.Add(box); _panel.Controls.Add(box); } catch (Exception ex) when(ex.IsCaught()) { timer.Enabled = false; if (_count > 0) { _count = 0; } break; } finally { _panel.ResumeLayout(false); } } var max = _panel.Width / _panel.Controls[0].Width; for (var i = 0; i < _panel.Controls.Count; i++) { if (_panel.Controls[i] == null) { continue; } var line = i / max; var column = i - line * max; _panel.Controls[i].Location = new Point(column * _panel.Controls[i].Width, line * _panel.Controls[i].Height); } if (timer.Enabled || _panel.Enabled) { return; } _panel.Enabled = true; _textBox.Enabled = true; _progressCircle.Active = false; _buttonPanel.SuspendLayout(); _buttonPanel.Controls.Clear(); _buttonPanel.Controls.Add(_button); _buttonPanel.BorderStyle = BorderStyle.FixedSingle; _buttonPanel.ResumeLayout(false); TaskBarProgress.SetState(Handle, TaskBarProgressState.NoProgress); if (!_panel.Focus()) { _panel.Select(); } } }
private void IconBox_MouseDown(object sender, MouseEventArgs e) { offset = IconBox.PointToClient(MousePosition); moving = true; TimerMain.Enabled = true; }
private void Start() { display = GetComponentInChildren <IconBox>(); activeSaying = withoutItemSaying; activeSaying.enabled = true; }