📄 win_infoquery.c
字号:
/*win_infoQuery.c//////*//*** COMPANY NAME: 国星** FILE NAME: win_infoQuery.c** FILE PATH: Interface/win_infoQuery.c** WINDOWS NAME: 通信 ** WINDOWS PATH: 通信 / 通信查询** OTHER INFORMATION; 无** CREATER NAME: LiWencheng,JiangYuanqing** MENDER NAME: LiWencheng,JiangYuanqing** CHANGE TIME: 11/14/2007 */#include "sysSrcInfo.h" static int QueryTypeFlag=0;static BITMAP bmp_InfoQuery; static HWND hWndMainInfoQuery ,hWndCombox ,hwndedit_Query; static HWND staticInput, staticUserId, staticQueryAddr; static const char *KB_pictureFiles[] = { "./Pictures/b_windowsbackground_1.PNG", "./Pictures/OK.PNG", "./Pictures/c_hide.PNG", "./Pictures/return.PNG" };static const char *labels_infoQuery[] = { "按最新存入", "按发信方地址", "回执查询", };static skin_item_t skin_items_InfoQuery [] ={ {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, "" }};static skin_head_t skin_head_InfoQuery ={ "skin_head_InfoQuery", SKIN_STYLE_TOOLTIP, NULL, NULL, 0, 3, skin_items_InfoQuery, FALSE};static void CloseTheWindow_InfoQuery(){ ShowWindow ( hWndMainInfoQuery, SW_HIDE); LoadSkinBmps( &skin_head_InfoQuery, FALSE ,KB_pictureFiles ,(sizeof (KB_pictureFiles))/sizeof(char *) ); UnloadBitmap( &bmp_InfoQuery );}static int main_event_cb_InfoQuery (HWND hwnd, skin_item_t* item, int event, void* data){ int length; char buff[8]; if (event == SIE_BUTTON_CLICKED) { switch (item->id) { case SIID_OK: currSelectResult = SendMessage (hWndCombox, CB_GETCURSEL, 0, 0 ); switch(currSelectResult) { case BY_NEWINPUT: LoadData(INBOX, TYPE_OF_TXXX,GetCount( INBOX, TYPE_OF_TXXX) ); loadedMesg.pCommInfo=(COMMINFO **)Filtrate(TYPE_OF_TXXX, loadedMesg.countOfMesg, BY_NEWEST3,queFilter, (void **)loadedMesg.pCommInfo ); win_queryResult(hWndMain ); CloseTheWindow_InfoQuery(); break; case BY_SENDID: length = GetWindowTextLength(hwndedit_Query); if( length != 0 ) { GetWindowText (hwndedit_Query,buff,length); queFilter.srcID = atol( buff ); LoadData(INBOX, TYPE_OF_TXXX, GetCount( INBOX, TYPE_OF_TXXX) ); loadedMesg.pCommInfo=(COMMINFO **)Filtrate(TYPE_OF_TXXX, loadedMesg.countOfMesg, BY_LOCADDRSS,queFilter, (void **)loadedMesg.pCommInfo ); win_queryResult(hWndMain ); CloseTheWindow_InfoQuery(); } break; case BY_FEEDBACK: length = GetWindowTextLength(hwndedit_Query); if( length != 0 ) { GetWindowText (hwndedit_Query,buff,length); queFilter.srcID = atol( buff ); //loadedMesg.fkInfo printf("FKXX ________srcID %ld\n",queFilter.srcID ); Filtrate(TYPE_OF_TXXX,GetCount(INBOX, TYPE_OF_FKXX), BY_AUTOFBACK, queFilter, NULL ); win_queryResult(hWndMain ); CloseTheWindow_InfoQuery(); } break; } break; case SIID_RETURN: win_information(hWndMain); CloseTheWindow_InfoQuery(); break; } } return 1;}static void my_notif_proc(HWND hwnd, int id, int nc, DWORD add_data){ currSelectResult = SendMessage (hWndCombox, CB_GETCURSEL, 0, 0 ); if(nc==CBN_SELCHANGE) { switch(currSelectResult) { case BY_NEWINPUT: ShowWindow ( hwndedit_Query, SW_HIDE); ShowWindow ( staticInput, SW_HIDE); ShowWindow ( staticUserId, SW_HIDE); ShowWindow ( staticQueryAddr, SW_HIDE); break; case BY_SENDID: ShowWindow ( hwndedit_Query, SW_SHOW); SetFocusChild(hwndedit_Query); ShowWindow ( staticInput, SW_SHOW); ShowWindow ( staticUserId, SW_SHOW); ShowWindow ( staticQueryAddr, SW_HIDE); break; case BY_FEEDBACK: ShowWindow ( hwndedit_Query, SW_SHOW); SetFocusChild(hwndedit_Query); ShowWindow ( staticInput, SW_HIDE); ShowWindow ( staticUserId, SW_HIDE); ShowWindow ( staticQueryAddr, SW_SHOW); break; } } }static int msg_event_cb_InfoQuery (HWND hwnd, int message, WPARAM wparam, LPARAM lparam, int* result){ int i; HDC hdc; gal_pixel pixel; switch (message) { case MSG_CREATE: LoadBitmap (HDC_SCREEN, &bmp_InfoQuery, "Pictures/a_information_5.PNG"); hWndCombox = CreateWindow (CTRL_COMBOBOX, "", WS_CHILD | WS_VISIBLE |CBS_EDITNOBORDER|CBS_NOTIFY| CBS_READONLY|CBS_SPINARROW_LEFTRIGHT|CBS_SPINLIST, //CBS_AUTOSPIN|CBS_AUTOLOOP| 2343, 70, 20, 90, 20, hwnd, 0); SetNotificationCallback (hWndCombox, my_notif_proc); gal_pixel pixel = RGB2Pixel (HDC_SCREEN, 0xFF, 0xFF, 0xFF); SetWindowBkColor (hWndCombox, pixel); for (i=0;i<3;i++) { SendMessage (hWndCombox, CB_ADDSTRING, 0, (LPARAM)labels_infoQuery[i]); } SendMessage (hWndCombox, CB_SETCURSEL, 0, 0 ); hwndedit_Query = CreateWindow( CTRL_SLEDIT, "", WS_VISIBLE | WS_CHILD | WS_BORDER , 343,RJ_X, 90,150 , 20, hwnd, 0); pixel = RGB2Pixel (HDC_SCREEN, 0xFF, 0xFF, 0xFF); staticInput= CreateWindow ("static", "请输入查询条件 ",WS_VISIBLE | SS_SIMPLE, 7854,RJ_X, 60, 130, 15, hwnd, 0); SetWindowBkColor (staticInput, pixel); staticUserId= CreateWindow ("static", "用户地址",WS_VISIBLE | SS_SIMPLE, 7854,RJ_X, 75, 70, 15, hwnd, 0); SetWindowBkColor (staticUserId, pixel); staticQueryAddr= CreateWindow ("static", "查询地址",WS_VISIBLE | SS_SIMPLE, 7854,RJ_X, 75, 70, 15, hwnd, 0); SetWindowBkColor (staticQueryAddr, pixel); ShowWindow ( hwndedit_Query, SW_HIDE); ShowWindow ( staticInput, SW_HIDE); ShowWindow ( staticUserId, SW_HIDE); ShowWindow ( staticQueryAddr, SW_HIDE); 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_InfoQuery); TextOut (hdc, WZ_ZTL_X4, WZ_ZTL_Y, "通信查询" ); TextOut (hdc, RJ_X, 23, "查询条件"); EndPaint (hwnd,hdc); break; } return 1;}int win_InfoQuery(HWND hwndmain ){ LoadSkinBmps( &skin_head_InfoQuery, TRUE ,KB_pictureFiles ,(sizeof (KB_pictureFiles))/sizeof(char *) ); if (skin_head_InfoQuery.bmps == NULL) { printf ("Could not load skin bitmaps!\n"); } if ( !skin_init (&skin_head_InfoQuery, main_event_cb_InfoQuery, msg_event_cb_InfoQuery) ){ printf ("skin init fail!\n\n"); } else{ hWndMainInfoQuery= create_skin_control (&skin_head_InfoQuery, hwndmain,143, DEF_X_, DEF_Y_,DEF_WIDTH, DEF_HEIGHT); currShowWindowHwnd = hWndMainInfoQuery; } return 1;}#ifndef _LITE_VERSION#include <minigui/dti.c>#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -