<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>阿债的山寨实验室 &#187; gui</title>
	<atom:link href="http://blog.declab.com/tag/gui/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.declab.com</link>
	<description></description>
	<lastBuildDate>Thu, 27 May 2010 03:45:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>D语言的第一个图形界面程序</title>
		<link>http://blog.declab.com/web/2008/d%e8%af%ad%e8%a8%80%e7%9a%84%e7%ac%ac%e4%b8%80%e4%b8%aa%e5%9b%be%e5%bd%a2%e7%95%8c%e9%9d%a2%e7%a8%8b%e5%ba%8f/</link>
		<comments>http://blog.declab.com/web/2008/d%e8%af%ad%e8%a8%80%e7%9a%84%e7%ac%ac%e4%b8%80%e4%b8%aa%e5%9b%be%e5%bd%a2%e7%95%8c%e9%9d%a2%e7%a8%8b%e5%ba%8f/#comments</comments>
		<pubDate>Mon, 31 Mar 2008 18:31:37 +0000</pubDate>
		<dc:creator>阿债</dc:creator>
				<category><![CDATA[WEB开发]]></category>
		<category><![CDATA[d语言]]></category>
		<category><![CDATA[gui]]></category>

		<guid isPermaLink="false">http://rblog.declab.com/2008/1/d%e8%af%ad%e8%a8%80%e7%9a%84%e7%ac%ac%e4%b8%80%e4%b8%aa%e5%9b%be%e5%bd%a2%e7%95%8c%e9%9d%a2%e7%a8%8b%e5%ba%8f/</guid>
		<description><![CDATA[元旦放假，赋闲在家，学了一下D语言，完成了第一个GUI程序。 需要的东东，D语言的编译器DMD和DMC，还有GUI开发包DFL，还有一个IDE： dmd.zip http://ftp.digitalmars.com/dmd.zip dmc.zip http://ftp.digitalmars.com/dmc.zip dfl09601.exe http://www.dprogramming.com/dfl09601.exe entice084.exe http://www.dprogramming.com/entice084.exe 安装，先在D盘创建一个目录ddev： 将dmd.zip、dmc.zip解压到d，其中dmc.zip中的dm目录会覆盖dmd.zip的dm目录。 将dfl09601.exe和entice084.exe安装到目录 设置，将环境变量中的Path中添加 D:\ddev\dmd\bin;D:\ddev\dm\bin; 第一个程序，文件first.d代码 #!/usr/bin/dmd /* My First D Win32 Progamme */ private import dfl.all; class MyForm: dfl.form.Form { // Do not modify or move this block of variables. dfl.label.Label LblPrompt; dfl.button.Button BtClose; this() { initializeMyForm(); //@ Other MyForm initialization code here. } [...]


No related posts.

以上关联文章由 <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a> 提供支持。]]></description>
			<content:encoded><![CDATA[<p>元旦放假，赋闲在家，学了一下D语言，完成了第一个GUI程序。<br />
<span id="more-12"></span><br />
需要的东东，D语言的编译器DMD和DMC，还有GUI开发包DFL，还有一个IDE：<br />
dmd.zip   http://ftp.digitalmars.com/dmd.zip<br />
dmc.zip   http://ftp.digitalmars.com/dmc.zip<br />
dfl09601.exe   http://www.dprogramming.com/dfl09601.exe<br />
entice084.exe http://www.dprogramming.com/entice084.exe</p>
<p>安装，先在D盘创建一个目录ddev：<br />
将dmd.zip、dmc.zip解压到d，其中dmc.zip中的dm目录会覆盖dmd.zip的dm目录。<br />
将dfl09601.exe和entice084.exe安装到目录</p>
<p>设置，将环境变量中的Path中添加 D:\ddev\dmd\bin;D:\ddev\dm\bin;</p>
<p>第一个程序，文件first.d代码</p>
<pre lang="bash" line="1">#!/usr/bin/dmd
/*
My First D Win32 Progamme
*/

private import dfl.all;

class MyForm: dfl.form.Form
{
    // Do not modify or move this block of variables.
    dfl.label.Label LblPrompt;
    dfl.button.Button BtClose;

    this()
    {
        initializeMyForm();
        //@ Other MyForm initialization code here.
    }

    private void initializeMyForm()
    {
        // Do not manually modify this function.
        //~DFL Form
        opacity = 0.70;
        text = “测试”;
        clientSize = dfl.all.Size(292, 266);

        //~DFL dfl.label.Label=LblPrompt
        with(LblPrompt = new dfl.label.Label)
        {
            name = “LblPrompt”;
            backColor = dfl.all.SystemColors.info;
            font = new dfl.all.Font(”Microsoft Sans Serif”, 11f, dfl.all.FontStyle.BOLD);
            foreColor = dfl.all.SystemColors.highlight;
            text = “您好，欢迎测试DFL”;
            textAlign = dfl.all.ContentAlignment.MIDDLE_CENTER;
            bounds = dfl.all.Rect(64, 32, 156, 31);
            parent = this;
        }

        //~DFL dfl.button.Button=BtClose
        with(BtClose = new dfl.button.Button)
        {
            name = “BtClose”;
            text = “关 闭”;
            bounds = dfl.all.Rect(96, 176, 75, 23);
            parent = this;
            click ~= |exit_click;
        }
    }

    private void exit_click(Object sender, EventArgs ea)
    {
        Application.exitThread();
    }
}

int main()
{
    int result = 0;
    try
    {
        Application.enableVisualStyles();
        //@ Other application initialization code here.
        Application.run(new MyForm());
    }
    catch(Object o)
    {
        msgBox(o.toString(), “Fatal Error”, MsgBoxButtons.OK, MsgBoxIcon.ERROR);
        result = 1;
    }
    return result;
}</pre>
<p>编译，打开dos窗口，切换到代码所在目录，编译<br />
dfl -gui first.d</p>
<p>得到了first.exe程序</p>


<p>No related posts.</p>
<p>以上关联文章由 <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a> 提供支持。</p>]]></content:encoded>
			<wfw:commentRss>http://blog.declab.com/web/2008/d%e8%af%ad%e8%a8%80%e7%9a%84%e7%ac%ac%e4%b8%80%e4%b8%aa%e5%9b%be%e5%bd%a2%e7%95%8c%e9%9d%a2%e7%a8%8b%e5%ba%8f/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
