Kaydet (Commit) 331c4102 authored tarafından Andrzej J.R. Hunt's avatar Andrzej J.R. Hunt

Improved pin entry in dialog box -- correct sizing.

Change-Id: Ide6184395ea2d916d48dd93a2004dbb6d271a33a
üst 3269a0d1
...@@ -47,6 +47,10 @@ ModalDialog DLG_PAIR_REMOTE ...@@ -47,6 +47,10 @@ ModalDialog DLG_PAIR_REMOTE
TabStop = TRUE ; TabStop = TRUE ;
}; };
String STR_ENTER_PIN
{
Text [ en-US ] = "Enter PIN:";
};
}; };
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
...@@ -98,6 +98,7 @@ ClientBox::ClientBox( Dialog* pParent, RemoteServer *pServer, ...@@ -98,6 +98,7 @@ ClientBox::ClientBox( Dialog* pParent, RemoteServer *pServer,
m_pScrollBar->EnableDrag(); m_pScrollBar->EnableDrag();
m_aPinBox.SetUseThousandSep(false); m_aPinBox.SetUseThousandSep(false);
// m_aPinDescription.SetText( String( SdResId( STR_ENTER_PIN ) ) );
SetPaintTransparent( true ); SetPaintTransparent( true );
SetPosPixel( Point( RSC_SP_DLG_INNERBORDER_LEFT, RSC_SP_DLG_INNERBORDER_TOP ) ); SetPosPixel( Point( RSC_SP_DLG_INNERBORDER_LEFT, RSC_SP_DLG_INNERBORDER_TOP ) );
...@@ -180,8 +181,9 @@ void ClientBox::CalcActiveHeight( const long nPos ) ...@@ -180,8 +181,9 @@ void ClientBox::CalcActiveHeight( const long nPos )
aSize.Width() -= ICON_OFFSET; aSize.Width() -= ICON_OFFSET;
aSize = LogicToPixel( Size( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ),
aTextHeight += m_aPinBox.GetOutputHeightPixel(); MapMode( MAP_APPFONT ) );
aTextHeight += aSize.Height();
if ( aTextHeight < m_nStdHeight ) if ( aTextHeight < m_nStdHeight )
aTextHeight = m_nStdHeight; aTextHeight = m_nStdHeight;
...@@ -359,16 +361,27 @@ void ClientBox::DrawRow( const Rectangle& rRect, const TClientBoxEntry pEntry ) ...@@ -359,16 +361,27 @@ void ClientBox::DrawRow( const Rectangle& rRect, const TClientBoxEntry pEntry )
aPos.Y() += aTextHeight; aPos.Y() += aTextHeight;
if ( pEntry->m_bActive ) if ( pEntry->m_bActive )
{ {
Size aSize = LogicToPixel( Size( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ),
MapMode( MAP_APPFONT ) );
m_aPinBox.SetSizePixel( aSize );
const Rectangle aRect( GetEntryRect( m_nActive ) ); const Rectangle aRect( GetEntryRect( m_nActive ) );
Size aBtnSize( m_aPinBox.GetSizePixel() ); Size aBtnSize( m_aPinBox.GetSizePixel() );
Point aBtnPos( aRect.Left() + ICON_OFFSET, Size aTextSize( m_aPinDescription.GetSizePixel() );
Point aBtnPos( aRect.Left(),
aRect.Bottom() - TOP_OFFSET - aBtnSize.Height() );
// m_aPinDescription.SetPosPixel( aBtnPos );
DrawText( Rectangle( aBtnPos.X(), aBtnPos.Y(), rRect.Right(), rRect.Bottom() - TOP_OFFSET),
String( SdResId( STR_ENTER_PIN ) ), 0 );
aBtnPos = Point( aRect.Left() + GetTextWidth( String( SdResId( STR_ENTER_PIN ) ) ),
aRect.Bottom() - TOP_OFFSET - aBtnSize.Height() ); aRect.Bottom() - TOP_OFFSET - aBtnSize.Height() );
m_aPinBox.SetPosPixel( aBtnPos ); m_aPinBox.SetPosPixel( aBtnPos );
Size aSize = LogicToPixel( Size( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ),
MapMode( MAP_APPFONT ) );
m_aPinBox.SetSizePixel( aSize );
// long nExtraHeight = 0; // long nExtraHeight = 0;
// //
// if ( pEntry->m_bHasButtons ) // if ( pEntry->m_bHasButtons )
......
...@@ -15,3 +15,4 @@ ...@@ -15,3 +15,4 @@
#define LB_SERVERS 3 #define LB_SERVERS 3
#define INPUT_PIN 4 #define INPUT_PIN 4
#define TEXT_PIN 5 #define TEXT_PIN 5
#define STR_ENTER_PIN 6
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment