mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-22 07:28:16 +01:00
add option to take a TBuf16
This commit is contained in:
parent
d36351feb0
commit
72f9ece55b
1 changed files with 32 additions and 22 deletions
|
@ -1,6 +1,6 @@
|
||||||
/* -*-mode: C; fill-column: 78; c-basic-offset: 4;-*- */
|
/* -*-mode: C; fill-column: 78; c-basic-offset: 4;-*- */
|
||||||
/*
|
/*
|
||||||
* Copyright 2004 by Eric House (fixin@peak.org). All rights reserved.
|
* Copyright 2005 by Eric House (fixin@peak.org). All rights reserved.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -24,7 +24,13 @@
|
||||||
#include "xwords.hrh"
|
#include "xwords.hrh"
|
||||||
|
|
||||||
CXWAskDlg::CXWAskDlg( MPFORMAL XWStreamCtxt* aStream, TBool aKillStream ) :
|
CXWAskDlg::CXWAskDlg( MPFORMAL XWStreamCtxt* aStream, TBool aKillStream ) :
|
||||||
iStream(aStream), iKillStream(aKillStream)
|
iStream(aStream), iKillStream(aKillStream), iMessage(NULL)
|
||||||
|
{
|
||||||
|
MPASSIGN( this->mpool, mpool );
|
||||||
|
}
|
||||||
|
|
||||||
|
CXWAskDlg::CXWAskDlg( MPFORMAL TBuf16<128>* aMessage)
|
||||||
|
: iMessage(aMessage), iStream(NULL)
|
||||||
{
|
{
|
||||||
MPASSIGN( this->mpool, mpool );
|
MPASSIGN( this->mpool, mpool );
|
||||||
}
|
}
|
||||||
|
@ -39,7 +45,10 @@ CXWAskDlg::~CXWAskDlg()
|
||||||
void
|
void
|
||||||
CXWAskDlg::PreLayoutDynInitL()
|
CXWAskDlg::PreLayoutDynInitL()
|
||||||
{
|
{
|
||||||
|
CEikEdwin* contents = (CEikEdwin*)Control( EAskContents );
|
||||||
|
|
||||||
// Load the stream's contents into a read-only edit control.
|
// Load the stream's contents into a read-only edit control.
|
||||||
|
if ( iStream ) {
|
||||||
TInt size = stream_getSize( iStream );
|
TInt size = stream_getSize( iStream );
|
||||||
XP_U16* buf16 = new(ELeave) XP_U16[size];
|
XP_U16* buf16 = new(ELeave) XP_U16[size];
|
||||||
CleanupStack::PushL( buf16 );
|
CleanupStack::PushL( buf16 );
|
||||||
|
@ -54,14 +63,15 @@ CXWAskDlg::PreLayoutDynInitL()
|
||||||
TPtr16 desc16( buf16, size );
|
TPtr16 desc16( buf16, size );
|
||||||
|
|
||||||
desc16.Copy( desc8 );
|
desc16.Copy( desc8 );
|
||||||
|
|
||||||
CEikEdwin* contents = (CEikEdwin*)Control( EAskContents );
|
|
||||||
contents->SetTextL( &desc16 );
|
contents->SetTextL( &desc16 );
|
||||||
|
|
||||||
CleanupStack::PopAndDestroy( buf16 );
|
CleanupStack::PopAndDestroy( buf16 );
|
||||||
|
|
||||||
XP_FREE( mpool, buf8 );
|
XP_FREE( mpool, buf8 );
|
||||||
}
|
} else {
|
||||||
|
contents->SetTextL( iMessage );
|
||||||
|
}
|
||||||
|
} /* PreLayoutDynInitL */
|
||||||
|
|
||||||
TBool CXWAskDlg::OkToExitL( TInt aButtonID /* pressed button */ )
|
TBool CXWAskDlg::OkToExitL( TInt aButtonID /* pressed button */ )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue