예제 #1
0
        private static void AddSkinRow(Dialog dialog, BoxSizer column, string txt, SkinElementColor rgb, int rgbV)
        {
            string     buff;
            wxSize     sz        = new wxSize(40, 20);
            StaticText separator = new StaticText(dialog, 0, wxPorting.T("   "));

            BoxSizer row = new BoxSizer(Orientation.wxHORIZONTAL);

            rgb.m_label       = new StaticText(dialog, 0, wxPorting.LV(txt));
            rgb.m_rgbSelector = new Button(dialog, (int)MenuIDs.ID_CHOICE, wxPorting.L("Color..."), Window.wxDefaultPosition, Window.wxDefaultSize);
            sz.Height         = (rgb.m_rgbSelector.Size.Height);
            rgb.m_r           = new TextCtrl(dialog, 0, Globals.wxEmptyString, Window.wxDefaultPosition, sz);
            rgb.m_g           = new TextCtrl(dialog, 0, Globals.wxEmptyString, Window.wxDefaultPosition, sz);
            rgb.m_b           = new TextCtrl(dialog, 0, Globals.wxEmptyString, Window.wxDefaultPosition, sz);

            buff          = String.Format(wxPorting.T("%d"), (rgbV >> 16) & 0xFF);
            rgb.m_r.Value = (buff);
            buff          = String.Format(wxPorting.T("%d"), (rgbV >> 8) & 0xFF);
            rgb.m_g.Value = (buff);
            buff          = String.Format(wxPorting.T("%d"), rgbV & 0xFF);
            rgb.m_b.Value = (buff);

            row.Add(rgb.m_label, 35, SizerFlag.wxALIGN_LEFT | SizerFlag.wxRIGHT | SizerFlag.wxTOP, 4);
            row.Add(rgb.m_r, 20, SizerFlag.wxALIGN_RIGHT | SizerFlag.wxTOP, 4);
            row.Add(rgb.m_g, 20, SizerFlag.wxALIGN_RIGHT | SizerFlag.wxTOP, 4);
            row.Add(rgb.m_b, 20, SizerFlag.wxALIGN_RIGHT | SizerFlag.wxTOP, 4);
            row.Add(separator, 2, SizerFlag.wxTOP, 4);
            row.Add(rgb.m_rgbSelector, 20, SizerFlag.wxALIGN_RIGHT | SizerFlag.wxTOP, 4);

            column.Add(row, 1, SizerFlag.wxGROW | SizerFlag.wxLEFT | SizerFlag.wxRIGHT, 10);
        }
예제 #2
0
        public ComPanel(Window parent, ComService comService)
            : base(parent)
        {
            _comService                = comService;
            _comService.DataArrived   += ComDataArrived;
            _comService.StatusChanged += ComStatusChanged;

            var sizer = new BoxSizer(Orientation.Vertical);

            _dataFont = new Font(10, FontFamily.Teletype, FontStyle.Normal, FontWeight.Normal);

            Panel controlPanel = CreateControlPanel();

            sizer.Add(controlPanel, 0, SizerFlag.Expand | SizerFlag.All, 0);

            _history = new TextCtrl(this, "", WxDefaultPosition, WxDefaultSize,
                                    WindowStyles.TextCtrlMultiline | WindowStyles.TextCtrlReadonly)
            {
                Font = _dataFont
            };
            sizer.Add(_history, 1, SizerFlag.Expand | SizerFlag.All, 0);

            Panel sendPanel = CreateSendPanel();

            sizer.Add(sendPanel, 0, SizerFlag.Expand | SizerFlag.All, 5);

            SetSizer(sizer);
            sizer.SetSizeHints(this);

            EvtSize((e, s) => Sizer.SetDimension(0, 0, Width, Height));
            EvtClose((e, s) => OnClose());

            DisableInput();
        }
예제 #3
0
        public SkinColorsDialog(Window parent, TDSkin skn)
            : base(parent, 0, wxPorting.L("Skin Colors"), Window.wxDefaultPosition, Window.wxDefaultSize,
                   WindowStyles.DD_DEFAULT_STYLE, wxPorting.L("Skin Colors"))
        {
            EVT_BUTTON((int)MenuIDs.ID_CHOICE, new wx.EventListener(OnColorChoice));

            m_skin = skn;

            BoxSizer column = new BoxSizer(Orientation.wxVERTICAL);

            AddSkinRow(this, column, wxPorting.L("Background"), m_background, m_skin.background);
            AddSkinRow(this, column, wxPorting.L("Free Track"), m_freeTrack, m_skin.free_track);
            AddSkinRow(this, column, wxPorting.L("Reserved Track"), m_reservedTrack, m_skin.reserved_track);
            AddSkinRow(this, column, wxPorting.L("Reserved for Shunting"), m_reservedShunting, m_skin.reserved_shunting);
            AddSkinRow(this, column, wxPorting.L("Occupied"), m_occupiedTrack, m_skin.occupied_track);
            AddSkinRow(this, column, wxPorting.L("Reserved for Working"), m_workingTrack, m_skin.working_track);
            AddSkinRow(this, column, wxPorting.L("Switch Outline"), m_outline, m_skin.outline);
            AddSkinRow(this, column, wxPorting.L("Text"), m_text, m_skin.text);

            BoxSizer row = new BoxSizer(Orientation.wxHORIZONTAL);

            row.Add(new Button(this, wxID_CANCEL, wxPorting.L("Cance&l")), 0, SizerFlag.wxALL, 4);
            row.Add(new Button(this, wxID_OK, wxPorting.L("&Close")), 0, SizerFlag.wxALL, 4);
            column.Add(row, 0, SizerFlag.wxALIGN_RIGHT | SizerFlag.wxGROW | SizerFlag.wxALL, 6);

            SetSizer(column);
            column.Fit(this);
            column.SetSizeHints(this);
        }
예제 #4
0
        private Panel CreateControlPanel()
        {
            Panel    panel = new Panel(this);
            BoxSizer sizer = new BoxSizer(Orientation.Horizontal);

            _port = new ComboBox(panel, "", WxDefaultPosition, WxDefaultSize, new string[0],
                                 WindowStyles.ComboBoxDropDown | WindowStyles.ComboBoxReadonly);
            UpdatePorts();
            sizer.Add(_port, 0, SizerFlag.Expand | SizerFlag.All, 5);

            Bitmap refreshBitmap = GetType().Assembly.GetManifestResourceWxBitmap("DummyLoadController.Images.refresh.png");

            _refreshPorts = new BitmapButton(panel, ID_RefreshPorts, refreshBitmap);
            EvtButton(ID_RefreshPorts, (s, e) => UpdatePorts());
            sizer.Add(_refreshPorts, 0, SizerFlag.Expand | SizerFlag.All, 0);

            string[] baudRates = new[] { "300", "600", "1200", "2400", "4800", "9600", "14,400", "19,200", "28,800", "38,400", "57,600", "76,800", "115,200", "230,400" };
            _baudRate = new ComboBox(panel, "", WxDefaultPosition, WxDefaultSize, baudRates, WindowStyles.ComboBoxDropDown | WindowStyles.ComboBoxReadonly);
            _baudRate.Select(5);
            sizer.Add(_baudRate, 0, SizerFlag.Expand | SizerFlag.All, 5);

            _connect = new Button(panel, ID_Connect, "Connect");
            EvtButton(ID_Connect, (s, e) => Connect());
            sizer.Add(_connect, 0, SizerFlag.Expand | SizerFlag.All, 5);

            _disconnect = new Button(panel, ID_Disconnect, "Disconnect");
            EvtButton(ID_Disconnect, (s, e) => _comService.Disconnect());
            sizer.Add(_disconnect, 0, SizerFlag.Expand | SizerFlag.All, 5);

            panel.SetSizer(sizer);
            sizer.SetSizeHints(panel);

            return(panel);
        }
