本文整理汇总了C++中DrawInfo::button_up方法的典型用法代码示例。如果您正苦于以下问题:C++ DrawInfo::button_up方法的具体用法?C++ DrawInfo::button_up怎么用?C++ DrawInfo::button_up使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DrawInfo
的用法示例。
在下文中一共展示了DrawInfo::button_up方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _do_input
/* Called when a DrawingArea has input (either mouse or keyboard).
*/
static void _do_input(Widget w, void *data, XADCS *call_data)
{
char *input;
DrawInfo *di = (DrawInfo *) data;
SetDrawArea(w);
if (call_data->event->type == ButtonPress)
{
if (di->button_down)
di->button_down(w, call_data->event->xbutton.button,
call_data->event->xbutton.x,call_data->event->xbutton.y,
di->user_data);
}
else if (call_data->event->type == ButtonRelease)
{
if (di->button_up)
di->button_up(w, call_data->event->xbutton.button,
call_data->event->xbutton.x, call_data->event->xbutton.y,
di->user_data);
}
else if (call_data->event->type == KeyPress)
{
input = TranslateKeyCode(call_data->event);
if (input && *input != '\0' && di->keypress)
di->keypress(w, input, 0, di->user_data);
}
else if (call_data->event->type == KeyRelease)
{
input = TranslateKeyCode(call_data->event);
if (input && *input != '\0' && di->keypress)
di->keypress(w, input, 1, di->user_data);
}
}