diff options
author | Gergo Mocsi <gmocsi91@gmail.com> | 2013-07-29 18:41:27 +0200 |
---|---|---|
committer | Gergo Mocsi <gmocsi91@gmail.com> | 2013-09-02 18:16:51 +0200 |
commit | 92374fb966d35a1f2584c1d4fc1459b350a70474 (patch) | |
tree | 81973940c6730ce1f7fa8fad631dad95d645cdda /basctl | |
parent | GSOC work, nested reflection fix - again (diff) | |
download | core-92374fb966d35a1f2584c1d4fc1459b350a70474.tar.gz core-92374fb966d35a1f2584c1d4fc1459b350a70474.zip |
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
Diffstat (limited to 'basctl')
-rw-r--r-- | basctl/source/basicide/baside2b.cxx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx index b65e6d10dd1b..3e39f1a5b97e 100644 --- a/basctl/source/basicide/baside2b.cxx +++ b/basctl/source/basicide/baside2b.cxx @@ -468,6 +468,8 @@ void EditorWindow::Command( const CommandEvent& rCEvt ) { pDispatcher->ExecutePopup(); } + if( pCodeCompleteWnd->IsVisible() ) // hide the code complete window + pCodeCompleteWnd->ClearAndHide(); } } } @@ -506,7 +508,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(); @@ -638,16 +639,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(); |