summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGergo Mocsi <gmocsi91@gmail.com>2013-07-29 18:41:27 +0200
committerGergo Mocsi <gmocsi91@gmail.com>2013-07-29 18:41:27 +0200
commit27487350a0ac29f8b8997277d1e602d24e178ece (patch)
tree7d251615201b1d9fa3d5321fed278ae55e541da6
parentbd5ac5bce9492991c7ff26d5149f0d8679a2a050 (diff)
GSOC work, listbox appearance fix
Fixed the listbox appearance even the source file is scrolled. When scrolling, and the listbox is visible, it gets hidden. I've set the Code Completition to defaultly true, to make testing easier. Change-Id: If571a4f1d38751b35fd43ab3c1f13daccd9dd375
-rw-r--r--basctl/source/basicide/baside2b.cxx11
-rw-r--r--basic/source/classes/codecompletecache.cxx2
2 files changed, 10 insertions, 3 deletions
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index a3a8f1080a18..f0f6ae86e7a5 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -462,6 +462,8 @@ void EditorWindow::Command( const CommandEvent& rCEvt )
( rCEvt.GetCommand() == COMMAND_AUTOSCROLL ) )
{
HandleScrollCommand( rCEvt, rModulWindow.GetHScrollBar(), &rModulWindow.GetEditVScrollBar() );
+ if( pCodeCompleteWnd->IsVisible() ) // hide the code complete window
+ pCodeCompleteWnd->ClearAndHide();
}
}
}
@@ -500,7 +502,6 @@ void EditorWindow::KeyInput( const KeyEvent& rKEvt )
// see if there is an accelerator to be processed first
bool bDone = SfxViewShell::Current()->KeyInput( rKEvt );
-
if( rKEvt.GetCharCode() == '"' && CodeCompleteOptions::IsAutoCloseQuotesOn() )
{//autoclose double quotes
TextSelection aSel = GetEditView()->GetSelection();
@@ -632,16 +633,22 @@ void EditorWindow::KeyInput( const KeyEvent& rKEvt )
}
if( aEntryVect.size() > 0 )
{
+ // calculate position
Rectangle aRect = ( (TextEngine*) GetEditEngine() )->PaMtoEditCursor( aSel.GetEnd() , false );
+ long nViewYOffset = pEditView->GetStartDocPos().Y();
+ Point aPoint = aRect.BottomRight();
+ aPoint.Y() = aPoint.Y() - nViewYOffset;
aSel.GetStart().GetIndex() += 1;
aSel.GetEnd().GetIndex() += 1;
pCodeCompleteWnd->ClearListBox();
pCodeCompleteWnd->SetTextSelection(aSel);
+ //fill the listbox
for(unsigned int l = 0; l < aEntryVect.size(); ++l)
{
pCodeCompleteWnd->InsertEntry( aEntryVect[l] );
}
- pCodeCompleteWnd->SetPosPixel( aRect.BottomRight() );
+ //show it
+ pCodeCompleteWnd->SetPosPixel( aPoint );
pCodeCompleteWnd->Show();
pCodeCompleteWnd->ResizeListBox();
pCodeCompleteWnd->SelectFirstEntry();
diff --git a/basic/source/classes/codecompletecache.cxx b/basic/source/classes/codecompletecache.cxx
index b174d1e7149d..0c757df4b2c5 100644
--- a/basic/source/classes/codecompletecache.cxx
+++ b/basic/source/classes/codecompletecache.cxx
@@ -27,7 +27,7 @@ namespace
}
CodeCompleteOptions::CodeCompleteOptions()
-: bIsCodeCompleteOn( false ),
+: bIsCodeCompleteOn( true ),
bIsProcedureAutoCompleteOn( false ),
bIsAutoCloseQuotesOn( false ),
bIsAutoCloseParenthesisOn( false )