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


C++ queue_draw函数代码示例

本文整理汇总了C++中queue_draw函数的典型用法代码示例。如果您正苦于以下问题:C++ queue_draw函数的具体用法?C++ queue_draw怎么用?C++ queue_draw使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: int

bool RegionChooser::on_button_press_event(GdkEventButton* event)
{
    if (!instrument) return true;

    const int k = int(event->x / (get_width() - 1) * 128.0);

    if (event->type == GDK_BUTTON_PRESS) {
        if (event->y >= REGION_BLOCK_HEIGHT) {
            int velocity = (event->y >= REGION_BLOCK_HEIGHT + KEYBOARD_HEIGHT - 1) ? 127 :
                           int(float(event->y - REGION_BLOCK_HEIGHT) / float(KEYBOARD_HEIGHT) * 128.0f) + 1;
            currentActiveKey = k;
            keyboard_key_hit_signal.emit(k, velocity);
        }
    }

    if (event->y >= REGION_BLOCK_HEIGHT) return true;
    if (event->type == GDK_BUTTON_PRESS && event->button == 3) {
        gig::Region* r = get_region(k);
        if (r) {
            region = r;
            queue_draw();
            region_selected();
            dimensionManager.set_region(region);
            popup_menu_inside_region->popup(event->button, event->time);
        } else {
            new_region_pos = k;
            popup_menu_outside_region->popup(event->button, event->time);
        }
    } else {
        if (is_in_resize_zone(event->x, event->y)) {
            get_window()->pointer_grab(false,
                                       Gdk::BUTTON_RELEASE_MASK |
                                       Gdk::POINTER_MOTION_MASK |
                                       Gdk::POINTER_MOTION_HINT_MASK,
                                       Gdk::Cursor(Gdk::SB_H_DOUBLE_ARROW), event->time);
            resize.active = true;
        } else {
            gig::Region* r = get_region(k);
            if (r) {
                region = r;
                queue_draw();
                region_selected();
                dimensionManager.set_region(region);

                get_window()->pointer_grab(false,
                                           Gdk::BUTTON_RELEASE_MASK |
                                           Gdk::POINTER_MOTION_MASK |
                                           Gdk::POINTER_MOTION_HINT_MASK,
                                           Gdk::Cursor(Gdk::FLEUR), event->time);
                move.active = true;
                move.from_x = event->x;
                move.pos = 0;
            }
        }
    }
    return true;
}
开发者ID:svn2github,项目名称:linuxsampler,代码行数:57,代码来源:regionchooser.cpp

示例2: dragp

bool Render::on_motion_notify_event(GdkEventMotion* event)
{
  bool redraw=true;
  Vector2f dragp(event->x, event->y);
  Vector2f delta = m_downPoint - dragp;
  double factor = 0.3;
  Vector3d delta3f(-delta.x*factor, delta.y*factor, 0);
  get_model()->setMeasuresPoint(Vector2d((10.+event->x)/(get_width()-20),
					 (10.+get_height()-event->y)/(get_height()-20)));
  if (event->state & GDK_BUTTON1_MASK) { // move or rotate
    if (event->state & GDK_SHIFT_MASK) { // move object
      if (false);//delta3f.x<1 && delta3f.y<1) redraw=false;
      else {
	Shape *shape;
	TreeObject *object;
	if (!m_view->get_selected_stl(object, shape))
	  return true;
	if (!object && !shape)
	  return true;
	Transform3D *transf;
	if (!shape)
	  transf = &object->transform3D;
	else
	  transf = &shape->transform3D;
	transf->move(delta3f);
	m_downPoint = dragp;
	//m_view->get_model()->CalcBoundingBoxAndCenter();
      }
    }
    else { // rotate
      m_arcBall->dragAccumulate(event->x, event->y, &m_transform);
    }
    if (redraw) queue_draw();
    return true;
  }
  else {
    if (event->state & GDK_BUTTON2_MASK) { // zoom
      double factor = 1.0 + 0.01 * (delta.x - delta.y);
      m_zoom *= factor;
    }
    else if (event->state & GDK_BUTTON3_MASK) { // pan
      Matrix4f matrix;
      memcpy(&matrix.m00, &m_transform.M[0], sizeof(Matrix4f));
      Vector3f m_transl = matrix.getTranslation();
      m_transl += delta3f;
      matrix.setTranslation(m_transl);
      memcpy(&m_transform.M[0], &matrix.m00, sizeof(Matrix4f));      
    }
    m_downPoint = dragp;
    if (redraw) queue_draw();
    return true;
  }
  return Gtk::DrawingArea::on_motion_notify_event (event);
}
开发者ID:atoun,项目名称:repsnapper,代码行数:54,代码来源:render.cpp

示例3: gtk_hex_entry_motion

static gint
gtk_hex_entry_motion (GtkWidget *widget, GdkEventMotion *event)
{
	GtkHexEntry *hex_entry;
	gint x;
		
	g_return_val_if_fail (widget != NULL, FALSE);
	g_return_val_if_fail (GTK_IS_HEX_ENTRY (widget), FALSE);

	hex_entry = GTK_HEX_ENTRY (widget);

	if (hex_entry->button == 0) return FALSE;

	x = event->x;
	if (event->is_hint || (widget->window != event->window))
		gdk_window_get_pointer (widget->window, &x, NULL, NULL);

	hex_entry->cursor_position = x / gdk_char_width (hex_entry->font,'0');
	hex_entry->selection_end_pos = hex_entry->cursor_position;

	if (hex_entry->selection_end_pos < hex_entry->selection_start_pos)
	{
		hex_entry->selection_end_pos = hex_entry->selection_start_pos;
		hex_entry->selection_start_pos = hex_entry->cursor_position;
	}

	queue_draw (hex_entry);

	return TRUE;
}
开发者ID:duke1102,项目名称:psxdev,代码行数:30,代码来源:gtkhexentry.c

示例4: layout_graph

/** Set graph.
 * @param graph string representation of the current graph in the dot language.
 */
void
SkillGuiGraphDrawingArea::set_graph(std::string graph)
{
  if ( __update_graph ) {
    __graph_dot = graph;
    layout_graph();
    queue_draw();
  } else {
    __nonupd_graph = graph;
  }

  if ( __recording ) {
    char *tmp;
    timespec t;
    if (clock_gettime(CLOCK_REALTIME, &t) == 0) {
      struct tm tms;
      localtime_r(&t.tv_sec, &tms);

      if ( asprintf(&tmp, "%s/%s_%04i%02i%02i-%02i%02i%02i.%09li.dot",
		    __record_directory.c_str(), __graph_fsm.c_str(),
		    tms.tm_year + 1900, tms.tm_mon + 1, tms.tm_mday,
		    tms.tm_hour, tms.tm_min, tms.tm_sec, t.tv_nsec) != -1) {

          //printf("Would record to filename %s\n", tmp);
          save_dotfile(tmp);
          free(tmp);
      } else {
        printf("Warning: Could not create file name for recording, skipping graph\n");
      }
    } else {
      printf("Warning: Could not time recording, skipping graph\n");
    }
  }
}
开发者ID:timn,项目名称:ros-skillgui,代码行数:37,代码来源:graph_drawing_area.cpp

示例5: queue_draw

void
perfroll::update_sizes ()
{
    int h_bars = m_roll_length_ticks / (m_ticks_per_bar);
    int h_bars_visible = (m_window_x * m_perf_scale_x) / (m_ticks_per_bar);
    int h_max_value = h_bars - h_bars_visible;
    m_hadjust.set_lower(0);
    m_hadjust.set_upper(h_bars);
    m_hadjust.set_page_size(h_bars_visible);
    m_hadjust.set_step_increment(1);
    m_hadjust.set_page_increment(1);
    if (m_hadjust.get_value() > h_max_value)
        m_hadjust.set_value(h_max_value);

    m_vadjust.set_lower(0);
    m_vadjust.set_upper(m_sequence_max);
    m_vadjust.set_page_size(m_window_y / m_names_y);
    m_vadjust.set_step_increment(1);
    m_vadjust.set_page_increment(1);

    int v_max_value = m_sequence_max - (m_window_y / m_names_y);
    if (m_vadjust.get_value() > v_max_value)
        m_vadjust.set_value(v_max_value);

    if (is_realized())
        m_pixmap = Gdk::Pixmap::create(m_window, m_window_x, m_window_y, -1);

    queue_draw();
}
开发者ID:EQ4,项目名称:sequencer64,代码行数:29,代码来源:perfroll.cpp

