<para>Alignment of the text inside the control. Possible values are 'left', 'center' and 'right'. The 'width' and 'center' alignments are computed using the width of the control (as given by the <link linkend="textwidth">width</link> attribute). Available since VLC 0.8.5.</para>
<para>Default value: left</para>
</sect3>
+ <sect3 id="focus">
+ <title>focus</title>
+ <para>indicates if the control is eligible for mouse focus or not. If focus is set to false, it is as though the control did not exist when it comes to mouse focus. This allows for instance displaying a dynamic text in the title bar, yet opting for being able to move the window rather than manage scrolling of lengthy text. Available in VLC 1.2.0.</para>
+ <para>Default value: true</para>
+ </sect3>
<sect3 id="textscrolling">
<title>scrolling</title>
<para>Scrolling behaviour of the text (only when it doesn't fit in the <link linkend="textwidth">width</link> of the control). Possible values are 'auto', 'manual' and 'none'. If this attribute is set to 'auto', the text automatically starts scrolling. The user can drag the text, and click on it to start/stop the scrolling. If this attribute is set to 'manual', the text only scrolls when dragged by the user. If this attribute is set to 'none', no scrolling is possible at all. Available since VLC 0.8.5.</para>
CtrlText::CtrlText( intf_thread_t *pIntf, VarText &rVariable,
const GenericFont &rFont, const UString &rHelp,
- uint32_t color, VarBool *pVisible, Scrolling_t scrollMode,
- Align_t alignment ):
- CtrlGeneric( pIntf, rHelp, pVisible ), m_fsm( pIntf ),
+ uint32_t color, VarBool *pVisible, VarBool *pFocus,
+ Scrolling_t scrollMode, Align_t alignment ):
+ CtrlGeneric( pIntf, rHelp, pVisible ), m_pFocus( pFocus), m_fsm( pIntf ),
m_rVariable( rVariable ), m_cmdToManual( this ),
m_cmdManualMoving( this ), m_cmdManualStill( this ),
m_cmdMove( this ), m_pEvt( NULL ), m_rFont( rFont ),
bool CtrlText::mouseOver( int x, int y ) const
{
+ if( !m_pFocus->get() )
+ return false;
+
if( m_pCurrImg )
{
// We have 3 different ways of deciding when to return true here:
/// Create a text control with the optional given color
CtrlText( intf_thread_t *pIntf, VarText &rVariable,
const GenericFont &rFont, const UString &rHelp,
- uint32_t color, VarBool *pVisible, Scrolling_t scrollMode,
- Align_t alignment);
+ uint32_t color, VarBool *pVisible, VarBool *pFocus,
+ Scrolling_t scrollMode, Align_t alignment);
virtual ~CtrlText();
/// Handle an event
Scrolling_t m_scrollMode;
/// Type of alignment
Align_t m_alignment;
+ /// indicate if control is focusable
+ VarBool *m_pFocus;
/// Image of the text
GenericBitmap *m_pImg;
/// Image of the text, repeated twice and with some blank between;
// XXX check when it is null
Interpreter *pInterpreter = Interpreter::instance( getIntf() );
VarBool *pVisible = pInterpreter->getVarBool( rData.m_visible, m_pTheme );
+ VarBool *pFocus = pInterpreter->getVarBool( rData.m_focus, m_pTheme );
CtrlText *pText = new CtrlText( getIntf(), *pVar, *pFont,
- UString( getIntf(), rData.m_help.c_str() ), rData.m_color, pVisible,
- scrolling, alignment );
+ UString( getIntf(), rData.m_help.c_str() ), rData.m_color,
+ pVisible, pFocus, scrolling, alignment );
m_pTheme->m_controls[rData.m_id] = CtrlGenericPtr( pText );
int height = pFont->getSize();
Image id:string xPos:int yPos:int width:int height:int leftTop:string rightBottom:string xKeepRatio:bool yKeepRatio:bool visible:string bmpId:string actionId:string action2Id:string resize:string help:string art:bool layer:int windowId:string layoutId:string panelId:string
IniFile id:string file:string
Panel id:string xPos:int yPos:int leftTop:string rightBottom:string xKeepRatio:bool yKeepRatio:bool width:int height:int layer:int windowId:string layoutId:string panelId:string
-Text id:string xPos:int yPos:int visible:string fontId:string text:string width:int leftTop:string rightBottom:string xKeepRatio:bool yKeepRatio:bool color:uint32_t scrolling:string alignment:string help:string layer:int windowId:string layoutId:string panelId:string
+Text id:string xPos:int yPos:int visible:string fontId:string text:string width:int leftTop:string rightBottom:string xKeepRatio:bool yKeepRatio:bool color:uint32_t scrolling:string alignment:string focus:string help:string layer:int windowId:string layoutId:string panelId:string
RadialSlider id:string visible:string xPos:int yPos:int leftTop:string rightBottom:string xKeepRatio:bool yKeepRatio:bool sequence:string nbImages:int minAngle:float maxAngle:float value:string tooltip:string help:string layer:int windowId:string layoutId:string panelId:string
Slider id:string visible:string xPos:int yPos:int leftTop:string rightBottom:string xKeepRatio:bool yKeepRatio:bool upId:string downId:string overId:string points:string thickness:int value:string imageId:string nbHoriz:int nbVert:int padHoriz:int padVert:int tooltip:string help:string layer:int windowId:string layoutId:string panelId:string
List id:string xPos:int yPos:int visible:string width:int height:int leftTop:string rightBottom:string xKeepRatio:bool yKeepRatio:bool fontId:string var:string bgImageId:string fgColor:string playColor:string bgColor1:string bgColor2:string selColor:string help:string layer:int windowId:string layoutId:string panelId:string
/// Type definition
struct Text
{
- Text( const string & id, int xPos, int yPos, const string & visible, const string & fontId, const string & text, int width, const string & leftTop, const string & rightBottom, bool xKeepRatio, bool yKeepRatio, uint32_t color, const string & scrolling, const string & alignment, const string & help, int layer, const string & windowId, const string & layoutId, const string & panelId ):
-m_id( id ), m_xPos( xPos ), m_yPos( yPos ), m_visible( visible ), m_fontId( fontId ), m_text( text ), m_width( width ), m_leftTop( leftTop ), m_rightBottom( rightBottom ), m_xKeepRatio( xKeepRatio ), m_yKeepRatio( yKeepRatio ), m_color( color ), m_scrolling( scrolling ), m_alignment( alignment ), m_help( help ), m_layer( layer ), m_windowId( windowId ), m_layoutId( layoutId ), m_panelId( panelId ) {}
+ Text( const string & id, int xPos, int yPos, const string & visible, const string & fontId, const string & text, int width, const string & leftTop, const string & rightBottom, bool xKeepRatio, bool yKeepRatio, uint32_t color, const string & scrolling, const string & alignment, const string & focus, const string & help, int layer, const string & windowId, const string & layoutId, const string & panelId ):
+m_id( id ), m_xPos( xPos ), m_yPos( yPos ), m_visible( visible ), m_fontId( fontId ), m_text( text ), m_width( width ), m_leftTop( leftTop ), m_rightBottom( rightBottom ), m_xKeepRatio( xKeepRatio ), m_yKeepRatio( yKeepRatio ), m_color( color ), m_scrolling( scrolling ), m_alignment( alignment ), m_focus( focus ), m_help( help ), m_layer( layer ), m_windowId( windowId ), m_layoutId( layoutId ), m_panelId( panelId ) {}
string m_id;
int m_xPos;
uint32_t m_color;
string m_scrolling;
string m_alignment;
+ string m_focus;
string m_help;
int m_layer;
string m_windowId;
DefaultAttr( attr, "color", "#000000" );
DefaultAttr( attr, "scrolling", "auto" );
DefaultAttr( attr, "alignment", "left" );
+ DefaultAttr( attr, "focus", "true" );
DefaultAttr( attr, "width", "0" );
DefaultAttr( attr, "lefttop", "lefttop" );
DefaultAttr( attr, "rightbottom", "lefttop" );
convertBoolean( attr["ykeepratio"] ),
convertColor( attr["color"] ),
attr["scrolling"], attr["alignment"],
- attr["help"], m_curLayer, m_curWindowId, m_curLayoutId,
+ attr["focus"], attr["help"],
+ m_curLayer, m_curWindowId, m_curLayoutId,
m_panelStack.back() );
m_curLayer++;
m_pData->m_listText.push_back( textData );
color CDATA "#000000"
scrolling CDATA "auto"
alignment CDATA "left"
+ focus CDATA "true"
help CDATA ""
>
<!ELEMENT Playlist (Slider)?>