예제 #5
0
        private Panel CreateSendPanel()
        {
            Panel    panel = new Panel(this);
            BoxSizer sizer = new BoxSizer(Orientation.Horizontal);

            _textInput = new TextCtrl(panel, "", WxDefaultPosition, WxDefaultSize, WindowStyles.TextCtrlProcessEnter)
            {
                Font = _dataFont
            };
            sizer.Add(_textInput, 1, SizerFlag.Expand | SizerFlag.All, 0);
            _textInput.EvtKeyDown((s, e) =>
            {
                KeyEvent keyEvent = e as KeyEvent;
                if (keyEvent != null && keyEvent.KeyCode == 13)
                {
                    OnSend();
                }
                e.Skip(true);
            });

            _send = new Button(panel, ID_Send, "Send");
            EvtButton(ID_Send, (s, e) => OnSend());
            sizer.Add(_send, 0, SizerFlag.Expand | SizerFlag.All, 0);

            panel.SetSizer(sizer);
            sizer.SetSizeHints(panel);

            return(panel);
        }
예제 #6
0
    public static Sizer MyDialogFunc( Window parent, bool call_fit, bool set_sizer )
    {
        BoxSizer item0 = new BoxSizer( Orientation.wxVERTICAL );

        StaticBox item2 = new StaticBox( parent, -1, "Copyright" );
        item2.Font = new wx.Font( 16, wx.FontFamily.wxROMAN, wx.FontStyle.wxNORMAL, wx.FontWeight.wxNORMAL );
        StaticBoxSizer item1 = new StaticBoxSizer( item2, Orientation.wxVERTICAL );

        StaticText item3 = new StaticText( parent, ID_TEXT, "Copyright 2002 T. Coon. 1000,- ¤.", Window.wxDefaultPosition, Window.wxDefaultSize, 0 );
        item3.ForegroundColour = Colour.wxBLUE;
        item3.Font = new wx.Font( 16, wx.FontFamily.wxROMAN, wx.FontStyle.wxNORMAL, wx.FontWeight.wxNORMAL );
        item1.Add( item3, 0, Alignment.wxALIGN_CENTER|Direction.wxALL, 5 );

        item0.Add( item1, 0, Stretch.wxGROW|Alignment.wxALIGN_CENTER_VERTICAL|Direction.wxALL, 5 );

        StaticLine item4 = new StaticLine( parent, ID_LINE, Window.wxDefaultPosition, new Size(20,-1), StaticLine.wxLI_HORIZONTAL );
        item0.Add( item4, 0, Stretch.wxGROW|Alignment.wxALIGN_CENTER_VERTICAL|Direction.wxALL, 5 );

        Button item5 = new Button( parent, Window.wxID_OK, "OK", Window.wxDefaultPosition, Window.wxDefaultSize, 0 );
        item0.Add( item5, 0, Alignment.wxALIGN_CENTER|Direction.wxALL, 5 );

        if (set_sizer)
        {
            parent.SetSizer( item0 );
            if (call_fit)
                item0.SetSizeHints( parent );
        }

        return item0;
    }
예제 #7
0
        public ComPanel(Window parent, ComService comService)
            : base(parent)
        {
            _comService = comService;
            _comService.DataArrived += ComDataArrived;
            _comService.StatusChanged += ComStatusChanged;

            var sizer = new BoxSizer(Orientation.Vertical);
            _dataFont = new Font(10, FontFamily.Teletype, FontStyle.Normal, FontWeight.Normal);

            Panel controlPanel = CreateControlPanel();
            sizer.Add(controlPanel, 0, SizerFlag.Expand | SizerFlag.All, 0);

            _history = new TextCtrl(this, "", WxDefaultPosition, WxDefaultSize,
                WindowStyles.TextCtrlMultiline | WindowStyles.TextCtrlReadonly)
                {
                    Font = _dataFont
                };
            sizer.Add(_history, 1, SizerFlag.Expand | SizerFlag.All, 0);

            Panel sendPanel = CreateSendPanel();
            sizer.Add(sendPanel, 0, SizerFlag.Expand | SizerFlag.All, 5);

            SetSizer(sizer);
            sizer.SetSizeHints(this);

            EvtSize((e, s) => Sizer.SetDimension(0, 0, Width, Height));
            EvtClose((e, s) => OnClose());

            DisableInput();
        }
예제 #8
0
        public ScenarioInfoDialog(Window parent)
            : base(parent, 0, wxPorting.L("Scenario Information"), Window.wxDefaultPosition, Window.wxDefaultSize,
                   WindowStyles.DD_DEFAULT_STYLE, wxPorting.L("Scenario Information"))
        {
            BoxSizer buttonCol  = new BoxSizer(Orientation.wxVERTICAL);
            BoxSizer column     = new BoxSizer(Orientation.wxVERTICAL);
            BoxSizer leftColumn = new BoxSizer(Orientation.wxVERTICAL);
            BoxSizer row        = new BoxSizer(Orientation.wxHORIZONTAL);
            ListItem col        = new ListItem();

            m_notes = new TextCtrl(this, wxID_ANY, Globals.wxEmptyString,
                                   Window.wxDefaultPosition, new Size(200, 100), WindowStyles.TE_MULTILINE);

            leftColumn.Add(m_notes, 2, SizerFlag.wxGROW | SizerFlag.wxALL, 3);

            row.Add(leftColumn, 60, SizerFlag.wxGROW | SizerFlag.wxRIGHT | SizerFlag.wxLEFT, 3);

            buttonCol.Add(row, 0, SizerFlag.wxGROW | SizerFlag.wxALL, 5);

            row = new BoxSizer(Orientation.wxHORIZONTAL);
            row.Add(new Button(this, wxID_OK, wxPorting.L("&OK")), 0, SizerFlag.wxALL, 4);
            row.Add(new Button(this, wxID_CANCEL, wxPorting.L("&Cancel")), 0, SizerFlag.wxALL, 4);

            buttonCol.Add(row, 0, SizerFlag.wxALIGN_RIGHT | SizerFlag.wxGROW | SizerFlag.wxALL, 6);
            SetSizer(buttonCol);
            buttonCol.Fit(this);
            buttonCol.SetSizeHints(this);
        }
예제 #9
0
    public static Sizer MyDialogFunc(Window parent, bool call_fit, bool set_sizer)
    {
        BoxSizer item0 = new BoxSizer(Orientation.wxVERTICAL);

        StaticBox      item2 = new StaticBox(parent, -1, "Controls will remember their values");
        StaticBoxSizer item1 = new StaticBoxSizer(item2, Orientation.wxVERTICAL);

        FlexGridSizer item3 = new FlexGridSizer(0, 2, 0, 0);

        item3.AddGrowableCol(0);
        item3.AddGrowableCol(1);

        StaticText item4 = new StaticText(parent, ID_TEXT, "wxSpinCtrl:", Window.wxDefaultPosition, Window.wxDefaultSize, 0);

        item4.Name = "TestName";
        item3.Add(item4, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 5);

        SpinCtrl item5 = new SpinCtrl(parent, ID_MY_NUMBER, "0", Window.wxDefaultPosition, new Size(130, -1), SpinCtrl.wxSP_ARROW_KEYS | SpinCtrl.wxSP_WRAP, 0, 100, 0);

        item3.Add(item5, 0, Stretch.wxGROW | Alignment.wxALIGN_CENTER_VERTICAL | Direction.wxALL, 5);

        StaticText item6 = new StaticText(parent, ID_TEXT, "wxTextCtrl:", Window.wxDefaultPosition, Window.wxDefaultSize, 0);

        item3.Add(item6, 0, Alignment.wxALIGN_RIGHT | Alignment.wxALIGN_CENTER_VERTICAL | Direction.wxALL, 5);

        TextCtrl item7 = new TextCtrl(parent, ID_MY_TEXT, "", Window.wxDefaultPosition, new Size(130, -1), 0);

        item3.Add(item7, 0, Stretch.wxGROW | Alignment.wxALIGN_CENTER_VERTICAL | Direction.wxALL, 5);

        item1.Add(item3, 1, Stretch.wxGROW | Direction.wxALL, 5);

        item0.Add(item1, 0, Stretch.wxGROW | Alignment.wxALIGN_CENTER_VERTICAL | Direction.wxALL, 5);

        StaticLine item8 = new StaticLine(parent, ID_LINE, Window.wxDefaultPosition, new Size(300, -1), StaticLine.wxLI_HORIZONTAL);

        item0.Add(item8, 0, Stretch.wxGROW | Alignment.wxALIGN_CENTER_VERTICAL | Direction.wxALL, 5);

        Button item9 = new Button(parent, Window.wxID_OK, "OK", Window.wxDefaultPosition, Window.wxDefaultSize, 0);

        item0.Add(item9, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 5);

        if (set_sizer)
        {
            parent.SetSizer(item0);
            if (call_fit)
            {
                item0.SetSizeHints(parent);
            }
        }

        return(item0);
    }
예제 #10
0
            //
            //
            //


            public SwitchboardCellDialog(Window parent)
                : base(parent, 0, wxPorting.T("Switchboard Name"), Window.wxDefaultPosition, Window.wxDefaultSize,
                       WindowStyles.DD_DEFAULT_STYLE, wxPorting.L("Switchboard Name"))
            {
                EVT_BUTTON((int)wx.MenuIDs.wxID_RESET, new wx.EventListener(OnRemove));
                EVT_BUTTON((int)wx.MenuIDs.wxID_OK, new wx.EventListener(OnSave));
                EVT_BUTTON((int)wx.MenuIDs.wxID_CANCEL, new wx.EventListener(OnClose));



                ArrayString strings;
                BoxSizer    column = new BoxSizer(Orientation.wxVERTICAL);
                BoxSizer    row    = new BoxSizer(Orientation.wxHORIZONTAL);

                StaticText header = new StaticText(this, 0, wxPorting.L("&Label"));

                m_name = new TextCtrl(this, 0, Globals.wxEmptyString, Window.wxDefaultPosition, Window.wxDefaultSize);

                row.Add(header, 35, SizerFlag.wxALIGN_LEFT | SizerFlag.wxRIGHT, 4);
                row.Add(m_name, 65, SizerFlag.wxGROW | SizerFlag.wxALIGN_RIGHT | SizerFlag.wxLEFT, 6);

                column.Add(row, 1, SizerFlag.wxGROW | SizerFlag.wxTOP | SizerFlag.wxRIGHT | SizerFlag.wxLEFT, 10);

                row = new BoxSizer(Orientation.wxHORIZONTAL);

                header = new StaticText(this, 0, wxPorting.L("&Itinerary Name"));
                m_itin = new TextCtrl(this, 0, Globals.wxEmptyString, Window.wxDefaultPosition, Window.wxDefaultSize);

                row.Add(header, 35, SizerFlag.wxALIGN_LEFT | SizerFlag.wxRIGHT, 4);
                row.Add(m_itin, 65, SizerFlag.wxGROW | SizerFlag.wxALIGN_RIGHT | SizerFlag.wxLEFT, 6);

                column.Add(row, 1, SizerFlag.wxGROW | SizerFlag.wxTOP | SizerFlag.wxRIGHT | SizerFlag.wxLEFT, 10);
                //	wxStaticLine *line = new wxStaticLine( this );

                //	column.Add(line);

                row = new BoxSizer(Orientation.wxHORIZONTAL);

                m_removebutton = new Button(this, (int)wx.MenuIDs.wxID_RESET, wxPorting.L("&Remove"));
                row.Add(m_removebutton, 0, SizerFlag.wxTOP | SizerFlag.wxGROW, 10);
                m_savebutton = new Button(this, wxID_OK, wxPorting.L("&Save"));
                m_savebutton.SetDefault();
                row.Add(m_savebutton, 0, SizerFlag.wxTOP | SizerFlag.wxGROW, 10);
                m_closebutton = new Button(this, wxID_CANCEL, wxPorting.L("Cl&ose"));
                row.Add(m_closebutton, 0, SizerFlag.wxTOP | SizerFlag.wxGROW, 10);

                column.Add(row, 1, SizerFlag.wxGROW | SizerFlag.wxTOP | SizerFlag.wxRIGHT | SizerFlag.wxLEFT, 10);

                SetSizer(column);
                column.Fit(this);
                column.SetSizeHints(this);
            }
예제 #11
0
        public static TextCtrl AddTextLine(Dialog dialog, BoxSizer column, string txt)
        {
            BoxSizer   row     = new BoxSizer(Orientation.wxHORIZONTAL);
            StaticText header  = new StaticText(dialog, 0, wxPorting.LV(txt));
            TextCtrl   txtctrl = new TextCtrl(dialog, 0, Globals.wxEmptyString, Window.wxDefaultPosition, Window.wxDefaultSize);

            row.Add(header, 50, SizerFlag.wxGROW | SizerFlag.wxLEFT, 10);
            row.Add(txtctrl, 50, SizerFlag.wxGROW | SizerFlag.wxLEFT, 10);

            column.Add(row, 1, SizerFlag.wxGROW | SizerFlag.wxALL, 10);

            return(txtctrl);
        }
예제 #12
0
    public static Sizer NotebookFunc(Window parent, bool call_fit, bool set_sizer)
    {
        BoxSizer item0 = new BoxSizer(Orientation.wxVERTICAL);

        Notebook      item2 = new Notebook(parent, ID_NOTEBOOK, Window.wxDefaultPosition, new Size(200, 160), 0);
        NotebookSizer item1 = new NotebookSizer(item2);

        Panel item3 = new Panel(item2, -1);

        PageOneFunc(item3, false);
        item2.AddPage(item3, "Page 1");

        Panel item4 = new Panel(item2, -1);

        PageTwoFunc(item4, false);
        item2.AddPage(item4, "Page 2");

        Panel item5 = new Panel(item2, -1);

        item2.AddPage(item5, "Page 3");

        item0.Add(item1, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 5);

        StaticLine item6 = new StaticLine(parent, ID_LINE, Window.wxDefaultPosition, new Size(20, -1), StaticLine.wxLI_HORIZONTAL);

        item0.Add(item6, 0, Stretch.wxGROW | Alignment.wxALIGN_CENTER_VERTICAL | Direction.wxALL, 5);

        BoxSizer item7 = new BoxSizer(Orientation.wxHORIZONTAL);

        Button item8 = new Button(parent, Window.wxID_OK, "OK", Window.wxDefaultPosition, Window.wxDefaultSize, 0);

        item8.SetDefault();
        item7.Add(item8, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 5);

        Button item9 = new Button(parent, Window.wxID_CANCEL, "Cancel", Window.wxDefaultPosition, Window.wxDefaultSize, 0);

        item7.Add(item9, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 5);

        item0.Add(item7, 0, Alignment.wxALIGN_CENTER | Direction.wxLEFT | Direction.wxRIGHT | Direction.wxBOTTOM, 5);

        if (set_sizer)
        {
            parent.SetSizer(item0);
            if (call_fit)
            {
                item0.SetSizeHints(parent);
            }
        }

        return(item0);
    }
예제 #13
0
    public static Sizer PageTwoFunc(Window parent, bool call_fit, bool set_sizer)
    {
        BoxSizer item0 = new BoxSizer(Orientation.wxVERTICAL);

        StaticBox      item2 = new StaticBox(parent, -1, "Checks");
        StaticBoxSizer item1 = new StaticBoxSizer(item2, Orientation.wxHORIZONTAL);

        CheckBox item3 = new CheckBox(parent, ID_CHECKBOX, "Check", Window.wxDefaultPosition, Window.wxDefaultSize, 0);

        item1.Add(item3, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 5);

        CheckBox item4 = new CheckBox(parent, ID_CHECKBOX, "Check", Window.wxDefaultPosition, Window.wxDefaultSize, 0);

        item1.Add(item4, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 5);

        CheckBox item5 = new CheckBox(parent, ID_CHECKBOX, "Check", Window.wxDefaultPosition, Window.wxDefaultSize, 0);

        item1.Add(item5, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 5);

        item0.Add(item1, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 5);

        StaticBox      item7 = new StaticBox(parent, -1, "Buttons");
        StaticBoxSizer item6 = new StaticBoxSizer(item7, Orientation.wxVERTICAL);

        Button item8 = new Button(parent, ID_BUTTON, "OK", Window.wxDefaultPosition, Window.wxDefaultSize, 0);

        item6.Add(item8, 0, Alignment.wxALIGN_CENTER_VERTICAL | Direction.wxALL, 5);

        Button item9 = new Button(parent, ID_BUTTON, "OK", Window.wxDefaultPosition, Window.wxDefaultSize, 0);

        item6.Add(item9, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 5);

        Button item10 = new Button(parent, ID_BUTTON, "OK", Window.wxDefaultPosition, Window.wxDefaultSize, 0);

        item6.Add(item10, 0, Stretch.wxGROW | Alignment.wxALIGN_CENTER_VERTICAL | Direction.wxALL, 5);

        item0.Add(item6, 0, Stretch.wxGROW | Alignment.wxALIGN_CENTER_VERTICAL | Direction.wxALL, 5);

        if (set_sizer)
        {
            parent.SetSizer(item0);
            if (call_fit)
            {
                item0.SetSizeHints(parent);
            }
        }

        return(item0);
    }
예제 #14
0
        public static TextCtrl AddTextLine(Dialog dialog, BoxSizer column, string txt)
        {
            throw new NotImplementedException();

            //BoxSizer row = new BoxSizer(Orientation.wxHORIZONTAL);
            //StaticText header = new StaticText(dialog, 0, wxPorting.LV(txt));
            //TextCtrl txtctrl = new TextCtrl(dialog, 0, wxEmptyString, Window.wxDefaultPosition, Window.wxDefaultSize);

            //row.Add(header, 35, SizerFlag.wxALIGN_LEFT | SizerFlag.wxRIGHT | SizerFlag.TOP, 4);
            //row.Add(txtctrl, 65, SizerFlag.wxGROW | SizerFlag.wxALIGN_RIGHT | SizerFlag.TOP, 4);

            //column.Add(row, 1, SizerFlag.wxGROW |  SizerFlag.wxLEFT | SizerFlag.wxRIGHT, 10);

            //return txtctrl;
        }
예제 #15
0
        private static TextCtrl AddTextLine(Dialog dialog, BoxSizer column, String txt)
        {
            BoxSizer   row     = new BoxSizer(Orientation.wxHORIZONTAL);
            StaticText header  = new StaticText(dialog, 0, wxPorting.LV(txt));
            TextCtrl   txtctrl = new TextCtrl(dialog, 0, Globals.wxEmptyString, Window.wxDefaultPosition, Window.wxDefaultSize);

            row.Add(header, 35, SizerFlag.wxALIGN_LEFT | SizerFlag.wxRIGHT | SizerFlag.wxTOP, 4);
            row.Add(txtctrl, 65, SizerFlag.wxGROW | SizerFlag.wxALIGN_RIGHT | SizerFlag.wxTOP, 4);

            column.Add(row, 1, SizerFlag.wxGROW | SizerFlag.wxLEFT | SizerFlag.wxRIGHT, 10);

            lastLabel = header;

            return(txtctrl);
        }
예제 #16
0
    public static Sizer frmSobre(Window parent, bool call_fit, bool set_sizer)
    {
        BoxSizer item0 = new BoxSizer(Orientation.wxVERTICAL);

        StaticBox      item2 = new StaticBox(parent, -1, "");
        StaticBoxSizer item1 = new StaticBoxSizer(item2, Orientation.wxVERTICAL);

        StaticBitmap item3 = new StaticBitmap(parent, ID_STATICBITMAP, ListaBitmaps(6), Window.wxDefaultPosition, Window.wxDefaultSize);

        item1.Add(item3, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 5);

        StaticText item4 = new StaticText(parent, ID_TEXT, "Versão: 1.0.0", Window.wxDefaultPosition, Window.wxDefaultSize, 0);

        item1.Add(item4, 0, Alignment.wxALIGN_RIGHT | Alignment.wxALIGN_CENTER_VERTICAL | Direction.wxALL, 5);

        StaticText item5 = new StaticText(parent, ID_TEXT, "Todos os direitos reservados para: Henrique F. de Souza", Window.wxDefaultPosition, Window.wxDefaultSize, 0);

        item1.Add(item5, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 5);

        StaticText item6 = new StaticText(parent, ID_TEXT, "Sistema integrante do projeto Livrus Virtus,", Window.wxDefaultPosition, Window.wxDefaultSize, 0);

        item1.Add(item6, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 5);

        StaticText item7 = new StaticText(parent, ID_TEXT, "versão programado no wxDesigner.", Window.wxDefaultPosition, Window.wxDefaultSize, 0);

        item1.Add(item7, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 5);

        item0.Add(item1, 0, Stretch.wxGROW | Alignment.wxALIGN_CENTER_VERTICAL | Direction.wxALL, 5);

        Button item8 = new Button(parent, BTN_OK, "OK", Window.wxDefaultPosition, Window.wxDefaultSize, 0);

        item8.Name = "btnOk";
        item0.Add(item8, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 5);

        if (set_sizer)
        {
            // parent.SetAutoLayout( true );
            parent.SetSizer(item0);
            if (call_fit)
            {
                item0.Fit(parent);
                item0.SetSizeHints(parent);
            }
        }

        return(item0);
    }
예제 #17
0
        public BoxSizer AddFileRow(Panel page, Option option, FileRow outParam)
        {
            BoxSizer   row   = new BoxSizer(Orientation.wxHORIZONTAL);
            StaticText label = new StaticText(page, wxID_ANY, Globals.localize(option._descr));

            //row.Add(label);
            row.Add(label, 55, SizerFlag.wxALIGN_LEFT | SizerFlag.wxLEFT | SizerFlag.wxRIGHT | SizerFlag.wxTOP, 4);
            outParam._path       = new TextCtrl(page, wxID_ANY);
            outParam._path.Value = (option._sValue);
            //row.Add(outParam._path);
            row.Add(outParam._path, 75, SizerFlag.wxRIGHT | SizerFlag.wxGROW | SizerFlag.wxTOP, 4);
            outParam._button = new Button(page, wxID_ANY, wxPorting.T("..."));
            //row.Add(outParam._button);
            row.Add(outParam._button, 20, SizerFlag.wxRIGHT | SizerFlag.wxTOP, 4);
            outParam._option = option;
            return(row);
        }
예제 #18
0
        public static TextCtrl AddScriptLine(SignalDialog dialog, BoxSizer column, string txt)
        {
            throw new NotImplementedException();
            //BoxSizer row = new BoxSizer(Orientation.wxHORIZONTAL);
            //StaticText header = new StaticText(dialog, 0, wxPorting.LV(txt));
            //TextCtrl txtctrl = new TextCtrl(dialog, 0, Globals.wxEmptyString, Window.wxDefaultPosition, Window.wxDefaultSize);
            //Size size = txtctrl.Size;

            //row.Add(header, 35, SizerFlag.wxALIGN_LEFT | SizerFlag.wxRIGHT, 4);
            //row.Add(txtctrl, 65, SizerFlag.wxGROW | SizerFlag.wxALIGN_RIGHT | SizerFlag.wxLEFT, 6);
            //dialog.m_fileBrowser = new Button(dialog, MenuIDs.ID_PROPERTIES, wxPorting.T("..."), Window.wxDefaultPosition, new Size(32, size.Height + 2));
            //row.Add(dialog.m_fileBrowser, 0, SizerFlag.wxTOP | SizerFlag.wxALIGN_RIGHT, 4);

            //column.Add(row, 1, SizerFlag.wxGROW | SizerFlag.wxTOP | SizerFlag.wxRIGHT | SizerFlag.wxLEFT, 10);

            //return txtctrl;
        }
예제 #19
0
        public Panel CreatePage2()
        {
            Panel page2 = new Panel(this, wxID_ANY);

            BoxSizer column = new BoxSizer(Orientation.wxVERTICAL);
            BoxSizer row;

            row = AddFileRow(page2, Globals.alert_sound, _alert);
            column.Add(row);
            row = AddFileRow(page2, Globals.entry_sound, _enter);
            column.Add(row);
            row = AddFileRow(page2, Globals.searchPath, _search);
            column.Add(row);

            page2.SetSizer(column);
            return(page2);
        }
    public HelloWorldFrame(Window parent, int id, string title)
        :
        base(parent, id, "Helloworldframe", wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE)
    {
        mainbutton        = new Button(this, (int)Cmd.ID_MAINBUTTON, "Press Me");
        mainbutton.Click += new EventListener(OnButtonClicked);

        text1 = new TextCtrl(this, (int)Cmd.ID_TEXT1, "");
        text2 = new TextCtrl(this, (int)Cmd.ID_TEXT2, "");
        sizer = new BoxSizer(Orientation.wxVERTICAL);
        sizer.Add(mainbutton, 1, Direction.wxALL | Stretch.wxEXPAND, 2);
        sizer.Add(text1, 1, Direction.wxALL | Stretch.wxEXPAND, 2);
        sizer.Add(text2, 1, Direction.wxALL | Stretch.wxEXPAND, 2);
        sizer.Fit(this);
        sizer.SetSizeHints(this);
        SetSizer(sizer);
        Layout();
    }
예제 #21
0
    public static Sizer MyDialogFunc( Window parent, bool call_fit, bool set_sizer )
    {
        BoxSizer item0 = new BoxSizer( Orientation.wxVERTICAL );

        StaticBox item2 = new StaticBox( parent, -1, "Controls will remember their values" );
        StaticBoxSizer item1 = new StaticBoxSizer( item2, Orientation.wxVERTICAL );

        FlexGridSizer item3 = new FlexGridSizer( 0, 2, 0, 0 );
        item3.AddGrowableCol( 0 );
        item3.AddGrowableCol( 1 );

        StaticText item4 = new StaticText( parent, ID_TEXT, "wxSpinCtrl:", Window.wxDefaultPosition, Window.wxDefaultSize, 0 );
        item4.Name = "TestName";
        item3.Add( item4, 0, Alignment.wxALIGN_CENTER|Direction.wxALL, 5 );

        SpinCtrl item5 = new SpinCtrl( parent, ID_MY_NUMBER, "0", Window.wxDefaultPosition, new Size(130,-1), SpinCtrl.wxSP_ARROW_KEYS|SpinCtrl.wxSP_WRAP, 0, 100, 0 );
        item3.Add( item5, 0, Stretch.wxGROW|Alignment.wxALIGN_CENTER_VERTICAL|Direction.wxALL, 5 );

        StaticText item6 = new StaticText( parent, ID_TEXT, "wxTextCtrl:", Window.wxDefaultPosition, Window.wxDefaultSize, 0 );
        item3.Add( item6, 0, Alignment.wxALIGN_RIGHT|Alignment.wxALIGN_CENTER_VERTICAL|Direction.wxALL, 5 );

        TextCtrl item7 = new TextCtrl( parent, ID_MY_TEXT, "", Window.wxDefaultPosition, new Size(130,-1), 0 );
        item3.Add( item7, 0, Stretch.wxGROW|Alignment.wxALIGN_CENTER_VERTICAL|Direction.wxALL, 5 );

        item1.Add( item3, 1, Stretch.wxGROW|Direction.wxALL, 5 );

        item0.Add( item1, 0, Stretch.wxGROW|Alignment.wxALIGN_CENTER_VERTICAL|Direction.wxALL, 5 );

        StaticLine item8 = new StaticLine( parent, ID_LINE, Window.wxDefaultPosition, new Size(300,-1), StaticLine.wxLI_HORIZONTAL );
        item0.Add( item8, 0, Stretch.wxGROW|Alignment.wxALIGN_CENTER_VERTICAL|Direction.wxALL, 5 );

        Button item9 = new Button( parent, Window.wxID_OK, "OK", Window.wxDefaultPosition, Window.wxDefaultSize, 0 );
        item0.Add( item9, 0, Alignment.wxALIGN_CENTER|Direction.wxALL, 5 );

        if (set_sizer)
        {
            parent.SetSizer( item0 );
            if (call_fit)
                item0.SetSizeHints( parent );
        }

        return item0;
    }
예제 #22
0
    public static Sizer NotebookFunc( Window parent, bool call_fit, bool set_sizer )
    {
        BoxSizer item0 = new BoxSizer( Orientation.wxVERTICAL );

        Notebook item2 = new Notebook( parent, ID_NOTEBOOK, Window.wxDefaultPosition, new Size(200,160), 0 );
        NotebookSizer item1 = new NotebookSizer( item2 );

        Panel item3 = new Panel( item2, -1 );
        PageOneFunc( item3, false );
        item2.AddPage( item3, "Page 1" );

        Panel item4 = new Panel( item2, -1 );
        PageTwoFunc( item4, false );
        item2.AddPage( item4, "Page 2" );

        Panel item5 = new Panel( item2, -1 );
        item2.AddPage( item5, "Page 3" );

        item0.Add( item1, 0, Alignment.wxALIGN_CENTER|Direction.wxALL, 5 );

        StaticLine item6 = new StaticLine( parent, ID_LINE, Window.wxDefaultPosition, new Size(20,-1), StaticLine.wxLI_HORIZONTAL );
        item0.Add( item6, 0, Stretch.wxGROW|Alignment.wxALIGN_CENTER_VERTICAL|Direction.wxALL, 5 );

        BoxSizer item7 = new BoxSizer( Orientation.wxHORIZONTAL );

        Button item8 = new Button( parent, Window.wxID_OK, "OK", Window.wxDefaultPosition, Window.wxDefaultSize, 0 );
        item8.SetDefault();
        item7.Add( item8, 0, Alignment.wxALIGN_CENTER|Direction.wxALL, 5 );

        Button item9 = new Button( parent, Window.wxID_CANCEL, "Cancel", Window.wxDefaultPosition, Window.wxDefaultSize, 0 );
        item7.Add( item9, 0, Alignment.wxALIGN_CENTER|Direction.wxALL, 5 );

        item0.Add( item7, 0, Alignment.wxALIGN_CENTER|Direction.wxLEFT|Direction.wxRIGHT|Direction.wxBOTTOM, 5 );

        if (set_sizer)
        {
            parent.SetSizer( item0 );
            if (call_fit)
                item0.SetSizeHints( parent );
        }

        return item0;
    }
예제 #23
0
        Panel CreatePage3()
        {
            Panel page = new Panel(this, wxID_ANY);

            BoxSizer column = new BoxSizer(Orientation.wxVERTICAL);

            TDSkin m_skin = Globals.curSkin;

            AddSkinRow(page, column, wxPorting.L("Background"), m_background, m_skin.background);
            AddSkinRow(page, column, wxPorting.L("Free Track"), m_freeTrack, m_skin.free_track);
            AddSkinRow(page, column, wxPorting.L("Reserved Track"), m_reservedTrack, m_skin.reserved_track);
            AddSkinRow(page, column, wxPorting.L("Reserved for Shunting"), m_reservedShunting, m_skin.reserved_shunting);
            AddSkinRow(page, column, wxPorting.L("Occupied"), m_occupiedTrack, m_skin.occupied_track);
            AddSkinRow(page, column, wxPorting.L("Reserved for Working"), m_workingTrack, m_skin.working_track);
            AddSkinRow(page, column, wxPorting.L("Switch Outline"), m_outline, m_skin.outline);
            AddSkinRow(page, column, wxPorting.L("Text"), m_text, m_skin.text);

            page.SetSizer(column);
            return(page);
        }
예제 #24
0
    public static Sizer frmSplash(Window parent, bool call_fit, bool set_sizer)
    {
        BoxSizer item0 = new BoxSizer(Orientation.wxVERTICAL);

        StaticBitmap item1 = new StaticBitmap(parent, ID_STATICBITMAP, ListaBitmaps(6), Window.wxDefaultPosition, Window.wxDefaultSize);

        item0.Add(item1, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 5);

        if (set_sizer)
        {
            // parent.SetAutoLayout( true );
            parent.SetSizer(item0);
            if (call_fit)
            {
                item0.Fit(parent);
                item0.SetSizeHints(parent);
            }
        }

        return(item0);
    }
