Skip to content

Commit

Permalink
Did copy up/down for tree views
Browse files Browse the repository at this point in the history
  • Loading branch information
nickgammon committed Oct 21, 2010
1 parent 1e8cacc commit 49540c2
Show file tree
Hide file tree
Showing 4 changed files with 177 additions and 71 deletions.
1 change: 1 addition & 0 deletions dialogs/world_prefs/GenPropertyPage.h
Expand Up @@ -131,6 +131,7 @@ class CGenPropertyPage : public CPropertyPage
virtual void SetDispatchID (CObject * pItem, const DISPID dispid) = 0; // set script dispatch ID

virtual void SetInternalName (CObject * pItem, const CString strName) = 0; // name after creation
virtual void SetDefaultSequence () = 0; // make sequencing by sequence number, ascending

// get info about the object
virtual __int64 GetModificationNumber (CObject * pItem) const = 0; // get modification number
Expand Down
25 changes: 17 additions & 8 deletions dialogs/world_prefs/genpropertypage.cpp
Expand Up @@ -877,6 +877,11 @@ void CGenPropertyPage::LoadList (void)
long iCount = 0;
long iNotShown = 0;


// some stuff won't work if tree controls aren't in column sequence
if (m_bWantTreeControl)
SetDefaultSequence ();

// for filtering

CScriptEngine * m_ScriptEngine = NULL; // for the filtering checks
Expand Down Expand Up @@ -1179,15 +1184,19 @@ CListCtrl* pList = pPropPage->m_ctlList;
return true;


// append each column contents to the find string
CString * pstrObjectName = (CString *) pList->GetItemData ((long) FindInfo.m_pFindPosition);

ASSERT (pstrObjectName != NULL);

strLine.Empty ();
for (int i = 0; i < FindInfo.m_iControlColumns; i++)
{
if (i != 0)
strLine += '\t';
strLine += pList->GetItemText((long) FindInfo.m_pFindPosition, i);
}
CObject * pItem;

if (!pPropPage->m_ObjectMap->Lookup (*pstrObjectName, pItem))
return true;

ASSERT_VALID (pItem);
ASSERT( pItem->IsKindOf( RUNTIME_CLASS( CObject ) ) );

strLine = pPropPage->GetFindText (pItem);

if (FindInfo.m_bForwards)
FindInfo.m_pFindPosition++;
Expand Down

0 comments on commit 49540c2

Please sign in to comment.