当前位置: 首页>>代码示例>>C++>>正文


C++ SPDesktop::guidesMessageContext方法代码示例

本文整理汇总了C++中SPDesktop::guidesMessageContext方法的典型用法代码示例。如果您正苦于以下问题:C++ SPDesktop::guidesMessageContext方法的具体用法?C++ SPDesktop::guidesMessageContext怎么用?C++ SPDesktop::guidesMessageContext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SPDesktop的用法示例。


在下文中一共展示了SPDesktop::guidesMessageContext方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: sp_dt_guide_event


//.........这里部分代码省略.........
                drag_type = SP_DRAG_NONE;
                sp_canvas_item_ungrab(item, event->button.time);
                ret=TRUE;
            }
            break;
    case GDK_ENTER_NOTIFY:
    {
            sp_guideline_set_color(SP_GUIDELINE(item), guide->getHiColor());

            // set move or rotate cursor
            Geom::Point const event_w(event->crossing.x, event->crossing.y);

            if ((event->crossing.state & GDK_SHIFT_MASK) && (drag_type != SP_DRAG_MOVE_ORIGIN)) {
                GdkCursor *guide_cursor;
                guide_cursor = gdk_cursor_new (GDK_EXCHANGE);
                gdk_window_set_cursor(gtk_widget_get_window (GTK_WIDGET(desktop->getCanvas())), guide_cursor);
#if GTK_CHECK_VERSION(3,0,0)
                g_object_unref(guide_cursor);
#else
                gdk_cursor_unref(guide_cursor);
#endif
            } else {
                GdkCursor *guide_cursor;
                guide_cursor = gdk_cursor_new (GDK_HAND1);
                gdk_window_set_cursor(gtk_widget_get_window (GTK_WIDGET(desktop->getCanvas())), guide_cursor);
#if GTK_CHECK_VERSION(3,0,0)
                g_object_unref(guide_cursor);
#else
                gdk_cursor_unref(guide_cursor);
#endif
            }

            char *guide_description = guide->description();
            desktop->guidesMessageContext()->setF(Inkscape::NORMAL_MESSAGE, _("<b>Guideline</b>: %s"), guide_description);
            g_free(guide_description);
            break;
    }
    case GDK_LEAVE_NOTIFY:
            sp_guideline_set_color(SP_GUIDELINE(item), guide->getColor());

            // restore event context's cursor
            gdk_window_set_cursor(gtk_widget_get_window (GTK_WIDGET(desktop->getCanvas())), desktop->event_context->cursor);

            desktop->guidesMessageContext()->clear();
            break;
        case GDK_KEY_PRESS:
            switch (Inkscape::UI::Tools::get_group0_keyval (&event->key)) {
                case GDK_KEY_Delete:
                case GDK_KEY_KP_Delete:
                case GDK_KEY_BackSpace:
                {
                    SPDocument *doc = guide->document;
                    sp_guide_remove(guide);
                    DocumentUndo::done(doc, SP_VERB_NONE, _("Delete guide"));
                    ret = TRUE;
                    sp_event_context_discard_delayed_snap_event(desktop->event_context);
                    break;
                }
                case GDK_KEY_Shift_L:
                case GDK_KEY_Shift_R:
                    if (drag_type != SP_DRAG_MOVE_ORIGIN) {
                        GdkCursor *guide_cursor;
                        guide_cursor = gdk_cursor_new (GDK_EXCHANGE);
                        gdk_window_set_cursor(gtk_widget_get_window (GTK_WIDGET(desktop->getCanvas())), guide_cursor);
#if GTK_CHECK_VERSION(3,0,0)
            g_object_unref(guide_cursor);
开发者ID:vinics,项目名称:inkscape,代码行数:67,代码来源:desktop-events.cpp


注:本文中的SPDesktop::guidesMessageContext方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。