本文整理汇总了C++中CControl::DrawFunc方法的典型用法代码示例。如果您正苦于以下问题:C++ CControl::DrawFunc方法的具体用法?C++ CControl::DrawFunc怎么用?C++ CControl::DrawFunc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CControl
的用法示例。
在下文中一共展示了CControl::DrawFunc方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MsgBoxDlgProc
void MsgBoxDlgProc(LPWindow pWindow, LPGuiMsgInfo pGuiMsgInfo)
{
CControl* pControl;
switch(pGuiMsgInfo->ID)
{
case WM_LOAD:
pWindow->DrawFunc(pWindow);
break;
case WM_SHOW:
pWindow->DrawFunc(pWindow);
break;
case WM_CLOSE:
if(pWindow->pParentWindow != NULL)
{
//·µ»Ø¸¸´°¿Ú
g_pCurWindow = pWindow->pParentWindow;
PostWindowMsg(g_pCurWindow, WM_RETURN, 0, 0);
}
break;
case WM_UPDATECTRL:
pControl = (CControl*)(pGuiMsgInfo->wParam);
if(pControl != NULL)
{
pControl->DrawFunc(pControl);
}
break;
case WM_KEYDOWN:
switch(pGuiMsgInfo->wParam)
{
case KEY_BACK: //·µ»Ø
PostWindowMsg(pWindow, WM_CLOSE, 0, 0);
break;
case KEY_OK: //È·¶¨
PostWindowMsg(pWindow, WM_CLOSE, 0, 0);
break;
default:
break;
}
break;
default:
break;
}
}
示例2: Form_NetSet_Proc
void Form_NetSet_Proc(LPWindow pWindow, LPGuiMsgInfo pGuiMsgInfo)
{
CControl* pControl;
SIPADDR *setip;
s32 port;
char cTemp[20]="";
static u8 reset = 0;
switch(pGuiMsgInfo->ID)
{
case WM_LOAD:
ClearScreen();
SysTimeDly(15);
//CreateWindowTimerEx(pWindow, 1);
case WM_SHOW:
sprintf(gsIpAddr,"%d.%d.%d.%d",gIpAddr.addr1,gIpAddr.addr2,gIpAddr.addr3,gIpAddr.addr4);
sprintf(gsSubnetMask,"%d.%d.%d.%d",gSubnetMask.addr1,gSubnetMask.addr2,gSubnetMask.addr3,gSubnetMask.addr4);
sprintf(gsGateWay,"%d.%d.%d.%d",gGateWay.addr1,gGateWay.addr2,gGateWay.addr3,gGateWay.addr4);
sprintf(gsServerPort,"%d",gServerPort);
sprintf(gsServerAddr,"%d.%d.%d.%d",gServerAddr.addr1,gServerAddr.addr2,gServerAddr.addr3,gServerAddr.addr4);
pWindow->DrawFunc(pWindow);
break;
case WM_UPDATECTRL:
pControl = (CControl*)(pGuiMsgInfo->wParam);
if(pControl != NULL)
{
pControl->DrawFunc(pControl);
}
break;
case WM_TIMEUPDATE:
PostWindowMsg(WM_UPDATECTRL, (uint32)&gStatusBar, 0);
break;
case WM_KEYDOWN:
switch(pGuiMsgInfo->wParam)
{
case KEY_UP:
if (CTRL_CONTENT(mNetParaAttr).focus > 0) {
CTRL_CONTENT(mNetParaAttr).focus--;
PostWindowMsg(WM_UPDATECTRL, (uint32)&mNetParaAttr, 0);
}
break;
case KEY_DOWN:
if (CTRL_CONTENT(mNetParaAttr).focus + 1 < CTRL_CONTENT(mNetParaAttr).total) {
CTRL_CONTENT(mNetParaAttr).focus++;
PostWindowMsg(WM_UPDATECTRL, (uint32)&mNetParaAttr, 0);
}
break;
case KEY_OK:
memset(cTemp,0,20);
switch (CTRL_CONTENT(mNetParaAttr).focus) {
case 0:
//
if( LoadEditDlg(&g_TextEditWindow, "请输入设备IP地址", gsIpAddr, cTemp, 15)) {
setip = IPFormatDetection(cTemp);
if(setip) {
memcpy(&gIpAddr,setip,sizeof(SIPADDR));
strcpy(gsIpAddr,cTemp);
reset = 1;
//IP4_ADDR(&ipaddr, setip->addr1, setip->addr2, setip->addr3, setip->addr4);
//tcpclient_close();
//netif_set_ipaddr(&xnetif,&ipaddr);
NetParamSave();
} else {
MsgBoxDlg(&g_MsgBoxDlg, "信息提示", "IP地址不合法,请重新输入");
}
}
break;
case 1:
//
if( LoadEditDlg(&g_TextEditWindow, "请输入设备子网掩码", gsSubnetMask, cTemp, 15)) {
setip = IPFormatDetection(cTemp);
if(setip) {
memcpy(&gSubnetMask,setip,sizeof(SIPADDR));
strcpy(gsSubnetMask,cTemp);
reset = 1;
//IP4_ADDR(&netmask, setip->addr1, setip->addr2, setip->addr3, setip->addr4);
//tcpclient_close();
//netif_set_netmask(&xnetif,&netmask);
NetParamSave();
} else {
MsgBoxDlg(&g_MsgBoxDlg, "信息提示", "子网掩码不合法,请重新输入");
}
}
break;
case 2:
//
if( LoadEditDlg(&g_TextEditWindow, "请输入设备默认网关", gsGateWay, cTemp, 15)) {
setip = IPFormatDetection(cTemp);
if(setip) {
memcpy(&gGateWay,setip,sizeof(SIPADDR));
strcpy(gsGateWay,cTemp);
reset = 1;
//.........这里部分代码省略.........
示例3: Form_ADChannel_Proc
void Form_ADChannel_Proc(LPWindow pWindow, LPGuiMsgInfo pGuiMsgInfo)
{
// CControl* pControl;
// char cBuff[20]="";
// char cTemp[10]="";
switch(pGuiMsgInfo->ID)
{
case WM_LOAD:
ClearScreen();
SysTimeDly(3);
CreateWindowTimer(&gWD_ADChannel);
StartWindowTimer(&gWD_ADChannel);
case WM_SHOW:
pWindow->DrawFunc(pWindow);
break;
case WM_UPDATECTRL:
mADChannel1.DrawFunc(&mADChannel1);
mADChannel2.DrawFunc(&mADChannel2);
mADChannel3.DrawFunc(&mADChannel3);
mADChannel4.DrawFunc(&mADChannel4);
break;
#if 0
pControl = (CControl*)(pGuiMsgInfo->wParam);
if(pControl != NULL)
{
if (pControl->state & CTRL_VISABLE)
pControl->DrawFunc(pControl);
}
break;
#endif
case WM_TIMEUPDATE:
// gWD_ADChannel.DrawFunc(&gWD_ADChannel);
gStatusBar.DrawFunc(&gStatusBar);
// PostWindowMsg(WM_UPDATECTRL, (uint32)&gStatusBar, 0);
break;
case WM_KEYDOWN:
switch(pGuiMsgInfo->wParam)
{
case KEY_UP:
break;
case KEY_DOWN:
break;
case KEY_LEFT:
break;
case KEY_OK:
//MsgBoxDlg(&g_MsgBoxDlg, "整车式零点标定成功", "将进入整车式砝码重量输入流程");
//
// g_pCurWindow = &gWD_CalibrateInput; //时间
// g_pCurWindow->pParentWindow = &gWD_CalibrateWeight;
// PostWindowMsg(WM_LOAD, NULL, NULL);
//
break;
case KEY_RIGHT:
break;
case KEY_BACK:
StopWindowTimer(&gWD_ADChannel);
// CalibrateProc();
// CalibParamSync();
if(pWindow->pParentWindow != NULL)
{
g_pCurWindow = pWindow->pParentWindow;
}
else
{
g_pCurWindow = &gWD_Main;
}
PostWindowMsg(g_pCurWindow, WM_LOAD,0,0);
break;
case KEY_1:
case KEY_2:
case KEY_3:
case KEY_4:
case KEY_5:
case KEY_6:
case KEY_7:
case KEY_8:
case KEY_9:
break;
default:
break;
}
break;
default:
break;
}
}
示例4: Form_Warning_Proc
void Form_Warning_Proc(LPWindow pWindow, LPGuiMsgInfo pGuiMsgInfo)
{
CControl* pControl;
switch(pGuiMsgInfo->ID)
{
case WM_LOAD:
ClearScreen(); //ÇåÆÁ
SysTimeDly(3);
CTRL_CONTENT(mWarningAttr).focus = 0; //¹â±êÍ£ÁôλÖÃ
CreateWindowTimer(&gWD_Warning);
StartWindowTimer(&gWD_Warning);
case WM_SHOW:
//ÉèÖùÊÕÏÄÚÈÝ
Device_status();
pWindow->DrawFunc(pWindow);
break;
case WM_UPDATECTRL:
pControl = (CControl*)(pGuiMsgInfo->wParam);
if(pControl != NULL)
{
pControl->DrawFunc(pControl);
}
break;
case WM_TIMEUPDATE:
// PostWindowMsg(WM_UPDATECTRL, (uint32)&gStatusBar, 0);
gStatusBar.DrawFunc(&gStatusBar);
break;
case WM_KEYDOWN:
switch(pGuiMsgInfo->wParam)
{
case KEY_UP:
if (CTRL_CONTENT(mWarningAttr).focus > 0) {
CTRL_CONTENT(mWarningAttr).focus--;
PostWindowMsg(pWindow, WM_UPDATECTRL, (uint32)&mWarningAttr, 0);
}
break;
case KEY_DOWN:
if (CTRL_CONTENT(mWarningAttr).focus + 1 < CTRL_CONTENT(mWarningAttr).total) {
CTRL_CONTENT(mWarningAttr).focus++;
PostWindowMsg(pWindow, WM_UPDATECTRL, (uint32)&mWarningAttr, 0);
}
break;
case KEY_LEFT:
break;
case KEY_OK:
break;
case KEY_RIGHT:
break;
case KEY_BACK:
StopWindowTimer(&gWD_Warning);
// DestoryWindowTimer(&gWD_Warning);
if(pWindow->pParentWindow != NULL)
{
g_pCurWindow = pWindow->pParentWindow;
}
else
{
g_pCurWindow = &gWD_Main;
}
PostWindowMsg(g_pCurWindow, WM_LOAD,0,0);
break;
default:
break;
}
break;
default:
break;
}
}
示例5: Form_CalibrateSet_Proc
void Form_CalibrateSet_Proc(LPWindow pWindow, LPGuiMsgInfo pGuiMsgInfo)
{
CControl* pControl;
char cTemp[10] = {0};
switch(pGuiMsgInfo->ID)
{
case WM_LOAD:
ClearScreen();
SysTimeDly(3);
CTRL_CONTENT(mCalibrateSetAttr).focus = 0;
case WM_SHOW:
sprintf(DynamicCoefficientSet,"%d",0);
sprintf(StaticCoefficientSet,"%f", gWetPar.Scaler_K);
sprintf(Axle3_K_Value,"%f", gWetPar.PreAxle1_K);
sprintf(Axle4_K_Value,"%f", gWetPar.PreAxle2_K);
pWindow->DrawFunc(pWindow);
break;
case WM_UPDATECTRL:
pControl = (CControl*)(pGuiMsgInfo->wParam);
if(pControl != NULL)
{
pControl->DrawFunc(pControl);
}
break;
case WM_TIMEUPDATE:
PostWindowMsg(pWindow, WM_UPDATECTRL, (uint32)&gStatusBar, 0);
break;
case WM_KEYDOWN:
switch(pGuiMsgInfo->wParam)
{
case KEY_UP:
if (CTRL_CONTENT(mCalibrateSetAttr).focus > 0) {
CTRL_CONTENT(mCalibrateSetAttr).focus--;
PostWindowMsg(pWindow, WM_UPDATECTRL, (uint32)&mCalibrateSetAttr, 0);
}
break;
case KEY_DOWN:
if (CTRL_CONTENT(mCalibrateSetAttr).focus + 1 < CTRL_CONTENT(mCalibrateSetAttr).total) {
CTRL_CONTENT(mCalibrateSetAttr).focus++;
PostWindowMsg(pWindow, WM_UPDATECTRL, (uint32)&mCalibrateSetAttr, 0);
}
break;
case KEY_LEFT:
break;
case KEY_OK:
switch (CTRL_CONTENT(mCalibrateSetAttr).focus)
{
case 0:
if( LoadEditDlg(&g_TextEditWindow, "动态标定系数参数", cTemp, cTemp, 8));
break;
case 1:
if( LoadEditDlg(&g_TextEditWindow, "静态标定系数参数", cTemp, cTemp, 8))
{
Set_ScalerStatic_K(atof(cTemp));
}
break;
case 2:
if( LoadEditDlg(&g_TextEditWindow, "3轴K系数", cTemp, cTemp, 8))
{
Set_3Axle_Static_K(atof(cTemp));
}
break;
case 3:
if( LoadEditDlg(&g_TextEditWindow, "4轴K系数", cTemp, cTemp, 8))
{
Set_4Axle_Static_K(atof(cTemp));
}
break;
default:
break;
}
PostWindowMsg(pWindow, WM_SHOW,0,0);
break;
case KEY_RIGHT:
break;
case KEY_BACK:
if(pWindow->pParentWindow != NULL)
{
g_pCurWindow = pWindow->pParentWindow;
}
else
{
g_pCurWindow = &gWD_Main;
}
PostWindowMsg(g_pCurWindow, WM_LOAD,0,0);
break;
//.........这里部分代码省略.........
示例6: Form_DateSet_Proc
void Form_DateSet_Proc(LPWindow pWindow, LPGuiMsgInfo pGuiMsgInfo)
{
CControl* pControl;
GuiMsgInfo guiMsgInfo;
// static CSysTime time;
static CSysTime time = {0};
static CSysTime *SetDate = NULL;
switch(pGuiMsgInfo->ID)
{
case WM_LOAD:
ClearScreen();
SysTimeDly(15);
// GetSysTime(&time);
SetDate = Get_System_Time();
time.year = SetDate->year;
time.mon = SetDate->mon;
time.day = SetDate->day;
time.week = SetDate->week;
time.hour = SetDate->hour;
time.min = SetDate->min;
time.sec = SetDate->sec;
//CreateWindowTimerEx(pWindow, 1);
//StartWindowTimer(pWindow); //Æô¶¯Ö÷´°Ì嶨ʱÆ÷
case WM_SHOW:
sprintf(year, "%02d", time.year);
sprintf(month, "%02d", time.mon);
sprintf(day, "%02d", time.day);
pWindow->DrawFunc(pWindow);
break;
case WM_UPDATECTRL:
pControl = (CControl*)(pGuiMsgInfo->wParam);
if(pControl != NULL)
{
pControl->DrawFunc(pControl);
}
break;
case WM_TIMEUPDATE:
PostWindowMsg(pWindow, WM_UPDATECTRL, (uint32)&gStatusBar, 0);
break;
case WM_KEYDOWN:
switch(pGuiMsgInfo->wParam)
{
case KEY_UP:
if(mDateYY.state & CTRL_FOCUS) {
time.year++;
if (time.year > YEARMAX) {
time.year = YEARMIN;
}
if((time.mon == 2)&&(time.day > 28)) {
if (time.day > 29) {
time.day = 29;
}else if(time.year % 100) {
if(time.year % 4) {
time.day=28;//·ÇÈòÄê
}
} else if(time.year % 400){
time.day=28;//·ÇÈòÄê
}
}
} else if(mDateMM.state & CTRL_FOCUS) {
time.mon++;
if (time.mon > 12) {
time.mon = 1;
}
switch(time.mon) {
case 2:
if(time.day > 28) {
if (time.day > 29) {
time.day = 29;
}else if(time.year % 100) {
if(time.year % 4) {
time.day=28;//·ÇÈòÄê
}
} else if(time.year % 400){
time.day=28;//·ÇÈòÄê
}
}
break;
case 4:
case 6:
case 9:
case 11:
if(time.day > 30) {
time.day = 30;
}
break;
default :
break;
}
} else if(mDateDD.state & CTRL_FOCUS) {
time.day++;
switch(time.mon) {
case 2:
if(time.day > 28) {
//.........这里部分代码省略.........