symbian中使用滚动条

这是我自己写的一个滚动条界面就有2个label,可以根据滚动条而上下滑动。但是有缺陷就是drag滚动条时不平滑,有高手请指点一下。

/*
* ============================================================================
*  Name     : CShowInfoDialog from ShowInfoDialog.cpp
*  Part of  : ImageConverter
*  Created  : May 14, 2006 by Forum Nokia
*  Description:
*     Used to show information of an image frame.
*  Version  : 2.0
*  Copyright: Nokia Corporation
* ============================================================================
*/

// INCLUDE FILES
#include <aknlists.h>
#include <aknnotewrappers.h>
#include <stringloader.h>
#include "ShowInfoDialog.h"
#include <testscroller_0xEBE02C7E.rsg>
#include <BARSREAD.H>
#include <aknscontrolcontext.h> 
#include <aknsbasicbackgroundcontrolcontext.h> 
const TInt KNumMessages = 10;
const TInt KMaxInfoDescriptorLength = 80;
const TInt LASTSPACE = 25;
const TInt XOFFSET = 7;
const TInt SPACING = 4;
// ================= MEMBER FUNCTIONS =======================

CMessageViewDialogControl::CMessageViewDialogControl()
	{
	iSendBackLabel = NULL;
	iNameLabel = NULL;
	iScrollBarWidth = 25;
	iStartPoit = TPoint( 7,9 );
	isSetContent = EFalse;
	iMoveY = 0;
	}

CMessageViewDialogControl::~CMessageViewDialogControl()
	{
	delete iSendBackLabel;
	iSendBackLabel = NULL;

	delete iNameLabel;
	iNameLabel = NULL;

	 if(iSBFrame)
	 {
	  delete iSBFrame;
	  iSBFrame = NULL;
	 }
	  if (aDisplayContent)
	  {
	   aDisplayContent->ResetAndDestroy();
	   delete aDisplayContent;
	   aDisplayContent = NULL;
	  }
	}
				
void CMessageViewDialogControl::ConstructL(CShowInfoDialog* aParent, const TRect& aRect,data* aInfoStrings )
	{
    CreateWindowL();
#ifndef __SERIES60_30__
    EnableDragEvents();
#endif
	iFocusControl = NULL;
	parent = aParent;
	iPos = aInfoStrings;
	InitializeControlsL();
	iRect = aRect;
	iMaxDisplayLine = GetMaxDisplay();
    SetRect(aRect);
    ActivateL();
	}
			
TInt CMessageViewDialogControl::CountComponentControls() const
	{
	return 2;
	}
				
CCoeControl* CMessageViewDialogControl::ComponentControl( TInt aIndex ) const
	{
	switch ( aIndex )
		{
		case ESendBackLabel:
			return iSendBackLabel;
		case ENameLabel:
			return iNameLabel;
		}
	return NULL;
	}
				
void CMessageViewDialogControl::SizeChanged()
	{
	CCoeControl::SizeChanged();
	LayoutControls();
	}
				
void CMessageViewDialogControl::LayoutControls()
	{
  TRect tempMainPane;
  AknLayoutUtils::LayoutMetricsRect (AknLayoutUtils::EMainPane,tempMainPane);
  TRect r(TPoint(0, 0), tempMainPane.Size());

	iSendBackLabel->SetExtent( TPoint( XOFFSET, 9 ), TSize( 48, 48 ) );
	
	
	int ew = Rect().Width() - XOFFSET - SPACING*2;
	int nameY = iSendBackLabel->Font()->HeightInPixels() + iSendBackLabel->Font()->AscentInPixels()/2 + SPACING;
	{

	SetDisplayContent(nameY,ENameLabel,iPos->senderName );
	AccountTotalLine(iPos->senderName);
	}
	

	
	iScrollCount = iTotalLine-iMaxDisplayLine + 2;
	if( iScrollCount > 0 )
	CreateScrollBars( iScrollCount );
	iTotalLine = 0;

	aDisplayContent->ResetAndDestroy();
	delete aDisplayContent;
	aDisplayContent = NULL;
	 
	 
	}


