Ejemplo n.º 1
0
 private void btnGetImagePath_Click(object sender, EventArgs e)//
 {
     Share.GetImage(tbImagePath, GotImage);
 }
Ejemplo n.º 2
0
 private void btnGetReference_Click(object sender, EventArgs e) => Share.GetFile(tbReference);
Ejemplo n.º 3
0
 private void btnIPEdit_Click(object sender, EventArgs e) => Share.lvIPs_Edit(lvIPs);                                                              //Ok
Ejemplo n.º 4
0
        private void btnIPEdit_Click(object sender, EventArgs e) => Share.lvIPs_Edit(lvIPs);                                                              //Ok

        private void btnIPDelete_Click(object sender, EventArgs e) => Share.lvIPs_Delete(lvIPs);                                                          //Ok
Ejemplo n.º 5
0
 private void btnGetBackImage_Click(object sender, EventArgs e) => Share.GetImage(tbBackgImagePath, GotImage); //Ok
Ejemplo n.º 6
0
        public MapOptionsForm(xMap map)
        {
            InitializeComponent();
            if (map == null)
            {
                map = new xMap();
            }
            Map  = map;
            Text = Options.LangCur.lMOTitle;

            #region Main
            tpMain.Text      = Options.LangCur.lMOTabMain;
            lblName.Text     = Options.LangCur.lMOName;
            lblSize.Text     = Options.LangCur.lMOSize;
            chkSizeAuto.Text = Options.LangCur.lMOAuto;
            // Fill
            tbName.Text         = Map.Name;
            nudSizeW.Value      = Map.Width;
            nudSizeH.Value      = Map.Height;
            tbDescription.Text  = Map.Description;
            chkSizeAuto.Checked = Map.AutoSize;
            #endregion

            #region Background
            tpBack.Text = Options.LangCur.lMOTabBack;
            // Grid
            gbGrid.Text = Options.LangCur.lMOGrid;
            cbbGridStyle.Items.Add(Options.LangCur.lMOGridStyle0None);
            cbbGridStyle.Items.Add(Options.LangCur.lMOGridStyle1Dots);
            cbbGridStyle.Items.Add(Options.LangCur.lMOGridStyle2Corners);
            cbbGridStyle.Items.Add(Options.LangCur.lMOGridStyle3Crosses);
            cbbGridStyle.Items.Add(Options.LangCur.lMOGridStyle4Grid);
            toolTip.SetToolTip(btnGridColor, Options.LangCur.hEEColorPick);
            lblGridThick.Text     = Options.LangCur.lEELineThick;
            chkGridSnap.Text      = Options.LangCur.lMOGridAlign;
            btnAlignElements.Text = Options.LangCur.lMOGridAlignNow;
            // Fill
            chkGridStore.Checked       = Map.Grid.StoreOwn;
            cbbGridStyle.SelectedIndex = (int)Map.Grid.Style;
            btnGridColor.BackColor     = Map.Grid.Pen.Color;
            nudGridStepX.Value         = Map.Grid.StepX;
            nudGridStepY.Value         = Map.Grid.StepY;
            nudGridThick.Value         = (int)Map.Grid.Pen.Width;
            chkGridSnap.Checked        = Map.Grid.Snap;
            // Back image
            gbBack.Text = Options.LangCur.lMOBack;
            cbbBackStyle.Items.Add(Options.LangCur.lMOBackStyle0Color);
            cbbBackStyle.Items.Add(Options.LangCur.lMOBackStyle1ImageAlign);
            cbbBackStyle.Items.Add(Options.LangCur.lMOBackStyle2ImageTile);
            cbbBackStyle.Items.Add(Options.LangCur.lMOBackStyle3ImageStrech);
            cbbBackStyle.Items.Add(Options.LangCur.lMOBackStyle4ImageZInner);
            cbbBackStyle.Items.Add(Options.LangCur.lMOBackStyle5ImageZOutter);
            toolTip.SetToolTip(btnBackColor, Options.LangCur.hEEColorPick);
            toolTip.SetToolTip(btnGetBackImage, Options.LangCur.hEEImageLoad);
            lblBackgImagePath.Text   = Options.LangCur.lEEImagePath;
            chkTransparentColor.Text = Options.LangCur.lOETransparentColor;
            chkBackImageFloat.Text   = Options.LangCur.lEEImageFloat;
            chkBackImageBuildIn.Text = Options.LangCur.lEEImageBuildIn;
            lblBackImageAlign.Text   = Options.LangCur.lEEAlign;
            lblBackImageBPP.Text     = Options.LangCur.lEEImageBPP;
            cbbBackImageAlign.Items.Add(Options.LangCur.lEEAlign0TL);
            cbbBackImageAlign.Items.Add(Options.LangCur.lEEAlign1TC);
            cbbBackImageAlign.Items.Add(Options.LangCur.lEEAlign2TR);
            cbbBackImageAlign.Items.Add(Options.LangCur.lEEAlign3ML);
            cbbBackImageAlign.Items.Add(Options.LangCur.lEEAlign4MC);
            cbbBackImageAlign.Items.Add(Options.LangCur.lEEAlign5MR);
            cbbBackImageAlign.Items.Add(Options.LangCur.lEEAlign6BL);
            cbbBackImageAlign.Items.Add(Options.LangCur.lEEAlign7BC);
            cbbBackImageAlign.Items.Add(Options.LangCur.lEEAlign8BR);
            // Fill
            chkBackStore.Checked            = Map.Back.StoreOwn;
            cbbBackStyle.SelectedIndex      = (int)Map.Back.Style;
            btnBackColor.BackColor          = Map.Back.Color;
            tbBackgImagePath.Text           = Map.Back.Path;
            chkTransparentColor.Checked     = Map.Back.UseAlphaColor;
            btnAlphaColor.BackColor         = Map.Back.AlphaColor;
            chkBackImageFloat.Checked       = Map.Back.Float;
            cbbBackImageAlign.SelectedIndex = (int)Map.Back.Align;
            chkBackImageBuildIn.Checked     = Map.Back.BuildIn;
            cbbBackImageBPP.SelectedIndex   = (int)Map.Back.BPP;
            // Redraw sample
            GotImage(Map.Back.Image);
            #endregion

            #region Objects
            tpObjects.Text = Options.LangCur.lMOTabObjects;
            toolTip.SetToolTip(btnIPDelete, Options.LangCur.hEOPrototypeDelete);
            clmObjectName.Text      = Options.LangCur.lMOColumName;
            clmObjectLocation.Text  = Options.LangCur.lMOColumLocation;
            clmObjectPrototype.Text = Options.LangCur.lMOColumPrototype;
            clmObjectReference.Text = Options.LangCur.lMOColumReference;
            // Fill
            foreach (xObject obj in Map.Objects)
            {
                var item = lvObjects.Items.Add(obj.Name);
                item.SubItems.Add("");
                item.SubItems.Add("");
                item.SubItems.Add("");
                item.Tag = obj;
                UpdateObjectNode(item, obj);
                // Fill IPs
                foreach (var IP in obj.IPs)
                {
                    Share.lvIPs_Add(lvIPs, IP, ref IP.Map_lvItem);
                }
            }
            #endregion

            #region Links
            tpLinks.Text = Options.LangCur.lMOTabLinks;
            toolTip.SetToolTip(btnIPDelete, Options.LangCur.hEOPrototypeDelete);
            clmLinkName.Text      = Options.LangCur.lMOColumName;
            clmLinkLocation.Text  = Options.LangCur.lMOColumLocation;
            clmLinkPrototype.Text = Options.LangCur.lMOColumPrototype;
            clmLinkReference.Text = Options.LangCur.lMOColumReference;
            // Fill
            foreach (xLink Link in Map.Links)
            {
                var item = lvLinks.Items.Add(Link.Name);
                item.SubItems.Add("");
                item.SubItems.Add("");
                item.SubItems.Add("");
                item.Tag = Link;
                UpdateLinkNode(item, Link);
            }
            #endregion

            #region Boxes
            tpBoxes.Text = Options.LangCur.lMOTabBoxes;
            toolTip.SetToolTip(btnIPDelete, Options.LangCur.hEOPrototypeDelete);
            clmBoxName.Text      = Options.LangCur.lMOColumName;
            clmBoxLocation.Text  = Options.LangCur.lMOColumLocation;
            clmBoxPrototype.Text = Options.LangCur.lMOColumPrototype;
            clmBoxReference.Text = Options.LangCur.lMOColumReference;
            // Fill
            foreach (xBox Box in Map.Boxes)
            {
                var item = lvBoxes.Items.Add(Box.Name);
                item.SubItems.Add("");
                item.SubItems.Add("");
                item.SubItems.Add("");
                item.SubItems.Add("");
                item.Tag = Box;
                UpdateBoxNode(item, Box);
            }
            #endregion

            // IPs
            tpIPs.Text = Options.LangCur.lMOTabIPs;
            toolTip.SetToolTip(btnIPDelete, Options.LangCur.hOOIPDelete);
            clmIPAddress.Text    = Options.LangCur.lOOColumIP;
            clmIPPeriod.Text     = Options.LangCur.lOOColumPeriod;
            clmIPTimeLast.Text   = Options.LangCur.lOOColumTimeLast;
            clmIPTimeNext.Text   = Options.LangCur.lOOColumTimeNext;
            clmIPLastResult.Text = Options.LangCur.lOOColumResult;
        }
