Exemplo n.º 1
0
void            _HYPullDown::SetMenuItem  (_String newItem, long loc)
{
    if ((loc>=0)&&(loc<menuSelections.lLength)) {
        menuSelections.Replace (loc,&newItem,true);
        _SetMenuItem (newItem,loc);
    }
}
Exemplo n.º 2
0
//
// PrintWinSetMenuText
//
static void PrintSetItemText(WM_HWIN hWin,int ID)
{
			switch (ID)
			{
				 case ID_PrintMenu:
						    if (Language ==  0)
											   MENU_SetFont(hWin,&GUI_Font30);
										else MENU_SetFont(hWin,&GUI_Font20_1);
						    _SetMenuItem(hWin,0,pLanguage->PrintMenu[0],ID_Print_All,0);
					     _SetMenuItem(hWin,0,pLanguage->PrintMenu[1],ID_Print_Showing,0);
					     _SetMenuItem(hWin,hFre,pLanguage->PrintMenu[2],ID_Print_Frequency,0);
					     _SetMenuItem(hWin,hSite,pLanguage->PrintMenu[3],ID_Print_Site,0);
					     _SetMenuItem(hWin,hInfo,pLanguage->PrintMenu[4],ID_Print_Info,0);
          break;	
					
     case ID_Print_Frequency:
						    if (Language ==  0)
											   MENU_SetFont(hWin,&GUI_Font30);
										else MENU_SetFont(hWin,&GUI_Font20_1);
										_SetMenuItem(hWin,0,pLanguage->Frequency[0],ID_Print_Fre_Int,0);
										_SetMenuItem(hWin,0,pLanguage->Frequency[1],ID_Print_Fre_Loc1,0);
										_SetMenuItem(hWin,0,pLanguage->Frequency[2],ID_Print_Fre_Loc2,0);
										_SetMenuItem(hWin,0,pLanguage->Frequency[3],ID_Print_Fre_Chs,0);
          break;
					
     case ID_Print_Site:
						    if (Language ==  0)
											   MENU_SetFont(hWin,&GUI_Font30);
										else MENU_SetFont(hWin,&GUI_Font20_1);
						    _SetMenuItem(hWin,0,pLanguage->StaTion[0],ID_Print_Site_Prt,0);
					     _SetMenuItem(hWin,hSiteSet,pLanguage->StaTion[1],ID_Print_Site_SiteSet,0);
          break;
					
     case ID_Print_Info:
						    if (Language ==  0)
											   MENU_SetFont(hWin,&GUI_Font30);
										else MENU_SetFont(hWin,&GUI_Font20_1);
										_SetMenuItem(hWin,0,pLanguage->InfoType[0],ID_Print_Info_Prt,0);
									 _SetMenuItem(hWin,hInfoSet,pLanguage->InfoType[1],ID_Print_Info_InfoSet,0);
          break;
					
     case ID_Print_Site_SiteSet:
						    if (Language ==  0)
											   MENU_SetFont(hWin,&GUI_Font30);
										else MENU_SetFont(hWin,&GUI_Font20_1);
						    _SetMenuItem(hWin,0,pLanguage->IsPrint[0],ID_Print_Site_SiteSet_Prt_0,0);
										_SetMenuItem(hWin,0,pLanguage->IsPrint[1],ID_Print_Site_SiteSet_Prt_1,0);
										_SetMenuItem(hWin,0,pLanguage->IsPrint[2],ID_Print_Site_SiteSet_Prt_2,0);
										_SetMenuItem(hWin,0,pLanguage->IsPrint[3],ID_Print_Site_SiteSet_Prt_3,0);
										_SetMenuItem(hWin,0,pLanguage->IsPrint[4],ID_Print_Site_SiteSet_Prt_4,0);
										break;
					case ID_Print_Info_InfoSet:
						    if (Language ==  0)
											   MENU_SetFont(hWin,&GUI_Font30);
										else MENU_SetFont(hWin,&GUI_Font20_1);
										_SetMenuItem(hWin,0,pLanguage->IsPrint[0],ID_Print_Info_InfoSet_Prt_0,0);
										_SetMenuItem(hWin,0,pLanguage->IsPrint[1],ID_Print_Info_InfoSet_Prt_1,0);
										_SetMenuItem(hWin,0,pLanguage->IsPrint[2],ID_Print_Info_InfoSet_Prt_2,0);
										_SetMenuItem(hWin,0,pLanguage->IsPrint[3],ID_Print_Info_InfoSet_Prt_3,0);
										_SetMenuItem(hWin,0,pLanguage->IsPrint[4],ID_Print_Info_InfoSet_Prt_4,0);
						    break;
			}
}
Exemplo n.º 3
0
//
//MenuCallback
//
static void MenuCall(WM_MESSAGE *pMsg)
{
	 WM_HWIN hWin = pMsg->hWin;
	 WM_KEY_INFO *KEY;
	 MENU_ITEM_DATA *pData;
	 int16_t PrintMenuID;
	 PrintMenuID = WM_GetId(hWin);
  switch (pMsg->MsgId)
	 {
			case USER_MSG_LANGUAGE:
				    pLanguage = &Lguprintwin[Language];
			     PrintSetItemText(hWin,PrintMenuID);
			     TEXT_SetText(PrintHintText,"");
				    break;

			case WM_KEY:
								KEY = (WM_KEY_INFO*)pMsg->Data.p;
								switch (KEY->Key)
								{
									
									  case GUI_KEY_MENU:
												    WM_BringToTop(Menuwin);
											     WM_SetFocus(WM_GetDialogItem(Menuwin,ID_MENU));
											     MENU_SetSel(WM_GetDialogItem(Menuwin,ID_MENU),0);
											     MenuSel = 0;
												    break;
											case GUI_KEY_PRINT:
												    WM_BringToTop(mainwin);
											     WM_SetFocus(mainwin);
											     break;
											
											case GUI_KEY_LEFT:
											case GUI_KEY_RIGHT:
												    if(PrintActiveId >= ID_Print_Site_SiteSet_Prt_0 && PrintActiveId <= ID_Print_Site_SiteSet_Prt_4) 
																{
																				PrintSiteindex = PrintActiveId - 2068;
																	   if (Language == 0)
																				{
																							if (PrintSiteSet[PrintSiteindex] == 0)
																							{
																											sprintf(pStrBuf,"%c""%s",PrintSiteindex+65,"不打印");
																											_SetMenuItem(pMsg->hWin,0,pStrBuf,PrintActiveId,0);
																											PrintSiteSet[PrintSiteindex] = 1;
																							}
																							else
																							{																					
																											sprintf(pStrBuf,"%c""%s",PrintSiteindex+65,"打印");
																											_SetMenuItem(pMsg->hWin,0,pStrBuf,PrintActiveId,0);
																											PrintSiteSet[PrintSiteindex] = 0;

																							}
																				}
																				else //english
																				{
																								if (PrintSiteSet[PrintSiteindex] == 0)
																							{
																											sprintf(pStrBuf,"%c"" ""%s",PrintSiteindex+65,"REJ");
																											_SetMenuItem(pMsg->hWin,0,pStrBuf,PrintActiveId,0);
																											PrintSiteSet[PrintSiteindex] = 1;
																							}
																							else
																							{																					
																											sprintf(pStrBuf,"%c"" ""%s",PrintSiteindex+65,"SEL");
																											_SetMenuItem(pMsg->hWin,0,pStrBuf,PrintActiveId,0);
																											PrintSiteSet[PrintSiteindex] = 0;

																							}																				  
																				}
																}
												    else if(PrintActiveId >= ID_Print_Info_InfoSet_Prt_0 && PrintActiveId <= ID_Print_Info_InfoSet_Prt_4)
																{
																				PrintInfoindex = PrintActiveId - 2073;
																	   if(Language == 0)
																				{
																							if (PrintInfoSet[PrintInfoindex] == 0)
																							{
																											INFO("INDEX = %d",PrintInfoindex);
																											sprintf(pStrBuf,"%c""%s",PrintInfoindex+65,"不打印");
																											_SetMenuItem(pMsg->hWin,0,pStrBuf,PrintActiveId,0);
																											PrintSiteSet[PrintInfoindex] = 1;
																							}
																							else
																							{																					
																											sprintf(pStrBuf,"%c""%s",PrintInfoindex+65,"打印");
																											_SetMenuItem(pMsg->hWin,0,pStrBuf,PrintActiveId,0);
																											PrintSiteSet[PrintInfoindex] = 0;

																							}
																				}
																				else  //english
																				{
																							if (PrintInfoSet[PrintInfoindex] == 0)
																							{
																											INFO("INDEX = %d",PrintInfoindex);
																											sprintf(pStrBuf,"%c"" ""%s",PrintInfoindex+65,"REJ");
																											_SetMenuItem(pMsg->hWin,0,pStrBuf,PrintActiveId,0);
																											PrintSiteSet[PrintInfoindex] = 1;
																							}
																							else
																							{																					
																											sprintf(pStrBuf,"%c"" ""%s",PrintInfoindex+65,"SEL");
																											_SetMenuItem(pMsg->hWin,0,pStrBuf,PrintActiveId,0);
																											PrintSiteSet[PrintInfoindex] = 0;

																							}																					
																				}
																}																
																break;
											case GUI_KEY_ESCAPE:
																PrintMenuThird = 0;
											     if (PrintActiveId >= ID_Print_All && PrintActiveId <= ID_Print_Info)
																	   break;
																
											case GUI_KEY_ENTER:
																PrintMenuThird = 0;
											default:
														MENU_Callback(pMsg);
														break;
								}
								break;
								
			case WM_POST_PAINT:
        if(PrintMenuID == ID_PrintMenu)
								{
									  GUI_SetColor(GUI_BLACK);
									  if (Language == 0)
											{
													GUI_DrawLine(193,0,193,197);
													GUI_DrawLine(0,197,193,197);
											}
											else  //english
											{
												 GUI_DrawLine(240,0,240,147);
													GUI_DrawLine(0,147,240,147);
											}
								}									
								break;
				default:
							 MENU_Callback(pMsg);
						 	break;
		}
}