void CMessageViewDialogControl::InitializeControlsL()
	{
	
	iSendBackLabel = new ( ELeave ) CEikLabel;
	iSendBackLabel->SetContainerWindowL( *this );
		{
		TResourceReader reader;
		iEikonEnv->CreateResourceReaderLC( reader, R_CONTACTEDITDIALOG_SENDBACK_LABEL );
		iSendBackLabel->ConstructFromResourceL( reader );
		CleanupStack::PopAndDestroy(); // reader internal state
		}
//		
	iNameLabel = new ( ELeave ) CEikLabel;
	iNameLabel->SetContainerWindowL( *this );
		{//need to know reciver or sender
		TResourceReader reader;
		iEikonEnv->CreateResourceReaderLC( reader, R_CONTACTEDITDIALOG_NAME_RECIVER_LABEL );
		iNameLabel->ConstructFromResourceL( reader );
		CleanupStack::PopAndDestroy(); // reader internal state
		}
//	
		MAknsSkinInstance* skin = AknsUtils::SkinInstance();
		TRgb rgb_label;
		AknsUtils::GetCachedColor(skin, rgb_label, KAknsIIDQsnTextColors,  EAknsCIQsnTextColorsCG9 );
		TRgb rgb_value;
		AknsUtils::GetCachedColor(skin, rgb_value, KAknsIIDQsnTextColors,  EAknsCIQsnTextColorsCG10);
//    
		iNameLabel->SetBrushStyle( CWindowGc::ENullBrush );
		iSendBackLabel->SetBrushStyle( CWindowGc::ENullBrush );
//
		iNameLabel->OverrideColorL(EColorLabelText,rgb_label);
		iSendBackLabel->OverrideColorL(EColorLabelText,rgb_label);
	  
	}

void CMessageViewDialogControl::HandleResourceChange( TInt aType )
	{
		CCoeControl::HandleResourceChange(aType);
	   if(aType==KEikDynamicLayoutVariantSwitch)
	    {
	    TRect tempMainPane;
	    AknLayoutUtils::LayoutMetricsRect (AknLayoutUtils::EMainPane,tempMainPane);
	    TRect r(TPoint(0, 0), tempMainPane.Size());
	    SetRect(r); // Parent()->Rect()
	    }
	}
TTypeUid::Ptr CMessageViewDialogControl::MopSupplyObject(TTypeUid aId)
{
 if (parent->iSkinContext )
 {
   return MAknsControlContext::SupplyMopObject( aId, parent->iSkinContext );
 }
 return CCoeControl::MopSupplyObject(aId);
}
				
void CMessageViewDialogControl::Draw( const TRect& aRect  ) const
	{
	 CWindowGc& gc = SystemGc();
	 TRect tempMainPane;
	 AknLayoutUtils::LayoutMetricsRect (AknLayoutUtils::EMainPane,tempMainPane);
	 TRect mainPane(TPoint(0, 0), tempMainPane.Size());
	 if(parent->iSkinContext)
	   {
	   parent->iSkinContext->SetRect(mainPane);
	   AknsDrawUtils::Background( AknsUtils::SkinInstance(),  parent->iSkinContext, this, gc, mainPane);   
	   }

		}


