Focus Problem

1 message Options
Embed this post
Permalink
Renan Moura Ferreira

Focus Problem

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)
  I'm integrating a text editor to audacity's interface
  and it's working properly, but I'm having a problema with the focus
  in my wxRichTextCtrl component.
 
  When I type something in the wxRichTextCtrl, it affects the toolbars
  of audacity.

  Could anyone tell me how to solve it, I mean, how  I keep the focus
  in the text editor and kill it in the rest of the application.

  I'm sending the modifications I did in Project.cpp to integrate the text editor.


 --------------
 Renan Moura



Navegue com segurança com o Novo Internet Explorer 8. Baixe agora, é gratis!
wxPanel *panel = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );

                wxBoxSizer *downSizer = new wxBoxSizer( wxVERTICAL );

                wxToolBar* toolBar = new wxToolBar(panel, wxID_ANY,wxDefaultPosition,wxDefaultSize,wxTB_HORIZONTAL | wxNO_BORDER, "any");
                toolBar->AddTool(wxID_OPENE, wxBitmap(open_xpm), wxNullBitmap, false, -1, -1, (wxObject *) NULL, _("Open"));
                toolBar->AddTool(wxID_SAVEE, wxBitmap(save_xpm), wxNullBitmap, false, -1, -1, (wxObject *) NULL, _("Save"));
                toolBar->AddSeparator();
                toolBar->AddTool(wxID_CUT, wxBitmap(cut_xpm), wxNullBitmap, false, -1, -1, (wxObject *) NULL, _("Cut"));
                toolBar->AddTool(wxID_COPY, wxBitmap(copy_xpm), wxNullBitmap, false, -1, -1, (wxObject *) NULL, _("Copy"));
                toolBar->AddTool(wxID_PASTE, wxBitmap(paste_xpm), wxNullBitmap, false, -1, -1, (wxObject *) NULL, _("Paste"));
                toolBar->AddSeparator();
                toolBar->AddTool(wxID_UNDO, wxBitmap(undo_xpm), wxNullBitmap, false, -1, -1, (wxObject *) NULL, _("Undo"));
                toolBar->AddTool(wxID_REDO, wxBitmap(redo_xpm), wxNullBitmap, false, -1, -1, (wxObject *) NULL, _("Redo"));
                toolBar->AddSeparator();
                toolBar->AddTool(ID_FORMAT_BOLD, wxBitmap(bold_xpm), wxNullBitmap, true, -1, -1, (wxObject *) NULL, _("Bold"));
                toolBar->AddTool(ID_FORMAT_ITALIC, wxBitmap(italic_xpm), wxNullBitmap, true, -1, -1, (wxObject *) NULL, _("Italic"));
                toolBar->AddTool(ID_FORMAT_UNDERLINE, wxBitmap(underline_xpm), wxNullBitmap, true, -1, -1, (wxObject *) NULL, _("Underline"));
                toolBar->AddSeparator();
                toolBar->AddTool(ID_FORMAT_ALIGN_LEFT, wxBitmap(alignleft_xpm), wxNullBitmap, true, -1, -1, (wxObject *) NULL, _("Align Left"));
                toolBar->AddTool(ID_FORMAT_ALIGN_CENTRE, wxBitmap(centre_xpm), wxNullBitmap, true, -1, -1, (wxObject *) NULL, _("Centre"));
                toolBar->AddTool(ID_FORMAT_ALIGN_RIGHT, wxBitmap(alignright_xpm), wxNullBitmap, true, -1, -1, (wxObject *) NULL, _("Align Right"));
                toolBar->AddSeparator();
                toolBar->AddTool(ID_FORMAT_INDENT_LESS, wxBitmap(indentless_xpm), wxNullBitmap, false, -1, -1, (wxObject *) NULL, _("Indent Less"));
                toolBar->AddTool(ID_FORMAT_INDENT_MORE, wxBitmap(indentmore_xpm), wxNullBitmap, false, -1, -1, (wxObject *) NULL, _("Indent More"));
                toolBar->AddSeparator();
                toolBar->AddTool(ID_FORMAT_FONT, wxBitmap(font_xpm), wxNullBitmap, false, -1, -1, (wxObject *) NULL, _("Font"));
                toolBar->AddSeparator();
                toolBar->AddTool(ID_RELOAD, wxBitmap(delete_xpm), wxNullBitmap, false, -1, -1, (wxObject *) NULL, _("Fechar Documento"));
                toolBar->Realize();
               
                downSizer->Add(toolBar, 0, wxEXPAND, 5);

                wxSplitterWindow* splitterin = new wxSplitterWindow( panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D );
                wxPanel *panelin = new wxPanel( splitterin, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
                wxBoxSizer *innerSizer = new wxBoxSizer( wxVERTICAL );
                m_richTextCtrl = new wxRichTextCtrl(panelin, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(200, 200), wxVSCROLL|wxHSCROLL|wxNO_BORDER|wxWANTS_CHARS);
                wxFont font(12, wxROMAN, wxNORMAL, wxNORMAL);
                m_richTextCtrl->SetFont(font);

                innerSizer->Add(m_richTextCtrl, 1, wxEXPAND, 5);
           
                panelin->SetSizer(innerSizer);
                panelin->Layout();
                innerSizer->Fit(panelin);
  splitterin->Initialize(panelin);
                downSizer->Add(splitterin, 1, wxEXPAND, 5);

                panel->SetSizer(downSizer);
                panel->Layout();
                downSizer->Fit(panel);


                bs->Add(panel/*splitter*/, 1, wxEXPAND, 5);
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel