//---------------------------------------------------------
void CDLG_Parameters::On_Info(wxCommandEvent &event)
{
	if( m_pInfo )
	{
		Show_Info(!m_pInfo->IsShown());
	}
}
//---------------------------------------------------------
CDLG_Parameters::CDLG_Parameters(CSG_Parameters *pParameters, const wxString &Caption, const wxString &Info)
	: CDLG_Base(-1, Caption)
{
	if( Caption.IsEmpty() )
	{
		if( pParameters && !pParameters->Get_Name().is_Empty() )
		{
			SetTitle(pParameters->Get_Name().c_str());
		}
		else
		{
			SetTitle(_TL("Parameters"));
		}
	}

	m_pControl		= new CParameters_Control(this, true);

	m_pParameters	= pParameters;

	g_pActive->Get_Parameters()->Update_Parameters(m_pParameters, true);

	m_pControl->Set_Parameters(m_pParameters);

	Add_Button(ID_BTN_LOAD);
	Add_Button(ID_BTN_SAVE);
	Add_Button(ID_BTN_DEFAULTS);

	if( Info.IsEmpty() )
	{
		m_pInfo_Button	= NULL;
		m_pInfo			= NULL;
	}
	else
	{
		Add_Button(0);

		wxString	_Info(Info); _Info.Replace("\n", "<br>");

		m_pInfo_Button	= Add_Button(ID_BTN_DESCRIPTION);
		m_pInfo			= new CActive_Description(this);
		m_pInfo->SetPage(_Info);

		Show_Info(m_bInfo);
	}

	Set_Positions();
}
示例#3
0
文件: iwho.c 项目: pxunl/myshell
int main(int argc, const char *argv[])
{
	struct utmp record;
	FILE   *utmp_fd;
	int    read_len = sizeof(record);

	/* UTMP_FILE is utmp.h */
	utmp_fd = fopen(UTMP_FILE, "r");

	while (fread(&record, read_len, 1, utmp_fd))
	{
		Show_Info(&record);	
	}

	fclose(utmp_fd);
	return 0;
}