void CMessageViewDialogControl::HandleScrollEventL(CEikScrollBar*  aScrollBar,TEikScrollEvent aEventType )
	{
	TInt offset = iSendBackLabel->Font()->HeightInPixels()+iLineToLineSpace;//iRect.Height() / iScrollCount;
	
	 switch(aEventType)
	           {
	        	case EEikScrollPageUp:
	        		{
	                   CEikScrollBar* sb=  iSBFrame->VerticalScrollBar();// get an object of your scroll bar 
		                   TInt pos=sb->ThumbPosition();/// it will provide new position of scrollbar	  
    				 if( iScrollPos != 0 )
    					 {
    					 TPoint point = iNameLabel->Position();
    					 iNameLabel->SetPosition(TPoint( point.iX,point.iY + offset*(iScrollPos-pos) ) );
    					 point = iSendBackLabel->Position();
    					 iSendBackLabel->SetPosition(TPoint( point.iX,point.iY + offset*(iScrollPos-pos) ) );
    					 }
    				 if( iScrollPos <= 0 )
    					 iScrollPos = 0;
    				 else
	                     iScrollPos=pos;/// moving down number of scroll span
    				 iIsScrollDown=EFalse;
	        		}
	        	    DrawNow();
	        	    break;
	        	case EEikScrollPageDown:
	        		{
	                   CEikScrollBar* sb=  iSBFrame->VerticalScrollBar();// get an object of your scroll bar 
		                   TInt pos=sb->ThumbPosition();/// it will provide new position of scrollbar
		                  if(iScrollPos<pos)
		                   {

		         			 if( iScrollPos != iScrollCount - 1 )
		         			 {
		         				 TPoint point = iNameLabel->Position();
		         				 iNameLabel->SetPosition(TPoint( point.iX,point.iY - offset*(pos-iScrollPos) ) );
								 point = iSendBackLabel->Position();
		     					 iSendBackLabel->SetPosition(TPoint( point.iX,point.iY - offset*(pos-iScrollPos) ) );
		         			 }
		         			
		         			 if( iScrollPos >= iScrollCount - 1 )
		         				 iScrollPos = iScrollCount - 1;
		         			 else
			                     iScrollPos=pos;/// moving down number of scroll span
		         			
		         			 iIsScrollDown=ETrue;
		                   }
	        		}
		                  DrawNow();
		                  break;
	        	case EEikScrollThumbDragVert:
	                 {
	                   CEikScrollBar* sb=  iSBFrame->VerticalScrollBar();// get an object of your scroll bar 
	                   TInt pos=sb->ThumbPosition();/// it will provide new position of scrollbar
	                  if(iScrollPos<pos)
	                   {

	         			 if( iScrollPos != iScrollCount - 1 )
	         			 {
	         				 TPoint point = iNameLabel->Position();
	         				 iNameLabel->SetPosition(TPoint( point.iX,point.iY - offset*(pos-iScrollPos) ) );
							 point = iSendBackLabel->Position();
	     					 iSendBackLabel->SetPosition(TPoint( point.iX,point.iY - offset*(pos-iScrollPos) ) );
	         			 }
	         			
	         			 if( iScrollPos >= iScrollCount - 1 )
	         				 iScrollPos = iScrollCount - 1;
	         			 else
		                     iScrollPos=pos;/// moving down number of scroll span
	         			
	         			 iIsScrollDown=ETrue;
	                   }
	                  else
	                   {

	     				 if( iScrollPos != 0 )
	     					 {
	     					 TPoint point = iNameLabel->Position();
	     					 iNameLabel->SetPosition(TPoint( point.iX,point.iY + offset*(iScrollPos-pos) ) );
	     					 point = iSendBackLabel->Position();
	     					 iSendBackLabel->SetPosition(TPoint( point.iX,point.iY + offset*(iScrollPos-pos) ) );
	     					 }
	     				 if( iScrollPos <= 0 )
	     					 iScrollPos = 0;
	     				 else
		                     iScrollPos=pos;/// moving down number of scroll span
	     				 iIsScrollDown=EFalse;
	                   }
	                  
	                  DrawNow();
	                  break;
	                }
	             case EEikScrollThumbReleaseVert:
	                  break;
	             default:
	                  break;
	            }
	        
	        UpdateScrollBarFrame();
	}

TKeyResponse CMessageViewDialogControl::OfferKeyEventL(const TKeyEvent& aKeyEvent,
                            TEventCode aType)
	{
	TInt offset = iSendBackLabel->Font()->HeightInPixels()+iLineToLineSpace;//iRect.Height() / iScrollCount;
    CEikScrollBar* sb=  iSBFrame->VerticalScrollBar();// get an object of your scroll bar 
    TInt pos=sb->ThumbPosition();/// it will provide new position of scrollbar 
	 if(/*(aType == EEventKeyDown) && */(aKeyEvent.iScanCode == EStdKeyDownArrow))
	 { 
		  
		 if( iScrollPos != iScrollCount - 1 )
		 {
			 TPoint point = iNameLabel->Position();
			 iNameLabel->SetPosition(TPoint( point.iX,point.iY - offset ) );
			  point = iSendBackLabel->Position();
			 iSendBackLabel->SetPosition(TPoint( point.iX,point.iY - offset ) );
			 
			 if( iScrollPos >= iScrollCount - 1 )
				 iScrollPos = iScrollCount - 1;
			 else
				 iScrollPos++;
			 
			 UpdateScrollBarFrame();
		 }
		 
	 }
	 else if(/*(aType == EEventKeyDown) && */(aKeyEvent.iScanCode == EStdKeyUpArrow))
	 {

		 if( iScrollPos != 0 )
			 {
			 TPoint point = iNameLabel->Position();
			 iNameLabel->SetPosition(TPoint( point.iX,point.iY + offset ) );
			  point = iSendBackLabel->Position();
			 iSendBackLabel->SetPosition(TPoint( point.iX,point.iY + offset ) );
				 
				 if( iScrollPos <= 0 )
					 iScrollPos = 0;
				 else
					 iScrollPos--;
				 
				 UpdateScrollBarFrame();
			 }

	 }

	}

void CMessageViewDialogControl::UpdateScrollBarFrame()
	{
	
	 iSBFrame->MoveVertThumbTo(iScrollPos);//绝对坐标
	 iSBFrame->DrawScrollBarsNow();
	 DrawNow();
	
	}
void CMessageViewDialogControl::CreateScrollBars(TInt aCunt)
	{
		//构造
		if(!iSBFrame)
			{ 	 
				 iSBFrame=new(ELeave) CEikScrollBarFrame(this, this,ETrue);
			}
				 iSBFrame->CreateDoubleSpanScrollBarsL(ETrue, EFalse,ETrue,ETrue); 
				 iSBFrame->SetTypeOfVScrollBar(CEikScrollBarFrame::EDoubleSpan);
				 iSBFrame->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,
				 CEikScrollBarFrame::EAuto);
				 
				iVDsSbarModel.SetScrollSpan(aCunt);
				iVDsSbarModel.SetWindowSize(1);
				TEikScrollBarFrameLayout layout;
				layout.iTilingMode = TEikScrollBarFrameLayout::EInclusiveRectConstant;
				TRect rect = Rect();
				iSBFrame->TileL(&iHDsSbarModel,&iVDsSbarModel,rect,rect,layout);
				iSBFrame->SetVFocusPosToThumbPos(iVDsSbarModel.FocusPosition());
						
				 iSBFrame->MoveVertThumbTo(0);
				 iSBFrame->DrawScrollBarsNow();
//				 DrawNow();
			
	}


void CMessageViewDialogControl::AccountTotalLine( const TDesC& aContent )
{
	  if (aDisplayContent)
	  {
	   aDisplayContent->ResetAndDestroy();
	   delete aDisplayContent;
	   aDisplayContent = NULL;
	  }
	  aDisplayContent = new RPointerArray<HBufC>;
	  HBufC *content = aContent.Alloc();
	  aDisplayContent->Append( content );
	  
	 for(TInt i=0;i<aDisplayContent->Count();i++)
	 {
	  TInt nStringMaxDisplayLine = iNameLabel->Font()->TextWidthInPixels((*aDisplayContent)[i]->Des())/(iRect.Width() - iScrollBarWidth) + iMaxDisplayLine;
	  TBidiText* bidi = TBidiText::NewL((*aDisplayContent)[i]->Des(), nStringMaxDisplayLine);
	  bidi->WrapText(iRect.Width()-iScrollBarWidth, *iSendBackLabel->Font(), NULL);
	  TInt lines = bidi->NumberOfLinesInDisplayText();
	  iTotalLine += lines;
	  delete bidi;
	 }
}

void CMessageViewDialogControl::WrapToArray(const TDesC& buffer,CEikLabel* iLabel)
	{
		CArrayFix<TPtrC>* iTextArray; //for creating multiline label.
		HBufC* iMultiLineText; // //for creating multiline label.
		iTextArray = new CArrayFixFlat<TPtrC>(1);
		iMultiLineText = HBufC::NewL(0);
		AknTextUtils::WrapToArrayL(buffer,360- iScrollBarWidth,*(iLabel->Font()), *iTextArray);
		TInt Height = 0; //to set height of label.[[Category:Symbian C++]]
		for (TInt i = 0; i < iTextArray->Count(); i++)
		{	
			TInt length = iTextArray->At(i).Length() + 1;
			iMultiLineText = iMultiLineText->ReAllocL(iMultiLineText->Length() + length);
			iMultiLineText->Des().Append(iTextArray->At(i));
			iMultiLineText->Des().Append(_L("\n"));
			Height += iLabel->Font()->HeightInPixels() + iLabel->Font()->AscentInPixels()/2;
		}
		 
		iLabel->SetTextL(iMultiLineText->Des());
		//set size of label.
		iLabel->SetSize(TSize(360- iScrollBarWidth,Height));
	
		delete iTextArray;
		delete iMultiLineText;
	}
