SDLGUI下手工输入Widget小工类生成界面(两段视频)
sdlgui吧
全部回复
仅看楼主
level 10
twtfcu3 楼主
第一段视频下载地址(格式.swf,时长11分钟)
百度网盘
第二段视频下载地址(格式.swf,时长18分钟)
百度网盘
2014年05月31日 00点05分 1
level 10
twtfcu3 楼主
#include <SDL2/SDL.h>
#include "sdlgui/sdlgui.h"
using namespace std;
typedef class plane : public GUI<plane,sdl_widget>
{
public:
plane();
plane(const char*,int,int,int,int,Uint32);
int init();
int init(const char*,int,int,int,int,Uint32);
int sysevent(SDL_Event*);
protected:
sdl_widget_ptr _title;
sdl_button_ptr _min,_close;
sdl_view_ptr _view;
sdl_h_scroll_ptr _h;
}*plane_ptr;
plane::plane()
:
GUI<plane,sdl_widget>()
{
init();
}
plane::plane(const char* ptitle,int px,int py,int pw,int ph,Uint32 pflag)
:
GUI<plane,sdl_widget>()
{
init(ptitle,px,py,pw,ph,pflag);
}
int plane::init()
{
if(sdl_widget::init())return -1;
return 0;
}
int plane::init(const char* ptitle,int px,int py,int pw,int ph,Uint32 pflag)
{
if(sdl_widget::init(ptitle,px,py,pw,ph,pflag))return -1;
_title = add<sdl_widget>("title",0,0,pw,30,1);
_title->fill_rect(NULL,0xfffff0);
_min = _title->add<sdl_button>("-",pw-60,0,30,30,1);
_close = _title->add<sdl_button>("x",pw-30,0,30,30,1);
_view = add<sdl_view>("",0,30,pw-30,ph-30,1);
_view->view.init("",0,0,600,600,1);
_view->view.img_load(ptitle);
_view->scroll(1);
_h = add<sdl_h_scroll>("",pw-30,30,30,ph-30,1);
return 0;
}
int plane::sysevent(SDL_Event*e)
{
switch(e->type)
{
default:
break;
}
return sdl_widget::sysevent(e);
}
int main(int argc, char * argv[])
{
sdl_frame f("sdlgui",100,100,600,600,SDL_WINDOW_SHOWN);
f.add<plane>("bg.jpg",0,0,600,300,1);
f.run();
return 0;
}
2014年05月31日 00点05分 2
level 10
twtfcu3 楼主
我要叫了
2014年05月31日 00点05分 3
2014年05月31日 01点05分
2014年05月31日 01点05分
2014年05月31日 01点05分
2014年05月31日 01点05分
level 11
顶顶。。。
2014年05月31日 01点05分 5
level 9
顶帖,
2014年05月31日 01点05分 6
level 9

   --
::: (\_(\ I
*: (=’ :’) :* miss
•..(,(”)(”) ¤°.¸¸.•´¯`» you
2014年05月31日 01点05分 7
level 5
先顶
2014年05月31日 01点05分 8
level 1
来了.....帮顶一下。
2014年05月31日 02点05分 9
level 14

2014年05月31日 02点05分 10
level 1

   ——魔术,梦与艺术的结合······
2014年05月31日 02点05分 11
level 9
来顶了
2014年05月31日 04点05分 12
level 11
[笑眼]
2014年05月31日 04点05分 13
level 1
顶一顶,顶一顶[哈哈]
2014年05月31日 04点05分 14
level 4
顶顶更健康*^_^*
2014年05月31日 07点05分 15
level 3
哈哈 顶!
2014年05月31日 11点05分 16
level 1
[咦]视频用的是啥解析库?
2014年06月01日 14点06分 17
是电脑录制的,swf格式
2014年06月01日 17点06分
安装手机版flashplayer可以用手机看
2014年06月01日 17点06分
level 10
twtfcu3 楼主
是电脑录制的,swf格式
2014年06月01日 17点06分 18
level 1
居然被艾特了,好激动
2014年06月06日 13点06分 19
1