Home » U++ Library support » U++ Widgets - General questions or Mixed problems » DocEdit without end line
|
Re: DocEdit without end line [message #15697 is a reply to message #15695] |
Sun, 04 May 2008 21:48 |
bytefield
Messages: 210 Registered: December 2007
|
Experienced Member |
|
|
There isn't such an option, but simply comment out line 155 from DocEdit.cpp from CtrlLib package.
Or you can edit DocEdit and add such and option, and in Paint function to check if line under the last line is enabled.
e.g.
//TextEdit.h
class DocEdit : public TextCtrl {
...
bool haveunderline;
DocEdit& HaveUnderline(bool underline = true)
{
haveunderline = underline;
return *this;
}
// DocEdit.cpp
void DocEdit::Paint(Draw& w) {
...
// line 155
if (haveunderline)
w.DrawRect(1, y++, cx, 1, SColorShadow);
Edit:(u++ core dev's) Shouldn't be there such an option?
Andrei
cdabbd745f1234c2751ee1f932d1dd75
[Updated on: Sun, 04 May 2008 21:51] Report message to a moderator
|
|
|
|
Re: DocEdit without end line [message #15700 is a reply to message #15699] |
Sun, 04 May 2008 23:06 |
lucpolak
Messages: 18 Registered: April 2008 Location: France
|
Promising Member |
|
|
I have another problem with DocEdit/ArrayCtrl mix.
I uses a DocEdit Ctrl in cells of ArrayCtrl. I want to resize the cell containing the data of DocEdit when entering text.
For example, when adding new lines with enter key.
To do this, i use the Callback for WhenAction on this control.
de <<= THISBACK(ResizeListe);
When data changes, the callback is correctly called. the callback function is :
void FicheDossier::ResizeListe()
{
for (int i=0;i<ListeDesc.GetCount();i++)
{
DocEdit &de = ListeDesc[i];
String val = de.GetData();
int numLignes = de.GetLineCount();
de.SetRectY(0,numLignes*CYSTEP+1);
de.RefreshLayout();
m_ListeElements.SetLineCy(i,numLignes*CYSTEP+1);
}
m_ListeElements.RefreshLayout();
}
The GetLineCount works fine, I prompted the value of numLignes after calling GetLineCount and its ok. The problem seems to be with the function SetLineCy. After this method is called, there are no changes... Can you known why ?
Last think, i call this function on loading data and the cells are correctly resized with data loaded.
ex : after loading : the cells is correctly resized
on run-time : (the designation cell contains test\n test2...)
GetLineCount returns 2 and CYSTEP is 15
Lucas
[Updated on: Sun, 04 May 2008 23:11] Report message to a moderator
|
|
|
Re: DocEdit without end line [message #16129 is a reply to message #15700] |
Wed, 28 May 2008 20:47 |
|
mirek
Messages: 14105 Registered: November 2005
|
Ultimate Member |
|
|
lucpolak wrote on Sun, 04 May 2008 17:06 | I have another problem with DocEdit/ArrayCtrl mix.
I uses a DocEdit Ctrl in cells of ArrayCtrl. I want to resize the cell containing the data of DocEdit when entering text.
For example, when adding new lines with enter key.
To do this, i use the Callback for WhenAction on this control.
de <<= THISBACK(ResizeListe);
When data changes, the callback is correctly called. the callback function is :
void FicheDossier::ResizeListe()
{
for (int i=0;i<ListeDesc.GetCount();i++)
{
DocEdit &de = ListeDesc[i];
String val = de.GetData();
int numLignes = de.GetLineCount();
de.SetRectY(0,numLignes*CYSTEP+1);
de.RefreshLayout();
m_ListeElements.SetLineCy(i,numLignes*CYSTEP+1);
}
m_ListeElements.RefreshLayout();
}
The GetLineCount works fine, I prompted the value of numLignes after calling GetLineCount and its ok. The problem seems to be with the function SetLineCy. After this method is called, there are no changes... Can you known why ?
|
Yes, perhaps nobody tried something as hard with ArrayCtrl yet
Anyway, I believe this really should work. Do you think you can send me some testcase to get me started?
Mirek
|
|
|
Goto Forum:
Current Time: Fri Nov 01 00:57:32 CET 2024
Total time taken to generate the page: 0.01884 seconds
|