概览
示例
截图
比较
应用
下载
Documentation
集市
现状与日程
常见问题
作者与许可证
论坛
资助Ultimate++
搜索本站
语言
中文(简体)











SourceForge.net Logo



HelloWorld

 

Rudimentary HelloWorld application with menu and status bar

 

 

hello.cpp

 

#include <CtrlLib/CtrlLib.h>

 

using namespace Upp;

 

class HelloWorld : public TopWindow {

    MenuBar menu;

    StatusBar status;

 

    void FileMenu(Bar& bar);

    void MainMenu(Bar& bar);

    void About();

 

public:

    typedef HelloWorld CLASSNAME;

 

    HelloWorld();

};

 

void HelloWorld::About()

{

    PromptOK("{{1@5 [@9= This is the]::@2 [A5@0 Ultimate`+`+ Hello world sample}}");

}

 

void HelloWorld::FileMenu(Bar& bar)

{

    bar.Add("About..", THISBACK(About));

    bar.Separator();

    bar.Add("Exit", THISBACK(Close));

}

 

void HelloWorld::MainMenu(Bar& bar)

{

    menu.Add("File", THISBACK(FileMenu));

}

 

HelloWorld::HelloWorld()

{

    AddFrame(menu);

    AddFrame(status);

    menu.Set(THISBACK(MainMenu));

    status = "Welcome to the Ultimate++ !";

}

 

GUI_APP_MAIN

{

    SetLanguage(LNG_ENGLISH);

    HelloWorld().Run();

}

 

 

 

 

本页也有english, català, čeština, deutsch, español, euskara, français, română, русский中文(繁體)版本. 你想帮忙吗?