Laxkit
0.0.7.1
|
Sub class of MenuItem to read in directories only when needed. More...
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 MenuInfo * | GetSubmenu (int create=0) |
Redifines GetSubmenu to call CreateSubmenu(name) rather than CreateSubmenu(NULL) | |
virtual MenuInfo * | CreateSubmenu (const char *pathtodir) |
Scan in a directory whose path is ntitle, adding new FileMenuItems. | |
virtual MenuInfo * | ExtractMenu () |
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 char * | GetString (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 char * | whattype () |
Returns the type of anObject. | |
virtual anObject * | duplicate (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 | |
char * | name |
LaxImage * | image |
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 |
MenuItem * | nextdetail |
MenuInfo * | parent |
Public Attributes inherited from Laxkit::anObject | |
int | suppress_debug |
DeleteRefCountedFunc | deleteMe |
Called when the count is decremented to 0. | |
unsigned long | object_id |
char * | object_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 | |
MenuInfo * | submenu |
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. |
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
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().
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().