Files correlati : Ricompilazione Demo : [ ] Commento : Riportata la versione P@rtners 2.0 patch 349 git-svn-id: svn://10.65.10.50/trunk@10573 c028cbd2-c16b-5b4b-a496-9718f37d4682
		
			
				
	
	
		
			101 lines
		
	
	
		
			2.0 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			101 lines
		
	
	
		
			2.0 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
#include <applicat.h>
 | 
						|
#include <automask.h>
 | 
						|
 | 
						|
#include "ba1600.h"
 | 
						|
#include "ba1900.h"
 | 
						|
 | 
						|
 | 
						|
///////////////////////////////////////////////////////////
 | 
						|
// Main mask
 | 
						|
///////////////////////////////////////////////////////////
 | 
						|
 | 
						|
class TDevotoOli_mask : public TAutomask 
 | 
						|
{
 | 
						|
protected:
 | 
						|
  virtual bool on_field_event(TOperable_field& f, TField_event e, long jolly);
 | 
						|
	 
 | 
						|
  static int parac(TConfig& cfg, void* jolly);
 | 
						|
 | 
						|
public:
 | 
						|
  bool something_selected() const;
 | 
						|
 | 
						|
  TDevotoOli_mask();
 | 
						|
};
 | 
						|
 | 
						|
bool TDevotoOli_mask::something_selected() const
 | 
						|
{
 | 
						|
	TSheet_field& sheet = sfield(F_MODULES);
 | 
						|
	FOR_EACH_SHEET_ROW(sheet, i, row)
 | 
						|
		if (row->get_char(0) > ' ')
 | 
						|
			break;
 | 
						|
  return i >= 0;
 | 
						|
}
 | 
						|
 | 
						|
bool TDevotoOli_mask::on_field_event(TOperable_field& f, TField_event e, long jolly)
 | 
						|
{
 | 
						|
	switch (f.dlg())
 | 
						|
	{
 | 
						|
	case F_MODULES:
 | 
						|
		if (e == se_query_add || e == se_query_del)
 | 
						|
			return FALSE;
 | 
						|
    break;
 | 
						|
	case F_TUTTI:
 | 
						|
		{
 | 
						|
			TSheet_field& sheet = sfield(F_MODULES);
 | 
						|
			const char* sel = something_selected() ? "" : "X";
 | 
						|
    	FOR_EACH_SHEET_ROW_BACK(sheet, i, row)
 | 
						|
				row->add(sel, 0);
 | 
						|
			sheet.force_update();
 | 
						|
		}
 | 
						|
		break;
 | 
						|
	default:
 | 
						|
		break;
 | 
						|
	}
 | 
						|
	return TRUE;
 | 
						|
}
 | 
						|
 | 
						|
int TDevotoOli_mask::parac(TConfig& cfg, void* jolly)
 | 
						|
{
 | 
						|
	const TString& para = cfg.get_paragraph();
 | 
						|
	if (para.len() == 2)
 | 
						|
	{
 | 
						|
		TSheet_field* sheet = (TSheet_field*)jolly;
 | 
						|
		TToken_string& row = sheet->row(-1);
 | 
						|
		row = "X";
 | 
						|
		row.add(para);
 | 
						|
		row.add(cfg.get("Descrizione"));
 | 
						|
	}
 | 
						|
	return 0;
 | 
						|
}
 | 
						|
 | 
						|
TDevotoOli_mask::TDevotoOli_mask() : TAutomask("ba1900") 
 | 
						|
{ 
 | 
						|
	TInstall_ini ini;
 | 
						|
	TSheet_field& sheet = sfield(F_MODULES);
 | 
						|
	ini.for_each_paragraph(parac, &sheet);
 | 
						|
	sheet.force_update();
 | 
						|
}
 | 
						|
 | 
						|
///////////////////////////////////////////////////////////
 | 
						|
// Main app
 | 
						|
///////////////////////////////////////////////////////////
 | 
						|
 | 
						|
class TDevotoOli_app : public TSkeleton_application
 | 
						|
{
 | 
						|
protected:
 | 
						|
	virtual void main_loop();
 | 
						|
};
 | 
						|
 | 
						|
void TDevotoOli_app::main_loop()
 | 
						|
{
 | 
						|
  TDevotoOli_mask dom;
 | 
						|
	dom.run();
 | 
						|
}
 | 
						|
 | 
						|
int ba1900(int argc, char* argv[])
 | 
						|
{
 | 
						|
	TDevotoOli_app app;
 | 
						|
	app.run(argc, argv, TR("Devoto/Oli"));
 | 
						|
	return 0;
 | 
						|
}
 |