Here is a simple fix for that problem:
change the start of DrawString in RichText.cpp to this:
[code]
//--------------------------------------------------------------------------
---
// Purpose: Draws a string of characters in the panel
// Input: iFirst - Index of the first character to draw
// iLast - Index of the last character to draw
// renderState - Render state to use
// font- font to use
// Output: returns the width of the character drawn
//--------------------------------------------------------------------------
---
int RichText::DrawString(int iFirst, int iLast, TRenderState &renderState,
HFont font)
{
// Calculate the render size
int fontTall = surface()->GetFontTall(font);
// BUGBUG John: This won't exactly match the rendered size
int charWide = 0;
for ( int i = iFirst; i <= iLast; i++ )
{
char ch = m_TextStream[i];
charWide += surface()->GetCharacterWidth(font, ch);
}
// fix code start
//this fixes when it renders out side the rich text box and out side
the container panel.
int x, y;
this->GetPos(x, y);
if (renderState.y + fontTall > GetTall())
return charWide;
// fix code end
[/code]
Make sure the end of the function is still there
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Christopher
Harris
Sent: Thursday, February 14, 2008 10:17 PM
To: [email protected]
Subject: RE: [hlcoders] Scrollbar on vgui::RichText in a PropertyDialog
:< I had that same text problem and I had to make it 1-5 units in height
smaller than the size of the property page. Otherwise it would bleed beyond
the page and into the bottom border of the property dialog. Still with it
off by 1-5 units it bleeds slightly over the border of the vgui::RichText
itself. Hmmm, strange though I will have to play around with it some more.
It may be made more complicated by the fact that I have this all on the chat
hud.
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mark Chandler
Sent: Wednesday, February 13, 2008 10:16 PM
To: [email protected]
Subject: RE: [hlcoders] Scrollbar on vgui::RichText in a PropertyDialog
Weird, I have done what you have said and I don't have that problem. But I
did have a problem of the text going out side the textbox which I have
fixed.
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Christopher
Harris
Sent: Thursday, February 14, 2008 5:23 AM
To: [email protected]
Subject: RE: [hlcoders] Scrollbar on vgui::RichText in a PropertyDialog
Heh, Yes, in fact that is all I can do. If I click on the scrollbar it will
start selecting text as if the scollbar does not exist.
Chris
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mark Chandler
Sent: Wednesday, February 13, 2008 7:22 AM
To: [email protected]
Subject: RE: [hlcoders] Scrollbar on vgui::RichText in a PropertyDialog
Can you select text from it?
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Christopher
Harris
Sent: Wednesday, February 13, 2008 9:00 PM
To: [email protected]
Subject: [hlcoders] Scrollbar on vgui::RichText in a PropertyDialog
This is a multipart message in MIME format.
--
[ Picked text/plain from multipart/alternative ]
Hey,
If I have a panel I made that has a vgui::RichText with scrollbar enabled I
can use the scrollbar when I test the page on its own. When I add it to a
properties dialog I can no longer use the scrollbar. My icon stays in text
select icon mode even when hovered over scrollbar. Has anyone come across
this before, could be a bug or something stupid on my part!
Chris
--
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders