Create a texte editor Topic is solved
Create a texte editor
So I am triing to write some kind of text editor with WxWdgets. I am puting a wxTextCtrl with multiline style into the boxsizer of the frame, there is no other components, but when I am resizing the frame the textCtrl is not really resizing.
Re: Create a texte editor
Please show the sizer related code.
Also: Depending on the capabilities you need, you should look into wxRichTextCtrl and wxStyledTextCtrl. The latter one is harder to use, because the official documentation is practically useless and you'll have to collect the necessary information from various other sources, e.g. some posts in this forum.
Also: Depending on the capabilities you need, you should look into wxRichTextCtrl and wxStyledTextCtrl. The latter one is harder to use, because the official documentation is practically useless and you'll have to collect the necessary information from various other sources, e.g. some posts in this forum.
Use the source, Luke!
Re: Create a texte editor
wxRichTextCtrl is not worcking for me, as I am geting compiler error when using it. Just forgot to mention, that I am using wxSmith and CodeBlocks for my wxWidget projects.doublemax wrote:Please show the sizer related code.
Also: Depending on the capabilities you need, you should look into wxRichTextCtrl and wxStyledTextCtrl. The latter one is harder to use, because the official documentation is practically useless and you'll have to collect the necessary information from various other sources, e.g. some posts in this forum.
Re: Create a texte editor
Hi,
As doublemax' asked - can you post your code?
Also - it would be interesting to know what errors did you get for wxRichTextCtrl.
Thank you.
As doublemax' asked - can you post your code?
Also - it would be interesting to know what errors did you get for wxRichTextCtrl.
Thank you.
- eranon
- Can't get richer than this
- Posts: 867
- Joined: Sun May 13, 2012 11:42 pm
- Location: France
- Contact:
Re: Create a texte editor
I'm using CodeBlocks too and one of my apps using the wxRichTextCtrl control intensively has its user interface built from wxSmith. So, what's your difficulty with wxSmith, CodeBlocks and your underlying compiler against wxRichTextCtrl?gtafan wrote:wxRichTextCtrl is not worcking for me, as I am geting compiler error when using it. Just forgot to mention, that I am using wxSmith and CodeBlocks for my wxWidget projects.doublemax wrote:Depending on the capabilities you need, you should look into wxRichTextCtrl and wxStyledTextCtrl.
And as doublemax and ONEEYEMAN requested: your code, man
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]
-
- Filthy Rich wx Solver
- Posts: 235
- Joined: Fri Sep 14, 2012 8:26 am
- Location: Kontich, Belgium
- Contact:
Re: Create a texte editor
Hi gtafan,
Based on not seeing any code
As for your first question, you need to set for the textcontrol the expand flag to horizontal alignment - providing the control is placed into a wxBoxSizerV. and also set the stretch factor=1. Only then your text control will fill up the entire space of the vertical box sizer and with resizing be capable in keeping up with the new size.
regards,
Nunki
Based on not seeing any code
As for your first question, you need to set for the textcontrol the expand flag to horizontal alignment - providing the control is placed into a wxBoxSizerV. and also set the stretch factor=1. Only then your text control will fill up the entire space of the vertical box sizer and with resizing be capable in keeping up with the new size.
regards,
Nunki
Re: Create a texte editor
Thanks, even I was able to find out myself the thing about expand flag, it´s really the solution. So my curent code looks like this:Nunki wrote:Hi gtafan,
Based on not seeing any code
As for your first question, you need to set for the textcontrol the expand flag to horizontal alignment - providing the control is placed into a wxBoxSizerV. and also set the stretch factor=1. Only then your text control will fill up the entire space of the vertical box sizer and with resizing be capable in keeping up with the new size.
regards,
Nunki
Code: Select all
Create(parent, id, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE, _T("id"));
BoxSizer1 = new wxBoxSizer(wxHORIZONTAL);
TextCtrl1 = new wxTextCtrl(this, ID_TEXTCTRL1, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE, wxDefaultValidator, _T("ID_TEXTCTRL1"));
BoxSizer1->Add(TextCtrl1, 1, wxEXPAND, 0);
SetSizer(BoxSizer1);