PrevNextUpHome SophiaFramework UNIVERSE 5.3
SFBStatic
Wrapper Class for the IStatic interface.
#include <SFBStatic.h.hpp>
class SFBStatic : public SFBControl;
SFMTYPEDEFWRAPPER(SFBStatic)

Inheritance diagram

 Inheritance diagram of SFBStaticClass

Version

BREW 2.0 BREW 2.1 BREW 3.1 BREW 4.0
O O O O

Reference

BREW API IStatic

Member

Public Functions
SInt32 GoToLine( SInt32 index )
Auto-scroll to a specific line. The nLine parameter is a 0-based index value.
Bool IsScrollable( Void )
This method allows the caller to determine if the text of the static control fits in space allocated to the control.
static
SFBStaticSmp
NewInstance( SFCErrorPtr exception = null )
Create a new SFBStatic instance.
static
SFBStaticSmp
NewInstance( AEECLSID id , SFCErrorPtr exception = null )
Create a new SFBStatic instance.
Void SetFont( AEEFont textFont , AEEFont titleFont )
Set the title and text fonts.
Bool SetText( WCharPtr title , WCharPtr text , AEEFont titleFont , AEEFont textFont )
sets the text and title of the SFBStatic Interface object.
Bool SetText( SFXWideStringConstRef title , SFXWideStringConstRef text , AEEFont titleFont , AEEFont textFont )
sets the text and title of the SFBStatic Interface object.
Bool SetTextEx( BytePtr text , SFBAStreamSmpConstRef stream , Bool append )
sets the text of the SFBStatic object.
Bool SetTextEx( SFXAnsiStringConstRef text , Bool append = false )
sets the text of the SFBStatic object.
Bool SetTextEx( SFXWideStringConstRef text , Bool append = false )
sets the text of the SFBStatic object.
Bool SetTextEx( SFBAStreamSmpConstRef stream , Bool append = false )
sets the text of the SFBStatic object.
Bool SetTextEx( SFXStorageConstRef storage , Bool append = false )
sets the text of the SFBStatic object.
Void SizeToFit( SFXRectanglePtr rect )
Adjust the size of the bounding rectangle so that it can fit all the text in the SFBStatic.
UInt32 GetProperties( Void ) (inherits from SFBControl)
Return the control-specific properties or flags.
Void GetRect( SFXRectanglePtr rect ) (inherits from SFBControl)
Get the rectangle of the control.
SFXRectangle GetRect( Void ) (inherits from SFBControl)
Get the rectangle of the control.
Bool HandleEvent( AEEEvent event , UInt16 wParam , UInt32 dwParam ) (inherits from SFBControl)
Pass events to a control. The BREW controls process various events to allow a device user to enter a text, time, or date value or choose an item from a menu. Refer to the descriptions of each control for the events it handles. Your applet must pass a control all of the events, unless the control is part of a dialog. Below is an example of an application passing all of the events to the controls of the application.
Bool HandleEvent( SFXEventConstRef event ) (inherits from SFBControl)
Pass events to a control. The BREW controls process various events to allow a device user to enter a text, time, or date value or choose an item from a menu. Refer to the descriptions of each control for the events it handles. Your applet must pass a control all of the events, unless the control is part of a dialog. Below is an example of an application passing all of the events to the controls of the application.
Bool IsActive( Void ) (inherits from SFBControl)
Return the active or focus state of the control.
Bool Redraw( Void ) (inherits from SFBControl)
Instruct the control to redraw its contents.
Void Reset( Void ) (inherits from SFBControl)
Instruct the control to reset (free/delete) its contents and to immediately leave active/focus mode.
Void SetActive( Bool active = true ) (inherits from SFBControl)
Instruct the control to enter/leave focus or selected mode.
Void SetProperties( UInt32 properties ) (inherits from SFBControl)
Set control-specific properties or flags.
Void SetRect( SFXRectangleConstRef rect ) (inherits from SFBControl)
Set the active screen coordinates of the control. This may result in the control redrawing its contents.
Protected Functions
static
SFBBaseSmp
FactoryByCreate( AEECLSID id , SFCErrorPtr exception = null ) (inherits from SFBBase)
Create the instance for the specified ClassID's interface.
static
SFBBaseSmp
FactoryByQuery( SFBQuerySmpConstRef query , AEECLSID id , SFCErrorPtr exception = null ) (inherits from SFBBase)
Create the instance for the specified ClassID's interface using the SFBQuery instance.

