SophiaFramework UNIVERSE 5.3 |
#include <SFZTabControl.h.hpp>
class SFZTabControl : public SFYTabControl;
SFMTYPEDEFRESPONDER(SFZTabControl)
How to use
Tab control(SFZTabControl) represents a control to manage and display the tab pages(SFZTabPage) using the tabbed user interface.
The content of each tab in the tab control is managed by the tab page(SFZTabPage).
The real region of tab control is set with the SFYResponder::SetRealBound function.
The real region of the tab page is automatically set immediately after the tab control is set to its parent responder using the SFYResponder::SetParent function
The appearance of the tab control can be set by using its various functions.
A text and/or an image can be drawn on the tab region as title of the tab page.
The focus behaviour of the tab depends on the state of the corresponding tab page. For more details, refer to the SFYTabControl class.
The minimum value, the maximum value, the current value, the field value, and the top value inherit from those of the SFYTabControl class.
Limitation on specification | |
---|---|
When the child responder of the tab control is set to the responder other than the SFZTabPage class or the descendant class, the behaviour is not defined. The minimum value, the maximum value, and the current value must not be changed using the SFYControl::SetMinimumValue function, the SFYControl::SetMaximumValue function, and the SFYControl::SetCurrentValue function respectively. |
The below is the layout of SFZTabControl.
The code to create the tab control with five tab pages is as follows:
Void UserAppClass::Main(Void) { SFBShellSmp shell = SFBShell::GetInstance(); SFBImageSmp image; SFCError error(SFERR_NO_ERROR); // create the window SFZWindowSmp window = SFZWindow::NewInstance(); // set window's parent to UserAppClass window->SetParent(GetThis()); // set window's real region to UserAppClass's local region window->SetRealBound(GetLocalBound()); // set the window's state to "visible" + "active" + "enable" + "focus" together window->SetState(true, true, true, true); // [Required] create tab control SFZTabControlSmp tab = SFZTabControl::NewInstance(&error); // [Required] set tab control's parent to window tab->SetParent(window); // [Required] set tab control's real region to window's local region tab->SetRealBound(window->GetLocalBound()); // [Optional] set tab control's background color to light green color tab->SetBackgroundColor(SFXRGBColor(0xDD, 0xFF, 0xDD, 0x00)); // [Required] set "visible" + "active" + "enable" + "focus" to tab control's state together tab->SetState(true, true, true, true); // [Required] create tab page SFZTabPageSmp pageA = SFZTabPage::NewInstance(&error); SFZTabPageSmp pageB = SFZTabPage::NewInstance(&error); SFZTabPageSmp pageC = SFZTabPage::NewInstance(&error); SFZTabPageSmp pageD = SFZTabPage::NewInstance(&error); SFZTabPageSmp pageE = SFZTabPage::NewInstance(&error); // [Required] set tab pages's parent to tab control // (tabs are displayed in the order to set their parent ) pageA->SetParent(tab); pageB->SetParent(tab); pageC->SetParent(tab); pageD->SetParent(tab); pageE->SetParent(tab); // [Optional] set tab page's title(text) pageA->SetTitle("A"); pageB->SetTitle("B"); pageC->SetTitle("C"); pageD->SetTitle("D"); pageE->SetTitle("E"); // [Optional] set tab page's title(image) image = shell->LoadResImage(SAMPLETAB_RES_FILE, IDI_OBJECT_5001); pageA->SetImage(image); image = shell->LoadResImage(SAMPLETAB_RES_FILE, IDI_OBJECT_5002); pageB->SetImage(image); image = shell->LoadResImage(SAMPLETAB_RES_FILE, IDI_OBJECT_5003); pageD->SetImage(image); image = shell->LoadResImage(SAMPLETAB_RES_FILE, IDI_OBJECT_5004); pageE->SetImage(image); // [Optional] set tab control's hint pageA->SetHint("Display the button A."); pageB->SetHint("Will not be displayed in the tab."); pageC->SetHint("Can not select."); pageD->SetHint("Display the button D."); pageE->SetHint("Display the button E."); // [Required] set state of each page // (in the settings below, page B will not be displayed and page C is unselectable) pageA->SetState(true, true, true, false); // "enable" state pageB->SetState(true, false, false, false); // "inactive" state pageC->SetState(false, false, false, false); // "invisible" state pageD->SetState(true, true, true, false); // "enable" state pageE->SetState(true, true, true, false); // "enable" state // [Optional] set items in each page SFZTextButtonControlSmp buttonA = SFZTextButtonControl::NewInstance(); SFZTextButtonControlSmp buttonD = SFZTextButtonControl::NewInstance(); SFZTextButtonControlSmp buttonE = SFZTextButtonControl::NewInstance(); buttonA->SetParent(pageA); buttonD->SetParent(pageD); buttonE->SetParent(pageE); buttonA->SetText("Button A"); buttonD->SetText("Button D"); buttonE->SetText("Button E"); buttonA->SetRealBound(SFXRectangle(70, 0, 100, 25)); buttonD->SetRealBound(SFXRectangle(70, 150, 100, 25)); buttonE->SetRealBound(SFXRectangle(70, 250, 100, 25)); buttonA->SetState(true, true, true, true); buttonD->SetState(true, true, true, true); buttonE->SetState(true, true, true, true); // [Optional] set number of pages to be displayed at the same time in tab control region to 4 tab->SetFieldValue(4); // [Optional] draw border of tab control tab->SetDrawBorder(true); // [Optional] set scroll bar's width to 7 pixels tab->SetScrollBarWidth(7); // [Optional] set tab control's padding to 3 pixels (integer value more than 0 or 0 can be set) tab->SetPadding(4); // [Recommended] select page of "pageD" ("pageD" will be moved foremost and displayed ) tab->FocusPage(3); // method below to move tab page foremost is prohibited // since there is possibility that selected tab may not match tab page placed foremost currently // NG: pageD->ToFront(); return; }
Execution Result:
Moving the tab page foremost | |
---|---|
To move the tab page foremost among tab pages in the tab control, call the SFYTabControl::FocusPage function by specifying its index as an argument. Since there is a possibility that the selected tab may not match the tab page placed foremost currently, it is prohibited to call the tab page's functions such as SFYResponder::ToFront or SFYResponder::SetStateFocus which may chage the order relation of the tab pages. |
Tab Control and Tab Page [SFZTabControl] | Real Region | SFYControl | SFYTabControl | SFZTabPage | SFYResponder::SetRealBound
Constructor/Destructor |
---|
SFZTabControl( Void ) Constructor of the SFZTabControl class.
|
~SFZTabControl( Void ) Destructor of the SFZTabControl class.
|
Public Functions | |
---|---|
SFXRGBColorConstRef |
GetArrowColor( Void )
Get the color of left and right arrows of this tab control.
|
SFXRGBColorConstRef |
GetFocusTabTopEdgeColor( Void ) Get the color of upper border of currently selected tab of this tab control.
|
Bool |
GetFocusTabTopEdgeEnable( Void )
Get the value of enable flag of the upper border of currently selected tab of this tab control.
|
AEEFont |
GetFont( Void )
Get the font of this tab control, which is used for the title of the tab page and the hint text.
|
SFXBevelColorConstRef |
GetHintBevelColor( Void )
Get the bevel color of hint region of this tab control.
|
SInt16 |
GetHintHeight( Void ) Get the height of the hint region of this tab control. [pixels]
|
SInt16 |
GetPadding( Void )
Get the padding size of this tab control. [pixels]
|
SFZTabPageSmp |
GetPage(
SInt16 index
)
Get the page of this tab control, of which index is specified in the argument.
|
SFXBevelColorConstRef |
GetTabBevelColor( Void )
Get the bevel color of tab region of this tab control.
|
SInt16 |
GetTabHeight( Void )
Get the height of the tab region to draw the title of the tab page of this tab control. [pixels]
|
static SFZTabControlSmp |
NewInstance(
SFCErrorPtr exception = null
) Create a new instance of this responder class.
|
Void |
SetArrowColor(
SFXRGBColorConstRef param
)
Set the color of left and right arrows of this tab control to the specified value.
|
Void |
SetDrawBorder(
Bool param
)
Set the draw-border flag indicating whether or not to draw the border of this tab control to the specified value.
|
Void |
SetFocusTabTopEdgeColor(
SFXRGBColorConstRef param
)
Set the color of upper border of currently selected tab of this tab control to the specified value.
|
Void |
SetFocusTabTopEdgeEnable(
Bool param
)
Set the enable flag of the upper border of currently selected tab of this tab control to the specified value.
|
Void |
SetFont(
AEEFont param
)
Set the font this tab control to the specified value, which is used for the title of the tab page and the hint text.
|
Void |
SetHintBevelColor(
SFXBevelColorConstRef param
)
Set the bevel color of hint region of this tab control to the specified value.
|
Void |
SetHintHeight(
SInt16 param
)
Set the height of the hint region of this tab control to the specified value. [pixels]
|
Void |
SetPadding(
SInt16 param
)
Set the padding size of this tab control to the specified value. [pixels]
|
Void |
SetTabBevelColor(
SFXBevelColorConstRef param
)
Set the bevel color of tab region of this tab control to the specified value.
|
Void |
SetTabHeight(
SInt16 param
)
Set the height of the tab region to draw the title of the tab page of this tab control to the specified value. [pixels]
|
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.
|
SInt32 |
FirstIndexOf(
Bool visible
, Bool active
, Bool enable
)
(inherits from SFYTabControl)
Get the first index among the pages(or containers) of this tab control, which match the specified condition.
|
Void |
FocusLeft( Void )
(inherits from SFYTabControl)
Move the focus to the tab page next left to the currently focused page of this tab control.
|
SFCError |
FocusPage(
SInt32 index
)
(inherits from SFYTabControl)
Move the focus to the specified tab page(or container) of this tab control.
|
Void |
FocusRight( Void )
(inherits from SFYTabControl)
Move the focus to the tab page next right to the currently focused page of this tab control.
|
SFXRGBColorConstRef |
GetBackgroundColor( Void )
(inherits from SFYWidget)
Get the background color.
|
SInt32 |
GetBottomValue( Void )
(inherits from SFYTabControl)
Get the index of the last page on the right side which is currently displayed on this tab control.
|
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.
|
SFXRectangleConstRef |
GetContentBound( Void )
(inherits from SFYTabControl)
Get the real region of page(or container) which will be set for this tab control.
|
SInt32 |
GetCurrentValue( Void )
(inherits from SFYControl)
Get the current value of this control.
|
SFYDistributerPtr |
GetDistributer( Void )
(inherits from SFYResponder)
Get the distributer bound with this responder.
|
SInt32 |
GetFieldValue( Void )
(inherits from SFYTabControl)
Get the number of tab pages which is displayed at the same time in this tab control.
|
AVKType |
GetFocusLeftKey( Void )
(inherits from SFYTabControl)
Get the key with which the focus is moved to the page(or container) left
next to the currently focused page(or container) of this tab control.
|
AVKType |
GetFocusRightKey( Void )
(inherits from SFYTabControl)
Get the key with which the focus is moved to the page(or container) right
next to the currently focused page(or container) of this tab control.
|
SFYResponderSmp |
GetFrame( Void )
(inherits from SFYResponder)
Get the frame which has been attached to this responder.
|
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.
|
SInt32 |
GetIndex(
SFYContainerSmpConstRef tabpage
)
(inherits from SFYTabControl)
Get the index of the specified page(or container) of this tab control.
|
SFXRectangle |
GetLocalBound( Void )
(inherits from SFYResponder)
Get the local region of this responder.
|
SInt32 |
GetMaximumValue( Void )
(inherits from SFYTabControl)
[DEPRECATED]Get the number of all pages(or containers) of this tab control.
[Discontinued in the near future. Use the GetPageCount function instead.]
|
SInt32 |
GetMinimumValue( Void )
(inherits from SFYControl)
Get the minimum value of this control.
|
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.
|
SInt32 |
GetPageCount( Void )
(inherits from SFYTabControl)
Get the number of pages(or containers) of this tab control which match the specified condition.
|
SInt32 |
GetPageCount(
Bool visible
, Bool active
, Bool enable
)
(inherits from SFYTabControl)
Get the number of pages(or containers) of this tab control which match the specified 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 |
GetSafePageBackgroundColor( Void )
(inherits from SFYTabControl)
Get the background color of
the safe page of this tab control,
which will be displayed when the specified page does not exist or is invalid.
|
SFYScrollBarControlSmpConstRef |
GetScrollBarControl( Void )
(inherits from SFYTabControl)
Get the scroll bar control which is internally used by this tab control.
|
SInt16 |
GetScrollBarWidth( Void )
(inherits from SFYTabControl)
Get the width of the scroll bar control which is internally used by this tab control. [pixels]
|
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.
|
Bool |
GetTabLoop( Void )
(inherits from SFYTabControl)
Get the value of tab-loop flag
indicating whether or not the focus at the first or last page can be moved to the last or first page respectively.
|
SInt32 |
GetTopValue( Void )
(inherits from SFYTabControl)
Get the index of the first page on the left side which is currently displayed on this tab control.
|
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.
|
SInt32 |
LastIndexOf(
Bool visible
, Bool active
, Bool enable
)
(inherits from SFYTabControl)
Get the last index among the pages(or containers) of this tab control
which match the specified condition.
|
SInt32 |
NextIndexOf(
SInt32 index
, Bool visible
, Bool active
, Bool enable
)
(inherits from SFYTabControl)
Get the next index of the specified index among the pages of this tab control
which match the specified condition.
|
SInt32 |
PrevIndexOf(
SInt32 index
, Bool visible
, Bool active
, Bool enable
)
(inherits from SFYTabControl)
Get the previous index of the specified index among the pages of this tab control
which match the specified condition.
|
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 |
SetCurrentValue(
SInt32 param
)
(inherits from SFYControl)
Set the current value of this control to the specified value.
|
Void |
SetDistributer(
SFYDistributerPtr param
)
(inherits from SFYResponder)
Bind this responder with the specified distributer.
|
Void |
SetFieldValue(
SInt32 param
)
(inherits from SFYTabControl)
Set the number of the tab pages which is displayed at the same time in this tab control to the specified value.
|
Void |
SetFocusLeftKey(
AVKType param
)
(inherits from SFYTabControl)
Set the key with which the focus is moved to the page(or container) left
next to the currently focused page(or container) of this tab control to the specified value.
|
Void |
SetFocusRightKey(
AVKType param
)
(inherits from SFYTabControl)
Set the key with which the focus is moved to the page(or container) right
next to the currently focused page(or container) of this tab control to the specified value.
|
SFCError |
SetFrame(
SFYResponderSmpConstRef param
)
(inherits from SFYResponder)
Attach the specified frame to this frame.
|
Void |
SetID(
UInt32 param
)
(inherits from SFYResponder)
Set the ID value of this responder to the specified value.
|
Void |
SetMaximumValue(
SInt32 param
)
(inherits from SFYControl)
Set the maximum value of the control to the specified value.
|
Void |
SetMinimumValue(
SInt32 param
)
(inherits from SFYControl)
Set the minimum value of the control 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 |
SetSafePageBackgroundColor(
SFXRGBColorConstRef param
)
(inherits from SFYTabControl)
Set the background color of
the safe page of this tab control to the specified value,
which will be displayed when the specified page does not exist or is invalid.
|
SFCError |
SetScrollBarControl(
SFYScrollBarControlSmpConstRef param
)
(inherits from SFYTabControl)
Set the scroll bar control which is internally used by this tab control to the specified value.
|
Void |
SetScrollBarWidth(
SInt16 param
)
(inherits from SFYTabControl)
Set the width of the scroll bar control to the specified value, which is internally used by this tab control. [pixels]
|
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 |
SetTabLoop(
Bool param
)
(inherits from SFYTabControl)
Set the tab-loop flag showing
whether or not the focus at the first or last page can be moved to the last or first page respectively 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 |
HandleBoundReal( Void )
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 |
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 |
HandleRenderRequest(
SFXGraphicsPtr graphics
)
This function will be called when the (SFEVT_RESPONDER_RENDER, SFP16_RENDER_REQUEST) event is received.
[Draw this responder.]
|
Void |
AdjustPages( Void )
(inherits from SFYTabControl)
Adjust the real region and the virtual region of all the pages of this tab control.
|
static SFYResponderSmp |
Factory(
SFYResponderPtr responder
, SFCErrorPtr exception = null
)
(inherits from SFYResponder)
This function is used to implement the NewInstance function.
|
SFYContainerSmpConstRef |
GetSafePage( Void )
(inherits from SFYTabControl)
Get the safe page of this tab control
which will be displayed when the specified page does not exist or is invalid.
|
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 |
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 |
SetContentBound(
SFXRectangleConstRef rectangle
)
(inherits from SFYTabControl)
Set the real region of page(or container) which will be set for this tab control to the specified value.
|
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 SFZTabControl class.
|
HorizontalEnum
(inherits from SFYResponder)
Constants that represent the horizontal alignment.
|
VerticalEnum
(inherits from SFYResponder)
Constants that represent the vertical alignment.
|
[ protected, explicit ] SFZTabControl(Void);
This constructor performs the initializations as follows:
SFYResponder::SetType | SFZTabControl::CodeEnum | SFZTabControl::SetTabBevelColor | SFZTabControl::SetHintBevelColor | SFZTabControl::SetArrowColor | SFZTabControl::SetFocusTabTopEdgeColor | SFZTabControl::SetFont | SFZTabControl::SetTabHeight | SFZTabControl::SetHintHeight | SFZTabControl::SetPadding | SFZTabControl::SetDrawBorder | SFZTabControl::SetFocusTabTopEdgeEnable | SFXBevelColor | SFXRGBColor | Type
[ protected, virtual ] virtual ~SFZTabControl(Void);
This destructor does nothing.
[ public, const ] SFXRGBColorConstRef GetArrowColor(Void);
Color(SFXRGBColor) of left and right arrows of this tab control.
This function gets the color(SFXRGBColor) of left and right arrows(or triangles) of this tab control.
[ public, const ] SFXRGBColorConstRef GetFocusTabTopEdgeColor(Void);
This function gets the color of upper border of currently selected tab of this tab control.
This border will not be drawn when this tab control is in the "unfocus" state or set to "false" using the SFZTabControl::SetFocusTabTopEdgeEnable function.
SFZTabControl::SetFocusTabTopEdgeColor | SFZTabControl::SetFocusTabTopEdgeEnable | SFXRGBColor
[ public, const ] Bool GetFocusTabTopEdgeEnable(Void);
If the upper border is valid, "true" will be returned. Otherwise, "false" will be returned.
This function gets the value of enable flag of the upper border of currently selected tab of this tab control.
This border will be drawn in the color set with the SFZTabControl::SetFocusTabTopEdgeColor function only when the return value of this function is "true".
[ public, const ] AEEFont GetFont(Void);
Font of this tab control, which is used for the title of the tab page and the hint text.
This function gets the font of this tab control, which is used for the title of the tab page and the hint text.
[ public, const ] SFXBevelColorConstRef GetHintBevelColor(Void);
Bevel color(SFXBevelColor) of rectangular region to draw a hint text.
This function gets the bevel color(SFXBevelColor) of the rectangular region to draw a hint text of this tab control.
[ public, const ] SInt16 GetHintHeight(Void);
Height of the rectangular region to draw a hint text. [pixels]
This function gets the height of the rectangular region to draw a hint text of this tab control. [pixels]
[ public, const ] SInt16 GetPadding(Void);
Amount of space (padding) between two consecutive tab regions of the tab control.
This function gets the padding size of this tab control, which is space between two consecutive tab regions to draw the title of the tab page. [pixels]
This padding area is filled in the color set with the SFYWidget::SetBackgroundColor function.
[ public, const ] SFZTabPageSmp GetPage( SInt16 index // index of page );
Page of this tab control, of which index is specified in the argument.
If such a page does not exist, SFZTabPageSmp::EmptyInstance() will be returned.
[ public, const ] SFXBevelColorConstRef GetTabBevelColor(Void);
Bevel color(SFXBevelColor) of the tab region, which corresponds to the tab page in the "active" state of this tab control.
This function gets the bevel color of tab region, which corresponds to the tab page in the "active" state of this tab control.
The bevel color of the tab region corresponding to the tab page in the "inactive" state is automatically set based on the color set with this function.
[ public, const ] SInt16 GetTabHeight(Void);
Height of the tab region to draw the title of the tab page of this tab control. [pixels]
This function gets the height of the tab region to draw the title of the tab page of this tab control. [pixels]
[ protected, virtual ] Void HandleBoundReal(Void);
This function will be called when the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_REAL) event is received.
In the default implementation, the position and the size of all components of the tab control are re-calculated, the real region, virtual region and the srcoll bar (if any) of asscociated tab pages are reset, and tab control is redrawn.
You may overide this function to perform your own processing.
Sending the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_REAL) event | |
---|---|
The (SFEVT_RESPONDER_BOUND, SFP16_BOUND_REAL) event will occur when the real region is changed by calling the SFYResponder::SetRealBound function. |
Processing when the real region is changed | |
---|---|
Other than overriding this virtual function, there is another method to define and implement the handler for the region event[XANDLER_DECLARE_VOIDBOUND], and register it into the responder. In the processing when the real region is updated, this virtual function is executed first, and next the handlers for the 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 the region event can be omitted. |
Internal implementation of the SFZTabControl::HandleBoundReal function is as follows:
/*protected virtual */Void SFZTabControl::HandleBoundReal(Void) { SetVirtualBound(SFXRectangle(SFXGrid::ZeroInstance(), GetRealBound().GetSize())); Relocate(); Invalidate(); return; }// SFZTabControl::HandleBoundReal // /*private */Void SFZTabControl::Relocate() { SFXRectangle lx; SFXRectangle content; SFYScrollBarControlSmp bar; lx.Set(GetLocalBound()); _rcHint.Set(SFXGrid::ZeroInstance(), SFXSize(lx.GetWidth(), _hintHeight)); _rcTabs.Set(_rcHint.GetLeftBottom(), SFXSize(lx.GetWidth(), _tabHeight)); _rcBody.Set(lx).SetTop(_rcTabs.GetBottom()); content.Set(_rcBody); if (_border) { content.Deflate(TAB_BORDER_WIDTH, 0, TAB_BORDER_WIDTH, TAB_BORDER_WIDTH); } if ((bar = GetScrollBarControl()) != null) { if (bar->GetStateVisible()) { content.SubWidth(GetScrollBarWidth()); bar->SetRealBound(SFXRectangle(content.GetRight(), content.GetY(), GetScrollBarWidth(), content.GetHeight())); } } SetContentBound(content); return; }// SFZTabControl::Relocate //
SFYResponder::SetRealBound | Region Event[SFEVT_RESPONDER_BOUND] | Handler for the Region Event[XANDLER_DECLARE_VOIDBOUND] | Real Region | Virtual Region | Local Region
[ protected, virtual ] Void HandleBoundVirtual(Void);
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.
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. |
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 of the SFZTabControl::HandleBoundVirtual function is as follows:
/*protected virtual */Void SFZTabControl::HandleBoundVirtual(Void) { SetVirtualBound(SFXRectangle(SFXGrid::ZeroInstance(), GetRealBound().GetSize())); return; }// SFZTabControl::HandleBoundVirtual //
SFYResponder::SetRealBound | SFYResponder::SetVirtualBound | Region Event[SFEVT_RESPONDER_BOUND] | Handler for the Region Event[XANDLER_DECLARE_VOIDBOUND] | Virtual Region | Real Region | Local Region
[ protected, virtual, const ] Void HandleRenderRequest( SFXGraphicsPtr graphics // graphic object );
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.
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. |
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:
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 of the SFZTabControl::HandleRenderRequest function is as follows:
/*protected virtual */Void SFZTabControl::HandleRenderRequest(SFXGraphicsPtr graphics) const { DrawAllTab(graphics); if (_border) { DrawBorder(graphics); } return; }// SFZTabControl::HandleRenderRequest // /*private */Void SFZTabControl::DrawAllTab(SFXGraphicsPtr graphics) const { SFXRectangle rAllTab; SFXRectangle rBase; SFXRectangle rLeft; SFXRectangle rRight; SFXRectangle r1; SInt32 visPageNum; SInt16 oneTabWidth; SInt16 arrow; if (_hintHeight > 0) { SFXBevelColor cHint; cHint.Set(_color.hintBevel); if (!GetStateActive(true)) { (cHint.GetBase().GetBrightness() > 0x7F) ? cHint.SubRGB(OFFSET_INACTIVE) : cHint.AddRGB(OFFSET_INACTIVE); } graphics->FillBevelRectangle(_rcHint, cHint); } rAllTab.Set(_rcTabs); rAllTab.SubHeight(TAB_BASE_HEIGHT); rBase.Set(_rcTabs); rBase.SetTop(rAllTab.GetBottom()); graphics->FillBevelRectangle(rBase, _color.tabBevel); if (GetFieldValue() > 0) { if ((visPageNum = GetPageCount(true, false, false)) > GetFieldValue()) { arrow = SFXGraphics::MeasureSingleText(_font, "<"); rLeft.Set(rAllTab); rLeft.SetWidth(arrow); rRight.Set(rLeft); rRight.AddX(rAllTab.GetWidth() - rLeft.GetWidth()); rAllTab.Deflate(arrow, 0); if (GetTabLoop() || GetTopValue() > FirstIndexOf(true, false, false)) { DrawLeftTriangle(graphics, rLeft); } if (GetTabLoop() || GetBottomValue() < LastIndexOf(true, false, false)) { DrawRightTriangle(graphics, rRight); } } oneTabWidth = static_cast<SInt16>((rAllTab.GetWidth() - (GetFieldValue() + 1) * _padding) / GetFieldValue()); r1.Set(rAllTab); r1.SetWidth(oneTabWidth); if (visPageNum > 0) { SFXRectangle cx; SInt32 i; SInt32 k; SInt32 offsetNum; if (visPageNum >= GetFieldValue()) { offsetNum = GetFieldValue() - 1; } else { offsetNum = visPageNum - 1; } r1.AddX(static_cast<SInt16>(offsetNum * (oneTabWidth + _padding))); for (i = 0, k = GetBottomValue(); i < GetFieldValue(); ++i) { if (k >= 0 && k >= GetTopValue()) { if (k != GetCurrentValue()) { DrawOneTab(graphics, r1, k); } else { cx.Set(r1); } r1.SubX(oneTabWidth + _padding); k = PrevIndexOf(k, true, false, false); } else { break; } } if (GetTopValue() <= GetCurrentValue() && GetCurrentValue() <= GetBottomValue()) { DrawOneTab(graphics, cx, GetCurrentValue()); } } else { DrawOneTab(graphics, r1, -1); } } return; }// SFZTabControl::DrawAllTab // /*private */Void SFZTabControl::DrawOneTab(SFXGraphicsPtr graphics, SFXRectangleConstRef rectangle, SInt32 index) const { SFXRectangle rOne; SFXTriangle triPiece; SFXBevelColor cBevel; SFZTabPageSmp page; UInt08 diffBevel; Bool visible; Bool active; page = GetPage(index); if (page != null || index == -1) { if (page != null) { visible = page->GetStateVisible(); active = page->GetStateActive(); } else { visible = true; active = false; } rOne.Set(rectangle); cBevel.Set(_color.tabBevel); diffBevel = 0; if (index != GetCurrentValue()) { diffBevel = OFFSET_SELECT; } if (!active) { diffBevel = OFFSET_INACTIVE; } (cBevel.GetBase().GetBrightness() > 0x7F) ? cBevel.SubRGB(diffBevel) : cBevel.AddRGB(diffBevel); if (index == GetCurrentValue()) { rOne.AddHeight(1); } triPiece.Set(rOne.GetRightTop().GetLeftTop(), rOne.GetRightBottom().GetLeftTop(), (rOne.GetRightBottom().AddX(_padding * 2)).GetLeftTop()); graphics->FillTriangle(triPiece, cBevel.GetBase()); graphics->DrawLine(SFXLine(triPiece.GetFirst(), triPiece.GetThird()), cBevel.GetDark()); graphics->FillBevel(rOne, cBevel, true, true, _padding == 0, false); if (index == GetCurrentValue()) { if (GetStateFocus(true) && GetFocusTabTopEdgeEnable()) { graphics->DrawLine(SFXLine(rOne.GetEdgeTop()).Offset(0, 1).AddStartX(1).SubEndX(1), _color.edge); } rOne.AddHeight(TAB_BASE_HEIGHT - 1); } if (index != -1 && page != null) { SFXRectangle rImage; SFXRectangle rText; SFXWideStringConstRef title(page->GetTitle()); SFBImageSmp image(page->GetImage()); SFXWideStringConstRef hint(page->GetHint()); SFXRGBColor cText; cText.Set(page->GetTextColor()); if (!page->GetStateActive(true)) { (cText.GetBrightness() > 0x7F) ? cText.SubRGB(OFFSET_INACTIVE) : cText.AddRGB(OFFSET_INACTIVE); } rText.Set(rOne); if (image != null) { AEEImageInfo info; SInt16 dx; SInt16 dy; rImage.Set(rOne.GetOrigin(), SFXSize(rOne.GetHeight(), rOne.GetHeight())); if (title.IsEmpty()) { rImage.AddX((rOne.GetWidth() - rImage.GetWidth()) / 2); } else { rText.AddLeft(rImage.GetWidth()); } image->GetInfo(&info); if (info.cx > 0 && info.cy > 0) { dx = (rImage.GetWidth() - info.cx) / 2; dy = (rImage.GetHeight() - info.cy) / 2; rImage.SetSize(info.cx, info.cy); graphics->DrawImage(image, rImage.GetOrigin() + SFXGrid(dx, dy)); } } graphics->SetFont(_font); rText.AddY(graphics->GetFontDescent() / 2); graphics->DrawSingleText(title, rText, cText, IDF_ALIGN_CENTER); if (index == GetCurrentValue() && _hintHeight > 0) { rText.Set(_rcHint); graphics->SetFont(_font); rText.AddY(graphics->GetFontDescent() / 2); graphics->DrawSingleText(hint, rText, cText, IDF_ALIGN_CENTER); } } } return; }// SFZTabControl::DrawOneTab // /*private */ Void SFZTabControl::DrawLeftTriangle(SFXGraphicsPtr graphics, SFXRectangleConstRef rectangle) const { SFXRGBColor color(_color.arrow); SInt16 w(rectangle.GetWidth() / 4); SInt16 h(w * 2); SInt16 x(rectangle.GetX() + (rectangle.GetWidth() - w) / 2); SInt16 y(rectangle.GetY() + (rectangle.GetHeight() - h) / 2); if (!GetStateFocus(true)) { (color.GetBrightness() > 0x7F) ? color.SubRGB(OFFSET_FOCUS) : color.SubRGB(OFFSET_FOCUS); } graphics->FillTriangle(SFXTriangle(x + w, y, x, y + h / 2, x + w, y + h), color); return; }// SFZTabControl::DrawLeftTriangle // /*private */Void SFZTabControl::DrawRightTriangle(SFXGraphicsPtr graphics, SFXRectangleConstRef rectangle) const { SFXRGBColor color(_color.arrow); SInt16 w(rectangle.GetWidth() / 4); SInt16 h(w * 2); SInt16 x(rectangle.GetX() + (rectangle.GetWidth() - w) / 2); SInt16 y(rectangle.GetY() + (rectangle.GetHeight() - h) / 2); if (!GetStateFocus(true)) { (color.GetBrightness() > 0x7F) ? color.SubRGB(OFFSET_FOCUS) : color.SubRGB(OFFSET_FOCUS); } graphics->FillTriangle(SFXTriangle(x + w, y + h / 2, x, y, x, y + h), color); return; }// SFZTabControl::DrawRightTriangle // /*private */Void SFZTabControl::DrawBorder(SFXGraphicsPtr graphics) const { SFXRGBColor light; SFXRGBColor dark; SFXLine left; SFXLine bottom; SFXLine right; left.Set(_rcBody.GetEdgeLeft()); left.SubStartY(1); graphics->DrawLine(left, _color.tabBevel.GetLight()); left.Offset(1, 0); left.SubEndY(1); graphics->DrawLine(left, _color.tabBevel.GetBase()); left.Offset(1, 0); left.SubEndY(1); graphics->DrawLine(left, _color.tabBevel.GetDark()); bottom.Set(_rcBody.GetEdgeBottom()); graphics->DrawLine(bottom, _color.tabBevel.GetDark()); bottom.Offset(0, -1); bottom.AddStartX(1); bottom.SubEndX(1); graphics->DrawLine(bottom, _color.tabBevel.GetBase()); bottom.Offset(0, -1); bottom.AddStartX(1); bottom.SubEndX(1); graphics->DrawLine(bottom, _color.tabBevel.GetLight()); right.Set(_rcBody.GetEdgeRight()); right.SubStartY(1); graphics->DrawLine(right, _color.tabBevel.GetDark()); right.Offset(-1, 0); right.SubEndY(1); graphics->DrawLine(right, _color.tabBevel.GetBase()); right.Offset(-1, 0); right.SubEndY(1); graphics->DrawLine(right, _color.tabBevel.GetLight()); return; }// SFZTabControl::DrawBorder //
SFYResponder::Invalidate | SFYResponder::Render | SFYResponder::InvokeBackward | Drawing Event[SFEVT_RESPONDER_RENDER] | Handler for the Drawing Event[XANDLER_DECLARE_VOIDRENDER] | Rendering | Event Loop | Responder Tree | Virtual Region | Real Region | Local Region
[ public, static ] SFZTabControlSmp NewInstance( SFCErrorPtr exception = null // error value );
Return the error value generated inside the function.
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.
The code to create a new instance of this responder class is as follows:
SFZTabControlSmp _tab;
SFCError error;
if ((_tab = SFZTabControl::NewInstance(&error)) != null) {
...
}
[ public ] Void SetArrowColor( SFXRGBColorConstRef param // value to set );
This function sets the color of left and right arrows of this tab control to the specified value(SFXRGBColor).
Default: SFXRGBColor(0x00, 0xBF, 0xF3, 0x00)
This function sets the draw-border flag indicating whether or not to draw the border of this tab control to the specified value.
If you want the border of this tab control drawn, set the argument of this function to "true". Otherwise, set it to "false".
Default: false [The border will not be drawn.]
[ public ] Void SetFocusTabTopEdgeColor( SFXRGBColorConstRef param // value to set );
This function sets the color of upper border of currently selected tab of this tab control to the specified value.
This border will not be drawn when this tab control is in the "unfocus" state or set to "false" using the SFZTabControl::SetFocusTabTopEdgeEnable function.
Default: SFXRGBColor(0x11, 0x22, 0xBB, 0x00)
SFZTabControl::GetFocusTabTopEdgeColor | SFZTabControl::SetFocusTabTopEdgeEnable | SFXRGBColor
This function sets the enable flag of the upper border of currently selected tab of this tab control to the specified value.
This border will be drawn in the color set with the SFZTabControl::SetFocusTabTopEdgeColor function only when this tab control is set to "true" with this function.
Default: true
This function sets the font this tab control to the specified value, which is used for the title of the tab page and the hint text.
If the font is changed, the style event of SFXEvent(SFEVT_RESPONDER_STYLE, SFP16_STYLE_FONT, 0) will occur.
Default: AEE_FONT_NORMAL
SFZTabControl::GetFont | SFXEvent | Style Event[SFEVT_RESPONDER_STYLE]
[ public ] Void SetHintBevelColor( SFXBevelColorConstRef param // value to set );
This function sets the bevel color of rectangular region to draw a hint text of this tab control to the specified value(SFXBevelColor).
Default: SFXBevelColor(SFXRGBColor(0x9F, 0x9F, 0x9F, 0x00), SFXRGBColor(0xDD, 0xDD, 0xDD, 0x00), SFXRGBColor(0x6C, 0x6C, 0x6C, 0x00))
SFZTabControl::GetHintBevelColor | SFXBevelColor | SFXRGBColor
This function sets the height of the rectangular region to draw a hint text of this tab control to the specified value.
If you do not want to display the hint area, set this hint height to 0.
Default: height of AEE_FONT_NORMAL + 2 [pixels]
This function sets the padding size of this tab control to the specified value, which is space between two consecutive tab regions to draw the title of the tab page. [pixels]
This padding area is filled in the color set with the SFYWidget::SetBackgroundColor function.
Default: 4 pixels
[ public ] Void SetTabBevelColor( SFXBevelColorConstRef param // value to set );
This function sets the bevel color of tab region of this tab control to the specified value(SFXBevelColor), which corresponds to the tab page in the "active" state of this tab control.
The bevel color of the tab region corresponding to the tab page in the "inactive" state is automatically set based on the color set with this function.
Default: SFXBevelColor(SFXRGBColor(0x9F, 0x9F, 0x9F, 0x00), SFXRGBColor(0xDD, 0xDD, 0xDD, 0x00), SFXRGBColor(0x6C, 0x6C, 0x6C, 0x00))
SFZTabControl::GetTabBevelColor | SFXBevelColor | SFXRGBColor
This function sets the height of the tab region to draw the title of the tab page of this tab control to the specified value. [pixels]
Default: height of AEE_FONT_NORMAL + 3 pixels
enum CodeEnum { CODE_TYPE = four_char_code('c', 't', 'a', 'b') }; SFMTYPEDEFTYPE(CodeEnum)
Copyright(c) 2002 - 2024 Sophia Cradle Incorporated All Rights Reserved. |