TInt CMessageViewDialogControl::GetMaxDisplay()
{
 return (iRect.Height() - LASTSPACE - iStartPoit.iY - 20 )/(iSendBackLabel->Font()->HeightInPixels() + iLineToLineSpace);
}

void CMessageViewDialogControl::SetDisplayContent(TInt preY,TInt index,const TDesC& content )
	{
		int SPACING = 4;
		int preleft = 7;
		int prew = Rect().Width() - 7 - SPACING*2- iScrollBarWidth;
		switch( index )
			{
			case ESendBackLabel:
				WrapToArray(content,iSendBackLabel);
				iSendBackLabel->SetExtent( TPoint( preleft, preY ),  TSize(prew,iSendBackLabel->MinimumSize().iHeight*1.1f));	
				break;
			case ENameLabel:{
				WrapToArray(content,iNameLabel);
				iNameLabel->SetExtent( TPoint( preleft, preY ),  TSize(prew,iNameLabel->MinimumSize().iHeight*1.1f));
				break;
			}
	
			default:
				return;
			}
	}

void CMessageViewDialogControl::HandlePointerEventL(const TPointerEvent& aPointerEvent)
	{

		TInt offset = iSendBackLabel->Font()->HeightInPixels()+iLineToLineSpace;
		switch (aPointerEvent.iType)
		{
		case TPointerEvent::EButton1Down:
			{
			iStartPointv5  = aPointerEvent.iPosition;
			Window().RequestPointerRepeatEvent(TTimeIntervalMicroSeconds32(1000), Rect());
			break;
			}
		case TPointerEvent::EButton1Up:
			{
			iRepeatCount = 0;
			iMoveY=0;
				
			break;
			}
		case TPointerEvent::EButtonRepeat:
			{
			TPoint point3 = aPointerEvent.iPosition - iStartPointv5 ;
			
			if(iRepeatCount >= 32 )
				{
				//长按处理
				break;
				}
		
			iRepeatCount++;
			Window().RequestPointerRepeatEvent(TTimeIntervalMicroSeconds32(1000), Rect());	//0.001s
			break;
			}
		case TPointerEvent::EDrag:
			{
			//拖动处理
			
			TPoint point2 = aPointerEvent.iPosition - iStartPointv5;
			int y = point2.iY;//拖拽后的高度
			
			iMoveY += y;
			
			//如果拖拽的高度大于显示字体的高度开始移动滚动条
			if( iMoveY != 0 ){
			
				if( iMoveY > 0 )
					{//向上拖动
						if( Abs(iMoveY) > (iSendBackLabel->Font()->HeightInPixels() + iSendBackLabel->Font()->AscentInPixels()/2) )
						{
							if( iScrollPos != 0 )
							 {
							 TPoint point = iNameLabel->Position();
							 iNameLabel->SetPosition(TPoint( point.iX,point.iY + offset ) );
								 point = iSendBackLabel->Position();
							 iSendBackLabel->SetPosition(TPoint( point.iX,point.iY + offset ) );
								 
								 if( iScrollPos <= 0 )
									 iScrollPos = 0;
								 else
									 iScrollPos--;
								 
								 UpdateScrollBarFrame();
							 }
						}
					}
				else
					{//向下拖动
						if( Abs(iMoveY) > (iSendBackLabel->Font()->HeightInPixels() + iSendBackLabel->Font()->AscentInPixels()/2) )
						{
							 if( iScrollPos != iScrollCount - 1 )
							 {
								 TPoint point = iNameLabel->Position();
								 iNameLabel->SetPosition(TPoint( point.iX,point.iY - offset ) );
								  point = iSendBackLabel->Position();
								 iSendBackLabel->SetPosition(TPoint( point.iX,point.iY - offset ) );
	
								 
								 if( iScrollPos >= iScrollCount - 1 )
									 iScrollPos = iScrollCount - 1;
								 else
									 iScrollPos++;
								 
								 UpdateScrollBarFrame();
							 }
						}
					}

			}
			iStartPointv5  = aPointerEvent.iPosition;//记录拖拽后的位置
			break;
			}
		default:
			{
			break;
			}
			
		}
	}

// C++ default constructor can NOT contain any code, that
// might leave.
//
CShowInfoDialog::CShowInfoDialog( data* aInfoStrings,TRect aRect ) : 
    iInfoStrings( aInfoStrings ),iRect( aRect )
    {
    }

CShowInfoDialog::~CShowInfoDialog()
    {
    delete iSkinContext;
    delete imessageView;
    }


// ----------------------------------------------------------
// CShowInfoDialog::PreLayoutDynInitL()
// Initializing the dialog dynamically
// ----------------------------------------------------------
//
void CShowInfoDialog::PreLayoutDynInitL()
    {

	imessageView = new (ELeave) CMessageViewDialogControl;
	imessageView->SetMopParent(this);
	imessageView->ConstructL(this, iRect,iInfoStrings);
    }

void CShowInfoDialog::PostLayoutDynInitL()
    {
	iSkinContext = CAknsBasicBackgroundControlContext::NewL(KAknsIIDQsnBgAreaMain,Rect(),EFalse);
	imessageView->SetMopParent(this);
	imessageView->SetRect( iRect );
    }

// ----------------------------------------------------------
// CShowInfoDialog::OkToExitL()
// This function ALWAYS returns ETrue
// ----------------------------------------------------------
//
TBool CShowInfoDialog::OkToExitL(TInt /*aButtonId*/)
    {
    return ETrue;
    }

TInt CShowInfoDialog::CountComponentControls() const
    {
    if( imessageView )
        return( 1 );
    else 
        return( 0 ); 
    }

CCoeControl* CShowInfoDialog::ComponentControl(TInt /*aIndex*/) const
    {
    return imessageView;
    }

TKeyResponse CShowInfoDialog::OfferKeyEventL(
    const TKeyEvent& aKeyEvent,TEventCode aType)
    {
	imessageView->OfferKeyEventL(aKeyEvent,aType );
	   return( EKeyWasNotConsumed );
    }


.h

/*
* ============================================================================
*  Name     : CShowInfoDialog from ShowInfoDialog.h
*  Part of  : ImageConverter
*  Created  : May 14, 2006 by Forum Nokia
*  Description:
*     Used to show information of a image frame.
*  Version  : 2.0
*  Copyright: Nokia Corporation
* ============================================================================
*/

#ifndef __SHOWINFODIALOG_H__
#define __SHOWINFODIALOG_H__

// INCLUDES
#include <aknview.h>
#include <eikdialg.h>
#include "testscrollerAppUi.h"
// FORWARD DECLARATIONS
class CEikTextListBox;
class CShowInfoDialog;
// CLASS DECLARATION
enum TControls
	{
	ESendBackLabel = 0,
	ENameLabel,
	ELastControl
	};

class CMessageViewDialogControl : public CCoeControl, public MEikScrollBarObserver
	{
public:
	// constructors and destructor
	CMessageViewDialogControl();
	void ConstructL(CShowInfoDialog* aParent, const TRect& aRect,data* aInfoStrings);
	virtual ~CMessageViewDialogControl();
	TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
public:
	// from base class CCoeControl
	TInt CountComponentControls() const;
	CCoeControl* ComponentControl( TInt aIndex ) const;
	void HandleResourceChange( TInt aType );
	void HandlePointerEventL(const TPointerEvent& aPointerEvent);
protected:
	// from base class CCoeControl
	void SizeChanged();

private:
	// from base class CCoeControl
	void Draw( const TRect& aRect ) const;
public:
    /**
    * From CoeControl, OfferKeyEventL
    */
    TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,
                                TEventCode aType);
public:///MEikScrollBarObserver
    void HandleScrollEventL(CEikScrollBar*  aScrollBar,TEikScrollEvent aEventType );
    CShowInfoDialog *parent;
private:
	void InitializeControlsL();
	void LayoutControls();
	void AccountTotalLine();//计算所要显示的内容的总行数
	
	 //创建系统滚动条
public:	
	void CreateScrollBars(TInt aCunt);
		void UpdateScrollBarFrame();
	void SetDisplayContent(TInt preY,TInt index,const TDesC& content );
	void WrapToArray(const TDesC& buffer,CEikLabel* iLabel);//用于多行显示label内容
	 //计算文字中行数
	 void AccountTotalLine(const TDesC& aContent);
	 //计算一屏幕显示的最大行数
	 TInt GetMaxDisplay();
		CCoeControl* iFocusControl;
private:
	CEikLabel* iSendBackLabel;
	CEikLabel* iNameLabel;
	TInt iMaxDisplayLine;//一屏能显示的最在行数
	 //文字总行数
	 TInt iTotalLine;
	    TInt                iScrollPos;//滚动条的位置
	TBool iIsScrollDown;
    CEikScrollBarFrame* iSBFrame;
    TInt                iStartLine;
    TInt	iScrollCount;
    TAknDoubleSpanScrollBarModel          iHDsSbarModel;
    TAknDoubleSpanScrollBarModel          iVDsSbarModel;  

public: 
  data*	iPos;

  //文字显示开始位置
  TPoint iStartPoit;
  //每行文字间的间距
  TInt iLineToLineSpace;
  TRect iRect;
  TInt iScrollBarWidth;
  RPointerArray<HBufC> * aDisplayContent;
  TBool isSetContent;
  
#ifndef __SERIES60_30__
    	TPoint iStartPointv5 ;
        TInt iRepeatCount;
        TInt iMoveY;
#endif
	};
/**
*  Dialog class
*  Test various controls.
*/
class CShowInfoDialog:public CEikDialog
    {
    public: // Constructors and destructor
        /**
        * Constructor
        */      
        CShowInfoDialog( data* aInfoStrings ,TRect aRect);
        
        ~CShowInfoDialog();

        /**
        * From CAknDialog set parameters before showing dialog.
        */
        void PreLayoutDynInitL();
		
        void PostLayoutDynInitL();

        TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);

        /**
        * From CAknDialog update member variables of CAknExEditorDialog.
        * @param aButtonId The ID of the button that was activated.
        * @return Should return ETrue if the dialog should exit,
        *    and EFalse if it should not
        */
        TBool OkToExitL(TInt aButtonId);

    public:
    private: // from base classes
        /**
        * From CoeControl,CountComponentControls.
        */
        TInt CountComponentControls() const;

        /**
        * From CCoeControl,ComponentControl.
        */
        CCoeControl* ComponentControl(TInt aIndex) const;

    
    private: // internal methods
	   void ShowInfoDialogL();

    private: // data
	   data* iInfoStrings;
	
        /*! @var iListBox the control used to display the results */
	   CMessageViewDialogControl* imessageView;

        /*! @var iMessageList the list of messages to display */
        CDesCArrayFlat* iMessageList;
    public:
		CAknsBasicBackgroundControlContext* iSkinContext;
		TRect iRect;
    };

#endif //__SHOWINFODIALOG_H__






  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
城市应急指挥系统是智慧城市建设的重要组成部分,旨在提高城市对突发事件的预防和处置能力。系统背景源于自然灾害和事故灾难频发,如汶川地震和日本大地震等,这些事件造成了巨大的人员伤亡和财产损失。随着城市化进程的加快,应急信息化建设面临信息资源分散、管理标准不统一等问题,需要通过统筹管理和技术创新来解决。 系统的设计思路是通过先进的技术手段,如物联网、射频识别、卫星定位等,构建一个具有强大信息感知和通信能力的网络和平台。这将促进不同部门和层次之间的信息共享、交流和整合,提高城市资源的利用效率,满足城市对各种信息的获取和使用需求。在“十二五”期间,应急信息化工作将依托这些技术,实现动态监控、风险管理、预警以及统一指挥调度。 应急指挥系统的建设目标是实现快速有效的应对各种突发事件,保障人民生命财产安全,减少社会危害和经济损失。系统将包括预测预警、模拟演练、辅助决策、态势分析等功能,以及应急值守、预案管理、GIS应用等基本应用。此外,还包括支撑平台的建设,如接警心、视频会议、统一通信等基础设施。 系统的实施将涉及到应急网络建设、应急指挥、视频监控、卫星通信等多个方面。通过高度集成的系统,建立统一的信息接收和处理平台,实现多渠道接入和融合指挥调度。此外,还包括应急指挥心基础平台建设、固定和移动应急指挥通信系统建设,以及应急队伍建设,确保能够迅速响应并有效处置各类突发事件。 项目的意义在于,它不仅是提升灾害监测预报水平和预警能力的重要科技支撑,也是实现预防和减轻重大灾害和事故损失的关键。通过实施城市应急指挥系统,可以加强社会管理和公共服务,构建和谐社会,为打造平安城市提供坚实的基础。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值