Ejemplo n.º 7
0
 private void btnGetRootBoxes_Click(object sender, EventArgs e) => Share.GetFolder(tbRootBoxes);
Ejemplo n.º 8
0
                : Color.MistyRose);//Ok

        #region Get folder
        private void btnGetLanguagePath_Click(object sender, EventArgs e) => Share.GetFolder(tbLanguagePath);
Ejemplo n.º 9
0
        private void tcMaps_Selected(object sender, TabControlEventArgs e)
        {
            // Case new not "add new tab"
            xMap SelectedMap = (tcMaps.SelectedTab.Tag as xMap);

            if (SelectedMap == null || Map == SelectedMap)
            {
                return;
            }

            // Remove last map info
            if (Map != null)
            {
                foreach (ListViewItem lvItem in libraryForm.lvUsedObjects.Items)
                {
                    (lvItem.Tag as xPrototype).lvItemUsed = null;
                }
                foreach (ListViewItem lvItem in libraryForm.lvUsedLinks.Items)
                {
                    (lvItem.Tag as xPrototype).lvItemUsed = null;
                }
                foreach (ListViewItem lvItem in libraryForm.lvUsedBoxes.Items)
                {
                    (lvItem.Tag as xPrototype).lvItemUsed = null;
                }
                libraryForm.lvUsedObjects.Items.Clear();
                libraryForm.lvUsedLinks.Items.Clear();
                libraryForm.lvUsedBoxes.Items.Clear();
                Map.lv_PObjects       =
                    Map.lv_PLinks     =
                        Map.lv_PBoxes = null;
            }

            // Switching
            Map = SelectedMap;
            // Draw
            if (Map.DoAutoSize())
            {
                Map.Draw();
            }
            CheckScrollers();
            CheckFrames(true);
            Invalidate();
            // Add current map info
            libraryForm.lvUsedObjects.BeginUpdate();
            libraryForm.lvUsedLinks.BeginUpdate();
            libraryForm.lvUsedBoxes.BeginUpdate();
            foreach (var PObject in Map.PObjects)
            {
                PObject.lvItemUsed = libraryForm.lvUsedObjects.Items.Add("");
                PObject.lvItemUsed.SubItems.Add("");
                PObject.lvItemUsed.SubItems.Add("");
                PObject.lvItemUsed.Tag = PObject;
                Share.Library_UpdateNodeName(PObject);
            }
            foreach (var PLink in Map.PLinks)
            {
                PLink.lvItemUsed = libraryForm.lvUsedLinks.Items.Add("");
                PLink.lvItemUsed.SubItems.Add("");
                PLink.lvItemUsed.SubItems.Add("");
                PLink.lvItemUsed.Tag = PLink;
                Share.Library_UpdateNodeName(PLink);
            }
            foreach (var PBox in Map.PBoxes)
            {
                PBox.lvItemUsed = libraryForm.lvUsedBoxes.Items.Add("");
                PBox.lvItemUsed.SubItems.Add("");
                PBox.lvItemUsed.SubItems.Add("");
                PBox.lvItemUsed.Tag = PBox;
                Share.Library_UpdateNodeName(PBox);
            }
            libraryForm.lvUsedObjects.EndUpdate();
            libraryForm.lvUsedLinks.EndUpdate();
            libraryForm.lvUsedBoxes.EndUpdate();
            Map.lv_PObjects = libraryForm.lvUsedObjects;
            Map.lv_PLinks   = libraryForm.lvUsedLinks;
            Map.lv_PBoxes   = libraryForm.lvUsedBoxes;
        }