|
Nokia N97 SDK Example Applications Guide |
#include <tactileexamplecircle.h>
Inheritance diagram for CTactileExampleCircle:

Definition at line 27 of file tactileexamplecircle.h.
Public Member Functions |
|
| virtual | ~CTactileExampleCircle () |
| void | EnableFeedback (TBool aEnabled) |
| void | Draw (const TRect &aRect) const |
| void | HandlePointerEventL (const TPointerEvent &aPointerEvent) |
| TBool | HitRegionContains (const TPoint &aPoint, const CCoeControl &) const |
Static Public Member Functions |
|
| static CTactileExampleCircle * | NewL (const TRect &aRect, const CCoeControl *aParent) |
Private Member Functions |
|
| CTactileExampleCircle () | |
| void | ConstructL (const TRect &aRect, const CCoeControl *aParent) |
|
|
Destructor. Definition at line 44 of file tactileexamplecircle.cpp.
|
|
||||||||||||
|
First phase of two-phased constructor Definition at line 29 of file tactileexamplecircle.cpp. References ConstructL(). Referenced by CTactileExampleAppView::ConstructL(). 00031 { 00032 CTactileExampleCircle* self = new ( ELeave ) CTactileExampleCircle; 00033 CleanupStack::PushL( self ); 00034 self->ConstructL( aRect, aParent ); 00035 CleanupStack::Pop( self ); 00036 return self; 00037 }
|
|
|
Enables/disables tactile feedback for this control
Definition at line 53 of file tactileexamplecircle.cpp. Referenced by CTactileExampleAppView::HandleControlEventL(), and CTactileExampleAppView::HandleResourceChange(). 00054 { 00055 MTouchFeedback* feedback = MTouchFeedback::Instance(); 00056 if ( feedback ) 00057 { 00058 feedback->EnableFeedbackForControl( this, aEnabled ); 00059 } 00060 }
|
|
|
From CCoeControl. Draw this CTactileExampleCircle control to the screen.
Definition at line 68 of file tactileexamplecircle.cpp. 00069 { 00070 CWindowGc& gc = SystemGc(); 00071 gc.SetPenStyle( CGraphicsContext::ENullPen ); 00072 gc.SetBrushStyle( CGraphicsContext::ESolidBrush ); 00073 gc.SetBrushColor( KRgbBlue ); 00074 gc.DrawEllipse( Rect() ); 00075 }
|
|
|
From CCoeControl.
Definition at line 84 of file tactileexamplecircle.cpp. 00085 { 00086 if ( aPointerEvent.iType == TPointerEvent::EButton1Down ) 00087 { 00088 MTouchFeedback* feedback = MTouchFeedback::Instance(); 00089 if ( feedback ) 00090 { 00091 feedback->InstantFeedback( this, ETouchFeedbackBasic ); 00092 } 00093 } 00094 CCoeControl::HandlePointerEventL( aPointerEvent ); 00095 }
|
|
||||||||||||
|
From MCoeControlHitTest. Tests whether a pointer event occurred inside the control's hit region
Definition at line 105 of file tactileexamplecircle.cpp. Referenced by CTactileExampleAppView::HandlePointerEventL(). 00107 { 00108 TBool hit; 00109 00110 if ( this->IsVisible() ) 00111 { 00112 TReal distance; // aPoint's distance from center of the circle 00113 TReal pow1; 00114 TReal pow2; 00115 TPoint offSet = Rect().Center() - aPoint; 00116 Math::Pow( pow1, offSet.iX, 2 ); 00117 Math::Pow( pow2, offSet.iY, 2 ); 00118 Math::Sqrt( distance, pow1 + pow2 ); 00119 00120 hit = ( distance > ( Rect().Width()/2 )) ? EFalse : ETrue; 00121 } 00122 else 00123 { 00124 hit = EFalse; 00125 } 00126 00127 return hit; 00128 }
|
|
||||||||||||
|
Second phase of constructor. Definition at line 145 of file tactileexamplecircle.cpp. Referenced by NewL(). 00146 { 00147 SetContainerWindowL( *aParent ); 00148 SetRect( aRect ); 00149 00150 // Set hit tester to be object itself 00151 SetHitTest( this ); 00152 00153 ActivateL(); 00154 }
|
|
© Nokia 2009 |