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


C++ GTK_TOGGLE_TOOL_BUTTON函数代码示例

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


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

示例1: on_view_offsets

NOT IMPLEMENTED YET

/* callback to show and hide the offsets columns pane */
G_MODULE_EXPORT void 
on_view_offsets (GtkObject *object, gpointer user_data)
{
  /* NOT YET TESTED */
     GtkWidget *offsets_w, *menu_w, *btn_w;

     offsets_w = get_widget("inst_list");
     menu_w = get_widget("m_view_metrics");
     btn_w = get_widget("view_metrics_btn");

     g_print("on_view_offsets\n");

     g_signal_handlers_block_by_func(G_OBJECT(object), 
				     G_CALLBACK(on_view_offsets), NULL);

     if (GTK_WIDGET_VISIBLE(offsets_w)) {
	  gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu_w), FALSE);
	  gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(btn_w),
					    FALSE);
  	  gtk_widget_hide(offsets_w);
     } else {
	  gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu_w), TRUE);
	  gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(btn_w),
					    TRUE);
	  gtk_widget_show(offsets_w);
     }

     g_signal_handlers_unblock_by_func(G_OBJECT(object), 
				       G_CALLBACK(on_view_offsets), NULL);
}
开发者ID:SystemGarden,项目名称:habitat,代码行数:33,代码来源:callbacks.c

示例2: XOJ_CHECK_TYPE_OBJ

void AbstractToolItem::toolButtonCallback(GtkToolButton* toolbutton, AbstractToolItem* item)
{
	XOJ_CHECK_TYPE_OBJ(item, AbstractToolItem);

	if (toolbutton && GTK_IS_TOGGLE_TOOL_BUTTON(toolbutton))
	{
		bool selected = gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(toolbutton));

		// ignore this event... GTK Broadcast to much events, e.g. if you call set_active
		if (item->toolToggleButtonActive == selected)
		{
			return;
		}

		// don't allow deselect this button
		if (item->toolToggleOnlyEnable && selected == false)
		{
			gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(toolbutton), true);
			return;
		}

		item->toolToggleButtonActive = selected;
	}

	item->activated(NULL, NULL, toolbutton);
}
开发者ID:xournalpp,项目名称:xournalpp,代码行数:26,代码来源:AbstractToolItem.cpp

示例3: XOJ_CHECK_TYPE

void ToolDrawCombocontrol::selected(ActionGroup group, ActionType action)
{
	XOJ_CHECK_TYPE(ToolDrawCombocontrol);

	if (!this->item)
	{
		return;
	}

	if (!GTK_IS_TOGGLE_TOOL_BUTTON(this->item))
	{
		g_warning("ToolDrawCombocontrol: selected action %i which is not a toggle action!", action);
		return;
	}

	string description;

	for (ToolDrawType* t : drawTypes)
	{
		if (action == t->type && this->action != t->type)
		{
			this->action = t->type;
			gtk_image_set_from_icon_name(GTK_IMAGE(iconWidget), t->icon.c_str(), GTK_ICON_SIZE_SMALL_TOOLBAR);
			description = t->name;
			break;
		}
	}

	gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(item), description.c_str());
	if (gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(this->item)) != (this->action == action))
	{
		this->toolToggleButtonActive = (this->action == action);
		gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(this->item), this->toolToggleButtonActive);
	}
}
开发者ID:xournalpp,项目名称:xournalpp,代码行数:35,代码来源:ToolDrawCombocontrol.cpp

示例4: XOJ_CHECK_TYPE

void ColorToolItem::enableColor(int color) {
	XOJ_CHECK_TYPE(ColorToolItem);

	if (isSelector()) {
		selectcolor_set_color(this->iconWidget, color);
		this->color = color;
		if (GTK_IS_TOGGLE_BUTTON(this->item)) {
			gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(this->item), false);
		}
	} else {
		bool active = colorEqualsMoreOreLess(color);

		if (this->item) {
			gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(this->item), active);
		}

		if (active) {
			this->toolHandler->setColorFound();

			// Only equals more ore less, so we will set it exact to the default color
			if (this->color != color) {
				this->toolHandler->setColor(this->color);
			}

		}
	}
}
开发者ID:wbrenna,项目名称:xournalpp,代码行数:27,代码来源:ColorToolItem.cpp

示例5: SetSelectMode

void CMatchingDlg::OnButtonClicked(GtkWidget *pBtn)
{
	if (!m_Updating) {
		m_Updating = true;
		if (pBtn==m_FrameBtn) {
			if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(m_FrameBtn))) {
				SetSelectMode(REFERENCE_FRAME);
				UpdatePreview(true);
				UpdateControls();
			}
		} else if (pBtn==m_CatalogBtn) {
			if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(m_CatalogBtn))) {
				SetSelectMode(CATALOG_FILE);
				UpdatePreview(true);
				UpdateControls();
			}
		} else if (pBtn==GTK_WIDGET(m_ShowChart)) {
			if (gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(m_ShowChart))) {
				SetDisplayMode(DISPLAY_CHART);
				UpdatePreview(true);
				UpdateControls();
			}
		} else if (pBtn==GTK_WIDGET(m_ShowImage)) {
			if (gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(m_ShowImage))) {
				SetDisplayMode(DISPLAY_IMAGE);
				UpdatePreview(true);
				UpdateControls();
			}
		} else if (pBtn==m_PathBtn) 
			ChangeCatalogPath();
		else if (pBtn==m_OptionsBtn)
			EditPreferences();
		m_Updating = false;
	}
}
开发者ID:mvancompernolle,项目名称:ai_project,代码行数:35,代码来源:matching_dlg.cpp

示例6: switch

void CMatchingDlg::SetSelectMode(tSelectMode mode)
{
	m_SelectMode = mode;
	switch (mode)
	{
	case REFERENCE_FRAME:
		gtk_label_set_markup(GTK_LABEL(m_SelLabel), "<b>Select a reference frame</b>");
		gtk_widget_hide(m_CatalogBox);
		gtk_widget_hide(m_PathLabel);
		gtk_widget_hide(m_PathEntry);
		gtk_widget_hide(m_PathBtn);
		gtk_widget_show(m_FrameBox);
		gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(m_ShowChart), 
			m_DMFrame == DISPLAY_CHART);
		gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(m_ShowImage), 
			m_DMFrame == DISPLAY_IMAGE);
		break;

	case CATALOG_FILE:
		gtk_label_set_markup(GTK_LABEL(m_SelLabel), "<b>Select a catalog file</b>");
		gtk_widget_hide(m_FrameBox);
		gtk_widget_show(m_PathLabel);
		gtk_widget_show(m_PathEntry);
		gtk_widget_show(m_PathBtn);
		gtk_widget_show(m_CatalogBox);
		gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(m_ShowChart), 
			m_DMCatalog == DISPLAY_CHART);
		gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(m_ShowImage), 
			m_DMCatalog == DISPLAY_IMAGE);
		break;
	}
}
开发者ID:mvancompernolle,项目名称:ai_project,代码行数:32,代码来源:matching_dlg.cpp

示例7: library_view_adjust_aspect_buttons

static void library_view_adjust_aspect_buttons(library_view_t* view, aspect_enum aspect)
{
  GtkToggleToolButton* g_btn = GTK_TOGGLE_TOOL_BUTTON(gtk_builder_get_object(view->builder, "tbtn_genres"));
  GtkToggleToolButton* ar_btn = GTK_TOGGLE_TOOL_BUTTON(gtk_builder_get_object(view->builder, "tbtn_artists"));
  GtkToggleToolButton* al_btn = GTK_TOGGLE_TOOL_BUTTON(gtk_builder_get_object(view->builder, "tbtn_albums"));

  switch (aspect) {
    case GENRE_ASPECT: {
        SET_TOGGLE(ar_btn, FALSE);
        SET_TOGGLE(al_btn, FALSE);
        SET_TOGGLE(g_btn, TRUE);
    }
    break;
    case ARTIST_ASPECT: {
        SET_TOGGLE(ar_btn, TRUE);
        SET_TOGGLE(al_btn, FALSE);
        SET_TOGGLE(g_btn, FALSE);
    }
    break;
    case ALBUM_ASPECT: {
        SET_TOGGLE(ar_btn, FALSE);
        SET_TOGGLE(al_btn, TRUE);
        SET_TOGGLE(g_btn, FALSE);
    }
    break;
    default:
    break;
  }
}
开发者ID:hdijkema,项目名称:BackToBasics,代码行数:29,代码来源:library_view.c

示例8: on_view_choices

