// ReSharper restore InconsistentNaming
        void InitializeComponents()
        {
            Stream stream = Assembly
                .GetExecutingAssembly()
                .GetManifestResourceStream(AppController.Instance.Config.DrawingAreaWindow);

            var glade = new Glade.XML(stream, AppController.Instance.Config.DrawingAreaWindowName, null);
            if (stream != null)
            {
                stream.Close();
            }
            glade.Autoconnect(this);

            //todo: add icon
            //this.IconList = new Pixbuf[]{ new Pixbuf(System.Reflection.Assembly.GetExecutingAssembly(), "LadderLogic.bmp")};
            //this.Icon = this.IconList[0];

            var drw = new ElementDrawing (DrawingAreaController.Instance.Surface, 2, 2);
            vbox1.Add(drw);
            drw.Show ();
        }
// ReSharper restore InconsistentNaming


        void InitializeComponents()
        {
            Stream stream = Assembly
                            .GetExecutingAssembly()
                            .GetManifestResourceStream(AppController.Instance.Config.DrawingAreaWindow);

            var glade = new Glade.XML(stream, AppController.Instance.Config.DrawingAreaWindowName, null);

            if (stream != null)
            {
                stream.Close();
            }
            glade.Autoconnect(this);

            //todo: add icon
            //this.IconList = new Pixbuf[]{ new Pixbuf(System.Reflection.Assembly.GetExecutingAssembly(), "LadderLogic.bmp")};
            //this.Icon = this.IconList[0];

            var drw = new ElementDrawing(DrawingAreaController.Instance.Surface, 2, 2);

            vbox1.Add(drw);
            drw.Show();
        }
Exemple #3
0
        void InitializeComponents()
        {
            var stream = Assembly
                         .GetExecutingAssembly()
                         .GetManifestResourceStream(AppController.Instance.Config.AppWindow);

            var glade = new Glade.XML(stream, AppController.Instance.Config.AppWindowName, null);

            if (stream != null)
            {
                stream.Close();
            }
            glade.Autoconnect(this);

            mNew.Activated         += OnNew;
            mOpen.Activated        += OnOpen;
            mSave.Activated        += OnSave;
            mSaveAs.Activated      += OnSaveAs;
            mQuit.Activated        += OnQuit;
            mEnvironment.Activated += OnEnvironment;
            mAbout.Activated       += OnAbout;
            mExportToPng.Activated += OnExportToPng;

            rbDefault.Clicked  += OnVariableRadiobuttonCliecked;
            rbExisting.Clicked += OnVariableRadiobuttonCliecked;
            rbNew.Clicked      += OnVariableRadiobuttonCliecked;

            rbDefault1.Clicked  += OnVariableRadiobuttonCliecked1;
            rbExisting1.Clicked += OnVariableRadiobuttonCliecked1;
            rbNew1.Clicked      += OnVariableRadiobuttonCliecked1;

            rbDefault2.Clicked  += OnVariableRadiobuttonCliecked2;
            rbExisting2.Clicked += OnVariableRadiobuttonCliecked2;
            rbNew2.Clicked      += OnVariableRadiobuttonCliecked2;

            rbDefault3.Clicked  += OnVariableRadiobuttonCliecked3;
            rbExisting3.Clicked += OnVariableRadiobuttonCliecked3;
            rbNew3.Clicked      += OnVariableRadiobuttonCliecked3;

            DisableProperties();

            cbDefaultVar.Changed += OnVariableComboboxChanged;
            cbExistVar.Changed   += OnVariableComboboxChanged;
            etNewVar.Changed     += OnVariableComboboxChanged;

            cbDefaultVar1.Changed += OnVariableComboboxChanged;
            cbExistVar1.Changed   += OnVariableComboboxChanged;
            etNewVar1.Changed     += OnVariableComboboxChanged;

            cbDefaultVar2.Changed += OnVariableComboboxChanged;
            cbExistVar2.Changed   += OnVariableComboboxChanged;
            etNewVar2.Changed     += OnVariableComboboxChanged;

            cbDefaultVar3.Changed += OnVariableComboboxChanged;
            cbExistVar3.Changed   += OnVariableComboboxChanged;
            etNewVar3.Changed     += OnVariableComboboxChanged;

            cbFunction.Changed  += OnFunctionChanged;
            chbOverride.Toggled += OnOverrideToggled;

            IconList = new[] { new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), AppController.Instance.Config.Icon) };
            Icon     = IconList[0];

            var surfaces = AppController.Instance.GetPalette();

            uint count = (uint)surfaces.Sum(s => s.Segments.Count);

            table1 = new Gtk.Table(2, count / 2, true);

            int index = 0;

            for (uint i = 0; i < count / 2; i++)
            {
                for (uint j = 0; j < 2; j++)
                {
                    if (surfaces.Count() > index)
                    {
                        var surf = surfaces [index++];
                        var el   = new ElementDrawing(surf, 2, 2);
                        table1.Attach(el, i, i + 1, j, j + (uint)surf.Segments.Count());
                        el.Show();
                    }
                }
            }

            vboxPalette.Add(table1);

            table1.SetSizeRequest(300, 100);
            table1.Show();

            _grid = new ElementDrawing(AppController.Instance.Surface, 24, 24);

            scrolledwindow1.AddWithViewport(_grid);

            _grid.Show();

            var arduino = AppController.Instance.GetArduino();

            var code = new ElementDrawing(arduino[0], 2, 2);

            tblArdulino.Attach(code, 0, 1, 0, 1);
            code.CreateCode += CController.Instance.CreateCode;
            code.Show();
        }
