Commit 0b500caf by Pascal Bigot

--no commit message

parent 27ae872f
......@@ -515,7 +515,7 @@ namespace CommonLib
ConnectionStateEvent(this, eClientConnectionSate.Connected);
}
}
catch
catch (Exception e)
{
m_bOpen = false;
ConnectionStateEvent(this, eClientConnectionSate.Error);
......
......@@ -622,8 +622,13 @@ namespace CommonLib
TreeNode DropedItem = (TreeNode)e.Data.GetData(typeof(TreeNode));
if (DropedItem != null)
{
if (DropedItem.Tag is Data &&
this.ControlType != InteractiveControlType.Text)
bool bAllowAssocDataDrop = true;
ISpecificControl spec = this as ISpecificControl;
if (spec!= null)
{
bAllowAssocDataDrop = spec.StdPropEnabling.m_bEditAssociateDataEnabled;
}
if (DropedItem.Tag is Data && bAllowAssocDataDrop)
{
e.Effect = DragDropEffects.All;
return;
......
......@@ -292,7 +292,7 @@ namespace CommonLib
for (int i = 0 ; i< Lines.Length; i++)
{
m_iCurLine = i;
if (Lines[i].Length > 0 && !string.IsNullOrEmpty(Lines[i]))
if (!string.IsNullOrEmpty(Lines[i]) && Lines[i].Length > 0)
{
string Line = Lines[i];
string[] strTab = Line.Split(ParseExecGlobals.TOKEN_SEPARATOR);
......
......@@ -54,6 +54,7 @@ namespace ImageButton
InitializeComponent();
this.imageButtonDispCtrl1.Enabled = false;
imageButtonDispCtrl1.Paint += new PaintEventHandler(imageButtonDispCtrl1_Paint);
}
/// <summary>
......@@ -159,8 +160,14 @@ namespace ImageButton
protected override void OnPaint(PaintEventArgs e)
{
// met a jour les attributs du bouton standard pour l'image de fond et le style
SelfPaint(e.Graphics, this);
// dessine l'étoile représentant la présence d'une donnée associée
//Comme on utilise un controle standard inclu dans l'interactive control, on capte son évènement de dessin et c'est sur
// lui qu'on effectue les dessins de la présence de donnée associée
}
void imageButtonDispCtrl1_Paint(object sender, PaintEventArgs e)
{
ControlPainter.DrawPresenceAssociateData(e.Graphics, this);
// existe une version ou il est possible de passer le paramètre indquant l'affichage de
// l'étoile dont le prototype est le suivant
......
......@@ -405,18 +405,8 @@ namespace SmartApp.Ihm.Designer
e.Graphics.DrawLines(penDotPurple, ptRepere1600par1200);
strHelpText = "1600 x 1200";
e.Graphics.DrawString(strHelpText, SystemFonts.DefaultFont, Brushes.Purple, new Point(800, 1188));
if (m_SizeCustomLines.Width != -1 && m_SizeCustomLines.Height != -1)
{
penDotCustom.DashStyle = DashStyle.Dot;
Point[] ptRepereCustom = new Point[3] { new Point(0, m_SizeCustomLines.Height),
new Point(m_SizeCustomLines.Width, m_SizeCustomLines.Height),
new Point(m_SizeCustomLines.Width, 0) };
e.Graphics.DrawLines(penDotCustom, ptRepereCustom);
strHelpText = string.Format("{0} x {1}", m_SizeCustomLines.Width, m_SizeCustomLines.Height);
e.Graphics.DrawString(strHelpText, SystemFonts.DefaultFont, Brushes.Orange, new Point(m_SizeCustomLines.Width / 2, m_SizeCustomLines.Height - 12));
}
penGrille.DashStyle = DashStyle.DashDot;
for (int i = m_GridSpacing; m_GridSpacing > 0 && i < this.Width; i += m_GridSpacing)
for (int i = m_GridSpacing; m_GridSpacing > 0 && i < this.Width; i += m_GridSpacing)
{
Point[] ptRepereGrid = new Point[] { new Point(i, 0),
new Point(i, this.Height) };
......@@ -428,6 +418,16 @@ namespace SmartApp.Ihm.Designer
new Point(this.Width, i) };
e.Graphics.DrawLines(penGrille, ptRepereGrid2);
}
if (m_SizeCustomLines.Width != -1 && m_SizeCustomLines.Height != -1)
{
penDotCustom.DashStyle = DashStyle.Dot;
Point[] ptRepereCustom = new Point[3] { new Point(0, m_SizeCustomLines.Height),
new Point(m_SizeCustomLines.Width, m_SizeCustomLines.Height),
new Point(m_SizeCustomLines.Width, 0) };
e.Graphics.DrawLines(penDotCustom, ptRepereCustom);
strHelpText = string.Format("{0} x {1}", m_SizeCustomLines.Width, m_SizeCustomLines.Height);
e.Graphics.DrawString(strHelpText, SystemFonts.DefaultFont, Brushes.Orange, new Point(m_SizeCustomLines.Width / 2, m_SizeCustomLines.Height - 12));
}
}
}
}
......
......@@ -120,6 +120,7 @@
this.btnOK.TabIndex = 4;
this.btnOK.Text = "OK";
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// btnCancel
//
......
......@@ -13,18 +13,48 @@ namespace SmartApp
{
public partial class BridgeEditorForm : Form
{
public SolutionGest m_Solution;
protected SolutionGest m_Solution;
protected DataBridgeInfo m_BridgeInfo;
//List<string> m_listProjects = new List<string>();
//SortedList<string, List<string>> m_listProjToDatas = new SortedList<string, List<string>>();
/// <summary>
///
/// </summary>
public SolutionGest Solution
{
get { return m_Solution; }
set
{
m_Solution = value;
if (m_Solution != null)
{
InitProjectList(cboSourceProj);
InitProjectList(cboTargetProj);
UpdateControlsStates();
}
}
}
/// <summary>
///
/// </summary>
public DataBridgeInfo BridgeInfo
{
get { return m_BridgeInfo; }
set
{
m_BridgeInfo = value;
if (m_BridgeInfo != null)
InitFromBridgeInfo();
}
}
/// <summary>
///
/// </summary>
/// <param name="Solution"></param>
public BridgeEditorForm(SolutionGest Solution)
public BridgeEditorForm()
{
m_Solution = Solution;
InitializeComponent();
Program.LangSys.Initialize(this);
btnAddDstData.Image = Resources.SimpleArrowLeft;
......@@ -37,12 +67,71 @@ namespace SmartApp
btnUpDstData.Image = Resources.SimpleArrowUp;
btnUpSrcData.Image = Resources.SimpleArrowUp;
InitProjectList(cboSourceProj);
InitProjectList(cboTargetProj);
//InitProjectList(cboSourceProj);
//InitProjectList(cboTargetProj);
UpdateControlsStates();
}
/// <summary>
///
/// </summary>
protected void InitFromBridgeInfo()
{
if (m_BridgeInfo == null)
return;
numBridgePeriod.Value = m_BridgeInfo.ExecTimerPeriod;
for (int i = 0; i< cboSourceProj.Items.Count; i++)
{
if (cboSourceProj.GetItemText(cboSourceProj.Items[i]) == m_BridgeInfo.SrcDoc)
cboSourceProj.SelectedIndex = i;
}
for (int i = 0; i < cboTargetProj.Items.Count; i++)
{
if (cboTargetProj.GetItemText(cboTargetProj.Items[i]) == m_BridgeInfo.DstDoc)
cboTargetProj.SelectedIndex = i;
}
foreach (string symbol in m_BridgeInfo.SrcDataList)
{
lstViewBridge.Items.Add(symbol).SubItems.Add(string.Empty);
}
foreach (string symbol in m_BridgeInfo.DstDataList)
{
bool bEmptyItemFound = false;
foreach (ListViewItem lviBri in lstViewBridge.Items)
{
if (string.IsNullOrEmpty(lviBri.SubItems[1].Text))
{
lviBri.SubItems[1].Text = symbol;
bEmptyItemFound = true;
break;
}
}
if (!bEmptyItemFound)
lstViewBridge.Items.Add(string.Empty).SubItems.Add(symbol);
}
}
/// <summary>
///
/// </summary>
protected void SaveToBridgeInfo()
{
m_BridgeInfo.SrcDoc = cboSourceProj.SelectedText;
m_BridgeInfo.DstDoc = cboTargetProj.SelectedText;
m_BridgeInfo.SrcDataList.Clear();
m_BridgeInfo.DstDataList.Clear();
foreach (ListViewItem lvi in lstViewBridge.Items)
{
m_BridgeInfo.SrcDataList.Add(lvi.SubItems[0].Text);
m_BridgeInfo.SrcDataList.Add(lvi.SubItems.Count >1? lvi.SubItems[1].Text : string.Empty);
}
}
/// <summary>
/// met a jour l'état des différents en éléments en fonction des sélection courantes
/// </summary>
protected void UpdateControlsStates()
......@@ -130,6 +219,12 @@ namespace SmartApp
}
}
/// <summary>
///
/// </summary>
/// <param name="lvDataList"></param>
/// <param name="cboProj"></param>
/// <param name="cboGroup"></param>
protected void InitProjDataList(ListView lvDataList, ComboBox cboProj, ComboBox cboGroup)
{
// aucun projet seléctionné, on sort
......@@ -175,6 +270,7 @@ namespace SmartApp
}
}
#region combo selected index change
private void cboSourceProj_SelectedIndexChanged(object sender, EventArgs e)
{
InitProjectGroupsList(cboSourceGrpFilter, cboSourceProj);
......@@ -196,7 +292,14 @@ namespace SmartApp
{
InitProjDataList(lstViewTargetDatas, cboTargetProj, cboTargetGrpFilter);
}
#endregion
#region Add/remove datas
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnAddRemSrcData_Click(object sender, EventArgs e)
{
if (sender == btnAddSrcData)
......@@ -227,6 +330,11 @@ namespace SmartApp
}
}
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnAddRemDstData_Click(object sender, EventArgs e)
{
if (sender == btnAddDstData)
......@@ -256,7 +364,13 @@ namespace SmartApp
}
}
#endregion
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnUpDownSrcData_Click(object sender, EventArgs e)
{
if (sender == btnUpSrcData)
......@@ -269,6 +383,11 @@ namespace SmartApp
}
}
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnUpDownDstData_Click(object sender, EventArgs e)
{
if (sender == btnUpDstData)
......@@ -280,5 +399,15 @@ namespace SmartApp
}
}
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnOK_Click(object sender, EventArgs e)
{
this.SaveToBridgeInfo();
}
}
}
......@@ -337,8 +337,13 @@ namespace SmartApp
void CtxMenuBridgeProperties_Click(object sender, EventArgs e)
{
TreeNode selNode = SelectedNode;
DocumentElementNode elem = selNode.Tag as DocumentElementNode;
BridgeEditorForm brideDlg = new BridgeEditorForm(m_GestSolution);
DataBridgeInfo bri = selNode.Tag as DataBridgeInfo;
//DocumentElementNode elem = selNode.Tag as DocumentElementNode;
BridgeEditorForm brideDlg = new BridgeEditorForm()
{
Solution = m_GestSolution,
BridgeInfo = bri,
};
brideDlg.ShowDialog();
//DocumentProprtiesDialog projectPropDialog = new DocumentProprtiesDialog();
//DocumentProprtiesDialog CfgPage = new DocumentProprtiesDialog();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment