Hello Kohei,
As said I've modified the codebase over Noel's patch and worked on
showing the button up and basic toggling working. So far the text
window and the container class resizes well base on the button click.
But currently I'd need to work on following things also
1: Setting the proper output area when the toggling happens. I've
tried working on it but was not able to get vertical offset proper
when in multiline mode. So need to look more into its mathematics.
2: As Noel mentioned in, his last mail that I'm setting the height to
TBX_WINDOW_HEIGHT instead it can be more than that. I tried fetching
the current height in ScMultiTextWnd::Resize() and setting the correct
height but I did some wrong implementation and LO was crashing because
of that. So I'd need to look into that too.
3: The third thing is, when the resize happens, the ScInputWindow i.e
toolbox doesn't resize. The overflow of the child window is hidden
inside ScInputWindow.
So this patch contains a basic button implementations and toggling of
the textbox (resizing it) based on the click. I took time because it
took some time to understand the new codebase which makes this feature
runtime switchable. Please review it as soon as possible and help me
work on the above mentioned things.
Thanks and regards
--
Anurag Jain
Final yr B.Tech CSE
SASTRA University
Thanjavur(T.N.)-613402
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 2d7a748..1fb7c6b 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -51,6 +51,7 @@
#include <vcl/cursor.hxx>
#include <vcl/help.hxx>
#include <svl/stritem.hxx>
+#include <stdio.h>
#include "inputwin.hxx"
#include "scmod.hxx"
@@ -81,6 +82,7 @@
#define TEXT_MULTI_STARTPOS 5
#define THESIZE 1000000 //!!! langt... :-)
#define TBX_WINDOW_HEIGHT 22 // in Pixeln - fuer alle Systeme gleich?
+#define LEFT_OFFSET 5
enum ScNameInputType
{
@@ -176,7 +178,7 @@ ScInputWindow::ScInputWindow( Window* pParent, SfxBindings* pBind ) :
}
DBG_ASSERT( pViewSh, "no view shell for input window" );
- // Positionsfenster, 3 Buttons, Eingabefenster
+ // Position window, 3 buttons, input window
InsertWindow ( 1, &aWndPos, 0,
0 );
InsertSeparator (
1 );
InsertItem ( SID_INPUT_FUNCTION, IMAGE( SID_INPUT_FUNCTION ), 0, 2 );
@@ -187,9 +189,12 @@ ScInputWindow::ScInputWindow( Window* pParent, SfxBindings* pBind ) :
aWndPos .SetQuickHelpText( ScResId( SCSTR_QHELP_POSWND ) );
aWndPos .SetHelpId ( HID_INSWIN_POS );
- aTextWindow.SetQuickHelpText( ScResId( SCSTR_QHELP_INPUTWND ) );
- aTextWindow.SetHelpId ( HID_INSWIN_INPUT );
-
+
+ if ( !lcl_isExperimentalMode() )
+ {
+ aTextWindow.SetQuickHelpText( ScResId( SCSTR_QHELP_INPUTWND ) );
+ aTextWindow.SetHelpId ( HID_INSWIN_INPUT );
+ }
// kein SetHelpText, die Hilfetexte kommen aus der Hilfe
SetItemText ( SID_INPUT_FUNCTION, ScResId( SCSTR_QHELP_BTNCALC ) );
@@ -477,7 +482,7 @@ void ScInputWindow::Select()
aTextWindow.StartEditEngine();
if ( pScMod->IsEditMode() ) // nicht, wenn z.B. geschuetzt
{
- aTextWindow.GrabFocus();
+ aTextWindow.StartEditEngine();
aTextWindow.SetTextString( '=' );
EditView* pView = aTextWindow.GetEditView();
@@ -497,20 +502,24 @@ void ScInputWindow::Select()
void ScInputWindow::Resize()
{
ToolBox::Resize();
-
- long nWidth = GetSizePixel().Width();
- long nLeft = aTextWindow.GetPosPixel().X();
- Size aSize = aTextWindow.GetSizePixel();
-
- aSize.Width() = Max( ((long)(nWidth - nLeft - 5)), (long)0 );
+
if ( lcl_isExperimentalMode() )
{
- aSize.Height()= TBX_WINDOW_HEIGHT;
- aTextWindow.SetSizePixel( aSize );
+ //aSize.Height()= TBX_WINDOW_HEIGHT;
+ //aTextWindow.SetSizePixel( aSize );
aTextWindow.Resize();
}
- aTextWindow.SetSizePixel( aSize );
- aTextWindow.Invalidate();
+ else
+ {
+ long nWidth = GetSizePixel().Width();
+ long nLeft = aTextWindow.GetPosPixel().X();
+ Size aSize = aTextWindow.GetSizePixel();
+
+ aSize.Width() = Max( ((long)(nWidth - nLeft - 5)), (long)0 );
+
+ aTextWindow.SetSizePixel( aSize );
+ aTextWindow.Invalidate();
+ }
}
void ScInputWindow::SetFuncString( const String& rString, sal_Bool bDoEdit )
@@ -518,8 +527,10 @@ void ScInputWindow::SetFuncString( const String& rString, sal_Bool bDoEdit )
//! new method at ScModule to query if function autopilot is open
SfxViewFrame* pViewFrm = SfxViewFrame::Current();
EnableButtons( pViewFrm && !pViewFrm->GetChildWindow( SID_OPENDLG_FUNCTION ) );
- aTextWindow.StartEditEngine();
-
+ if ( !lcl_isExperimentalMode() )
+ aTextWindow.StartEditEngine();
+ else
+ aTextWindow.StartEditEngine();
ScModule* pScMod = SC_MOD();
if ( pScMod->IsEditMode() )
{
@@ -729,12 +740,17 @@ void ScInputWindow::DataChanged( const DataChangedEvent& rDCEvt )
ScInputBarGroup::ScInputBarGroup(Window* pParent)
: ScTextWndBase ( pParent, WinBits(WB_HIDE) ),
- aTextWindow ( this ),
- bIsMultiLine ( false )
+ aMultiTextWnd ( this ),
+ aButton ( this),
+ bIsMultiLine ( false )
{
- aTextWindow.Show();
- aTextWindow.SetQuickHelpText( ScResId( SCSTR_QHELP_INPUTWND ) );
- aTextWindow.SetHelpId ( HID_INSWIN_INPUT );
+ aMultiTextWnd.Show();
+ aMultiTextWnd.SetQuickHelpText( ScResId( SCSTR_QHELP_INPUTWND ) );
+ aMultiTextWnd.SetHelpId ( HID_INSWIN_INPUT );
+
+ aButton.SetClickHdl ( LINK( this, ScInputBarGroup, ClickHdl ) );
+ aButton.Show();
+ aButton.Enable();
}
ScInputBarGroup::~ScInputBarGroup()
@@ -745,80 +761,131 @@ ScInputBarGroup::~ScInputBarGroup()
void
ScInputBarGroup::InsertAccessibleTextData( ScAccessibleEditLineTextData& rTextData )
{
- aTextWindow.InsertAccessibleTextData( rTextData );
+ aMultiTextWnd.InsertAccessibleTextData( rTextData );
}
void
ScInputBarGroup::RemoveAccessibleTextData( ScAccessibleEditLineTextData& rTextData )
{
- aTextWindow.RemoveAccessibleTextData( rTextData );
+ aMultiTextWnd.RemoveAccessibleTextData( rTextData );
}
const String&
ScInputBarGroup::GetTextString() const
{
- return aTextWindow.GetTextString();
+ return aMultiTextWnd.GetTextString();
}
void ScInputBarGroup::SetTextString( const String& rString )
{
- aTextWindow.SetTextString(rString);
+ aMultiTextWnd.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 );
- aSize.Height()=22;
- aTextWindow.SetSizePixel( aSize );
- aTextWindow.Invalidate();
+ long nWidth = GetParent()->GetSizePixel().Width();
+ long nLeft = GetPosPixel().X();
+ Size aSize = GetSizePixel();
+ aSize.Width() = Max( ((long)(nWidth - nLeft - 2*LEFT_OFFSET)), (long)0 );
+ if(bIsMultiLine)
+ {
+ aSize.Height()=3*TBX_WINDOW_HEIGHT;
+ }
+ else
+ {
+ aSize.Height()=TBX_WINDOW_HEIGHT;
+ }
+ SetSizePixel(aSize);
+ Invalidate();
+
+
aButton.SetPosSizePixel(Point(aSize.Width()-3*LEFT_OFFSET,0),Size(0.5*TBX_WINDOW_HEIGHT,TBX_WINDOW_HEIGHT));
+
+ aMultiTextWnd.Resize();
}
+
void ScInputBarGroup::GainFocus()
{
- aTextWindow.GrabFocus();
+ aMultiTextWnd.GrabFocus();
}
void ScInputBarGroup::StopEditEngine( sal_Bool bAll )
{
- aTextWindow.StopEditEngine( bAll );
+ aMultiTextWnd.StopEditEngine( bAll );
}
void ScInputBarGroup::StartEditEngine()
{
- aTextWindow.StartEditEngine();
+ aMultiTextWnd.StartEditEngine();
}
+
void ScInputBarGroup::MakeDialogEditView()
{
- aTextWindow.MakeDialogEditView();
+ aMultiTextWnd.MakeDialogEditView();
}
EditView* ScInputBarGroup::GetEditView()
{
- return aTextWindow.GetEditView();
+ return aMultiTextWnd.GetEditView();
}
sal_Bool ScInputBarGroup::IsInputActive()
{
- return aTextWindow.IsInputActive();
+ return aMultiTextWnd.IsInputActive();
}
void ScInputBarGroup::SetFormulaMode(sal_Bool bSet)
{
- aTextWindow.SetFormulaMode(bSet);
+ aMultiTextWnd.SetFormulaMode(bSet);
}
-ScMultiTextWnd::ScMultiTextWnd( Window* pParen ) : ScTextWnd( pParen )
+IMPL_LINK( ScInputBarGroup, ClickHdl, PushButton*, pBtn )
+{
+
+if(!bIsMultiLine)
+{
+ bIsMultiLine=true;
+}
+else
+{
+ bIsMultiLine=false;
+}
+aMultiTextWnd.SetMultiLineStatus(bIsMultiLine);
+Resize();
+return 0;
+}
+
+//========================================================================
+// ScMultiTextWnd
+//========================================================================
+
+ScMultiTextWnd::ScMultiTextWnd( Window* pParen ) : ScTextWnd( pParen ),
+ bIsMultiLine(false)
{
nTextStartPos = TEXT_MULTI_STARTPOS;
}
+bool ScMultiTextWnd::GetMultiLineStatus()
+{
+ return bIsMultiLine;
+}
+
+void ScMultiTextWnd::SetMultiLineStatus(bool bMode)
+{
+ bIsMultiLine=bMode;
+}
+
+int ScMultiTextWnd::GetLineCount()
+{
+ if(pEditView)
+ {
+ return pEditEngine->GetLineCount(0);
+ }
+}
+
void ScMultiTextWnd::Paint( const Rectangle& rRec )
{
// We always use edit engine to draw text at all times.
@@ -833,21 +900,194 @@ void ScMultiTextWnd::Paint( const Rectangle& rRec )
void ScMultiTextWnd::Resize()
{
- if (pEditView)
+ long nWidth = GetParent()->GetSizePixel().Width();
+ long nLeft = GetPosPixel().X();
+ Size cSize = GetSizePixel();
+ cSize.Width() = Max( ((long)(nWidth - nLeft - 3*LEFT_OFFSET)), (long)0 );
+
+ if(bIsMultiLine)
+ {
+ cSize.Height()=3*TBX_WINDOW_HEIGHT;
+
+ }
+ else
{
+ cSize.Height()=TBX_WINDOW_HEIGHT;
+ }
+ SetSizePixel(cSize);
+
+ if (pEditView)
+ {
Size aSize = GetOutputSizePixel();
-
Size bSize = LogicToPixel(Size(0,pEditEngine->GetLineHeight(0,0)));
int nDiff=(aSize.Height()-bSize.Height())/2;
- Point aPos(nTextStartPos,nDiff*aSize.Height()/aSize.Height());
+ Point aPos(TEXT_STARTPOS,nDiff*aSize.Height()/aSize.Height());
Point aPos2(aSize.Width()-5,(aSize.Height()-nDiff)*aSize.Height()/aSize.Height());
pEditView->SetOutputArea(
PixelToLogic(Rectangle(aPos, aPos2)));
}
}
+
+
+void ScMultiTextWnd::StartEditEngine()
+{
+ // Bei "eigener Modalitaet" (Doc-modale Dialoge) nicht aktivieren
+
+ SfxObjectShell* pObjSh = SfxObjectShell::Current();
+ if ( pObjSh && pObjSh->IsInModalMode() )
+ return;
+
+ if ( !pEditView || !pEditEngine )
+ {
+ InitEditEngine(pObjSh);
+ }
+
+ SC_MOD()->SetInputMode( SC_INPUT_TOP );
+
+ SfxViewFrame* pViewFrm = SfxViewFrame::Current();
+ if (pViewFrm)
+ pViewFrm->GetBindings().Invalidate( SID_ATTR_INSERT );
+}
+
+void lcl_ExtendEditFontAttribs( SfxItemSet& rSet )
+{
+ const SfxPoolItem& rFontItem = rSet.Get( EE_CHAR_FONTINFO );
+ rSet.Put( rFontItem, EE_CHAR_FONTINFO_CJK );
+ rSet.Put( rFontItem, EE_CHAR_FONTINFO_CTL );
+ const SfxPoolItem& rHeightItem = rSet.Get( EE_CHAR_FONTHEIGHT );
+ rSet.Put( rHeightItem, EE_CHAR_FONTHEIGHT_CJK );
+ rSet.Put( rHeightItem, EE_CHAR_FONTHEIGHT_CTL );
+ const SfxPoolItem& rWeightItem = rSet.Get( EE_CHAR_WEIGHT );
+ rSet.Put( rWeightItem, EE_CHAR_WEIGHT_CJK );
+ rSet.Put( rWeightItem, EE_CHAR_WEIGHT_CTL );
+ const SfxPoolItem& rItalicItem = rSet.Get( EE_CHAR_ITALIC );
+ rSet.Put( rItalicItem, EE_CHAR_ITALIC_CJK );
+ rSet.Put( rItalicItem, EE_CHAR_ITALIC_CTL );
+ const SfxPoolItem& rLangItem = rSet.Get( EE_CHAR_LANGUAGE );
+ rSet.Put( rLangItem, EE_CHAR_LANGUAGE_CJK );
+ rSet.Put( rLangItem, EE_CHAR_LANGUAGE_CTL );
+}
+
+void lcl_ModifyRTLDefaults( SfxItemSet& rSet )
+{
+ rSet.Put( SvxAdjustItem( SVX_ADJUST_RIGHT, EE_PARA_JUST ) );
+
+ // always using rtl writing direction would break formulas
+ //rSet.Put( SvxFrameDirectionItem( FRMDIR_HORI_RIGHT_TOP, EE_PARA_WRITINGDIR ) );
+
+ // PaperSize width is limited to USHRT_MAX in RTL mode (because of EditEngine's
+ // sal_uInt16 values in EditLine), so the text may be wrapped and line spacing must be
+ // increased to not see the beginning of the next line.
+ SvxLineSpacingItem aItem( SVX_LINESPACE_TWO_LINES, EE_PARA_SBL );
+ aItem.SetPropLineSpace( 200 );
+ rSet.Put( aItem );
+}
+
+void lcl_ModifyRTLVisArea( EditView* pEditView )
+{
+ Rectangle aVisArea = pEditView->GetVisArea();
+ Size aPaper = pEditView->GetEditEngine()->GetPaperSize();
+ long nDiff = aPaper.Width() - aVisArea.Right();
+ aVisArea.Left() += nDiff;
+ aVisArea.Right() += nDiff;
+ pEditView->SetVisArea(aVisArea);
+}
+
+
+void ScMultiTextWnd::InitEditEngine(SfxObjectShell* pObjSh)
+{
+ ScFieldEditEngine* pNew;
+ ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell();
+ if ( pViewSh )
+ {
+ const ScDocument* pDoc = pViewSh->GetViewData()->GetDocument();
+ pNew = new ScFieldEditEngine( pDoc->GetEnginePool(), pDoc->GetEditPool() );
+ }
+ else
+ pNew = new ScFieldEditEngine( EditEngine::CreatePool(), NULL, sal_True );
+ pNew->SetExecuteURL( false );
+ pEditEngine = pNew;
+
+ Size barSize=GetOutputSizePixel();
+
+ long barHeight=barSize.Height();
+ long textHeight=LogicToPixel( Size( 0, GetTextHeight() ) ).Height();
+ long nDiff = barHeight - textHeight;
+
+ barSize.Height()=nDiff+barHeight;
+ barSize.Width() -= 2*nTextStartPos-4;
+ pEditEngine->SetUpdateMode( false );
+ pEditEngine->SetPaperSize( PixelToLogic(Size(barSize.Width(),10000)) );
+ pEditEngine->SetWordDelimiters(
+ ScEditUtil::ModifyDelimiters( pEditEngine->GetWordDelimiters() ) );
+
+ UpdateAutoCorrFlag();
+
+ {
+ SfxItemSet* pSet = new SfxItemSet( pEditEngine->GetEmptyItemSet() );
+ pEditEngine->SetFontInfoInItemSet( *pSet, aTextFont );
+ lcl_ExtendEditFontAttribs( *pSet );
+ // turn off script spacing to match DrawText output
+ pSet->Put( SvxScriptSpaceItem( false, EE_PARA_ASIANCJKSPACING ) );
+ if ( bIsRTL )
+ lcl_ModifyRTLDefaults( *pSet );
+ pEditEngine->SetDefaults( pSet );
+ }
+
+ // Wenn in der Zelle URL-Felder enthalten sind, muessen die auch in
+ // die Eingabezeile uebernommen werden, weil sonst die Positionen nicht stimmen.
+
+ sal_Bool bFilled = false;
+ ScInputHandler* pHdl = SC_MOD()->GetInputHdl();
+ if ( pHdl ) //! Testen, ob's der richtige InputHdl ist?
+ bFilled = pHdl->GetTextAndFields( *pEditEngine );
+
+ pEditEngine->SetUpdateMode( sal_True );
+
+ // aString ist die Wahrheit...
+ if ( bFilled && pEditEngine->GetText() == aString )
+ Invalidate(); // Repaint fuer (hinterlegte) Felder
+ else
+ pEditEngine->SetText(aString); // dann wenigstens den richtigen Text
+
+ pEditView = new EditView( pEditEngine, this );
+ pEditView->SetInsertMode(bIsInsertMode);
+
+ // Text aus Clipboard wird als ASCII einzeilig uebernommen
+ sal_uLong n = pEditView->GetControlWord();
+ pEditView->SetControlWord( n | EV_CNTRL_SINGLELINEPASTE );
+
+ pEditEngine->InsertView( pEditView, EE_APPEND );
+
+ Resize();
+
+ if ( bIsRTL )
+ lcl_ModifyRTLVisArea( pEditView );
+
+ pEditEngine->SetModifyHdl(LINK(this, ScTextWnd, NotifyHdl));
+
+ if (!maAccTextDatas.empty())
+ maAccTextDatas.back()->StartEdit();
+
+ // as long as EditEngine and DrawText sometimes differ for CTL text,
+ // repaint now to have the EditEngine's version visible
+// SfxObjectShell* pObjSh = SfxObjectShell::Current();
+ if ( pObjSh && pObjSh->ISA(ScDocShell) )
+ {
+ ScDocument* pDoc = ((ScDocShell*)pObjSh)->GetDocument(); // any document
+ sal_uInt8 nScript = pDoc->GetStringScriptType( aString );
+ if ( nScript & SCRIPTTYPE_COMPLEX )
+ Invalidate();
+ }
+}
+
+void ScMultiTextWnd::StopEditEngine( sal_Bool /*bAll*/ )
+{
+}
+
//========================================================================
-// Eingabefenster
+// ScTextWnd
//========================================================================
ScTextWnd::ScTextWnd( Window* pParent )
@@ -1114,161 +1354,6 @@ void ScTextWnd::UpdateAutoCorrFlag()
}
}
-void lcl_ExtendEditFontAttribs( SfxItemSet& rSet )
-{
- const SfxPoolItem& rFontItem = rSet.Get( EE_CHAR_FONTINFO );
- rSet.Put( rFontItem, EE_CHAR_FONTINFO_CJK );
- rSet.Put( rFontItem, EE_CHAR_FONTINFO_CTL );
- const SfxPoolItem& rHeightItem = rSet.Get( EE_CHAR_FONTHEIGHT );
- rSet.Put( rHeightItem, EE_CHAR_FONTHEIGHT_CJK );
- rSet.Put( rHeightItem, EE_CHAR_FONTHEIGHT_CTL );
- const SfxPoolItem& rWeightItem = rSet.Get( EE_CHAR_WEIGHT );
- rSet.Put( rWeightItem, EE_CHAR_WEIGHT_CJK );
- rSet.Put( rWeightItem, EE_CHAR_WEIGHT_CTL );
- const SfxPoolItem& rItalicItem = rSet.Get( EE_CHAR_ITALIC );
- rSet.Put( rItalicItem, EE_CHAR_ITALIC_CJK );
- rSet.Put( rItalicItem, EE_CHAR_ITALIC_CTL );
- const SfxPoolItem& rLangItem = rSet.Get( EE_CHAR_LANGUAGE );
- rSet.Put( rLangItem, EE_CHAR_LANGUAGE_CJK );
- rSet.Put( rLangItem, EE_CHAR_LANGUAGE_CTL );
-}
-
-void lcl_ModifyRTLDefaults( SfxItemSet& rSet )
-{
- rSet.Put( SvxAdjustItem( SVX_ADJUST_RIGHT, EE_PARA_JUST ) );
-
- // always using rtl writing direction would break formulas
- //rSet.Put( SvxFrameDirectionItem( FRMDIR_HORI_RIGHT_TOP, EE_PARA_WRITINGDIR ) );
-
- // PaperSize width is limited to USHRT_MAX in RTL mode (because of EditEngine's
- // sal_uInt16 values in EditLine), so the text may be wrapped and line spacing must be
- // increased to not see the beginning of the next line.
- SvxLineSpacingItem aItem( SVX_LINESPACE_TWO_LINES, EE_PARA_SBL );
- aItem.SetPropLineSpace( 200 );
- rSet.Put( aItem );
-}
-
-void lcl_ModifyRTLVisArea( EditView* pEditView )
-{
- Rectangle aVisArea = pEditView->GetVisArea();
- Size aPaper = pEditView->GetEditEngine()->GetPaperSize();
- long nDiff = aPaper.Width() - aVisArea.Right();
- aVisArea.Left() += nDiff;
- aVisArea.Right() += nDiff;
- pEditView->SetVisArea(aVisArea);
-}
-
-void ScMultiTextWnd::StartEditEngine()
-{
- // Bei "eigener Modalitaet" (Doc-modale Dialoge) nicht aktivieren
-
- SfxObjectShell* pObjSh = SfxObjectShell::Current();
- if ( pObjSh && pObjSh->IsInModalMode() )
- return;
-
- if ( !pEditView || !pEditEngine )
- {
- InitEditEngine(pObjSh);
- }
-
- SC_MOD()->SetInputMode( SC_INPUT_TOP );
-
- SfxViewFrame* pViewFrm = SfxViewFrame::Current();
- if (pViewFrm)
- pViewFrm->GetBindings().Invalidate( SID_ATTR_INSERT );
-}
-
-void ScMultiTextWnd::InitEditEngine(SfxObjectShell* pObjSh)
-{
- ScFieldEditEngine* pNew;
- ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell();
- if ( pViewSh )
- {
- const ScDocument* pDoc = pViewSh->GetViewData()->GetDocument();
- pNew = new ScFieldEditEngine( pDoc->GetEnginePool(), pDoc->GetEditPool() );
- }
- else
- pNew = new ScFieldEditEngine( EditEngine::CreatePool(), NULL, sal_True );
- pNew->SetExecuteURL( false );
- pEditEngine = pNew;
-
- Size barSize=GetOutputSizePixel();
-
- long barHeight=barSize.Height();
- long textHeight=LogicToPixel( Size( 0, GetTextHeight() ) ).Height();
- long nDiff = barHeight - textHeight;
-
- barSize.Height()=nDiff+barHeight;
- barSize.Width() -= 2*nTextStartPos-4;
- pEditEngine->SetUpdateMode( false );
- pEditEngine->SetPaperSize( PixelToLogic(Size(barSize.Width(),10000)) );
- pEditEngine->SetWordDelimiters(
- ScEditUtil::ModifyDelimiters( pEditEngine->GetWordDelimiters() ) );
-
- UpdateAutoCorrFlag();
-
- {
- SfxItemSet* pSet = new SfxItemSet( pEditEngine->GetEmptyItemSet() );
- pEditEngine->SetFontInfoInItemSet( *pSet, aTextFont );
- lcl_ExtendEditFontAttribs( *pSet );
- // turn off script spacing to match DrawText output
- pSet->Put( SvxScriptSpaceItem( false, EE_PARA_ASIANCJKSPACING ) );
- if ( bIsRTL )
- lcl_ModifyRTLDefaults( *pSet );
- pEditEngine->SetDefaults( pSet );
- }
-
- // Wenn in der Zelle URL-Felder enthalten sind, muessen die auch in
- // die Eingabezeile uebernommen werden, weil sonst die Positionen nicht stimmen.
-
- sal_Bool bFilled = false;
- ScInputHandler* pHdl = SC_MOD()->GetInputHdl();
- if ( pHdl ) //! Testen, ob's der richtige InputHdl ist?
- bFilled = pHdl->GetTextAndFields( *pEditEngine );
-
- pEditEngine->SetUpdateMode( sal_True );
-
- // aString ist die Wahrheit...
- if ( bFilled && pEditEngine->GetText() == aString )
- Invalidate(); // Repaint fuer (hinterlegte) Felder
- else
- pEditEngine->SetText(aString); // dann wenigstens den richtigen Text
-
- pEditView = new EditView( pEditEngine, this );
- pEditView->SetInsertMode(bIsInsertMode);
-
- // Text aus Clipboard wird als ASCII einzeilig uebernommen
- sal_uLong n = pEditView->GetControlWord();
- pEditView->SetControlWord( n | EV_CNTRL_SINGLELINEPASTE );
-
- pEditEngine->InsertView( pEditView, EE_APPEND );
-
- Resize();
-
- if ( bIsRTL )
- lcl_ModifyRTLVisArea( pEditView );
-
- pEditEngine->SetModifyHdl(LINK(this, ScTextWnd, NotifyHdl));
-
- if (!maAccTextDatas.empty())
- maAccTextDatas.back()->StartEdit();
-
- // as long as EditEngine and DrawText sometimes differ for CTL text,
- // repaint now to have the EditEngine's version visible
-// SfxObjectShell* pObjSh = SfxObjectShell::Current();
- if ( pObjSh && pObjSh->ISA(ScDocShell) )
- {
- ScDocument* pDoc = ((ScDocShell*)pObjSh)->GetDocument(); // any document
- sal_uInt8 nScript = pDoc->GetStringScriptType( aString );
- if ( nScript & SCRIPTTYPE_COMPLEX )
- Invalidate();
- }
-}
-
-void ScMultiTextWnd::StopEditEngine( sal_Bool /*bAll*/ )
-{
-}
-
void ScTextWnd::StartEditEngine()
{
// Bei "eigener Modalitaet" (Doc-modale Dialoge) nicht aktivieren
diff --git a/sc/source/ui/inc/inputwin.hxx b/sc/source/ui/inc/inputwin.hxx
index 627c4be..b2bb8b9 100644
--- a/sc/source/ui/inc/inputwin.hxx
+++ b/sc/source/ui/inc/inputwin.hxx
@@ -33,6 +33,7 @@
#include <vcl/toolbox.hxx>
#include <sfx2/childwin.hxx>
#include <svl/lstner.hxx>
+#include <vcl/button.hxx>
#include <vcl/combobox.hxx>
#include <vcl/window.hxx>
#include <svtools/transfer.hxx>
@@ -171,13 +172,21 @@ public:
ScMultiTextWnd( Window* pParent );
virtual void StartEditEngine();
virtual void StopEditEngine( sal_Bool bAll );
+ void SetMultiLineStatus(bool bMode);
+ bool GetMultiLineStatus();
+ int GetLineCount();
+ void SetSize(bool bIsMultiLine);
+ virtual void Resize();
protected:
void InitEditEngine(SfxObjectShell* pObjSh);
virtual void Paint( const Rectangle& rRec );
- virtual void Resize();
+private:
+ bool bIsMultiLine;
};
+//================================================================================
+
class ScInputBarGroup : public ScTextWndBase
{
@@ -203,11 +212,15 @@ public:
private:
- ScMultiTextWnd aTextWindow;
+ ScMultiTextWnd aMultiTextWnd;
+ PushButton aButton;
bool bIsMultiLine;
+
+ DECL_LINK( ClickHdl, PushButton* );
};
+//================================================================================
class ScInputWindow : public ToolBox // Parent-Toolbox
{
Context
- [Libreoffice] [GSOC][patch] Multiline inputbar · Anurag Jain
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.