class::ui::DirList

class ui::DirList
  : public ui::List

This class will create a list from directory entries in the filesystem

Members

DirList(

const arg::SourceDirectoryPath & path,
LinkedElement * parent,
LinkedElement * child
)

~DirList()
virtual LinkedElement & at(

list_attr_size_t i
)

fs::Dir & dir()
virtual Element * handle_event(

const Event & event,
const draw::DrawingAttr & attr
)

bool is_suffix_visible() const
ListItem & item()
const var::String & path() const
void set_callback(

list_dir_callback_t callback
)

void set_path(

const arg::SourceDirectoryPath & path
)

void set_suffix_visible(

bool v
)

virtual list_attr_size_t size() const
protected void set_size(

u32 total
)

typedef void(* list_dir_callback_t

Details

DirList(

const arg::SourceDirectoryPath & path,
LinkedElement * parent,
LinkedElement * child
)

Contruct a new list


~DirList()

virtual LinkedElement & at(

list_attr_size_t i
)

Return a pointer to the element in the specfied location in the list

Parameters

  • i The offset within the list

Returns

A pointer to the object


fs::Dir & dir()

Accces the fs::Dir object used to read the directory


virtual Element * handle_event(

const Event & event,
const draw::DrawingAttr & attr
)

Handles an event sent by the event loop.

Parameters

  • event The event that should be handled

  • attr The draw::DrawingAttr to use to update the display based on the event.


bool is_suffix_visible() const

Returns true if the filename suffixes should be visible


ListItem & item()

Access the currently selected item in the list


const var::String & path() const

Access the path


void set_callback(

list_dir_callback_t callback
)

Assign the callback for when an item in the list is selected


void set_path(

const arg::SourceDirectoryPath & path
)

Set the path for the directory


void set_suffix_visible(

bool v
)

This method changes the visibility of the file suffix in the list


virtual list_attr_size_t size() const

Return the total entries in the list


protected void set_size(

u32 total
)


typedef void(* list_dir_callback_t

Callback for actions on a list directory


X

Thanks for Coming!

Subscribe to news and updates