Ejemplo n.º 1
0
        public frmPrincipal()
            : base(null, -1, Resource.STR_TITULO, new Point(-1, -1),
                   new Size(640, 480), wx.MDIParentFrame.wxDEFAULT_MDI_FRAME_STYLE)
        {
            Icon = new wx.Icon("xpms/livrus.xpm");

            //Barra de Menu
            mnuCadastros = new wx.Menu();
            mnuCadastros.Append((int)Resource.MNU_CAD_ASSUNTOS, "&Assuntos", Resource.STR_CADASSUNTO);
            mnuCadastros.Append((int)Resource.MNU_CAD_AUTORES, "A&utores", Resource.STR_CADAUTOR);
            mnuCadastros.Append((int)Resource.MNU_CAD_EDITORAS, "&Editoras", Resource.STR_CADEDITORA);
            mnuCadastros.Append((int)Resource.MNU_CAD_ENDERECOS, "E&ndereços", Resource.STR_CADENDERECO);
            mnuCadastros.Append((int)Resource.MNU_CAD_IDIOMAS, "&Idiomas", Resource.STR_CADIDIOMA);
            mnuCadastros.Append((int)Resource.MNU_CAD_PAISES, "&Países", Resource.STR_CADPAIS);
            mnuCadastros.Append((int)Resource.MNU_CAD_PROFISSOES, "P&rofissões", Resource.STR_CADPROFISS);
            mnuCadastros.AppendSeparator();
            mnuCadastros.Append((int)Resource.MNU_CAD_CLIENTES, "&Clientes", Resource.STR_CADCLIENTE);
            mnuCadastros.Append((int)Resource.MNU_CAD_LIVROS, "&Livros", Resource.STR_CADLIVRO);

            mnuPesquisas = new wx.Menu();
            mnuPesquisas.Append((int)Resource.MNU_CON_ASSUNTOS, "&Assuntos", Resource.STR_CONASSUNTO);
            mnuPesquisas.Append((int)Resource.MNU_CON_AUTORES, "A&utores", Resource.STR_CONAUTOR);
            mnuPesquisas.Append((int)Resource.MNU_CON_EDITORAS, "&Editoras", Resource.STR_CONEDITORA);
            mnuPesquisas.Append((int)Resource.MNU_CON_ENDERECOS, "E&ndereços", Resource.STR_CONENDERECO);
            mnuPesquisas.Append((int)Resource.MNU_CON_IDIOMAS, "&Idiomas", Resource.STR_CONIDIOMA);
            mnuPesquisas.Append((int)Resource.MNU_CON_PAISES, "&Países", Resource.STR_CONPAIS);
            mnuPesquisas.Append((int)Resource.MNU_CON_PROFISSOES, "P&rofissões", Resource.STR_CONPROFISS);
            mnuPesquisas.AppendSeparator();
            mnuPesquisas.Append((int)Resource.MNU_CON_CLIENTES, "&Clientes", Resource.STR_CONCLIENTE);
            mnuPesquisas.Append((int)Resource.MNU_CON_LIVROS, "&Livros", Resource.STR_CONLIVRO);

            mnuVendas = new wx.Menu();
            mnuVendas.Append((int)Resource.MNU_VEN_VENDERLIVROS, "&Vender Livros", Resource.STR_VENLIVRO);
            mnuVendas.Append((int)Resource.MNU_VEN_VENDASREALIZADAS, "Vendas &Realizadas", Resource.STR_CONVENLIVRO);

            mnuOpcoes = new wx.Menu();
            mnuOpcoes.Append((int)Resource.MNU_OP_ALTERARSENHA, "&Alterar Senha", Resource.STR_ALTSENHA);
            mnuOpcoes.AppendSeparator();
            mnuOpcoes.Append((int)Resource.MNU_OP_SOBRE, "&Sobre", Resource.STR_OPSOBRE);
            mnuOpcoes.Append((int)Resource.MNU_OP_SAIR, "Sa&ir\tCtrl-S", Resource.STR_OPSAIR);

            barraMenu = new wx.MenuBar();
            barraMenu.Append(mnuCadastros, "&Cadastros");
            barraMenu.Append(mnuPesquisas, "&Pesquisas");
            barraMenu.Append(mnuVendas, "&Vendas");
            barraMenu.Append(mnuOpcoes, "&Opções");

            MenuBar = barraMenu;

            //Barra de ferramentas
            barraFerra = new wx.ToolBar(this, -1, wxDefaultPosition, wxDefaultSize,
                                        wx.ToolBar.wxTB_HORIZONTAL | wx.ToolBar.wxNO_BORDER);
            ToolBar = barraFerra;
            barraFerra.AddTool((int)Resource.MNU_CAD_CLIENTES, "",
                               new wx.Bitmap("xpms/cliente.xpm", wx.BitmapType.wxBITMAP_TYPE_XPM),
                               "", wx.ItemKind.wxITEM_NORMAL);
            barraFerra.AddTool((int)Resource.MNU_CAD_LIVROS, "",
                               new wx.Bitmap("xpms/livro.xpm", wx.BitmapType.wxBITMAP_TYPE_XPM),
                               "", wx.ItemKind.wxITEM_NORMAL);
            barraFerra.AddTool((int)Resource.MNU_VEN_VENDERLIVROS, "",
                               new wx.Bitmap("xpms/livros.xpm", wx.BitmapType.wxBITMAP_TYPE_XPM),
                               "", wx.ItemKind.wxITEM_NORMAL);
            barraFerra.AddSeparator();
            barraFerra.AddTool((int)Resource.MNU_OP_SOBRE, "",
                               new wx.Bitmap("xpms/sobre.xpm", wx.BitmapType.wxBITMAP_TYPE_XPM),
                               "", wx.ItemKind.wxITEM_NORMAL);
            barraFerra.AddTool((int)Resource.MNU_OP_SAIR, "",
                               new wx.Bitmap("xpms/sair.xpm", wx.BitmapType.wxBITMAP_TYPE_XPM),
                               "", wx.ItemKind.wxITEM_NORMAL);
            barraFerra.Realize();

            barraStatus              = CreateStatusBar(2);
            StatusBarPane            = 1;
            nLarguras                = new int[2];
            nLarguras[0]             = 100;
            nLarguras[1]             = -1;
            barraStatus.StatusWidths = nLarguras;
            barraStatus.SetStatusText(Resource.STR_USUARIO, 0);

            FazLayout();

            EVT_MENU((int)Resource.MNU_CAD_ASSUNTOS, new EventListener(OnMnuCadAssuntos));
            EVT_MENU((int)Resource.MNU_CAD_AUTORES, new EventListener(OnMnuCadAutores));
            EVT_MENU((int)Resource.MNU_CAD_EDITORAS, new EventListener(OnMnuCadEditoras));
            EVT_MENU((int)Resource.MNU_CAD_ENDERECOS, new EventListener(OnMnuCadEnderecos));
            EVT_MENU((int)Resource.MNU_CAD_IDIOMAS, new EventListener(OnMnuCadIdiomas));
            EVT_MENU((int)Resource.MNU_CAD_PAISES, new EventListener(OnMnuCadPaises));
            EVT_MENU((int)Resource.MNU_CAD_PROFISSOES, new EventListener(OnMnuCadProfissoes));
            EVT_MENU((int)Resource.MNU_CAD_CLIENTES, new EventListener(OnMnuCadClientes));
            EVT_MENU((int)Resource.MNU_CAD_LIVROS, new EventListener(OnMnuCadLivros));

            EVT_MENU((int)Resource.MNU_CON_ASSUNTOS, new EventListener(OnMnuConAssuntos));
            EVT_MENU((int)Resource.MNU_CON_AUTORES, new EventListener(OnMnuConAutores));
            EVT_MENU((int)Resource.MNU_CON_EDITORAS, new EventListener(OnMnuConEditoras));
            EVT_MENU((int)Resource.MNU_CON_ENDERECOS, new EventListener(OnMnuConEnderecos));
            EVT_MENU((int)Resource.MNU_CON_IDIOMAS, new EventListener(OnMnuConIdiomas));
            EVT_MENU((int)Resource.MNU_CON_PAISES, new EventListener(OnMnuConPaises));
            EVT_MENU((int)Resource.MNU_CON_PROFISSOES, new EventListener(OnMnuConProfissoes));
            EVT_MENU((int)Resource.MNU_CON_CLIENTES, new EventListener(OnMnuConClientes));
            EVT_MENU((int)Resource.MNU_CON_LIVROS, new EventListener(OnMnuConLivros));

            EVT_MENU((int)Resource.MNU_VEN_VENDERLIVROS, new EventListener(OnMnuVenderLivros));
            EVT_MENU((int)Resource.MNU_VEN_VENDASREALIZADAS, new EventListener(OnMnuVendasRealizadas));

            EVT_MENU((int)Resource.MNU_OP_ALTERARSENHA, new EventListener(OnMnuAlterarSenha));
            EVT_MENU((int)Resource.MNU_OP_SOBRE, new EventListener(OnMnuSobre));
            EVT_MENU((int)Resource.MNU_OP_SAIR, new EventListener(OnClose));

            EVT_CLOSE(new EventListener(OnClose));
        }
Ejemplo n.º 2
0
        public frmFilha(MDIParentFrame parent, int nTelaAtiva)
            : base(parent, -1, "Cadastro de ", new Point(0, 0),
                   new Size(342, 219), wxDEFAULT_FRAME_STYLE, "")
        {
            ClientSize = new Size(330, 136);
            Icon       = new wx.Icon("xpms/livrus.xpm");
            EVT_CLOSE(new EventListener(OnClose));
            nLocalTelaAtiva = nTelaAtiva;

            if (nTelaAtiva == Resource.FRMCADASSUNTOS)
            {
                fCadAssuntos = new frmCadAssuntos(this);
                Title        = Resource.STR_CADASSUNTO;
            }
            else if (nTelaAtiva == Resource.FRMCADAUTORES)
            {
                fCadAutores = new frmCadAutores(this);
                Title       = Resource.STR_CADAUTOR;
            }
            else if (nTelaAtiva == Resource.FRMCADEDITORAS)
            {
                fCadEditoras = new frmCadEditoras(this);
                Title        = Resource.STR_CADEDITORA;
            }
            else if (nTelaAtiva == Resource.FRMCADENDERECOS)
            {
                fCadEnderecos = new frmCadEnderecos(this);
                Title         = Resource.STR_CADENDERECO;
                ClientSize    = new Size(525, 170);
            }
            else if (nTelaAtiva == Resource.FRMCADIDIOMAS)
            {
                fCadIdiomas = new frmCadIdiomas(this);
                Title       = Resource.STR_CADIDIOMA;
            }
            else if (nTelaAtiva == Resource.FRMCADPAISES)
            {
                fCadPaises = new frmCadPaises(this);
                Title      = Resource.STR_CADPAIS;
            }
            else if (nTelaAtiva == Resource.FRMCADPROFISSOES)
            {
                fCadProfissoes = new frmCadProfissoes(this);
                Title          = Resource.STR_CADPROFISS;
            }
            else if (nTelaAtiva == Resource.FRMCADCLIENTES)
            {
                fCadClientes = new frmCadClientes(this);
                Title        = Resource.STR_CADCLIENTE;
                ClientSize   = new Size(525, 440);
            }
            else if (nTelaAtiva == Resource.FRMCADLIVROS)
            {
                fCadLivros = new frmCadLivros(this);
                Title      = Resource.STR_CADLIVRO;
                ClientSize = new Size(510, 385);
            }
            else if (nTelaAtiva == Resource.FRMVENDERLIVROS)
            {
                fVenderLivros = new frmVenderLivros(this);
                Title         = Resource.STR_VENLIVRO;
                ClientSize    = new Size(480, 310);
            }
            else if (nTelaAtiva == Resource.FRMCONVENDAS)
            {
                fConVendas = new frmConVendas(this);
                Title      = Resource.STR_CONVENLIVRO;
                ClientSize = new Size(480, 330);
            }
            else if (nTelaAtiva == Resource.FRMALTERARSENHA)
            {
                fAlterarSenha = new frmAlterarSenha(this);
                Title         = Resource.STR_ALTSENHA;
                ClientSize    = new Size(255, 134);
            }
        }