Exemple #1
0
        //---------------------------------------------------------------------------

        private void btCancelClick(object sender, EventArgs e)
        {       // Lade wieder das eingestellte Preismodell
            if (CraftCurrent != null)
            {
                Unit.xml_config.OpenConfig(Unit.xml_config.arMenuItems[Utils.ConvertTagToInt(CraftCurrent.Tag)].FileName);
            }
            TMCapView.UpdateColors(); // Stelle wieder die Farben zurück
            TMCapView.UpdateFormat(); // Stelle wieder Formatierung zurück
        }
Exemple #2
0
        //---------------------------------------------------------------------------



        private void ShapeOnClick(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                cdColDialog.Color = ((RectangleShape)sender).BackColor;
                if (cdColDialog.ShowDialog(this) == DialogResult.OK)
                {
                    ((RectangleShape)sender).BackColor = cdColDialog.Color;
                    TMCapView.SetColor(Utils.ConvertTagToInt(((RectangleShape)sender).Tag), cdColDialog.Color);
                    MCapExample.Refresh();
                }
            }
        }
Exemple #3
0
        //---------------------------------------------------------------------------

        //already handled by shape

        /*private void ShapeContext(object sender, HandledMouseEventArgs e)
         * {
         *  Point abspos = ((RectangleShape)sender).PointToScreen(e.Location);
         *  //pmStatColors.SourceControl = ((RectangleShape)sender).Parent;
         *  pmStatColors.Show(((RectangleShape)sender).Parent, abspos.X, abspos.Y);
         * }*/
        //---------------------------------------------------------------------------

        private void ShapeNewCol(object sender, EventArgs e)
        {
            ContextMenuStrip menu      = (ContextMenuStrip)(((ToolStripMenuItem)sender).GetCurrentParent());
            ShapeContainer   container = (ShapeContainer)(menu).SourceControl;
            RectangleShape   pShape    = (RectangleShape)container.GetChildAtPoint(container.PointToClient(menu.Location));

            cdColDialog.Color = pShape.BackColor;
            if (cdColDialog.ShowDialog(this) == DialogResult.OK)
            {
                pShape.BackColor = cdColDialog.Color;
                TMCapView.SetColor(Utils.ConvertTagToInt(pShape.Tag), cdColDialog.Color);
                MCapExample.Refresh();
            }
        }
Exemple #4
0
        //---------------------------------------------------------------------------

        private void btOkClick(object sender, EventArgs e)
        {
            Utils.SetRegistryInteger("UpdateMode", rgUpdateMode.ItemIndex);
            Utils.SetRegistryInteger("OverwriteItems", cbOverwriteItems.Checked ? 1 : 0);
            Utils.SetRegistryInteger("UseProxy", cbUseProxy.Checked ? 1 : 0);
            Utils.SetRegistryInteger("AlternateLogin", cbAlternateLogin.Checked ? 1 : 0);
            Utils.SetRegistryString("ProxyServer", edServer.Text);
            Utils.SetRegistryString("ProxyPort", edPort.Text);
            Utils.SetRegistryString("ProxyUser", edUser.Text);
            Utils.SetRegistryString("ProxyPasswd", edPasswd.Text);
            Utils.SetRegistryInteger("IPWorkaround", cbIPWorkaround.Checked ? 1 : 0);
            Utils.SetRegistryInteger("CalcTotalUtility", cbCalcTotalUtility.Checked ? 1 : 0);
            Utils.SetRegistryInteger("ItemPreview", cbItemPreview.Checked ? 1 : 0);
            Utils.SetRegistryInteger("WikiHelp", cbWikiHelp.Checked ? 1 : 0);
            Utils.SetRegistryInteger("LoadChars", cbLoadChars.Checked ? 1 : 0);
            Utils.SetRegistryInteger("CheckForUpdate", cbCheckForUpdate.Checked ? 1 : 0);
            Utils.SetRegistryInteger("ProcessPriority", cbProcess.Checked ? 1 : 0);
            Utils.SetRegistryInteger("UpdateIntervall", rgUpdateIntervall.ItemIndex);

            Utils.SetRegistryInteger("StatDisplayMode", rgStatDisplay.ItemIndex);
            Utils.SetRegistryString("StatDisplayFormula", edDisplayStatFormula.Text);
            Utils.SetRegistryInteger("StatDisplayFloorCol", (int)Utils.Color2Int(shFloorCol.BackColor));
            Utils.SetRegistryInteger("StatDisplayCapCol", (int)Utils.Color2Int(shCapCol.BackColor));
            Utils.SetRegistryInteger("StatDisplayCapIncCol", (int)Utils.Color2Int(shCapIncCol.BackColor));
            Utils.SetRegistryInteger("StatDisplayCapAddCol", (int)Utils.Color2Int(shCapAddCol.BackColor));
            Utils.SetRegistryInteger("StatDisplayCapSubCol", (int)Utils.Color2Int(shCapSubCol.BackColor));
            Utils.SetRegistryInteger("StatDisplayValueCol", (int)Utils.Color2Int(shValueCol.BackColor));
            Utils.SetRegistryInteger("StatDisplayValueAddCol", (int)Utils.Color2Int(shValueAddCol.BackColor));
            Utils.SetRegistryInteger("StatDisplayValueSubCol", (int)Utils.Color2Int(shValueSubCol.BackColor));
            Utils.SetRegistryInteger("StatDisplayTextCol", (int)Utils.Color2Int(shTextCol.BackColor));
            Utils.SetRegistryInteger("StatDisplayTextMouseOverColCol", (int)Utils.Color2Int(shTextMouseOverCol.BackColor));
            TMCapView.UpdateColors();
            TMCapView.UpdateFormat();

            // gewähltes Preismodell speichern
            Unit.xml_config.SavePriceModel(cbPriceModel.CurrentData);
            // Und zugehörigen Menüpunkt aktivieren
            if (CraftMenu != null)
            {
                TMainMenu.TTBXCustomItem item = (TMainMenu.TTBXCustomItem)Utils.FindTBXItem(CraftMenu, Unit.xml_config.arMenuItems[cbPriceModel.CurrentData].Name);
                Debug.Assert(item != null);
                Unit.frmMain.mnUserOptionClick(item, EventArgs.Empty);
            }

            //Speichern der Erweiterungen
            for (int ext = 0; ext < Unit.xml_config.nExtensions; ext++)
            {
                Utils.SetRegistryInteger(Unit.xml_config.arExtensions[ext].Name, cbAddons.GetItemChecked(ext) ? 1 : 0, "\\Extensions");
            }
        }
Exemple #5
0
        //---------------------------------------------------------------------------

        private void ShapeRestoreCol(object sender, EventArgs e)
        {
            Color[] OldCols = new Color[10] {
                Color.White, Color.Gray, Utils.Int2Color(0x00aa0000), Utils.Int2Color(0x000000cc), Utils.Int2Color(0x0000cc00), Color.Gray,
                Utils.Int2Color(0x006666dd), Utils.Int2Color(0x0066dd66), SystemColors.ControlText, Color.Blue
            };

            ContextMenuStrip menu      = (ContextMenuStrip)(((ToolStripMenuItem)sender).GetCurrentParent());
            ShapeContainer   container = (ShapeContainer)(menu).SourceControl;
            RectangleShape   pShape    = (RectangleShape)container.GetChildAtPoint(container.PointToClient(menu.Location));;

            if (Utils.ConvertTagToInt(pShape.Tag) >= 0 && Utils.ConvertTagToInt(pShape.Tag) < 10)
            {
                pShape.BackColor = OldCols[Utils.ConvertTagToInt(pShape.Tag)];
                TMCapView.SetColor(Utils.ConvertTagToInt(pShape.Tag), OldCols[Utils.ConvertTagToInt(pShape.Tag)]);
                MCapExample.Refresh();
            }
        }