Skip to content

Commit

Permalink
Save the content ID of the item list in use
Browse files Browse the repository at this point in the history
The content ID of the current item list is now saved and exposed via
the getContentID() method, to enable client code to more easily
manipulate the currently displayed list.
  • Loading branch information
Colin Ward committed Sep 12, 2024
1 parent 9414c73 commit 9bcc72a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 5 additions & 1 deletion StdGadgetTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ void CStdGadgetTree::setContent(int a_contentID)
{
ASSERTM((a_contentID >= 0), "CStdGadgetTree::setContent() => Invalid content ID passed in");

m_contentID = a_contentID;

#ifdef __amigaos__

SetGadgetAttrs((struct Gadget *) m_poGadget, NULL, NULL, LISTBROWSER_Labels, (ULONG) NULL, TAG_DONE);
Expand Down Expand Up @@ -282,7 +284,9 @@ int CStdGadgetTree::setContent(StdList<CTreeNode> &a_items)

#endif /* ! QT_GUI_LIB */

return m_nextContentID++;
m_contentID = m_nextContentID++;

return m_contentID;
}

/**
Expand Down
6 changes: 6 additions & 0 deletions StdGadgets.h
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ class CStdGadgetTree : public CStdGadget
{
private:

int m_contentID; /**< The content ID of the file list currently in use */
int m_nextContentID; /**< The next content ID that will be assigned to a new list */

#ifdef __amigaos__
Expand Down Expand Up @@ -466,6 +467,11 @@ class CStdGadgetTree : public CStdGadget

public:

int getContentID()
{
return m_contentID;
}

std::string getSelectedItem();

void setContent(int a_contentID);
Expand Down

0 comments on commit 9bcc72a

Please sign in to comment.