Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » RichText,QTF,RTF... » RichTextView::GetData() Method
RichTextView::GetData() Method [message #57511] Tue, 14 September 2021 20:46 Go to next message
mubeta is currently offline  mubeta
Messages: 77
Registered: October 2006
Member
If the qtf code in the viewer don't contain any text, the GetData method return an empty string, losing all the others qtf data: paragraph format and what else. I think that is not the best, and for my developing app, I had remove this feature.

Value RichTextView::GetData() const
{
	//if(text.IsEmpty()) return Value();
	return GetQTF();
}
Re: RichTextView::GetData() Method [message #57513 is a reply to message #57511] Thu, 16 September 2021 00:35 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
mubeta wrote on Tue, 14 September 2021 20:46
If the qtf code in the viewer don't contain any text, the GetData method return an empty string, losing all the others qtf data: paragraph format and what else. I think that is not the best, and for my developing app, I had remove this feature.

Value RichTextView::GetData() const
{
	//if(text.IsEmpty()) return Value();
	return GetQTF();
}


Tough one. Current behaviour is designed so that IsNull returns true when RichTextView is empty.

I guess you should be able to call GetQTF if needed?

Mirek
Re: RichTextView::GetData() Method [message #57533 is a reply to message #57513] Fri, 17 September 2021 15:14 Go to previous message
mubeta is currently offline  mubeta
Messages: 77
Registered: October 2006
Member
Hi Mirek,

SetData() and GetData() methods are the best, due of the fact that they are present in each controls and so the interface from GUI to the app source code is very simple.

All my app is based on a lot of graphical forms of data stored in a databases, and for show and store the data I am using a code similar to this one:
  Ctrl *ctrl = GetFirstChild();
  while(ctrl)
  {
    if(fields.Find(ToUpper(ctrl->GetLayoutId())) >= 0 )
      update.Column(SqlId(ToUpper(ctrl->GetLayoutId())), ctrl->GetData());
    
    ctrl = ctrl->GetNext();
  }


    ctrl = GetFirstChild();
    while(ctrl)
    {
      if (!sql1[SqlId(ctrl->GetLayoutId())].IsNull())
        ctrl->SetData(sql1[SqlId(ctrl->GetLayoutId())]);
      
      ctrl = ctrl->GetNext();
    }


As you can see, using SetData() and GetData() the amount of source code is very small, and GUI controls only need to be named the same as the field in the DB. What you are asking will require a very big amount of different source code, more trubles, etc.

Previous Topic: Change proposal: line break in RichType / fieldparts
Next Topic: Remove empty paragraphs
Goto Forum:
  


Current Time: Fri Apr 19 12:26:58 CEST 2024

Total time taken to generate the page: 0.05550 seconds