mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-20 22:26:54 +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;-*- */
|
||||
/*
|
||||
* 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
|
||||
* modify it under the terms of the GNU General Public License
|
||||
|
@ -24,7 +24,13 @@
|
|||
#include "xwords.hrh"
|
||||
|
||||
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 );
|
||||
}
|
||||
|
@ -39,7 +45,10 @@ CXWAskDlg::~CXWAskDlg()
|
|||
void
|
||||
CXWAskDlg::PreLayoutDynInitL()
|
||||
{
|
||||
CEikEdwin* contents = (CEikEdwin*)Control( EAskContents );
|
||||
|
||||
// Load the stream's contents into a read-only edit control.
|
||||
if ( iStream ) {
|
||||
TInt size = stream_getSize( iStream );
|
||||
XP_U16* buf16 = new(ELeave) XP_U16[size];
|
||||
CleanupStack::PushL( buf16 );
|
||||
|
@ -54,14 +63,15 @@ CXWAskDlg::PreLayoutDynInitL()
|
|||
TPtr16 desc16( buf16, size );
|
||||
|
||||
desc16.Copy( desc8 );
|
||||
|
||||
CEikEdwin* contents = (CEikEdwin*)Control( EAskContents );
|
||||
contents->SetTextL( &desc16 );
|
||||
|
||||
CleanupStack::PopAndDestroy( buf16 );
|
||||
|
||||
XP_FREE( mpool, buf8 );
|
||||
}
|
||||
} else {
|
||||
contents->SetTextL( iMessage );
|
||||
}
|
||||
} /* PreLayoutDynInitL */
|
||||
|
||||
TBool CXWAskDlg::OkToExitL( TInt aButtonID /* pressed button */ )
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue