本文整理汇总了C++中Container::FadeTo方法的典型用法代码示例。如果您正苦于以下问题:C++ Container::FadeTo方法的具体用法?C++ Container::FadeTo怎么用?C++ Container::FadeTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Container
的用法示例。
在下文中一共展示了Container::FadeTo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: api_gui_addform
ZString api_gui_addform( ZCsl *aCsl )
{
clear_controlid_list();
int argCount = aCsl->get("argCount").asInt();
// int flags = GUMPFLAG_MOVABLE | GUMPFLAG_CLOSABLE | GUMPFLAG_FOCUSABLE;
int x = aCsl->get("x").asInt();
int y = aCsl->get("y").asInt();
std::string gfm_file = std::string (aCsl->get("gfm_file").buffer ());
bool is_container = (argCount > 3) ? ((int) aCsl->get("is_container").asInt()) : false;
Container* container = NULL;
std::string shape;
XML::Parser parser;
XML::Node* form=NULL,* document=NULL;
try
{
parser.loadData(gfm_file);
document = parser.parseDocument();
int width=640,height=480, alpha=0, flags=0, fade_alpha=0, fade_time=0;
std::string onclick, onclose, onmouseup, onmousedown, onkeypressed;
form = document->findNode("form");
if ( !form )
{
throw;
}
form->lookupAttribute("width", width);
form->lookupAttribute("height", height);
form->lookupAttribute("alpha", alpha);
form->lookupAttribute("flags", flags);
form->lookupAttribute("shape", shape);
XML::Node* fade_node = form->findNode("fade");
if (fade_node)
{
fade_node->lookupAttribute("alpha", fade_alpha);
fade_node->lookupAttribute("time", fade_time);
}
XML::Node* event_node = form->findNode("event");
if (event_node)
{
event_node->lookupAttribute("onclick", onclick);
event_node->lookupAttribute("onclose", onclose);
event_node->lookupAttribute("onmouseup", onmouseup);
event_node->lookupAttribute("onmousedown", onmousedown);
event_node->lookupAttribute("onkeypressed", onkeypressed);
}
if (is_container)
{
container = new Container();
container->SetPosition(x,y);
container->SetSize(width, height);
container->SetAlpha(alpha);
if (fade_time != 0)
container->FadeTo(fade_alpha, fade_time);
x = 0, y = 0;
api_addcontrol( container );
Control* control=container;
if (!onclose.empty()) {
control->OnClose(on_closehandler);
control->SetScriptFunction(FUNC_ONCLOSE, (char*)onclose.c_str());
}
if (!onmousedown.empty()) {
control->OnMouseDown(on_mousedownhandler);
control->SetScriptFunction(FUNC_ONMOUSEDOWN, (char*)onmousedown.c_str());
}
if (!onmouseup.empty()) {
control->OnMouseUp(on_mouseuphandler);
control->SetScriptFunction(FUNC_ONMOUSEUP, (char*)onmouseup.c_str());
}
act_container_id = container->GetID();
}
} catch (...) {
//delete document;
return "0";
}
int idx=0;
XML::Node* control_node = NULL;
while ((control_node = form->findNode("control", idx++))) {
Control* control=NULL;
XML::Node* event_node=NULL,* gump_node=NULL, * passwd_node=NULL;
XML::Node* check_node=NULL,* group_node=NULL,* text_node=NULL;
std::string type, name;
std::string onclick, onclose, onmouseup, onmousedown, onkeypressed;
//.........这里部分代码省略.........