PrevNextUpHome SophiaFramework UNIVERSE 5.3
SFZTitleBevelFrame
Responder which represents a bevel frame with a title.
#include <SFZTitleBevelFrame.h.hpp>
class SFZTitleBevelFrame : public SFYBevelFrame;
SFMTYPEDEFCLASS(SFZTitleBevelFrame)

Inheritance diagram

 Inheritance diagram of SFZTitleBevelFrameClass

Collaboration diagram

 Collaboration diagram of SFZTitleBevelFrameClass

Description

How to use

Bevel frame with a title is a frame which consists of a shadow region, a flat frame region, a bevel region, and a header region for title.

[Note] How to get a frame margin

The frame margin of frame responder can be obtained by calling the SFYResponder::GetSuitableMargin function.

Figure 390. Bevel frame with [SFZTitleBevelFrame]


Bevel frame with [SFZTitleBevelFrame]

The union of the shadow region, the flat frame region, the bevel region, and the header region for title is the frame margin of bevel frame with a title.

Figure 391. Bevel frame with: Expanded Figure[SFZTitleBevelFrame]


Bevel frame with: Expanded Figure[SFZTitleBevelFrame]

The black line is the shadow region, the blue line(default: black) is the flat frame region, the line of white and gray is the bevel frame region, and the bevel color rectangular region in gray where the "Title" string is drawn at the center is the header region. The union set of these four regions is the frame margin of bevel frame with a title. And the rectangular region surrounded by the frame margin is the content region.

The height of the header region "HeaderHeight" is given as below.

HeaderHeight = FontHeight + 2 * BevelFrameWidth + 2 * FrameMarginSize

FontHeight      : height of font
BevelFrameWidth : width of bevel frame [1 pixel]
FrameMarginSize : margin of the header region set with SetFrameSize() [by default, 1 pixel]

The width of the header region "HeaderWidth" is given as below.

HeaderWidth = SFZTitleBevelFrameWidth - FlatFrameWidth - ShadowWidth

SFZTitleBevelFrameWidth : width of local region of this SFZTitleBevelFrame instance
FlatFrameWidth          : width of flat frame region [1 pixel]
ShadowWidth             : width of shadow region [1 pixel]

The background of the header region is filled in the bevel color(SFXBevelColor) set with the SFZTitleBevelFrame::SetHeaderColor function.

The top edge of the bevel frame region is positioned just under the header region.

Each width of the shadow region, the flat frame region, and the bevel frame region is 1 pixel.

  1. The shadow region is drawn by calling the SFYPlainFrame::DrawShadow function. (The color of shadow region is set with the SFYPlainFrame::SetShadowColor function.)
  2. The flat frame region is drawn by calling the SFYFlatFrame::DrawFrame function. (The color of flat frame region is set with the SFYFlatFrame::SetFrameColor and SFYFlatFrame::SetFocusColor functions.)
  3. The header region is drawn by calling the SFZTitlePlainFrame::DrawHeader function. (The color of the header region is set with the SFZTitlePlainFrame::SetHeaderColor function.)
  4. The bevel frame region is drawn by calling the SFYBevelFrame::DrawBevel function. (The color of flat frame region is set with the SFYBevelFrame::SetBevelColor function.)
[Note] Responder with a frame

A window or dialog with a frame can be implemented by calling its SFYResponder::SetFrame function. A real region of a window or dialog is the content region surrounded by the frame margin.

Example 897. Execution result of the sample code: attach a frame to a window [SFZTitleBevelFrame and SFZWindow]

// define the class
SFMTYPEDEFCLASS(USRApplication)
class USRApplication : public SFYApplication {
  SFMSEALCOPY(USRApplication)
public:
  static SFCInvokerPtr Factory(Void);
private:
  explicit USRApplication(Void) static_throws;
  virtual ~USRApplication(Void);

  XANDLER_DECLARE_VOIDRENDER(OnRenderRequestSFZWindow) // drawing handler
  XANDLER_DECLARE_BOOLEVENT(OnKeySFZWindow)            // key handler of the window
};


// constructor
USRApplication::USRApplication(Void) static_throws
{
  // ... (omitted) ...

  SFZTitleBevelFrameSmp frame;  // smart pointer to SFZTitleBevelFrame
  SFZWindowSmp          window; // smart pointer to SFZWindow
  SFCError              error(SFERR_NO_ERROR);

  // create the frame
  if ((frame = SFZTitleBevelFrame::NewInstance(&error)) != null) {

    // set the frame's title
    frame->SetText("Title for SFZWindow");

    // In general, the frame's state is set to "visible" + "active" + "enable" + "focus".
    frame->SetState(true, true, true, true);

    // create the window
    if ((window = SFZWindow::NewInstance(&error)) != null) {

      // register the drawing handler into window: draw "Hello World!"
      error = window->RegisterHandler(
        SFXEventRange(SFEVT_RESPONDER_RENDER, SFEVT_RESPONDER_RENDER, SFP16_RENDER_REQUEST, SFP16_RENDER_REQUEST),
        XANDLER_INTERNAL(OnRenderRequestSFZWindow)
      );
      if (error == SFERR_NO_ERROR) {

        // register the key handler into the window: close the frame when the SELECT key is pressed
        error = window->RegisterHandler(
          SFXEventRange(SFEVT_KEY, SFEVT_KEY, SFP16_BEGIN, SFP16_END),
          XANDLER_INTERNAL(OnKeySFZWindow)
        );
        if (error == SFERR_NO_ERROR) { 

          // set the window's parent responder to the application class(root)
          error = window->SetParent(GetThis());
          if (error == SFERR_NO_ERROR) {

            // attach the frame to the window
            error = window->SetFrame(frame);
            if (error == SFERR_NO_ERROR) {

              // Set the frame's real region to the region obtained by deflating the screen device region by (30, 30)
              // * Automatically, the window's real region will be set to the region obtained by deflating it by the frame margin.
              frame->SetRealBound(GetLocalBound().Deflate(30, 30));

              // set the window's state to "visible" + "active" + "enable" + "focus" together
              window->SetState(true, true, true, true);

              // move the window foremost
              // * automatically, the frame will be moved foremost together
              window->ToFront();
            }
          }
        }
      }
    }
  }
  static_throw(error);
}


// implement the drawing handler of SFZWindow
#define TROPICALBLUE_COLOR (SFXRGBColor(0xCE, 0xD8, 0xF8, 0x00))
#define COLOR_BLACK        (SFXRGBColor(0x00, 0x00, 0x00, 0x00))
XANDLER_IMPLEMENT_VOIDRENDER(helloworld, OnRenderRequestSFZWindow, invoker, reason, graphics)
{
  unused(invoker);
  unused(reason);

  // fill the window's local region in tropical bule color
  graphics->FillRectangle(GetLocalBound(), TROPICALBLUE_COLOR);

  // draw "Hello World!" in black at the center of the window
  graphics->DrawSingleText("Hello World!", invoker->GetLocalBound(), COLOR_BLACK);

  return;
}

// implement the key handler of SFZWindow
XANDLER_IMPLEMENT_BOOLEVENT(helloworld, OnKeySFZWindow, invoker, event)
{
  Bool result(false);
  unused(invoker);

  switch (event.GetP16()) {

    case AVK_SELECT:  // when the SELECT key is pressed

         // close the window only
         // * automatically, the frame will be detached from the window and become invisible
         invoker->Terminate();

         result = true;  // "true" is set since the event has been handled

         break;
  }

  return result;
}

Figure 392. Execution result of the sample code: attach a frame to a window [SFZTitleBevelFrame and SFZWindow]


Execution result of the sample code: attach a frame to a window [SFZTitleBevelFrame and SFZWindow]

Reference

SFZBevelFrame | SFYBevelFrame | SFYFlatFrame | SFYPlainFrame | SFYFrame | SFXMargin | Real Region | SFYSingleTextWidget | SFYResponder::GetSuitableMargin | Frame | SFYResponder::ToFront | SFYResponder::Terminate

Member

Constructor/Destructor
SFZTitleBevelFrame( Void )
Constructor of the SFZTitleBevelFrame class.
~SFZTitleBevelFrame( Void )
Destructor of the SFZTitleBevelFrame class.
Public Functions
AEEFont GetFont( Void )
Get the title font.
SInt16 GetFrameSize( Void )
Get the margin between the border of the header region and the title string. [pixels]
SFXBevelColorConstRef GetHeaderColor( Void )
Get the color of the header region of this frame.
HorizontalEnum GetHorizontalAlign( Void )
Get the value of horizontal alignment of the title.
DirectionEnum GetScrollDirection( Void )
Get the scroll direction of the title.
UInt32 GetScrollInterval( Void )
Get the scroll-interval of the title. [milliseconds]
SInt16 GetScrollStep( Void )
Get the scroll-step of the title. [pixels]
SFXWideStringConstRef GetText( Void )
Get the title.
SFXRGBColorConstRef GetTextColor( Void )
Get the color of the title.
VerticalEnum GetVerticalAlign( Void )
Get the value of vertical alignment of the title.
UInt32 GetWaitInterval( Void )
Get the waiting time to start to scroll the title. [milliseconds]
static
SFZTitleBevelFrameSmp
NewInstance( SFCErrorPtr exception = null )
Create a new instance of this responder class.
Void SetFont( AEEFont param )
Set the title font to the specified value.
Void SetFrameSize( SInt16 param )
Set the margin between the border of the header region and the title string to the specified value. [pixels]
Void SetHeaderColor( SFXBevelColorConstRef param )
Set the color of the header region of this frame to the specified value.
Void SetHorizontalAlign( HorizontalEnum param )
Set the horizontal alignment of the title to the specified value.
Void SetScrollDirection( DirectionEnum param )
Set the scroll direction of the title to the specified value.
Void SetScrollInterval( UInt32 param )
Set the scroll-interval of the title to the specified value. [milliseconds]
Void SetScrollStep( SInt16 param )
Set the scroll-step of the title to the specified value. [pixels]
SFCError SetText( SFXPathConstRef path , UInt16 id )
Set the title to the specified value.
SFCError SetText( SFXWideStringConstRef param )
Set the title to the specified value.
Void SetTextColor( SFXRGBColorConstRef param )
Set the color of the title to the specified value.
Void SetVerticalAlign( VerticalEnum param )
Set the vertical alignment of the title to the specified value.
Void SetWaitInterval( UInt32 param )
Set the waiting time to start to scroll the title to the specified value. [milliseconds]
Void StartScroll( Void )
Start to scroll the title.
Void StopScroll( Void )
Stop to scroll the title.
Void ClearHandler( Void ) (inherits from SFYResponder)
Unregister all handlers from this responder.
Void ClearTracer( Void ) (inherits from SFYResponder)
Unregister all dispatching rules from the tracer of this responder.
SFCError Distribute( SFXEventConstRef event , BoolPtr result = null ) (inherits from SFYResponder)
Distribute the specified event.
SFXRGBColorConstRef GetBackgroundColor( Void ) (inherits from SFYWidget)
Get the background color.
SFXBevelColorConstRef GetBevelColor( Void ) (inherits from SFYBevelFrame)
Get the bevel color of bevel frame region.
Bool GetBevelEnable( Void ) (inherits from SFYBevelFrame)
Get the value of flag indicating whether or not the bevel frame region is enabled.
SFYResponderSmp GetChildBack( Void ) (inherits from SFYResponder)
Get the backmost child responder of this responder, which matches the specified search condition.
SFYResponderSmp GetChildBack( Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the backmost child responder of this responder, which matches the specified search condition.
SFYResponderSmp GetChildBack( UInt32 id ) (inherits from SFYResponder)
Get the backmost child responder of this responder, which matches the specified search condition.
SFYResponderSmp GetChildBack( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the backmost child responder of this responder, which matches the specified search condition.
SFYResponderSmp GetChildBackward( SInt32 index ) (inherits from SFYResponder)
Get the child responder of this responder at the specified position from the back side, which matches the specified search condition.
SFYResponderSmp GetChildBackward( SInt32 index , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the child responder of this responder at the specified position from the back side, which matches the specified search condition.
SFYResponderSmp GetChildBackward( SInt32 index , UInt32 id ) (inherits from SFYResponder)
Get the child responder of this responder at the specified position from the back side, which matches the specified search condition.
SFYResponderSmp GetChildBackward( SInt32 index , UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the child responder of this responder at the specified position from the back side, which matches the specified search condition.
SInt32 GetChildCount( Void ) (inherits from SFYResponder)
Get the number of child responders of this responder, which match the specified search condition.
SInt32 GetChildCount( Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the number of child responders of this responder, which match the specified search condition.
SInt32 GetChildCount( UInt32 id ) (inherits from SFYResponder)
Get the number of child responders of this responder, which match the specified search condition.
SInt32 GetChildCount( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the number of child responders of this responder, which match the specified search condition.
SFYResponderSmp GetChildForward( SInt32 index ) (inherits from SFYResponder)
Get the child responder of this responder at the specified position from the front side, which matches the specified search condition.
SFYResponderSmp GetChildForward( SInt32 index , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the child responder of this responder at the specified position from the front side, which matches the specified search condition.
SFYResponderSmp GetChildForward( SInt32 index , UInt32 id ) (inherits from SFYResponder)
Get the child responder of this responder at the specified position from the front side, which matches the specified search condition.
SFYResponderSmp GetChildForward( SInt32 index , UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the child responder of this responder at the specified position from the front side, which matches the specified search condition.
SFYResponderSmp GetChildFront( Void ) (inherits from SFYResponder)
Get the foremost child responder of this responder, which matches the specified search condition.
SFYResponderSmp GetChildFront( Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the foremost child responder of this responder, which matches the specified search condition.
SFYResponderSmp GetChildFront( UInt32 id ) (inherits from SFYResponder)
Get the foremost child responder of this responder, which matches the specified search condition.
SFYResponderSmp GetChildFront( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the foremost child responder of this responder, which matches the specified search condition.
SFYDistributerPtr GetDistributer( Void ) (inherits from SFYResponder)
Get the distributer bound with this responder.
SFXRGBColorConstRef GetFocusColor( Void ) (inherits from SFYFlatFrame)
Get the color of flat frame region in the "focus" state.
SFYResponderSmp GetFrame( Void ) (inherits from SFYResponder)
Get the frame which has been attached to this responder.
SFXRGBColorConstRef GetFrameColor( Void ) (inherits from SFYFlatFrame)
Get the color of flat frame region in the "unfocus" state.
Bool GetFrameEnable( Void ) (inherits from SFYFlatFrame)
Get the value of flag indicating whether or not the flat frame region is enabled.
SFXRectangle GetGlobalBound( Void ) (inherits from SFYResponder)
Get the globle region of this responder.
UInt32 GetID( Void ) (inherits from SFYResponder)
Get the ID of this responder instance.
SFXRectangle GetLocalBound( Void ) (inherits from SFYResponder)
Get the local region of this responder.
SInt32 GetNthBackward( Void ) (inherits from SFYResponder)
Get the position counted from the back side of this responder among a group of sibling responders, which match the specified search condition.
SInt32 GetNthBackward( Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the position counted from the back side of this responder among a group of sibling responders, which match the specified search condition.
SInt32 GetNthBackward( UInt32 id ) (inherits from SFYResponder)
Get the position counted from the back side of this responder among a group of sibling responders, which match the specified search condition.
SInt32 GetNthBackward( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the position counted from the back side of this responder among a group of sibling responders, which match the specified search condition.
SInt32 GetNthForward( Void ) (inherits from SFYResponder)
Get the position counted from the front side of this responder among a group of sibling responders, which match the specified search condition.
SInt32 GetNthForward( Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the position counted from the front side of this responder among a group of sibling responders, which match the specified search condition.
SInt32 GetNthForward( UInt32 id ) (inherits from SFYResponder)
Get the position counted from the front side of this responder among a group of sibling responders, which match the specified search condition.
SInt32 GetNthForward( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the position counted from the front side of this responder among a group of sibling responders, which match the specified search condition.
SFYResponderSmp GetParent( Void ) (inherits from SFYResponder)
Get the parent responder of this responder.
Bool GetPropertyTransparent( Void ) (inherits from SFYResponder)
Get the transparency attribute of this responder.
SFXRectangleConstRef GetRealBound( Void ) (inherits from SFYResponder)
Get the real region of this responder.
VoidPtr GetReference( Void ) (inherits from SFYResponder)
Get the reference of this responder.
SFYRendererPtr GetRenderer( Void ) (inherits from SFYResponder)
Get the renderer bound with this responder.
SFYResponderSmp GetRoot( Void ) (inherits from SFYResponder)
Get the root responder.
SFXRGBColorConstRef GetShadowColor( Void ) (inherits from SFYPlainFrame)
Get the color of shadow region.
Bool GetShadowEnable( Void ) (inherits from SFYPlainFrame)
Get the value of flag indicating whether or not the shadow region is enabled.
Bool GetStateActive( Bool inherit = false ) (inherits from SFYResponder)
Get the active state of this responder.
Bool GetStateEnable( Bool inherit = false ) (inherits from SFYResponder)
Get the enable state of this responder.
Bool GetStateFocus( Bool inherit = false ) (inherits from SFYResponder)
Get the focus state of this responder.
Bool GetStateValid( Bool inherit = false ) (inherits from SFYResponder)
Get the valid state of this responder.
Bool GetStateVisible( Bool inherit = false ) (inherits from SFYResponder)
Get the visible state of this responder.
SFXRectangle GetSuitableBound( Void ) (inherits from SFYResponder)
Get the suitable region of this responder.
SFXRectangle GetSuitableBound( SFXRectangleConstRef rectangle ) (inherits from SFYResponder)
Get the suitable region of this responder.
SFXRectangle GetSuitableBound( SFXRectangleConstRef param , HorizontalEnum horizontal , VerticalEnum vertical ) (inherits from SFYResponder)
Get the suitable region of this responder.
SFXMargin GetSuitableMargin( Void ) (inherits from SFYResponder)
Get the suitable frame margin region of this responder.
SFCType GetType( Void ) (inherits from SFYResponder)
Get the type of this responder class.
SFXRectangleConstRef GetVirtualBound( Void ) (inherits from SFYResponder)
Get the virtual region of this responder.
Bool HasFrame( Void ) (inherits from SFYResponder)
Check whether or not this responder is a content-responder.
Void Initialize( Void ) (inherits from SFYResponder)
Initialize this responder.
Bool IsBack( Void ) (inherits from SFYResponder)
Check whether or not this responder is the backmost responder among a group of the sibling responders which match the specified search condition.
Bool IsBack( Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Check whether or not this responder is the backmost responder among a group of the sibling responders which match the specified search condition.
Bool IsBack( UInt32 id ) (inherits from SFYResponder)
Check whether or not this responder is the backmost responder among a group of the sibling responders which match the specified search condition.
Bool IsBack( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Check whether or not this responder is the backmost responder among a group of the sibling responders which match the specified search condition.
Bool IsFrame( Void ) (inherits from SFYResponder)
Check whether or not this responder is an attachment-frame.
Bool IsFront( Void ) (inherits from SFYResponder)
Check whether or not this responder is the foremost responder among a group of the sibling responders which match the specified search condition.
Bool IsFront( Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Check whether or not this responder is the foremost responder among a group of the sibling responders which match the specified search condition.
Bool IsFront( UInt32 id ) (inherits from SFYResponder)
Check whether or not this responder is the foremost responder among a group of the sibling responders which match the specified search condition.
Bool IsFront( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Check whether or not this responder is the foremost responder among a group of the sibling responders which match the specified search condition.
Bool IsNthBackward( SInt32 index ) (inherits from SFYResponder)
Check whether or not this responder is at the specified position from the back side among a group of the sibling responders which match the specified search condition.
Bool IsNthBackward( SInt32 index , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Check whether or not this responder is at the specified position from the back side among a group of the sibling responders which match the specified search condition.
Bool IsNthBackward( SInt32 index , UInt32 id ) (inherits from SFYResponder)
Check whether or not this responder is at the specified position from the back side among a group of the sibling responders which match the specified search condition.
Bool IsNthBackward( SInt32 index , UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Check whether or not this responder is at the specified position from the back side among a group of the sibling responders which match the specified search condition.
Bool IsNthForward( SInt32 index ) (inherits from SFYResponder)
Check whether or not this responder is at the specified position from the front side among a group of the sibling responders which match the specified search condition.
Bool IsNthForward( SInt32 index , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Check whether or not this responder is at the specified position from the front side among a group of the sibling responders which match the specified search condition.
Bool IsNthForward( SInt32 index , UInt32 id ) (inherits from SFYResponder)
Check whether or not this responder is at the specified position from the front side among a group of the sibling responders which match the specified search condition.
Bool IsNthForward( SInt32 index , UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Check whether or not this responder is at the specified position from the front side among a group of the sibling responders which match the specified search condition.
Bool IsRoot( Void ) (inherits from SFYResponder)
Check whether or not this responder is the root responder.
SFCError Recover( Void ) (inherits from SFYResponder)
Recover the intersection region between this responder and the responder space by using the saved bitmap to restore the device bitmap.
SFCError RegisterHandler( SFXEventRangeConstRef range , SFYHandler::RuleRecConstRef rule ) (inherits from SFYResponder)
Register specified handlers into this responder.
SFCError RegisterHandler( SFXEventRangeConstRef range , SFYHandler::HandlerSPP spp , VoidPtr reference ) (inherits from SFYResponder)
Register specified handlers into this responder.
SFCError RegisterHandler( SFXEventRangeConstPtr range , SFYHandler::RuleRecConstPtr rule , SInt32 length ) (inherits from SFYResponder)
Register specified handlers into this responder.
SFCError RegisterHandler( SFXEventRangeConstPtr range , SFYHandler::HandlerSPPConstPtr spp , VoidPtrConstPtr reference , SInt32 length ) (inherits from SFYResponder)
Register specified handlers into this responder.
SFCError RegisterTracer( SFXEventRangeConstRef range , SFYTracer::RuleRecConstRef rule ) (inherits from SFYResponder)
Register specified dispatching rules into the tracer of this responder.
SFCError RegisterTracer( SFXEventRangeConstRef range , SFYTracer::OrderEnum order , SFYTracer::StateEnum state , Bool overload ) (inherits from SFYResponder)
Register specified dispatching rules into the tracer of this responder.
SFCError RegisterTracer( SFXEventRangeConstPtr range , SFYTracer::RuleRecConstPtr rule , SInt32 length ) (inherits from SFYResponder)
Register specified dispatching rules into the tracer of this responder.
SFCError RegisterTracer( SFXEventRangeConstPtr range , SFYTracer::OrderEnumConstPtr order , SFYTracer::StateEnumConstPtr state , BoolConstPtr overload , SInt32 length ) (inherits from SFYResponder)
Register specified dispatching rules into the tracer of this responder.
SFCError Render( Bool force = false ) (inherits from SFYResponder)
Boot up the renderer for redrawing this responder and its descendant responders.
Void SetBackgroundColor( SFXRGBColorConstRef param ) (inherits from SFYWidget)
Set the background color to the specified value.
Void SetBevelColor( SFXBevelColorConstRef param ) (inherits from SFYBevelFrame)
Set the bevel color of bevel frame region to the specified value.
Void SetBevelEnable( Bool param ) (inherits from SFYBevelFrame)
Set the flag indicating whether or not the bevel frame region is enable to the specified value.
Void SetDistributer( SFYDistributerPtr param ) (inherits from SFYResponder)
Bind this responder with the specified distributer.
Void SetFocusColor( SFXRGBColorConstRef param ) (inherits from SFYFlatFrame)
Set the color of flat frame region in the "focus" state to the specified value.
SFCError SetFrame( SFYResponderSmpConstRef param ) (inherits from SFYResponder)
Attach the specified frame to this frame.
Void SetFrameColor( SFXRGBColorConstRef param ) (inherits from SFYFlatFrame)
Set the color of flat frame region in the "unfocus" state to the specified value.
Void SetFrameEnable( Bool param ) (inherits from SFYFlatFrame)
Set the flag indicating whether or not the flat frame region is enabled to the specified value.
Void SetID( UInt32 param ) (inherits from SFYResponder)
Set the ID value of this responder to the specified value.
SFCError SetParent( SFYResponderSmpConstRef param ) (inherits from SFYResponder)
Set the parent responder of this responder to the specified responder.
Void SetProperty( Bool transparent ) (inherits from SFYResponder)
Set the property of this responder to the specified value.
Void SetPropertyTransparent( Bool param ) (inherits from SFYResponder)
Set the transparency attribute of this responder to the specified value.
Void SetRealBound( SFXRectangleConstRef param ) (inherits from SFYResponder)
Set the real region of this responder to the specified region.
Void SetReference( VoidPtr param ) (inherits from SFYResponder)
Set the reference value of this responder to the specified value.
Void SetRenderer( SFYRendererPtr param ) (inherits from SFYResponder)
Bind this responder with the specified renderer.
Void SetShadowColor( SFXRGBColorConstRef param ) (inherits from SFYPlainFrame)
Set the color of shadow region to the specified value.
Void SetShadowEnable( Bool param ) (inherits from SFYPlainFrame)
Set the flag indicating whether or not the shadow region is enabled to the specified value.
Void SetState( Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Set all states of this responder to specified values together.
Void SetStateActive( Bool param ) (inherits from SFYResponder)
Set the active state of this responder to the specified value.
Void SetStateEnable( Bool param ) (inherits from SFYResponder)
Set the enable state of this responder to the specified value.
Void SetStateFocus( Bool param ) (inherits from SFYResponder)
Set the focus state of this responder to the specified value.
Void SetStateVisible( Bool param ) (inherits from SFYResponder)
Set the visible state of this responder to the specified value.
Void SetVirtualBound( SFXRectangleConstRef param ) (inherits from SFYResponder)
Set the virtual region of this responder to the specified value.
SFCError Snapshot( SFBBitmapSmpConstRef bitmap ) (inherits from SFYResponder)
Get a snapshot image of the intersection region between this responder and the responder space by using the saved bitmap.
Void Terminate( Void ) (inherits from SFYResponder)
Terminate this responder.
Void ToBack( Void ) (inherits from SFYResponder)
Move this responder to the backmost position among a group of the sibling responders which match the specified search condition.
Void ToBack( Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Move this responder to the backmost position among a group of the sibling responders which match the specified search condition.
Void ToBack( UInt32 id ) (inherits from SFYResponder)
Move this responder to the backmost position among a group of the sibling responders which match the specified search condition.
Void ToBack( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Move this responder to the backmost position among a group of the sibling responders which match the specified search condition.
Void ToFront( Void ) (inherits from SFYResponder)
Move this responder to the foremost position among a group of the sibling responders which match the specified search condition.
Void ToFront( Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Move this responder to the foremost position among a group of the sibling responders which match the specified search condition.
Void ToFront( UInt32 id ) (inherits from SFYResponder)
Move this responder to the foremost position among a group of the sibling responders which match the specified search condition.
Void ToFront( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Move this responder to the foremost position among a group of the sibling responders which match the specified search condition.
Void ToNthBackward( SInt32 index ) (inherits from SFYResponder)
Move this responder to the specified position from the back side among a group of the sibling responders which match the specified search condition.
Void ToNthBackward( SInt32 index , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Move this responder to the specified position from the back side among a group of the sibling responders which match the specified search condition.
Void ToNthBackward( SInt32 index , UInt32 id ) (inherits from SFYResponder)
Move this responder to the specified position from the back side among a group of the sibling responders which match the specified search condition.
Void ToNthBackward( SInt32 index , UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Move this responder to the specified position from the back side among a group of the sibling responders which match the specified search condition.
Void ToNthForward( SInt32 index ) (inherits from SFYResponder)
Move this responder to the specified position from the front side among a group of the sibling responders which match the specified search condition.
Void ToNthForward( SInt32 index , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Move this responder to the specified position from the front side among a group of the sibling responders which match the specified search condition.
Void ToNthForward( SInt32 index , UInt32 id ) (inherits from SFYResponder)
Move this responder to the specified position from the front side among a group of the sibling responders which match the specified search condition.
Void ToNthForward( SInt32 index , UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Move this responder to the specified position from the front side among a group of the sibling responders which match the specified search condition.
Void UnregisterHandler( SFXEventRangeConstRef range , SFYHandler::RuleRecConstRef rule ) (inherits from SFYResponder)
Unregister the handler from this responder which matches the specified condition.
Void UnregisterHandler( SFXEventRangeConstRef range , SFYHandler::HandlerSPP spp , VoidPtr reference ) (inherits from SFYResponder)
Unregister the handler from this responder which matches the specified condition.
Void UnregisterHandler( SFXEventRangeConstPtr range , SFYHandler::RuleRecConstPtr rule , SInt32 length ) (inherits from SFYResponder)
Unregister the handler from this responder which matches the specified condition.
Void UnregisterHandler( SFXEventRangeConstPtr range , SFYHandler::HandlerSPPConstPtr spp , VoidPtrConstPtr reference , SInt32 length ) (inherits from SFYResponder)
Unregister the handler from this responder which matches the specified condition.
Void UnregisterTracer( SFXEventRangeConstRef range ) (inherits from SFYResponder)
Unregister the dispatching rule from the tracer of this responder which matches the specified condition.
Void UnregisterTracer( SFXEventRangeConstPtr range , SInt32 length ) (inherits from SFYResponder)
Unregister the dispatching rule from the tracer of this responder which matches the specified condition.
T const & static_catch( Void ) (inherits from static_exception)
Get the current exception.
Protected Functions
Void DrawHeader( SFXGraphicsPtr graphics , SFXRectangleConstRef rectangle )
Draw the header region of this frame.
SFXRectangleConstRef GetHeaderBound( Void )
Get the header region of this frame.
SFYSingleTextWidgetSmpConstRef GetWidget( Void )
Get the widget which is contained internally for drawing a title.
Void HandleBoundVirtual( Void )
This function will be called when the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_VIRTUAL) event is received. [Perform the processing when the virtual region is changed.]
Void HandleMarginRequest( SFXMarginPtr margin )
This function will be called when the (SFEVT_RESPONDER_MARGIN, SFP16_MARGIN_REQUEST) event is received. [Calculate the frame margin of this responder.]
Void HandleRenderRequest( SFXGraphicsPtr graphics )
This function will be called when the (SFEVT_RESPONDER_RENDER, SFP16_RENDER_REQUEST) event is received. [Draw this responder.]
SFXRectangle DrawBevel( SFXGraphicsPtr graphics , SFXRectangleConstRef rectangle ) (inherits from SFYBevelFrame)
Draw the bevel frame region of bevel frame.
SFXRectangle DrawFrame( SFXGraphicsPtr graphics , SFXRectangleConstRef rectangle ) (inherits from SFYFlatFrame)
Draw the flat frame region of flat frame.
SFXRectangle DrawShadow( SFXGraphicsPtr graphics , SFXRectangleConstRef rectangle ) (inherits from SFYPlainFrame)
Draw the shadow region of plain frame.
static
SFYResponderSmp
Factory( SFYResponderPtr responder , SFCErrorPtr exception = null ) (inherits from SFYResponder)
This function is used to implement the NewInstance function.
SFXMarginConstRef GetBevelMargin( Void ) (inherits from SFYBevelFrame)
Get the margin of bevel frame region.
SFXMarginConstRef GetFrameMargin( Void ) (inherits from SFYFlatFrame)
Get the margin of flat frame region.
SFXMarginConstRef GetShadowMargin( Void ) (inherits from SFYPlainFrame)
Get the margin of shadow region.
SFYResponderSmp GetThis( Void ) (inherits from SFYResponder)
Get the smart pointer of this responder.
Void HandleBoundGlobal( SFXRectangleConstRef rectangle ) (inherits from SFYWidget)
This function will be called when the global region is changed.
Void HandleBoundOptimize( SFXRectanglePtr rectangle ) (inherits from SFYWidget)
This function will be called when the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_OPTIMIZE) event is received. [Calculate the suitable rectangle size of this responder within the specified hint rectangle.]
Void HandleBoundReal( Void ) (inherits from SFYFrame)
This function will be called when the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_REAL) event is received. [Perform the processing when the real region is changed.]
Void HandleBoundRequest( SFXRectanglePtr rectangle ) (inherits from SFYWidget)
This function will be called when the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_REQUEST) event is received. [Calculate the suitable rectangle size of this responder.]
Void Invalidate( Void ) (inherits from SFYResponder)
Register the specified redraw region of this responder.
Void Invalidate( SFXRectangleConstRef param ) (inherits from SFYResponder)
Register the specified redraw region of this responder.
Void InvokeBackward( SFXEventConstRef event , Bool overload , BoolPtr result = null ) (inherits from SFYResponder)
Call the handlers for the specified event from the end of the handler list registered into this responder.
Void InvokeForward( SFXEventConstRef event , Bool overload , BoolPtr result = null ) (inherits from SFYResponder)
Call the handlers for the specified event from the head of the handler list registered into this responder.
Void SetType( SFCType param ) (inherits from SFYResponder)
Set the Type value of this responder to the specified 4-character value.
Void static_throw( static_exception< T > const & param ) (inherits from static_exception)
Set an exception.
Void static_throw( T const & param ) (inherits from static_exception)
Set an exception.
Bool static_try( Void ) (inherits from static_exception)
Confirm whether or not the exception is retained.
Types
CodeEnum
Constant that represents the SFZTitleBevelFrame class.
DefaultEnum
Constants that represent the default value for various parameters.
DirectionEnum
Constants that represent the scroll direction of the title.
HorizontalEnum
Constants that represent the horizontal alignment of the title.
VerticalEnum
Constants that represent the vertical alignment of the title.

SFZTitleBevelFrame::SFZTitleBevelFrame
Constructor of the SFZTitleBevelFrame class.
[ protected, explicit ]
SFZTitleBevelFrame(Void);

Description

This constructor performs the initializations as follows:

  1. Set the type of this responder to "tbvl".
  2. Set the margin between the border of the header region and the title string to SFZTitleBevelFrame::DEFAULT_FRAME.
  3. Set the bevel color(SFXBevelColor) of the header region of this frame to the value below.
    static SFXBevelColor::AtomRecConst bevel[] = {
          {{{{0x00, 0xEE, 0xEE, 0xEE}}},     // CgJ[
          {{{0x00, 0xDD, 0xDD, 0xDD}}},      // x[XJ[
          {{{0x00, 0x88, 0x88, 0x88}}}}      // _[NJ[
    };
    
  4. Create the SFYSingleTextWidget instance which is internally contained as a child responder for drawing the title.
  5. Set the state of the SFYSingleTextWidget instance to "visible" + "active" + "disable" + "unfocus".
  6. Set the title to ""[null string].
  7. Set the color of the title to SFXRGBColor(0x00, 0x00, 0x00, 0x00)[black color]
  8. Set the title font to AEE_FONT_NORMAL.
  9. Set the horizontal alignment of the title to SFYSingleTextWidget::DEFAULT_HORIZONTAL.
  10. Set the vertical alignment of the title to SFYSingleTextWidget::DEFAULT_VERTICAL.
  11. Set the waiting time to start to scroll the title to SFYSingleTextWidget::DEFAULT_WAIT [milliseconds].
  12. Set the scroll direction of the title to SFYSingleTextWidget::DEFAULT_DIRECTION.
  13. Set the scroll-interval of the title to SFYSingleTextWidget::DEFAULT_SCROLL [milliseconds].
  14. Set the scroll-step of the title to SFYSingleTextWidget::DEFAULT_STEP [pixels].
  15. Register the event handlers in the table below into this responder.

Table 243. Event handler

Event Content of the handler
State event[SFEVT_RESPONDER_STATE] which will occur when this responder becomes focused Start to scroll the title.
State event[SFEVT_RESPONDER_STATE] which will occur when this responder becomes unfocused Stop to scroll the title.
[Note] Note
In a responder inheriting from SFZTitleBevelFrame, the corresponding handler will be called when one of the above events occurs.

Reference

SFYResponder::SetType | SFZTitleBevelFrame::CodeEnum | SFZTitleBevelFrame::SetFrameSize | SFZTitleBevelFrame::SetHeaderColor | SFZTitleBevelFrame::GetWidget | SFYResponder::SetState | SFZTitleBevelFrame::SetText | SFZTitleBevelFrame::SetTextColor | SFZTitleBevelFrame::SetFont | SFZTitleBevelFrame::SetHorizontalAlign | SFZTitleBevelFrame::SetScrollDirection | SFZTitleBevelFrame::SetScrollInterval | SFZTitleBevelFrame::SetScrollStep | SFZTitleBevelFrame::SetTextColor | SFZTitleBevelFrame::SetVerticalAlign | SFZTitleBevelFrame::SetWaitInterval | SFYSingleTextWidget::NewInstance | SFYSingleTextWidget::DirectionEnum | SFYSingleTextWidget::DefaultEnum | SFYSingleTextWidget | SFXBevelColor | SFXRGBColor Type | Type | State | Event | State Event[SFEVT_RESPONDER_STATE]


SFZTitleBevelFrame::~SFZTitleBevelFrame
Destructor of the SFZTitleBevelFrame class.
[ protected, virtual ]
virtual ~SFZTitleBevelFrame(Void);

Description

This destructor does nothing.


SFZTitleBevelFrame::DrawHeader
Draw the header region of this frame.
[ protected, const ]
Void DrawHeader(
    SFXGraphicsPtr graphics          // graphics object
    SFXRectangleConstRef rectangle   // header region
);

Description

This function fills the header region of this frame in the bevel color set with the SFZTitleBevelFrame::SetHeaderColor function.

In case you want to perform your own processing, override this function.

[Caution] Caution
In the "inactive" state, the light color and the dark color is set to the base color of bevel color.

Internal Implementation

Internal implementation of the SFZTitleBevelFrame::DrawHeader function is as follows:

/*protected */Void SFZTitleBevelFrame::DrawHeader(SFXGraphicsPtr graphics, SFXRectangleConstRef rectangle) const
{
    SFXBevelColor                               bevel;

    bevel.Set(_color.header);
    if (!GetStateActive(true)) {
        bevel.SetLight(bevel.GetBase());
        bevel.SetDark(bevel.GetBase());
    }
    graphics->FillBevelRectangle(rectangle, bevel);
    return;
}// SFZTitleBevelFrame::DrawHeader //

Reference

SFZTitleBevelFrame::SetHeaderColor | SFXBevelColor | SFXRGBColor | SFXRectangle | State


SFZTitleBevelFrame::GetFont
Get the title font.
[ public, const ]
AEEFont GetFont(Void);

Description

This function gets the title font.

Reference

SFZTitleBevelFrame::SetFont


SFZTitleBevelFrame::GetFrameSize
Get the margin between the border of the header region and the title string. [pixels]
[ public, const ]
SInt16 GetFrameSize(Void);

Return value

The margin between the border of the header region and the title string. [pixels]

Reference

SFZTitleBevelFrame::SetFrameSize


SFZTitleBevelFrame::GetHeaderBound
Get the header region of this frame.
[ protected, const ]
SFXRectangleConstRef GetHeaderBound(Void);

Return value

Header region of this frame.

Description

This function gets the header region to display title of this frame.

In case you want to perform your own processing override this virtual function.

The default implementation is as follows:

The width of the header is that of the bevel frame with a title excluded the shadow region and the flat frame region.

The height of the header is the value set with the SFZTitleBevelFrame::SetFrameSize function multiplied by 2, added by the height of the font, and added 2 pixels which is the width of the up and bottom borders of the title bevel region.

This function is called in the SFZTitleBevelFrame::HandleMarginRequest function to calculate the header region.

Figure 393. Bevel frame with a title: Expanded Figure[SFZTitleBevelFrame]


Bevel frame with a title: Expanded Figure[SFZTitleBevelFrame]

Reference

SFZTitleBevelFrame::HandleMarginRequest | SFZTitleBevelFrame::SetFrameSize


SFZTitleBevelFrame::GetHeaderColor
Get the color of the header region of this frame.
[ public, const ]
SFXBevelColorConstRef GetHeaderColor(Void);

Return value

Color of the header region of this frame(SFXRGBColor).

Reference

SFZTitleBevelFrame::SetHeaderColor | SFXBevelColor | SFXRGBColor


SFZTitleBevelFrame::GetHorizontalAlign
Get the value of horizontal alignment of the title.
[ public, const ]
HorizontalEnum GetHorizontalAlign(Void);

Return value

Value of horizontal alignment of the title.

Reference

SFZTitleBevelFrame::SetHorizontalAlign | SFZTitleBevelFrame::HorizontalEnum


SFZTitleBevelFrame::GetScrollDirection
Get the scroll direction of the title.
[ public, const ]
DirectionEnum GetScrollDirection(Void);

Reference

SFZTitleBevelFrame::SetScrollDirection


SFZTitleBevelFrame::GetScrollInterval
Get the scroll-interval of the title. [milliseconds]
[ public, const ]
UInt32 GetScrollInterval(Void);

Return value

Scroll-interval. [milliseconds]

Reference

SFZTitleBevelFrame::SetScrollInterval


SFZTitleBevelFrame::GetScrollStep
Get the scroll-step of the title. [pixels]
[ public, const ]
SInt16 GetScrollStep(Void);

Return value

Scroll-step. [pixels]

Reference

SFZTitleBevelFrame::SetScrollStep


SFZTitleBevelFrame::GetText
Get the title.
[ public, const ]
SFXWideStringConstRef GetText(Void);

Reference

SFZTitleBevelFrame::SetText


SFZTitleBevelFrame::GetTextColor
Get the color of the title.
[ public, const ]
SFXRGBColorConstRef GetTextColor(Void);

Reference

SFZTitleBevelFrame::SetTextColor | SFXRGBColor


SFZTitleBevelFrame::GetVerticalAlign
Get the value of vertical alignment of the title.
[ public, const ]
VerticalEnum GetVerticalAlign(Void);

Return value

Value of vertical alignment of the title.

Reference

SFZTitleBevelFrame::SetVerticalAlign | SFZTitleBevelFrame::VerticalEnum


SFZTitleBevelFrame::GetWaitInterval
Get the waiting time to start to scroll the title. [milliseconds]
[ public, const ]
UInt32 GetWaitInterval(Void);

Return value

Waiting time to start to scroll. [milliseconds]

Reference

SFZTitleBevelFrame::SetWaitInterval


SFZTitleBevelFrame::GetWidget
Get the widget which is contained internally for drawing a title.
[ protected, const ]
SFYSingleTextWidgetSmpConstRef GetWidget(Void);

Description

This function gets the instance of the SFYSingleTextWidget class, which is contained as a child responder internally for drawing a title.

The drawing of the single text is delegated to the SFYSingleTextWidget class.

Reference

SFYSingleTextWidget


SFZTitleBevelFrame::HandleBoundVirtual
This function will be called when the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_VIRTUAL) event is received. [Perform the processing when the virtual region is changed.]
[ protected, virtual ]
Void HandleBoundVirtual(Void);

Description

This function will be called when the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_VIRTUAL) event is received.

In case you want to perform your own processing when the virtual region is changed, override this virtual function.

The default implementation is to equalize the real region with the new local region and relocate this responder to fit into the new virtual region.

[Note] Sending the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_VIRTUAL) event

The (SFEVT_RESPONDER_BOUND, SFP16_BOUND_VIRTUAL) event will occur when the virtual region is changed by calling the SFYResponder::SetRealBound or SFYResponder::SetVirtualBound function.

[Note] Another method when the virtual region is changed

Other than overriding this virtual function, it is possible to define and implement the handler for region event[XANDLER_DECLARE_VOIDBOUND], and register it into the responder.

In the processing when the virtual region is updated, this virtual function is executed first, and next the handlers for region event are executed in the registered order.

In almost all cases, the method to override this virtual function is adopted since defining, implementing and registering the handler for region event can be omitted.

Internal Implementation

Internal implementation of the SFZTitleBevelFrame::HandleBoundVirtual function is as follows:

/*protected virtual */Void SFZTitleBevelFrame::HandleBoundVirtual(Void)
{
    Relocate();
    return;
}// SFZTitleBevelFrame::HandleBoundVirtual //

/*private */Void SFZTitleBevelFrame::Relocate(Void)
{
    SFXRectangle                                lx;

    lx.Set(GetLocalBound());
    lx.Deflate(GetShadowMargin());
    lx.Deflate(GetFrameMargin());
    lx.Deflate(GetBevelMargin());
    lx.Deflate(_frame, _frame);
    lx.SetHeight(_widget->GetFontSize().GetHeight());
    _bound.Set(lx);
    _bound.Inflate(_frame, _frame);
    _bound.Inflate(GetBevelMargin());
    _widget->SetRealBound(lx);
    return;
}// SFZTitleBevelFrame::Relocate //

Reference

SFYSingleTextWidget | SFZTitleBevelFrame::SetText | SFZTitleBevelFrame::GetHeaderBound | SFZTitleBevelFrame::SetFrameSize | SFYResponder::SetRealBound | SFYResponder::SetVirtualBound | Region Event[SFEVT_RESPONDER_BOUND] | Handler for the Region Event[XANDLER_DECLARE_VOIDBOUND] | Virtual Region | Real Region | Local Region


SFZTitleBevelFrame::HandleMarginRequest
This function will be called when the (SFEVT_RESPONDER_MARGIN, SFP16_MARGIN_REQUEST) event is received. [Calculate the frame margin of this responder.]
[ protected, virtual, const ]
Void HandleMarginRequest(
    SFXMarginPtr margin   // calculated frame margin region
);

Description

This function will be called when the margin event [SFXEvent(SFEVT_RESPONDER_MARGIN, SFP16_MARGIN_REQUEST, rectangle)] is received.

This function calculates the frame margin of this responder.

In case you want to calculate the frame margin of this responder when the margin event [SFXEvent(SFEVT_RESPONDER_MARGIN, SFP16_MARGIN_REQUEST, rectangle)] is received, override this virtual function.

In addition, this frame margin will be drawn by the SFZTitleBevelFrame::HandleRenderRequest function.

The default implementation is to calculate the frame margin which consists of a shadow region, a flat frame region, a bevel frame region and a header region.

The shadow region, the flat frame region, the bevel frame region, and the header region can be obtained by calling the SFYPlainFrame::GetShadowMargin function, the SFYFlatFrame::GetFrameMargin function, the SFYBevelFrame::GetBevelMargin function, and the SFZTitleBevelFrame::GetHeaderBound function respectively.

Figure 394. Bevel frame with a title[SFZTitleBevelFrame]


Bevel frame with a title[SFZTitleBevelFrame]

Figure 395. Bevel frame with a title: Expanded Figure[SFZTitleBevelFrame]


Bevel frame with a title: Expanded Figure[SFZTitleBevelFrame]

The height of the header region "HeaderHeight" is given as below.

HeaderHeight = FontHeight + 2 * BevelFrameWidth + 2 * FrameMarginSize

FontHeight      : height of font
BevelFrameWidth : width of bevel frame [1 pixel]
FrameMarginSize : margin of the header region set with SetFrameSize() [by default, 1 pixel]

The width of the header region "HeaderWidth" is given as below.

HeaderWidth = SFZTitleBevelFrameWidth - FlatFrameWidth - ShadowWidth

SFZTitleBevelFrameWidth : width of local region of this SFZTitleBevelFrame instance
FlatFrameWidth          : width of flat frame region [1 pixel]
ShadowWidth             : width of shadow region [1 pixel]

The background of the header region is filled in the bevel color(SFXBevelColor) set with the SFZTitleBevelFrame::SetHeaderColor function.

The top edge of the bevel frame region is positioned just under the header region.

Each width of the shadow region, the flat frame region, and the bevel frame region is 1 pixel.

[Note] Margin event[(SFEVT_RESPONDER_MARGIN, SFP16_MARGIN_REQUEST) event]

The SFYResponder::GetSuitableMargin function will send the margin event [SFXEvent(SFEVT_RESPONDER_MARGIN, SFP16_MARGIN_REQUEST, margin)] to this responder.

Then, the SFYFrame::HandleMarginRequest virtual function will be called.

The margin element (P32 parameter) of the margin event is set to SFXMargin::ZeroInstance() as an initial value.

Internal Implementation

Internal implementation of the SFZTitleBevelFrame::HandleMarginRequest function is as follows:

/*protected virtual */Void SFZTitleBevelFrame::HandleMarginRequest(SFXMarginPtr margin) const
{
    margin->Add(GetShadowMargin());
    margin->Add(GetFrameMargin());
    margin->AddTop(_bound.GetHeight());
    margin->Add(GetBevelMargin());
    return;
}// SFZTitleBevelFrame::HandleMarginRequest //

Reference

SFYResponder::GetSuitableMargin | SFYPlainFrame::GetShadowMargin | SFYFlatFrame::GetFrameMargin | SFYBevelFrame::GetBevelMargin | SFZTitleBevelFrame::GetHeaderBound | SFZTitleBevelFrame::HandleRenderRequest | SFXMargin | Margin Event[SFEVT_RESPONDER_MARGIN]


SFZTitleBevelFrame::HandleRenderRequest
This function will be called when the (SFEVT_RESPONDER_RENDER, SFP16_RENDER_REQUEST) event is received. [Draw this responder.]
[ protected, virtual, const ]
Void HandleRenderRequest(
    SFXGraphicsPtr graphics   // graphics object
);

Description

This function will be called when the (SFEVT_RESPONDER_RENDER, SFP16_RENDER_REQUEST) event is received.

In case you want to perform your own drawing of this responder, override this function.

The default implementation is to draw this responder.

[Note] The method to darw a responder

In addition to overriding this virtual function, it is possible to define and implement the handler for drawing event(drawing handler)[XANDLER_DECLARE_VOIDRENDER], and register it into the responder.

Then, the overridden virtual function will be called first, and next the drawing handlers registered into the responder will be booted up in the registered order.

In almost all cases, the method to override this function is used to draw the responder since there is no need to declare and register the drawing handler.

[Note] Procedure of drawing a responder

The drawing handler will be booted up when the drawing event(SFEVT_RESPONDER_RENDER) occurs. And then the drawing handler draw the responder actually.

The drawing event will be sent to only the responders including the region to be redrawn out of the redraw regions registered into the renderer using the SFYResponder::InvokeBackward function after the SFYResponder::Render function boots up the renderer.

Here, the SFYResponder::Render function will be called at the following situations:

  1. At the end of the event loop
  2. At the applet start / resume or the end of a highest priority event handler
  3. In the callback, which is outside the event loop.

If calling the SFYResponder::Render function with specifying "true" as an argument, the drawing event will be sent to all the responders to be actually displayed on the screen which are located below the responder in the responder tree, regardless of the registration of redraw region.

Internal Implementation

Internal implementation of the SFZTitleBevelFrame::HandleRenderRequest function is as follows:

/*protected virtual */Void SFZTitleBevelFrame::HandleRenderRequest(SFXGraphicsPtr graphics) const
{
    SFXRectangle                                lx;

    lx.Set(DrawFrame(graphics, DrawShadow(graphics, GetLocalBound())));
    DrawHeader(graphics, _bound);
    lx.AddTop(_bound.GetHeight());
    DrawBevel(graphics, lx);
    return;
}// SFZTitleBevelFrame::HandleRenderRequest //

Reference

SFYPlainFrame::DrawShadow | SFYPlainFrame::SetShadowColor | SFYFlatFrame::DrawFrame | SFYFlatFrame::SetFrameColor | SFYFlatFrame::SetFocusColor | SFZTitleBevelFrame::DrawHeader | SFZTitleBevelFrame::SetHeaderColor | SFZTitleBevelFrame::SetText | SFZTitleBevelFrame::SetHorizontalAlign | SFZTitleBevelFrame::SetVerticalAlign | SFZTitleBevelFrame::SetFont | SFZTitleBevelFrame::SetTextColor | SFYBevelFrame::DrawBevel | SFYBevelFrame::SetBevelColor | SFXBevelColor | SFYSingleTextWidget | SFYSingleTextWidget::HandleRenderRequest | SFYResponder::Invalidate | SFYResponder::Render | SFYResponder::InvokeBackward | Drawing Event[SFEVT_RESPONDER_RENDER] | Handler for the Drawing Event[XANDLER_DECLARE_VOIDRENDER] | Rendering | Event Loop | Responder Tree


SFZTitleBevelFrame::NewInstance
Create a new instance of this responder class.
[ public, static ]
SFZTitleBevelFrameSmp NewInstance(
    SFCErrorPtr exception = null   // error value
);

Argument

exception

Return the error value generated inside the function.

Return value

  • If succeeds: not null pointer
  • Otherwise: null pointer

Description

This function creates a new instance of this responder class.

If succeeds, a not null pointer will be returned, and the "exception" argument is SFERR_NO_ERROR. If fails such as insufficient memory, a null pointer will be returned, and the "exception" argument holds the error value.

Example

The code to create a new instance of this responder class is as follows:

SFZTitleBevelFrameSmp _titlebevelframe;
SFCError error;

if ((_titlebevelframe = SFZTitleBevelFrame::NewInstance(&error)) != null) {

    ...
}

SFZTitleBevelFrame::SetFont
Set the title font to the specified value.
[ public ]
Void SetFont(
    AEEFont param   // value to set
);

Description

This function sets the title font to the specified value.

Default: AEE_FONT_NORMAL

Reference

SFZTitleBevelFrame::GetFont


SFZTitleBevelFrame::SetFrameSize
Set the margin between the border of the header region and the title string to the specified value. [pixels]
[ public ]
Void SetFrameSize(
    SInt16 param   // value to set
);

Description

This function sets the margin between the border of the header region and the title string to the specified value. [pixels]

Default: 1 pixel.

[Note] Height of the header region
The value set with this function multiplied by 2 and added on the height of the font is the height of the header region.
[Caution] 1 pixel border of the header region

The 1 pixel border of the header region which is drawn in case of the bevel frame with a title is not included in this margin.

Reference

SFZTitleBevelFrame::GetFrameSize


SFZTitleBevelFrame::SetHeaderColor
Set the color of the header region of this frame to the specified value.
[ public ]
Void SetHeaderColor(
    SFXBevelColorConstRef param   // value to set
);

Description

This function sets the color of the header region of this frame to the specified value.

Default setting is as follows:

static SFXBevelColor::AtomRecConst bevel[] = {
      {{{{0x00, 0xEE, 0xEE, 0xEE}}},     // light color
      {{{0x00, 0xDD, 0xDD, 0xDD}}},      // base color
      {{{0x00, 0x88, 0x88, 0x88}}}}      // dark color
};
[Caution] Caution
In the "inactive" state, the light color and the dark color is set to the base color of bevel color.

Reference

SFZTitleBevelFrame::GetHeaderColor | SFXBevelColor | SFXRGBColor | State


SFZTitleBevelFrame::SetHorizontalAlign
Set the horizontal alignment of the title to the specified value.
[ public ]
Void SetHorizontalAlign(
    HorizontalEnum param   // value to set
);

Description

This function sets the horizontal alignment of the title to the specified value.

The title set with the SFZTitleBevelFrame::SetText function is contained internally as text widget(SFYSingleTextWidget).

Default: SFYSingleTextWidget::DEFAULT_HORIZONTAL

For the value of SFYSingleTextWidget::DEFAULT_HORIZONTAL, refer to SFYSingleTextWidget::HorizontalEnum.

Reference

SFZTitleBevelFrame::GetHorizontalAlign | SFYSingleTextWidget | SFZTitleFlatFrame::SetText | SFZTitleBevelFrame::HorizontalEnum | SFYSingleTextWidget::HorizontalEnum


SFZTitleBevelFrame::SetScrollDirection
Set the scroll direction of the title to the specified value.
[ public ]
Void SetScrollDirection(
    DirectionEnum param   // value to set
);

Description

This function sets the scroll direction of the title to the specified value.

Default: SFYSingleTextWidget::DEFAULT_DIRECTION

For the value of SFYSingleTextWidget::DEFAULT_DIRECTION, refer to SFYSingleTextWidget::DirectionEnum.

Reference

SFZTitleBevelFrame::GetScrollDirection | SFZTitleBevelFrame::DirectionEnum | SFYSingleTextWidget::DirectionEnum


SFZTitleBevelFrame::SetScrollInterval
Set the scroll-interval of the title to the specified value. [milliseconds]
[ public ]
Void SetScrollInterval(
    UInt32 param   // value to set
);

Description

This function sets the scroll-interval of the title to the specified value. [milliseconds]

Default: SFYSingleTextWidget::DEFAULT_SCROLL [milliseconds]

For the value of SFYSingleTextWidget::DEFAULT_SCROLL, refer to SFYSingleTextWidget::DefaultEnum.

Reference

SFZTitleBevelFrame::GetScrollInterval | SFZTitleBevelFrame::DefaultEnum | SFYSingleTextWidget::DefaultEnum


SFZTitleBevelFrame::SetScrollStep
Set the scroll-step of the title to the specified value. [pixels]
[ public ]
Void SetScrollStep(
    SInt16 param   // value to set
);

Description

This function sets the number of pixels of each scroll to the specified value. If "-1"(this is default value) is set, the scroll-step will be set to the width of the " " character of the currently used font.

Default: SFYSingleTextWidget::DEFAULT_STEP [pixels]

For the value of SFYSingleTextWidget::DEFAULT_STEP, refer to SFYSingleTextWidget::DefaultEnum.

Reference

SFZTitleBevelFrame::GetScrollStep | SFZTitleBevelFrame::DefaultEnum | SFYSingleTextWidget::DefaultEnum


SFZTitleBevelFrame::SetText
Set the title to the specified value.
[ public ]
SFCError SetText(
    SFXPathConstRef path   // path of resource file
    UInt16 id              // resource ID
);
[ public ]
SFCError SetText(
    SFXWideStringConstRef param   // text
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If insufficient memory: SFERR_NO_MEMORY
  • Otherwise: SFERR_FAILED

Description

This function sets the title to the specified value.

The string value is set directly in the argument, or read from the resource file.

Default: ""[null string]

Reference

SFZTitleBevelFrame::GetText | SFZTitleBevelFrame::SetHorizontalAlign | SFZTitleBevelFrame::SetVerticalAlign SFZTitleBevelFrame::SetTextColor | SFZTitleBevelFrame::SetFont


SFZTitleBevelFrame::SetTextColor
Set the color of the title to the specified value.
[ public ]
Void SetTextColor(
    SFXRGBColorConstRef param   // value to set
);

Description

This function sets the color of the title to the specified value.

Default: SFXRGBColor(0x00, 0x00, 0x00, 0x00)[black color]

In the "inactive" state, the text will be drawn in the color of which each RGB value is subtracted 0x44 from the color set with this function if the brightness of this color is greater than 0x7F. Otherwise it will be drawn in the color of which each RGB value is added 0x44 on the color set with this function.

The brightness of color can be obtained by calling the SFXRGBColor::GetBrightness function.

Reference

SFZTitleFlatFrame::GetTextColor | SFXRGBColor::GetBrightness | SFXRGBColor | State


SFZTitleBevelFrame::SetVerticalAlign
Set the vertical alignment of the title to the specified value.
[ public ]
Void SetVerticalAlign(
    VerticalEnum param   // 
);

Description

This function set the vertical alignment of the title to the specified value.

The title set with the SFZTitleBevelFrame::SetText function is internally contained as text widget(SFYSingleTextWidget).

Default: SFYSingleTextWidget::DEFAULT_VERTICAL

For the value of SFYMultipleTextWidget::DEFAULT_VERTICAL, refer to SFYMultipleTextWidget::VerticalEnum.

Reference

SFZTitleBevelFrame::GetVerticalAlign | SFYSingleTextWidget | SFZTitleFlatFrame::SetText | SFZTitleBevelFrame::VerticalEnum | SFYSingleTextWidget::VerticalEnum


SFZTitleBevelFrame::SetWaitInterval
Set the waiting time to start to scroll the title to the specified value. [milliseconds]
[ public ]
Void SetWaitInterval(
    UInt32 param   // 
);

Description

This function sets the waiting time to start to scroll the title to the specified value. [milliseconds]

Default: SFYSingleTextWidget::DEFAULT_WAIT [milliseconds]

For the value of SFYSingleTextWidget::DEFAULT_WAIT, refer to SFYSingleTextWidget::DefaultEnum.

Reference

SFZTitleBevelFrame::GetWaitInterval | SFZTitleBevelFrame::DefaultEnum | SFYSingleTextWidget::DefaultEnum


SFZTitleBevelFrame::StartScroll
Start to scroll the title.
[ public ]
Void StartScroll(Void);

Description

If the width of the text is greater than that of the virtual region, the title will start to scroll.

Otherwise, the title will not scroll.

Though the SFEVT_APP_SUSPEND event and the SFEVT_APP_RESUME event will be automatically handled, the behaviour of this function is not defined when called between the SFEVT_APP_SUSPEND event and the SFEVT_APP_RESUME event.

Reference

SFZTitleBevelFrame::StopScroll


SFZTitleBevelFrame::StopScroll
Stop to scroll the title.
[ public ]
Void StopScroll(Void);

Reference

SFZTitlePlainFrame::StartScroll


SFZTitleBevelFrame::CodeEnum
Constant that represents the SFZTitleBevelFrame class.
enum CodeEnum {
    CODE_TYPE = four_char_code('f', 't', 'b', 'l')
};
SFMTYPEDEFTYPE(CodeEnum)

Reference

SFYResponder::GetType | SFYResponder::SetType


SFZTitleBevelFrame::DefaultEnum
Constants that represent the default value for various parameters.
enum DefaultEnum {
    DEFAULT_WAIT   = SFYSingleTextWidget::DEFAULT_WAIT,    // waiting time to start the scroll [milliseconds]
    DEFAULT_SCROLL = SFYSingleTextWidget::DEFAULT_SCROLL,  // scroll-interval [milliseconds]
    DEFAULT_STEP   = SFYSingleTextWidget::DEFAULT_STEP     // scroll-step [pixels]
};
SFMTYPEDEFTYPE(DefaultEnum)

Reference

SFYSingleTextWidget::DefaultEnum


SFZTitleBevelFrame::DirectionEnum
Constants that represent the scroll direction of the title.
enum DirectionEnum {
    DIRECTION_LEFT    = SFYSingleTextWidget::DIRECTION_LEFT,    // scroll left
    DIRECTION_RIGHT   = SFYSingleTextWidget::DIRECTION_RIGHT,   // scroll right
    DEFAULT_DIRECTION = SFYSingleTextWidget::DEFAULT_DIRECTION  // Default: scroll left
};
SFMTYPEDEFTYPE(DirectionEnum)

Reference

SFYSingleTextWidget::DirectionEnum


SFZTitleBevelFrame::HorizontalEnum
Constants that represent the horizontal alignment of the title.
enum HorizontalEnum {
    HORIZONTAL_LEFT    = SFYSingleTextWidget::HORIZONTAL_LEFT,   // left-aligned
    HORIZONTAL_CENTER  = SFYSingleTextWidget::HORIZONTAL_CENTER, // center-aligned
    HORIZONTAL_RIGHT   = SFYSingleTextWidget::HORIZONTAL_RIGHT,  // right-aligned
    DEFAULT_HORIZONTAL = SFYSingleTextWidget::DEFAULT_HORIZONTAL // default: center-aligned
};
SFMTYPEDEFTYPE(HorizontalEnum)

Reference

SFYSingleTextWidget::HorizontalEnum


SFZTitleBevelFrame::VerticalEnum
Constants that represent the vertical alignment of the title.
enum VerticalEnum {
    VERTICAL_TOP     = SFYSingleTextWidget::VERTICAL_TOP,     // top-aligned
    VERTICAL_MIDDLE  = SFYSingleTextWidget::VERTICAL_MIDDLE,  // center-aligned
    VERTICAL_BOTTOM  = SFYSingleTextWidget::VERTICAL_BOTTOM,  // bottom-aligned
    DEFAULT_VERTICAL = SFYSingleTextWidget::DEFAULT_VERTICAL  // default: center-aligned
};
SFMTYPEDEFTYPE(VerticalEnum)

Reference

SFYSingleTextWidget::VerticalEnum