Project Description
C++ Windowless GUI,DirectUI

使用C++编写,基于GDI+的一套Windowless GUI库

示例代码:

	auto panel = new Panel(50, 50, 700, 500);
	panel->SetBackground(Color::LightBlue);
	panel->SetBorderColor(Color(255, 0, 0));
	auto button = new Button( 10, 10, 80, 30 );
	button->SetText( TEXT("按钮") );
	button->SetToolTip( TEXT("ToolTip") );
	panel->Add( button );
 
	auto option = new Option( 100, 18, 60, 14 );
	option->SetText( TEXT("单选框") );
	option->SetToolTip( TEXT("ToolTip") );
	panel->Add( option );
 
	auto check = new CheckBox( 170, 18, 60, 14 );
	check->SetText( TEXT("复选框") );
	check->SetToolTip( TEXT("ToolTip") );
	panel->Add( check );
	auto prograss = new PrograssBar( 240, 17, 160, 16 );
	prograss->SetValue( 80 );
	prograss->SetToolTip( TEXT("ToolTip") );
	panel->Add( prograss );
	auto textbox = new TextBox( 410, 16, 90, 18 );
	textbox->SetBackground( Color::White );
	textbox->SetText( TEXT("TextBox") );
	panel->Add( textbox );

	auto track = new TrackBar( 510, 17, 160, 16 );
	track->SetValue( 50 );
	track->SetToolTip( TEXT("Track") );
	panel->Add( track );

	Window* win = new Window(L"GUIToolkit", L"Window");
	win->Add(panel);
	win->SetClientSize(800, 600);
	win->Show();

	button->Click += [win](void* e) { ::MessageBox(win->GetHandle(), L"Clicked", L"tips", MB_OK); };
	Timer timer;
	timer.Tick += [panel](void* p) 
	{
		SizeF pos = panel->GetSize();
		pos.Height = 400.0f + 100.0f * std::sin((float)::GetTickCount() / 200.0f);
		panel->SetSize(pos);
	};
	timer.Start(40);

	return Application::Run(win);

Last edited Mar 23, 2012 at 9:19 AM by wmesci, version 8