Home » U++ Library support » RichText,QTF,RTF... » How to add some text to RichTextview?
How to add some text to RichTextview? [message #1422] |
Fri, 03 March 2006 14:57  |
Cpu86
Messages: 3 Registered: March 2006
|
Junior Member |
|
|
Hi,
I have a richtextview and I want to add some text at the end of the text is already present.
I do this:
String s = elenco.GetData();
char *str_elenco = (char *)malloc(sizeof(char) * (strlen(~s)+8));
strcpy(str_elenco,~s);
strcat(str_elenco,"[+10 A]");
elenco.SetData(str_elenco);
But doesn't work.
Anyone can help me?
Thanks
Marco
[Topic name edited by fudadmin and moved from "library wishlist"]
[Updated on: Fri, 03 March 2006 21:34] by Moderator Report message to a moderator
|
|
|
Re: RichTextview [message #1423 is a reply to message #1422] |
Fri, 03 March 2006 15:54   |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
Cpu86 wrote on Fri, 03 March 2006 08:57 | Hi,
I have a richtextview and I want to add some text at the end of the text is already present.
I do this:
String s = elenco.GetData();
char *str_elenco = (char *)malloc(sizeof(char) * (strlen(~s)+8));
strcpy(str_elenco,~s);
strcat(str_elenco,"[+10 A]");
elenco.SetData(str_elenco);
But doesn't work.
Anyone can help me?
Thanks
Marco
|
My guess is that you have got into "Zoom troubles" (and perhaps used RichTextCtrl instead of RichTextView).
This seems to work:
#include <CtrlLib/CtrlLib.h>
#define LAYOUTFILE <RichView/RichView.lay>
#include <CtrlCore/lay.h>
class RichView : public WithRichViewLayout<TopWindow> {
public:
void Add();
typedef RichView CLASSNAME;
RichView();
};
void RichView::Add()
{
text <<= String(~text) + "test&";
}
RichView::RichView()
{
CtrlLayout(*this, "Window title");
add <<= THISBACK(Add);
text.SetZoom(Zoom(140, 1000));
Sizeable();
}
GUI_APP_MAIN
{
RichView().Run();
}
LAYOUT(RichViewLayout, 200, 392)
ITEM(RichTextView, text, HSizePosZ(4, 4).VSizePosZ(4, 40))
ITEM(Button, add, SetLabel(t_("Add")).LeftPosZ(4, 42).TopPosZ(356, 32))
END_LAYOUT
Mirek
|
|
|
|
Goto Forum:
Current Time: Fri Apr 25 11:54:00 CEST 2025
Total time taken to generate the page: 0.00601 seconds
|