/** * When the size of a block changes, shifts blocks below it up or down. */ private void OnBlockSizeChanged(object sender, EventArgs e) { if (Width != 0 && Height != 0) { AbstractContactViewBlock senderBlock = (AbstractContactViewBlock)sender; GroupBox blockGroupBox = (GroupBox)senderBlock.Parent; blockGroupBox.Height = senderBlock.Height + (int)(20 * Core.ScaleFactor.Height); } }
public void AddContactBlock(int col, string caption, AbstractContactViewBlock block) { if (col == 0) { _leftBlocks.Add(block); } else { _rightBlocks.Add(block); } }
private void ContsructColumn(IList blocks, StringBuilder htmlCtor) { htmlCtor.Append("<td class=\"content\">\n"); htmlCtor.Append("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">"); for (int i = 0; i < blocks.Count; i++) { AbstractContactViewBlock block = (AbstractContactViewBlock)blocks[i]; htmlCtor.Append(block.HtmlContent(_contact)).Append("\n"); if (i < blocks.Count - 1) { htmlCtor.Append("\t<tr><td colspan=\"2\"><hr/></td></tr>\n"); } } htmlCtor.Append("</table></td>\n"); }
void IContactTabBlockContainer.AddContactBlock(string tabName, string caption, AbstractContactViewBlock block) { TabPage page; if (_pages.ContainsKey(tabName)) { page = _pages[tabName]; } else { page = new TabPage(tabName); page.AutoScroll = true; _contentPages.TabPages.Add(page); _pages[tabName] = page; } block.Location = new Point(4, 12); block.Dock = DockStyle.Fill; // Decorative panes delimit groupboxes from each other so that // the bottom of the upper box is not visually merged with the // top of the lower one. Panel decorativeShift = new Panel(); decorativeShift.Dock = DockStyle.Top; decorativeShift.Size = new Size(block.Width + 8, 10); page.Controls.Add(decorativeShift); page.Controls.SetChildIndex(decorativeShift, 0); GroupBox blockGroupBox = new GroupBox(); blockGroupBox.Dock = DockStyle.Top; blockGroupBox.Text = caption; blockGroupBox.Size = new Size(block.Width + 8, block.Height + (int)(20 * Core.ScaleFactor.Height)); blockGroupBox.FlatStyle = FlatStyle.System; blockGroupBox.Controls.Add(block); page.Controls.Add(blockGroupBox); page.Controls.SetChildIndex(blockGroupBox, 0); _contactBlocks.Add(block); block.ValidStateChanged += block_ValidStateChanged; block.SizeChanged += OnBlockSizeChanged; }