China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-26 00:08
中国DOS联盟论坛 » DOS开发编程 & 发展交流 (开发室) » 100KB DOS Graphics Interface Development (Borland/DJGPP Library) DigestI View 41,845 Replies 111
Floor 91 Posted 2008-10-25 20:03 ·  中国 辽宁 大连 联通
中级用户
★★
www.ecgui.com
Credits 272
Posts 123
Joined 2006-09-23 07:38
19-year member
UID 63446
Status Offline
eCGUI Download Center: http://www.ecgui.com/html/ecgui/35.html

[ Last edited by ecurb2006 on 2008-10-20 at 23:32 ]
eCGUI-微型嵌入式GUI/ DOS/Linux/uC/OS-II/等 图形界面开发
www.ecgui.com
Floor 92 Posted 2008-10-25 23:31 ·  中国 辽宁 大连 联通
中级用户
★★
www.ecgui.com
Credits 272
Posts 123
Joined 2006-09-23 07:38
19-year member
UID 63446
Status Offline
```
/*
Jpeg - JPG image display and desktop background change
Website:www.ecgui.com
E-mail:ecgui.com@ecgui.com
*/
#include "gui.h" /* GUI header file */

void MyJPG(HAND hd,MESSAGE msg)
{
if(msg.type == GM_SYSTEM) /* Determine message type, all message types are in uppercase */
switch(msg.message) /* Determine message */
{
case GM_Draw:
{
HDC hdc;
IMAGE img;/* Image structure */
hdc=efGDI->Start(msg.pHOST);/* Get HDC drawing handle, start drawing */
img.filename="logo.jpg"; /* Image file name */
img.type=IMAGE_TYPE_JPG;/* File type */
img.hdc=hdc;/* Drawing handle */
efImage->Load(&img);/* Preliminary read image information */
efImage->Show(&img,0,0);/* Display image */
efGDI->End(msg.pHOST,hdc); /* Release HDC drawing handle */
}
return;
default:break;
}

}

void imgjpg_init(void); /* Function declaration: register JPEG image function support */
HDC StartDesktopDraw(void); /* Function declaration: get desktop HDC drawing handle, start drawing */
void EndDesktopDraw(HDC); /* Function declaration: release desktop HDC drawing handle */

int gmain(void *data) /* Entry function of GUI program */
{

imgjpg_init();/* *Register JPEG image function support*/
{
HDC hdc;/* HDC drawing handle */
IMAGE img; /* Image structure */
hdc=StartDesktopDraw();/* Get desktop HDC drawing handle, start drawing */
img.filename="alizee.jpg"; /* Image file name */
img.type=IMAGE_TYPE_JPG; /* File type */
img.hdc=hdc; /* Drawing handle */
efImage->Load(&img); /* Preliminary read image information */
efImage->Show(&img,0,0); /* Display image */
EndDesktopDraw(hdc); /* Release desktop HDC drawing handle */
}
/* Create a main window */
CreatObject(0,MAINWINDOW,1,1,"JEPG Picture - Power by eCGUI-www.ecgui.com",5,10,510,570,MyJPG,data);
return True;
}
/* ************** End of file **************** */

;Compile
bcc -mh jpeg.c lib\gui.lib lib\libjpeg.lib
;It is best to compress it with upx.exe again, there is upx.exe in the _up directory of the development package
_up\upx -5 jpeg.exe

Running result

```
eCGUI-微型嵌入式GUI/ DOS/Linux/uC/OS-II/等 图形界面开发
www.ecgui.com
Floor 93 Posted 2008-10-27 09:14 ·  中国 辽宁 大连 联通
中级用户
★★
www.ecgui.com
Credits 272
Posts 123
Joined 2006-09-23 07:38
19-year member
UID 63446
Status Offline
Unicode German display support! German has 3 more special letters than English Latin letters. Ää Üü Öö



http://www.ecgui.com/bbs/thread-12-1-1.html

[ Last edited by ecurb2006 on 2008-10-27 at 09:20 ]
eCGUI-微型嵌入式GUI/ DOS/Linux/uC/OS-II/等 图形界面开发
www.ecgui.com
Floor 94 Posted 2008-11-09 11:26 ·  中国 辽宁 大连 联通
中级用户
★★
www.ecgui.com
Credits 272
Posts 123
Joined 2006-09-23 07:38
19-year member
UID 63446
Status Offline
0.4 Beta - Nested call of dialog windows, support for multi - window switching

Because these API interfaces may still need some improvements.
Friends who are interested in participating in the test can send an email to ecgui.com@gmail.com. Can send it to you first.
eCGUI-微型嵌入式GUI/ DOS/Linux/uC/OS-II/等 图形界面开发
www.ecgui.com
Floor 95 Posted 2008-11-11 13:37 ·  中国 上海 电信
新手上路
Credits 16
Posts 8
Joined 2008-09-06 13:44
17-year member
UID 124948
Gender Male
Status Offline
I can't open the eCGUI website. Could it have already passed away....
Floor 96 Posted 2008-11-11 15:46 ·  中国 辽宁 大连 联通
中级用户
★★
www.ecgui.com
Credits 272
Posts 123
Joined 2006-09-23 07:38
19-year member
UID 63446
Status Offline
Please download from http://ecurb2006.download.csdn.net/

Fix the website issues as soon as possible.
eCGUI-微型嵌入式GUI/ DOS/Linux/uC/OS-II/等 图形界面开发
www.ecgui.com
Floor 97 Posted 2008-11-30 10:59 ·  中国 辽宁 大连 联通
中级用户
★★
www.ecgui.com
Credits 272
Posts 123
Joined 2006-09-23 07:38
19-year member
UID 63446
Status Offline
eCGUI 0.3 for DOS-32bit
http://www.ecgui.com/download/ecgui4dos32.zip
Version features: Compiled with DJGPP.

========================================================
Development tools ---------- Extraction password is ecgui.com
DOS 16-bit: Borland C/C++ 3.1 streamlined version
Link: http://www.ecgui.com/download/tools/bc31.zip

DOS 32-bit: DJGPP (including Allegro graphics library)
Link: http://www.ecgui.com/download/tools/djgpp.zip
eCGUI-微型嵌入式GUI/ DOS/Linux/uC/OS-II/等 图形界面开发
www.ecgui.com
Floor 98 Posted 2008-12-01 07:17 ·  中国 辽宁 大连 联通
中级用户
★★
www.ecgui.com
Credits 272
Posts 123
Joined 2006-09-23 07:38
19-year member
UID 63446
Status Offline

Flat-style multi-window support (beta version)
eCGUI-微型嵌入式GUI/ DOS/Linux/uC/OS-II/等 图形界面开发
www.ecgui.com
Floor 99 Posted 2008-12-22 15:49 ·  中国 辽宁 大连 联通
中级用户
★★
www.ecgui.com
Credits 272
Posts 123
Joined 2006-09-23 07:38
19-year member
UID 63446
Status Offline
CGUI micro embedded GUI - QQ Group 76249907
eCGUI-微型嵌入式GUI/ DOS/Linux/uC/OS-II/等 图形界面开发
www.ecgui.com
Floor 100 Posted 2008-12-24 08:20 ·  中国 辽宁 大连 联通
中级用户
★★
www.ecgui.com
Credits 272
Posts 123
Joined 2006-09-23 07:38
19-year member
UID 63446
Status Offline


The goal of eCFileMan is to become a graphical file manager based on eCGUI. It can run under DOS, facilitating file management operations under DOS.
It is currently in the testing and development phase. The code is provided here. Currently, only the file list display has been implemented.
The code is divided into two files: ecfm.c and list.c

/* ------------- ecfm.c - start */
/*
Copyright (C) 2008 ecGUI Developers
All rights reserved.
Website: www.ecgui.com
Info: ecgui.com@gmail.com
-- list.c ---
*/
#include "gui.h"
#include "list.c"


#define ITEM_NUM 6 /* Number of items */

typedef struct _eCFMData
{
HAND urlbox;
}eCFMData,*PeCFMData;



eCFileMan Gecfm_buf;
PeCFileMan Gecfm=&Gecfm_buf;
char buf;
void eCFMWin(HAND hd,MESSAGE msg)
{
HAND box,button;/* Handles */
PMENU pm;
int i;
if(msg.type==GM_SYSTEM)
switch(msg.message)
{
case GM_Create:
CreateObject(hd,TEXTBOX,1,1,"",5,40,315,60,0,0);
box=CreateObject(hd,SELBOX,1,1,"",5,65,315,400,0,0); /* Create a selection box object */
#if 0
pm=(PMENU)malloc(sizeof(MENU)*ITEM_NUM*2);
for(i=0;i<12;i++)
{
pm->szTitle="a";
efSelBox->Add(box,pm); /* Add sub-item */
pm++;
}
#endif
{
PLIST pl=NULL;
PFileList pfl;
scandir(Gecfm,"");
for(pl=Gecfm->pDirListHead;pl!=NULL;pl=pl->pNEXT)
{
pfl=(PFileList)pl->pData;
if(pfl->type==FT_DIR)
//printf("<%s>\n",pfl->name);
//sprintf(pfl->name,"<%s>",pfl->name);
{
sprintf(buf,"<%s>",pfl->name);
strcpy(pfl->name,buf);
pfl->item.szTitle=pfl->name;
efSelBox->Add(box,&(pfl->item));
}
}

pl=Gecfm->pFileListHead;
pl=pl->pNEXT->pNEXT;
for(;pl!=NULL;pl=pl->pNEXT)
{
pfl=(PFileList)pl->pData;
if(pfl->type==FT_FILE)
{
//sprintf(buf,"<%s>",pfl->name);
//strcpy(pfl->name,buf);
pfl->item.szTitle=pfl->name;
efSelBox->Add(box,&(pfl->item));
}
}
for(pl=Gecfm->pDirListHead;pl!=NULL;pl=pl->pNEXT)
{
pfl=(PFileList)pl->pData;
if(pfl->type==FT_FILE)
{
//sprintf(buf,"<%s>",pfl->name);
//strcpy(pfl->name,buf);
pfl->item.szTitle=pfl->name;
efSelBox->Add(box,&(pfl->item));
}
}

}
break;
case GM_Draw:
break;
default:
break;
}
}
int gmain(void *data) /* Entry function of the GUI program */
{
/* Create a main window */
CreatObject(0,MAINWINDOW,1,1,"eCFileMan 0.1 Beta(081213)",0,0,640,480,eCFMWin,data);
return True;
}
eCGUI-微型嵌入式GUI/ DOS/Linux/uC/OS-II/等 图形界面开发
www.ecgui.com
Floor 101 Posted 2008-12-24 08:21 ·  中国 辽宁 大连 联通
中级用户
★★
www.ecgui.com
Credits 272
Posts 123
Joined 2006-09-23 07:38
19-year member
UID 63446
Status Offline

/* ********** list.c -start ***********/
/*
Copyright (C) 2008 ecGUI Developers
All rights reserved.
Website: www.ecgui.com
Info: ecgui.com@gmail.com
-- list.c ---
*/
#include <stdio.h>
#include <dir.h>
#include <dirent.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define FT_FILE 0
#define FT_DIR 1


typedef struct _LIST{
void *pData;
struct _LIST *pPRE;
struct _LIST *pNEXT;
}LIST,*PLIST;

PLIST addList(PLIST p,void *pData)
{
PLIST plnew=NULL,pl;
plnew=(PLIST)malloc(sizeof(LIST));
if(plnew==NULL) return NULL;
if(p==NULL)
{
plnew->pPRE=NULL;
plnew->pNEXT=NULL;
plnew->pData=pData;
return (plnew);
}
pl=p;
while(pl->pNEXT!=NULL) pl=pl->pNEXT;
plnew->pPRE=pl;
plnew->pNEXT=NULL;
plnew->pData=pData;
pl->pNEXT=plnew;
return(plnew);
}

PLIST insertList(PLIST pl,void *pData)
{
PLIST pn=NULL;

pn=(PLIST)malloc(sizeof(LIST));
if(pn==NULL) return NULL;
pn->pData=pData;
pn->pPRE=pl;
pn->pNEXT=NULL;
if(pl)
{
pn->pNEXT=pl->pNEXT;
pl->pNEXT=pn;

if(pl->pNEXT)
{
pl->pNEXT->pPRE=pn;
}
}
return pn;
}

PLIST delList(PLIST pl)
{
PLIST next=NULL;
if(pl == NULL) return 0;
next=pl->pNEXT;
if(pl->pNEXT)
(pl->pNEXT)->pPRE=pl->pPRE;
if(pl->pPRE)
(pl->pPRE)->pNEXT=pl->pNEXT;
free(pl);
pl=NULL;
return next;
}

typedef struct _FileList
{
int struct_size;
int type; /* 0 : File 1:Dir */
char name;
int size;

MENU item;
}FileList,*PFileList;


typedef struct _eCFileMan
{
PLIST pFileListHead;
PLIST pFileListTail;
PLIST pDirListHead;
PLIST pDirListTail;
}eCFileMan,*PeCFileMan;




void AddFile(PeCFileMan ecfm,int type,char *name,int size)
{
PFileList nf;
if(!ecfm) return;
nf=malloc(sizeof(FileList));
memset(nf,0,sizeof(FileList));
nf->struct_size=sizeof(FileList);
nf->type=type;
strcpy(nf->name,name);
nf->size=size;
if(type==FT_FILE)
{
if(!ecfm->pFileListHead)
ecfm->pFileListTail=ecfm->pFileListHead=insertList(NULL,nf);
else ecfm->pFileListTail=insertList(ecfm->pFileListTail,nf);
}
else if(type == FT_DIR)
{
if(!ecfm->pDirListHead)
ecfm->pDirListTail=ecfm->pDirListHead=insertList(NULL,nf);
else ecfm->pDirListTail=insertList(ecfm->pDirListTail,nf);
}
}

int scandir(PeCFileMan ecfm,char *dirname)
{
DIR *dir;
struct dirent *ent;
int type;
struct ffblk ffblk;
int done;
PLIST pl=NULL;
PFileList pfl;
//printf("First pass on '%s':\n",dirname);
if ((dir = opendir(dirname)) == NULL)
{
//perror("Unable to open directory");
//exit(1);
return 0;
}
AddFile(ecfm,FT_DIR,"..",0);
while ((ent = readdir(dir)) != NULL)
{
//printf("%s\n",ent->d_name);
#if 1
if(strstr(ent->d_name,"."))
type=FT_FILE;
else {type=FT_DIR; /* printf("\n-dir-\n"); */}

AddFile(ecfm,type,ent->d_name,0);
#endif
}

/*
printf("Second pass on '%s':\n",dirname);

rewinddir(dir);
while ((ent = readdir(dir)) != NULL)
printf("%s ",ent->d_name);
*/
if (closedir(dir) != 0);
// perror("Unable to close directory");



done = findfirst("*.",&ffblk,0);
while (!done)
{
//printf("%s\n", ffblk.ff_name);
for(pl=ecfm->pDirListHead;pl!=NULL;pl=pl->pNEXT)
{

pfl=(PFileList)pl->pData;

//printf("%s = %s \n",pfl->name,ffblk.ff_name);

if(strcmp(pfl->name,ffblk.ff_name)==0)
pfl->type=FT_FILE;
//else printf("%s\n",pfl->name);

}
done = findnext(&ffblk);
}
return 1;
}
eCGUI-微型嵌入式GUI/ DOS/Linux/uC/OS-II/等 图形界面开发
www.ecgui.com
Floor 102 Posted 2009-02-21 11:30 ·  中国 河北 邯郸 联通
新手上路
Credits 6
Posts 3
Joined 2008-12-15 19:34
17-year member
UID 133977
Gender Male
Status Offline
This is quite good.
Floor 103 Posted 2009-02-24 19:20 ·  中国 广东 潮州 电信
新手上路
Credits 8
Posts 4
Joined 2008-10-30 22:57
17-year member
UID 129614
Gender Male
Status Offline
I want one. Can you send it to my email: zyl20028246@163.com Thanks.
Floor 104 Posted 2009-02-25 21:19 ·  中国 辽宁 大连 联通
中级用户
★★
www.ecgui.com
Credits 272
Posts 123
Joined 2006-09-23 07:38
19-year member
UID 63446
Status Offline
All can be downloaded from the website www.ecgui.com
eCGUI-微型嵌入式GUI/ DOS/Linux/uC/OS-II/等 图形界面开发
www.ecgui.com
Floor 105 Posted 2009-04-04 10:43 ·  中国 辽宁 大连 联通
中级用户
★★
www.ecgui.com
Credits 272
Posts 123
Joined 2006-09-23 07:38
19-year member
UID 63446
Status Offline

The control fully supports the skin function
eCGUI-微型嵌入式GUI/ DOS/Linux/uC/OS-II/等 图形界面开发
www.ecgui.com
Forum Jump: