[Libreoffice-commits] .: sd/source

Andrzej J.R. Hunt ajrhunt at kemper.freedesktop.org
Tue Aug 14 00:50:29 PDT 2012


 sd/source/ui/dlg/RemoteDialog.src          |    4 ++++
 sd/source/ui/dlg/RemoteDialogClientBox.cxx |   25 +++++++++++++++++++------
 sd/source/ui/inc/RemoteDialog.hrc          |    1 -
 3 files changed, 23 insertions(+), 7 deletions(-)

New commits:
commit 331c410205f6f456af7c3ab54e981c771784fd6c
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date:   Tue Aug 14 09:47:57 2012 +0200

    Improved pin entry in dialog box -- correct sizing.
    
    Change-Id: Ide6184395ea2d916d48dd93a2004dbb6d271a33a

diff --git a/sd/source/ui/dlg/RemoteDialog.src b/sd/source/ui/dlg/RemoteDialog.src
index e7d9a96..609dbee 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 8ce809e..c734a2e 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 7e3bee7..da2e889 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


More information about the Libreoffice-commits mailing list