void Actor::LoadFromNode( const CString& sDir, const XNode* pNode ) { // Load Name, if any. pNode->GetAttrValue( "Name", m_sName ); float f; if( pNode->GetAttrValue( "BaseRotationXDegrees", f ) ) SetBaseRotationX( f ); if( pNode->GetAttrValue( "BaseRotationYDegrees", f ) ) SetBaseRotationY( f ); if( pNode->GetAttrValue( "BaseRotationZDegrees", f ) ) SetBaseRotationZ( f ); if( pNode->GetAttrValue( "BaseZoomX", f ) ) SetBaseZoomX( f ); if( pNode->GetAttrValue( "BaseZoomY", f ) ) SetBaseZoomY( f ); if( pNode->GetAttrValue( "BaseZoomZ", f ) ) SetBaseZoomZ( f ); // // Load commands // FOREACH_CONST_Attr( pNode, a ) { CString sKeyName = a->m_sName; /* "OnCommand" */ if( sKeyName.Right(7).CompareNoCase("Command") != 0 ) continue; /* not a command */ CString sValue = a->m_sValue; THEME->EvaluateString( sValue ); apActorCommands apac( new ActorCommands( sValue ) ); CString sCmdName; /* Special case: "Command=foo" -> "OnCommand=foo" */ if( sKeyName.size() == 7 ) sCmdName="On"; else sCmdName = sKeyName.Left( sKeyName.size()-7 ); AddCommand( sCmdName, apac ); }
void CAknInputFrame::SizeChanged() { // There are 5 different layouts to be handled by this component: // -------------------------------------------------------------- // Standard ( fixed find pane in column lists ) // PopupLayout ( popup find pane in any mainpane list ) // PinbLayout ( used by pinboard app ) // ClockAppLayout ( has been removed from laf - fall back to standard ) // PopupWindowLayout ( used by list query and popuplist ) _AKNTRACE_FUNC_ENTER; TRect parent( Rect() ); // parent for components TRect editorParent( Rect() ); // parent for the editor TRect rect( Rect() ); // rect of the whole shebang TAknLayoutRect r; // common temporary layout rect TAknWindowComponentLayout outline(0); TAknWindowLineLayout iconPos(0); TAknTextComponentLayout editor(0); TBool apac( AknLayoutUtils::Variant() == EApacVariant && ( iFlags & EShowIndicators ) ); if ( iFlags & EPopupLayout ) // popup find box { _AKNTRACE( "[%s][%s] PopupLayout", "CAknInputFrame", __FUNCTION__ ); r.LayoutRect( parent, AknLayoutScalable_Avkon::find_popup_pane() ); parent = r.Rect(); r.LayoutRect( r.Rect(), AknLayoutScalable_Avkon::input_popup_find_pane_cp() ); editorParent = r.Rect(); outline = AknLayoutScalable_Avkon::input_popup_find_pane_cp(); iconPos = AknLayoutScalable_Avkon::find_popup_pane_g1().LayoutLine(); editor = AknLayoutScalable_Avkon::input_popup_find_pane_t1( apac ? 2 : 0 ); if ( iPopupFindCC ) { r.LayoutRect( rect, AknLayoutScalable_Avkon::find_popup_pane() ); iPopupFindCC->SetFrameRects( rect, r.Rect() ); } } else if ( iFlags & EPinbLayout ) // used by pinboard app { _AKNTRACE( "[%s][%s] PinbLayout", "CAknInputFrame", __FUNCTION__ ); outline = AknLayoutScalable_Apps::input_focus_pane_cp01(0); iconPos = AknLayoutScalable_Apps::find_pinb_pane_g1(0); editor = AknLayoutScalable_Apps::find_pinb_pane_t2( apac ? 1 : 0 ); } else if ( iFlags & EPopupWindowLayout ) // list query or popup list { _AKNTRACE( "[%s][%s] PopupWindowLayout", "CAknInputFrame", __FUNCTION__ ); outline = AknLayoutScalable_Avkon::input_popup_find_pane_cp(); iconPos = AknLayoutScalable_Avkon::find_popup_pane_g1(); TAknTextComponentLayout textComponentLayout( TAknWindowComponentLayout::ComposeText( outline, AknLayoutScalable_Avkon::input_popup_find_pane_t1( apac ? 2 : 0 ) ) ); editor = textComponentLayout; if ( iPopupListCC ) { iPopupListCC->SetRect( rect ); } } else // standard find pane { _AKNTRACE( "[%s][%s] Standard Layout", "CAknInputFrame", __FUNCTION__ ); outline = AknLayoutScalable_Avkon::input_find_pane(); iconPos = AknLayoutScalable_Avkon::find_pane_g1(); editor = AknLayoutScalable_Avkon::input_find_pane_t2( apac ? 1: 0 ); r.LayoutRect( rect, AknLayoutScalable_Avkon::input_find_pane() ); editorParent = r.Rect(); } // --- set size and position of the frame around editor --- r.LayoutRect( parent, outline ); iOutlineRect = r.Rect(); _AKNTRACE( "[%s][%s] iOutlineRect: %s:%d,%d %s:%d,%d", "CAknInputFrame", __FUNCTION__, "LT", iOutlineRect.iTl.iX, iOutlineRect.iTl.iY, "BR", iOutlineRect.iBr.iX, iOutlineRect.iBr.iY ); if ( !iInputContext ) { // we need to provide own context if one does not exist // because old style drawing did kind of work even // without calling SetInputContext( ... ) iInputContext = CAknsFrameBackgroundControlContext::NewL( KAknsIIDQsnFrInput, TRect(0,0,0,0), TRect(0,0,0,0), EFalse ); iFlags = iFlags | EOwnsInputContext; // also need to provide skin for the editor in this case static_cast<CEikEdwin*>( iField )->SetSkinBackgroundControlContextL( iInputContext ); } if ( iInputContext ) { // this layout is actually from form! // there exists no layout for find box :-/ but this should do // no help from adaptation layer either r.LayoutRect( iOutlineRect, AknLayoutScalable_Avkon::input_focus_pane_g1() ); iInputContext->SetFrameRects( iOutlineRect, r.Rect() ); // and chain transparent contexts properly MAknsControlContext* bg = iPopupFindCC ? iPopupFindCC : iPopupListCC; if( !bg ) { bg = AknsDrawUtils::ControlContext( this ); } iInputContext->SetParentContext( bg ); } // --- set magnifying glass icon size & position --- iMagnIconPos.LayoutRect( parent, iconPos); CFbsBitmap* iconBitmap = iIcon->Bitmap(); if ( iconBitmap ) { AknIconUtils::SetSize( iconBitmap, iMagnIconPos.Rect().Size() ); } // --- layout the editor --- AknLayoutUtils::LayoutEdwin( static_cast<CEikEdwin*>( iField ), editorParent, editor.LayoutLine(), EAknsCIQsnTextColorsCG25, 0, ETrue ); AknsUtils::RegisterControlPosition( iField ); // prevent flicker _AKNTRACE_FUNC_EXIT; }