Laxkit  0.0.7.1
Public Member Functions | Public Attributes
Laxkit::FileMenuItem Class Reference

Sub class of MenuItem to read in directories only when needed. More...

Inheritance diagram for Laxkit::FileMenuItem:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 FileMenuItem (const char *newitem, unsigned int nstate, int followlinks=1)
 Constructor, passes NULL as the submenu to MenuItem constructor, and stats newitem.
virtual MenuInfoGetSubmenu (int create=0)
 Redifines GetSubmenu to call CreateSubmenu(name) rather than CreateSubmenu(NULL)
virtual MenuInfoCreateSubmenu (const char *pathtodir)
 Scan in a directory whose path is ntitle, adding new FileMenuItems.
virtual MenuInfoExtractMenu ()
 Grab out the submenu, defining if necessary. submenu undefined afterwards.
- Public Member Functions inherited from Laxkit::MenuItem
 MenuItem (const char *newitem, int nid, unsigned int nstate, int ninfo, MenuInfo *nsub, int sublocal)
 Item constructor, straight copy of all fields.
 MenuItem (LaxImage *img=NULL)
 MenuItem (const char *newitem, const char *img, int nid, unsigned int nstate, int ninfo, MenuInfo *nsub, int sublocal)
 Image file img is loaded, so it has a count of 1 after the constructor.
 MenuItem (const char *newitem, LaxImage *img, int nid, unsigned int nstate, int ninfo, MenuInfo *nsub, int sublocal)
 img pointer is transfered. Its count is not incremented.
virtual ~MenuItem ()
 Destructor, deletes name and if subislocal!=0, also deletes submenu.
virtual int AddDetail (MenuItem *detail)
 Install detail to end of nextdetail list.
virtual void SetState (unsigned newstate, int on)
virtual const charGetString (int detail)
virtual int isSelected (int oron=1)
virtual int hasSub () const
virtual int isOpen () const
virtual int hidden ()
 Return 1 for definitely hidden. 2 for hidden, except a child is a search hit.
virtual int hasParent (MenuInfo *menuinfo)
virtual int hasParent (MenuItem *menuitem)
- Public Member Functions inherited from Laxkit::anObject
 anObject ()
 Set object_id=getUniqueNumber().
virtual ~anObject ()
 Empty virtual destructor.
virtual const charwhattype ()
 Returns the type of anObject.
virtual anObjectduplicate (anObject *ref=NULL)
virtual int inc_count ()
 Increment the data's count by 1. Returns count.
virtual int dec_count ()
 Decrement the count of the data, deleting if count is less than or equal to 0.
virtual int the_count ()

Public Attributes

struct stat statbuf
- Public Attributes inherited from Laxkit::MenuItem
charname
LaxImageimage
int formathint
int id
int info
 Extra info, which is unused by either MenuItem or MenuInfo themselves.
unsigned int state
 Holds various state of the item, like if a menu is open, etc.
int x
int y
int w
int h
MenuItemnextdetail
MenuInfoparent
- Public Attributes inherited from Laxkit::anObject
int suppress_debug
DeleteRefCountedFunc deleteMe
 Called when the count is decremented to 0.
unsigned long object_id
charobject_idstr

Additional Inherited Members

- Protected Member Functions inherited from Laxkit::MenuItem
void base_init ()
void base_init (const char *newitem, int nid, unsigned int nstate, int ninfo, MenuInfo *nsub, int sublocal)
- Protected Attributes inherited from Laxkit::MenuItem
MenuInfosubmenu
int subislocal
 Nonzero if submenu should be deleted from the destructor.
- Protected Attributes inherited from Laxkit::anObject
int _count
 The reference count of the object.

Detailed Description

Sub class of MenuItem to read in directories only when needed.

Uses info to say whether to followlinks or not (1 is yes).

*** TODO: sync up all the options with QuickFileOpen/FileDialog/MenuSelector/PopupMenu


Constructor & Destructor Documentation

Laxkit::FileMenuItem::FileMenuItem ( const char newitem,
unsigned int  nstate,
int  followlinks = 1 
)

Constructor, passes NULL as the submenu to MenuItem constructor, and stats newitem.

newitem is the filename to stat. If followlinks!=0 then follow links, otherwise, statbuf will refer to the link itself.

References Laxkit::MenuItem::info, and Laxkit::MenuItem::state.

Referenced by CreateSubmenu().


Member Function Documentation

MenuInfo * Laxkit::FileMenuItem::CreateSubmenu ( const char pathtodir)
virtual

Scan in a directory whose path is ntitle, adding new FileMenuItems.

pathtodir must not be NULL to mean ".". You must pass in either "." or "".

Reimplemented from Laxkit::MenuItem.

References Laxkit::MenuInfo::AddItem(), appendstr(), FileMenuItem(), Laxkit::MenuItem::info, makestr(), Laxkit::MenuItem::state, and Laxkit::MenuItem::subislocal.

Referenced by GetSubmenu().


The documentation for this class was generated from the following files:

Mon Feb 17 2014 11:52:59, Laxkit