SFBStatic::GoToLine
Auto-scroll to a specific line. The nLine parameter is a 0-based index value.
[ public ]
SInt32 GoToLine(
    SInt32 index   // index to the scroll to display
);

Reference

BREW API ISTATIC_GoToLine


SFBStatic::IsScrollable
This method allows the caller to determine if the text of the static control fits in space allocated to the control.
[ public ]
Bool IsScrollable(Void);

Reference

BREW API ISTATIC_IsScrollable


SFBStatic::NewInstance
Create a new SFBStatic instance.
[ public, static ]
SFBStaticSmp NewInstance(
    SFCErrorPtr exception = null   // Error
);
[ public, static ]
SFBStaticSmp NewInstance(
    AEECLSID id                    // Class ID
    SFCErrorPtr exception = null   // Error
);

SFBStatic::SetFont
Set the title and text fonts.
[ public ]
Void SetFont(
    AEEFont textFont    // font to use for the text
    AEEFont titleFont   // font to use for the title
);

Reference

BREW API ISTATIC_SetFont


SFBStatic::SetText
sets the text and title of the SFBStatic Interface object.
[ public ]
Bool SetText(
    WCharPtr title      // pointer to the title string
    WCharPtr text       // pointer to the text
    AEEFont titleFont   // title font type
    AEEFont textFont    // text font type
);
[ public ]
Bool SetText(
    SFXWideStringConstRef title   // pointer to the title string
    SFXWideStringConstRef text    // pointer to the text
    AEEFont titleFont             // title font type
    AEEFont textFont              // text font type
);

Return value

  • Text and title were set correctly: true
  • Otherwize: false

Reference

BREW API ISTATIC_SetText | AEEFont


SFBStatic::SetTextEx
sets the text of the SFBStatic object.
[ public ]
Bool SetTextEx(
    BytePtr text                   // set the pointer to the text to byte type
    SFBAStreamSmpConstRef stream   // set the SFBAstream object contains the text
    Bool append                    // true to append text, false to reset text
);
[ public ]
Bool SetTextEx(
    SFXAnsiStringConstRef text   // set the SFBXAnsiString object contains the text
    Bool append = false          // true to append text, false to reset text
);
[ public ]
Bool SetTextEx(
    SFXWideStringConstRef text   // set the SFBXWideString object contains the text
    Bool append = false          // true to append text, false to reset text
);
[ public ]
Bool SetTextEx(
    SFBAStreamSmpConstRef stream   // set the SFBAstream object contains the text
    Bool append = false            // true to append text, false to reset text
);
[ public ]
Bool SetTextEx(
    SFXStorageConstRef storage   // set the SFBAstream object contains the text
    Bool append = false          // true to append text, false to reset text
);

Return value

  • The text was set or added: true
  • The text was not set or added: false

Description

Set the text of static control to single byte(char type) or double byte(ACar type) Before use this function to set the text of static control to AChar type, please set the property to ST_ASCII. So that the string of AChar type can be used. And if set it to string of WChar type, please don't set the property to ST_ASCII. (By default, the perproty of static control is not set to ST_ASCII.)

Warning

While calling the SetTextEx( SFXAnsiStringConstRef text , Bool append ) or SetTextEx( SFXWideStringConstRef text , Bool append ) function,please don't use the string just like ( "literal" which is surrounded by " If set the string with argument, please set it to SFXAnsiString type or SFXWideString type.

Example

    SFBStaticSmp staticCtl = SFBStatic::NewInstance();

    // Set the title and the text
    staticCtl->SetText("StaticTest", "Static Static", AEE_FONT_LARGE, AEE_FONT_LARGE);

    // As the string of AChar type will be set with SetTextEx(),
    // set the peoperty to ST_ASCII
    staticCtl->SetProperties(ST_ASCII);

    // set the string of AChar type
    staticCtl->SetTextEx(SFXAnsiString("Stream Test"));

    staticCtl->SetRect(SFXRectangle(0, 0, 100, 100));
    staticCtl->SetActive(true);
    staticCtl->Redraw();

Reference

BREW API ISTATIC_SetTextEx


SFBStatic::SizeToFit
Adjust the size of the bounding rectangle so that it can fit all the text in the SFBStatic.
[ public ]
Void SizeToFit(
    SFXRectanglePtr rect   // pointer to location to set to bounding rectangle
);

Reference

BREW API ISTATIC_SizeToFit