📄 win_locplacereport.c
字号:
/*win_locPlaceReport.c*//*** COMPANY NAME: 国星** FILE NAME: win_locPlaceReport.c** FILE PATH: Interface/win_locPlaceReport.c** WINDOWS NAME: 位置报告** WINDOWS PATH: 定位 / 位置报告** OTHER INFORMATION; 无** CREATER NAME: LiWencheng,JiangYuanqing** MENDER NAME: JiangYuanqing,LiWencheng** CHANGE TIME: 11/14/2007 */#include "sysSrcInfo.h"static BITMAP bmp_locPlaceReport;//缓存中间状态栏图片 //flagPlaceReport=1 return单次定位,//flagPlaceReport=2 return连续定位,// flagPlaceReport=3 return紧急定位 static int flagPlaceReport ;static HWND userAddr;static HWND P_hwndedit;static HWND check;/* 位图数组 */static const char *bmp_name_locPlaceReport[] = { "./Pictures/b_windowsbackground_1.PNG", "./Pictures/b_send.PNG", "./Pictures/c_hide.PNG", "./Pictures/return.PNG" };/* 定义皮肤元素数组 *///三个button 为左中右,并不表示它就一定指OK或MENUstatic skin_item_t skin_items_locPlaceReport [] ={ {SIID_OK, SI_TYPE_CHKBUTTON | SI_TEST_SHAPE_RECT | SI_STATUS_VISIBLE, BUTTONLEFT_X, BUTTON_Y, {}, 1 ,"" }, {SIID_MENU, SI_TYPE_CHKBUTTON | SI_TEST_SHAPE_RECT | SI_STATUS_VISIBLE, BUTTONCENTER_X, BUTTON_Y, {}, 2, "" }, {SIID_RETURN, SI_TYPE_CHKBUTTON | SI_TEST_SHAPE_RECT | SI_STATUS_VISIBLE, BUTTONRIGHT_X, BUTTON_Y, {}, 3, "" }};/* 定义皮肤 */skin_head_t skin_locPlaceReport ={ "main", //const BITMAP* bmps; SKIN_STYLE_TOOLTIP, NULL, NULL, 0, 3, skin_items_locPlaceReport, FALSE /** The number of the items in this skin. */ /* 定义皮肤元素数组 */ //注意上面数组的大小变了,则8变成多少};static int main_event_cb_locPlaceReport (HWND hwnd, skin_item_t* item, int event, void* data){ if (event == SIE_BUTTON_CLICKED) { switch (item->id) { //按的那个图片 case SIID_OK://send if( newLoc.usable == TRUE) { SingleReportLoc(); newLoc.usable = FALSE; } break;//case SIID_OK: case SIID_RETURN://righ win_reportOpen = WIN_REPORTCLOSE; MainWindowCleanup (hWndMainlocPlaceReport); skin_deinit (&skin_locPlaceReport); LoadSkinBmps( &skin_locPlaceReport, FALSE ,bmp_name_locPlaceReport ,(sizeof (bmp_name_locPlaceReport))/sizeof(char *) ); MiniGUIExtCleanUp (); ShowWindow ( hWndMainlocPlaceReport, SW_HIDE); SendMessage (hWndMainlocPlaceReport, MSG_CLOSE, 0, 0); win_loclocate (hWndMain,flagPlaceReport); return 0; break; } } return 1;}static void check_notif_proc (HWND hwnd ,int id, int nc, DWORD add_data){ printf("SendMessage (check, BM_SETCHECK, -----------%d\n",SendMessage (check, BM_GETCHECK, BST_CHECKED, 0)); if(SendMessage (check, BM_GETCHECK, BST_CHECKED, 0)) { SetApplyMutiReport (1); printf("SetApplyMutiReport (1);\n"); } else { SetApplyMutiReport (0); }}static void P_hwndedit_notif_proc (HWND hwnd ,int id, int nc, DWORD add_data){ int i; char buff[3]; if(nc ==EN_CHANGE) { GetWindowText (P_hwndedit,buff,3); i = atoi(buff); SetMutiReportFreq (i); }}static int msg_event_cb_locPlaceReport (HWND hwnd, int message, WPARAM wparam, LPARAM lparam, int* result){ HDC hdc; HDC hdc1; IVITEMINFO ivii_child; gal_pixel pixel; HWND child; HWND child1; char buff[40]; switch (message) { case MSG_CREATE: win_reportOpen = WIN_REPORTOPEN; LoadBitmap (HDC_SCREEN, &bmp_locPlaceReport, "Pictures/a_location_5.PNG"); userAddr = CreateWindow( CTRL_SLEDIT, //纬度 "", WS_VISIBLE | WS_CHILD | WS_BORDER ,//|ES_READONLY ,// | ES_AUTOWRAP, 601, 70, 22,80 , 16, hwnd, 0); SetWindowText (userAddr,"1234");//GetUserID ()); W_hwndedit_loclocate = CreateWindow( CTRL_SLEDIT, //纬度 "", WS_VISIBLE | WS_CHILD | WS_BORDER ,//|ES_READONLY ,// | ES_AUTOWRAP, 602, 35, 40,120 , 18, hwnd, 0); J_hwndedit_loclocate = CreateWindow( CTRL_SLEDIT, //纬度 "", WS_VISIBLE | WS_CHILD | WS_BORDER ,//|ES_READONLY ,// | ES_AUTOWRAP, 603, 35, 58,120 , 18, hwnd, 0); locatehight_loclocate = CreateWindow( CTRL_SLEDIT, //纬度 "", WS_VISIBLE | WS_CHILD | WS_BORDER ,//|ES_READONLY ,// | ES_AUTOWRAP, 604, 35, 76,85 , 20, hwnd, 0); locateErr_loclocate = CreateWindow( CTRL_SLEDIT, //纬度 "", WS_VISIBLE | WS_CHILD | WS_BORDER ,//|ES_READONLY ,// | ES_AUTOWRAP, 449, 120, 76,35 , 20, hwnd, 0); locatetime_loclocate = CreateWindow( CTRL_SLEDIT, //纬度 "", WS_VISIBLE | WS_CHILD | WS_BORDER ,//|ES_READONLY ,// | ES_AUTOWRAP, 605, 35, 96,120 , 18, hwnd, 0); P_hwndedit = CreateWindow( CTRL_SLEDIT, //频度 "5", WS_VISIBLE | WS_CHILD | WS_BORDER ,//|ES_READONLY ,// | ES_AUTOWRAP, 606, 65,120,90 , 16, hwnd, 0); SendMessage (P_hwndedit, EM_LIMITTEXT, 3,0L); SetNotificationCallback ( P_hwndedit,P_hwndedit_notif_proc); sprintf(buff,"%d",GetMutiReportFreq ()); SetWindowText (P_hwndedit,buff); check = CreateWindow( "button", // "启用连续位置报告", WS_VISIBLE | BS_AUTOCHECKBOX ,//|ES_READONLY ,// | ES_AUTOWRAP, 606, 3,142,140 , 20, hwnd, 0); SetNotificationCallback ( check,check_notif_proc); SetWindowBkColor (check, pixel); if(GetApplyMutiReport () == 1) { SendMessage (check, BM_SETCHECK, BST_CHECKED, 0); } printf("----------newLoc.usable == %d--------\n",newLoc.usable); if( newLoc.usable == TRUE) { printf("Firstly create window, Flush the window!\n"); ShowByDaDi (J_hwndedit_loclocate ,W_hwndedit_loclocate, newLoc.dwxx.longitude , newLoc.dwxx.latitude) ;//显示"经度""纬度" ShowHighByDaDiGao (locatehight_loclocate,locateErr_loclocate , newLoc.dwxx.height, newLoc.dwxx.abnormalHeigtht, newLoc.dwxx.normalSign, newLoc.dwxx.abnormalSign);//显示"高程"""高程误差" sprintf(buff ,"%4d-%2d-%2d %2d:%2d:%2d", newLoc.dwxx.year, newLoc.dwxx.mon, newLoc.dwxx.day, newLoc.dwxx.hour, newLoc.dwxx.minute, newLoc.dwxx.second); SetWindowText (locatetime_loclocate, buff);//显示时间 } break; case MSG_PAINT : hdc=BeginPaint (hwnd); SetBkMode (hdc, BM_TRANSPARENT); FillBoxWithBitmap (hdc, ZTL_PIC_X,ZTL_PIC_Y, ZTL_PIC_W,ZTL_PIC_H, &bmp_locPlaceReport); TextOut (hdc, WZ_ZTL_X4, WZ_ZTL_Y, "位置报告" ); TextOut (hdc,3, 20, "用户地址"); TextOut (hdc,3, 40, "纬度"); TextOut (hdc,3, 60, "经度"); TextOut (hdc,3, 80, "高程"); TextOut (hdc,3, 100, "时间"); TextOut (hdc,3, 120, "频度(秒)"); EndPaint (hwnd,hdc); break; } return 1;}void win_locPlaceReport(HWND hwndmain ,int flag){ MSG msg; flagPlaceReport = flag; LoadSkinBmps( &skin_locPlaceReport, TRUE ,bmp_name_locPlaceReport ,(sizeof (bmp_name_locPlaceReport))/sizeof(char *) ); if (skin_locPlaceReport.bmps == NULL) { //printf ("Could not load skin bitmaps!\n"); } if ( !skin_init (&skin_locPlaceReport, main_event_cb_locPlaceReport, msg_event_cb_locPlaceReport) ){ /* 初始化皮肤 */ int i=9; //printf ("skin init fail!%d\n\n",i); } else{ hWndMainlocPlaceReport = create_skin_control (&skin_locPlaceReport, hwndmain,143, DEF_X_, DEF_Y_, DEF_WIDTH, DEF_HEIGHT); currShowWindowHwnd = hWndMainlocPlaceReport; }}#ifndef _LITE_VERSION#include <minigui/dti.c>#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -