setup_ui1.c
上传用户:caisangzi8
上传日期:2013-10-25
资源大小:15756k
文件大小:17k
源码类别:

DVD

开发平台:

C/C++

  1. #include "user_init.h"
  2. #include "global.h"
  3. #include "osd.h"
  4. #include "func.h"
  5. #include "navdata.h"
  6. #include "kernel.h"
  7. #include "vpp.h"
  8. #include "user_if.h"
  9. #include "dsp3_if.h"
  10. #include "cchar.h"
  11. #include "ircmd.h"
  12. #include "auddrv.h" //2004AUDDRV oliver 20041004 for using audio driver purpose
  13. //#include "audif.h"
  14. #include "tvif.h"
  15. #include "memmap.h"
  16. #include "stdlib.h"
  17. #include "kinf.h"
  18. #include "setup_def.h"
  19. #include "one_key_pass.h"
  20. extern UINT8 setup_sel[MAX_SETUP_PAGE + MAX_CUSTM_SETUP_PAGE][MAX_PAGE_ITEM];
  21. extern const UINT8 setup_item[MAX_SETUP_PAGE + MAX_CUSTM_SETUP_PAGE][MAX_PAGE_ITEM][MAX_ITEM_SEL];
  22. #include "setup_page.h"
  23. extern UINT8 setup_page;
  24. extern  UINT8 setup_id;
  25. extern  UINT8   setup_sel_item;
  26. #define page setup_page
  27. #define id setup_id
  28. #define sel     setup_sel_item
  29. extern BYTE    passwdGUI_state;//record the current state in password GUI
  30. extern BYTE    index_y;          //item index for 1st-level page, 2nd-level page
  31. extern BYTE    index_y2;         //item index for 3rd-level page
  32. extern BYTE    index_y_start;
  33. extern BYTE    index_y2_start;
  34. extern BYTE    submenuStart;
  35. extern BYTE    setupLevel;       //0:main menu, 1:sub-menu, 2:selection-menu(menu of sub-menu)
  36. extern BYTE    setupItemNum[];
  37. #if defined(BBK_NEW_SETUP)&&defined(BBK_DV961_DVD) //axel 2004/1/26 04:01 DSS555 need not OENKEYPASSPAGE         
  38. //#ifdef BBK_NEW_SETUP//zhaoyanhua add 03-11-7 16:03
  39. /*
  40.  * Show main page.
  41.  */
  42. void ShowSetupMainPage()
  43. {
  44. const char   *str;
  45. int fontColor = 0;
  46. int bgColor = 0;
  47. fontColor = 6;
  48. bgColor = 0;
  49. SetOsdCol(1,1,SETUP_HL_COLOR,0xa346ffff);
  50. //clear rect to show correctly.
  51. osd_draw_region_rect(ONE_KEY_PASS_X, ONE_KEY_PASS_Y, 20*24, 14*24,0, 1);
  52. switch(index_x)
  53. {
  54.   case ONE_KEY_PASS_X:
  55. draw_setup_Btn_HL( 1, ONE_KEY_PASS_X*11, ONE_KEY_PASS_Y*4, 8* 24, 1*32,4,SETUP_HL_COLOR);
  56. break;
  57. case SETUP_X:
  58.     draw_setup_Btn_HL( 1,SETUP_X*14+28, SETUP_Y*4, 8* 24, 1*32,4,SETUP_HL_COLOR);
  59. break;
  60. case EXIT_SETUP_MENU_X:
  61.     draw_setup_Btn_HL( 1,EXIT_SETUP_MENU_X*14+32, EXIT_SETUP_MENU_Y*4, 9* 24, 1*32,4,SETUP_HL_COLOR);
  62. break;
  63. }
  64. str = _OsdMessegeFont1[osd_font_mode][STR_OS_ONEKEY_SETUP];
  65. osd_DrawRegionString(ONE_KEY_PASS_X, ONE_KEY_PASS_Y, str, fontColor,bgColor, 1);
  66. str = _OsdMessegeFont1[osd_font_mode][STR_OS_PROFESSION_SETUP];
  67. osd_DrawRegionString(SETUP_X+1, SETUP_Y, str, fontColor,bgColor, 1);
  68. str = _OsdMessegeFont1[osd_font_mode][STR_OS_EXIT_MENU];
  69. osd_DrawRegionString(EXIT_SETUP_MENU_X+2, EXIT_SETUP_MENU_Y, str, fontColor,bgColor, 1);
  70. }
  71. /*
  72. **FUNC : draw a rect border to show which button is select.
  73. **
  74. ** zhaoyanhua 
  75. ** Date: 03-11-7 15:00
  76. */
  77. void draw_setup_Btn_HL(BYTE r,UINT32 xStart, UINT32 yStart,UINT32 xLen,UINT32 yLen, int LineWidth,BYTE color)
  78. {
  79. //top line
  80. osd_draw_hline_region(xStart, xStart+xLen, yStart, color,LineWidth, r);
  81. //bottom Line
  82. osd_draw_hline_region(xStart, xStart+xLen, yStart+yLen-LineWidth, color,LineWidth, r);
  83. //left line
  84. osd_draw_vline_region(xStart, yStart, yStart+yLen, color,LineWidth, r);
  85. //right line
  86. osd_draw_vline_region(xStart+xLen-LineWidth, yStart, yStart+yLen, color,LineWidth, r);
  87. }
  88. /*
  89.  * show onekey setup page
  90.  */
  91. void ShowOneKeyPassPage()
  92. {
  93. osd_init_setup();  
  94.     index_y=0;
  95.     index_y_start=0;
  96.     setupItemNum[1]= MAX_PAGE_ITEM; // ALAN, 2003/9/9 03:32PM, to initial setupItemNum
  97.     setupLevel=0; // alan
  98. page = ONEKEYPASSPAGE;
  99. ShowSetupPage(2);
  100. }
  101. /*
  102.  * show main
  103.  */
  104. void ShowProfessionalSetup()
  105. {
  106. osd_init_setup();
  107. page = 0;
  108.     index_y=0;
  109.     index_y_start=0;
  110.     setupItemNum[1]=MAX_PAGE_ITEM; // ALAN, 2003/9/9 03:32PM, to initial setupItemNum
  111.     setupLevel=0; // alan
  112.     ShowSetupPage(2);
  113. }
  114. /*
  115.  *   get sel ITEM of ONEKEYPASSPAGE
  116.  *   to make the ONEKEYPASSPAGE has the same change with special SETUP PAGE 
  117.  */
  118. int GetOneKeyPageSel(int index_y)
  119. {
  120. int sel_item ;
  121. switch(index_y)
  122. {
  123. case 0: // audio output(MULTISPKPAGE)
  124. sel_item=SETUP_SPK_DOWNMIX;
  125. break;
  126. case 1:// TV format(SYSPAGE)
  127. sel_item = SETUP_TV_FORMAT;
  128. break;
  129. default:
  130. sel_item = 2;//DEFAULT VALUE ITEM
  131. }
  132. return sel_item;
  133. }
  134. #endif//  end for bbk's new setup
  135. #ifdef VIDEO_SETUP_NEW_GUI
  136. /*
  137.  *Function Description:
  138.  *    get the video current value to show in SETUP VIDEO PAGE 
  139.  * 
  140.  *  INPUT:
  141.  *    id ---> video osd string id type
  142.  *    
  143.  *  RETURN :
  144.  *    video value.
  145.  *  
  146.  * zhaoyanhua 2004-1-7 17:01
  147.  */
  148. int GetVideoSetValue(int str_id)
  149. {
  150. int iValue = 0;
  151. switch (str_id)
  152. {
  153. case STR_OS_BRIGHTNESS:
  154. iValue = SETUP_BRIGHTNESS-2;
  155. break;
  156. case STR_OS_CONTRAST:
  157. iValue = SETUP_CONTRAST-2;
  158. break;
  159. case STR_OS_HUE:
  160. iValue = SETUP_HUE-2-6;//must do like this!
  161. //printf("#####  ---setup_hue --%d--n",iValue);
  162. break;
  163. case STR_OS_SATURATION:
  164. iValue = SETUP_SATURATION-2;
  165. break;
  166. #ifdef DIP_CFG_ENABLE
  167. case STR_OS_DEINTLC:
  168. iValue = SETUP_DE_INTERLACE-2;
  169. break;
  170. #endif
  171. default:break;
  172. }
  173. //printf("###### ----in GetVideoSetValue %d---n",iValue);
  174. return iValue;
  175. }
  176. /*
  177.  *Function Description:
  178.  *    Draw Video Item(Brightness/hue/contrast ,ect) value in SETUP OSD.
  179.  *   
  180.  * INPUT:
  181.  *    ItemIndex ---> y_postion in level 1
  182.  *    
  183.  * zhaoyanhua 2004-1-7 19:22
  184.  */
  185. void setup_VideoItemValue(int ItemIndex,int fontColor,int bgColor)
  186. {
  187. BYTE buf[4];
  188. //draw ">" between sub-mean and it's corresponding selection area
  189. //osd_DrawString(SETUP_SUB_XSTART-1, ItemIndex+SETUP_MENU_YSTART+1, Ch_arrorR, SFONTCOLOR, SBGCOLOR);
  190. id = setup_item[page][ItemIndex][1];
  191. psprintf(buf,"%02d",GetVideoSetValue(id));
  192. //str = buf;
  193. //str = buf;
  194. osd_DrawString(SETUP_SUB_XSTART+1, ItemIndex+SETUP_MENU_YSTART+1, buf, fontColor, bgColor); 
  195. }
  196. /*
  197.  * Funciton Description:
  198.  *   
  199.  *    draw GUI to adjust video value 
  200.  * 
  201.  * INPUT:
  202.  *    id : video type :brightness/contrast/hue,ect
  203.  *
  204.  */
  205. void setup_ShowVideoGUI(int id)
  206. {
  207.     const char   *str;
  208.     
  209. #define MSG_STRING_X  0//message string xstart
  210. #define MSG_STRING_Y  11//message string ystart
  211. int GUI_x= 0,GUI_y= 0,GUI_h= 0,GUI_w = 0;//xstart/ystart/ylen/xlen
  212. int GUI_Backx = 0,GUI_Backy = 0, GUI_Backh= 0,GUI_Backw = 0;//background Rect xstart/ystart/ylen/xlen
  213. int GUI_Msgx= 0,GUI_Msgy= 0, GUI_Msgw =0, GUI_Msgh = 0;
  214. SetOsdCol(0,0,VIDEO_GUI_TRANS_COLOR,0x1e1e1e00);
  215. GUI_Backx = 0;
  216. GUI_Backy = SETUP_BUTTON_HEIGHT+24+40 - 2;
  217. //GUI_Backh = 9*SETUP_BUTTON_HEIGHT;
  218. GUI_Backh = 10*SETUP_BUTTON_HEIGHT-12;
  219. GUI_Backw = SETUP_MAX_WIDTH*15+40-4;
  220. //GUI_Backw = SETUP_MAX_WIDTH*15+40;
  221. //osd_draw_rect(20, SETUP_BUTTON_HEIGHT+24+40, (SETUP_MAX_WIDTH*15), 10*SETUP_BUTTON_HEIGHT-12, 10);
  222. //osd_draw_rect(0, SETUP_BUTTON_HEIGHT+24+40, (SETUP_MAX_WIDTH*15+40), 10*SETUP_BUTTON_HEIGHT-12, VIDEO_GUI_TRANS_COLOR);
  223. //draw background 
  224. //draw a big transparent rect .
  225. osd_draw_rect(GUI_Backx, GUI_Backy, GUI_Backw, GUI_Backh, VIDEO_GUI_TRANS_COLOR);
  226. //draw operation message rect
  227. GUI_Msgh = 70;
  228. GUI_Msgw = GUI_Backw;
  229. GUI_Msgx = GUI_Backx;
  230. GUI_Msgy = GUI_Backy+GUI_Backh-GUI_Msgh;
  231. osd_draw_rect(GUI_Msgx, GUI_Msgy, GUI_Msgw, GUI_Msgh, VIDEO_GUI_MSG_BGCOLOR);
  232. //draw video GUI
  233. GUI_h = (GUI_Backh - GUI_Msgh)/2 ;//GUI height
  234. GUI_w = GUI_Backw/2+120+70;//GUI width
  235. GUI_x = GUI_Backx + (GUI_Backw - GUI_w)/2;//GUI xstart
  236. GUI_y = GUI_Backy + (GUI_Backh - GUI_h - GUI_Msgh)/2; //GUI ystart
  237. osd_draw_rect(GUI_x, GUI_y, GUI_w, GUI_h, SBGCOLOR);
  238. //draw rect frame
  239. //I don't know why in SETUP_COLOR_TYPE2, SBLACKCOLOR -> WHITE
  240. //                                       SWHITECOLOR -> BLACK ?
  241. osd_DrawLine(GUI_x-2, GUI_y-1, GUI_x-2, GUI_y-1+GUI_h,SFONTCOLOR, 2);//left line
  242. osd_DrawLine(GUI_x, GUI_y-2, GUI_x+GUI_w, GUI_y-2,SFONTCOLOR, 2);//top line
  243. osd_DrawLine(GUI_x-1, GUI_y-2+GUI_h, GUI_x+1+GUI_w, GUI_y-2+GUI_h,SWHITECOLOR, 2);//bottom line
  244. osd_DrawLine(GUI_x-1+GUI_w, GUI_y-2, GUI_x-1+GUI_w, GUI_y+GUI_h,SWHITECOLOR, 2);//right line
  245. //show id string
  246. setup_CookVideoGUIString(id);
  247. //show operation Message about this id
  248. str = _OsdMessegeFont1[osd_font_mode][STR_OS_ENTER_RETURN];
  249. osd_DrawString(MSG_STRING_X, MSG_STRING_Y, str, SFONTCOLOR, VIDEO_GUI_MSG_BGCOLOR);///13
  250. //osd_DrawString(MSG_STRING_X, MSG_STRING_Y, "ENTER SELECT TO RETURN MAIN SETUP",SFONTCOLOR,VIDEO_GUI_MSG_BGCOLOR);///13
  251. }
  252. /*
  253.  * Funciton Discription:
  254.  *  when LEFT/RIGHT,show corresponding GUI and value.
  255.  *
  256.  * zhaoyanhua 2004-1-8 16:10
  257.  */
  258. void setup_CookVideoGUIString(int id)
  259. {
  260. #define  STRING_X  4//6
  261. #define  STRING_Y  6
  262.     int font_id = 0;
  263. int Level= 0;
  264. int totalLevel = 0;
  265. switch (id)
  266. {
  267. case STR_OS_BRIGHTNESS:
  268. Level = SETUP_BRIGHTNESS-2;
  269. totalLevel = 13;
  270. font_id = VIDEO_BIGHT_ID;
  271. break;
  272. case STR_OS_CONTRAST:
  273. Level = SETUP_CONTRAST-2;
  274. totalLevel = 13;
  275. font_id = VIDEO_CONTRAST_ID;
  276. break;
  277. case STR_OS_HUE:
  278. Level = SETUP_HUE-2;
  279. totalLevel = 13;
  280. font_id = VIDEO_HUE_ID;
  281. break;
  282. case STR_OS_SATURATION:
  283. Level = SETUP_SATURATION-2;
  284. totalLevel = 13;
  285. font_id = VIDEO_SATURATION_ID;
  286. break;
  287. #ifdef DIP_CFG_ENABLE
  288. case STR_OS_DEINTLC:
  289. Level = SETUP_DE_INTERLACE-2;
  290. totalLevel = 7;
  291. font_id = VIDEO_DEINTERLACE_ID;
  292. break;
  293. #endif
  294. default:break;
  295. }
  296. show_level(font_id, Level, totalLevel);//write message to "linebuf".
  297. osd_DrawString(STRING_X, STRING_Y, linebuf,STITLECOLOR, SBGCOLOR);
  298. }
  299. #endif//VIDEO_SETUP_NEW_GUI
  300. #ifdef SETUP_PASSWORD_GUI //zhaoyanhua add 2004-1-14 16:54
  301. /*
  302.  * Function Description:
  303.  *    in SETUP  show password GUI
  304.  *
  305.  */
  306. void setup_ShowPasswdGUI(void)
  307. {
  308.     const char   *str;
  309. int GUI_x= 0,GUI_y= 0,GUI_h= 0,GUI_w = 0;//xstart/ystart/ylen/xlen
  310. int GUI_Backx = 0,GUI_Backy = 0, GUI_Backh= 0,GUI_Backw = 0;//background Rect xstart/ystart/ylen/xlen
  311. int GUI_Msgx= 0,GUI_Msgy= 0, GUI_Msgw =0, GUI_Msgh = 0;
  312. SetOsdCol(0,0,PASSWD_GUI_TRANS_COLOR,0x1e1e1e00);
  313. SetOsdCol(0,0,SANTIBGCOLOR,0xa346ffff);
  314. GUI_Backx = 0;
  315. GUI_Backy = SETUP_BUTTON_HEIGHT+24+40-2;
  316. GUI_Backh = 10*SETUP_BUTTON_HEIGHT-12;
  317. GUI_Backw = SETUP_MAX_WIDTH*15+40-4;
  318. //draw background 
  319. //draw a big transparent rect .
  320. osd_draw_rect(GUI_Backx, GUI_Backy, GUI_Backw, GUI_Backh, PASSWD_GUI_TRANS_COLOR);
  321. //draw operation message rect
  322. GUI_Msgh = 70;
  323. GUI_Msgw = GUI_Backw;
  324. GUI_Msgx = GUI_Backx;
  325. GUI_Msgy = GUI_Backy+GUI_Backh-GUI_Msgh;
  326. osd_draw_rect(GUI_Msgx, GUI_Msgy, GUI_Msgw, GUI_Msgh, PASSWD_GUI_MSG_BGCOLOR);
  327. //draw video GUI
  328. GUI_h = (GUI_Backh - GUI_Msgh)/2+ 80;//+100 ;//GUI height
  329. GUI_w = GUI_Backw/2+120;//GUI width
  330. GUI_x = GUI_Backx + (GUI_Backw - GUI_w)/2;//GUI xstart
  331. GUI_y = GUI_Backy + (GUI_Backh - GUI_h - GUI_Msgh)/2; //GUI ystart
  332. osd_draw_rect(GUI_x, GUI_y, GUI_w, GUI_h, SBGCOLOR);
  333. //draw rect frame
  334. //I don't know why in SETUP_COLOR_TYPE2, SBLACKCOLOR -> WHITE
  335. //                                       SWHITECOLOR -> BLACK ?
  336. osd_DrawLine(GUI_x-2, GUI_y-1, GUI_x-2, GUI_y-1+GUI_h,SFONTCOLOR, 2);//left line
  337. osd_DrawLine(GUI_x, GUI_y-2, GUI_x+GUI_w, GUI_y-2,SFONTCOLOR, 2);//top line
  338. osd_DrawLine(GUI_x-1, GUI_y-2+GUI_h, GUI_x+1+GUI_w, GUI_y-2+GUI_h,SWHITECOLOR, 2);//bottom line
  339. osd_DrawLine(GUI_x-1+GUI_w, GUI_y-2, GUI_x-1+GUI_w, GUI_y+GUI_h,SWHITECOLOR, 2);//right line
  340. //nwe passwd
  341. str = _OsdMessegeFont1[osd_font_mode][STR_OS_OLD_PASSWD];
  342. osd_DrawString(OLD_PASSWD_X, OLD_PASSWD_Y, str, STITLECOLOR, SBGCOLOR);///13
  343. //osd_DrawString(OLD_PASSWD_X, OLD_PASSWD_Y, "OLD PASSWD:",STITLECOLOR, SBGCOLOR);
  344. if(passwdGUI_state != INPUT_GRADE_PASSWD_STATE)//grade passwd not show new passwd
  345. {   
  346.     str = _OsdMessegeFont1[osd_font_mode][STR_OS_NEW_PASSWD];
  347.     osd_DrawString(NEW_PASSWD_X, NEW_PASSWD_Y, str, STITLECOLOR, SBGCOLOR);///13
  348. //osd_DrawString(NEW_PASSWD_X, NEW_PASSWD_Y, "NEW PASSWD:",STITLECOLOR, SBGCOLOR);
  349.     }
  350. setup_PasswdGUIRefresh(passwdGUI_state);
  351. }
  352. /*
  353.  * when input password refresh PASSWORD in time
  354.  */
  355. void setup_PasswdGUIRefresh(int state)
  356. {
  357.     const char   *str;
  358. int oldpswd_bgcolor = 0;
  359. int newpswd_bgcolor = 0;
  360. int ok_bgcolor = 0,bDown = 0,left_top_color = 0,right_bottom_color = 0;
  361. switch(state)
  362. {
  363. case INPUT_OLD_PASSWD_STATE:
  364. oldpswd_bgcolor = PASSWD_SELECTED_COLOR;
  365. newpswd_bgcolor = PASSWD_UNSELECTED_COLOR;
  366. ok_bgcolor = PASSWD_UNSELECTED_COLOR;;
  367. bDown = BUTTON_DOWN;
  368. //show operation Message about this state
  369. //"please input old password"
  370.         str = _OsdMessegeFont1[osd_font_mode][STR_OS_PASSWD_SENTENCE1];
  371.         osd_DrawString(PASSWD_MSG_STRING_X, PASSWD_MSG_STRING_Y, str, SFONTCOLOR, VIDEO_GUI_MSG_BGCOLOR);///13
  372. //osd_DrawString(PASSWD_MSG_STRING_X, PASSWD_MSG_STRING_Y , "PLEASE INPUT OLD PASSWD",SFONTCOLOR,VIDEO_GUI_MSG_BGCOLOR);///13
  373. break;
  374. case INPUT_NEW_PASSWD_STATE:
  375. oldpswd_bgcolor = PASSWD_SELECTED_COLOR;
  376. newpswd_bgcolor = PASSWD_SELECTED_COLOR;
  377. ok_bgcolor = PASSWD_UNSELECTED_COLOR;
  378. bDown = BUTTON_DOWN;
  379. //show operation Message about this state
  380. //"please input new password"
  381. osd_DrawString(PASSWD_MSG_STRING_X, PASSWD_MSG_STRING_Y , "                       ",SFONTCOLOR,VIDEO_GUI_MSG_BGCOLOR);///13
  382.         str = _OsdMessegeFont1[osd_font_mode][STR_OS_PASSWD_SENTENCE2];
  383.         osd_DrawString(PASSWD_MSG_STRING_X, PASSWD_MSG_STRING_Y, str, SFONTCOLOR, VIDEO_GUI_MSG_BGCOLOR);///13
  384. //osd_DrawString(PASSWD_MSG_STRING_X, PASSWD_MSG_STRING_Y , "PLEASE INPUT NEW PASSWD",SFONTCOLOR,VIDEO_GUI_MSG_BGCOLOR);///13
  385. break;
  386. case INPUT_GRADE_PASSWD_STATE:
  387. oldpswd_bgcolor = PASSWD_SELECTED_COLOR;
  388. ok_bgcolor = PASSWD_UNSELECTED_COLOR;;
  389. bDown = BUTTON_DOWN;
  390. //show operation Message about this state
  391. //"please input old password"
  392.          str = _OsdMessegeFont1[osd_font_mode][STR_OS_PASSWD_SENTENCE1];
  393.          osd_DrawString(PASSWD_MSG_STRING_X, PASSWD_MSG_STRING_Y, str, SFONTCOLOR, VIDEO_GUI_MSG_BGCOLOR);///13
  394. //osd_DrawString(PASSWD_MSG_STRING_X, PASSWD_MSG_STRING_Y , "PLEASE INPUT OLD PASSWD",SFONTCOLOR,VIDEO_GUI_MSG_BGCOLOR);///13
  395. break;
  396. case SHOW_OK_STATE:
  397. oldpswd_bgcolor = PASSWD_UNSELECTED_COLOR;
  398. newpswd_bgcolor = PASSWD_UNSELECTED_COLOR;
  399. ok_bgcolor = PASSWD_SELECTED_COLOR;;
  400. bDown = BUTTON_UP;
  401. //show operation Message about this state
  402. //"enter select return to main setup"
  403.         str = _OsdMessegeFont1[osd_font_mode][STR_OS_ENTER_RETURN];
  404.         osd_DrawString(PASSWD_MSG_STRING_X, PASSWD_MSG_STRING_Y, str, SFONTCOLOR, VIDEO_GUI_MSG_BGCOLOR);///13
  405. //osd_DrawString(PASSWD_MSG_STRING_X, PASSWD_MSG_STRING_Y , "ENTER SELECT TO RETURN MAIN SETUP",SFONTCOLOR,VIDEO_GUI_MSG_BGCOLOR);///13
  406. break;
  407. case SHOW_ERROR_STATE://when old password error, show error message. zhaoyanhua add 2004-1-30 11:36
  408. oldpswd_bgcolor = PASSWD_SELECTED_COLOR;
  409. newpswd_bgcolor = PASSWD_UNSELECTED_COLOR;
  410. ok_bgcolor = PASSWD_UNSELECTED_COLOR;;
  411. bDown = BUTTON_DOWN;
  412. //show operation Message about this state
  413. //"passwd error! please input again"
  414. osd_DrawString(PASSWD_MSG_STRING_X, PASSWD_MSG_STRING_Y , "                       ",SFONTCOLOR,VIDEO_GUI_MSG_BGCOLOR);///13
  415.             str = _OsdMessegeFont1[osd_font_mode][STR_OS_PASSWD_ERROR];
  416. osd_DrawString(PASSWD_MSG_STRING_X, PASSWD_MSG_STRING_Y , str,SFONTCOLOR,VIDEO_GUI_MSG_BGCOLOR);///13
  417. //osd_DrawString(PASSWD_MSG_STRING_X, PASSWD_MSG_STRING_Y , "PASSWD ERROR. PLEASE INPUT AGAIN",SFONTCOLOR,VIDEO_GUI_MSG_BGCOLOR);///13
  418. break;
  419. default:
  420. break;
  421. }
  422. //old password box
  423. if(passwdGUI_state != INPUT_NEW_PASSWD_STATE)//when input NEW PASSWD, not redraw OLD PASSWORD BOX
  424. osd_draw_rect(OLD_PASSWD_BOX_X,OLD_PASSWD_BOX_Y,PASSWD_BOX_XLEN,PASSWD_BOX_YLEN, oldpswd_bgcolor);
  425. //new password word box
  426. if ( !((page==SYSPAGE) && (index_y==GRADEITEM)) ) ////grade passwd not show new passwd
  427. osd_draw_rect(NEW_PASSWD_BOX_X,NEW_PASSWD_BOX_Y,PASSWD_BOX_XLEN,PASSWD_BOX_YLEN, newpswd_bgcolor);
  428. //OK button
  429. osd_draw_rect(OK_BUTTON_X,OK_BUTTON_Y,OK_BUTTON_XLEN,OK_BUTTON_YLEN,ok_bgcolor);
  430. if(bDown)
  431. {
  432. left_top_color = SWHITECOLOR; //in fact it is black
  433. right_bottom_color =SFONTCOLOR; 
  434. }
  435. else
  436. {
  437. left_top_color = SFONTCOLOR;
  438. right_bottom_color= SWHITECOLOR;//in fact it is black
  439. }
  440. osd_DrawLine(OK_BUTTON_X, OK_BUTTON_Y, OK_BUTTON_X, OK_BUTTON_Y+OK_BUTTON_YLEN,left_top_color, 1);//left line
  441. osd_DrawLine(OK_BUTTON_X, OK_BUTTON_Y, OK_BUTTON_X+OK_BUTTON_XLEN, OK_BUTTON_Y,left_top_color, 1);//top line
  442. osd_DrawLine(OK_BUTTON_X, OK_BUTTON_Y-1+OK_BUTTON_YLEN, OK_BUTTON_X+OK_BUTTON_XLEN, OK_BUTTON_Y+OK_BUTTON_YLEN,right_bottom_color, 1);//bottom line
  443. osd_DrawLine(OK_BUTTON_X-1+OK_BUTTON_XLEN, OK_BUTTON_Y, OK_BUTTON_X+OK_BUTTON_XLEN, OK_BUTTON_Y+OK_BUTTON_YLEN,right_bottom_color, 1);//right line
  444. osd_DrawString(OK_BUTTON_WORD_X, OK_BUTTON_WORD_Y, "OK",STITLECOLOR, ok_bgcolor);
  445. }
  446. #endif//SETUP_PASSWORD_GUI