示例6: get_width

bool Terminal::on_my_drag_motion(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, guint time) {
    int width = get_width();
    int height = get_height();
    int from_center_x = x - width/2;
    int from_center_y = y - height/2;

    if (ABS(from_center_x) > ABS(from_center_y))
        if (from_center_x > 0)
            dock_pos = Gtk::POS_RIGHT;
        else
            dock_pos = Gtk::POS_LEFT;
    else
        if (from_center_y > 0)
            dock_pos = Gtk::POS_BOTTOM;
        else
            dock_pos = Gtk::POS_TOP;

    switch (dock_pos) {
        case Gtk::POS_TOP:
            dock_hint = GdkRectangle{0, 0, width, height/2};
            break;
        case Gtk::POS_LEFT:
            dock_hint = GdkRectangle{0, 0, width/2, height};
            break;
        case Gtk::POS_RIGHT:
            dock_hint = GdkRectangle{width/2, 0, width/2, height};
            break;
        case Gtk::POS_BOTTOM:
            dock_hint = GdkRectangle{0, height/2, width, height/2};
    }

    queue_draw();
}
开发者ID:SvanT,项目名称:SvanTerm2000,代码行数:33,代码来源:terminal.cpp

示例7: queue_draw

bool Terminal::on_my_drag_drop(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, guint time) {
    dock_hint = GdkRectangle{0, 0, 0, 0};
    queue_draw();

    if (dock_from == this) {
        return FALSE;
    }
    Frame *old_frame = static_cast<Frame *>(dock_from->get_parent());

    switch (dock_pos) {
        case GTK_POS_TOP:
            manage(new Splitter(get_parent(), dock_from, this, Gtk::ORIENTATION_VERTICAL));
            break;
        case GTK_POS_BOTTOM:
            manage(new Splitter(get_parent(), this, dock_from, Gtk::ORIENTATION_VERTICAL));
            break;
        case GTK_POS_LEFT:
            manage(new Splitter(get_parent(), dock_from, this, Gtk::ORIENTATION_HORIZONTAL));
            break;
        case GTK_POS_RIGHT:
            manage(new Splitter(get_parent(), this, dock_from, Gtk::ORIENTATION_HORIZONTAL));
    }


    old_frame->destroy();
    static_cast<TerminalWindow *>(this->get_toplevel())->present();
    dock_from->focus_vte();
}
开发者ID:SvanT,项目名称:SvanTerm2000,代码行数:28,代码来源:terminal.cpp

示例8: m2_mouseup

static RobWidget* m2_mouseup(RobWidget* handle, RobTkBtnEvent *event) {
	MF2UI* ui = (MF2UI*)GET_HANDLE(handle);
	ui->drag_cutoff_x = -1;
	ui->update_annotations = true;
	queue_draw(ui->m2);
	return NULL;
}
开发者ID:bangquangvn,项目名称:meters.lv2,代码行数:7,代码来源:phasewheel.c

示例9: queue_draw

void knob::set_value(float _value)
{

	if (invert)
	{
		value = max - _value;
	}
	else
	{
		value = _value;
	}	

	if (min > max && max >=0)
	{
		knob_value =  value / (min-max);
	}

	if (min > max && max <0)
	{
		knob_value = (value / (min - max)) + 0.5;
	}

	if (min <= max && min >=0)
	{
		knob_value = value / (max-min);
	}

	if (min <= max && min <0)
	{
		knob_value = (value / (max - min)) + 0.5;
	}
	
	queue_draw();
}
开发者ID:shanipribadi,项目名称:triceratops-lv2,代码行数:34,代码来源:knob_widget.cpp

示例10: get_allocation

