BOOL FAR PASCAL ScrReSize (HWND hWnd, UINT wParam, WORD cx, WORD cy) /* returns TRUE only if real resizing performed */ { BOOL ChgWidth, ChgHeight; if ((wParam != SIZENORMAL) && (wParam != SIZEFULLSCREEN)) { return FALSE; } ChgWidth = (cx != GetWindowWord (hWnd, GWW_SCRCX)); ChgHeight = (cy != GetWindowWord (hWnd, GWW_SCRCY)); if (!ChgWidth && !ChgHeight) return FALSE; SetWindowWord (hWnd, GWW_SCRCX, cx); SetWindowWord (hWnd, GWW_SCRCY, cy); if (!InternalRequest) { SCREEN *TopScreen; InternalRequest = TRUE; TopScreen = first_screen; select_screen ((SCREEN *)GetWindowLong (hWnd, GWL_SCRPTR), FALSE); if (ChgWidth) { newwidth (TRUE, DisplayableColumns (hWnd, cx, &EmacsCM)); } if (ChgHeight) { newsize (TRUE, DisplayableRows (hWnd, cy, &EmacsCM)); } select_screen (TopScreen, FALSE); update (FALSE); InternalRequest = FALSE; } return TRUE; } /* ScrReSize */
/* ========== */ static void PASCAL ChangeFont (void) { SCREEN *sp, *fsp; RECT Rect; /*-loop through all the screens, resizing the vision that emacs has of them, processing the current ("first") screen last */ InternalRequest = TRUE; fsp = first_screen; do { sp = first_screen; while (sp->s_next_screen != (SCREEN *)NULL) sp = sp->s_next_screen; select_screen (sp, FALSE); GetClientRect (sp->s_drvhandle, &Rect); newwidth (TRUE, DisplayableColumns (sp->s_drvhandle, Rect.right, &EmacsCM)); newsize (TRUE, DisplayableRows (sp->s_drvhandle, Rect.bottom, &EmacsCM)); } while (sp != fsp); InternalRequest = FALSE; /*-update the frame's client area and the MDIClient's size */ InvalidateRect (hFrameWnd, NULL, TRUE); GetClientRect (hFrameWnd, &Rect); MoveWindow (hMDIClientWnd, 0, 0, Rect.right, Rect.bottom - EmacsCM.MLHeight, TRUE); } /* ChangeFont */
/** * [lcd_rol LCD������ʾ] */ void lcd_rol(){ int x; for(x=0;x<64;x++){ select_screen(0); lcd_write_cmd(0xc0+x); delay_ms(500); } }
/** * [lcd_cls LCD��������] * @param screen [ѡ������] */ void lcd_cls(SCREEN screen){ int x,y; select_screen(screen); //screen:0-ѡ��ȫ����1-ѡ���������2-ѡ���Ұ��� for(x=0xb8;x<0xc0;x++){ //��0xb8-0xbf,��8ҳ lcd_write_cmd(x); lcd_write_cmd(0x40); //�еij�ʼ��ַ��0x40 for(y=0;y<64;y++){ lcd_write_byte(0x00); } } }
/** * [lcd_write_char LCDд��һ���ֽ�] * @param row [������] * @param col [������] * @param c [��д����ֽ�] */ void lcd_write_char(u8 row,u8 col,u8 c){ u8 i,calc_col; calc_col = col; if(col <=7) select_screen(LEFT); else{ calc_col = col - 8; select_screen(RIGHT); } lcd_set_coords(row,calc_col); c-=32; lcd_set_coords(row,calc_col); for(i=0;i<16;i++){ if(i==8){ lcd_set_coords(row+1,calc_col); } lcd_write_byte(font8x16[c][i]); } }