mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-18 11:19:10 +00:00
pfGUIControlMod's font face => plString
This commit is contained in:
@ -85,7 +85,7 @@ void pfGUIColorScheme::IReset( void )
|
|||||||
fSelForeColor.Set( 1, 1, 1, 1 );
|
fSelForeColor.Set( 1, 1, 1, 1 );
|
||||||
fSelBackColor.Set( 0, 0, 1, 1 );
|
fSelBackColor.Set( 0, 0, 1, 1 );
|
||||||
fTransparent = false;
|
fTransparent = false;
|
||||||
fFontFace = hsStrcpy( "Times New Roman" );
|
fFontFace = "Times New Roman";
|
||||||
fFontSize = 10;
|
fFontSize = 10;
|
||||||
fFontFlags = 0;
|
fFontFlags = 0;
|
||||||
}
|
}
|
||||||
@ -95,11 +95,6 @@ pfGUIColorScheme::pfGUIColorScheme()
|
|||||||
IReset();
|
IReset();
|
||||||
}
|
}
|
||||||
|
|
||||||
pfGUIColorScheme::~pfGUIColorScheme()
|
|
||||||
{
|
|
||||||
delete [] fFontFace;
|
|
||||||
}
|
|
||||||
|
|
||||||
pfGUIColorScheme::pfGUIColorScheme( hsColorRGBA &foreColor, hsColorRGBA &backColor )
|
pfGUIColorScheme::pfGUIColorScheme( hsColorRGBA &foreColor, hsColorRGBA &backColor )
|
||||||
{
|
{
|
||||||
IReset();
|
IReset();
|
||||||
@ -107,20 +102,14 @@ pfGUIColorScheme::pfGUIColorScheme( hsColorRGBA &foreColor, hsColorRGBA &backCol
|
|||||||
fBackColor = backColor;
|
fBackColor = backColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
pfGUIColorScheme::pfGUIColorScheme( const char *face, uint8_t size, uint8_t fontFlags )
|
pfGUIColorScheme::pfGUIColorScheme( const plString &face, uint8_t size, uint8_t fontFlags )
|
||||||
{
|
{
|
||||||
IReset();
|
IReset();
|
||||||
fFontFace = hsStrcpy( face );
|
fFontFace = face;
|
||||||
fFontSize = size;
|
fFontSize = size;
|
||||||
fFontFlags = fontFlags;
|
fFontFlags = fontFlags;
|
||||||
}
|
}
|
||||||
|
|
||||||
void pfGUIColorScheme::SetFontFace( const char *face )
|
|
||||||
{
|
|
||||||
delete [] fFontFace;
|
|
||||||
fFontFace = hsStrcpy( face );
|
|
||||||
}
|
|
||||||
|
|
||||||
void pfGUIColorScheme::Read( hsStream *s )
|
void pfGUIColorScheme::Read( hsStream *s )
|
||||||
{
|
{
|
||||||
fForeColor.Read( s );
|
fForeColor.Read( s );
|
||||||
@ -129,8 +118,7 @@ void pfGUIColorScheme::Read( hsStream *s )
|
|||||||
fSelBackColor.Read( s );
|
fSelBackColor.Read( s );
|
||||||
fTransparent = s->ReadBOOL();
|
fTransparent = s->ReadBOOL();
|
||||||
|
|
||||||
delete [] fFontFace;
|
fFontFace = s->ReadSafeString_TEMP();
|
||||||
fFontFace = s->ReadSafeString();
|
|
||||||
s->ReadLE( &fFontSize );
|
s->ReadLE( &fFontSize );
|
||||||
s->ReadLE( &fFontFlags );
|
s->ReadLE( &fFontFlags );
|
||||||
}
|
}
|
||||||
|
@ -74,9 +74,9 @@ class pfGUIColorScheme : public hsRefCnt
|
|||||||
hsColorRGBA fSelForeColor, fSelBackColor;
|
hsColorRGBA fSelForeColor, fSelBackColor;
|
||||||
bool fTransparent;
|
bool fTransparent;
|
||||||
|
|
||||||
char *fFontFace;
|
plString fFontFace;
|
||||||
uint8_t fFontSize;
|
uint8_t fFontSize;
|
||||||
uint8_t fFontFlags;
|
uint8_t fFontFlags;
|
||||||
|
|
||||||
enum FontFlags
|
enum FontFlags
|
||||||
{
|
{
|
||||||
@ -86,18 +86,17 @@ class pfGUIColorScheme : public hsRefCnt
|
|||||||
};
|
};
|
||||||
|
|
||||||
pfGUIColorScheme();
|
pfGUIColorScheme();
|
||||||
~pfGUIColorScheme();
|
|
||||||
pfGUIColorScheme( hsColorRGBA &foreColor, hsColorRGBA &backColor );
|
pfGUIColorScheme( hsColorRGBA &foreColor, hsColorRGBA &backColor );
|
||||||
pfGUIColorScheme( const char *face, uint8_t size, uint8_t fontFlags );
|
pfGUIColorScheme( const plString &face, uint8_t size, uint8_t fontFlags );
|
||||||
|
|
||||||
void SetFontFace( const char *face );
|
void SetFontFace(const plString &face) { fFontFace = face; }
|
||||||
|
|
||||||
void Read( hsStream *s );
|
void Read( hsStream *s );
|
||||||
void Write( hsStream *s );
|
void Write( hsStream *s );
|
||||||
|
|
||||||
bool IsBold( void ) { return ( fFontFlags & kFontBold ) ? true : false; }
|
bool IsBold() const { return ( fFontFlags & kFontBold ) ? true : false; }
|
||||||
bool IsItalic( void ) { return ( fFontFlags & kFontItalic ) ? true : false; }
|
bool IsItalic() const { return ( fFontFlags & kFontItalic ) ? true : false; }
|
||||||
bool IsShadowed( void ) { return ( fFontFlags & kFontShadowed ) ? true : false; }
|
bool IsShadowed() const { return ( fFontFlags & kFontShadowed ) ? true : false; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
@ -349,7 +349,7 @@ void pfGUIMultiLineEditCtrl::IPostSetUpDynTextMap( void )
|
|||||||
fFontFlagsSet |= kFontStyleSet;
|
fFontFlagsSet |= kFontStyleSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
fDynTextMap->SetFont( fFontFace.c_str(), fFontSize, fFontStyle,
|
fDynTextMap->SetFont( fFontFace, fFontSize, fFontStyle,
|
||||||
HasFlag( kXparentBgnd ) ? false : true );
|
HasFlag( kXparentBgnd ) ? false : true );
|
||||||
|
|
||||||
// Calculate a height for each line
|
// Calculate a height for each line
|
||||||
@ -572,7 +572,7 @@ uint32_t pfGUIMultiLineEditCtrl::IRenderLine( uint16_t x, uint16_t y, int32_t s
|
|||||||
IFindLastStyleCode( start, currStyle );
|
IFindLastStyleCode( start, currStyle );
|
||||||
|
|
||||||
fDynTextMap->SetTextColor( currColor, HasFlag( kXparentBgnd ) ? true : false );
|
fDynTextMap->SetTextColor( currColor, HasFlag( kXparentBgnd ) ? true : false );
|
||||||
fDynTextMap->SetFont( fFontFace.c_str(), fFontSize, GetColorScheme()->fFontFlags | currStyle,
|
fDynTextMap->SetFont( fFontFace, fFontSize, GetColorScheme()->fFontFlags | currStyle,
|
||||||
HasFlag( kXparentBgnd ) ? false : true );
|
HasFlag( kXparentBgnd ) ? false : true );
|
||||||
|
|
||||||
// Now, start from our start and go to the end and keep eating up as many chunks
|
// Now, start from our start and go to the end and keep eating up as many chunks
|
||||||
@ -609,7 +609,7 @@ uint32_t pfGUIMultiLineEditCtrl::IRenderLine( uint16_t x, uint16_t y, int32_t s
|
|||||||
// Read style and switch to that one
|
// Read style and switch to that one
|
||||||
IReadStyleCode( pos, currStyle );
|
IReadStyleCode( pos, currStyle );
|
||||||
if( !dontRender )
|
if( !dontRender )
|
||||||
fDynTextMap->SetFont( fFontFace.c_str(), fFontSize , GetColorScheme()->fFontFlags | currStyle,
|
fDynTextMap->SetFont( fFontFace, fFontSize , GetColorScheme()->fFontFlags | currStyle,
|
||||||
HasFlag( kXparentBgnd ) ? false : true );
|
HasFlag( kXparentBgnd ) ? false : true );
|
||||||
}
|
}
|
||||||
else if( buffer[ pos ] == L'\n' )
|
else if( buffer[ pos ] == L'\n' )
|
||||||
@ -1836,11 +1836,11 @@ void pfGUIMultiLineEditCtrl::IHitBeginningOfControlList(int32_t cursorPos)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void pfGUIMultiLineEditCtrl::SetFontFace(std::string fontFace)
|
void pfGUIMultiLineEditCtrl::SetFontFace(const plString &fontFace)
|
||||||
{
|
{
|
||||||
fFontFace = fontFace;
|
fFontFace = fontFace;
|
||||||
fFontFlagsSet |= kFontFaceSet;
|
fFontFlagsSet |= kFontFaceSet;
|
||||||
fDynTextMap->SetFont( fFontFace.c_str(), fFontSize, fFontStyle,
|
fDynTextMap->SetFont( fFontFace, fFontSize, fFontStyle,
|
||||||
HasFlag( kXparentBgnd ) ? false : true );
|
HasFlag( kXparentBgnd ) ? false : true );
|
||||||
fDynTextMap->CalcStringWidth( "The quick brown fox jumped over the lazy dog.", &fLineHeight );
|
fDynTextMap->CalcStringWidth( "The quick brown fox jumped over the lazy dog.", &fLineHeight );
|
||||||
}
|
}
|
||||||
@ -1850,7 +1850,7 @@ void pfGUIMultiLineEditCtrl::SetFontSize(uint8_t fontSize)
|
|||||||
fFontSize = fontSize;
|
fFontSize = fontSize;
|
||||||
fFontFlagsSet |= kFontSizeSet;
|
fFontFlagsSet |= kFontSizeSet;
|
||||||
fCalcedFontSize = fontSize;
|
fCalcedFontSize = fontSize;
|
||||||
fDynTextMap->SetFont( fFontFace.c_str(), fFontSize, fFontStyle,
|
fDynTextMap->SetFont( fFontFace, fFontSize, fFontStyle,
|
||||||
HasFlag( kXparentBgnd ) ? false : true );
|
HasFlag( kXparentBgnd ) ? false : true );
|
||||||
fDynTextMap->CalcStringWidth( "The quick brown fox jumped over the lazy dog.", &fLineHeight );
|
fDynTextMap->CalcStringWidth( "The quick brown fox jumped over the lazy dog.", &fLineHeight );
|
||||||
}
|
}
|
||||||
|
@ -129,10 +129,10 @@ class pfGUIMultiLineEditCtrl : public pfGUIControlMod
|
|||||||
|
|
||||||
pfGUIMultiLineEditProc *fEventProc; // where we send events to
|
pfGUIMultiLineEditProc *fEventProc; // where we send events to
|
||||||
|
|
||||||
std::string fFontFace;
|
plString fFontFace;
|
||||||
hsColorRGBA fFontColor;
|
hsColorRGBA fFontColor;
|
||||||
uint8_t fFontSize;
|
uint8_t fFontSize;
|
||||||
uint8_t fFontStyle;
|
uint8_t fFontStyle;
|
||||||
enum flagsSet
|
enum flagsSet
|
||||||
{
|
{
|
||||||
kFontFaceSet = 1,
|
kFontFaceSet = 1,
|
||||||
@ -271,7 +271,7 @@ class pfGUIMultiLineEditCtrl : public pfGUIControlMod
|
|||||||
|
|
||||||
uint8_t GetFontSize() {return fFontSize;} // because we're too cool to use the color scheme crap
|
uint8_t GetFontSize() {return fFontSize;} // because we're too cool to use the color scheme crap
|
||||||
|
|
||||||
void SetFontFace(std::string fontFace);
|
void SetFontFace(const plString &fontFace);
|
||||||
void SetFontColor(hsColorRGBA fontColor) {fFontColor = fontColor; fFontFlagsSet |= kFontColorSet;}
|
void SetFontColor(hsColorRGBA fontColor) {fFontColor = fontColor; fFontFlagsSet |= kFontColorSet;}
|
||||||
void SetFontSize(uint8_t fontSize);
|
void SetFontSize(uint8_t fontSize);
|
||||||
void SetFontStyle(uint8_t fontStyle) {fFontStyle = fontStyle; fFontFlagsSet |= kFontStyleSet;}
|
void SetFontStyle(uint8_t fontStyle) {fFontStyle = fontStyle; fFontFlagsSet |= kFontStyleSet;}
|
||||||
|
Reference in New Issue
Block a user