public void Button_UD_Pressed(object sender, System.EventArgs e)
 {
     if (localstate.Type == TYPE.David1)
     {
         localstate.Type = TYPE.David2;
     }
     else
     {
         localstate.Type = TYPE.David1;
     }
     CURRENT_DISPLAY oldwas = localstate.DISPLAY;
     localstate.DISPLAY = olddisplay;
     olddisplay = oldwas;
     ShowKeys = !ShowKeys;
     something_changed = true;
     if (m_conf.FocusToZusi) Stuff.SetFocusToZusi();
 }
        public DavidControl(MMI.EBuLa.Tools.XMLLoader conf, ControlContainer cc)
        {
            if (!conf.DoubleBuffer)
            {
                //This turns off internal double buffering of all custom GDI+ drawing
                this.SetStyle(ControlStyles.DoubleBuffer, true);
                this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
                this.SetStyle(ControlStyles.UserPaint, true);
                USE_DOUBLE_BUFFER = false;
            }
            else
            {
                USE_DOUBLE_BUFFER = true;
            }

            InitializeComponent();

            m_conf = conf;
            this.cc = cc;

            localstate = new DavidState();

            localstate.ICEtype = ICETYPE.ICE1;
            localstate.Type = TYPE.David2;
            localstate.DISPLAY = CURRENT_DISPLAY.D2_B;
            olddisplay = CURRENT_DISPLAY.D1_I;

            //SetButtons();
            vtime = DateTime.Now;

            InitC_druck();

            int interval = Convert.ToInt32(Math.Round((1d/(double)FramesPerSecond)*1000d));
            timer1.Interval = interval;
            timer1.Enabled = true;

            switch (m_conf.Sound)
            {
                case 1:
                    sound = new APISound();
                    break;
                case 2:
                    sound = new DxSound();
                    break;
                default:
                    sound = new NullSound();
                    break;
            }
            Button_SW_Pressed(this, new EventArgs());
        }