/* callback to show and hide the choice pane */
G_MODULE_EXPORT void 
on_view_choices (GtkObject *object, gpointer user_data)
{
     GtkWidget *scroll_w, *menu_w, *btn_w;

     scroll_w = get_widget("choice_scrollwin");
     menu_w = get_widget("m_view_choices");
     btn_w = get_widget("view_choice_btn");

     g_signal_handlers_block_by_func(G_OBJECT(object), 
				     G_CALLBACK(on_view_choices), NULL);

     if (GTK_WIDGET_VISIBLE(scroll_w)) {
	  gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu_w), FALSE);
	  gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(btn_w),
					    FALSE);
  	  gtk_widget_hide(scroll_w);
     } else {
	  gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu_w), TRUE);
	  gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(btn_w),
					    TRUE);
	  gtk_widget_show(scroll_w);
     }

     g_signal_handlers_unblock_by_func(G_OBJECT(object), 
				       G_CALLBACK(on_view_choices), NULL);
}
开发者ID:SystemGarden,项目名称:habitat,代码行数:28,代码来源:callbacks.c

示例9: enableInterpolationButtonSignals

		void CTopographicMap3DView::init()
		{
			//reflect default interpolation type
			m_rTopographicMapDatabase.setInterpolationType(m_ui64CurrentInterpolation);
			enableInterpolationButtonSignals(false);
			gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(m_pMapPotentials), m_ui64CurrentInterpolation == OVP_TypeId_SphericalLinearInterpolationType_Spline);
			gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(m_pMapCurrents), m_ui64CurrentInterpolation == OVP_TypeId_SphericalLinearInterpolationType_Laplacian);
			enableInterpolationButtonSignals(true);
		}
开发者ID:pborky,项目名称:openvibe,代码行数:9,代码来源:ovpCTopographicMap3DView.cpp

示例10: ui_callback_on_enable_filters

gboolean ui_callback_on_enable_filters(GtkWidget *widget, gpointer data)
{
    gboolean enabled;

    enabled = gtk_toggle_tool_button_get_active (GTK_TOGGLE_TOOL_BUTTON(ui_main_data.filters_enabled));
    gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON(ui_main_data.filters_enabled), !enabled);

    return TRUE;
}
开发者ID:2fumin,项目名称:EPC-openAir4G,代码行数:9,代码来源:ui_callbacks.c

示例11: XOJ_CHECK_TYPE_OBJ

void Sidebar::buttonClicked(GtkToolButton * toolbutton, SidebarPageButton * buttonData) {
	XOJ_CHECK_TYPE_OBJ(buttonData->sidebar, Sidebar);

	if (gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(toolbutton))) {
		if (buttonData->sidebar->visiblePage != buttonData->page->getWidget()) {
			buttonData->sidebar->setSelectedPage(buttonData->index);
		}
	} else if (buttonData->sidebar->visiblePage == buttonData->page->getWidget()) {
		gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(toolbutton), true);
	}
}
开发者ID:yolanother,项目名称:Xournal,代码行数:11,代码来源:Sidebar.cpp

示例12: UI_setAProcessToggleStatus

/**
	Set/unset the toggle button audio process
*/
void UI_setAProcessToggleStatus( uint8_t status )
{
gint b;
	 if(status) b=TRUE;
  	else			b=FALSE;

	if(b!=gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(guiAudioToggle)))
     		gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON(guiAudioToggle),b);
	aprintf("++ audio toggle : %d(%d)\n",b,status);

}
开发者ID:BackupTheBerlios,项目名称:avidemux-svn,代码行数:14,代码来源:GUI_bindings.cpp

示例13: Interface_iniciar

void Interface_iniciar() {
  GtkWidget *window;
  GdkGLConfig *glconfig;

  gtk_init(NULL, NULL);
  gtk_gl_init(NULL, NULL);


  GtkBuilder *builderPrincipal=Interface_carregarXML(INTERFACE_PRINCIPAL);
  window = GTK_WIDGET(gtk_builder_get_object (builderPrincipal, "window"));
  drawOpengl=GTK_WIDGET(gtk_builder_get_object(builderPrincipal, "drawOpengl"));
  frameProgresso=GTK_WIDGET(gtk_builder_get_object(builderPrincipal, "frameProgresso"));
  progress=GTK_PROGRESS_BAR(gtk_builder_get_object(builderPrincipal, "progressbar"));
  labelPosicaoXY=GTK_LABEL(gtk_builder_get_object(builderPrincipal, "labelPosicaoXY"));
  ajustScrollHorizGL=GTK_ADJUSTMENT(gtk_builder_get_object(builderPrincipal, "ajustScrollHorizGL"));
  ajustScrollVertGL=GTK_ADJUSTMENT(gtk_builder_get_object(builderPrincipal, "ajustScrollVertGL"));
  adjustAlpha=GTK_ADJUSTMENT(gtk_builder_get_object(builderPrincipal, "adjustAlpha"));
  tbAddEntidade=GTK_TOGGLE_TOOL_BUTTON(gtk_builder_get_object(builderPrincipal, "tbAddEntidade"));
  tbAddImagem=GTK_TOGGLE_TOOL_BUTTON(gtk_builder_get_object(builderPrincipal, "tbAddImagem"));
  tbAddTexto=GTK_TOGGLE_TOOL_BUTTON(gtk_builder_get_object(builderPrincipal, "tbAddTexto"));
  tbAmpliar=GTK_TOGGLE_TOOL_BUTTON(gtk_builder_get_object(builderPrincipal, "tbAmpliar"));
  tbReduzir=GTK_TOGGLE_TOOL_BUTTON(gtk_builder_get_object(builderPrincipal, "tbReduzir"));
  frameFerramentas=GTK_WIDGET(gtk_builder_get_object(builderPrincipal, "frameFerramentas"));

  /*gtk_adjustment_set_value(GTK_ADJUSTMENT(gtk_builder_get_object(builderPrincipal, "ajustScrollHorizGL")),500);
  gtk_adjustment_set_value(GTK_ADJUSTMENT(gtk_builder_get_object(builderPrincipal, "ajustScrollVertGL")),500);*/

  //Configura widget para opengl
  glconfig = gdk_gl_config_new_by_mode (GDK_GL_MODE_RGB    |
                                        GDK_GL_MODE_DEPTH  |
                                        GDK_GL_MODE_DOUBLE);

  if (!glconfig) {
      g_print ("*** Cannot find the double-buffered visual.\n");
      g_print ("*** Trying single-buffered visual.\n");

      /* Try single-buffered visual */
      glconfig = gdk_gl_config_new_by_mode (GDK_GL_MODE_RGB  | GDK_GL_MODE_DEPTH);
      if (!glconfig) {
          g_print ("*** No appropriate OpenGL-capable visual found.\n");
          g_assert_not_reached();
        }
    }

  if (!gtk_widget_set_gl_capability(drawOpengl, glconfig, NULL, TRUE, GDK_GL_RGBA_TYPE))
    g_assert_not_reached();

  gtk_builder_connect_signals(builderPrincipal, NULL);
  gtk_widget_show(window);

  g_object_unref(G_OBJECT(builderPrincipal));
}
开发者ID:laburb,项目名称:Morphometrics,代码行数:52,代码来源:interface.c

示例14: UI_setVProcessToggleStatus

/*
	Set/unset the toggle button video process
*/
void UI_setVProcessToggleStatus( uint8_t status )
{
gint b;
	 if(status) 		b=TRUE;
  	else			b=FALSE;
	if(b!=gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(guiVideoToggle)))
	{
     		gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON(guiVideoToggle),b);
		aprintf("Changing it to %d\n",b);
	}
	aprintf("++ video toggle : %d\n",b);

}
开发者ID:BackupTheBerlios,项目名称:avidemux-svn,代码行数:16,代码来源:GUI_bindings.cpp

示例15: modify_dice

/* Callback on dice press */
gint
modify_dice (GtkWidget * widget, gpointer data)
{
  DiceInfo *tmp = (DiceInfo *) data;
  GtkToggleToolButton *button = GTK_TOGGLE_TOOL_BUTTON (widget);

  /* Don't modify dice if player is marked finished or computer is playing */
  if (players[CurrentPlayer].finished || players[CurrentPlayer].comp) {
    if (gtk_toggle_tool_button_get_active (button))
      gtk_toggle_tool_button_set_active (button, FALSE);
    return TRUE;
  }

  if (NumberOfRolls >= NUM_ROLLS) {
    say (_("You are only allowed three rolls. Choose a score slot."));
    gtk_toggle_tool_button_set_active (button, FALSE);
    return TRUE;
  }

  tmp->sel = gtk_toggle_tool_button_get_active (button);

  UpdateAllDicePixmaps ();

  update_roll_button_sensitivity ();
  return TRUE;
}
开发者ID:bellau,项目名称:gnome-games,代码行数:27,代码来源:gyahtzee.c


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