Hi Noel,

Please review the patch I'm sending here. I did not have luck getting
the control shown up. Please guide me what I'm missing ?

Thanks and regards
-- 
Anurag Jain
Final yr B.Tech CSE
SASTRA University
Thanjavur(T.N.)-613402
diff --cc sc/source/ui/app/inputwin.cxx
index 0fed037,edffb0a..0000000
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@@ -140,7 -140,7 +140,7 @@@ ScInputWindow::ScInputWindow( Window* p
          ToolBox         ( pParent, WinBits(WB_BORDER|WB_3DLOOK|WB_CLIPCHILDREN) ),
          aWndPos         ( this ),
  //      maScrollBar     ( this,  WB_VERT | WB_DRAG ),
--        aTextWindow     ( this ),
++        aBarGroup       ( this ),
          pInputHdl		( NULL ),
          pBindings       ( pBind ),
          aTextOk			( ScResId( SCSTR_QHELP_BTNOK ) ),		// not always new from Resource
@@@ -171,13 -171,13 +171,13 @@@
      InsertItem      ( SID_INPUT_SUM, 	  IMAGE( SID_INPUT_SUM ), 0,      3 );
      InsertItem      ( SID_INPUT_EQUAL,	  IMAGE( SID_INPUT_EQUAL ), 0,    4 );
      InsertSeparator ( 												      5 );
--    InsertWindow    ( 7, &aTextWindow, 0,                                 6 );
++    InsertWindow    ( 7, &aBarGroup, 0,                              6 );
  //  InsertWindow    ( 8, &maScrollBar, 0,                                 8 );
  
      aWndPos	   .SetQuickHelpText( ScResId( SCSTR_QHELP_POSWND ) );
      aWndPos    .SetHelpId		( HID_INSWIN_POS );
--    aTextWindow.SetQuickHelpText( ScResId( SCSTR_QHELP_INPUTWND ) );
--    aTextWindow.SetHelpId		( HID_INSWIN_INPUT );
++//    aTextWindow.SetQuickHelpText( ScResId( SCSTR_QHELP_INPUTWND ) );
++//    aTextWindow.SetHelpId		( HID_INSWIN_INPUT );
  
  /*
      maScrollBar.SetPageSize( 1 );
@@@ -202,7 -202,7 +202,7 @@@
  
      aWndPos		.Show();
  //  maScrollBar .Show();
--    aTextWindow	.Show();
++    aBarGroup   .Show();
  
      pInputHdl = SC_MOD()->GetInputHdl( pViewSh, false );    // use own handler even if ref-handler is set
      if (pInputHdl)
@@@ -214,7 -214,7 +214,7 @@@
          //	-> Inhalt des Funktionsautopiloten wieder anzeigen
          //!	auch Selektion (am InputHdl gemerkt) wieder anzeigen
  
--        aTextWindow.SetTextString( pInputHdl->GetFormString() );
++        aBarGroup.SetTextString( pInputHdl->GetFormString() );
      }
      else if ( pInputHdl && pInputHdl->IsInputMode() )
      {
@@@ -222,7 -222,7 +222,7 @@@
          //	(Editieren einer Formel, dann umschalten zu fremdem Dokument/Hilfe),
          //	wieder den gerade editierten Text aus dem InputHandler anzeigen
  
--        aTextWindow.SetTextString( pInputHdl->GetEditString() );	// Text anzeigen
++        aBarGroup.SetTextString( pInputHdl->GetEditString() );	// Text anzeigen
          if ( pInputHdl->IsTopMode() )
              pInputHdl->SetMode( SC_INPUT_TABLE );		// Focus kommt eh nach unten
      }
@@@ -365,7 -365,7 +365,7 @@@ void ScInputWindow::Select(
          case SID_INPUT_OK:
              pScMod->InputEnterHandler();
              SetSumAssignMode();
--            aTextWindow.Invalidate();		// sonst bleibt Selektion stehen
++            aBarGroup.Invalidate();		// sonst bleibt Selektion stehen
              break;
  
          case SID_INPUT_SUM:
@@@ -472,13 -472,13 +472,13 @@@
  
          case SID_INPUT_EQUAL:
          {
--            aTextWindow.StartEditEngine();
++            aBarGroup.StartEditEngine();
              if ( pScMod->IsEditMode() )			// nicht, wenn z.B. geschuetzt
              {
--                aTextWindow.GrabFocus();
--                aTextWindow.SetTextString( '=' );
++                aBarGroup.GainFocus();
++                aBarGroup.SetTextString( '=' );
  
--                EditView* pView = aTextWindow.GetEditView();
++                EditView* pView = aBarGroup.GetEditView();
                  if (pView)
                  {
                      pView->SetSelection( ESelection(0,1, 0,1) );
@@@ -496,17 -496,17 +496,7 @@@ void ScInputWindow::Resize(
  {
      ToolBox::Resize();
  
--    long nWidth = GetSizePixel().Width();
--    long nLeft  = aTextWindow.GetPosPixel().X();
--    Size aSize  = aTextWindow.GetSizePixel();
--
--    aSize.Width() = Max( ((long)(nWidth - nLeft - 40)), (long)0 );
--
--//    printf("Inside ScInputWindow:Resize()\n");
--//    printf("nWidth %ld nLeft %ld aSize.Width%ld \n",nWidth, nLeft, aSize.Width());
--
--    aTextWindow.SetSizePixel( aSize );
--    aTextWindow.Invalidate();
++    aBarGroup.Resize();
  }
  
  void ScInputWindow::SetFuncString( const String& rString, sal_Bool bDoEdit )
@@@ -514,15 -514,15 +504,15 @@@
      //!	new method at ScModule to query if function autopilot is open
      SfxViewFrame* pViewFrm = SfxViewFrame::Current();
      EnableButtons( pViewFrm && !pViewFrm->GetChildWindow( SID_OPENDLG_FUNCTION ) );
--    aTextWindow.StartEditEngine();
++    aBarGroup.StartEditEngine();
  
      ScModule* pScMod = SC_MOD();
      if ( pScMod->IsEditMode() )
      {
          if ( bDoEdit )
--            aTextWindow.GrabFocus();
--        aTextWindow.SetTextString( rString );
--        EditView* pView = aTextWindow.GetEditView();
++            aBarGroup.GainFocus();
++        aBarGroup.SetTextString( rString );
++        EditView* pView = aBarGroup.GetEditView();
          if (pView)
          {
              xub_StrLen nLen = rString.Len();
@@@ -552,7 -552,7 +542,7 @@@ void ScInputWindow::SetTextString( cons
      int i = rString.Len();
      if (rString.Len() <= 32767)
      {
--        aTextWindow.SetTextString(rString);
++        aBarGroup.SetTextString(rString);
  //        printf("%d ScInputWnd:SetTextString(),  if \n",i);
      }
      else
@@@ -560,7 -560,7 +550,7 @@@
  //        printf("%d ScInputWnd:SetTextString(),  else \n",i);
          String aNew = rString;
          aNew.Erase(32767);
--        aTextWindow.SetTextString(aNew);
++        aBarGroup.SetTextString(aNew);
      }
  }
  
@@@ -614,7 -614,7 +604,7 @@@ void ScInputWindow::SetSumAssignMode(
  void ScInputWindow::SetFormulaMode( sal_Bool bSet )
  {
      aWndPos.SetFormulaMode(bSet);
--    aTextWindow.SetFormulaMode(bSet);
++    aBarGroup.SetFormulaMode(bSet);
  }
  
  void ScInputWindow::SetText( const String& rString )
@@@ -629,43 -629,43 +619,43 @@@ String ScInputWindow::GetText() cons
  
  sal_Bool ScInputWindow::IsInputActive()
  {
--    return aTextWindow.IsInputActive();
++    return aBarGroup.IsInputActive();
  }
  
  EditView* ScInputWindow::GetEditView()
  {
--    return aTextWindow.GetEditView();
++    return aBarGroup.GetEditView();
  }
  
  void ScInputWindow::MakeDialogEditView()
  {
--    aTextWindow.MakeDialogEditView();
++    aBarGroup.MakeDialogEditView();
  }
  
  void ScInputWindow::StopEditEngine( sal_Bool bAll )
  {
--    aTextWindow.StopEditEngine( bAll );
++//    aTextWindow.StopEditEngine( bAll );
  }
  
  void ScInputWindow::TextGrabFocus()
  {
--    aTextWindow.GrabFocus();
++    aBarGroup.GainFocus();
  }
  
  void ScInputWindow::TextInvalidate()
  {
--    aTextWindow.Invalidate();
++    aBarGroup.Invalidate();
  }
  
  void ScInputWindow::SwitchToTextWin()
  {
      // used for shift-ctrl-F2
  
--    aTextWindow.StartEditEngine();
++    aBarGroup.StartEditEngine();
      if ( SC_MOD()->IsEditMode() )
      {
--        aTextWindow.GrabFocus();
--        EditView* pView = aTextWindow.GetEditView();
++        aBarGroup.GainFocus();
++        EditView* pView = aBarGroup.GetEditView();
          if (pView)
          {
              xub_StrLen nLen = pView->GetEditEngine()->GetTextLen(0);
@@@ -725,11 -725,11 +715,82 @@@ void ScInputWindow::DataChanged( const 
  }
  
  //========================================================================
++//                  ScInputBarGroup
++//========================================================================
++
++ScInputBarGroup::ScInputBarGroup(Window* pParent)
++    :   Window          ( pParent, WinBits(WB_HIDE | WB_BORDER) ),
++        aTextWindow      ( this ),
++        maScrollBar     ( this,  WB_VERT | WB_DRAG ),
++        bIsMultiLine    ( false )
++{
++
++      aTextWindow.Show();
++      aTextWindow.SetQuickHelpText( ScResId( SCSTR_QHELP_INPUTWND ) );
++      aTextWindow.SetHelpId		( HID_INSWIN_INPUT );
++      
++
++}
++
++ScInputBarGroup::~ScInputBarGroup()
++{
++
++}
++void ScInputBarGroup::SetTextString( const String& rString )
++{
++    aTextWindow.SetTextString(rString);
++}
++
++void ScInputBarGroup::Resize()
++{
++    long nWidth = GetSizePixel().Width();
++    long nLeft  = aTextWindow.GetPosPixel().X();
++    Size aSize  = aTextWindow.GetSizePixel();
++
++    aSize.Width() = Max( ((long)(nWidth - nLeft - 40)), (long)0 );
++    
++    aTextWindow.SetSizePixel( aSize );
++    aTextWindow.Invalidate();
++}
++
++void ScInputBarGroup::GainFocus()
++{
++    aTextWindow.GrabFocus();
++}
++
++
++void ScInputBarGroup::StartEditEngine()
++{
++    aTextWindow.StartEditEngine();
++}
++
++void ScInputBarGroup::MakeDialogEditView()
++{
++    aTextWindow.MakeDialogEditView();
++}
++
++
++EditView* ScInputBarGroup::GetEditView()
++{
++    return aTextWindow.GetEditView();
++}
++
++bool ScInputBarGroup::IsInputActive()
++{
++    return aTextWindow.IsInputActive();
++}
++
++void ScInputBarGroup::SetFormulaMode(bool bSet)
++{
++    aTextWindow.SetFormulaMode(bSet);
++}
++
++//========================================================================
  // 							Input Window
  //========================================================================
  
  ScTextWnd::ScTextWnd( Window* pParent )
--    :	Window		 ( pParent, WinBits(WB_HIDE | WB_BORDER) ),
++    :  	Window		 ( pParent, WinBits(WB_HIDE | WB_BORDER) ),
          DragSourceHelper( this ),
          pEditEngine	 ( NULL ),
          pEditView	 ( NULL ),
diff --git a/sc/source/ui/inc/inputwin.hxx b/sc/source/ui/inc/inputwin.hxx
index 9901ef2..6127115 100644
--- a/sc/source/ui/inc/inputwin.hxx
+++ b/sc/source/ui/inc/inputwin.hxx
@@ -165,16 +165,15 @@ public:
     void            SetSize(Size aSize);
     virtual void    Resize();
     void            InitEditEngine(SfxObjectShell* pObjSh);
-//    void            GrabFocus();
-    void            SetFormulaMode(bool bSet);
-    void            GetFocus();
+    void            GainFocus();
+    void            SetFormulaMode( bool bSet );
     bool            IsFocus();
     void            MakeDialogEditView();
-    
+    bool            IsInputActive();
 private:
     
-    ScrollBar		maScrollBar;
     ScTextWnd       aTextWindow;
+    ScrollBar		maScrollBar;
     bool            bIsMultiLine;
 
 };
@@ -230,7 +229,6 @@ protected:
 
 private:
     ScPosWnd		aWndPos;
-//    ScTextWnd		aTextWindow;
     ScInputBarGroup aBarGroup;
     ScInputHandler*	pInputHdl;
     SfxBindings*    pBindings;
_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to