Commits

Frank Schoenheit [fs]  committed 5927ef1

fs33a: expose the WB_HIDESELECTION but of the tree control at its UNO API

  • Participants
  • Parent commits 6cd3de8

Comments (0)

Files changed (4)

File svtools/inc/svtools/svtreebx.hxx

 	virtual void	CursorMoved( SvLBoxEntry* pNewCursor );
 	virtual void	PreparePaint( SvLBoxEntry* );
 	virtual void	DataChanged( const DataChangedEvent& rDCEvt );
+    virtual void    StateChanged( StateChangedType nStateChange );
 
 	void 			InitSettings(BOOL bFont,BOOL bForeground,BOOL bBackground);
 	BOOL			IsCellFocusEnabled() const;

File svtools/source/contnr/svtreebx.cxx

 		Control::DataChanged( rDCEvt );
 }
 
+void SvTreeListBox::StateChanged( StateChangedType i_nStateChange )
+{
+    SvLBox::StateChanged( i_nStateChange );
+    if ( ( i_nStateChange & STATE_CHANGE_STYLE ) != 0 )
+    {
+        SetWindowBits( GetStyle() );
+    }
+}
+
 void SvTreeListBox::InitSettings(BOOL bFont,BOOL bForeground,BOOL bBackground)
 {
 	const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();

File svtools/source/uno/treecontrolpeer.cxx

 
 	switch( GetPropertyId( PropertyName ) )
 	{
+        case BASEPROPERTY_HIDEINACTIVESELECTION:
+        {
+            sal_Bool bEnabled = sal_False;
+            if ( aValue >>= bEnabled )
+            {
+                WinBits nStyle = rTree.GetStyle();
+                if ( bEnabled )
+                    nStyle |= WB_HIDESELECTION;
+                else
+                    nStyle &= ~WB_HIDESELECTION;
+                rTree.SetStyle( nStyle );
+            }
+        }
+        break;
+
 		case BASEPROPERTY_TREE_SELECTIONTYPE:
 		{
 			SelectionType eSelectionType;
 		UnoTreeListBoxImpl& rTree = getTreeListBoxOrThrow();
 		switch(nPropId)
 		{
+        case BASEPROPERTY_HIDEINACTIVESELECTION:
+			return Any( ( rTree.GetStyle() & WB_HIDESELECTION ) != 0 ? sal_True : sal_False );
+
 		case BASEPROPERTY_TREE_SELECTIONTYPE:
 		{
 			SelectionType eSelectionType;

File toolkit/source/controls/tree/treecontrol.cxx

 	ImplRegisterProperty( BASEPROPERTY_TREE_SHOWSROOTHANDLES );
     ImplRegisterProperty( BASEPROPERTY_TREE_ROWHEIGHT );
     ImplRegisterProperty( BASEPROPERTY_TREE_INVOKESSTOPNODEEDITING );
+    ImplRegisterProperty( BASEPROPERTY_HIDEINACTIVESELECTION );
 }
 
 UnoTreeModel::UnoTreeModel( const UnoTreeModel& rModel )