예제 #25
0
    public static Sizer PageOneFunc(Window parent, bool call_fit, bool set_sizer)
    {
        BoxSizer item0 = new BoxSizer(Orientation.wxVERTICAL);

        TextCtrl item1 = new TextCtrl(parent, ID_TEXTCTRL, "", Window.wxDefaultPosition, new Size(200, -1), 0);

        item0.Add(item1, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 20);

        TextCtrl item2 = new TextCtrl(parent, ID_TEXTCTRL, "", Window.wxDefaultPosition, new Size(200, 90), TextCtrl.wxTE_MULTILINE);

        item0.Add(item2, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 20);

        if (set_sizer)
        {
            parent.SetSizer(item0);
            if (call_fit)
            {
                item0.SetSizeHints(parent);
            }
        }

        return(item0);
    }
예제 #26
0
    public static Sizer MyDialogFunc(Window parent, bool call_fit, bool set_sizer)
    {
        BoxSizer item0 = new BoxSizer(Orientation.wxVERTICAL);

        StaticBox item2 = new StaticBox(parent, -1, "Copyright");

        item2.Font = new wx.Font(16, wx.FontFamily.wxROMAN, wx.FontStyle.wxNORMAL, wx.FontWeight.wxNORMAL);
        StaticBoxSizer item1 = new StaticBoxSizer(item2, Orientation.wxVERTICAL);

        StaticText item3 = new StaticText(parent, ID_TEXT, "Copyright 2002 T. Coon. 1000,- ¤.", Window.wxDefaultPosition, Window.wxDefaultSize, 0);

        item3.ForegroundColour = Colour.wxBLUE;
        item3.Font             = new wx.Font(16, wx.FontFamily.wxROMAN, wx.FontStyle.wxNORMAL, wx.FontWeight.wxNORMAL);
        item1.Add(item3, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 5);

        item0.Add(item1, 0, Stretch.wxGROW | Alignment.wxALIGN_CENTER_VERTICAL | Direction.wxALL, 5);

        StaticLine item4 = new StaticLine(parent, ID_LINE, Window.wxDefaultPosition, new Size(20, -1), StaticLine.wxLI_HORIZONTAL);

        item0.Add(item4, 0, Stretch.wxGROW | Alignment.wxALIGN_CENTER_VERTICAL | Direction.wxALL, 5);

        Button item5 = new Button(parent, Window.wxID_OK, "OK", Window.wxDefaultPosition, Window.wxDefaultSize, 0);

        item0.Add(item5, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 5);

        if (set_sizer)
        {
            parent.SetSizer(item0);
            if (call_fit)
            {
                item0.SetSizeHints(parent);
            }
        }

        return(item0);
    }
예제 #27
0
        private Panel CreateSendPanel()
        {
            Panel panel = new Panel(this);
            BoxSizer sizer = new BoxSizer(Orientation.Horizontal);

            _textInput = new TextCtrl(panel, "", WxDefaultPosition, WxDefaultSize, WindowStyles.TextCtrlProcessEnter)
            {
                Font = _dataFont
            };
            sizer.Add(_textInput, 1, SizerFlag.Expand | SizerFlag.All, 0);
            _textInput.EvtKeyDown((s, e) =>
            {
                KeyEvent keyEvent = e as KeyEvent;
                if (keyEvent != null && keyEvent.KeyCode == 13)
                {
                    OnSend();
                }
                e.Skip(true);
            });

            _send = new Button(panel, ID_Send, "Send");
            EvtButton(ID_Send, (s, e) => OnSend());
            sizer.Add(_send, 0, SizerFlag.Expand | SizerFlag.All, 0);

            panel.SetSizer(sizer);
            sizer.SetSizeHints(panel);

            return panel;
        }
예제 #28
0
    public static Sizer frmAlterarSenha(Window parent, bool call_fit, bool set_sizer)
    {
        BoxSizer item0 = new BoxSizer(Orientation.wxVERTICAL);

        GridSizer item1 = new GridSizer(0, 2, 0, 0);

        BoxSizer item2 = new BoxSizer(Orientation.wxVERTICAL);

        StaticText item3 = new StaticText(parent, ID_TEXT, "Login:"******"", Window.wxDefaultPosition, new Size(100, -1), 0);

        item4.Name = "edtLogin";
        item2.Add(item4, 0, Alignment.wxALIGN_CENTER_VERTICAL | Direction.wxALL, 0);

        item1.Add(item2, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 5);

        BoxSizer item5 = new BoxSizer(Orientation.wxVERTICAL);

        StaticText item6 = new StaticText(parent, ID_TEXT, "Senha atual:", Window.wxDefaultPosition, Window.wxDefaultSize, 0);

        item5.Add(item6, 0, Alignment.wxALIGN_CENTER_VERTICAL | Direction.wxRIGHT | Direction.wxBOTTOM, 5);

        TextCtrl item7 = new TextCtrl(parent, EDT_SENHAATUAL, "", Window.wxDefaultPosition, new Size(100, -1), 0);

        item7.Name = "edtSenhaAtual";
        item5.Add(item7, 0, Alignment.wxALIGN_CENTER_VERTICAL | Direction.wxALL, 0);

        item1.Add(item5, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 5);

        BoxSizer item8 = new BoxSizer(Orientation.wxVERTICAL);

        StaticText item9 = new StaticText(parent, ID_TEXT, "Nova senha:", Window.wxDefaultPosition, Window.wxDefaultSize, 0);

        item8.Add(item9, 0, Alignment.wxALIGN_CENTER_VERTICAL | Direction.wxRIGHT | Direction.wxBOTTOM, 5);

        TextCtrl item10 = new TextCtrl(parent, EDT_NOVASENHA, "", Window.wxDefaultPosition, new Size(100, -1), 0);

        item10.Name = "edtNovaSenha";
        item8.Add(item10, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 0);

        item1.Add(item8, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 5);

        BoxSizer item11 = new BoxSizer(Orientation.wxVERTICAL);

        StaticText item12 = new StaticText(parent, ID_TEXT, "Confirmar senha:", Window.wxDefaultPosition, Window.wxDefaultSize, 0);

        item11.Add(item12, 0, Alignment.wxALIGN_CENTER_VERTICAL | Direction.wxRIGHT | Direction.wxBOTTOM, 5);

        TextCtrl item13 = new TextCtrl(parent, EDT_CONFIRMSENHA, "", Window.wxDefaultPosition, new Size(100, -1), 0);

        item13.Name = "edtConfirmarSenha";
        item11.Add(item13, 0, Alignment.wxALIGN_CENTER_VERTICAL, 5);

        item1.Add(item11, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 5);

        item0.Add(item1, 0, Alignment.wxALIGN_CENTER_VERTICAL | Direction.wxALL, 5);

        BoxSizer item14 = new BoxSizer(Orientation.wxHORIZONTAL);

        Button item15 = new Button(parent, BTN_SALVAR, "Salvar", Window.wxDefaultPosition, Window.wxDefaultSize, 0);

        item15.Name = "btnSalvar";
        item14.Add(item15, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 5);

        Button item16 = new Button(parent, BTN_LIMPAR, "Limpar", Window.wxDefaultPosition, Window.wxDefaultSize, 0);

        item16.Name = "btnLimpar";
        item14.Add(item16, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 5);

        Button item17 = new Button(parent, BTN_FECHAR, "Fechar", Window.wxDefaultPosition, Window.wxDefaultSize, 0);

        item17.Name = "btnFechar";
        item14.Add(item17, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 5);

        item0.Add(item14, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 5);

        if (set_sizer)
        {
            // parent.SetAutoLayout( true );
            parent.SetSizer(item0);
            if (call_fit)
            {
                item0.Fit(parent);
                item0.SetSizeHints(parent);
            }
        }

        return(item0);
    }
예제 #29
0
        private Panel CreateControlPanel()
        {
            Panel panel = new Panel(this);
            BoxSizer sizer = new BoxSizer(Orientation.Horizontal);

            _port = new ComboBox(panel, "", WxDefaultPosition, WxDefaultSize, new string[0],
                WindowStyles.ComboBoxDropDown | WindowStyles.ComboBoxReadonly);
            UpdatePorts();
            sizer.Add(_port, 0, SizerFlag.Expand | SizerFlag.All, 5);

            Bitmap refreshBitmap = GetType().Assembly.GetManifestResourceWxBitmap("DummyLoadController.Images.refresh.png");
            _refreshPorts = new BitmapButton(panel, ID_RefreshPorts, refreshBitmap);
            EvtButton(ID_RefreshPorts, (s, e) => UpdatePorts());
            sizer.Add(_refreshPorts, 0, SizerFlag.Expand | SizerFlag.All, 0);

            string[] baudRates = new[] { "300", "600", "1200", "2400", "4800", "9600", "14,400", "19,200", "28,800", "38,400", "57,600", "76,800", "115,200", "230,400" };
            _baudRate = new ComboBox(panel, "", WxDefaultPosition, WxDefaultSize, baudRates, WindowStyles.ComboBoxDropDown | WindowStyles.ComboBoxReadonly);
            _baudRate.Select(5);
            sizer.Add(_baudRate, 0, SizerFlag.Expand | SizerFlag.All, 5);

            _connect = new Button(panel, ID_Connect, "Connect");
            EvtButton(ID_Connect, (s, e) => Connect());
            sizer.Add(_connect, 0, SizerFlag.Expand | SizerFlag.All, 5);

            _disconnect = new Button(panel, ID_Disconnect, "Disconnect");
            EvtButton(ID_Disconnect, (s, e) => _comService.Disconnect());
            sizer.Add(_disconnect, 0, SizerFlag.Expand | SizerFlag.All, 5);

            panel.SetSizer(sizer);
            sizer.SetSizeHints(panel);

            return panel;
        }
