From 331c410205f6f456af7c3ab54e981c771784fd6c Mon Sep 17 00:00:00 2001 From: "Andrzej J.R. Hunt" Date: Tue, 14 Aug 2012 09:47:57 +0200 Subject: Improved pin entry in dialog box -- correct sizing. Change-Id: Ide6184395ea2d916d48dd93a2004dbb6d271a33a --- sd/source/ui/dlg/RemoteDialog.src | 4 ++++ sd/source/ui/dlg/RemoteDialogClientBox.cxx | 25 +++++++++++++++++++------ sd/source/ui/inc/RemoteDialog.hrc | 3 ++- 3 files changed, 25 insertions(+), 7 deletions(-) (limited to 'sd') diff --git a/sd/source/ui/dlg/RemoteDialog.src b/sd/source/ui/dlg/RemoteDialog.src index e7d9a96cda6f..609dbeed440f 100644 --- a/sd/source/ui/dlg/RemoteDialog.src +++ b/sd/source/ui/dlg/RemoteDialog.src @@ -47,6 +47,10 @@ ModalDialog DLG_PAIR_REMOTE TabStop = TRUE ; }; + String STR_ENTER_PIN + { + Text [ en-US ] = "Enter PIN:"; + }; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file diff --git a/sd/source/ui/dlg/RemoteDialogClientBox.cxx b/sd/source/ui/dlg/RemoteDialogClientBox.cxx index 8ce809e7d356..c734a2e12f48 100644 --- a/sd/source/ui/dlg/RemoteDialogClientBox.cxx +++ b/sd/source/ui/dlg/RemoteDialogClientBox.cxx @@ -98,6 +98,7 @@ ClientBox::ClientBox( Dialog* pParent, RemoteServer *pServer, m_pScrollBar->EnableDrag(); m_aPinBox.SetUseThousandSep(false); +// m_aPinDescription.SetText( String( SdResId( STR_ENTER_PIN ) ) ); SetPaintTransparent( true ); SetPosPixel( Point( RSC_SP_DLG_INNERBORDER_LEFT, RSC_SP_DLG_INNERBORDER_TOP ) ); @@ -180,8 +181,9 @@ void ClientBox::CalcActiveHeight( const long nPos ) aSize.Width() -= ICON_OFFSET; - - aTextHeight += m_aPinBox.GetOutputHeightPixel(); + aSize = LogicToPixel( Size( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ), + MapMode( MAP_APPFONT ) ); + aTextHeight += aSize.Height(); if ( aTextHeight < m_nStdHeight ) aTextHeight = m_nStdHeight; @@ -359,16 +361,27 @@ void ClientBox::DrawRow( const Rectangle& rRect, const TClientBoxEntry pEntry ) aPos.Y() += aTextHeight; 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 ) ); 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() ); 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; // // if ( pEntry->m_bHasButtons ) diff --git a/sd/source/ui/inc/RemoteDialog.hrc b/sd/source/ui/inc/RemoteDialog.hrc index 7e3bee7f2322..da2e88991f3a 100644 --- a/sd/source/ui/inc/RemoteDialog.hrc +++ b/sd/source/ui/inc/RemoteDialog.hrc @@ -14,4 +14,5 @@ #define BTN_CANCEL 2 #define LB_SERVERS 3 #define INPUT_PIN 4 -#define TEXT_PIN 5 \ No newline at end of file +#define TEXT_PIN 5 +#define STR_ENTER_PIN 6 \ No newline at end of file -- cgit