119 lines
2.1 KiB
C++
Executable File
119 lines
2.1 KiB
C++
Executable File
// trasferimenti !!!!
|
|
|
|
class TTransfer : public TObject
|
|
{
|
|
TArray _cursors;
|
|
TCursor* _current_cursor;
|
|
|
|
TArray _configs;
|
|
TConfig* _current_config;
|
|
|
|
const char* _wmess;
|
|
bool _wbar;
|
|
bool _wcancel;
|
|
int _wthr;
|
|
|
|
MENU_TAG _last_choice;
|
|
|
|
virtual bool create();
|
|
virtual bool destroy();
|
|
|
|
protected:
|
|
virtual bool user_create() pure;
|
|
virtual bool user_destroy() pure;
|
|
|
|
void do_trasf(int n);
|
|
|
|
public:
|
|
void select_cursor(int i);
|
|
TCursor* get_cursor(int i);
|
|
int add_cursor(TCursor* c);
|
|
TCursor* current_cursor() { return _current_cursor; }
|
|
|
|
void select_config(int i);
|
|
TConfig* get_config(int i);
|
|
int add_config(TConfig* c);
|
|
TConfig* current_config() { return _current_config; }
|
|
|
|
virtual bool menu(MENU_TAG m);
|
|
|
|
void reset_files();
|
|
void add_file(int file, int from = 0);
|
|
void add_file(const char* tab, int from = 0);
|
|
|
|
|
|
TTransfer();
|
|
virtual ~TTransfer{};
|
|
|
|
};
|
|
|
|
TTransfer::TTransfer():TObject(),_cursors(10),_configs(10)
|
|
{
|
|
_current_cursor = NULL;
|
|
_current_config = NULL;
|
|
_last_choice = BAR_ITEM (1);
|
|
}
|
|
|
|
bool TTransfer::create()
|
|
{
|
|
if (user_create())
|
|
{
|
|
dispatch_e_menu (_last_choice);
|
|
return TRUE;
|
|
}
|
|
else return FALSE;
|
|
}
|
|
|
|
bool TTransfer::destroy()
|
|
{
|
|
user_destroy();
|
|
//reset_files();
|
|
_cursors.destroy();
|
|
_configs.destroy()
|
|
return //TApplication::destroy();
|
|
}
|
|
|
|
|
|
void TTransfer::select_cursor(int c)
|
|
{
|
|
if (c == -1) _current_cursor = NULL;
|
|
else _current_cursor = (TCursor*) &_cursors[c];
|
|
}
|
|
|
|
TCursor* TTransfer::get_cursor(int c)
|
|
{
|
|
if (c == -1) return NULL;
|
|
else return (TCursor*) &_cursors[c];
|
|
}
|
|
|
|
int TTransfer::add_cursor(TCursor* c)
|
|
{
|
|
if (c == NULL)
|
|
return -1;
|
|
_cursors.add(c);
|
|
_current_cursor = c;
|
|
return _cursors.items() - 1;
|
|
}
|
|
|
|
void TTransfer::select_config(int c)
|
|
{
|
|
if (c == -1) _current_config = NULL;
|
|
else _current_config = (TConfig*) &_configs[c];
|
|
}
|
|
|
|
TConfig* TTransfer::get_config(int c)
|
|
{
|
|
if (c == -1) return NULL;
|
|
else return (TConfig*) &_configs[c];
|
|
}
|
|
|
|
int TTransfer::add_config(TConfig* c)
|
|
{
|
|
if (c == NULL)
|
|
return -1;
|
|
_configs.add(c);
|
|
_current_config = c;
|
|
return _configs.items() - 1;
|
|
}
|
|
|