예제 #30
0
    public static Sizer frmLogin(Window parent, bool call_fit, bool set_sizer)
    {
        BoxSizer item0 = new BoxSizer(Orientation.wxVERTICAL);

        BoxSizer item1 = new BoxSizer(Orientation.wxHORIZONTAL);

        StaticBitmap item2 = new StaticBitmap(parent, ID_STATICBITMAP, ListaBitmaps(5), Window.wxDefaultPosition, Window.wxDefaultSize);

        item1.Add(item2, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 0);

        BoxSizer item3 = new BoxSizer(Orientation.wxVERTICAL);

        BoxSizer item4 = new BoxSizer(Orientation.wxVERTICAL);

        StaticText item5 = new StaticText(parent, LAB_LOGIN, "Login:"******"labLogin";
        item4.Add(item5, 0, Alignment.wxALIGN_CENTER_VERTICAL | Direction.wxRIGHT | Direction.wxBOTTOM, 5);

        TextCtrl item6 = new TextCtrl(parent, EDT_LOGIN, "", Window.wxDefaultPosition, new Size(80, -1), 0);

        item6.Name = "edtLogin";
        item4.Add(item6, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 0);

        item3.Add(item4, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 5);

        BoxSizer item7 = new BoxSizer(Orientation.wxVERTICAL);

        StaticText item8 = new StaticText(parent, LAB_SENHA, "Senha:", Window.wxDefaultPosition, Window.wxDefaultSize, 0);

        item8.Name = "labSenha";
        item7.Add(item8, 0, Alignment.wxALIGN_CENTER_VERTICAL | Direction.wxRIGHT | Direction.wxBOTTOM, 5);

        TextCtrl item9 = new TextCtrl(parent, EDT_SENHA, "", Window.wxDefaultPosition, new Size(80, -1), TextCtrl.wxTE_PASSWORD);

        item9.Name = "edtSenha";
        item7.Add(item9, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 0);

        item3.Add(item7, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 5);

        item1.Add(item3, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 0);

        item0.Add(item1, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 5);

        BoxSizer item10 = new BoxSizer(Orientation.wxHORIZONTAL);

        Button item11 = new Button(parent, BTN_LOGIN, "Login", Window.wxDefaultPosition, Window.wxDefaultSize, 0);

        item11.SetDefault();
        item11.Name = "btnLogin";
        item10.Add(item11, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 5);

        Button item12 = new Button(parent, BTN_CANCELAR, "Cancelar", Window.wxDefaultPosition, Window.wxDefaultSize, 0);

        item12.Name = "btnCancelar";
        item10.Add(item12, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 5);

        item0.Add(item10, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 5);

        if (set_sizer)
        {
            // parent.SetAutoLayout( true );
            parent.SetSizer(item0);
            if (call_fit)
            {
                item0.Fit(parent);
                item0.SetSizeHints(parent);
            }
        }

        return(item0);
    }
예제 #31
0
    public static Sizer frmCadAssuntos(Window parent, bool call_fit, bool set_sizer)
    {
        BoxSizer item0 = new BoxSizer(Orientation.wxVERTICAL);

        FlexGridSizer item1 = new FlexGridSizer(0, 2, 0, 0);

        item1.AddGrowableCol(0);

        FlexGridSizer item2 = new FlexGridSizer(0, 1, 0, 0);

        item2.AddGrowableRow(0);
        item2.AddGrowableRow(1);

        BoxSizer item3 = new BoxSizer(Orientation.wxVERTICAL);

        StaticText item4 = new StaticText(parent, LAB_CODIGO, "Código:", Window.wxDefaultPosition, Window.wxDefaultSize, 0);

        item4.Name = "labCodigo";
        item3.Add(item4, 5, Alignment.wxALIGN_CENTER_VERTICAL, 0);

        TextCtrl item5 = new TextCtrl(parent, EDT_CODIGO, "", Window.wxDefaultPosition, new Size(80, -1), 0);

        item5.Name = "edtCodigo";
        item3.Add(item5, 0, Alignment.wxALIGN_CENTER, 0);

        item2.Add(item3, 0, Alignment.wxALIGN_CENTER_VERTICAL, 0);

        BoxSizer item6 = new BoxSizer(Orientation.wxVERTICAL);

        StaticText item7 = new StaticText(parent, LAB_DESCRICAO, "Assunto:", Window.wxDefaultPosition, Window.wxDefaultSize, 0);

        item7.Name = "labDescricao";
        item6.Add(item7, 5, Alignment.wxALIGN_CENTER_VERTICAL, 0);

        TextCtrl item8 = new TextCtrl(parent, EDT_DESCRICAO, "", Window.wxDefaultPosition, new Size(200, -1), 0);

        item8.Name = "edtDescricao";
        item6.Add(item8, 0, Alignment.wxALIGN_CENTER, 0);

        item2.Add(item6, 0, Alignment.wxALIGN_CENTER, 0);

        item1.Add(item2, 0, Alignment.wxALIGN_CENTER_HORIZONTAL | Direction.wxALL, 5);

        BoxSizer item9 = new BoxSizer(Orientation.wxVERTICAL);

        Button item10 = new Button(parent, BTN_PESQUISAR, "Pesquisar", Window.wxDefaultPosition, Window.wxDefaultSize, 0);

        item10.SetDefault();
        item10.Name = "btnPesquisar";
        item9.Add(item10, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 0);

        Button item11 = new Button(parent, BTN_ANTERIOR, "Anterior", Window.wxDefaultPosition, Window.wxDefaultSize, 0);

        item11.Name    = "btnAnterior";
        item11.Enabled = false;
        item9.Add(item11, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 5);

        Button item12 = new Button(parent, BTN_PROXIMO, "Próximo", Window.wxDefaultPosition, Window.wxDefaultSize, 0);

        item12.Name    = "btnProximo";
        item12.Enabled = false;
        item9.Add(item12, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 0);

        item1.Add(item9, 0, Alignment.wxALIGN_CENTER_HORIZONTAL | Direction.wxALL, 5);

        item0.Add(item1, 0, Stretch.wxGROW | Alignment.wxALIGN_CENTER_VERTICAL, 0);

        BoxSizer item13 = new BoxSizer(Orientation.wxHORIZONTAL);

        Button item14 = new Button(parent, BTN_SALVAR, "Salvar", Window.wxDefaultPosition, Window.wxDefaultSize, 0);

        item14.Name    = "btnSalvar";
        item14.Enabled = false;
        item13.Add(item14, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 5);

        Button item15 = new Button(parent, BTN_EXCLUIR, "Excluir", Window.wxDefaultPosition, Window.wxDefaultSize, 0);

        item15.Name    = "btnExcluir";
        item15.Enabled = false;
        item13.Add(item15, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 5);

        Button item16 = new Button(parent, BTN_LIMPAR, "Limpar", Window.wxDefaultPosition, Window.wxDefaultSize, 0);

        item16.Name = "btnLimpar";
        item13.Add(item16, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 5);

        Button item17 = new Button(parent, BTN_FECHAR, "Fechar", Window.wxDefaultPosition, Window.wxDefaultSize, 0);

        item17.Name = "btnFechar";
        item13.Add(item17, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 5);

        item0.Add(item13, 0, Alignment.wxALIGN_RIGHT | Alignment.wxALIGN_CENTER_VERTICAL | Direction.wxALL, 5);

        if (set_sizer)
        {
            // parent.SetAutoLayout( true );
            parent.SetSizer(item0);
            if (call_fit)
            {
                item0.Fit(parent);
                item0.SetSizeHints(parent);
            }
        }

        return(item0);
    }
예제 #32
0
    public static Sizer frmConAssuntos(Window parent, bool call_fit, bool set_sizer)
    {
        FlexGridSizer item0 = new FlexGridSizer(0, 1, 0, 0);

        item0.AddGrowableRow(1);

        BoxSizer item1 = new BoxSizer(Orientation.wxHORIZONTAL);

        BoxSizer item2 = new BoxSizer(Orientation.wxVERTICAL);

        StaticText item3 = new StaticText(parent, LAB_DESCRICAO, "Assunto:", Window.wxDefaultPosition, new Size(40, -1), 0);

        item3.Name = "labDescricao";
        item2.Add(item3, 5, Alignment.wxALIGN_CENTER_VERTICAL, 5);

        TextCtrl item4 = new TextCtrl(parent, EDT_DESCRICAO, "", Window.wxDefaultPosition, new Size(250, -1), 0);

        item4.Name = "edtDescricao";
        item2.Add(item4, 0, Alignment.wxALIGN_CENTER_VERTICAL | Direction.wxALL, 0);

        item1.Add(item2, 0, Alignment.wxALIGN_CENTER_HORIZONTAL | Direction.wxALL, 5);

        Button item5 = new Button(parent, BTN_PESQUISAR, "Pesquisar", Window.wxDefaultPosition, Window.wxDefaultSize, 0);

        item5.Name = "btnPesquisar";
        item1.Add(item5, 0, Alignment.wxALIGN_BOTTOM | Alignment.wxALIGN_CENTER_HORIZONTAL | Direction.wxALL, 5);

        item0.Add(item1, 0, Alignment.wxALIGN_CENTER_VERTICAL | Direction.wxALL, 5);

        item6.Name = "gridConsulta";
        item0.Add(item6, 0, Stretch.wxGROW, 0);

        FlexGridSizer item7 = new FlexGridSizer(0, 2, 0, 0);

        item7.AddGrowableCol(0);

        BoxSizer item8 = new BoxSizer(Orientation.wxHORIZONTAL);

        StaticText item9 = new StaticText(parent, LAB_REGISTROS, "Registro: 0 de 0", Window.wxDefaultPosition, Window.wxDefaultSize, 0);

        item9.Name = "labRegistros";
        item8.Add(item9, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 5);

        item7.Add(item8, 0, Alignment.wxALIGN_BOTTOM | Direction.wxALL, 5);

        BoxSizer item10 = new BoxSizer(Orientation.wxHORIZONTAL);

        Button item11 = new Button(parent, LAB_LIMPAR, "Limpar", Window.wxDefaultPosition, Window.wxDefaultSize, 0);

        item11.Name = "btnLimpar";
        item10.Add(item11, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 5);

        Button item12 = new Button(parent, BTN_FECHAR, "Fechar", Window.wxDefaultPosition, Window.wxDefaultSize, 0);

        item12.Name = "btnFechar";
        item10.Add(item12, 0, Alignment.wxALIGN_CENTER | Direction.wxALL, 5);

        item7.Add(item10, 0, Stretch.wxGROW | Alignment.wxALIGN_BOTTOM | Direction.wxALL, 5);

        item0.Add(item7, 0, Stretch.wxGROW | Alignment.wxALIGN_CENTER_VERTICAL | Direction.wxALL, 5);

        if (set_sizer)
        {
            // parent.SetAutoLayout( true );
            parent.SetSizer(item0);
            if (call_fit)
            {
                item0.Fit(parent);
                item0.SetSizeHints(parent);
            }
        }

        return(item0);
    }
예제 #33
0
    public static Sizer PageOneFunc( Window parent, bool call_fit, bool set_sizer )
    {
        BoxSizer item0 = new BoxSizer( Orientation.wxVERTICAL );

        TextCtrl item1 = new TextCtrl( parent, ID_TEXTCTRL, "", Window.wxDefaultPosition, new Size(200,-1), 0 );
        item0.Add( item1, 0, Alignment.wxALIGN_CENTER|Direction.wxALL, 20 );

        TextCtrl item2 = new TextCtrl( parent, ID_TEXTCTRL, "", Window.wxDefaultPosition, new Size(200,90), TextCtrl.wxTE_MULTILINE );
        item0.Add( item2, 0, Alignment.wxALIGN_CENTER|Direction.wxALL, 20 );

        if (set_sizer)
        {
            parent.SetSizer( item0 );
            if (call_fit)
                item0.SetSizeHints( parent );
        }

        return item0;
    }
예제 #34
0
    public static Sizer PageTwoFunc( Window parent, bool call_fit, bool set_sizer )
    {
        BoxSizer item0 = new BoxSizer( Orientation.wxVERTICAL );

        StaticBox item2 = new StaticBox( parent, -1, "Checks" );
        StaticBoxSizer item1 = new StaticBoxSizer( item2, Orientation.wxHORIZONTAL );

        CheckBox item3 = new CheckBox( parent, ID_CHECKBOX, "Check", Window.wxDefaultPosition, Window.wxDefaultSize, 0 );
        item1.Add( item3, 0, Alignment.wxALIGN_CENTER|Direction.wxALL, 5 );

        CheckBox item4 = new CheckBox( parent, ID_CHECKBOX, "Check", Window.wxDefaultPosition, Window.wxDefaultSize, 0 );
        item1.Add( item4, 0, Alignment.wxALIGN_CENTER|Direction.wxALL, 5 );

        CheckBox item5 = new CheckBox( parent, ID_CHECKBOX, "Check", Window.wxDefaultPosition, Window.wxDefaultSize, 0 );
        item1.Add( item5, 0, Alignment.wxALIGN_CENTER|Direction.wxALL, 5 );

        item0.Add( item1, 0, Alignment.wxALIGN_CENTER|Direction.wxALL, 5 );

        StaticBox item7 = new StaticBox( parent, -1, "Buttons" );
        StaticBoxSizer item6 = new StaticBoxSizer( item7, Orientation.wxVERTICAL );

        Button item8 = new Button( parent, ID_BUTTON, "OK", Window.wxDefaultPosition, Window.wxDefaultSize, 0 );
        item6.Add( item8, 0, Alignment.wxALIGN_CENTER_VERTICAL|Direction.wxALL, 5 );

        Button item9 = new Button( parent, ID_BUTTON, "OK", Window.wxDefaultPosition, Window.wxDefaultSize, 0 );
        item6.Add( item9, 0, Alignment.wxALIGN_CENTER|Direction.wxALL, 5 );

        Button item10 = new Button( parent, ID_BUTTON, "OK", Window.wxDefaultPosition, Window.wxDefaultSize, 0 );
        item6.Add( item10, 0, Stretch.wxGROW|Alignment.wxALIGN_CENTER_VERTICAL|Direction.wxALL, 5 );

        item0.Add( item6, 0, Stretch.wxGROW|Alignment.wxALIGN_CENTER_VERTICAL|Direction.wxALL, 5 );

        if (set_sizer)
        {
            parent.SetSizer( item0 );
            if (call_fit)
                item0.SetSizeHints( parent );
        }

        return item0;
    }