bool Simple_GOL_Area::on_button_press_event(GdkEventButton* event)
{
	if(event->type == GDK_BUTTON_PRESS)
	{
		if(event->button == 1)
		{	
			Gtk::Allocation allocation = get_allocation();
			
			int item_x = int(sim_data->get_width()*event->x/allocation.get_width());
			int item_y = int(sim_data->get_height()*event->y/allocation.get_height());
			std::cout << item_x << " " << item_y << "\n";
			
			mouse_button_one_down = (sim_data->get(item_x, item_y)+1)%2 + 1;
				
			sim_data->set(item_x, item_y, (sim_data->get(item_x, item_y)+1)%2);
			
			queue_draw();
		}
		else if(event->button == 3)
		{
			pause_toggle();
		}
	}
	
	return true;
}
开发者ID:SeanFC,项目名称:Conways_GOL,代码行数:26,代码来源:Conways_Game_Of_Life.cpp

示例11: queue_draw

/** Button release event handler.
 * @param event event data
 * @return true
 */
bool
SkillGuiGraphDrawingArea::on_button_release_event(GdkEventButton *event)
{
  __mouse_motion = false;
  queue_draw();
  return true;
}
开发者ID:timn,项目名称:ros-skillgui,代码行数:11,代码来源:graph_drawing_area.cpp

示例12: queue_draw

void
perftime::set_guides( int a_snap, int a_measure )
{
    m_snap = a_snap;
    m_measure_length = a_measure;
    queue_draw();
}
开发者ID:Stazed,项目名称:seq42,代码行数:7,代码来源:perftime.cpp

示例13: gtk_hex_entry_button_release

static gint
gtk_hex_entry_button_release (GtkWidget *widget, GdkEventButton *event)
{
	GtkHexEntry *hex_entry;

	g_return_val_if_fail (widget != NULL, FALSE);
	g_return_val_if_fail (GTK_IS_HEX_ENTRY (widget), FALSE);

	hex_entry = GTK_HEX_ENTRY (widget);

	if (hex_entry->button != event->button) return FALSE;
	
	if (event->button == 1)
	{
		gtk_grab_remove (widget);
		hex_entry->has_selection = FALSE;
		if (hex_entry->selection_start_pos != hex_entry->selection_end_pos)
		{
			hex_entry->has_selection = TRUE;
		}
	}

	queue_draw (hex_entry);

	return FALSE;
}
开发者ID:duke1102,项目名称:psxdev,代码行数:26,代码来源:gtkhexentry.c

示例14: strdup

/** Open a dot graph and display it. */
void
SkillGuiGraphDrawingArea::open()
{
  Gtk::Window *w = dynamic_cast<Gtk::Window *>(get_toplevel());
  __fcd_open->set_transient_for(*w);

  int result = __fcd_open->run();
  if (result == Gtk::RESPONSE_OK) {
    __update_graph = false;
    __graph_dot = "";
    char *basec = strdup(__fcd_open->get_filename().c_str());
    char *basen = basename(basec);
    __graph_fsm = basen;
    free(basec);

    FILE *f = fopen(__fcd_open->get_filename().c_str(), "r");
    while (! feof(f)) {
      char tmp[4096];
      size_t s;
      if ((s = fread(tmp, 1, 4096, f)) > 0) {
        __graph_dot.append(tmp, s);
      }
    }
    fclose(f);
    __signal_update_disabled.emit();
    queue_draw();
  }

  __fcd_open->hide();
}
开发者ID:timn,项目名称:ros-skillgui,代码行数:31,代码来源:graph_drawing_area.cpp

示例15: gtk_hex_entry_size_allocate

static void
gtk_hex_entry_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
{
	GtkHexEntry *hex_entry;

	g_return_if_fail (widget != NULL);
	g_return_if_fail (GTK_IS_HEX_ENTRY (widget));
	g_return_if_fail (allocation != NULL);

	widget->allocation = *allocation;
	hex_entry = GTK_HEX_ENTRY (widget);

	if (GTK_WIDGET_REALIZED (widget))
	{
		GtkRequisition requisition;
		gtk_widget_get_child_requisition (widget, &requisition);
  
		gdk_window_move_resize (widget->window,
			allocation->x,
			allocation->y,
			requisition.width, requisition.height);

		queue_draw (hex_entry);
	}
}
开发者ID:duke1102,项目名称:psxdev,代码行数:25,代码来源:gtkhexentry.c


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