示例#1
0
//---------------------------------------------------------
CSG_String CSG_Module_Library::Get_Menu(int i)
{
	CSG_String	sMenu;

	if( Get_Module(i) != NULL )
	{
		bool		bAbsolute	= false;
		const SG_Char	*sModule	= Get_Module(i)->Get_MenuPath();

		if( sModule && *sModule && *(sModule + 1) == ':' )
		{
			bAbsolute	= sModule[0] == SG_T('A') || sModule[0] == SG_T('a');
			sModule		+= 2;
		}

		if( bAbsolute )	// menu path is relative to top menu...
		{
			if( sModule && *sModule )
			{
				sMenu.Printf(SG_T("%s"), sModule);
			}
		}
		else			// menu path is relative to library menu...
		{
			const SG_Char	*sLibrary	= Get_Info(MLB_INFO_Menu_Path);

			if( sModule && *sModule )
			{
				if( sLibrary && *sLibrary )
				{
					sMenu.Printf(SG_T("%s|%s"), sLibrary, sModule);
				}
				else
				{
					sMenu.Printf(SG_T("%s"), sModule);
				}
			}
			else if( sLibrary && *sLibrary )
			{
				sMenu.Printf(SG_T("%s"), sLibrary);
			}
		}

		if( sMenu.Length() > 0 )
		{
			sMenu.Append(SG_T("|"));
		}

		sMenu.Append(Get_Info(MLB_INFO_Name));
	}

	return( sMenu );
}
示例#2
0
文件: Bill.c 项目: jiesse/time-meter
/** 
* @brief Print the bill to the COM
* @author ¸ß½ðÁú
* 
* @return 0 to success
*/
u16  Print_Bill(void)
{
	Bill_Info_t Info;

    Get_Info(&Info);

    printf("\r\n************Receipt************\r\n");
    printf("\r\n\r\nThank you for taking our service!\r\n\r\n");
    printf("Total Miles: %.1f km\r\n\r\n",Info.Total_Miles);
    printf("Money Amount: RMB %.2f Yuan\r\n\r\n\r\n",Info.Total_Money);
    printf("%d-%d-%d %d:%d:%d\r\n\r\n\r\n",Info.Year,Info.Month,Info.Day,Info.Hour,Info.Minute,Info.Second);
    printf("*******************************\r\n");
	return 0;
}
示例#3
0
//---------------------------------------------------------
CSG_String CSG_Module_Library::Get_Summary(bool bHTML)
{
	CSG_String	s;

	if( bHTML )
	{
		s.Printf(
			SG_T("%s: <b>%s</b><br>%s: <i>%s</i><br>%s: <i>%s</i><br>%s: <i>%s</i><hr>%s"),
			LNG("[CAP] Module Library")	, Get_Info(MLB_INFO_Name),
			LNG("[CAP] Author")			, Get_Info(MLB_INFO_Author),
			LNG("[CAP] Version")		, Get_Info(MLB_INFO_Version),
			LNG("[CAP] File")			, Get_File_Name().c_str(),
			Get_Info(MLB_INFO_Description)
		);

		s.Append(CSG_String::Format(SG_T("<hr><b>%s:<ul>"), LNG("[CAP] Modules")));

		for(int i=0; i<Get_Count(); i++)
		{
			s.Append(CSG_String::Format(SG_T("<li>%s</li>"), Get_Module(i)->Get_Name()));
		}

		s.Append(SG_T("</ul>"));

		s.Replace(SG_T("\n"), SG_T("<br>"));
	}
	else
	{
		s.Printf(
			SG_T("%s: %s\n%s: %s\n%s: %s\n%s: %s\n\n%s"),
			LNG("[CAP] Module Library")	, Get_Info(MLB_INFO_Name),
			LNG("[CAP] Author")			, Get_Info(MLB_INFO_Author),
			LNG("[CAP] Version")		, Get_Info(MLB_INFO_Version),
			LNG("[CAP] File")			, Get_File_Name().c_str(),
			Get_Info(MLB_INFO_Description)
		);

		s.Append(CSG_String::Format(SG_T("\n\n%s:\n"), LNG("[CAP] Modules")));

		for(int i=0; i<Get_Count(); i++)
		{
			s.Append(CSG_String::Format(SG_T("- %s\n"), Get_Module(i)->Get_Name()));
		}
	}

	return( s );
}
示例#4
0
//---------------------------------------------------------
CSG_String CSG_Module_Library::Get_Menu(void)
{
	return( Get_Info(MLB_INFO_Menu_Path) );
}
示例#5
0
//---------------------------------------------------------
CSG_String CSG_Module_Library::Get_Version(void)
{
	return( Get_Info(MLB_INFO_Version) );
}
示例#6
0
//---------------------------------------------------------
CSG_String CSG_Module_Library::Get_Author(void)
{
	return( Get_Info(MLB_INFO_Author) );
}
示例#7
0
//---------------------------------------------------------
CSG_String CSG_Module_Library::Get_Description(void)
{
	return( Get_Info(MLB_INFO_Description) );
}
示例#8
0
//---------------------------------------------------------
CSG_String CSG_Module_Library::Get_Name(void)
{
	return( Get_Info(MLB_INFO_Name) );
}