📄 userlist_view.cpp
字号:
/*
Simple GUI & Network demo application,
Copyright (c) 2000 by Magnus Norddahl and Kenneth Gangstoe.
*/
#include "userlist_view.h"
#include "document.h"
#include <ClanLib/display.h>
#include <ClanLib/gui.h>
/////////////////////////////////////////////////////////////////////////////
// Construction:
UserListView::UserListView(MainFrame *parent)
: View(parent)
{
list = new CL_ListBox(CL_Rect(0,0,0,0), this);
// Connect events to signals:
slot_paint = sig_paint().connect(
CL_CreateSlot(this, &UserListView::on_paint));
/* slot_user_added = parent->get_document()->sig_user_added.connect(
CL_CreateSlot(this, &UserListView::on_user_added));
slot_user_removed = parent->get_document()->sig_user_removed.connect(
CL_CreateSlot(this, &UserListView::on_user_removed));
*/
// Document is not done yet, so add some dummy data instead:
on_user_added("Sphair");
on_user_added("Mbn");
}
UserListView::~UserListView()
{
}
/////////////////////////////////////////////////////////////////////////////
// Attributes:
/////////////////////////////////////////////////////////////////////////////
// Operations:
/////////////////////////////////////////////////////////////////////////////
// Events:
void UserListView::on_paint()
{
CL_Display::fill_rect(0, 0, get_width(), get_height(), 1,1,1);
}
void UserListView::on_user_added(const std::string &user)
{
}
void UserListView::on_user_removed(const std::string &user)
{
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -