📄 functionchose.c
字号:
/*
* This file use to create the chosing window for usr, and response to the user's
* choice,call the responding function.
*/
#include <sys\sysusr.h>
#include <sys\sysmsg.h>
#include <asixwin.h>
#include <asixapp.h>
#include <asixwin\asix_ed.h>
#include <asixwin\asix_tb.h>
#include <ctype.h>
#include <resource\bitmap.h>
#include "FunctionChose.h"
#include "WordM1.h"
#include "WordTest.h"
#include "WordMem.h"
#include "MainWnd.h"
extern unsigned char *pWordBuf[MAXWORDNUM];
extern unsigned char *pExpBuf[MAXWORDNUM];
extern unsigned char *pTotalBuf;
/*******************************************************************
* Function: FunctionChose()
*
* Parameter: int
*
* Description: This Function use to create the function-chosing of
* English learning,depending on the parameter to deter
* -ming which level to create.
*
* returns: if ok, return 0
*
*********************************************************************/
int FunctionChose(int Level)
{
//窗口和空间ID
U32 ForthLevFuncChoseWin;
U32 ForthLevtskbar;
U32 ForthLevWord_bt;
U32 ForthLevTest_bt;
U32 SixthLevFuncChoseWin;
U32 SixthLevtskbar;
U32 SixthLevWord_bt;
U32 SixthLevTest_bt;
U32 MasterFuncChoseWin;
U32 Mastertskbar;
U32 MWord_bt;
U32 MasterTest_bt;
//函数变量
MSG ForthLevMsg, SixthLevMsg, MasterMsg;
U32 i;
U8 ForthLev_quit = 0;
U8 SixthLev_quit = 0;
U8 Master_quit = 0;
int counter;
switch( Level )
{
case 4:
LowLevProc(4);
//四级主窗口
ForthLevFuncChoseWin = CreateWindow(WNDCLASS_WIN,
"四级功能选择",
WS_OVERLAPPEDWINDOW, 0, 0,
LCD_WIDTH, LCD_HEIGHT,
0,
0,
NULL);
//四级任务栏
ForthLevtskbar = CreateWindow( WNDCLASS_TSKBAR,
NULL,
WS_CHILD|TBS_TYPICAL,
0, 0, 0, 0,
ForthLevFuncChoseWin,
0,
NULL);
//按钮
ForthLevWord_bt = CreateWindow(WNDCLASS_BUTTON,
"四级单词",
WS_CHILD | BS_REGULAR,
BUTTON_X,
SECOND_LEV_ITEM_HEIGHT_GAP,
SECOND_LEV_ITEM_WIDTH_GAP/2,
SECOND_LEV_ITEM_HEIGHT_GAP/2,
ForthLevFuncChoseWin,
0,
NULL);
ForthLevTest_bt = CreateWindow( WNDCLASS_BUTTON,
"四级单词测试",
WS_CHILD | BS_REGULAR,
BUTTON_X,
2*SECOND_LEV_ITEM_HEIGHT_GAP,
SECOND_LEV_ITEM_WIDTH_GAP/2,
SECOND_LEV_ITEM_HEIGHT_GAP/2,
ForthLevFuncChoseWin,
0,
NULL);
while(!ForthLev_quit)
{
ASIXGetMessage(&ForthLevMsg, NULL, 0, 0);
switch(ForthLevMsg.message)
{
case WM_COMMAND:
if( ForthLevMsg.lparam == ForthLevWord_bt )
{
counter = ForthLevDict();
}
else if(ForthLevMsg.lparam == ForthLevTest_bt)
{
counter = ForthLevTest();
}
break;
case WM_QUIT:
ForthLev_quit = 1;
break;
default:
break;
}//end of switch(ForthLevMsg.message)
DefWindowProc( ForthLevMsg.message,
ForthLevMsg.lparam,
ForthLevMsg.data,
ForthLevMsg.wparam );
}//end of while(quit);
DestroyWindow(ForthLevFuncChoseWin);
// EndofTask();
return 0;
break;
case 6:
LowLevProc(6);
//六级主窗口
SixthLevFuncChoseWin = CreateWindow(WNDCLASS_WIN,
"六级功能选择",
WS_OVERLAPPEDWINDOW,
0, 0,LCD_WIDTH,LCD_HEIGHT,
0,
0,
NULL );
//六级任务栏
SixthLevtskbar = CreateWindow( WNDCLASS_TSKBAR,
NULL,
WS_CHILD|TBS_TYPICAL,
0, 0, 0, 0,
SixthLevFuncChoseWin,
0,
NULL);
//按钮
SixthLevWord_bt = CreateWindow(WNDCLASS_BUTTON,
"六级单词",
WS_CHILD | BS_REGULAR,
BUTTON_X,
SECOND_LEV_ITEM_HEIGHT_GAP,
SECOND_LEV_ITEM_WIDTH_GAP/2,
SECOND_LEV_ITEM_HEIGHT_GAP/2,
SixthLevFuncChoseWin,
0,
NULL);
SixthLevTest_bt = CreateWindow(WNDCLASS_BUTTON,
"六级单词测试",
WS_CHILD | BS_REGULAR,
BUTTON_X,
2*SECOND_LEV_ITEM_HEIGHT_GAP,
SECOND_LEV_ITEM_WIDTH_GAP/2,
SECOND_LEV_ITEM_HEIGHT_GAP/2,
SixthLevFuncChoseWin,
0,
NULL);
while(!SixthLev_quit)
{
ASIXGetMessage(&SixthLevMsg, NULL, 0, 0);
switch(SixthLevMsg.message)
{
case WM_COMMAND:
if( SixthLevMsg.lparam == SixthLevWord_bt )
{
counter = SixLevDict();
}
else if(SixthLevMsg.lparam == SixthLevTest_bt)
{
counter = SixLevTest();
}
break;
case WM_QUIT:
SixthLev_quit = 1;
break;
default:
break;
}//end of switch(ForthLevMsg.message)
DefWindowProc( SixthLevMsg.message,
SixthLevMsg.lparam,
SixthLevMsg.data,
SixthLevMsg.wparam );
}//end of while(quit);
DestroyWindow( SixthLevFuncChoseWin );
// EndofTask();
return 0;
break;
case 10:
//考研主窗口
MasterFuncChoseWin = CreateWindow( WNDCLASS_WIN,
"考研功能选择",
WS_OVERLAPPEDWINDOW,
0, 0, LCD_WIDTH, LCD_HEIGHT,
0,
0,
NULL);
//考研任务栏
Mastertskbar = CreateWindow(WNDCLASS_TSKBAR,
NULL,
WS_CHILD|TBS_TYPICAL,
0, 0, 0, 0,
MasterFuncChoseWin,
0,
NULL);
//按钮
MWord_bt = CreateWindow( WNDCLASS_BUTTON,
"考研单词",
WS_CHILD | BS_REGULAR,
BUTTON_X,
SECOND_LEV_ITEM_HEIGHT_GAP,
SECOND_LEV_ITEM_WIDTH_GAP/2,
SECOND_LEV_ITEM_HEIGHT_GAP/2,
MasterFuncChoseWin,
0,
NULL);
while( !Master_quit )
{
ASIXGetMessage(&MasterMsg, NULL, 0, 0);
switch(MasterMsg.message)
{
case WM_COMMAND:
if( MasterMsg.lparam == MWord_bt )
{
LowLevProc(10);
counter = MasterLevDict();
}
break;
case WM_QUIT:
Master_quit = 1;
break;
default:
break;
}//end of switch(ForthLevMsg.message)
DefWindowProc( MasterMsg.message,
MasterMsg.lparam,
MasterMsg.data,
MasterMsg.wparam );
}//end of while(quit);
DestroyWindow( MasterFuncChoseWin );
//EndofTask();
free( pTotalBuf );
return 0;
break;
default:
break;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -