textinput/peninputarc/src/peninputlayoutcontrol/peninputfloatctrl.cpp
branchRCL_3
changeset 7 a47de9135b21
child 18 c8fb4cf7b3ae
equal deleted inserted replaced
3:f5a1e66df979 7:a47de9135b21
       
     1 /*
       
     2 * Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0""
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Implementation for Floating window
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "peninputfloatctrl.h"
       
    20 
       
    21 const TInt KDefaultRoundSize = 2;
       
    22 const TInt KDefaultOrdinalPosition = 0;
       
    23 const TInt KDefaultOrdinalPriority = ECoeWinPriorityAlwaysAtFront + 100;
       
    24 // ---------------------------------------------------------------------------
       
    25 // C++ destructor
       
    26 // ---------------------------------------------------------------------------
       
    27 //
       
    28 CPeninputFloatingCtrl::~CPeninputFloatingCtrl()
       
    29     {
       
    30     }
       
    31 
       
    32 // ---------------------------------------------------------------------------
       
    33 // Draw this control
       
    34 // ---------------------------------------------------------------------------
       
    35 //
       
    36 void CPeninputFloatingCtrl::Draw( const TRect& aRect ) const
       
    37     {
       
    38     CWindowGc& gc = SystemGc();
       
    39     TRect rect = Rect();
       
    40     gc.Clear( rect ); 
       
    41 
       
    42     gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
       
    43     gc.SetBrushColor( KRgbGray );
       
    44     gc.SetPenStyle( CGraphicsContext::ESolidPen );
       
    45     gc.SetPenColor( KRgbBlack );
       
    46     gc.DrawRoundRect( rect, TSize( KDefaultRoundSize, KDefaultRoundSize ) );
       
    47     }
       
    48 
       
    49 // ---------------------------------------------------------------------------
       
    50 // Show this floating control
       
    51 // ---------------------------------------------------------------------------
       
    52 //
       
    53 void CPeninputFloatingCtrl::Show( const TRect& aRect )
       
    54     {
       
    55     Show( aRect, KDefaultOrdinalPosition, KDefaultOrdinalPriority );
       
    56     }
       
    57 
       
    58 // ---------------------------------------------------------------------------
       
    59 // Show this floating control
       
    60 // ---------------------------------------------------------------------------
       
    61 //
       
    62 void CPeninputFloatingCtrl::Show( const TRect& aRect, TInt aOrdinalPos, 
       
    63                                   TInt aOrdinalPriority )
       
    64     {
       
    65     SetRect( aRect );
       
    66     DrawableWindow()->SetOrdinalPosition( aOrdinalPos, aOrdinalPriority );
       
    67     MakeVisible( ETrue );    
       
    68     }
       
    69 // ---------------------------------------------------------------------------
       
    70 // Hide this floating control
       
    71 // ---------------------------------------------------------------------------
       
    72 //
       
    73 void CPeninputFloatingCtrl::Hide()
       
    74     {
       
    75     MakeVisible( EFalse );
       
    76     }
       
    77 
       
    78 // ---------------------------------------------------------------------------
       
    79 // Symbian constructor
       
    80 // ---------------------------------------------------------------------------
       
    81 //
       
    82 void CPeninputFloatingCtrl::BaseConstructL()
       
    83     {
       
    84     RWindowGroup& wg = CCoeEnv::Static()->RootWin();
       
    85     CreateWindowL( wg );
       
    86     SetComponentsToInheritVisibility();
       
    87     Window().SetRequiredDisplayMode( EColor16MA );
       
    88     MakeVisible( EFalse );
       
    89     ActivateL();
       
    90     }
       
    91 
       
    92 // ---------------------------------------------------------------------------
       
    93 // C++ constructor
       
    94 // ---------------------------------------------------------------------------
       
    95 //
       
    96 CPeninputFloatingCtrl::CPeninputFloatingCtrl()
       
    97     {
       
    98     // No implementation required
       
    99     }
       
   100