Exemple #4
0
        void InitializeComponents()
        {
            var stream = Assembly
                .GetExecutingAssembly()
                .GetManifestResourceStream(AppController.Instance.Config.AppWindow);

            var glade = new Glade.XML(stream, AppController.Instance.Config.AppWindowName, null);
            if (stream != null)
            {
                stream.Close();
            }
            glade.Autoconnect(this);

            mNew.Activated += OnNew;
            mOpen.Activated += OnOpen;
            mSave.Activated += OnSave;
            mSaveAs.Activated += OnSaveAs;
            mQuit.Activated += OnQuit;
            mEnvironment.Activated += OnEnvironment;
            mAbout.Activated += OnAbout;
            mExportToPng.Activated += OnExportToPng;

            rbDefault.Clicked += OnVariableRadiobuttonCliecked;
            rbExisting.Clicked += OnVariableRadiobuttonCliecked;
            rbNew.Clicked += OnVariableRadiobuttonCliecked;

            rbDefault1.Clicked += OnVariableRadiobuttonCliecked1;
            rbExisting1.Clicked += OnVariableRadiobuttonCliecked1;
            rbNew1.Clicked += OnVariableRadiobuttonCliecked1;

            rbDefault2.Clicked += OnVariableRadiobuttonCliecked2;
            rbExisting2.Clicked += OnVariableRadiobuttonCliecked2;
            rbNew2.Clicked += OnVariableRadiobuttonCliecked2;

            rbDefault3.Clicked += OnVariableRadiobuttonCliecked3;
            rbExisting3.Clicked += OnVariableRadiobuttonCliecked3;
            rbNew3.Clicked += OnVariableRadiobuttonCliecked3;

            DisableProperties ();

            cbDefaultVar.Changed += OnVariableComboboxChanged;
            cbExistVar.Changed += OnVariableComboboxChanged;
            etNewVar.Changed += OnVariableComboboxChanged;

            cbDefaultVar1.Changed += OnVariableComboboxChanged;
            cbExistVar1.Changed += OnVariableComboboxChanged;
            etNewVar1.Changed += OnVariableComboboxChanged;

            cbDefaultVar2.Changed += OnVariableComboboxChanged;
            cbExistVar2.Changed += OnVariableComboboxChanged;
            etNewVar2.Changed += OnVariableComboboxChanged;

            cbDefaultVar3.Changed += OnVariableComboboxChanged;
            cbExistVar3.Changed += OnVariableComboboxChanged;
            etNewVar3.Changed += OnVariableComboboxChanged;

            cbFunction.Changed += OnFunctionChanged;
            chbOverride.Toggled += OnOverrideToggled;

            IconList = new[]{ new Gdk.Pixbuf (Assembly.GetExecutingAssembly (), AppController.Instance.Config.Icon) };
            Icon = IconList[0];

            var surfaces = AppController.Instance.GetPalette ();

            var count = (uint)surfaces.Sum (s => s.Segments.Count);
            table1 = new Table (2, count / 2, true);

            var index = 0;
            for (uint i = 0; i < count / 2; i++) {
                for (uint j = 0; j < 2; j++) {
                    if (surfaces.Count() <= index) continue;
                    var surf = surfaces [index++];
                    var el = new ElementDrawing(surf, 2, 2 );
                    table1.Attach (el, i, i+1, j, j+(uint)surf.Segments.Count());
                    el.Show ();
                }
            }

            vboxPalette.Add (table1);

            table1.SetSizeRequest (300, 100);
            table1.Show ();

            _grid = new ElementDrawing(AppController.Instance.Surface, 24, 24);

            scrolledwindow1.AddWithViewport (_grid);

            _grid.Show ();

            var arduino = AppController.Instance.GetArduino ();

            var code = new ElementDrawing(arduino[0], 2, 2 );
            tblArdulino.Attach (code, 0, 1, 0, 1);
            code.CreateCode += CController.Instance.CreateCode;
            code.Show ();
            var t = new System.Threading.Thread(() =>
            {
                System.Threading.Thread.Sleep(2000);
                UpdateHelper.CompareVersions(this);
            });
            t.Start();
        }