public void alot(int num, FlowLayoutPanel flowLayoutPanel, String[,] dayArray, int x, String [,,] globalArray) { // Console.Write("\n"+x+") "+allDetailedCourses[x].course.courseName); if (traverseSlots(allDetailedCourses[x], dayArray)) { dayArray[row, col] = allDetailedCourses[x].course.courseCode; globalArray [num - 1, row, col] = allDetailedCourses[x].course.courseCode; // allDetailedCourses[x].monday = true; setDayBool(num, x, true); allDetailedCourses[x].remainingC_Hours--; updateButton(flowLayoutPanel, row, col, allDetailedCourses[x].course.courseName + " (" + allDetailedCourses[x].course.section + ")", allDetailedCourses[x].course.semester); flowLayoutPanel.Refresh(); // Console.Write("\t\t(" + row + ", " + col + ")\n"); int rowCheck = 1; // to check, that we have more row (rooms) in current time slot int saveIndex = x; while (true) { if ((row + rowCheck) < (rooms + 1)) // if next room available in same col { // Console.Write("yes "); int indexList = findAnyPreOrPostReqCourseIndex(num, allDetailedCourses[saveIndex].course); if (indexList != -1 && isTeacherClash(col, allDetailedCourses[indexList], dayArray) == false && isStudentClash(col, allDetailedCourses[indexList], dayArray) == false) // b=col to check clashes { saveIndex = indexList; dayArray[row + rowCheck, col] = allDetailedCourses[indexList].course.courseCode; globalArray[num - 1, row + rowCheck, col] = allDetailedCourses[indexList].course.courseCode; // allDetailedCourses[indexList].monday = true; setDayBool(num, indexList, true); allDetailedCourses[indexList].remainingC_Hours--; // Console.Write("\tSet"); updateButton(flowLayoutPanel, row + rowCheck, col, allDetailedCourses[indexList].course.courseName + " (" + allDetailedCourses[indexList].course.section + ")", allDetailedCourses[indexList].course.semester); flowLayoutPanel.Refresh(); } else { break; } } else { // Console.WriteLine("\tNo more rooms"); break; } rowCheck++; // Console.Write("\n"); } // Console.Write("\n"); } }
public static void loadFlowPanel(List <Favorite> favorites) { if (flowPanel != null) { favorites.ForEach(favorite => { UcCardFavorito card = new UcCardFavorito(favorite); card.Name = "card" + favorite.id; card.Anchor = AnchorStyles.Left; flowPanel.Controls.Add(card); }); flowPanel.Refresh(); } }
private void MoveVignette(object sender, DragEventArgs e) { VignetteNV vignetteSource = e.Data.GetData("VignetteNV") as VignetteNV; FlowLayoutPanel flowlayoutpanelTemp = (FlowLayoutPanel)sender as FlowLayoutPanel; //Si le flowlayoutpanel correspond bien à celui du UserControl que l'on déplace //(On ne doit pouvoir déplacer que les Vignettes d'album dans les Albums et les vignettes de Photos dans les photos). if (vignetteSource.Parent == flowlayoutpanelTemp) { //On obtient le contrôle à la position où l'évènement "drop" a été enregistré. Point p = flowlayoutpanelTemp.PointToClient(new Point(e.X, e.Y)); Control vignetteDestination = flowlayoutpanelTemp.GetChildAtPoint(p); //On obtient l'index (la position) de ce conbtrôle int index = flowlayoutpanelTemp.Controls.GetChildIndex(vignetteDestination, false); //On déplace la vignette source à cette position flowlayoutpanelTemp.Controls.SetChildIndex(vignetteSource, index); //On "invalide" le flowlayoutpanelTemp afin de le redessiner. flowlayoutpanelTemp.Refresh(); //flowlayoutpanelTemp.Invalidate(); //on sauvegarde les modifications XML_Serialization.save_user_data(); } //sinon, si le usercontrol est une PictureVignette et quelle est deplacée dans le flowlayoutpannel des albums else { if ((vignetteSource.Parent == AllPhotosGrid) && (flowlayoutpanelTemp == AlbumGrid)) { VignetteNVAlbum album; VignetteNVPhoto photo; //On obtient le contrôle à la position où l'évènement "drop" a été enregistré. Point p = flowlayoutpanelTemp.PointToClient(new Point(e.X, e.Y)); Control vignetteDestination = flowlayoutpanelTemp.GetChildAtPoint(p); //On obtient l'index (la position) de ce conbtrôle int index = flowlayoutpanelTemp.Controls.GetChildIndex(vignetteDestination, false); //On ajoute la vignettePicture dans lalbum situé à cette position album = (VignetteNVAlbum)flowlayoutpanelTemp.Controls[index]; photo = (VignetteNVPhoto)vignetteSource; album.albumLinked.Pictures.Add(photo.pic); album.refreshPreviewPicture(); //On "invalide" le flowlayoutpanelTemp afin de le redessiner. flowlayoutpanelTemp.Refresh(); //flowlayoutpanelTemp.Invalidate(); //on sauvegarde les modifications XML_Serialization.save_user_data(); } } }
public void update_blocks(utils.ETileViewType _view_type, tiles_data _tiles_data, bool _prop_per_block, data_sets_manager.EScreenDataType _scr_type) { Image img; Graphics gfx; m_block_rect.Width = m_block_rect.Height = (_view_type == utils.ETileViewType.tvt_ObjectId && !_prop_per_block) ? (utils.CONST_BLOCKS_IMG_SIZE >> 1):utils.CONST_BLOCKS_IMG_SIZE; for (int i = 0; i < platform_data.get_max_blocks_cnt(); i++) { img = m_imagelist_blocks.Images[i]; gfx = Graphics.FromImage(img); if (_tiles_data != null) { update_block(i, _view_type, _tiles_data, _prop_per_block, gfx, img, _scr_type); } else { gfx.Clear(utils.CONST_COLOR_BLOCK_CLEAR); } m_imagelist_blocks.Images[i] = img; gfx.Dispose(); } m_panel_blocks.Refresh(); }
public void update_tiles(utils.ETileViewType _view_type, tiles_data _tiles_data, data_sets_manager.EScreenDataType _scr_type) { Image img; Graphics gfx; if (_scr_type == data_sets_manager.EScreenDataType.sdt_Tiles4x4) { for (int i = 0; i < platform_data.get_max_tiles_cnt(); i++) { img = m_imagelist_tiles.Images[i]; gfx = Graphics.FromImage(img); if (_tiles_data != null) { update_tile(i, _view_type, _tiles_data, gfx, img, _scr_type); } else { gfx.Clear(utils.CONST_COLOR_TILE_CLEAR); } m_imagelist_tiles.Images[i] = img; gfx.Dispose(); } m_panel_tiles.Refresh(); } }
private void Manual_Paint(object sender, PaintEventArgs e) { _flpTop.Refresh(); Pen p = new Pen(Color.Black, 4); e.Graphics.DrawRectangle(p, 2, 2, 726, 726); p.Dispose(); _cbGamePlay.draw_ChessBoard(g); }
public void Select(Strip strip) { if (mModel.Selected != strip) { mModel.Selected = strip; mUserControl.Refresh(); ((WorkAreaForm)mUserControl.Parent).EnableSelect(); } }
private void RuleLayout_DragDrop(object sender, DragEventArgs e) { RuleButton button = (RuleButton)e.Data.GetData(typeof(RuleButton)); FlowLayoutPanel destination = (FlowLayoutPanel)sender; Point target_spot = destination.PointToClient(new Point(e.X, e.Y)); int target_index = destination.Controls.GetChildIndex(destination.GetChildAtPoint(target_spot)); destination.Controls.SetChildIndex(button, target_index); destination.Refresh(); }
public static void adjustHt(Form ContainerForm, FlowLayoutPanel CotainerPanel, Control OnoffControl, bool visible) { CotainerPanel.AutoSize = true; CotainerPanel.AutoSizeMode = AutoSizeMode.GrowAndShrink; int spaceBelowFl = ContainerForm.Height - CotainerPanel.Bottom; OnoffControl.Visible = visible; CotainerPanel.Refresh(); ContainerForm.Height = CotainerPanel.Height + CotainerPanel.Top + spaceBelowFl; ContainerForm.Top = (Screen.PrimaryScreen.WorkingArea.Height - ContainerForm.Height) / 2; }
internal static void PopulatePanel(List <MudData.FormulaAction> actions, FlowLayoutPanel panel, string archetypeName) { foreach (var action in actions) { var editor = new ScriptActionEditControl(action, archetypeName); panel.Controls.Add(editor); } panel.PerformLayout(); Utilities.ResizeControls(panel); panel.Refresh(); }
private void setLayoutFLPCatBottom() { createButtonsCat(); fLPCatBottom.SuspendLayout(); fLPCatBottom.Controls.Add(bCatNext); fLPCatBottom.Controls.Add(bCatCancel); fLPCatBottom.ResumeLayout(); fLPCatBottom.Refresh(); }
private void FillPage(FlowLayoutPanel flowPanel) { flowPanel.Invalidate(); var items = _chapterSave.ConvoyRegion.Convoy .Where(GetItemTypes(flowPanel)) .OrderBy((x) => x.ItemID); flowPanel.Controls.Clear(); foreach (var item in items) { var panel = new ConvoyItemPanel(); panel.LoadItem(_chapterSave, item); flowPanel.Controls.Add(panel); } flowPanel.Refresh(); }
internal static void SetConversationPlaceHolder(string name) { if (!BubblePlaceHolder.Controls.ContainsKey(name)) { var FlowBox = new FlowLayoutPanel() { Name = name, BorderStyle = BorderStyle.FixedSingle, FlowDirection = FlowDirection.TopDown, WrapContents = false, AutoScroll = true, Enabled = true, Visible = false }; FlowBox.Resize += FlowBox_Resize; FlowBox.ControlAdded += (s, e) => { ((Control)s).Width = FlowBox.ClientSize.Width - 10; if (!FlowBox.Visible) { SoundPlayer splayer = new SoundPlayer(@"notification.wav"); splayer.Play(); if (!ActiveForm.Focused) { FlashWindow(ActiveForm.Handle, true); } } }; FlowBox.Dock = DockStyle.Fill; FlowBox.HorizontalScroll.Maximum = 0; FlowBox.HorizontalScroll.Visible = false; FlowBox.VerticalScroll.Visible = true; FlowBox.Refresh(); BubblePlaceHolder.Controls.Add(FlowBox); } }
public void AddFileFoundedSeached(FileInfo file) { Debug.WriteLine($"addfilefoundedseached {file.FullName}"); _flowsearch = (FlowLayoutPanel)tabControl1.SelectedTab.Controls[0]; try { if (file != null && (file.Extension == ".gif" || file.Extension == ".GIF")) { ImagenBox sprite = new ImagenBox() { Width = _ancho, Height = _alto, BackColor = Color.BurlyWood, SizeMode = PictureBoxSizeMode.StretchImage, Tag = file.FullName, //Image = Utilities.Image.FromFile(file.FullName), //Image = (Image)Image.FromFile(fileInfo.FullName).Clone(), }; sprite.FromFile(file.FullName); sprite.SetCurrentFrame = (int)sprite.Count / 2; //sprite.Tag = fileInfo.FullName; //sprite.Image = (Image)Image.FromFile(fileInfo.FullName).Clone(); sprite.SizeMode = PictureBoxSizeMode.Zoom; sprite.Click += sprite_Click; sprite.MouseClick += sprite_MouseClick; _flowsearch.Controls.Add(sprite); TabPage tabpage = (TabPage)_flowsearch.Parent; this.Text = @"ShowGif: -" + tabpage.Text + "-" + tabpage.Controls[0].Controls.Count.ToString() + " items"; } _flowsearch.Refresh(); } catch (Exception ex) { MessageBox.Show(ex.Message + ex.ToString()); } }
/// <summary> /// 将SymbolGroup中的符号,通过大小和几何对象绘制到FlowLayoutPanel中 /// </summary> /// <param name="width"></param> /// <param name="height"></param> /// <param name="geometry"></param> /// <param name="panel"></param> /// <param name="symbolGroup"></param> private void PaintSymbols(Int32 width, Int32 height, Geometry geometry, FlowLayoutPanel flowLayoutPanel, SymbolGroup symbolGroup) { try { flowLayoutPanel.Controls.Clear(); Int32 count = symbolGroup.Count; Int32 row = 1; // 循环得到符号并将符号添加到PictureBox,后将PictureBox添加到FlowLayoutPanel for (int i = 0; i < count; i++) { Symbol symbol = symbolGroup[i]; // 初始化PictureBox对象 PictureBox pictureBox = new PictureBox(); pictureBox.Size = new Size(width, height); pictureBox.Name = symbol.Name; pictureBox.BorderStyle = BorderStyle.FixedSingle; pictureBox.Tag = symbol; //绘制符号 DrawSymbol(symbol, geometry, width, height, pictureBox); //注册PictureBox的点击事件 pictureBox.Click += new EventHandler(pictureBox_Click); pictureBox.MouseLeave += new EventHandler(pictureBox_MouseLeave); if (i % (flowLayoutPanel.Width / width) == 0) { row++; } flowLayoutPanel.Controls.Add(pictureBox); } flowLayoutPanel.Refresh(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void RefreshHelper(FlowLayoutPanel flp) { flp.Refresh(); }
//private MemoryStream ms; #region (Chat Screen) public Chat(Client client) { InitializeComponent(); UserListPanel.Controls.Add(UserListBox); UserListBox.Anchor = AnchorStyles.Right; UserListBox.BackColor = Theme.GetBackColor(); UserListBox.ForeColor = Theme.GetForeColor(); UserListBox.Dock = DockStyle.Fill; UserListBox.Visible = false; UserListBox.Font = new Font("Tahoma", 12, FontStyle.Regular); TalkingTolbl = new Label { Location = new Point(326, 14), Text = string.Empty, Font = new Font("Tahoma", 14, FontStyle.Regular) }; Controls.Add(TalkingTolbl); BubblePlaceHolder = new Panel() { Name = "BubblePlaceHolder", Anchor = (AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom), AutoSize = false, Size = new Size(772, 447), Location = new Point(313, 52), Visible = true }; Controls.Add(BubblePlaceHolder); ConversationFLP = new FlowLayoutPanel() { BorderStyle = BorderStyle.FixedSingle, FlowDirection = FlowDirection.TopDown, WrapContents = false, AutoScroll = true, AutoSize = true, Enabled = true, Visible = true }; ConversationFLP.ControlAdded += ConversationFLP_ControlAdded; UserListPanel.Controls.Add(ConversationFLP); ConversationFLP.Dock = DockStyle.Fill; ConversationFLP.HorizontalScroll.Maximum = 0; ConversationFLP.HorizontalScroll.Visible = false; ConversationFLP.VerticalScroll.Visible = true; ConversationFLP.Refresh(); ContactsFLP = new FlowLayoutPanel() { BorderStyle = BorderStyle.FixedSingle, FlowDirection = FlowDirection.TopDown, WrapContents = false, AutoScroll = true, AutoSize = true, Enabled = true, Visible = false }; UserListPanel.Controls.Add(ContactsFLP); ContactsFLP.Dock = DockStyle.Fill; ContactsFLP.HorizontalScroll.Maximum = 0; ContactsFLP.HorizontalScroll.Visible = false; ContactsFLP.VerticalScroll.Visible = true; ContactsFLP.Refresh(); //NPanel NotificationsFLP = new FlowLayoutPanel() { BorderStyle = BorderStyle.FixedSingle, FlowDirection = FlowDirection.TopDown, WrapContents = false, AutoScroll = true, AutoSize = true, Enabled = true, Visible = true }; NotificationsFLP.ControlAdded += NotificationsFLP_ControlAdded; NotificationsFLP.ControlRemoved += NotificationsFLP_ControlRemoved; NPanel.Controls.Add(NotificationsFLP); NotificationsFLP.Dock = DockStyle.Fill; NotificationsFLP.HorizontalScroll.Maximum = 0; NotificationsFLP.HorizontalScroll.Visible = false; NotificationsFLP.VerticalScroll.Visible = true; NotificationsFLP.Refresh(); ThisPanel.HorizontalScroll.Visible = false; RolesPanel.Controls.Add(ContactLbl); RolesPanel.Controls.Add(ConversationsLbl); notifyTray.BalloonTipIcon = ToolTipIcon.Info; notifyTray.BalloonTipTitle = "Volupia Messenger"; //notifyTray.Icon = GetHiconForChat(); notifyTray.Icon = new Icon(Environment.CurrentDirectory + @"\VolupiaChat.ico"); notifyTray.BalloonTipClicked += NotifyTray_BalloonTipClicked; notifyTray.MouseDoubleClick += NotifyTray_MouseDoubleClick; //Button Fix MicRBtn.FlatStyle = FlatStyle.Flat; MicRBtn.BackColor = Color.Lavender; MicRBtn.FlatAppearance.BorderSize = 0; BarPanel.Region = Region.FromHrgn(GDI.CreateRoundRectRgn(0, 0, BarPanel.Width, BarPanel.Height, 60, 60)); //Arredonda caixa de texto SendRButton.FlatStyle = FlatStyle.Flat; SendRButton.BackColor = Color.Lavender; SendRButton.FlatAppearance.BorderSize = 0; ApplyTheme(); downTime = new System.Windows.Forms.Timer { Interval = 500 }; downTime.Tick += DownTime_Tick; waveOut.PlaybackStopped += (s, e) => { waveOut.Dispose(); }; _MyClient = client; myUserName = _MyClient.Username; myUserId = _MyClient.Id; NameLbl.Text = _MyClient.Name; notifyTray.Text = _MyClient.Name; downCount = 0; LoginForm.Server.Connected(); TakeInvites(); GetContacts(); }
public void StatPanelUpdate() { StatPanel.Controls.Clear(); PerksPanel.Controls.Clear(); PerksPanel.Size = new Size(0, perksPanelPadding * 2 + perksPanelSide); PerksPanel.Location = new System.Drawing.Point(ClientSize.Width - (256 + perksPanelSide), ClientSize.Height - (perksPanelSide + 24)); var button = new Button() { Width = 256, Height = 64, Text = "END TURN", Font = new Font(FontFamily.GenericSerif, 32), ForeColor = Color.White, BackColor = Colors.PlayerDarkColors [Game.Players.IndexOf(Game.CurrentPlayer) % Colors.count] }; if (Game.Winner == null) { button.Click += (sender, args) => { EveryUpdate(); Controls.Remove(ShopPanel); Game.EndTurn(); PlayerPanelUpdate(); StatPanelUpdate(); Controls.Remove(HeroPanel); HeroPanel = new CurrentHeroPanel(Game.CurrentHero, this) { Size = new Size(128, 128), Anchor = AnchorStyles.Bottom | AnchorStyles.Left, Location = new System.Drawing.Point(32, ClientSize.Height - 160) }; Controls.Add(HeroPanel); HeroPanel.BringToFront(); ShopPanel = new ShopPanel(Game.CurrentHero, this, new Rectangle(ClientSize.Width / 2 - 480, ClientSize.Height / 2 - 300, 960, 600)); SkillPanel = new HeroSkillPanel(Game, Game.CurrentHero, this, ControlPanel.Width); CenterOnPoint(Game.Maze.UnitPositions[Game.CurrentHero]); ControlPanelUpdate(); MapUpdate(); } } ; else { button.Text = "END GAME"; button.Click += (sender, args) => this.Close(); } StatPanel.Controls.Add(button); if (Game.ChosenHero != null) { var h = new HeroInfo(Game.ChosenHero) { Width = StatPanel.Width - 6, }; StatPanel.Controls.Add(h); StatPanel.Controls.Add(new Label { BackColor = Color.Black, ForeColor = Colors.PlayerLightColors [Game.Players.IndexOf(Game.ChosenHero.P) % Colors.count], Text = Game.ChosenHero.Name, Font = new Font(FontFamily.GenericSansSerif, 16), Width = StatPanel.Width - 6, Height = 32, TextAlign = ContentAlignment.MiddleCenter }); foreach (var perk in Game.ChosenHero.Perks.Where(p => p.Name != "Perk")) { PerksPanel.Controls.Add(new Label { AutoSize = true, BackColor = Color.Black, Text = double.IsNaN(perk.Number(Game.ChosenHero)) ? perk.Name : perk.Name + "\n" + perk.Number(Game.ChosenHero), MinimumSize = new Size(perksPanelSide, perksPanelSide), MaximumSize = new Size(1000, perksPanelSide), Font = new Font(FontFamily.GenericSansSerif, 16), ForeColor = Color.Aqua, TextAlign = ContentAlignment.MiddleCenter, Margin = new Padding(perksPanelPadding) }); } } StatPanel.Refresh(); PerksPanel.Refresh(); }
public override void Refresh() { base.Refresh(); flow.Refresh(); }