#include <uMenu.h>
Public Member Functions | |
uMenuItemFileSelection (uMenu *m, char *tit, const char *help, tString &targ, const char *dir, const char *fileSpec, int getFilesFlag=0, bool formatName=true) | |
uMenuItemFileSelection (uMenu *m, char *tit, const char *help, tString &targ, const char *dir, const char *fileSpec, const char *defaultFileName, const char *defaultFilePath, int getFilesFlag=0, bool formatName=true) | |
virtual | ~uMenuItemFileSelection () |
void | SetDir (const char *dir) |
const void | SetFileSpec (const char *fileSpec) |
const void | SetFormatName (bool formatName) |
const void | SetGetFilesFlag (int getFilesFlag) |
const void | SetDefaultFileName (const char *defaultFileName) |
const void | SetDefaultFilePath (const char *defaultFilePath) |
const void | SetParams (const char *dir, const char *fileSpec, int getFilesFlag, bool formatName, const char *defaultFileName, const char *defaultFilePath) |
void | Reload () |
void | LoadDirectory (const char *dir, const char *fileSpec, bool formatName=true) |
void | AddFile (const char *fileName, const char *filePath, bool formatName=true) |
Protected Attributes | |
tString | dir_ |
tString | fileSpec_ |
int | getFilesFlag_ |
bool | formatName_ |
tString | defaultFileName_ |
tString | defaultFilePath_ |
Private Member Functions | |
void | NewChoice (uSelectItem< bool > *) |
void | NewChoice (char *, bool) |
Definition at line 530 of file uMenu.h.
uMenuItemFileSelection::uMenuItemFileSelection | ( | uMenu * | m, | |
char * | tit, | |||
const char * | help, | |||
tString & | targ, | |||
const char * | dir, | |||
const char * | fileSpec, | |||
int | getFilesFlag = 0 , |
|||
bool | formatName = true | |||
) | [inline] |
Definition at line 542 of file uMenu.h.
References Reload(), and SetParams().
00544 :uMenuItemSelection<tString>( m, tit, help, targ ) 00545 { 00546 SetParams( dir, fileSpec, getFilesFlag, formatName, "", "" ); 00547 Reload(); 00548 }
uMenuItemFileSelection::uMenuItemFileSelection | ( | uMenu * | m, | |
char * | tit, | |||
const char * | help, | |||
tString & | targ, | |||
const char * | dir, | |||
const char * | fileSpec, | |||
const char * | defaultFileName, | |||
const char * | defaultFilePath, | |||
int | getFilesFlag = 0 , |
|||
bool | formatName = true | |||
) | [inline] |
Definition at line 550 of file uMenu.h.
References Reload(), and SetParams().
00554 :uMenuItemSelection<tString>( m, tit, help, targ ) 00555 { 00556 SetParams( dir, fileSpec, getFilesFlag, formatName, defaultFileName, defaultFilePath ); 00557 Reload(); 00558 }
virtual uMenuItemFileSelection::~uMenuItemFileSelection | ( | ) | [inline, virtual] |
void uMenuItemFileSelection::NewChoice | ( | uSelectItem< bool > * | ) | [private] |
void uMenuItemFileSelection::NewChoice | ( | char * | , | |
bool | ||||
) | [private] |
void uMenuItemFileSelection::SetDir | ( | const char * | dir | ) | [inline] |
Definition at line 562 of file uMenu.h.
References dir_.
Referenced by SetParams().
00562 { dir_ = dir; }; const
const void uMenuItemFileSelection::SetFileSpec | ( | const char * | fileSpec | ) | [inline] |
Definition at line 563 of file uMenu.h.
References fileSpec_.
Referenced by SetParams().
00563 { fileSpec_ = fileSpec; }; const
const void uMenuItemFileSelection::SetFormatName | ( | bool | formatName | ) | [inline] |
Definition at line 564 of file uMenu.h.
References formatName_.
Referenced by SetParams().
00564 { formatName_ = formatName; }; const
const void uMenuItemFileSelection::SetGetFilesFlag | ( | int | getFilesFlag | ) | [inline] |
Definition at line 565 of file uMenu.h.
References getFilesFlag_.
Referenced by SetParams().
00565 { getFilesFlag_ = getFilesFlag; } const
const void uMenuItemFileSelection::SetDefaultFileName | ( | const char * | defaultFileName | ) | [inline] |
Definition at line 566 of file uMenu.h.
References defaultFileName_.
Referenced by SetParams().
00566 { defaultFileName_ = defaultFileName; }; const
const void uMenuItemFileSelection::SetDefaultFilePath | ( | const char * | defaultFilePath | ) | [inline] |
Definition at line 567 of file uMenu.h.
References defaultFilePath_.
Referenced by SetParams().
00567 { defaultFilePath_ = defaultFilePath; }; const
const void uMenuItemFileSelection::SetParams | ( | const char * | dir, | |
const char * | fileSpec, | |||
int | getFilesFlag, | |||
bool | formatName, | |||
const char * | defaultFileName, | |||
const char * | defaultFilePath | |||
) | [inline] |
Definition at line 569 of file uMenu.h.
References SetDefaultFileName(), SetDefaultFilePath(), SetDir(), SetFileSpec(), SetFormatName(), and SetGetFilesFlag().
Referenced by uMenuItemFileSelection().
00571 { 00572 SetDir( dir ); 00573 SetFileSpec( fileSpec ); 00574 SetGetFilesFlag( getFilesFlag ); 00575 SetFormatName( formatName ); 00576 SetDefaultFileName( defaultFileName ); 00577 SetDefaultFilePath( defaultFilePath ); 00578 }
void uMenuItemFileSelection::Reload | ( | ) |
Definition at line 1270 of file uMenu.cpp.
Referenced by uMenuItemFileSelection().
01270 {} 01271 01272 void uMenuItemFileSelection::Reload() 01273 { 01274 Clear(); 01275 if ( defaultFileName_.Len() > 1 && defaultFilePath_.Len() > 1 ) 01276 AddFile( defaultFileName_, defaultFilePath_, formatName_ );
void uMenuItemFileSelection::LoadDirectory | ( | const char * | dir, | |
const char * | fileSpec, | |||
bool | formatName = true | |||
) |
Definition at line 1278 of file uMenu.cpp.
01282 { 01283 tArray <tString> files; 01284 tString filePath ( dir ); 01285 tDirectories::GetFiles( tString( dir ), tString( fileSpec ), files, getFilesFlag_ ); 01286 for ( int i = 0; i < files.Len(); i++ ) 01287 { 01288 AddFile( files( i ), filePath + files( i ), formatName );
void uMenuItemFileSelection::AddFile | ( | const char * | fileName, | |
const char * | filePath, | |||
bool | formatName = true | |||
) |
Definition at line 1290 of file uMenu.cpp.
01294 { 01295 tString menuName ( fileName ); 01296 if ( formatName ) 01297 tDirectories::FileNameToMenuName( fileName, menuName );
tString uMenuItemFileSelection::dir_ [protected] |
tString uMenuItemFileSelection::fileSpec_ [protected] |
int uMenuItemFileSelection::getFilesFlag_ [protected] |
bool uMenuItemFileSelection::formatName_ [protected] |
tString uMenuItemFileSelection::defaultFileName_ [protected] |
tString uMenuItemFileSelection::defaultFilePath_ [protected] |