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

📄 editdemo.c

📁 s3c44b0上用的MINIGUI源代码
💻 C
字号:
/* ** $Id: edit.c,v 1.4 2003/07/04 08:29:13 weiym Exp $**** Listing 9.1**** edit.c: Sample program for MiniGUI Programming Guide** 	    Usage of EDIT control.**** Copyright (C) 2003 Feynman Software.**** License: GPL*/#include <stdio.h>#include <stdlib.h>#include <minigui/common.h>#include <minigui/minigui.h>#include <minigui/gdi.h>#include <minigui/window.h>#include <minigui/control.h>static DLGTEMPLATE DlgBoxInputChar ={    WS_BORDER | WS_CAPTION,     WS_EX_NONE,    0, 0, 320, 240,     "达盛editdemo",    0, 0,    6, NULL,    0};#define IDC_EDIT        120#define IDC_CHAR        100#define IDC_CHARS       110static CTRLDATA CtrlInputChar [] ={     {        CTRL_STATIC,        WS_VISIBLE | SS_CENTER,        10, 0, 300, 18,         IDC_STATIC,         "简单框",        0    },    {        CTRL_EDIT,        WS_VISIBLE | WS_TABSTOP |  SS_CENTER,        10, 20, 300, 18,         IDC_EDIT,         "",        0    },    {        CTRL_STATIC,        WS_VISIBLE | SS_CENTER,        10, 45, 300, 18,         IDC_STATIC,         "单行框",        0    },    {        CTRL_SLEDIT,        WS_VISIBLE | WS_TABSTOP | WS_BORDER,        10, 65, 300, 25,        IDC_CHAR,	"",        0    },    {        CTRL_STATIC,        WS_VISIBLE | SS_CENTER,        10, 95, 300, 18,         IDC_STATIC,         "多行框",        0    },    {        CTRL_MLEDIT,        WS_VISIBLE | WS_TABSTOP | WS_BORDER | WS_VSCROLL | ES_BASELINE | ES_AUTOWRAP,        10, 120, 300, 70,         IDC_CHARS,         "",        0    },};static int InputCharDialogBoxProc (HWND hDlg, int message, WPARAM wParam, LPARAM lParam){    static PLOGFONT my_font;    HWND hwnd;    switch (message) {    case MSG_INITDIALOG:        my_font = CreateLogFont (NULL, "Arial", "ISO8859-1",                         FONT_WEIGHT_REGULAR, FONT_SLANT_ROMAN, FONT_SETWIDTH_NORMAL,                        FONT_SPACING_CHARCELL, FONT_UNDERLINE_NONE, FONT_STRUCKOUT_NONE,                         30, 0);	hwnd = GetDlgItem (hDlg, IDC_CHAR);//        SetNotificationCallback (hwnd, my_notif_proc);	SetWindowFont (hwnd, my_font);	SendMessage (hwnd, MSG_KEYDOWN, SCANCODE_INSERT, 0L);        return 1;            case MSG_COMMAND:        switch (wParam) {        case IDOK:        case IDCANCEL:	    DestroyLogFont (my_font);            EndDialog (hDlg, wParam);            break;        }        break;    }        return DefaultDialogProc (hDlg, message, wParam, lParam);}int MiniGUIMain (int argc, const char* argv[]){        DlgBoxInputChar.controls = CtrlInputChar;    DialogBoxIndirectParam (&DlgBoxInputChar, HWND_DESKTOP, InputCharDialogBoxProc, 0L);    return 0;}#include <minigui/dti.c>

⌨️ 快捷键说明

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