summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/vcl/combobox.hxx2
-rw-r--r--include/vcl/edit.hxx4
-rw-r--r--svtools/source/control/ctrlbox.cxx1
-rw-r--r--vcl/source/control/combobox.cxx5
-rw-r--r--vcl/source/control/edit.cxx12
5 files changed, 21 insertions, 3 deletions
diff --git a/include/vcl/combobox.hxx b/include/vcl/combobox.hxx
index 2f7efd3e006e..4d30398e8c6e 100644
--- a/include/vcl/combobox.hxx
+++ b/include/vcl/combobox.hxx
@@ -90,7 +90,7 @@ public:
virtual void RemoveEntryAt(sal_Int32 nPos);
void Clear();
-
+ void EnableSelectAll();
sal_Int32 GetEntryPos( const OUString& rStr ) const;
sal_Int32 GetEntryPos( const void* pData ) const;
Image GetEntryImage( sal_Int32 nPos ) const;
diff --git a/include/vcl/edit.hxx b/include/vcl/edit.hxx
index 61649aeef6f1..bee63aae0488 100644
--- a/include/vcl/edit.hxx
+++ b/include/vcl/edit.hxx
@@ -88,6 +88,7 @@ private:
sal_Int32 mnMaxWidthChars;
sal_Unicode mcEchoChar;
bool mbModified:1,
+ mbSelectAllSingleClick:1,
mbInternModified:1,
mbReadOnly:1,
mbInsertMode:1,
@@ -201,6 +202,9 @@ public:
virtual void SetReadOnly( bool bReadOnly = true );
virtual bool IsReadOnly() const { return mbReadOnly; }
+ void SetSelectAllSingleClick( bool bSelectAllSingleClick );
+ bool IsSelectAllSingleClick() const { return mbSelectAllSingleClick; }
+
void SetInsertMode( bool bInsert );
bool IsInsertMode() const;
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx
index 9d7911b0552c..2ae2506cf33f 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -669,6 +669,7 @@ void LineListBox::DataChanged( const DataChangedEvent& rDCEvt )
FontNameBox::FontNameBox( vcl::Window* pParent, WinBits nWinStyle ) :
ComboBox( pParent, nWinStyle )
{
+ EnableSelectAll();
mbWYSIWYG = false;
InitFontMRUEntriesFile();
}
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index 4508d34022fc..92ae580010f6 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -507,7 +507,10 @@ void ComboBox::EnableAutoSize( bool bAuto )
}
}
}
-
+void ComboBox::EnableSelectAll()
+{
+ m_pImpl->m_pSubEdit->SetSelectAllSingleClick(true);
+}
void ComboBox::EnableDDAutoWidth( bool b )
{
if (m_pImpl->m_pFloatWin)
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 1283b28d710b..108ce15a984f 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -272,6 +272,7 @@ void Edit::ImplInitEditData()
mbModified = false;
mbInternModified = false;
mbReadOnly = false;
+ mbSelectAllSingleClick = false;
mbInsertMode = true;
mbClickedInSelection = false;
mbActivePopup = false;
@@ -1318,7 +1319,7 @@ void Edit::MouseButtonDown( const MouseEvent& rMEvt )
if ( rMEvt.GetClicks() < 4 )
{
mbClickedInSelection = false;
- if ( rMEvt.GetClicks() == 3 )
+ if ( rMEvt.GetClicks() == 3 || mbSelectAllSingleClick )
{
ImplSetSelection( Selection( 0, EDIT_NOLIMIT) );
ImplCopyToSelectionClipboard();
@@ -2413,6 +2414,15 @@ void Edit::SetReadOnly( bool bReadOnly )
}
}
+void Edit::SetSelectAllSingleClick( bool bSelectAllSingleClick )
+{
+ if ( mbSelectAllSingleClick != bSelectAllSingleClick )
+ {
+ mbSelectAllSingleClick = bSelectAllSingleClick;
+ if ( mpSubEdit )
+ mpSubEdit->SetSelectAllSingleClick( bSelectAllSingleClick );
+ }
+}
void Edit::SetInsertMode( bool bInsert )
{
if ( bInsert != mbInsertMode )