[Libreoffice-commits] core.git: vcl/source
Philipp Weissenbacher
p.weissenbacher at gmail.com
Mon Mar 25 02:24:56 PDT 2013
vcl/source/control/longcurr.cxx | 103 ++-------------------
vcl/source/control/lstbox.cxx | 190 ++++++++++------------------------------
vcl/source/control/menubtn.cxx | 32 +-----
vcl/source/control/morebtn.cxx | 44 +--------
vcl/source/control/prgsbar.cxx | 28 -----
vcl/source/control/scrbar.cxx | 134 +++++++---------------------
6 files changed, 114 insertions(+), 417 deletions(-)
New commits:
commit 25810de17f143a0946634fa5ba9f68977fc63cfd
Author: Philipp Weissenbacher <p.weissenbacher at gmail.com>
Date: Fri Mar 22 20:47:21 2013 +0100
Translate German comments, fix some whitespace
Change-Id: I44eba784d51522b67826051d20ba8939f195dccb
Reviewed-on: https://gerrit.libreoffice.org/2916
Reviewed-by: Thomas Arnhold <thomas at arnhold.org>
Tested-by: Thomas Arnhold <thomas at arnhold.org>
diff --git a/vcl/source/control/longcurr.cxx b/vcl/source/control/longcurr.cxx
index d84b404..ba5e5b3 100644
--- a/vcl/source/control/longcurr.cxx
+++ b/vcl/source/control/longcurr.cxx
@@ -35,12 +35,8 @@
using namespace ::comphelper;
-// =======================================================================
-
#define FORMAT_LONGCURRENCY 4
-// =======================================================================
-
static BigInt ImplPower10( sal_uInt16 n )
{
sal_uInt16 i;
@@ -52,11 +48,9 @@ static BigInt ImplPower10( sal_uInt16 n )
return nValue;
}
-// -----------------------------------------------------------------------
-
static XubString ImplGetCurr( const LocaleDataWrapper& rLocaleDataWrapper, const BigInt &rNumber, sal_uInt16 nDigits, const String& rCurrSymbol, sal_Bool bShowThousandSep )
{
- DBG_ASSERT( nDigits < 10, "LongCurrency duerfen nur maximal 9 Nachkommastellen haben" );
+ DBG_ASSERT( nDigits < 10, "LongCurrency may only have 9 decimal places" );
if ( rNumber.IsZero() || (long)rNumber )
return rLocaleDataWrapper.getCurr( (long)rNumber, nDigits, rCurrSymbol, bShowThousandSep );
@@ -100,8 +94,6 @@ static XubString ImplGetCurr( const LocaleDataWrapper& rLocaleDataWrapper, const
return aTemplate;
}
-// -----------------------------------------------------------------------
-
static sal_Bool ImplNumericProcessKeyInput( Edit*, const KeyEvent& rKEvt,
sal_Bool bStrictFormat, sal_Bool bThousandSep,
const LocaleDataWrapper& rLocaleDataWrapper )
@@ -125,26 +117,24 @@ static sal_Bool ImplNumericProcessKeyInput( Edit*, const KeyEvent& rKEvt,
}
}
-// -----------------------------------------------------------------------
-
static sal_Bool ImplNumericGetValue( const XubString& rStr, BigInt& rValue,
sal_uInt16 nDecDigits, const LocaleDataWrapper& rLocaleDataWrapper,
sal_Bool bCurrency = sal_False )
{
- XubString aStr = rStr;
- XubString aStr1;
+ XubString aStr = rStr;
+ XubString aStr1;
rtl::OUStringBuffer aStr2;
- sal_uInt16 nDecPos;
- sal_Bool bNegative = sal_False;
+ sal_uInt16 nDecPos;
+ sal_Bool bNegative = sal_False;
- // Reaktion auf leeren String
+ // On empty string
if ( !rStr.Len() )
return sal_False;
- // Fuehrende und nachfolgende Leerzeichen entfernen
+ // Trim leading and trailing spaces
aStr = string::strip(aStr, ' ');
- // Position des Dezimalpunktes suchen
+ // Find decimal sign's position
nDecPos = aStr.Search( rLocaleDataWrapper.getNumDecimalSep() );
if ( nDecPos != STRING_NOTFOUND )
@@ -155,7 +145,7 @@ static sal_Bool ImplNumericGetValue( const XubString& rStr, BigInt& rValue,
else
aStr1 = aStr;
- // Negativ ?
+ // Negative?
if ( bCurrency )
{
if ( (aStr.GetChar( 0 ) == '(') && (aStr.GetChar( aStr.Len()-1 ) == ')') )
@@ -198,7 +188,7 @@ static sal_Bool ImplNumericGetValue( const XubString& rStr, BigInt& rValue,
bNegative = sal_True;
}
- // Alle unerwuenschten Zeichen rauswerfen
+ // Throw out all unwanted chars
for (xub_StrLen i=0; i < aStr1.Len(); )
{
if ( (aStr1.GetChar( i ) >= '0') && (aStr1.GetChar( i ) <= '9') )
@@ -222,7 +212,7 @@ static sal_Bool ImplNumericGetValue( const XubString& rStr, BigInt& rValue,
if ( bNegative )
aStr1.Insert( '-', 0 );
- // Nachkommateil zurechtstutzen und dabei runden
+ // Cut down decimal part and round while doing so
bool bRound = false;
if (aStr2.getLength() > nDecDigits)
{
@@ -236,7 +226,7 @@ static sal_Bool ImplNumericGetValue( const XubString& rStr, BigInt& rValue,
aStr = aStr1;
aStr += aStr2.makeStringAndClear();
- // Bereichsueberpruefung
+ // Boundscheck
BigInt nValue( aStr );
if ( bRound )
{
@@ -251,27 +241,19 @@ static sal_Bool ImplNumericGetValue( const XubString& rStr, BigInt& rValue,
return sal_True;
}
-// =======================================================================
-
static sal_Bool ImplLongCurrencyProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
sal_Bool, sal_Bool bUseThousandSep, const LocaleDataWrapper& rLocaleDataWrapper )
{
- // Es gibt hier kein sinnvolles StrictFormat, also alle
- // Zeichen erlauben
+ // There's no StrictFormat that makes sense here, thus allow all chars
return ImplNumericProcessKeyInput( pEdit, rKEvt, sal_False, bUseThousandSep, rLocaleDataWrapper );
}
-// -----------------------------------------------------------------------
-
inline sal_Bool ImplLongCurrencyGetValue( const XubString& rStr, BigInt& rValue,
sal_uInt16 nDecDigits, const LocaleDataWrapper& rLocaleDataWrapper )
{
- // Zahlenwert holen
return ImplNumericGetValue( rStr, rValue, nDecDigits, rLocaleDataWrapper, sal_True );
}
-// -----------------------------------------------------------------------
-
sal_Bool ImplLongCurrencyReformat( const XubString& rStr, BigInt nMin, BigInt nMax,
sal_uInt16 nDecDigits,
const LocaleDataWrapper& rLocaleDataWrapper, String& rOutStr,
@@ -307,9 +289,6 @@ sal_Bool ImplLongCurrencyReformat( const XubString& rStr, BigInt nMin, BigInt nM
}
}
-
-// =======================================================================
-
void LongCurrencyFormatter::ImpInit()
{
mnFieldValue = 0;
@@ -324,36 +303,26 @@ void LongCurrencyFormatter::ImpInit()
SetDecimalDigits( 0 );
}
-// -----------------------------------------------------------------------
-
LongCurrencyFormatter::LongCurrencyFormatter()
{
ImpInit();
}
-// -----------------------------------------------------------------------
-
LongCurrencyFormatter::~LongCurrencyFormatter()
{
}
-// -----------------------------------------------------------------------
-
void LongCurrencyFormatter::SetCurrencySymbol( const String& rStr )
{
maCurrencySymbol= rStr;
ReformatAll();
}
-// -----------------------------------------------------------------------
-
String LongCurrencyFormatter::GetCurrencySymbol() const
{
return !maCurrencySymbol.isEmpty() ? maCurrencySymbol : GetLocaleDataWrapper().getCurrSymbol();
}
-// -----------------------------------------------------------------------
-
void LongCurrencyFormatter::SetValue( BigInt nNewValue )
{
SetUserValue( nNewValue );
@@ -361,8 +330,6 @@ void LongCurrencyFormatter::SetValue( BigInt nNewValue )
SetEmptyFieldValueData( sal_False );
}
-// -----------------------------------------------------------------------
-
void LongCurrencyFormatter::SetUserValue( BigInt nNewValue )
{
if ( nNewValue > mnMax )
@@ -386,8 +353,6 @@ void LongCurrencyFormatter::SetUserValue( BigInt nNewValue )
MarkToBeReformatted( sal_False );
}
-// -----------------------------------------------------------------------
-
BigInt LongCurrencyFormatter::GetValue() const
{
if ( !GetField() )
@@ -406,8 +371,6 @@ BigInt LongCurrencyFormatter::GetValue() const
return mnLastValue;
}
-// -----------------------------------------------------------------------
-
void LongCurrencyFormatter::Reformat()
{
if ( !GetField() )
@@ -432,43 +395,31 @@ void LongCurrencyFormatter::Reformat()
SetValue( mnLastValue );
}
-// -----------------------------------------------------------------------
-
void LongCurrencyFormatter::ReformatAll()
{
Reformat();
}
-// -----------------------------------------------------------------------
-
void LongCurrencyFormatter::SetMin( BigInt nNewMin )
{
mnMin = nNewMin;
ReformatAll();
}
-// -----------------------------------------------------------------------
-
void LongCurrencyFormatter::SetMax( BigInt nNewMax )
{
mnMax = nNewMax;
ReformatAll();
}
-// -----------------------------------------------------------------------
-
void LongCurrencyFormatter::SetUseThousandSep( sal_Bool b )
{
mbThousandSep = b;
ReformatAll();
}
-
-// -----------------------------------------------------------------------
-
void LongCurrencyFormatter::SetDecimalDigits( sal_uInt16 nDigits )
{
-// DBG_ASSERT( nDigits < 10, "LongCurrency duerfen nur maximal 9 Nachkommastellen haben" );
if ( nDigits > 9 )
nDigits = 9;
@@ -477,15 +428,11 @@ void LongCurrencyFormatter::SetDecimalDigits( sal_uInt16 nDigits )
ReformatAll();
}
-// -----------------------------------------------------------------------
-
sal_uInt16 LongCurrencyFormatter::GetDecimalDigits() const
{
return mnDecimalDigits;
}
-// =======================================================================
-
void ImplNewLongCurrencyFieldValue( LongCurrencyField* pField, BigInt nNewValue )
{
Selection aSelect = pField->GetSelection();
@@ -508,8 +455,6 @@ void ImplNewLongCurrencyFieldValue( LongCurrencyField* pField, BigInt nNewValue
pField->Modify();
}
-// =======================================================================
-
LongCurrencyField::LongCurrencyField( Window* pParent, WinBits nWinStyle ) :
SpinField( pParent, nWinStyle )
{
@@ -521,13 +466,11 @@ LongCurrencyField::LongCurrencyField( Window* pParent, WinBits nWinStyle ) :
Reformat();
}
-// -----------------------------------------------------------------------
LongCurrencyField::~LongCurrencyField()
{
}
-// -----------------------------------------------------------------------
long LongCurrencyField::PreNotify( NotifyEvent& rNEvt )
{
@@ -539,7 +482,6 @@ long LongCurrencyField::PreNotify( NotifyEvent& rNEvt )
return SpinField::PreNotify( rNEvt );
}
-// -----------------------------------------------------------------------
long LongCurrencyField::Notify( NotifyEvent& rNEvt )
{
@@ -558,7 +500,6 @@ long LongCurrencyField::Notify( NotifyEvent& rNEvt )
return SpinField::Notify( rNEvt );
}
-// -----------------------------------------------------------------------
void LongCurrencyField::Modify()
{
@@ -566,7 +507,6 @@ void LongCurrencyField::Modify()
SpinField::Modify();
}
-// -----------------------------------------------------------------------
void LongCurrencyField::Up()
{
@@ -579,8 +519,6 @@ void LongCurrencyField::Up()
SpinField::Up();
}
-// -----------------------------------------------------------------------
-
void LongCurrencyField::Down()
{
BigInt nValue = GetValue();
@@ -592,7 +530,6 @@ void LongCurrencyField::Down()
SpinField::Down();
}
-// -----------------------------------------------------------------------
void LongCurrencyField::First()
{
@@ -600,7 +537,6 @@ void LongCurrencyField::First()
SpinField::First();
}
-// -----------------------------------------------------------------------
void LongCurrencyField::Last()
{
@@ -608,8 +544,6 @@ void LongCurrencyField::Last()
SpinField::Last();
}
-// =======================================================================
-
LongCurrencyBox::LongCurrencyBox( Window* pParent, WinBits nWinStyle ) :
ComboBox( pParent, nWinStyle )
{
@@ -617,14 +551,10 @@ LongCurrencyBox::LongCurrencyBox( Window* pParent, WinBits nWinStyle ) :
Reformat();
}
-// -----------------------------------------------------------------------
-
LongCurrencyBox::~LongCurrencyBox()
{
}
-// -----------------------------------------------------------------------
-
long LongCurrencyBox::PreNotify( NotifyEvent& rNEvt )
{
if( rNEvt.GetType() == EVENT_KEYINPUT )
@@ -635,7 +565,6 @@ long LongCurrencyBox::PreNotify( NotifyEvent& rNEvt )
return ComboBox::PreNotify( rNEvt );
}
-// -----------------------------------------------------------------------
long LongCurrencyBox::Notify( NotifyEvent& rNEvt )
{
@@ -654,16 +583,12 @@ long LongCurrencyBox::Notify( NotifyEvent& rNEvt )
return ComboBox::Notify( rNEvt );
}
-// -----------------------------------------------------------------------
-
void LongCurrencyBox::Modify()
{
MarkToBeReformatted( sal_True );
ComboBox::Modify();
}
-// -----------------------------------------------------------------------
-
void LongCurrencyBox::ReformatAll()
{
XubString aStr;
@@ -681,6 +606,4 @@ void LongCurrencyBox::ReformatAll()
SetUpdateMode( sal_True );
}
-// =======================================================================
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx
index cb15f0a..9b15759 100644
--- a/vcl/source/control/lstbox.cxx
+++ b/vcl/source/control/lstbox.cxx
@@ -38,14 +38,12 @@
#include <com/sun/star/datatransfer/dnd/XDropTarget.hpp>
-// =======================================================================
ListBox::ListBox( WindowType nType ) : Control( nType )
{
ImplInitListBoxData();
}
-// -----------------------------------------------------------------------
ListBox::ListBox( Window* pParent, WinBits nStyle ) : Control( WINDOW_LISTBOX )
{
@@ -53,7 +51,6 @@ ListBox::ListBox( Window* pParent, WinBits nStyle ) : Control( WINDOW_LISTBOX )
ImplInit( pParent, nStyle );
}
-// -----------------------------------------------------------------------
ListBox::ListBox( Window* pParent, const ResId& rResId ) :
Control( WINDOW_LISTBOX )
@@ -68,15 +65,13 @@ ListBox::ListBox( Window* pParent, const ResId& rResId ) :
Show();
}
-// -----------------------------------------------------------------------
ListBox::~ListBox()
{
- //#109201#
ImplCallEventListeners( VCLEVENT_OBJECT_DYING );
- // Beim zerstoeren des FloatWins macht TH ein GrabFocus auf den Parent,
- // also diese ListBox => PreNotify()...
+ // When destroying the FloatWin TH does a GrabFocus to the Parent:
+ // that means this "ListBox => PreNotify() ..."
ImplListBox *pImplLB = mpImplLB;
mpImplLB = NULL;
delete pImplLB;
@@ -86,7 +81,6 @@ ListBox::~ListBox()
delete mpBtn;
}
-// -----------------------------------------------------------------------
void ListBox::ImplInitListBoxData()
{
@@ -101,7 +95,6 @@ void ListBox::ImplInitListBoxData()
m_nMaxWidthChars = -1;
}
-// -----------------------------------------------------------------------
void ListBox::ImplInit( Window* pParent, WinBits nStyle )
{
@@ -182,7 +175,6 @@ void ListBox::ImplInit( Window* pParent, WinBits nStyle )
SetCompoundControl( sal_True );
}
-// -----------------------------------------------------------------------
WinBits ListBox::ImplInitStyle( WinBits nStyle )
{
@@ -193,7 +185,6 @@ WinBits ListBox::ImplInitStyle( WinBits nStyle )
return nStyle;
}
-// -----------------------------------------------------------------------
void ListBox::ImplLoadRes( const ResId& rResId )
{
@@ -208,14 +199,13 @@ void ListBox::ImplLoadRes( const ResId& rResId )
long nId = ReadLongRes();
if( nId )
- SetEntryData( nPos, (void *)nId ); // ID als UserData
+ SetEntryData( nPos, (void *)nId ); // ID as UserData
}
if( nSelPos < nNumber )
SelectEntryPos( nSelPos );
}
-// -----------------------------------------------------------------------
IMPL_LINK_NOARG(ListBox, ImplSelectHdl)
{
@@ -244,7 +234,6 @@ IMPL_LINK_NOARG(ListBox, ImplSelectHdl)
return 1;
}
-// -----------------------------------------------------------------------
IMPL_LINK_NOARG(ListBox, ImplScrollHdl)
{
@@ -252,7 +241,6 @@ IMPL_LINK_NOARG(ListBox, ImplScrollHdl)
return 1;
}
-// -----------------------------------------------------------------------
IMPL_LINK_NOARG(ListBox, ImplCancelHdl)
{
@@ -262,7 +250,6 @@ IMPL_LINK_NOARG(ListBox, ImplCancelHdl)
return 1;
}
-// -----------------------------------------------------------------------
IMPL_LINK( ListBox, ImplSelectionChangedHdl, void*, n )
{
@@ -272,7 +259,7 @@ IMPL_LINK( ListBox, ImplSelectionChangedHdl, void*, n )
const ImplEntryList* pEntryList = mpImplLB->GetEntryList();
if ( pEntryList->IsEntryPosSelected( nChanged ) )
{
- // Sollte mal ein ImplPaintEntry werden...
+ // FIXME? This should've been turned into an ImplPaintEntry some time ago...
if ( nChanged < pEntryList->GetMRUCount() )
nChanged = pEntryList->FindEntry( pEntryList->GetEntryText( nChanged ) );
mpImplWin->SetItemPos( nChanged );
@@ -295,7 +282,6 @@ IMPL_LINK( ListBox, ImplSelectionChangedHdl, void*, n )
return 1;
}
-// -----------------------------------------------------------------------
IMPL_LINK_NOARG(ListBox, ImplDoubleClickHdl)
{
@@ -303,7 +289,6 @@ IMPL_LINK_NOARG(ListBox, ImplDoubleClickHdl)
return 1;
}
-// -----------------------------------------------------------------------
IMPL_LINK_NOARG(ListBox, ImplClickBtnHdl)
{
@@ -325,7 +310,6 @@ IMPL_LINK_NOARG(ListBox, ImplClickBtnHdl)
return 0;
}
-// -----------------------------------------------------------------------
IMPL_LINK_NOARG(ListBox, ImplPopupModeEndHdl)
{
@@ -360,7 +344,6 @@ IMPL_LINK_NOARG(ListBox, ImplPopupModeEndHdl)
return 0;
}
-// -----------------------------------------------------------------------
void ListBox::ToggleDropDown()
{
@@ -379,7 +362,6 @@ void ListBox::ToggleDropDown()
}
}
-// -----------------------------------------------------------------------
void ListBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags )
{
@@ -414,7 +396,7 @@ void ListBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sa
}
}
- // Inhalt
+ // Content
if ( ( nFlags & WINDOW_DRAW_MONO ) || ( eOutDevType == OUTDEV_PRINTER ) )
{
pDev->SetTextColor( Color( COL_BLACK ) );
@@ -432,9 +414,9 @@ void ListBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sa
}
}
- long nOnePixel = GetDrawPixel( pDev, 1 );
- sal_uInt16 nTextStyle = TEXT_DRAW_VCENTER;
- Rectangle aTextRect( aPos, aSize );
+ long nOnePixel = GetDrawPixel( pDev, 1 );
+ sal_uInt16 nTextStyle = TEXT_DRAW_VCENTER;
+ Rectangle aTextRect( aPos, aSize );
if ( GetStyle() & WB_CENTER )
nTextStyle |= TEXT_DRAW_CENTER;
@@ -461,7 +443,7 @@ void ListBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sa
{
Rectangle aClip( aPos, aSize );
if ( nTextHeight > aSize.Height() )
- aClip.Bottom() += nTextHeight-aSize.Height()+1; // Damit HP-Drucker nicht 'weg-optimieren'
+ aClip.Bottom() += nTextHeight-aSize.Height()+1; // So that HP Printers don't optimize this away
pDev->IntersectClipRegion( aClip );
}
@@ -470,7 +452,7 @@ void ListBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sa
else
{
long nTextHeight = pDev->GetTextHeight();
- sal_uInt16 nLines = (sal_uInt16)(aSize.Height() / nTextHeight);
+ sal_uInt16 nLines = (sal_uInt16)(aSize.Height() / nTextHeight);
Rectangle aClip( aPos, aSize );
pDev->IntersectClipRegion( aClip );
@@ -504,7 +486,6 @@ void ListBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sa
pDev->Pop();
}
-// -----------------------------------------------------------------------
void ListBox::GetFocus()
{
@@ -519,7 +500,6 @@ void ListBox::GetFocus()
Control::GetFocus();
}
-// -----------------------------------------------------------------------
Window* ListBox::GetPreferredKeyInputWindow()
{
@@ -534,7 +514,6 @@ Window* ListBox::GetPreferredKeyInputWindow()
return Control::GetPreferredKeyInputWindow();
}
-// -----------------------------------------------------------------------
void ListBox::LoseFocus()
{
@@ -546,7 +525,6 @@ void ListBox::LoseFocus()
Control::LoseFocus();
}
-// -----------------------------------------------------------------------
void ListBox::DataChanged( const DataChangedEvent& rDCEvt )
{
@@ -557,14 +535,14 @@ void ListBox::DataChanged( const DataChangedEvent& rDCEvt )
((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
- SetBackground(); // due to a hack in Window::UpdateSettings the background must be reset
+ SetBackground(); // Due to a hack in Window::UpdateSettings the background must be reset
// otherwise it will overpaint NWF drawn listboxes
Resize();
- mpImplLB->Resize(); // Wird nicht durch ListBox::Resize() gerufen, wenn sich die ImplLB nicht aendert.
+ mpImplLB->Resize(); // Is not called by ListBox::Resize() if the ImplLB does not change
if ( mpImplWin )
{
- mpImplWin->SetSettings( GetSettings() ); // Falls noch nicht eingestellt...
+ mpImplWin->SetSettings( GetSettings() ); // If not yet set...
ImplInitFieldSettings( mpImplWin, sal_True, sal_True, sal_True );
mpBtn->SetSettings( GetSettings() );
@@ -577,7 +555,6 @@ void ListBox::DataChanged( const DataChangedEvent& rDCEvt )
}
}
-// -----------------------------------------------------------------------
void ListBox::EnableAutoSize( sal_Bool bAuto )
{
@@ -591,7 +568,6 @@ void ListBox::EnableAutoSize( sal_Bool bAuto )
}
}
-// -----------------------------------------------------------------------
void ListBox::EnableDDAutoWidth( sal_Bool b )
{
@@ -599,7 +575,6 @@ void ListBox::EnableDDAutoWidth( sal_Bool b )
mpFloatWin->SetAutoWidth( b );
}
-// -----------------------------------------------------------------------
void ListBox::SetDropDownLineCount( sal_uInt16 nLines )
{
@@ -608,7 +583,6 @@ void ListBox::SetDropDownLineCount( sal_uInt16 nLines )
mpFloatWin->SetDropDownLineCount( mnLineCount );
}
-// -----------------------------------------------------------------------
sal_uInt16 ListBox::GetDropDownLineCount() const
{
@@ -617,7 +591,6 @@ sal_uInt16 ListBox::GetDropDownLineCount() const
return mnLineCount;
}
-// -----------------------------------------------------------------------
void ListBox::setPosSizePixel( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags )
{
@@ -637,49 +610,48 @@ void ListBox::setPosSizePixel( long nX, long nY, long nWidth, long nHeight, sal_
Control::setPosSizePixel( nX, nY, nWidth, nHeight, nFlags );
}
-// -----------------------------------------------------------------------
void ListBox::Resize()
{
Size aOutSz = GetOutputSizePixel();
if( IsDropDownBox() )
{
- // initialize the dropdown button size with the standard scrollbar width
+ // Initialize the dropdown button size with the standard scrollbar width
long nSBWidth = GetSettings().GetStyleSettings().GetScrollBarSize();
- long nBottom = aOutSz.Height();
+ long nBottom = aOutSz.Height();
- // note: in case of no border, pBorder will actually be this
+ // Note: in case of no border, pBorder will actually be this
Window *pBorder = GetWindow( WINDOW_BORDER );
ImplControlValue aControlValue;
Point aPoint;
Rectangle aContent, aBound;
- // use the full extent of the control
+ // Use the full extent of the control
Rectangle aArea( aPoint, pBorder->GetOutputSizePixel() );
if ( GetNativeControlRegion( CTRL_LISTBOX, PART_BUTTON_DOWN,
aArea, 0, aControlValue, rtl::OUString(), aBound, aContent) )
{
long nTop = 0;
- // convert back from border space to local coordinates
+ // Convert back from border space to local coordinates
aPoint = pBorder->ScreenToOutputPixel( OutputToScreenPixel( aPoint ) );
aContent.Move( -aPoint.X(), -aPoint.Y() );
- // use the themes drop down size for the button
+ // Use the themes drop down size for the button
aOutSz.Width() = aContent.Left();
mpBtn->setPosSizePixel( aContent.Left(), nTop, aContent.Right(), (nBottom-nTop) );
- // adjust the size of the edit field
+ // Adjust the size of the edit field
if ( GetNativeControlRegion( CTRL_LISTBOX, PART_SUB_EDIT,
aArea, 0, aControlValue, rtl::OUString(), aBound, aContent) )
{
- // convert back from border space to local coordinates
+ // Convert back from border space to local coordinates
aContent.Move( -aPoint.X(), -aPoint.Y() );
- // use the themes drop down size
+ // Use the themes drop down size
if( ! (GetStyle() & WB_BORDER) && ImplGetSVData()->maNWFData.mbNoFocusRects )
{
- // no border but focus ring behavior -> we have a problem; the
+ // No border but focus ring behavior -> we have a problem; the
// native rect relies on the border to draw the focus
// let's do the best we can and center vertically, so it doesn't look
// completely wrong.
@@ -705,23 +677,20 @@ void ListBox::Resize()
mpImplLB->SetSizePixel( aOutSz );
}
- // FloatingWindow-Groesse auch im unsichtbare Zustand auf Stand halten,
- // weil KEY_PGUP/DOWN ausgewertet wird...
+ // Retain FloatingWindow size even when it's invisible, as we still process KEY_PGUP/DOWN ...
if ( mpFloatWin )
mpFloatWin->SetSizePixel( mpFloatWin->CalcFloatSize() );
Control::Resize();
}
-// -----------------------------------------------------------------------
-
void ListBox::FillLayoutData() const
{
mpControlData->mpLayoutData = new vcl::ControlLayoutData();
const Control* pMainWin = mpImplLB->GetMainWindow();
if( mpFloatWin )
{
- // dropdown mode
+ // Dropdown mode
AppendLayoutData( *mpImplWin );
mpImplWin->SetLayoutDataParent( this );
if( mpFloatWin->IsReallyVisible() )
@@ -737,44 +706,42 @@ void ListBox::FillLayoutData() const
}
}
-// -----------------------------------------------------------------------
-
long ListBox::GetIndexForPoint( const Point& rPoint, sal_uInt16& rPos ) const
{
if( !HasLayoutData() )
FillLayoutData();
- // check whether rPoint fits at all
+ // Check whether rPoint fits at all
long nIndex = Control::GetIndexForPoint( rPoint );
if( nIndex != -1 )
{
- // point must be either in main list window
+ // Point must be either in main list window
// or in impl window (dropdown case)
ImplListBoxWindow* pMain = mpImplLB->GetMainWindow();
- // convert coordinates to ImplListBoxWindow pixel coordinate space
+ // Convert coordinates to ImplListBoxWindow pixel coordinate space
Point aConvPoint = LogicToPixel( rPoint );
aConvPoint = OutputToAbsoluteScreenPixel( aConvPoint );
aConvPoint = pMain->AbsoluteScreenToOutputPixel( aConvPoint );
aConvPoint = pMain->PixelToLogic( aConvPoint );
- // try to find entry
+ // Try to find entry
sal_uInt16 nEntry = pMain->GetEntryPosForPoint( aConvPoint );
if( nEntry == LISTBOX_ENTRY_NOTFOUND )
{
- // not found, maybe dropdown case
+ // Not found, maybe dropdown case
if( mpImplWin && mpImplWin->IsReallyVisible() )
{
- // convert to impl window pixel coordinates
+ // Convert to impl window pixel coordinates
aConvPoint = LogicToPixel( rPoint );
aConvPoint = OutputToAbsoluteScreenPixel( aConvPoint );
aConvPoint = mpImplWin->AbsoluteScreenToOutputPixel( aConvPoint );
- // check whether converted point is inside impl window
+ // Check whether converted point is inside impl window
Size aImplWinSize = mpImplWin->GetOutputSizePixel();
if( aConvPoint.X() >= 0 && aConvPoint.Y() >= 0 && aConvPoint.X() < aImplWinSize.Width() && aConvPoint.Y() < aImplWinSize.Height() )
{
- // inside the impl window, the position is the current item pos
+ // Inside the impl window, the position is the current item pos
rPos = mpImplWin->GetItemPos();
}
else
@@ -789,14 +756,13 @@ long ListBox::GetIndexForPoint( const Point& rPoint, sal_uInt16& rPos ) const
DBG_ASSERT( nIndex != -1, "found index for point, but relative index failed" );
}
- // get line relative index
+ // Get line relative index
if( nIndex != -1 )
nIndex = ToRelativeLineIndex( nIndex );
return nIndex;
}
-// -----------------------------------------------------------------------
void ListBox::StateChanged( StateChangedType nType )
{
@@ -904,7 +870,6 @@ void ListBox::StateChanged( StateChangedType nType )
Control::StateChanged( nType );
}
-// -----------------------------------------------------------------------
long ListBox::PreNotify( NotifyEvent& rNEvt )
{
@@ -983,7 +948,7 @@ long ListBox::PreNotify( NotifyEvent& rNEvt )
}
else
{
- nDone = 0; // don't eat this event, let the default handling happen (i.e. scroll the context)
+ nDone = 0; // Don't consume this event, let the default handling take it (i.e. scroll the context)
}
}
}
@@ -991,21 +956,18 @@ long ListBox::PreNotify( NotifyEvent& rNEvt )
return nDone ? nDone : Control::PreNotify( rNEvt );
}
-// -----------------------------------------------------------------------
void ListBox::Select()
{
ImplCallEventListenersAndHandler( VCLEVENT_LISTBOX_SELECT, maSelectHdl, this );
}
-// -----------------------------------------------------------------------
void ListBox::DoubleClick()
{
ImplCallEventListenersAndHandler( VCLEVENT_LISTBOX_DOUBLECLICK, maDoubleClickHdl, this );
}
-// -----------------------------------------------------------------------
void ListBox::Clear()
{
@@ -1021,7 +983,6 @@ void ListBox::Clear()
CallEventListeners( VCLEVENT_LISTBOX_ITEMREMOVED, (void*) sal_IntPtr(-1) );
}
-// -----------------------------------------------------------------------
void ListBox::SetNoSelection()
{
@@ -1036,7 +997,6 @@ void ListBox::SetNoSelection()
}
}
-// -----------------------------------------------------------------------
sal_uInt16 ListBox::InsertEntry( const XubString& rStr, sal_uInt16 nPos )
{
@@ -1046,7 +1006,6 @@ sal_uInt16 ListBox::InsertEntry( const XubString& rStr, sal_uInt16 nPos )
return nRealPos;
}
-// -----------------------------------------------------------------------
sal_uInt16 ListBox::InsertEntry( const Image& rImage, sal_uInt16 nPos )
{
@@ -1056,7 +1015,6 @@ sal_uInt16 ListBox::InsertEntry( const Image& rImage, sal_uInt16 nPos )
return nRealPos;
}
-// -----------------------------------------------------------------------
sal_uInt16 ListBox::InsertEntry( const XubString& rStr, const Image& rImage, sal_uInt16 nPos )
{
@@ -1066,14 +1024,12 @@ sal_uInt16 ListBox::InsertEntry( const XubString& rStr, const Image& rImage, sal
return nRealPos;
}
-// -----------------------------------------------------------------------
void ListBox::RemoveEntry( const XubString& rStr )
{
RemoveEntry( GetEntryPos( rStr ) );
}
-// -----------------------------------------------------------------------
void ListBox::RemoveEntry( sal_uInt16 nPos )
{
@@ -1081,7 +1037,6 @@ void ListBox::RemoveEntry( sal_uInt16 nPos )
CallEventListeners( VCLEVENT_LISTBOX_ITEMREMOVED, (void*) sal_IntPtr(nPos) );
}
-// -----------------------------------------------------------------------
Image ListBox::GetEntryImage( sal_uInt16 nPos ) const
{
@@ -1090,7 +1045,6 @@ Image ListBox::GetEntryImage( sal_uInt16 nPos ) const
return Image();
}
-// -----------------------------------------------------------------------
sal_uInt16 ListBox::GetEntryPos( const XubString& rStr ) const
{
@@ -1100,7 +1054,6 @@ sal_uInt16 ListBox::GetEntryPos( const XubString& rStr ) const
return nPos;
}
-// -----------------------------------------------------------------------
sal_uInt16 ListBox::GetEntryPos( const void* pData ) const
{
@@ -1110,35 +1063,30 @@ sal_uInt16 ListBox::GetEntryPos( const void* pData ) const
return nPos;
}
-// -----------------------------------------------------------------------
XubString ListBox::GetEntry( sal_uInt16 nPos ) const
{
return mpImplLB->GetEntryList()->GetEntryText( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
}
-// -----------------------------------------------------------------------
sal_uInt16 ListBox::GetEntryCount() const
{
return mpImplLB->GetEntryList()->GetEntryCount() - mpImplLB->GetEntryList()->GetMRUCount();
}
-// -----------------------------------------------------------------------
XubString ListBox::GetSelectEntry( sal_uInt16 nIndex ) const
{
return GetEntry( GetSelectEntryPos( nIndex ) );
}
-// -----------------------------------------------------------------------
sal_uInt16 ListBox::GetSelectEntryCount() const
{
return mpImplLB->GetEntryList()->GetSelectEntryCount();
}
-// -----------------------------------------------------------------------
sal_uInt16 ListBox::GetSelectEntryPos( sal_uInt16 nIndex ) const
{
@@ -1152,28 +1100,24 @@ sal_uInt16 ListBox::GetSelectEntryPos( sal_uInt16 nIndex ) const
return nPos;
}
-// -----------------------------------------------------------------------
sal_Bool ListBox::IsEntrySelected( const XubString& rStr ) const
{
return IsEntryPosSelected( GetEntryPos( rStr ) );
}
-// -----------------------------------------------------------------------
sal_Bool ListBox::IsEntryPosSelected( sal_uInt16 nPos ) const
{
return mpImplLB->GetEntryList()->IsEntryPosSelected( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
}
-// -----------------------------------------------------------------------
void ListBox::SelectEntry( const XubString& rStr, sal_Bool bSelect )
{
SelectEntryPos( GetEntryPos( rStr ), bSelect );
}
-// -----------------------------------------------------------------------
void ListBox::SelectEntryPos( sal_uInt16 nPos, sal_Bool bSelect )
{
@@ -1181,42 +1125,36 @@ void ListBox::SelectEntryPos( sal_uInt16 nPos, sal_Bool bSelect )
mpImplLB->SelectEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), bSelect );
}
-// -----------------------------------------------------------------------
void ListBox::SetEntryData( sal_uInt16 nPos, void* pNewData )
{
mpImplLB->SetEntryData( nPos + mpImplLB->GetEntryList()->GetMRUCount(), pNewData );
}
-// -----------------------------------------------------------------------
void* ListBox::GetEntryData( sal_uInt16 nPos ) const
{
return mpImplLB->GetEntryList()->GetEntryData( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
}
-// -----------------------------------------------------------------------
void ListBox::SetEntryFlags( sal_uInt16 nPos, long nFlags )
{
mpImplLB->SetEntryFlags( nPos + mpImplLB->GetEntryList()->GetMRUCount(), nFlags );
}
-// -----------------------------------------------------------------------
long ListBox::GetEntryFlags( sal_uInt16 nPos ) const
{
return mpImplLB->GetEntryList()->GetEntryFlags( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
}
-// -----------------------------------------------------------------------
void ListBox::SetTopEntry( sal_uInt16 nPos )
{
mpImplLB->SetTopEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
}
-// -----------------------------------------------------------------------
sal_uInt16 ListBox::GetTopEntry() const
{
@@ -1226,21 +1164,18 @@ sal_uInt16 ListBox::GetTopEntry() const
return nPos;
}
-// -----------------------------------------------------------------------
sal_Bool ListBox::IsTravelSelect() const
{
return mpImplLB->IsTravelSelect();
}
-// -----------------------------------------------------------------------
sal_Bool ListBox::IsInDropDown() const
{
return mpFloatWin && mpFloatWin->IsInPopupMode();
}
-// -----------------------------------------------------------------------
Rectangle ListBox::GetBoundingRectangle( sal_uInt16 nItem ) const
{
@@ -1250,7 +1185,6 @@ Rectangle ListBox::GetBoundingRectangle( sal_uInt16 nItem ) const
return aRect;
}
-// -----------------------------------------------------------------------
void ListBox::EnableMultiSelection( sal_Bool bMulti )
{
@@ -1262,25 +1196,22 @@ void ListBox::EnableMultiSelection( sal_Bool bMulti, sal_Bool bStackSelection )
mpImplLB->EnableMultiSelection( bMulti, bStackSelection );
// WB_SIMPLEMODE:
- // Die MultiListBox verh�lt sich wie eine normale ListBox.
- // Die Mehrfachselektion kann nur �ber entsprechende Zusatztasten erfolgen.
-
+ // The MultiListBox behaves just like a normal ListBox
+ // MultiSelection is possible via corresponding addtional keys
sal_Bool bSimpleMode = ( GetStyle() & WB_SIMPLEMODE ) ? sal_True : sal_False;
mpImplLB->SetMultiSelectionSimpleMode( bSimpleMode );
- // ohne Focus ist das Traveln in einer MultiSelection nicht zu sehen:
+ // In a MultiSelection, we can't see us travelling without focus
if ( mpFloatWin )
mpImplLB->GetMainWindow()->AllowGrabFocus( bMulti );
}
-// -----------------------------------------------------------------------
sal_Bool ListBox::IsMultiSelectionEnabled() const
{
return mpImplLB->IsMultiSelectionEnabled();
}
-// -----------------------------------------------------------------------
Size ListBox::CalcMinimumSize() const
{
@@ -1304,8 +1235,8 @@ Size ListBox::CalcMinimumSize() const
if (bAddScrollWidth)
{
- // try native borders; scrollbar size may not be a good indicator
- // see how large the edit area inside is to estimate what is needed for the dropdown
+ // Try native borders; scrollbar size may not be a good indicator
+ // See how large the edit area inside is to estimate what is needed for the dropdown
ImplControlValue aControlValue;
Point aPoint;
Rectangle aContent, aBound;
@@ -1323,7 +1254,7 @@ Size ListBox::CalcMinimumSize() const
aSz = CalcWindowSize( aSz );
- if (IsDropDownBox()) // check minimum height of dropdown box
+ if (IsDropDownBox()) // Check minimum height of dropdown box
{
ImplControlValue aControlValue;
Rectangle aRect( Point( 0, 0 ), aSz );
@@ -1351,7 +1282,7 @@ Size ListBox::CalcSubEditSize() const
else
{
aSz.Height() = mpImplLB->CalcSize( 1 ).Height();
- // size to maxmimum entry width
+ // Size to maxmimum entry width
aSz.Width() = mpImplLB->GetMaxEntryWidth();
if (m_nMaxWidthChars != -1)
@@ -1360,7 +1291,7 @@ Size ListBox::CalcSubEditSize() const
aSz.Width() = std::min(aSz.Width(), nMaxWidth);
}
- // do not create ultrathin ListBoxes, it doesn't look good
+ // Do not create ultrathin ListBoxes, it doesn't look good
if( aSz.Width() < GetSettings().GetStyleSettings().GetScrollBarSize() )
aSz.Width() = GetSettings().GetStyleSettings().GetScrollBarSize();
}
@@ -1368,14 +1299,12 @@ Size ListBox::CalcSubEditSize() const
return aSz;
}
-// -----------------------------------------------------------------------
Size ListBox::GetOptimalSize() const
{
return CalcMinimumSize();
}
-// -----------------------------------------------------------------------
Size ListBox::CalcAdjustedSize( const Size& rPrefSize ) const
{
@@ -1401,17 +1330,16 @@ Size ListBox::CalcAdjustedSize( const Size& rPrefSize ) const
return aSz;
}
-// -----------------------------------------------------------------------
Size ListBox::CalcSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const
{
- // ggf. werden ScrollBars eingeblendet
+ // ScrollBars are shown if needed
Size aMinSz = CalcMinimumSize();
-// aMinSz = ImplCalcOutSz( aMinSz );
+ // aMinSz = ImplCalcOutSz( aMinSz );
Size aSz;
- // Hoehe
+ // Height
if ( nLines )
{
if ( !IsDropDownBox() )
@@ -1422,7 +1350,7 @@ Size ListBox::CalcSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const
else
aSz.Height() = aMinSz.Height();
- // Breite
+ // Width
if ( nColumns )
aSz.Width() = nColumns * GetTextWidth( rtl::OUString('X') );
else
@@ -1443,7 +1371,6 @@ Size ListBox::CalcSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const
return aSz;
}
-// -----------------------------------------------------------------------
void ListBox::GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const
{
@@ -1462,7 +1389,6 @@ void ListBox::GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines
}
}
-// -----------------------------------------------------------------------
IMPL_LINK( ListBox, ImplUserDrawHdl, UserDrawEvent*, pEvent )
{
@@ -1470,13 +1396,11 @@ IMPL_LINK( ListBox, ImplUserDrawHdl, UserDrawEvent*, pEvent )
return 1;
}
-// -----------------------------------------------------------------------
void ListBox::UserDraw( const UserDrawEvent& )
{
}
-// -----------------------------------------------------------------------
void ListBox::DrawEntry( const UserDrawEvent& rEvt, sal_Bool bDrawImage, sal_Bool bDrawText, sal_Bool bDrawTextAtImagePos )
{
@@ -1486,7 +1410,6 @@ void ListBox::DrawEntry( const UserDrawEvent& rEvt, sal_Bool bDrawImage, sal_Boo
mpImplWin->DrawEntry( bDrawImage, bDrawText, bDrawTextAtImagePos );
}
-// -----------------------------------------------------------------------
void ListBox::SetUserItemSize( const Size& rSz )
{
@@ -1495,7 +1418,6 @@ void ListBox::SetUserItemSize( const Size& rSz )
mpImplWin->SetUserItemSize( rSz );
}
-// -----------------------------------------------------------------------
void ListBox::EnableUserDraw( sal_Bool bUserDraw )
{
@@ -1504,7 +1426,6 @@ void ListBox::EnableUserDraw( sal_Bool bUserDraw )
mpImplWin->EnableUserDraw( bUserDraw );
}
-// -----------------------------------------------------------------------
void ListBox::SetReadOnly( sal_Bool bReadOnly )
{
@@ -1515,56 +1436,45 @@ void ListBox::SetReadOnly( sal_Bool bReadOnly )
}
}
-// -----------------------------------------------------------------------
sal_Bool ListBox::IsReadOnly() const
{
return mpImplLB->IsReadOnly();
}
-// -----------------------------------------------------------------------
void ListBox::SetSeparatorPos( sal_uInt16 n )
{
mpImplLB->SetSeparatorPos( n );
}
-// -----------------------------------------------------------------------
sal_uInt16 ListBox::GetSeparatorPos() const
{
return mpImplLB->GetSeparatorPos();
}
-// -----------------------------------------------------------------------
sal_uInt16 ListBox::GetDisplayLineCount() const
{
return mpImplLB->GetDisplayLineCount();
}
-// -----------------------------------------------------------------------
-
-// pb: #106948# explicit mirroring for calc
-
void ListBox::EnableMirroring()
{
mpImplLB->EnableMirroring();
}
-// -----------------------------------------------------------------------
Rectangle ListBox::GetDropDownPosSizePixel() const
{
return mpFloatWin ? mpFloatWin->GetWindowExtentsRelative( const_cast<ListBox*>(this) ) : Rectangle();
}
-// -----------------------------------------------------------------------
-
const Wallpaper& ListBox::GetDisplayBackground() const
{
- // !!! recursion does not occur because the ImplListBox is default
- // initialized to a nontransparent color in Window::ImplInitData
+ // !!! Recursion does not occur because the ImplListBox is initialized by default
+ // to a non-transparent color in Window::ImplInitData
return mpImplLB->GetDisplayBackground();
}
@@ -1588,7 +1498,6 @@ bool ListBox::set_property(const rtl::OString &rKey, const rtl::OString &rValue)
return true;
}
-// =======================================================================
MultiListBox::MultiListBox( Window* pParent, WinBits nStyle ) :
ListBox( WINDOW_MULTILISTBOX )
{
@@ -1596,7 +1505,6 @@ MultiListBox::MultiListBox( Window* pParent, WinBits nStyle ) :
EnableMultiSelection( sal_True );
}
-// -----------------------------------------------------------------------
MultiListBox::MultiListBox( Window* pParent, const ResId& rResId ) :
ListBox( WINDOW_MULTILISTBOX )
diff --git a/vcl/source/control/menubtn.cxx b/vcl/source/control/menubtn.cxx
index 2bce1cc..0fed804 100644
--- a/vcl/source/control/menubtn.cxx
+++ b/vcl/source/control/menubtn.cxx
@@ -26,8 +26,6 @@
#include <vcl/menubtn.hxx>
#include <vcl/svapp.hxx>
-// =======================================================================
-
void MenuButton::ImplInitMenuButtonData()
{
mnDDStyle = PUSHBUTTON_DROPDOWN_MENUBUTTON;
@@ -39,8 +37,6 @@ void MenuButton::ImplInitMenuButtonData()
mnMenuMode = 0;
}
-// -----------------------------------------------------------------------
-
void MenuButton::ImplInit( Window* pParent, WinBits nStyle )
{
if ( !(nStyle & WB_NOTABSTOP) )
@@ -50,8 +46,6 @@ void MenuButton::ImplInit( Window* pParent, WinBits nStyle )
EnableRTL( Application::GetSettings().GetLayoutRTL() );
}
-// -----------------------------------------------------------------------
-
void MenuButton::ImplExecuteMenu()
{
Activate();
@@ -79,7 +73,6 @@ OString MenuButton::GetCurItemIdent() const
mpMenu->GetItemIdent(mnCurItemId) : OString();
}
-// -----------------------------------------------------------------------
MenuButton::MenuButton( Window* pParent, WinBits nWinBits )
: PushButton( WINDOW_MENUBUTTON )
@@ -88,8 +81,6 @@ MenuButton::MenuButton( Window* pParent, WinBits nWinBits )
ImplInit( pParent, nWinBits );
}
-// -----------------------------------------------------------------------
-
MenuButton::MenuButton( Window* pParent, const ResId& rResId )
: PushButton( WINDOW_MENUBUTTON )
{
@@ -103,8 +94,6 @@ MenuButton::MenuButton( Window* pParent, const ResId& rResId )
Show();
}
-// -----------------------------------------------------------------------
-
void MenuButton::ImplLoadRes( const ResId& rResId )
{
Control::ImplLoadRes( rResId );
@@ -119,20 +108,15 @@ void MenuButton::ImplLoadRes( const ResId& rResId )
}
}
-// -----------------------------------------------------------------------
-
MenuButton::~MenuButton()
{
delete mpMenuTimer;
delete mpOwnMenu;
}
-// -----------------------------------------------------------------------
-
IMPL_LINK_NOARG(MenuButton, ImplMenuTimeoutHdl)
{
- // Abfragen, ob Button-Benutzung noch aktiv ist, da diese ja auch
- // vorher abgebrochen wurden sein koennte
+ // See if Button Tracking is still active, as it could've been cancelled earler
if ( IsTracking() )
{
if ( !(GetStyle() & WB_NOPOINTERFOCUS) )
@@ -143,14 +127,13 @@ IMPL_LINK_NOARG(MenuButton, ImplMenuTimeoutHdl)
return 0;
}
-// -----------------------------------------------------------------------
void MenuButton::MouseButtonDown( const MouseEvent& rMEvt )
{
bool bExecute = true;
if ( mnMenuMode & MENUBUTTON_MENUMODE_TIMED )
{
- // if the separated dropdown symbol is not hit, delay the popup execution
+ // If the separated dropdown symbol is not hit, delay the popup execution
if( mnDDStyle != PUSHBUTTON_DROPDOWN_MENUBUTTON || // no separator at all
rMEvt.GetPosPixel().X() <= ImplGetSeparatorX() )
{
@@ -178,7 +161,6 @@ void MenuButton::MouseButtonDown( const MouseEvent& rMEvt )
}
}
-// -----------------------------------------------------------------------
void MenuButton::KeyInput( const KeyEvent& rKEvt )
{
@@ -194,26 +176,22 @@ void MenuButton::KeyInput( const KeyEvent& rKEvt )
PushButton::KeyInput( rKEvt );
}
-// -----------------------------------------------------------------------
void MenuButton::Activate()
{
maActivateHdl.Call( this );
}
-// -----------------------------------------------------------------------
void MenuButton::Select()
{
maSelectHdl.Call( this );
}
-// -----------------------------------------------------------------------
void MenuButton::SetMenuMode( sal_uInt16 nMode )
{
- // Fuer die 5.1-Auslieferung besser noch nicht inline, ansonsten kann
- // diese Funktion zur 6.0 inline werden
+ // FIXME: It's better to not inline this for 5.1; in 6.0 we can make it inline, however
mnMenuMode = nMode;
}
@@ -221,8 +199,8 @@ void MenuButton::SetPopupMenu( PopupMenu* pNewMenu )
{
if (pNewMenu == mpMenu)
return;
- // Fuer die 5.1-Auslieferung besser noch nicht inline, ansonsten kann
- // diese Funktion zur 6.0 inline werden
+
+ // FIXME: It's better to not inline this for 5.1; in 6.0 we can make it inline, however
mpMenu = pNewMenu;
}
diff --git a/vcl/source/control/morebtn.cxx b/vcl/source/control/morebtn.cxx
index 2d3b974..0debd4c 100644
--- a/vcl/source/control/morebtn.cxx
+++ b/vcl/source/control/morebtn.cxx
@@ -22,8 +22,6 @@
#include <tools/rc.h>
#include <vector>
-// =======================================================================
-
typedef ::std::vector< Window* > ImplMoreWindowList;
struct ImplMoreButtonData
@@ -33,8 +31,6 @@ struct ImplMoreButtonData
OUString maLessText;
};
-// =======================================================================
-
void MoreButton::ImplInit( Window* pParent, WinBits nStyle )
{
mpMBData = new ImplMoreButtonData;
@@ -63,7 +59,6 @@ void MoreButton::ImplInit( Window* pParent, WinBits nStyle )
}
}
-// -----------------------------------------------------------------------
void MoreButton::ShowState()
{
if ( mbState )
@@ -78,16 +73,12 @@ void MoreButton::ShowState()
}
}
-// -----------------------------------------------------------------------
-
MoreButton::MoreButton( Window* pParent, WinBits nStyle ) :
PushButton( WINDOW_MOREBUTTON )
{
ImplInit( pParent, nStyle );
}
-// -----------------------------------------------------------------------
-
MoreButton::MoreButton( Window* pParent, const ResId& rResId ) :
PushButton( WINDOW_MOREBUTTON )
{
@@ -100,8 +91,6 @@ MoreButton::MoreButton( Window* pParent, const ResId& rResId ) :
Show();
}
-// -----------------------------------------------------------------------
-
void MoreButton::ImplLoadRes( const ResId& rResId )
{
PushButton::ImplLoadRes( rResId );
@@ -110,7 +99,7 @@ void MoreButton::ImplLoadRes( const ResId& rResId )
if ( nObjMask & RSC_MOREBUTTON_STATE )
{
- // Nicht Methode rufen, da Dialog nicht umgeschaltet werden soll
+ // Don't call method as Dialog should not be switched over
mbState = (sal_Bool)ReadShortRes();
// SetText( GetText() );
ShowState();
@@ -118,12 +107,10 @@ void MoreButton::ImplLoadRes( const ResId& rResId )
if ( nObjMask & RSC_MOREBUTTON_MAPUNIT )
meUnit = (MapUnit)ReadLongRes();
if ( nObjMask & RSC_MOREBUTTON_DELTA )
- // Groesse fuer Erweitern des Dialogs
+ // Size for resizing the Dialog
mnDelta = ReadShortRes();
}
-// -----------------------------------------------------------------------
-
MoreButton::~MoreButton()
{
if ( mpMBData->mpItemList )
@@ -131,33 +118,30 @@ MoreButton::~MoreButton()
delete mpMBData;
}
-// -----------------------------------------------------------------------
-
void MoreButton::Click()
{
Window* pParent = GetParent();
Size aSize( pParent->GetSizePixel() );
long nDeltaPixel = LogicToPixel( Size( 0, mnDelta ), meUnit ).Height();
- // Status aendern
+ // Change status
mbState = !mbState;
ShowState();
- // Hier den Click-Handler rufen, damit vorher die Controls initialisiert
- // werden koennen
+ // Call Click handler here, so that we can initialize the Controls
PushButton::Click();
- // Je nach Status die Fenster updaten
+ // Update the windows according to the status
if ( mbState )
{
- // Fenster anzeigen
+ // Show window
if ( mpMBData->mpItemList ) {
for ( size_t i = 0, n = mpMBData->mpItemList->size(); i < n; ++i ) {
(*mpMBData->mpItemList)[ i ]->Show();
}
}
- // Dialogbox anpassen
+ // Adapt dialogbox
Point aPos( pParent->GetPosPixel() );
Rectangle aDeskRect( pParent->ImplGetFrameWindow()->GetDesktopRectPixel() );
@@ -176,11 +160,11 @@ void MoreButton::Click()
}
else
{
- // Dialogbox anpassen
+ // Adapt Dialogbox
aSize.Height() -= nDeltaPixel;
pParent->SetSizePixel( aSize );
- // Fenster nicht mehr anzeigen
+ // Hide window(s) again
if ( mpMBData->mpItemList ) {
for ( size_t i = 0, n = mpMBData->mpItemList->size(); i < n; ++i ) {
(*mpMBData->mpItemList)[ i ]->Hide();
@@ -189,8 +173,6 @@ void MoreButton::Click()
}
}
-// -----------------------------------------------------------------------
-
void MoreButton::AddWindow( Window* pWindow )
{
if ( !mpMBData->mpItemList )
@@ -204,21 +186,16 @@ void MoreButton::AddWindow( Window* pWindow )
pWindow->Hide();
}
-// -----------------------------------------------------------------------
-
void MoreButton::SetText( const OUString& rText )
{
PushButton::SetText( rText );
}
-// -----------------------------------------------------------------------
-
OUString MoreButton::GetText() const
{
return PushButton::GetText();
}
-// -----------------------------------------------------------------------
void MoreButton::SetMoreText( const OUString& rText )
{
if ( mpMBData )
@@ -228,7 +205,6 @@ void MoreButton::SetMoreText( const OUString& rText )
SetText( rText );
}
-// -----------------------------------------------------------------------
OUString MoreButton::GetMoreText() const
{
if ( mpMBData )
@@ -237,7 +213,6 @@ OUString MoreButton::GetMoreText() const
return PushButton::GetText();
}
-// -----------------------------------------------------------------------
void MoreButton::SetLessText( const OUString& rText )
{
if ( mpMBData )
@@ -247,7 +222,6 @@ void MoreButton::SetLessText( const OUString& rText )
SetText( rText );
}
-// -----------------------------------------------------------------------
OUString MoreButton::GetLessText() const
{
if ( mpMBData )
diff --git a/vcl/source/control/prgsbar.cxx b/vcl/source/control/prgsbar.cxx
index 5b0d04c..04f99bf 100644
--- a/vcl/source/control/prgsbar.cxx
+++ b/vcl/source/control/prgsbar.cxx
@@ -24,13 +24,9 @@
#include <vcl/status.hxx>
#include <vcl/prgsbar.hxx>
-// =======================================================================
-
#define PROGRESSBAR_OFFSET 3
#define PROGRESSBAR_WIN_OFFSET 2
-// =======================================================================
-
void ProgressBar::ImplInit()
{
mnPercent = 0;
@@ -50,8 +46,6 @@ static WinBits clearProgressBarBorder( Window* pParent, WinBits nOrgStyle )
return nOutStyle;
}
-// -----------------------------------------------------------------------
-
ProgressBar::ProgressBar( Window* pParent, WinBits nWinStyle ) :
Window( pParent, clearProgressBarBorder( pParent, nWinStyle ) )
{
@@ -59,28 +53,22 @@ ProgressBar::ProgressBar( Window* pParent, WinBits nWinStyle ) :
ImplInit();
}
-// -----------------------------------------------------------------------
-
ProgressBar::ProgressBar( Window* pParent, const ResId& rResId ) :
Window( pParent, rResId )
{
ImplInit();
}
-// -----------------------------------------------------------------------
-
ProgressBar::~ProgressBar()
{
}
-// -----------------------------------------------------------------------
-
void ProgressBar::ImplInitSettings( sal_Bool bFont,
sal_Bool bForeground, sal_Bool bBackground )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
-/* !!! Derzeit unterstuetzen wir keine Textausgaben
+/* FIXME: !!! We do not support text output at the moment
if ( bFont )
{
Font aFont;
@@ -128,14 +116,13 @@ void ProgressBar::ImplInitSettings( sal_Bool bFont,
}
SetLineColor();
SetFillColor( aColor );
-/* !!! Derzeit unterstuetzen wir keine Textausgaben
+/* FIXME: !!! We do not support text output at the moment
SetTextColor( aColor );
SetTextFillColor();
*/
}
}
-// -----------------------------------------------------------------------
void ProgressBar::ImplDrawProgress( sal_uInt16 nOldPerc, sal_uInt16 nNewPerc )
{
@@ -166,14 +153,11 @@ void ProgressBar::ImplDrawProgress( sal_uInt16 nOldPerc, sal_uInt16 nNewPerc )
Rectangle( Point(), GetSizePixel() ) );
}
-// -----------------------------------------------------------------------
-
void ProgressBar::Paint( const Rectangle& )
{
ImplDrawProgress( 0, mnPercent );
}
-// -----------------------------------------------------------------------
void ProgressBar::Resize()
{
@@ -182,8 +166,6 @@ void ProgressBar::Resize()
Invalidate();
}
-// -----------------------------------------------------------------------
-
void ProgressBar::SetValue( sal_uInt16 nNewPercent )
{
DBG_ASSERTWARNING( nNewPercent <= 100, "StatusBar::SetProgressValue(): nPercent > 100" );
@@ -205,11 +187,9 @@ void ProgressBar::SetValue( sal_uInt16 nNewPercent )
}
}
-// -----------------------------------------------------------------------
-
void ProgressBar::StateChanged( StateChangedType nType )
{
-/* !!! Derzeit unterstuetzen wir keine Textausgaben
+/* FIXME: !!! We do not support text output at the moment
if ( (nType == STATE_CHANGE_ZOOM) ||
(nType == STATE_CHANGE_CONTROLFONT) )
{
@@ -232,8 +212,6 @@ void ProgressBar::StateChanged( StateChangedType nType )
Window::StateChanged( nType );
}
-// -----------------------------------------------------------------------
-
void ProgressBar::DataChanged( const DataChangedEvent& rDCEvt )
{
if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx
index f5677a9..5df8e29 100644
--- a/vcl/source/control/scrbar.cxx
+++ b/vcl/source/control/scrbar.cxx
@@ -50,7 +50,7 @@ using ::rtl::OUString;
#include "thumbpos.hxx"
-// =======================================================================
+
#define SCRBAR_DRAW_BTN1 ((sal_uInt16)0x0001)
#define SCRBAR_DRAW_BTN2 ((sal_uInt16)0x0002)
@@ -74,13 +74,11 @@ using ::rtl::OUString;
struct ImplScrollBarData
{
- AutoTimer maTimer; // Timer
+ AutoTimer maTimer; // Timer
sal_Bool mbHide;
Rectangle maTrackRect; // TODO: move to ScrollBar class when binary incompatibility of ScrollBar class is no longer problematic
};
-// =======================================================================
-
void ScrollBar::ImplInit( Window* pParent, WinBits nStyle )
{
mpData = NULL;
@@ -116,7 +114,6 @@ void ScrollBar::ImplInit( Window* pParent, WinBits nStyle )
SetBackground();
}
-// -----------------------------------------------------------------------
void ScrollBar::ImplInitStyle( WinBits nStyle )
{
@@ -126,7 +123,6 @@ void ScrollBar::ImplInitStyle( WinBits nStyle )
mbFullDrag = (GetSettings().GetStyleSettings().GetDragFullOptions() & DRAGFULL_OPTION_SCROLL) != 0;
}
-// -----------------------------------------------------------------------
ScrollBar::ScrollBar( Window* pParent, WinBits nStyle ) :
Control( WINDOW_SCROLLBAR )
@@ -134,7 +130,6 @@ ScrollBar::ScrollBar( Window* pParent, WinBits nStyle ) :
ImplInit( pParent, nStyle );
}
-// -----------------------------------------------------------------------
ScrollBar::ScrollBar( Window* pParent, const ResId& rResId ) :
Control( WINDOW_SCROLLBAR )
@@ -148,7 +143,6 @@ ScrollBar::ScrollBar( Window* pParent, const ResId& rResId ) :
Show();
}
-// -----------------------------------------------------------------------
ScrollBar::~ScrollBar()
{
@@ -156,7 +150,6 @@ ScrollBar::~ScrollBar()
delete mpData;
}
-// -----------------------------------------------------------------------
void ScrollBar::ImplLoadRes( const ResId& rResId )
{
@@ -176,7 +169,6 @@ void ScrollBar::ImplLoadRes( const ResId& rResId )
SetThumbPos( nThumbPos );
}
-// -----------------------------------------------------------------------
void ScrollBar::ImplUpdateRects( sal_Bool bUpdate )
{
@@ -279,11 +271,10 @@ void ScrollBar::ImplUpdateRects( sal_Bool bUpdate )
}
}
-// -----------------------------------------------------------------------
long ScrollBar::ImplCalcThumbPos( long nPixPos )
{
- // Position berechnen
+ // Calculate position
long nCalcThumbPos;
nCalcThumbPos = ImplMulDiv( nPixPos, mnMaxRange-mnVisibleSize-mnMinRange,
mnThumbPixRange-mnThumbPixSize );
@@ -291,18 +282,16 @@ long ScrollBar::ImplCalcThumbPos( long nPixPos )
return nCalcThumbPos;
}
-// -----------------------------------------------------------------------
long ScrollBar::ImplCalcThumbPosPix( long nPos )
{
long nCalcThumbPos;
- // Position berechnen
+ // Calculate position
nCalcThumbPos = ImplMulDiv( nPos-mnMinRange, mnThumbPixRange-mnThumbPixSize,
mnMaxRange-mnVisibleSize-mnMinRange );
- // Am Anfang und Ende des ScrollBars versuchen wir die Anzeige korrekt
- // anzuzeigen
+ // At the start and end of the ScrollBar, we try to show the display correctly
if ( !nCalcThumbPos && (mnThumbPos > mnMinRange) )
nCalcThumbPos = 1;
if ( nCalcThumbPos &&
@@ -313,7 +302,6 @@ long ScrollBar::ImplCalcThumbPosPix( long nPos )
return nCalcThumbPos;
}
-// -----------------------------------------------------------------------
void ScrollBar::ImplCalc( sal_Bool bUpdate )
{
@@ -425,7 +413,7 @@ void ScrollBar::ImplCalc( sal_Bool bUpdate )
if ( mnThumbPixRange )
{
- // Werte berechnen
+ // Calculate values
if ( (mnVisibleSize >= (mnMaxRange-mnMinRange)) ||
((mnMaxRange-mnMinRange) <= 0) )
{
@@ -452,9 +440,9 @@ void ScrollBar::ImplCalc( sal_Bool bUpdate )
}
}
- // Wenn neu ausgegeben werden soll und wir schon ueber eine
- // Aktion einen Paint-Event ausgeloest bekommen haben, dann
- // geben wir nicht direkt aus, sondern invalidieren nur alles
+ // If we're ought to ouput again and we have been triggered
+ // a Paint event via an Action, we don't output directly,
+ // but invalidate everything
if ( bUpdate && HasPaintEvent() )
{
Invalidate();
@@ -463,11 +451,9 @@ void ScrollBar::ImplCalc( sal_Bool bUpdate )
ImplUpdateRects( bUpdate );
}
-// -----------------------------------------------------------------------
-
void ScrollBar::Draw( OutputDevice* pDev, const Point& rPos, const Size& /* rSize */, sal_uLong nFlags )
{
- Point aPos = pDev->LogicToPixel( rPos );
+ Point aPos = pDev->LogicToPixel( rPos );
pDev->Push();
pDev->SetMapMode();
@@ -485,11 +471,11 @@ void ScrollBar::Draw( OutputDevice* pDev, const Point& rPos, const Size& /* rSiz
pDev->SetSettings( aSettings );
}
- // for printing:
- // -calculate the size of the rects
- // -because this is zero-based add the correct offset
- // -print
- // -force recalculate
+ // For printing:
+ // - calculate the size of the rects
+ // - because this is zero-based add the correct offset
+ // - print
+ // - force recalculate
if ( mbCalcSize )
ImplCalc( sal_False );
@@ -507,7 +493,6 @@ void ScrollBar::Draw( OutputDevice* pDev, const Point& rPos, const Size& /* rSiz
mbCalcSize = sal_True;
}
-// -----------------------------------------------------------------------
sal_Bool ScrollBar::ImplDrawNative( sal_uInt16 nDrawFlags )
{
@@ -679,7 +664,7 @@ void ScrollBar::ImplDraw( sal_uInt16 nDrawFlags, OutputDevice* pOutDev )
SymbolType eSymbolType;
sal_Bool bEnabled = IsEnabled();
- // Evt. noch offene Berechnungen nachholen
+ // Finish some open calculations (if any)
if ( mbCalcSize )
ImplCalc( sal_False );
@@ -785,7 +770,6 @@ void ScrollBar::ImplDraw( sal_uInt16 nDrawFlags, OutputDevice* pOutDev )
}
}
-// -----------------------------------------------------------------------
long ScrollBar::ImplScroll( long nNewPos, sal_Bool bCallEndScroll )
{
@@ -803,7 +787,6 @@ long ScrollBar::ImplScroll( long nNewPos, sal_Bool bCallEndScroll )
return nDelta;
}
-// -----------------------------------------------------------------------
long ScrollBar::ImplDoAction( sal_Bool bCallEndScroll )
{
@@ -833,7 +816,6 @@ long ScrollBar::ImplDoAction( sal_Bool bCallEndScroll )
return nDelta;
}
-// -----------------------------------------------------------------------
void ScrollBar::ImplDoMouseAction( const Point& rMousePos, sal_Bool bCallAction )
{
@@ -910,8 +892,6 @@ void ScrollBar::ImplDoMouseAction( const Point& rMousePos, sal_Bool bCallAction
ImplDoAction( sal_False );
}
-// -----------------------------------------------------------------------
-
void ScrollBar::ImplDragThumb( const Point& rMousePos )
{
long nMovePix;
@@ -920,7 +900,7 @@ void ScrollBar::ImplDragThumb( const Point& rMousePos )
else
nMovePix = rMousePos.Y()-(maThumbRect.Top()+mnMouseOff);
- // move thumb if necessary
+ // Move thumb if necessary
if ( nMovePix )
{
mnThumbPixPos += nMovePix;
@@ -940,8 +920,6 @@ void ScrollBar::ImplDragThumb( const Point& rMousePos )
}
}
-// -----------------------------------------------------------------------
-
void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt )
{
bool bPrimaryWarps = GetSettings().GetStyleSettings().GetPrimaryButtonWarpsSlider();
@@ -951,7 +929,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt )
if (rMEvt.IsLeft() || rMEvt.IsMiddle() || rMEvt.IsRight())
{
- const Point& rMousePos = rMEvt.GetPosPixel();
+ const Point& rMousePos = rMEvt.GetPosPixel();
sal_uInt16 nTrackFlags = 0;
sal_Bool bHorizontal = ( GetStyle() & WB_HORZ )? sal_True: sal_False;
sal_Bool bIsInside = sal_False;
@@ -997,7 +975,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt )
{
if( mpData )
{
- mpData->mbHide = sal_True; // disable focus blinking
+ mpData->mbHide = sal_True; // disable focus blinking
if( HasFocus() )
ImplDraw( SCRBAR_DRAW_THUMB, this ); // paint without focus
}
@@ -1052,7 +1030,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt )
}
}
- // Soll Tracking gestartet werden
+ // Should we start Tracking?
if ( meScrollType != SCROLL_DONTKNOW )
{
// remember original position in case of abort or EndScroll-Delta
@@ -1069,13 +1047,12 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt )
}
}
-// -----------------------------------------------------------------------
void ScrollBar::Tracking( const TrackingEvent& rTEvt )
{
if ( rTEvt.IsTrackingEnded() )
{
- // Button und PageRect-Status wieder herstellen
+ // Restore Button and PageRect status
sal_uInt16 nOldStateFlags = mnStateFlags;
mnStateFlags &= ~(SCRBAR_STATE_BTN1_DOWN | SCRBAR_STATE_BTN2_DOWN |
SCRBAR_STATE_PAGE1_DOWN | SCRBAR_STATE_PAGE2_DOWN |
@@ -1084,7 +1061,7 @@ void ScrollBar::Tracking( const TrackingEvent& rTEvt )
ImplDraw( mnDragDraw, this );
mnDragDraw = 0;
- // Bei Abbruch, die alte ThumbPosition wieder herstellen
+ // Restore the old ThumbPosition when canceled
if ( rTEvt.IsTrackingCanceled() )
{
long nOldPos = mnThumbPos;
@@ -1095,8 +1072,8 @@ void ScrollBar::Tracking( const TrackingEvent& rTEvt )
if ( meScrollType == SCROLL_DRAG )
{
- // Wenn gedragt wurde, berechnen wir den Thumb neu, damit
- // er wieder auf einer gerundeten ThumbPosition steht
+ // On a SCROLLDRAG we recalculate the Thumb, so that it's back to a
+ // rounded ThumbPosition
ImplCalc();
if ( !mbFullDrag && (mnStartPos != mnThumbPos) )
@@ -1119,21 +1096,19 @@ void ScrollBar::Tracking( const TrackingEvent& rTEvt )
{
const Point rMousePos = rTEvt.GetMouseEvent().GetPosPixel();
- // Dragging wird speziell behandelt
+ // Dragging is treated in a special way
if ( meScrollType == SCROLL_DRAG )
ImplDragThumb( rMousePos );
else
ImplDoMouseAction( rMousePos, rTEvt.IsTrackingRepeat() );
- // Wenn ScrollBar-Werte so umgesetzt wurden, das es nichts
- // mehr zum Tracking gibt, dann berechen wir hier ab
+ // If ScrollBar values are translated in a way that there's
+ // nothing left to track, we cancel here
if ( !IsVisible() || (mnVisibleSize >= (mnMaxRange-mnMinRange)) )
EndTracking();
}
}
-// -----------------------------------------------------------------------
-
void ScrollBar::KeyInput( const KeyEvent& rKEvt )
{
if ( !rKEvt.GetKeyCode().GetModifier() )
@@ -1175,15 +1150,11 @@ void ScrollBar::KeyInput( const KeyEvent& rKEvt )
Control::KeyInput( rKEvt );
}
-// -----------------------------------------------------------------------
-
void ScrollBar::Paint( const Rectangle& )
{
ImplDraw( SCRBAR_DRAW_ALL, this );
}
-// -----------------------------------------------------------------------
-
void ScrollBar::Resize()
{
Control::Resize();
@@ -1193,8 +1164,6 @@ void ScrollBar::Resize()
Invalidate();
}
-// -----------------------------------------------------------------------
-
IMPL_LINK_NOARG(ScrollBar, ImplAutoTimerHdl)
{
if( mpData && mpData->mbHide )
@@ -1220,8 +1189,6 @@ void ScrollBar::ImplInvert()
Invert( aRect, 0 );
}
-// -----------------------------------------------------------------------
-
void ScrollBar::GetFocus()
{
if( !mpData )
@@ -1230,14 +1197,12 @@ void ScrollBar::GetFocus()
mpData->maTimer.SetTimeoutHdl( LINK( this, ScrollBar, ImplAutoTimerHdl ) );
mpData->mbHide = sal_False;
}
- ImplInvert(); // react immediately
+ ImplInvert(); // react immediately
mpData->maTimer.SetTimeout( GetSettings().GetStyleSettings().GetCursorBlinkTime() );
mpData->maTimer.Start();
Control::GetFocus();
}
-// -----------------------------------------------------------------------
-
void ScrollBar::LoseFocus()
{
if( mpData )
@@ -1247,8 +1212,6 @@ void ScrollBar::LoseFocus()
Control::LoseFocus();
}
-// -----------------------------------------------------------------------
-
void ScrollBar::StateChanged( StateChangedType nType )
{
Control::StateChanged( nType );
@@ -1289,8 +1252,6 @@ void ScrollBar::StateChanged( StateChangedType nType )
}
}
-// -----------------------------------------------------------------------
-
void ScrollBar::DataChanged( const DataChangedEvent& rDCEvt )
{
Control::DataChanged( rDCEvt );
@@ -1304,8 +1265,6 @@ void ScrollBar::DataChanged( const DataChangedEvent& rDCEvt )
}
}
-// -----------------------------------------------------------------------
-
Rectangle* ScrollBar::ImplFindPartRect( const Point& rPt )
{
sal_Bool bHorizontal = ( GetStyle() & WB_HORZ )? sal_True: sal_False;
@@ -1355,7 +1314,7 @@ long ScrollBar::PreNotify( NotifyEvent& rNEvt )
{
if( !pMouseEvt->GetButtons() && !pMouseEvt->IsSynthetic() && !pMouseEvt->IsModifierChanged() )
{
- // trigger redraw if mouse over state has changed
+ // Trigger a redraw if mouse over state has changed
if( IsNativeControlSupported(CTRL_SCROLLBAR, PART_ENTIRE_CONTROL) )
{
Rectangle* pRect = ImplFindPartRect( GetPointerPosPixel() );
@@ -1389,21 +1348,18 @@ long ScrollBar::PreNotify( NotifyEvent& rNEvt )
return nDone ? nDone : Control::PreNotify(rNEvt);
}
-// -----------------------------------------------------------------------
void ScrollBar::Scroll()
{
ImplCallEventListenersAndHandler( VCLEVENT_SCROLLBAR_SCROLL, maScrollHdl, this );
}
-// -----------------------------------------------------------------------
void ScrollBar::EndScroll()
{
ImplCallEventListenersAndHandler( VCLEVENT_SCROLLBAR_ENDSCROLL, maEndScrollHdl, this );
}
-// -----------------------------------------------------------------------
long ScrollBar::DoScroll( long nNewPos )
{
@@ -1417,7 +1373,6 @@ long ScrollBar::DoScroll( long nNewPos )
return nDelta;
}
-// -----------------------------------------------------------------------
long ScrollBar::DoScrollAction( ScrollType eScrollType )
{
@@ -1432,38 +1387,33 @@ long ScrollBar::DoScrollAction( ScrollType eScrollType )
return nDelta;
}
-// -----------------------------------------------------------------------
-
void ScrollBar::SetRangeMin( long nNewRange )
{
SetRange( Range( nNewRange, GetRangeMax() ) );
}
-// -----------------------------------------------------------------------
void ScrollBar::SetRangeMax( long nNewRange )
{
SetRange( Range( GetRangeMin(), nNewRange ) );
}
-// -----------------------------------------------------------------------
-
void ScrollBar::SetRange( const Range& rRange )
{
- // Range einpassen
+ // Adapt Range
Range aRange = rRange;
aRange.Justify();
long nNewMinRange = aRange.Min();
long nNewMaxRange = aRange.Max();
- // Wenn Range sich unterscheidet, dann neuen setzen
+ // If Range differs, set a new one
if ( (mnMinRange != nNewMinRange) ||
(mnMaxRange != nNewMaxRange) )
{
mnMinRange = nNewMinRange;
mnMaxRange = nNewMaxRange;
- // Thumb einpassen
+ // Adapt Thumb
if ( mnThumbPos > mnMaxRange-mnVisibleSize )
mnThumbPos = mnMaxRange-mnVisibleSize;
if ( mnThumbPos < mnMinRange )
@@ -1473,8 +1423,6 @@ void ScrollBar::SetRange( const Range& rRange )
}
}
-// -----------------------------------------------------------------------
-
void ScrollBar::SetThumbPos( long nNewThumbPos )
{
if ( nNewThumbPos > mnMaxRange-mnVisibleSize )
@@ -1489,15 +1437,13 @@ void ScrollBar::SetThumbPos( long nNewThumbPos )
}
}
-// -----------------------------------------------------------------------
-
void ScrollBar::SetVisibleSize( long nNewSize )
{
if ( mnVisibleSize != nNewSize )
{
mnVisibleSize = nNewSize;
- // Thumb einpassen
+ // Adapt Thumb
if ( mnThumbPos > mnMaxRange-mnVisibleSize )
mnThumbPos = mnMaxRange-mnVisibleSize;
if ( mnThumbPos < mnMinRange )
@@ -1524,8 +1470,6 @@ Size ScrollBar::getCurrentCalcSize() const
return aCtrlRegion.GetSize();
}
-// =======================================================================
-
void ScrollBarBox::ImplInit( Window* pParent, WinBits nStyle )
{
Window::ImplInit( pParent, nStyle, NULL );
@@ -1536,20 +1480,16 @@ void ScrollBarBox::ImplInit( Window* pParent, WinBits nStyle )
ImplInitSettings();
}
-// -----------------------------------------------------------------------
-
ScrollBarBox::ScrollBarBox( Window* pParent, WinBits nStyle ) :
Window( WINDOW_SCROLLBARBOX )
{
ImplInit( pParent, nStyle );
}
-// -----------------------------------------------------------------------
-
void ScrollBarBox::ImplInitSettings()
{
- // Hack, damit man auch DockingWindows ohne Hintergrund bauen kann
- // und noch nicht alles umgestellt ist
+ // FIXME: Hack so that we can build DockingWindows even without background
+ // and not everything has been switched over yet
if ( IsBackground() )
{
Color aColor;
@@ -1561,8 +1501,6 @@ void ScrollBarBox::ImplInitSettings()
}
}
-// -----------------------------------------------------------------------
-
void ScrollBarBox::StateChanged( StateChangedType nType )
{
Window::StateChanged( nType );
@@ -1574,8 +1512,6 @@ void ScrollBarBox::StateChanged( StateChangedType nType )
}
}
-// -----------------------------------------------------------------------
-
void ScrollBarBox::DataChanged( const DataChangedEvent& rDCEvt )
{
Window::DataChanged( rDCEvt );
More information about the Libreoffice-commits
mailing list