⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 call.c

📁 基于minigui的手机界面程序开发 实现简单的计数器功能
💻 C
字号:
/* 
** $Id: dialogbox.c,v 1.3 2003/06/13 06:50:39 weiym Exp $
**
** Listing 4.1
**
** dialogbox.c: Sample program for MiniGUI Programming Guide
** 	Usage of DialogBoxIndirectParam
**
** Copyright (C) 2003 Feynman Software.
**
** License: GPL
*/

#include <stdio.h>
#include <string.h>
#include <minigui/common.h>
#include <minigui/minigui.h>
#include <minigui/gdi.h>
#include <minigui/window.h>
#include <minigui/control.h>

static DLGTEMPLATE DlgInitProgress4 =
{
    WS_BORDER | WS_CAPTION, 
    WS_EX_NONE,
    60, 60, 320, 240, 
    "通讯",
    0, 0,
    17, NULL,
    0
};

#define IDC_PROMPTINFO	100
#define IDC_PROGRESS  	110
#define BTN_ADD 120
#define BTN_NUM 121

#define BTN_DEL 130
#define BTN_SER 140
#define BTN_NAME 150
#define IDC_T 151
#define BTN_OK 160
#define BTN_C 161
static BITMAP bmp;
#define ID_1 201
#define ID_2 202
#define ID_3 203
#define ID_4 204
#define ID_5 205
#define ID_6 206
#define ID_7 207
#define ID_8 208
#define ID_9 209
#define ID_0 210
#define ID_11 211
#define ID_12 212
char buff[100];
char buff2[100];
#define BTN_S 199

static CTRLDATA CtrlInitProgress4 [] =
{ 
   /* {
        "static",
        WS_VISIBLE | SS_SIMPLE,
        10, 10, 380, 16, 
        IDC_PROMPTINFO, 
        "通讯---打电话",
    },*/
        

        {
CTRL_EDIT,
WS_VISIBLE,
100,0,120,25,
IDC_T,
0,
0
},
    
   



    {
        "button",
        WS_TABSTOP | WS_VISIBLE | BS_DEFPUSHBUTTON, 
        55,35, 60, 30,
        ID_1, 
        "1",
        0
    },  {
        "button",
        WS_TABSTOP | WS_VISIBLE | BS_DEFPUSHBUTTON, 
        125, 35, 60, 30,
        ID_2, 
        "2",
        0
    },  {
        "button",
        WS_TABSTOP | WS_VISIBLE | BS_DEFPUSHBUTTON, 
        195, 35, 60, 30,
        ID_3, 
        "3",
        0
    },  {
        "button",
        WS_TABSTOP | WS_VISIBLE | BS_DEFPUSHBUTTON, 
        55, 75, 60, 30,
        ID_4, 
        "4",
        0
    },
      {
        "button",
        WS_TABSTOP | WS_VISIBLE | BS_DEFPUSHBUTTON, 
        125, 75, 60, 30,
        ID_5, 
        "5",
        0
    },
      {
        "button",
        WS_TABSTOP | WS_VISIBLE | BS_DEFPUSHBUTTON, 
        195, 75, 60, 30,
        ID_6, 
        "6",
        0
    },
      {
        "button",
        WS_TABSTOP | WS_VISIBLE | BS_DEFPUSHBUTTON, 
        55, 115, 60, 30,
        ID_7, 
        "7",
        0
    },

      {
        "button",
        WS_TABSTOP | WS_VISIBLE | BS_DEFPUSHBUTTON, 
        125, 115, 60, 30,
        ID_8, 
        "8",
        0
    },
      {
        "button",
        WS_TABSTOP | WS_VISIBLE | BS_DEFPUSHBUTTON, 
        195, 115, 60, 30,
       ID_9, 
        "9",
        0
    },
       {
        "button",
        WS_TABSTOP | WS_VISIBLE | BS_DEFPUSHBUTTON, 
        125, 155, 60, 30,
        ID_0, 
        "0",
        0
    },
      {
        "button",
        WS_TABSTOP | WS_VISIBLE | BS_DEFPUSHBUTTON, 
        55, 155, 60, 30,
       ID_11, 
        "*",
        0
    },
      {
        "button",
        WS_TABSTOP | WS_VISIBLE | BS_DEFPUSHBUTTON, 
        195, 155, 60, 30,
       ID_12, 
        "#",
        0
    },

    
    {
        "button",
        WS_TABSTOP | WS_VISIBLE | BS_DEFPUSHBUTTON, 
        0, 190, 60, 30,
        BTN_C, 
        "拨打",
        0
    },
		{
        "button",
        WS_TABSTOP | WS_VISIBLE | BS_DEFPUSHBUTTON, 
        260, 190, 60, 30,
        IDCANCEL, 
        "返回",
        0
    },
			{
        "button",
        WS_TABSTOP | WS_VISIBLE | BS_DEFPUSHBUTTON, 
        130, 190, 60, 30,
        BTN_S, 
        "C",
        0
    }
};

static int InitDialogBoxProc4 (HWND hDlg, int message, WPARAM wParam, LPARAM lParam)
{
    HDC hdc;
	int i;
    switch (message) {
    case MSG_INITDIALOG:
        return 1;
case MSG_ERASEBKGND:
	hdc = GetClientDC(hDlg);
	LoadBitmap (HDC_SCREEN, &bmp, "bk2.jpg");
	FillBoxWithBitmap(hdc,0,0,320,240,&bmp);
	Rectangle(hdc,0,0,320,240);
	ReleaseDC(hdc);
	return 0;
    	
        
    case MSG_COMMAND:
        switch (wParam) 
			{
	case IDOK:
		
		case BTN_C:
		GetWindowText(GetDlgItem(hDlg,IDC_T),buff2,30);	
	       gprs_call(buff2, strlen(buff2));
		break;
		
		case ID_1:
			strcat(buff2,"1");
			SetWindowText(GetDlgItem(hDlg,IDC_T),buff2);break;
			case ID_2:
				strcat(buff2,"2");
				SetWindowText(GetDlgItem(hDlg,IDC_T),buff2);break;
				case ID_3:
					strcat(buff2,"3");
				SetWindowText(GetDlgItem(hDlg,IDC_T),buff2);break;
				case ID_4:
					strcat(buff2,"4");
				SetWindowText(GetDlgItem(hDlg,IDC_T),buff2);break;
				case ID_5:
					strcat(buff2,"5");
				SetWindowText(GetDlgItem(hDlg,IDC_T),buff2);break;
				case ID_6:
					strcat(buff2,"6");
				SetWindowText(GetDlgItem(hDlg,IDC_T),buff2);break;
				case ID_7:
					strcat(buff2,"7");
				SetWindowText(GetDlgItem(hDlg,IDC_T),buff2);break;
				case ID_8:
					strcat(buff2,"8");
				SetWindowText(GetDlgItem(hDlg,IDC_T),buff2);break;
				case ID_9:
					strcat(buff2,"9");
				SetWindowText(GetDlgItem(hDlg,IDC_T),buff2);break;
				case ID_0:
					strcat(buff2,"0");
				SetWindowText(GetDlgItem(hDlg,IDC_T),buff2);break;
				case ID_11:
					strcat(buff2,"*");
				SetWindowText(GetDlgItem(hDlg,IDC_T),buff2);break;
				case ID_12:
					strcat(buff2,"#");
				SetWindowText(GetDlgItem(hDlg,IDC_T),buff2);break;
				case BTN_S:

					
					i = strlen(buff2);
					buff2[i-1]='\0';
					//strncpy(buff3,buff2,(strlen(buff2)-1));
					//strcpy(buff2,buff3);
					SetWindowText(GetDlgItem(hDlg,IDC_T),buff2);break;
					
        case IDCANCEL:
            EndDialog (hDlg, wParam);
            break;
                      }
       break; 
       } 
    
    
    return DefaultDialogProc (hDlg, message, wParam, lParam);
}

 void InitDialogBox4 (HWND hWnd)
{
    DlgInitProgress4.controls = CtrlInitProgress4;
    
    DialogBoxIndirectParam (&DlgInitProgress4, hWnd, InitDialogBoxProc4, 0L);
}

/*int MiniGUIMain (int argc, const char* argv[])
{
#ifdef _LITE_VERSION
    SetDesktopRect(0, 0, 1024, 768);
#endif
    
    InitDialogBox2 (HWND_DESKTOP);

    return 0;
}*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -