/// /////////////////////////////////////// protected override void MyDraw(CContextDessinObjetGraphique ctx) { base.MyDraw(ctx); Graphics g = ctx.Graphic; Brush b = new SolidBrush(BackColor); Rectangle rect = new Rectangle(Position, Size); g.FillRectangle(b, rect); if (HasAddButton | HasDeleteButton) { Pen pen = Pens.Black; g.DrawLine(pen, rect.Left, rect.Top + c_nHauteurBandeau, rect.Right, rect.Top + c_nHauteurBandeau); int nX = 5; Brush br = Brushes.Black; if (HasAddButton) { g.DrawString("Add", Font, br, new Point(rect.X + nX, rect.Top + 1)); nX += 40; } if (HasDeleteButton) { g.DrawString("Delete", Font, br, new Point(rect.Left + nX, rect.Top + 1)); } } b.Dispose(); base.MyDraw(ctx); }
//------------------------------------ public virtual void AfterDrawObjet(CContextDessinObjetGraphique ctx, C2iObjetDeSchema objet) { if (!IsConcerneParAlarme) { return; } int nSizeTour = 2; Color couleur = m_severite != null ? m_severite.Couleur : Color.White; Rectangle rct = objet.RectangleAbsolu; Brush br = new SolidBrush(couleur); ctx.Graphic.FillRectangle(br, new Rectangle(rct.Left - nSizeTour, rct.Top - nSizeTour, rct.Width + nSizeTour, nSizeTour)); ctx.Graphic.FillRectangle(br, new Rectangle(rct.Right, rct.Top - nSizeTour, nSizeTour, rct.Height + nSizeTour * 2)); ctx.Graphic.FillRectangle(br, new Rectangle(rct.Left - nSizeTour, rct.Bottom, rct.Width + 2 * nSizeTour, nSizeTour)); ctx.Graphic.FillRectangle(br, new Rectangle(rct.Left - nSizeTour, rct.Top - nSizeTour, nSizeTour, rct.Height + nSizeTour)); br.Dispose(); br = new SolidBrush(Color.FromArgb(100, couleur)); ctx.Graphic.FillRectangle(br, rct); br.Dispose(); Image imgMasquage = null; if (HasMasquage) { imgMasquage = timos.data.Resource.Mask_adm; } if (imgMasquage != null) { ctx.Graphic.DrawImageUnscaled(imgMasquage, rct.Right - imgMasquage.Width, rct.Bottom - imgMasquage.Height); } }
/// /////////////////////// protected override void MyDraw(CContextDessinObjetGraphique ctx) { Graphics g = ctx.Graphic; Brush b = new SolidBrush(BackColor); Size sz = Size; if (DockStyle == EDockStyle.Left || DockStyle == EDockStyle.Right) { if (sz.Width > 10) { sz.Width = 10; } } if (DockStyle == EDockStyle.Top || DockStyle == EDockStyle.Bottom) { if (sz.Height > 10) { sz.Height = 10; } } Rectangle rect = new Rectangle(Position, sz); g.FillRectangle(b, rect); b.Dispose(); base.MyDraw(ctx); }
protected override CContextDessinObjetGraphique GetContexteDessin(Graphics g, Rectangle clipZone) { CContextDessinObjetGraphique ctx = base.GetContexteDessin(g, clipZone); ctx.FonctionDessinSupplementaireApresObjet = new DessinSupplementaireDelegate(DessinSupplementaireItem); return(ctx); }
private void m_panelDessin_Paint(object sender, PaintEventArgs e) { Graphics g = e.Graphics; CContextDessinObjetGraphique ctg = new CContextDessinObjetGraphique(g); if (m_objetEdite != null) { if (m_objetEdite.SymboleADessiner != null) { m_objetEdite.SymboleADessiner.Draw(ctg); } } /* if (m_objetEdite.SymbolePropre != null) * { * if (m_objetEdite.SymbolePropre.Symbole != null) * m_objetEdite.SymbolePropre.Symbole.Draw(ctg); * * } * else if (m_cmbSymboleBib.ElementSelectionne != null) * { * CSymboleDeBibliotheque symboleBib = (CSymboleDeBibliotheque)m_cmbSymboleBib.ElementSelectionne; * if (symboleBib.Symbole != null) * if (symboleBib.Symbole.Symbole != null) * symboleBib.Symbole.Symbole.Draw(ctg); * / if (m_objetEdite.SymboleDeBibliotheque.Symbole != null) * if (m_objetEdite.SymboleDeBibliotheque.Symbole.Symbole != null) * m_objetEdite.SymboleDeBibliotheque.Symbole.Symbole.Draw(ctg); * * } */ }
/// ////////////////////////////////// /// <summary> /// Dessin de tout le controle et de ses fils /// </summary> /// <param name="contexte"></param> public override void Draw(CContextDessinObjetGraphique ctx) { if (!m_bVisible) { return; } MyDraw(ctx); Graphics g = ctx.Graphic; Matrix oldMat = g.Transform; Matrix matrice = (Matrix)oldMat.Clone(); Point pt = ClientToGlobal(new Point(0, 0)); if (Parent != null) { pt = Parent.GlobalToClient(pt); } //pt = ClientToGlobal ( pt ); matrice.Translate(pt.X, pt.Y); g.Transform = matrice; Region oldClip = g.Clip; g.Clip = new Region(new Rectangle(0, 0, ClientSize.Width + 1, ClientSize.Height + 1)); DrawInterieur(ctx); foreach (C2iSymbole fils in Childs) { fils.Draw(ctx); } g.Clip = oldClip; g.Transform = oldMat; }
/// ////////////////////////////////////////////////// public override void DrawInterieur(CContextDessinObjetGraphique ctx) { Graphics g = ctx.Graphic; Rectangle rect = new Rectangle(new Point(0, 0), Size); if (Variable == null) { DrawTextBox(rect, g); return; } if (Variable.IsChoixParmis()) { DrawCombo(rect, g); } else { if (Variable.TypeDonnee.TypeDotNetNatif == typeof(double) || Variable.TypeDonnee.TypeDotNetNatif == typeof(int) || Variable.TypeDonnee.TypeDotNetNatif == typeof(string)) { DrawTextBox(rect, g); } else if (Variable.TypeDonnee.TypeDotNetNatif == typeof(DateTime)) { DrawCombo(rect, g); } else if (Variable.TypeDonnee.TypeDotNetNatif == typeof(bool)) { DrawCheckBox(rect, g); } } }
//------------------------------------------------------- protected override void MyDraw(CContextDessinObjetGraphique ctx) { Rectangle rct = RectangleAbsolu; rct.Inflate(-c_nTailleOmbre / 2, -c_nTailleOmbre / 2); rct.Offset(c_nTailleOmbre / 2, c_nTailleOmbre / 2); ctx.Graphic.FillRectangle(Brushes.LightGray, rct); rct.Offset(-c_nTailleOmbre, -c_nTailleOmbre); ctx.Graphic.FillRectangle(Brushes.White, rct); ctx.Graphic.DrawRectangle(Pens.Black, rct); CEasyQuery query = Query; Rectangle rctHeader = new Rectangle(rct.Location, new Size(rct.Width, HeaderHeight)); ctx.Graphic.DrawRectangle(Pens.Black, rctHeader); rctHeader.Inflate(-1, -1); DrawHeader(ctx, rctHeader); //Dessins des colonnes if (m_bIsExpanded) { Rectangle rctCols = new Rectangle(rct.Left + 1, rctHeader.Bottom + 2, rct.Width - 2, rct.Height - rctHeader.Height - 2); DrawColumns(ctx, rctCols); } if (m_postFilter != null) { m_postFilter.Draw(this, ctx); } }
/// ////////////////////////////////// /// <summary> /// Dessin de tout le controle et de ses fils /// </summary> /// <param name="contexte"></param> public override void Draw(CContextDessinObjetGraphique ctx) { MyDraw(ctx); Graphics g = ctx.Graphic; Matrix oldMat = g.Transform; Matrix matrice = (Matrix)oldMat.Clone(); Point pt = ClientToGlobal(new Point(0, 0)); if (Parent != null) { pt = Parent.GlobalToClient(pt); } //pt = ClientToGlobal ( pt ); matrice.Translate(pt.X, pt.Y); g.Transform = matrice; Region oldClip = g.Clip; Region newClip = oldClip.Clone(); newClip.Intersect(GetLocalClipRect()); g.Clip = newClip; DrawInterieur(ctx); foreach (C2iWnd fils in Childs) { fils.Draw(ctx); } g.Clip = oldClip; newClip.Dispose(); g.Transform = oldMat; }
//--------------------------------------------------- protected override void MyDraw(CContextDessinObjetGraphique ctx) { Rectangle rct = new Rectangle(Position.X, Position.Y, Size.Width, Size.Height); ctx.Graphic.FillRectangle(Brushes.White, rct); ctx.Graphic.DrawRectangle(Pens.Black, rct); }
//------------------------------------------------------- protected override void MyDraw(CContextDessinObjetGraphique ctx) { foreach (I2iObjetGraphique objet in m_listeChilds) { objet.Draw(ctx); } }
//------------------------------------------ public void Draw( CContextDessinObjetGraphique ctx, IElementDeSchemaReseau element, C2iObjetGraphique objetGraphique) { ApplyOnSymbole(element); if (m_symbole != null) { m_symbole.Transparency = 100; Matrix oldMat = ctx.Graphic.Transform; C2iLienDeSchemaReseau lien = objetGraphique as C2iLienDeSchemaReseau; if (lien != null) { //Se place au centre du lien Point pt = lien.GetPointCentral(); pt.Offset(-m_symbole.Width / 2, -m_symbole.Height / 2); ctx.Graphic.TranslateTransform(pt.X, pt.Y); } else { float fEchelleX = (float)objetGraphique.Size.Width / (float)m_symbole.Size.Width; float fEchelleY = (float)objetGraphique.Size.Height / (float)m_symbole.Size.Height; ctx.Graphic.InterpolationMode = InterpolationMode.HighQualityBilinear; ctx.Graphic.TranslateTransform(objetGraphique.Position.X, objetGraphique.Position.Y); ctx.Graphic.ScaleTransform(fEchelleX, fEchelleY); } m_symbole.Draw(ctx); ctx.Graphic.Transform = oldMat; } }
/// /////////////////////// protected override void MyDraw(CContextDessinObjetGraphique ctx) { Graphics g = ctx.Graphic; Brush b = new SolidBrush(BackColor); Rectangle rect = new Rectangle(Position, Size); //rect = contexte.ConvertToAbsolute(rect); g.FillRectangle(b, rect); b.Dispose(); Image img = Resources.SubForm; g.DrawImage(img, rect); switch (BorderStyle) { case C2iWndPanel.PanelBorderStyle._3D: DrawCadre3D(rect, true, g); break; case C2iWndPanel.PanelBorderStyle.Plein: Pen pen = new Pen(ForeColor); g.DrawRectangle(pen, rect); pen.Dispose(); break; } base.MyDraw(ctx); }
/// //////////////////////////////////////////////////////// protected override void MyDraw(CContextDessinObjetGraphique ctx) { Graphics g = ctx.Graphic; Brush bWhite = new SolidBrush(Color.LightGreen); List <Point> poly = new List <Point>(); Rectangle rct = RectangleAbsolu; int nWidthFleche = rct.Height / 2; if (nWidthFleche > rct.Width / 2) { nWidthFleche = rct.Width / 2; } poly.Add(new Point(rct.Left, rct.Top)); poly.Add(new Point(rct.Right - nWidthFleche, rct.Top)); poly.Add(new Point(rct.Right, rct.Top + rct.Height / 2)); poly.Add(new Point(rct.Right - nWidthFleche, rct.Bottom)); poly.Add(new Point(rct.Left, rct.Bottom)); g.FillPolygon(bWhite, poly.ToArray()); Pen pBlack = new Pen(Color.Black); g.DrawPolygon(pBlack, poly.ToArray()); bWhite.Dispose(); pBlack.Dispose(); DrawLibelle(g); }
/// /////////////////////// protected override void MyDraw(CContextDessinObjetGraphique ctx) { Graphics g = ctx.Graphic; Rectangle rect = new Rectangle(Position, Size); if (m_imageDesignTime == null) { string strNomImage = "MapViewDesignTime.bmp"; m_imageDesignTime = new Bitmap(GetType(), strNomImage); } if (m_imageDesignTime != null) { g.DrawImage(m_imageDesignTime, rect); } else { Brush br = new SolidBrush(BackColor); g.FillRectangle(br, rect); br.Dispose(); Pen pen = new Pen(ForeColor); g.DrawRectangle(pen, rect); pen.Dispose(); StringFormat sf = new StringFormat(); sf.Alignment = StringAlignment.Center; sf.LineAlignment = StringAlignment.Center; br = new SolidBrush(ForeColor); g.DrawString("Map view", Font, br, rect, sf); br.Dispose(); } }
/// //////////////////////////////////////////////////////// protected override void MyDraw(CContextDessinObjetGraphique ctx) { Graphics g = ctx.Graphic; Rectangle rct = RectangleAbsolu; Rectangle rctCadre = RectangleCadre; Rectangle rctOmbre = new Rectangle(rct.Left + 4, rct.Bottom - 4, rct.Width - 4, 4); Brush brOmbre = new SolidBrush(Color.FromArgb(50, 0, 0, 0)); g.FillRectangle(brOmbre, rctOmbre); rctOmbre = new Rectangle(rct.Right - 4, rct.Top + 4, 4, rct.Height - 8); g.FillRectangle(brOmbre, rctOmbre); brOmbre.Dispose(); Brush bWhite = GetNewBrushForFond(); g.FillRectangle(bWhite, rctCadre); Pen pBlack = new Pen(Color.Black); g.DrawRectangle(pBlack, rctCadre); bWhite.Dispose(); pBlack.Dispose(); #if !PDA Image img = GetImage(); if (img != null) { g.DrawImage(img, rctCadre.Left + 1, rctCadre.Top + 1, img.Width, img.Height); } #endif DrawLibelle(g); }
//----------------------------------------------- protected void MyDraw(CContextDessinObjetGraphique ctx) { Rectangle rct = RectangleAbsolu; ctx.Graphic.FillRectangle(Brushes.White, rct); ctx.Graphic.DrawRectangle(Pens.Black, rct); }
//------------------------------------------------------- protected virtual void DrawColumns(CContextDessinObjetGraphique ctx, Rectangle rctCols) { Region oldClip = ctx.Graphic.Clip; Region clip = new Region(rctCols); ctx.Graphic.Clip = clip; m_dicColonneToRect.Clear(); int nY = 0; Font ft = new Font(FontFamily.GenericSansSerif, 7); StringFormat format = new StringFormat(); format.LineAlignment = StringAlignment.Near; format.Alignment = StringAlignment.Near; format.FormatFlags = StringFormatFlags.NoWrap; int nHeightCol = (int)ctx.Graphic.MeasureString("ABCDEFGHIJKLMNOPQRSTUVXYZ", ft).Height; foreach (IColumnDeEasyQuery col in Columns) { Rectangle rctCol = new Rectangle(rctCols.Left, rctCols.Top + nY, rctCols.Width, nHeightCol); ctx.Graphic.DrawString(col.ColumnName, ft, Brushes.Black, rctCol, format); m_dicColonneToRect[col] = rctCol; nY += nHeightCol; } ctx.Graphic.Clip = oldClip; clip.Dispose(); ft.Dispose(); }
//------------------------------------------------------- protected override void MyDraw(CContextDessinObjetGraphique ctx) { if (!m_prj.IsValide()) { return; } Graphics g = ctx.Graphic; foreach (I2iObjetGraphique objet in m_listeChilds) { if (objet is CWndProjetBrique && m_prj.AfficherMiniature && !m_bMiniature) { CWndProjetBrique prj = (CWndProjetBrique)objet; g.DrawImageUnscaled(prj.Miniature, new Rectangle(prj.Position.X, prj.Position.Y, prj.Projet.DesignerProjetWidth, prj.Projet.DesignerProjetHeight)); Rectangle rect = new Rectangle(prj.Position.X, prj.Position.Y, prj.Projet.DesignerProjetWidth, prj.Projet.DesignerProjetHeight); Pen pen = new Pen(Color.Black); g.DrawRectangle(pen, rect); pen.Dispose(); } else { objet.Draw(ctx); } } }
/// /////////////////////////////////////////////// protected override void MyDraw(CContextDessinObjetGraphique ctx) { base.MyDraw(ctx); Graphics g = ctx.Graphic; DrawVariableEntree(g, VariableAModifier); }
//------------------------------------ public virtual void BeforeDrawObjet(CContextDessinObjetGraphique ctx, C2iObjetDeSchema objet) { if (!m_bIsConcernéParAlarmes) { return; } }
/// /////////////////////////////////////////////// protected override void MyDraw(CContextDessinObjetGraphique ctx) { base.MyDraw(ctx); Graphics g = ctx.Graphic; if (VariableResultat != null) { DrawVariableSortie(g, VariableResultat); } /* * * * Font ft = new Font ( "Arial", 7, FontStyle.Regular ); * string strNomVariable = "> "+(VariableResultat==null?"":VariableResultat.Nom); * SizeF size = g.MeasureString ( strNomVariable, ft ); * Rectangle rect = RectangleAbsolu; * int nHeight = (int)size.Height+2; * int nWidth = (int)size.Width+2; * rect.Offset ( rect.Width-nWidth, rect.Height-nHeight ); * rect.Height = nHeight; * rect.Width = nWidth; * Pen pBlack = new Pen ( Color.Black ); * g.FillRectangle ( Brushes.Yellow, rect ); * g.DrawRectangle ( pBlack, rect ); * pBlack.Dispose(); * Brush bBlack = new SolidBrush(Color.Black ); * g.DrawString ( strNomVariable, ft, bBlack, rect.Left+1, rect.Top+1); * bBlack.Dispose(); * ft.Dispose();*/ }
public override void Draw(CContextDessinObjetGraphique ctx) { if (SymboleContenu != null) { SymboleContenu.Draw(ctx); } }
/// /////////////////////////////////////////////////// protected override void MyDraw(CContextDessinObjetGraphique ctx) { base.MyDraw(ctx); CSegmentDroite[] segments = GetLienTracable().Segments; Graphics g = ctx.Graphic; string strLibelle = Libelle; Font ft = new Font("Arial", 6, FontStyle.Regular); SizeF size = g.MeasureString(strLibelle, ft); Point pt = segments[0].Milieu; if (segments[0].Vecteur.Y == 0)//horizontal { pt.Offset(-(int)(size.Width / 2), -(int)(size.Height + 3)); } else { pt.Offset(3, (int)(-size.Height / 2)); } Rectangle rect = RectangleAbsolu; Brush bBlack = new SolidBrush(Color.Black); g.DrawString(strLibelle, ft, bBlack, pt.X, pt.Y); bBlack.Dispose(); }
/// ////////////////////////////////////////////////// public override void DrawInterieur(CContextDessinObjetGraphique ctx) { Graphics g = ctx.Graphic; Rectangle rect = new Rectangle(new Point(0, 0), Size); DrawTextBoxFiltre(rect, g); }
//------------------------------------------------------- public override void Draw(CContextDessinObjetGraphique ctx) { base.Draw(ctx); if (SourceEntites is CSourceEntitesPourTableDataChampDeTable) { string strIdTable = ((CSourceEntitesPourTableDataChampDeTable)SourceEntites).IdTable; IObjetDeEasyQuery tableSource = null; foreach (IObjetDeEasyQuery objet in Query.Childs) { CODEQBase o = objet as CODEQBase; if (o != null && o.Id == strIdTable) { tableSource = o; break; } } if (tableSource != null) { Pen pen = new Pen(Brushes.Black, 2); CLienTracable lien = CTraceurLienDroit.GetLienPourLier(tableSource.RectangleAbsolu, RectangleAbsolu, EModeSortieLien.Automatic); lien.RendVisibleAvecLesAutres(ctx.Liens); ctx.AddLien(lien); pen.DashStyle = DashStyle.Dot; AdjustableArrowCap cap = new AdjustableArrowCap(4, 4, true); pen.CustomEndCap = cap; lien.Draw(ctx.Graphic, pen); pen.Dispose(); cap.Dispose(); } } }
//--------------------------------------------------- public void Draw(CContextDessinObjetGraphique contexte, CWorkflowEtapeDessin etape) { MyDraw(contexte, etape); if (etape != null && etape.TypeEtape != null && etape.TypeEtape.IsDefautStart) { int?nMinxX = null; int?nMinY = null; int?nMaxX = null; foreach (Point pt in GetPolygoneDessin(etape)) { if (nMinxX == null || nMinxX.Value > pt.X) { nMinxX = pt.X; } if (nMinY == null || nMinY.Value > pt.Y) { nMinY = pt.Y; } if (nMaxX == null || nMaxX.Value < pt.X) { nMaxX = pt.X; } } Point ptImage = new Point((nMaxX.Value - nMinxX.Value) / 2 + nMinxX.Value - Resource1.Start.Width / 2, nMinY.Value); contexte.Graphic.DrawImageUnscaled(Resource1.Start, ptImage); } }
//------------------------------------------------------ protected override void MyDraw(CContextDessinObjetGraphique ctx) { if (TypeEtape != null) { TypeEtape.Bloc.Draw(ctx, this); } }
//---------------------------------------------- private void ShowPreview() { m_timerPreview.Stop(); using (CWaitCursor waiter = new CWaitCursor()) { if (m_wndListeForms.SelectedItems.Count == 1) { ListViewItem item = m_wndListeForms.SelectedItems[0]; C2iWndReference reference = item.Tag as C2iWndReference; if (reference != null) { if (m_wndPreview.Image != null) { m_wndPreview.Image.Dispose(); m_wndPreview.Image = null; } m_lblForm.Text = reference.WndLabel; C2iWnd wnd = C2iWndProvider.GetForm(reference); if (wnd != null) { Bitmap bmp = new Bitmap(wnd.Size.Width + 2, wnd.Size.Height + 2); Graphics g = Graphics.FromImage(bmp); CContextDessinObjetGraphique ctx = new CContextDessinObjetGraphique(g); wnd.Draw(ctx); g.Dispose(); m_wndPreview.Image = bmp; } } } } }
/// /////////////////////// protected override void MyDraw(CContextDessinObjetGraphique ctx) { Graphics g = ctx.Graphic; Rectangle rect = new Rectangle(Position, Size); Image img = Resource.MapViewDesignTime; g.DrawImage(img, rect); }