diff options
author | August Sodora <augsod@gmail.com> | 2011-11-16 16:45:38 -0500 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2011-11-17 18:41:21 -0600 |
commit | a1deac6043ffdc5fba454f92c42e46de0943f7f7 (patch) | |
tree | f5c6d48469504f32aab4cc32bdf0a18c6c97b94f /basctl/source/basicide/baside2b.cxx | |
parent | a4074e34039b0e570a3aa08cdffde1562892df17 (diff) |
Finished making it possible to toggle line numbers in the basic ide
Diffstat (limited to 'basctl/source/basicide/baside2b.cxx')
-rw-r--r-- | basctl/source/basicide/baside2b.cxx | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx index be082689227a..2a4d8ce6d698 100644 --- a/basctl/source/basicide/baside2b.cxx +++ b/basctl/source/basicide/baside2b.cxx @@ -1630,13 +1630,13 @@ ComplexEditorWindow::ComplexEditorWindow( ModulWindow* pParent ) : aBrkWindow( this ), aLineNumberWindow( this, pParent ), aEdtWindow( this ), - aEWVScrollBar( this, WB_VSCROLL | WB_DRAG ) + aEWVScrollBar( this, WB_VSCROLL | WB_DRAG ), + bLineNumberDisplay(false) { aEdtWindow.SetModulWindow( pParent ); aBrkWindow.SetModulWindow( pParent ); aEdtWindow.Show(); aBrkWindow.Show(); - aLineNumberWindow.Show(); aEWVScrollBar.SetLineSize( SCROLL_LINE ); aEWVScrollBar.SetPageSize( SCROLL_PAGE ); @@ -1659,8 +1659,16 @@ void ComplexEditorWindow::Resize() Size aLnSz(aLineNumberWindow.GetWidth(), aSz.Height()); aLineNumberWindow.SetPosSizePixel(Point(DWBORDER+aBrkSz.Width() - 1, DWBORDER), aLnSz); - Size aEWSz(aSz.Width() - nBrkWidth - aLineNumberWindow.GetWidth() - nSBWidth + 2, aSz.Height()); - aEdtWindow.SetPosSizePixel( Point( DWBORDER+aBrkSz.Width()+aLnSz.Width()-1, DWBORDER ), aEWSz ); + if(bLineNumberDisplay) + { + Size aEWSz(aSz.Width() - nBrkWidth - aLineNumberWindow.GetWidth() - nSBWidth + 2, aSz.Height()); + aEdtWindow.SetPosSizePixel( Point( DWBORDER+aBrkSz.Width()+aLnSz.Width()-1, DWBORDER ), aEWSz ); + } + else + { + Size aEWSz(aSz.Width() - nBrkWidth - nSBWidth + 1, aSz.Height()); + aEdtWindow.SetPosSizePixel(Point(DWBORDER + aBrkSz.Width() - 1, DWBORDER), aEWSz); + } aEWVScrollBar.SetPosSizePixel( Point( aOutSz.Width()-DWBORDER-nSBWidth, DWBORDER ), Size( nSBWidth, aSz.Height() ) ); } @@ -1696,6 +1704,20 @@ void ComplexEditorWindow::DataChanged(DataChangedEvent const & rDCEvt) } } +void ComplexEditorWindow::SetLineNumberDisplay(bool b) +{ + if(b == bLineNumberDisplay) + return; + + if(b) + aLineNumberWindow.Show(); + else + aLineNumberWindow.Hide(); + + bLineNumberDisplay = b; + Resize(); +} + uno::Reference< awt::XWindowPeer > EditorWindow::GetComponentInterface(sal_Bool bCreate) { |