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 » U++ Widgets - General questions or Mixed problems » DocEdit without end line
DocEdit without end line [message #15695] Sun, 04 May 2008 21:11 Go to next message
lucpolak is currently offline  lucpolak
Messages: 18
Registered: April 2008
Location: France
Promising Member
Hello, i want to implement the DocEdit in an array. The problem is that basically, the DocEdit ctrl have a line at the end of the text like show here :
http://www.virtualsofts.com/img/DocEditko.PNG

I want to present the DocEdit like this :

http://www.virtualsofts.com/img/DocEditok.PNG

Why can i do this ?

I've tried to pass NullFrame() to set frame but it's not sufficent.

Thanks for answers,

Lucas
Re: DocEdit without end line [message #15697 is a reply to message #15695] Sun, 04 May 2008 21:48 Go to previous messageGo to next message
bytefield is currently offline  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 #15699 is a reply to message #15697] Sun, 04 May 2008 22:59 Go to previous messageGo to next message
lucpolak is currently offline  lucpolak
Messages: 18
Registered: April 2008
Location: France
Promising Member
ok thanks it's works fine.

I think that it can be a interessant option.

Lucas
Re: DocEdit without end line [message #15700 is a reply to message #15699] Sun, 04 May 2008 23:06 Go to previous messageGo to next message
lucpolak is currently offline  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
http://www.virtualsofts.com/img/afterloading.PNG

on run-time : (the designation cell contains test\n test2...)
GetLineCount returns 2 and CYSTEP is 15

http://www.virtualsofts.com/img/runtime.PNG

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 Go to previous message
mirek is currently offline  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 Smile

Anyway, I believe this really should work. Do you think you can send me some testcase to get me started? Smile

Mirek


Previous Topic: Margin / Spacing of buttons
Next Topic: A main modeless window
Goto Forum:
  


Current Time: Fri Nov 01 00:57:32 CET 2024

Total time taken to generate the page: 0.01884 seconds