Пример #1
0
Options::Options(clan::GUIManager &gui, clan::Rect gui_position) : clan::GUIComponent(&gui, clan::GUITopLevelDescription("Options", gui_position, false))
{
	// Note, when changing these, remember to change the popup menu defaults
	compare_function = clan::compare_greater;
	stencil_pass = clan::stencil_keep;
	stencil_fail = clan::stencil_incr;

	num_balls = 9;
	is_moveballs_set = true;
	is_circle_set = true;
	compare_reference = 1;

	int slider_xpos = 400;
	int slider_ypos = 250;
	int slider_gap = 24;
	slider_numballs = create_slider(slider_xpos, slider_ypos); slider_ypos += slider_gap;
	slider_ypos += 8;
	slider_numballs->set_max(9);
	slider_numballs->set_position(num_balls);
	slider_numballs->func_value_changed() = bind_member(this, &Options::slider_numballs_changed);
	slider_ypos += 8;
	label_numballs = create_slider_label(slider_numballs);

	slider_ypos += 8;
	slider_compare_reference = create_slider(slider_xpos, slider_ypos); slider_ypos += slider_gap;
	slider_ypos += 8;
	slider_compare_reference->set_max(16);
	slider_compare_reference->set_position(compare_reference);
	slider_compare_reference->func_value_changed() = bind_member(this, &Options::slider_compare_reference_changed);
	slider_ypos += 8;
	label_compare_reference = create_slider_label(slider_compare_reference);

	int checkbox_xpos = slider_xpos;
	int checkbox_ypos = slider_ypos;
	int checkbox_gap = 24;
	checkbox_moveballs = create_checkbox(checkbox_xpos, checkbox_ypos, "Moving Balls", is_moveballs_set);
	checkbox_moveballs->func_state_changed() = bind_member(this, &Options::checkbox_moveballs_changed);
	checkbox_ypos += checkbox_gap + 8;
	checkbox_circle = create_checkbox(checkbox_xpos, checkbox_ypos, "Draw Stencil Circle (Without selected stencil options)", is_circle_set);
	checkbox_circle->func_state_changed() = bind_member(this, &Options::checkbox_circle_changed);
	checkbox_ypos += checkbox_gap + 8;

	make_compare_menu(combo_compare_menu);
	combo_comparefunc = create_compare_combo_box(600, 40, combo_compare_menu, 3);
	label_comparefunc = create_combobox_label(combo_comparefunc, "Compare Function");

	make_passfail_menu(combo_pass_menu);
	combo_pass = create_passfail_combo_box(600, 80, combo_pass_menu, 0);
	label_pass = create_combobox_label(combo_pass, "Pass Operation");

	make_passfail_menu(combo_fail_menu);
	combo_fail = create_passfail_combo_box(600, 120, combo_fail_menu, 3);
	label_fail = create_combobox_label(combo_fail, "Fail Operation");

	update_all_slider_text();

	func_render() = bind_member(this, &Options::on_render);
}
Пример #2
0
static GtkWidget *p_create_frame_cache(struct LibravatarPrefsPage *page)
{
	GtkWidget *vbox, *checkbox, *spinner, *hbox;
	GtkAdjustment *adj;

	vbox =  gtk_vbox_new(FALSE, 6);

	checkbox = create_checkbox(_("_Use cached icons"),
				   _("Keep icons on disk for reusing instead "
				     "of making another network request"));
	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbox),
				     libravatarprefs.cache_icons);
	g_signal_connect(checkbox, "toggled",
			 G_CALLBACK(cache_icons_check_toggled_cb), NULL);
	page->cache_icons_check = checkbox;

	adj = (GtkAdjustment *) gtk_adjustment_new(
					libravatarprefs.cache_interval,
					INTERVAL_MIN_H, INTERVAL_MAX_H, 1.0,
					0.0, 0.0);
	spinner = gtk_spin_button_new(adj, 1.0, 0);
	gtk_widget_show(spinner);
	gtk_widget_set_sensitive(spinner, libravatarprefs.cache_icons);
	hbox = labeled_spinner_box(_("Cache refresh interval"), spinner, _("hours"), NULL);
	page->cache_interval_spin = spinner;

	gtk_box_pack_start(GTK_BOX(vbox), checkbox, FALSE, FALSE, 0);
	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);

	return vbox;
}
Пример #3
0
static GtkWidget *p_create_frame_network(struct LibravatarPrefsPage *page)
{
	GtkWidget *vbox, *chk_redirects, *spinner, *hbox;
	GtkAdjustment *adj;
#if (defined USE_GNUTLS && GLIB_CHECK_VERSION(2,22,0))
	GtkWidget *chk_federated;
#endif

	vbox =  gtk_vbox_new(FALSE, 6);

	chk_redirects = create_checkbox(_("_Allow redirects to other sites"),
				   _("Follow redirect responses received from "
				     "libravatar server to other avatar "
				     "services like gravatar.com"));
	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(chk_redirects),
				     libravatarprefs.allow_redirects);
	page->allow_redirects_check = chk_redirects;
	gtk_box_pack_start(GTK_BOX(vbox), chk_redirects, FALSE, FALSE, 0);

#if (defined USE_GNUTLS && GLIB_CHECK_VERSION(2,22,0))
	chk_federated = create_checkbox(_("_Enable federated servers"),
				_("Try to get avatar from sender's domain "
				  "libravatar server"));
	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(chk_federated),
				     libravatarprefs.allow_federated);
	page->allow_federated_check = chk_federated;
	gtk_box_pack_start(GTK_BOX(vbox), chk_federated, FALSE, FALSE, 0);
#endif

	adj = (GtkAdjustment *) gtk_adjustment_new(
					libravatarprefs.timeout,
					TIMEOUT_MIN_S,
					(prefs_common_get_prefs()->io_timeout_secs > 0)
					? (prefs_common_get_prefs()->io_timeout_secs - 1)
					: 0,
					1.0, 0.0, 0.0);
	spinner = gtk_spin_button_new(adj, 1.0, 0);
	gtk_widget_show(spinner);
	hbox = labeled_spinner_box(_("Request timeout"), spinner, _("seconds"),
		_("Set to 0 to use global socket I/O timeout. "
                  "Maximum value must be also less than global socket "
                  "I/O timeout."));
	page->timeout = spinner;
	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);

	return vbox;
}
Пример #4
0
void build_check(GUI* g)
{
  WIDGET* ch1=NULL;
  WIDGET* ch2=NULL;
  WIDGET* ch3=NULL;

  ch1=create_checkbox("Checkbox",10,80);
  ch2=create_checkbox("Disabled Checkbox",120,80);
  set_checkbox_enable(ch2,0);
  ch3=create_checkbox("Fancy Checkbox",320,80);
  set_checkbox_text_color(ch3,0x000000FF);
  set_checkbox_check_color(ch3,0x00FF0000);

  add_to_main(g,ch1);
  add_to_main(g,ch2);
  add_to_main(g,ch3);
}
Пример #5
0
static GtkWidget *p_create_frame_cache(struct LibravatarPrefsPage *page)
{
	GtkWidget *vbox, *checkbox, *spinner, *hbox, *label, *button;
	GtkAdjustment *adj;
	AvatarCacheStats *stats;
	gchar *markup;

	vbox =  gtk_vbox_new(FALSE, 6);

	checkbox = create_checkbox(_("_Use cached icons"),
				   _("Keep icons on disk for reusing instead "
				     "of making another network request"));
	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbox),
				     libravatarprefs.cache_icons);
	g_signal_connect(checkbox, "toggled",
			 G_CALLBACK(cache_icons_check_toggled_cb), NULL);
	page->cache_icons_check = checkbox;

	adj = (GtkAdjustment *) gtk_adjustment_new(
					libravatarprefs.cache_interval,
					INTERVAL_MIN_H, INTERVAL_MAX_H, 1.0,
					0.0, 0.0);
	spinner = gtk_spin_button_new(adj, 1.0, 0);
	gtk_widget_show(spinner);
	gtk_widget_set_sensitive(spinner, libravatarprefs.cache_icons);
	hbox = labeled_spinner_box(_("Cache refresh interval"), spinner, _("hours"), NULL);
	page->cache_interval_spin = spinner;

	gtk_box_pack_start(GTK_BOX(vbox), checkbox, FALSE, FALSE, 0);
	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);

	label = gtk_label_new(NULL);
	gtk_widget_show(label);
	stats = libravatar_cache_stats();
	markup = avatar_stats_label_markup(stats);
	gtk_label_set_markup(GTK_LABEL(label), markup);
	g_free(markup);
	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);

	button = gtk_button_new_from_stock(GTK_STOCK_CLEAR);
	gtk_widget_show(button);
	g_signal_connect(button, "clicked",
		G_CALLBACK(cache_clean_button_clicked_cb), label);
	gtk_widget_set_sensitive(button, (stats != NULL && stats->bytes > 0));

	hbox = gtk_hbox_new(FALSE, 6);
	gtk_widget_show(hbox);
	gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
	gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);

	if (stats != NULL)
		g_free(stats);

	return vbox;
}
Пример #6
0
Options::Options(clan::Canvas &canvas) : clan::TextureWindow(canvas)
{
	// Note, when changing these, remember to change the popup menu defaults
	current_mapmode = clan::map_2d_upper_left;
	num_balls = 3;
	grid_angle = 0;
	is_moveballs_set = true;

	int slider_xpos = 450;
	int slider_label_xpos = slider_xpos + 200;
	int slider_ypos = 100;
	int slider_gap = 24;
	slider_numballs = create_slider(slider_xpos, slider_ypos);
	slider_numballs->set_max_position(9);
	slider_numballs->set_position(num_balls);
	slider_numballs->func_value_changed() = bind_member(this, &Options::slider_numballs_changed);
	label_numballs = create_slider_label(slider_label_xpos, slider_ypos);
	slider_ypos += slider_gap;

	slider_grid_angle = create_slider(slider_xpos, slider_ypos);
	slider_grid_angle->set_min_position(-45);
	slider_grid_angle->set_max_position(90);
	slider_grid_angle->set_position(grid_angle);
	slider_grid_angle->func_value_changed() = bind_member(this, &Options::slider_grid_angle_changed);
	label_grid_angle = create_slider_label(slider_label_xpos, slider_ypos);
	slider_ypos += slider_gap;

	int checkbox_xpos = slider_xpos;
	int checkbox_ypos = slider_ypos;
	int checkbox_gap = 24;
	checkbox_moveballs = create_checkbox(checkbox_xpos, checkbox_ypos, "Moving Balls", is_moveballs_set);
	checkbox_moveballs->func_state_changed() = bind_member(this, &Options::checkbox_moveballs_changed);

	listbox_mapmode = Theme::create_listbox();
	listbox_mapmode->style()->set("position: absolute; left:%1px; top:%2px; width:%3px; height:auto;", checkbox_xpos, 10, 180);

	listbox_mapmode->set_items<std::string>( { "2d Upper Left", "2d Lower Left", "User Projection" }, Theme::create_listbox_label);

	listbox_mapmode->func_selection_changed() = bind_member(this, &Options::on_mapmode_selected);
	listbox_mapmode->set_selected_item(0);
	add_subview(listbox_mapmode);

	label_mapmode = Theme::create_label(true);
	add_subview(label_mapmode);
	label_mapmode->style()->set("position: absolute; left:%1px; top:%2px", slider_label_xpos, 10);
	label_mapmode->set_text("Map Mode");

	update_all_slider_text();
}
Пример #7
0
Options::Options(clan::GUIManager &gui, clan::Rect gui_position) : clan::GUIComponent(&gui, clan::GUITopLevelDescription("Options", gui_position, false))
{
	// Note, when changing these, remember to change the popup menu defaults
	current_mapmode = clan::map_2d_upper_left;
	num_balls = 3;
	grid_angle = 0;
	is_moveballs_set = true;

	int slider_xpos = 450;
	int slider_ypos = 100;
	int slider_gap = 24;
	slider_numballs = create_slider(slider_xpos, slider_ypos); slider_ypos += slider_gap;
	slider_ypos += 8;
	slider_numballs->set_max(9);
	slider_numballs->set_position(num_balls);
	slider_numballs->func_value_changed().set(this, &Options::slider_numballs_changed);
	slider_ypos += 8;
	label_numballs = create_slider_label(slider_numballs);

	slider_grid_angle = create_slider(slider_xpos, slider_ypos); slider_ypos += slider_gap;
	slider_ypos += 8;
	slider_grid_angle->set_min(-45);
	slider_grid_angle->set_max(90);
	slider_grid_angle->set_position(grid_angle);
	slider_grid_angle->func_value_changed().set(this, &Options::slider_grid_angle_changed);
	slider_ypos += 8;
	label_grid_angle = create_slider_label(slider_grid_angle);

	int checkbox_xpos = slider_xpos;
	int checkbox_ypos = slider_ypos;
	int checkbox_gap = 24;
	checkbox_moveballs = create_checkbox(checkbox_xpos, checkbox_ypos, "Moving Balls", is_moveballs_set);
	checkbox_moveballs->func_state_changed().set(this, &Options::checkbox_moveballs_changed);

	make_mapmode_menu(combo_mapmode_menu);
	combo_mapmode = create_mapmode_combo_box(450, 40, combo_mapmode_menu, 0);
	label_mapmode = create_combobox_label(combo_mapmode, "Map Mode");

	update_all_slider_text();

	func_render().set(this, &Options::on_render);
}
Пример #8
0
/**************************************************************************
  ...
**************************************************************************/
struct widget * create_textcheckbox(struct gui_layer *pDest, bool state,
		  SDL_String16 *pStr, Uint32 flags)
{
  struct widget *pCBox;
  struct CHECKBOX *pTmp;
  SDL_Surface *pSurf, *pIcon;
  struct widget *pTmpWidget;

  if (!pStr) {
    return create_checkbox(pDest, state, flags);
  }
  
  pTmp = fc_calloc(1, sizeof(struct CHECKBOX));
    
  if (state) {
    pSurf = pTheme->CBOX_Sell_Icon;
  } else {
    pSurf = pTheme->CBOX_Unsell_Icon;
  }
    
  pIcon = create_icon_from_theme(pSurf, 0);
  pCBox = create_iconlabel(pIcon, pDest, pStr, (flags | WF_FREE_PRIVATE_DATA));

  pStr->style &= ~SF_CENTER;

  pCBox->theme = pSurf;
  FREESURFACE(pIcon);

  set_wtype(pCBox, WT_TCHECKBOX);
  pTmp->state = state;
  pTmp->pTRUE_Theme = pTheme->CBOX_Sell_Icon;
  pTmp->pFALSE_Theme = pTheme->CBOX_Unsell_Icon;
  pCBox->private_data.cbox = pTmp;

  pTmpWidget = widget_new();
  /* we can't use pCBox->redraw here, because it is of type iconlabel */
  textcheckbox_baseclass_redraw = pTmpWidget->redraw;
  FREEWIDGET(pTmpWidget);
  pCBox->redraw = redraw_textcheckbox;
  
  return pCBox;
}
Пример #9
0
void iAmpPluginDlg::init()
{
    CKXPluginGUI::init();
    // custom dialog initialization here...

    // create_dialog(Caption, Width, Height, ExtraHeight = 25)
    create_dialog(plugin_name(amp), 300, 120);

    // create_hfader(Fader, Ctrl_ID, Label, MinVal, MaxVal, Left, Top, Width, Label_Width)
    create_hfader(left,  LEFT_LEVEL_ID,  "Left (dB):" ,-600,600, 7, 12, 310, 110);
    create_hfader(right, RIGHT_LEVEL_ID, "Right (dB):",-600,600, 7, 48, 310, 110);
    left.slider.set_tic_freq(120);
    right.slider.set_tic_freq(120);

    // SHOW_CHECKBOX(CheckBox, Ctrl_ID, Caption, Left, Top, Width)
    create_checkbox(chkLock, LOCK_ID, "Lock", 30, 94, 80);

    controls_enabled = TRUE;

    sync(EVERYPM_ID);
}
Пример #10
0
void iAPSExpPlusPluginDlg::init()
{
	CKXPluginGUI::init();
	// custom dialog initialization here...

	// create_dialog(Caption, Width, Height, ExtraHeight)
	create_dialog(plugin_name(apsexp_plus), 300, 260); //w=275

	// create_hfader(Fader, Ctrl_ID, Label, MinVal, MaxVal, Left, Top, Width, Label_Width)
	create_hfader(fdrAttackTime, ATTACK_TIME_ID, "Attack Time (ms):",0,500, 7, 12, 283, 110); // fader must be declared with plugin dialog class
	create_hfader(fdrReleaseTime, RELEASE_TIME_ID, "Release Time (ms):",50,3000, 7, 48, 283, 110);
	create_hfader(fdrThreshold, POST_GAIN_ID, "Ouput Gain (dB):",-60,60, 7, 84, 283, 110);
	create_hfader(fdrRatio, THRESHOLD_ID, "Threshold (dB):", -60, 0, 7, 120, 283, 110);	
	create_hfader(fdrPostGain, RATIO_ID, "Ratio:", 1, 100, 7, 156, 283, 110);
	create_hfader(fdrPreDelay, PREDELAY_ID, "PreDelay (ms)", 0, 40, 7, 192, 283, 110);
	create_checkbox(sidechain, SIDECHAIN_ID, "  Toggle Side Chain", 40, 228, 180);

	controls_enabled = TRUE;

	sync(EVERYPM_ID);
}
Пример #11
0
Options::Options(clan::GUIManager &gui, clan::Rect gui_position) : clan::GUIComponent(&gui, clan::GUITopLevelDescription("Options", gui_position, false))
{
	is_normals_set = false;
	sized_format = clan::tf_rgb8;
	dimension = perlin_2d;
	amplitude = 1.0;
	width = 256;
	height = 256;
	octaves = 1;

	start_x = 0.0f;
	length_x = 32.0f;
	start_y = 0.0f;
	length_y = 32.0f;
	position_z = 0.0f;
	position_w = 0.0f;

	make_format_menu(combo_format_menu);
	combo_format = create_format_combo_box(450, 30, combo_format_menu, 0);
	label_format = create_combobox_label(combo_format, "Pixel Format");

	checkbox_normals = create_checkbox(640, 35, "Draw Normals (rgb only)", is_normals_set);
	checkbox_normals->func_state_changed().set(this, &Options::checkbox_normals_changed);

	make_dimension_menu(combo_dimension_menu);
	combo_dimension = create_dimension_combo_box(450, 80, combo_dimension_menu, 0);
	combo_dimension->set_selected_item(1);
	label_dimension = create_combobox_label(combo_dimension, "Dimension");

	int slider_xpos = 450;
	int slider_ypos = 120;
	int slider_gap = 20;

	slider_width = create_slider(slider_xpos, slider_ypos); slider_ypos += slider_gap;
	slider_ypos += 8;
	slider_width->set_min(32);
	slider_width->set_max(382);
	slider_width->set_position(width);
	slider_width->func_value_changed().set(this, &Options::slider_width_changed);
	slider_ypos += 8;
	label_width = create_slider_label(slider_width);

	slider_height = create_slider(slider_xpos, slider_ypos); slider_ypos += slider_gap;
	slider_ypos += 8;
	slider_height->set_min(32);
	slider_height->set_max(382);
	slider_height->set_position(height);
	slider_height->func_value_changed().set(this, &Options::slider_height_changed);
	slider_ypos += 8;
	label_height = create_slider_label(slider_height);

	slider_octaves = create_slider(slider_xpos, slider_ypos); slider_ypos += slider_gap;
	slider_ypos += 8;
	slider_octaves->set_min(1);
	slider_octaves->set_max(9);
	slider_octaves->set_page_step(1);
	slider_octaves->set_position(octaves);
	slider_octaves->func_value_changed().set(this, &Options::slider_octaves_changed);
	slider_ypos += 8;
	label_octaves = create_slider_label(slider_octaves);

	slider_amplitude = create_slider(slider_xpos, slider_ypos); slider_ypos += slider_gap;
	slider_ypos += 8;
	set_value(slider_amplitude, amplitude, MAX_AMPLITUDE);
	slider_amplitude->func_value_changed().set(this, &Options::slider_amplitude_changed);
	slider_ypos += 8;
	label_amplitude = create_slider_label(slider_amplitude);

	slider_start_x = create_slider(slider_xpos, slider_ypos); slider_ypos += slider_gap;
	slider_ypos += 8;
	set_value(slider_start_x, start_x, MAX_POSITION);
	slider_start_x->func_value_changed().set(this, &Options::slider_start_x_changed);
	slider_ypos += 8;
	label_start_x = create_slider_label(slider_start_x);

	slider_length_x = create_slider(slider_xpos, slider_ypos); slider_ypos += slider_gap;
	slider_ypos += 8;
	set_value(slider_length_x, length_x, MAX_LENGTH);
	slider_length_x->func_value_changed().set(this, &Options::slider_length_x_changed);
	slider_ypos += 8;
	label_length_x = create_slider_label(slider_length_x);

	slider_start_y = create_slider(slider_xpos, slider_ypos); slider_ypos += slider_gap;
	slider_ypos += 8;
	set_value(slider_start_y, start_y, MAX_POSITION);
	slider_start_y->func_value_changed().set(this, &Options::slider_start_y_changed);
	slider_ypos += 8;
	label_start_y = create_slider_label(slider_start_y);

	slider_length_y = create_slider(slider_xpos, slider_ypos); slider_ypos += slider_gap;
	slider_ypos += 8;
	set_value(slider_length_y, length_y, MAX_LENGTH);
	slider_length_y->func_value_changed().set(this, &Options::slider_length_y_changed);
	slider_ypos += 8;
	label_length_y = create_slider_label(slider_length_y);

	slider_position_z = create_slider(slider_xpos, slider_ypos); slider_ypos += slider_gap;
	slider_ypos += 8;
	set_value(slider_position_z, position_z, MAX_POSITION);
	slider_position_z->func_value_changed().set(this, &Options::slider_position_z_changed);
	slider_ypos += 8;
	label_position_z = create_slider_label(slider_position_z);

	slider_position_w = create_slider(slider_xpos, slider_ypos); slider_ypos += slider_gap;
	slider_ypos += 8;
	set_value(slider_position_w, position_w, MAX_POSITION);
	slider_position_w->func_value_changed().set(this, &Options::slider_position_w_changed);
	slider_ypos += 8;
	label_position_w = create_slider_label(slider_position_w);


	update_all_slider_text();

	func_render().set(this, &Options::on_render);
}
Пример #12
0
Options::Options(CL_GUIManager &gui, CL_Rect gui_position) : CL_GUIComponent(&gui, CL_GUITopLevelDescription("Options", gui_position, false))
{
	// If you change these, you also need to change the default selected combobox item
	blendfunc[0] = cl_blend_src_alpha;
	blendfunc[1] = cl_blend_one_minus_src_alpha;
	blendfunc[2] = cl_blend_src_alpha;
	blendfunc[3] = cl_blend_one_minus_src_alpha;
	blendequation[0] = cl_blend_equation_add;
	blendequation[1] = cl_blend_equation_add;
	logic_operation = cl_logic_op_set;
	logic_operation_enabled = false;

	primary_color = CL_Colorf::white;
	blend_color = CL_Colorf::white;
	num_balls = 4;
	is_premult_alpha_set = false;
	is_moveballs_set = true;
	is_blending_set = true;

	int slider_xpos = 400;
	int slider_ypos = 200;
	int slider_gap = 24;
	slider_numballs = create_slider(slider_xpos, slider_ypos); slider_ypos += slider_gap;
	slider_ypos += 8;
	slider_numballs->set_max(9);
	slider_numballs->set_position(4);
	slider_numballs->func_value_changed().set(this, &Options::slider_numballs_changed);
	slider_primary_red = create_slider(slider_xpos, slider_ypos); slider_ypos += slider_gap;
	slider_primary_red->func_value_changed().set(this, &Options::slider_primary_red_changed);
	slider_primary_green = create_slider(slider_xpos, slider_ypos); slider_ypos += slider_gap;
	slider_primary_green->func_value_changed().set(this, &Options::slider_primary_green_changed);
	slider_primary_blue = create_slider(slider_xpos, slider_ypos); slider_ypos += slider_gap;
	slider_primary_blue->func_value_changed().set(this, &Options::slider_primary_blue_changed);
	slider_primary_alpha = create_slider(slider_xpos, slider_ypos); slider_ypos += slider_gap;
	slider_primary_alpha->func_value_changed().set(this, &Options::slider_primary_alpha_changed);
	slider_ypos += 8;
	slider_blend_red = create_slider(slider_xpos, slider_ypos); slider_ypos += slider_gap;
	slider_blend_red->func_value_changed().set(this, &Options::slider_blend_red_changed);
	slider_blend_green = create_slider(slider_xpos, slider_ypos); slider_ypos += slider_gap;
	slider_blend_green->func_value_changed().set(this, &Options::slider_blend_green_changed);
	slider_blend_blue = create_slider(slider_xpos, slider_ypos); slider_ypos += slider_gap;
	slider_blend_blue->func_value_changed().set(this, &Options::slider_blend_blue_changed);
	slider_blend_alpha = create_slider(slider_xpos, slider_ypos); slider_ypos += slider_gap;
	slider_blend_alpha->func_value_changed().set(this, &Options::slider_blend_alpha_changed);
	slider_ypos += 8;
	label_numballs = create_slider_label(slider_numballs);
	label_primary_red = create_slider_label(slider_primary_red);
	label_primary_green = create_slider_label(slider_primary_green);
	label_primary_blue = create_slider_label(slider_primary_blue);
	label_primary_alpha = create_slider_label(slider_primary_alpha);
	label_blend_red = create_slider_label(slider_blend_red);
	label_blend_green = create_slider_label(slider_blend_green);
	label_blend_blue = create_slider_label(slider_blend_blue);
	label_blend_alpha = create_slider_label(slider_blend_alpha);

	int checkbox_xpos = slider_xpos;
	int checkbox_ypos = slider_ypos;
	int checkbox_gap = 24;
	checkbox_moveballs = create_checkbox(checkbox_xpos, checkbox_ypos, "Moving Balls", is_moveballs_set);
	checkbox_moveballs->func_state_changed().set(this, &Options::checkbox_moveballs_changed);
	checkbox_blending = create_checkbox(checkbox_xpos + 150, checkbox_ypos, "Enable Blending", is_blending_set);
	checkbox_blending->func_state_changed().set(this, &Options::checkbox_blending_changed);
	checkbox_premult_alpha = create_checkbox(checkbox_xpos + 300, checkbox_ypos, "Use Premultipied Alpha", is_premult_alpha_set);
	checkbox_premult_alpha->func_state_changed().set(this, &Options::checkbox_premult_alpha_changed);
	checkbox_ypos += checkbox_gap + 8;

	make_equation_menu(combo_color_equation_menu);
	make_equation_menu(combo_alpha_equation_menu);
	combo_color_equation = create_equation_combo_box(400, 40, combo_color_equation_menu, 0);
	combo_alpha_equation = create_equation_combo_box(550, 40, combo_alpha_equation_menu, 0);
	label_color = create_combobox_label(combo_color_equation, "COLOR EQUATION");
	label_alpha = create_combobox_label(combo_alpha_equation, "ALPHA EQUATION");

	make_logic_menu(combo_logic_menu);
	combo_logic = create_logic_combo_box(700, 40, combo_logic_menu, 0);
	label_logic = create_combobox_label(combo_logic, "LOGIC OPERATION");

	make_blend_menu(combo_src_blend_menu);
	make_blend_menu(combo_dest_blend_menu);
	make_blend_menu(combo_src_alpha_blend_menu);
	make_blend_menu(combo_dest_alpha_blend_menu);
	combo_src_blend = create_blend_combo_box(410, 100, combo_src_blend_menu, 6);
	label_src = create_combobox_label(combo_src_blend, "SOURCE FUNCTION");
	combo_dest_blend = create_blend_combo_box(610, 100, combo_dest_blend_menu, 7);
	label_dest = create_combobox_label(combo_dest_blend, "DEST FUNCTION");
	combo_src_alpha_blend = create_blend_combo_box(410, 160, combo_src_alpha_blend_menu, 6);
	label_src_alpha = create_combobox_label(combo_src_alpha_blend, "SOURCE ALPHA FUNCTION");
	combo_dest_alpha_blend = create_blend_combo_box(610, 160, combo_dest_alpha_blend_menu, 7);
	label_dest_alpha = create_combobox_label(combo_dest_alpha_blend, "DEST ALPHA FUNCTION");

	update_all_slider_text();

	func_render().set(this, &Options::on_render);
}
Пример #13
0
void iRevPluginDlg::init()
{
	    // skin status:
        // ------------------------
        // mf=this.kxl [if exists]
        // mf.next=[attached]=kX Mixer's mf
        // mf.priority=1; this.kxl is accessed first

        // process kxefx.kxs now
        TCHAR tmp_str[MAX_PATH];
        efx_skin.get_full_skin_path(_T("kxefx.kxs"),tmp_str);
        efx_skin.set_skin(tmp_str);
        mf.attach_skin(&efx_skin);
        efx_skin.attach_skin(kxmixer_skin);
        efx_skin.set_attach_priority(1);

        // skin status:
        // -------------------------
        // [1] mf=this.kxl
        // [2] mf.next=efx_skin
        // [3] efx_skin=kxefx.kxs
        // [4] efx_skin.next=kxmixer skin
        // [1,2,3,4] -- access order

        CKXPluginGUI::init(); // this is necessary
        // init() should be called -after- skin initialization

//-----------------------------------------------------------------------------------------------
// custom dialog initialization here...
// (title, Width, Height)
create_dialog(plugin_name(rev), 250, 120);
grpbox.hide();//hide useless GUI elements
w_label.hide();

    
    /*LCDs*/
    
    count_inlev.Create("",WS_VISIBLE|SS_NOTIFY,CRect(CPoint(65,96),CSize(29,18)), this);
	//count_inlev.SetID(COUNT_INLEV);
	count_inlev.SetBlankPadding(3);//празни полета от ляво
	count_inlev.SetColours(RGB(255,255,255), RGB(0,0,100), RGB(0,0,150));//цифри, блат, слайдер
	count_inlev.SetColourFaded(RGB(98,98,135));
	count_inlev.SetAllowInteraction(false);//не може да се настройва
	count_inlev.SetDraw3DBar(false);//без слайдър
	count_inlev.DisplayInt(true);

	count_erlev.Create("",WS_VISIBLE|SS_NOTIFY,CRect(CPoint(316,96),CSize(29,18)), this);
	//count_erlev.SetID(COUNT_ERLEV);
	count_erlev.SetBlankPadding(3);//празни полета от ляво
	count_erlev.SetColours(RGB(255,255,255), RGB(100,80,0), RGB(0,0,150));//цифри, блат, слайдер
	count_erlev.SetColourFaded(RGB(135,126,98));
	count_erlev.SetAllowInteraction(false);//не може да се настройва
	count_erlev.SetDraw3DBar(false);//без слайдър
	count_erlev.DisplayInt(true);

	count_revlev.Create("",WS_VISIBLE|SS_NOTIFY,CRect(CPoint(407,96),CSize(29,18)), this);
	//count_revlev.SetID(COUNT_REVLEV);
	count_revlev.SetBlankPadding(3);//празни полета от ляво
	count_revlev.SetColours(RGB(255,255,255), RGB(0,0,0), RGB(0,0,150));//цифри, блат, слайдер
	count_revlev.SetColourFaded(RGB(98,98,135));
	count_revlev.SetAllowInteraction(false);//не може да се настройва
    count_revlev.SetDraw3DBar(false);//без слайдър
	count_revlev.DisplayInt(true);

	count_drylev.Create("",WS_VISIBLE|SS_NOTIFY,CRect(CPoint(496,96),CSize(29,18)), this);
	//count_drylev.SetID(COUNT_DRYLEV);
	count_drylev.SetBlankPadding(3);//празни полета от ляво
	count_drylev.SetColours(RGB(255,255,255), RGB(100,0,0), RGB(0,0,150));//цифри, блат, слайдер
	count_drylev.SetColourFaded(RGB(135,98,98));
	count_drylev.SetAllowInteraction(false);//не може да се настройва
	count_drylev.SetDraw3DBar(false);//без слайдър
	count_drylev.DisplayInt(true);
	
	count_band.Create("",WS_VISIBLE|SS_NOTIFY,CRect(CPoint(167,97),CSize(44,15)), this);
	//count_band.SetID(COUNT_BAND);
	count_band.SetBlankPadding(5);//празни полета от ляво
	count_band.SetColours(RGB(255,255,255), RGB(0,0,100), RGB(0,0,150));//цифри, блат, слайдер
	count_band.SetColourFaded(RGB(98,98,135));
	count_band.SetAllowInteraction(false);//не може да се настройва
	count_band.SetDraw3DBar(false);//без слайдър
	count_band.DisplayInt(true);

	count_pre.Create("",WS_VISIBLE|SS_NOTIFY,CRect(CPoint(65,176),CSize(29,18)), this);
	//count_pre.SetID(COUNT_PRE);
	count_pre.SetBlankPadding(3);//празни полета от ляво
	count_pre.SetColours(RGB(255,255,255), RGB(0,0,100), RGB(0,0,0));//цифри, блат, слайдер
	count_pre.SetColourFaded(RGB(98,98,135));
	count_pre.SetAllowInteraction(false);//не може да се настройва
	count_pre.SetDraw3DBar(false);//без слайдър
	count_pre.DisplayInt(true);

	count_decay.Create("",WS_VISIBLE|SS_NOTIFY,CRect(CPoint(169,177),CSize(44,15)), this);
	//count_decay.SetID(COUNT_DECAY);
	count_decay.SetBlankPadding(5);//празни полета от ляво
	count_decay.SetColours(RGB(255,255,255), RGB(0,0,100), RGB(0,0,0));//цифри, блат, слайдер
	count_decay.SetColourFaded(RGB(98,98,135));
	count_decay.SetAllowInteraction(false);//не може да се настройва
	count_decay.SetDraw3DBar(false);//без слайдър
	count_decay.DisplayInt(true);

	count_outlev.Create("",WS_VISIBLE|SS_NOTIFY,CRect(CPoint(387,256),CSize(29,18)), this);
	//count_outlev.SetID(COUNT_OUTLEV);
	count_outlev.SetBlankPadding(3);//празни полета от ляво
	count_outlev.SetColours(RGB(255,255,255), RGB(0,0,100), RGB(0,0,0));//цифри, блат, слайдер
	count_outlev.SetColourFaded(RGB(98,98,135));
	count_outlev.SetAllowInteraction(false);//не може да се настройва
	count_outlev.SetDraw3DBar(false);//без слайдър
	count_outlev.DisplayInt(true);

	
	/*for loading the bitmap frames for the knobs*///valid for filenames kx.bmp (e.g. k1.bmp
	for(i=0;i<FRAMES;i++){                        //k2.bmp, k3.bmp etc.) 
	   sprintf(filename, "k%d.bmp", i+1);         //
       bitmaps[i] = mf.load_image(filename);      //
	}                                             //
   /*end*///////////////////////////////////////////

   /*Knobs*/

	knob_inlev.SetBitmaps(bitmaps);
	knob_inlev.Create("",WS_CHILD| WS_VISIBLE|SS_NOTIFY, CRect(CPoint(15,85),CSize(40,40)), this);
    knob_inlev.SetID(INLEV);
	knob_inlev.SetPos(plugin->_params[INLEV]);
	
	knob_erlev.SetBitmaps(bitmaps);
	knob_erlev.Create("",WS_CHILD| WS_VISIBLE|SS_NOTIFY, CRect(CPoint(265,85),CSize(40,40)), this);
    knob_erlev.SetID(ERLEV);
	knob_erlev.SetPos(plugin->_params[ERLEV]);

	knob_revlev.SetBitmaps(bitmaps);
	knob_revlev.Create("",WS_CHILD| WS_VISIBLE|SS_NOTIFY, CRect(CPoint(355,85),CSize(40,40)), this);
    knob_revlev.SetID(REVLEV);
	knob_revlev.SetPos(plugin->_params[REVLEV]);
	
    knob_drylev.SetBitmaps(bitmaps);
	knob_drylev.Create("",WS_CHILD| WS_VISIBLE|SS_NOTIFY, CRect(CPoint(445,85),CSize(40,40)), this);
    knob_drylev.SetID(DRYLEV);
    knob_drylev.SetPos(plugin->_params[DRYLEV]);

	knob_band.SetBitmaps(bitmaps);
	knob_band.Create("",WS_CHILD| WS_VISIBLE|SS_NOTIFY, CRect(CPoint(116,85),CSize(40,40)), this);
    knob_band.SetID(BAND);
	knob_band.SetPos(plugin->_params[BAND]);
	
    knob_pre.SetBitmaps(bitmaps);
	knob_pre.Create("",WS_CHILD| WS_VISIBLE|SS_NOTIFY, CRect(CPoint(15,165),CSize(40,40)), this);
    knob_pre.SetID(PRE);
	knob_pre.SetPos(plugin->_params[PRE]);

	knob_decay.SetBitmaps(bitmaps);
	knob_decay.Create("",WS_CHILD| WS_VISIBLE|SS_NOTIFY, CRect(CPoint(116,165),CSize(40,40)), this);
	knob_decay.SetID(DECAY);
	knob_decay.SetPos(plugin->_params[DECAY]);
	
    knob_diff.SetBitmaps(bitmaps);
	knob_diff.Create("",WS_CHILD| WS_VISIBLE|SS_NOTIFY, CRect(CPoint(362,165),CSize(40,40)), this);
    knob_diff.SetID(DIFF);
	knob_diff.SetPos(plugin->_params[DIFF]);

	knob_damp.SetBitmaps(bitmaps);
	knob_damp.Create("",WS_CHILD| WS_VISIBLE|SS_NOTIFY, CRect(CPoint(287,165),CSize(40,40)), this);
    knob_damp.SetID(DAMP);
	knob_damp.SetPos(plugin->_params[DAMP]);

    knob_outlev.SetBitmaps(bitmaps);
	knob_outlev.Create("",WS_CHILD| WS_VISIBLE|SS_NOTIFY, CRect(CPoint(335,245),CSize(40,40)), this);
    knob_outlev.SetID(OUTLEV);
	knob_outlev.SetPos(plugin->_params[OUTLEV]);

	/////////////////////////////////////////////////////////////

	knob_tap1.SetBitmaps(bitmaps);
	knob_tap1.Create("",WS_CHILD| WS_VISIBLE|SS_NOTIFY, CRect(CPoint(17,255),CSize(40,40)), this);
    knob_tap1.SetID(TAP1);
	knob_tap1.SetPos(plugin->_params[TAP1]);

	knob_tap2.SetBitmaps(bitmaps);
	knob_tap2.Create("",WS_CHILD| WS_VISIBLE|SS_NOTIFY, CRect(CPoint(62,255),CSize(40,40)), this);
    knob_tap2.SetID(TAP2);
	knob_tap2.SetPos(plugin->_params[TAP2]);

	knob_tap3.SetBitmaps(bitmaps);
	knob_tap3.Create("",WS_CHILD| WS_VISIBLE|SS_NOTIFY, CRect(CPoint(107,255),CSize(40,40)), this);
    knob_tap3.SetID(TAP3);
	knob_tap3.SetPos(plugin->_params[TAP3]);

	knob_tap4.SetBitmaps(bitmaps);
	knob_tap4.Create("",WS_CHILD| WS_VISIBLE|SS_NOTIFY, CRect(CPoint(152,255),CSize(40,40)), this);
    knob_tap4.SetID(TAP4);
	knob_tap4.SetPos(plugin->_params[TAP4]);

	knob_tap5.SetBitmaps(bitmaps);
	knob_tap5.Create("",WS_CHILD| WS_VISIBLE|SS_NOTIFY, CRect(CPoint(197,255),CSize(40,40)), this);
    knob_tap5.SetID(TAP5);
	knob_tap5.SetPos(plugin->_params[TAP5]);

	knob_tap6.SetBitmaps(bitmaps);
	knob_tap6.Create("",WS_CHILD| WS_VISIBLE|SS_NOTIFY, CRect(CPoint(242,255),CSize(40,40)), this);
    knob_tap6.SetID(TAP6);
	knob_tap6.SetPos(plugin->_params[TAP6]);


    /*Checkboxes*/
	
	led_pre_x10.set_bitmaps(
		mf.load_image("led_off.bmp"),
		mf.load_image("led_off.bmp"),
		mf.load_image("led_on.bmp"),
		mf.load_image("led_on.bmp"));
	create_checkbox	(led_pre_x10, LED_PRE_X10, "", 56, 183, 150); 
	led_pre_x10.set_method(kMETHOD_TRANS);

	led_decay_x10.set_bitmaps(
		mf.load_image("led_off.bmp"),
		mf.load_image("led_off.bmp"),
		mf.load_image("led_on.bmp"),
		mf.load_image("led_on.bmp"));
	create_checkbox	(led_decay_x10, LED_DECAY_X10, "", 170, 183, 150); 
	led_decay_x10.set_method(kMETHOD_TRANS);

	
	/*VU meter*/
	
	vumeter.set_bitmaps(
		 mf.load_image("vu_off.bmp"),
		 mf.load_image("vu_on.bmp"));
	vumeter.create(rev_name, 484, 161,this,1);
	vumeter.show();

	turn_on(1);
	redraw();
	

	controls_enabled = 1; // enable updating GUI when the parameters are changed

	sync(EVERYPM_ID); // update all 'GUI' elements to the preset plugin parameters
}
Пример #14
0
// Plugin GUI init
//----------------------------------------------------------------------
void iMixyPluginDlg::init()
{
	
	CKXPluginGUI::init();
	smallfont.CreatePointFont(70,"Tahoma"); // creates a small font	
	// custom dialog window  (title, Width, Height)
	create_dialog(plugin_name(mixy), 980, 460);

	for(int i=1; i<10; i++)
	{
		vu[-1+i]=new kPeak;

	// load  bitmaps here 
		switch(plugin->_params[44+i])	
		{	 
		case 0 :	 
			vu[-1+i]->set_bitmaps(mf.load_image(("my0-24.jpg")),mf.load_image(("my0-24h.jpg")));	 
			break;	 
		case 1 :	 
			vu[-1+i]->set_bitmaps(mf.load_image(("my0-60.jpg")),mf.load_image(("my0-60h.jpg")));	 
			break;	 
		case 2 :	 
			vu[-1+i]->set_bitmaps(mf.load_image(("my0-90.jpg")),mf.load_image(("my0-90h.jpg")));	 
			break;	 
		case 3 :	 
			vu[-1+i]->set_bitmaps(mf.load_image(("my0-120.jpg")),mf.load_image(("my0-120h.jpg")));	 
			break;	 
		case 4 :	 
			vu[-1+i]->set_bitmaps(mf.load_image(("my12-24.jpg")),mf.load_image(("my12-24h.jpg")));	 
			break;	 
		case 5 :	 
			vu[-1+i]->set_bitmaps(mf.load_image(("my12-60.jpg")),mf.load_image(("my12-60h.jpg")));	 
			break;	 
		case 6 :	 
			vu[-1+i]->set_bitmaps(mf.load_image(("my12-90.jpg")),mf.load_image(("my12-90h.jpg")));	 
			break;	 
		case 7 :	 
			vu[-1+i]->set_bitmaps(mf.load_image(("my12-120.jpg")),mf.load_image(("my12-120h.jpg")));	 
			break;	
		}	
	}
	char d[7];
	vutop=75;
	for (int i=1; i<10; i++)
	{
		// show VU meter name,left, top,    mode  		
		vuleft[i-1]=50+105*(i-1); 	
		vu[-1+i]->create(mixy_name,  vuleft[i-1],  vutop, this, 1);	
		vu[-1+i]->show();

		// show VU labels; the ID should be >PARAM_COUNT  left, top, width	
		create_label(vutextl[i-1],MIXY_PARAMS_COUNT+1,"      ",vuleft[i-1]-35,vutop-40,50);	
		vutextl[i-1].ModifyStyle(SS_LEFT,SS_RIGHT,0);
		vutextl[i-1].SetFont(&smallfont,NULL);
		create_label(vutextr[i-1],MIXY_PARAMS_COUNT+1,"      ",vuleft[i-1]+20,vutop-40,50);
		vutextr[i-1].SetFont(&smallfont,NULL);

		// SHOW_VFADER(Fader, Ctrl_ID, Label, MinVal,MaxVal,Left, Top, Width, Height)	//	
		if (i<9) sprintf(d, "Ch%i" , 2*i-1); else sprintf(d, "M1" );
		create_vslider(fdrvol[2*i-1],	2*i-2, d,  -120, 12,	vuleft[i-1]-31,	vutop-31,	25, 290);
		fdrvol[2*i-1].ModifyStyle( TBS_AUTOTICKS,TBS_NOTICKS,0);

		if (i<9) sprintf(d, "Ch%i" , 2*i); else sprintf(d, "M2" );	
		create_vslider(fdrvol[2*i],	2*i-1, d,  -120, 12,	vuleft[i-1]+40,	vutop-30,	25, 290);
		fdrvol[2*i].ModifyStyle( TBS_AUTOTICKS|TBS_RIGHT,TBS_NOTICKS|TBS_LEFT,0);
		// show fdr labels; the ID should be >PARAM_COUNT  left, top, width	
		create_label(fdrtext[2*i-2],MIXY_PARAMS_COUNT+1,"      ",vuleft[i-1]-27,vutop+vu[-1+i]->get_peak_height()-10,50);	
		fdrtext[2*i-2].SetFont(&smallfont,NULL);

		create_label(fdrtext[2*i-1],MIXY_PARAMS_COUNT+1,"      ",vuleft[i-1]+10,vutop+vu[-1+i]->get_peak_height()-10,50);	
		fdrtext[2*i-1].ModifyStyle(SS_LEFT,SS_RIGHT,0);
		fdrtext[2*i-1].SetFont(&smallfont,NULL);

		// SHOW pan sliders(Fader, Ctrl_ID, Label, MinVal,MaxVal,Left, Top, Width, Height)	//	
		if (i<9)
		{ 
			sprintf(d, "Pan %i" , 2*i-1); 
			create_hslider(pan[2*i-2],	2*i+52, d,  -10, 10,	vuleft[i-1]-35,	vutop+vu[-1+i]->get_peak_height()+10,	50, 20);
			pan[2*i-2].ModifyStyle( TBS_AUTOTICKS,TBS_NOTICKS,0);			
			sprintf(d, "Pan %i" , 2*i); 
			create_hslider(pan[2*i-1],	2*i+53, d,  -10, 10,	vuleft[i-1]+15,	vutop+vu[-1+i]->get_peak_height()+10,	50, 20);
			pan[2*i-1].ModifyStyle( TBS_AUTOTICKS,TBS_NOTICKS,0);
			
			create_checkbox(solo[2*i-2], 2*i+68, "Solo", vuleft[i-1]-30, vutop+vu[-1+i]->get_peak_height()+30, 50);			
			solo[2*i-2].SetFont(&smallfont,NULL);
			create_checkbox(solo[2*i-1], 2*i+69, "Solo", vuleft[i-1]+20, vutop+vu[-1+i]->get_peak_height()+30, 50);
			solo[2*i-1].SetFont(&smallfont,NULL);
		}

		//(CheckBox, Ctrl_ID, Caption, Left, Top, Width)	
		create_checkbox(mute[2*i-1], 2*i+16, "Mute", vuleft[i-1]-30, vutop+vu[-1+i]->get_peak_height()+50, 50);
		mute[2*i-1].SetFont(&smallfont,NULL);
		create_checkbox(mute[2*i], 2*i+17, "Mute", vuleft[i-1]+20, vutop+vu[-1+i]->get_peak_height()+50, 50);
		mute[2*i].SetFont(&smallfont,NULL);
		create_checkbox(stlink[i-1], i+35, "Stereo Link", vuleft[i-1]-20, vutop+vu[-1+i]->get_peak_height()+70, 80);
		stlink[i-1].SetFont(&smallfont,NULL);

			// edit text boxes
		edit[i-1] = new CEdit;
		edit[i-1]->Create(WS_CHILD|WS_VISIBLE|WS_BORDER|SS_CENTER,CRect(vuleft[i-1]-20, vutop+390, vuleft[i-1]+61, vutop+405), this, 0x10001+i-1);		
		edit[i-1]->SetFont(&smallfont,NULL);
		//edit[i-1]->SetWindowText(plugin->str_param[i-1]);
		//sprintf(data[i-1],plugin->str_param);
	}

		create_checkbox(monomix, 86, "Mono Mix", vuleft[8]-30, vutop+vu[4]->get_peak_height()+30, 80);
		monomix.SetFont(&smallfont,NULL);

	// show reset button left, top, width
	create_button(p_reset[0],P_RESET1,	"reset", vuleft[0]-5, vutop-58,vu[0]->get_peak_width());	
	create_button(p_reset[1],P_RESET2,	"reset", vuleft[1]-5, vutop-58,vu[0]->get_peak_width());
	create_button(p_reset[2],P_RESET3,	"reset", vuleft[2]-5, vutop-58,vu[0]->get_peak_width());
	create_button(p_reset[3],P_RESET4,	"reset", vuleft[3]-5, vutop-58,vu[0]->get_peak_width());
	create_button(p_reset[4],P_RESET5,	"reset", vuleft[4]-5, vutop-58,vu[0]->get_peak_width());
	create_button(p_reset[5],P_RESET6,	"reset", vuleft[5]-5, vutop-58,vu[0]->get_peak_width());	
	create_button(p_reset[6],P_RESET7,	"reset", vuleft[6]-5, vutop-58,vu[0]->get_peak_width());
	create_button(p_reset[7],P_RESET8,	"reset", vuleft[7]-5, vutop-58,vu[0]->get_peak_width());
	create_button(p_reset[8],P_RESET9,	"reset", vuleft[8]-5, vutop-58,vu[0]->get_peak_width());
	for (int i=0;i<9;i++)
	{
		p_reset[i].SetFont(&smallfont,NULL);
	}
	//image.create("",0,0, mf.load_image("my12-120.jpg"), this, kMETHOD_TRANS);
	//image.show();

	turn_on(1);
	redraw();
	controls_enabled = 1; // enable updating GUI when the parameters are changed
	sync(EVERYPM_ID); // update all 'GUI' elements to the preset plugin parameters
}
Пример #15
0
NodeHandle Entry<TypeOfEntry>::make_naked_node( simparm::NodeHandle node ) {
    if ( boost::is_same< TypeOfEntry, bool >() )
        return create_checkbox( node, getName() );
    else
        return create_textfield( node, getName(), typeName( TypeOfEntry() ) ); 
}
Пример #16
0
void ifuzzPluginDlg::init()
{
        // skin status:
        // ------------------------
        // mf=this.kxl [if exists]
        // mf.next=[attached]=kX Mixer's mf
        // mf.priority=1; this.kxl is accessed first

        // process kxefx.kxs now
        TCHAR tmp_str[MAX_PATH];
        efx_skin.get_full_skin_path(_T("kxefx.kxs"),tmp_str);
        efx_skin.set_skin(tmp_str);
        mf.attach_skin(&efx_skin);
        efx_skin.attach_skin(kxmixer_skin);
        efx_skin.set_attach_priority(1);

        // skin status:
        // -------------------------
        // [1] mf=this.kxl
        // [2] mf.next=efx_skin
        // [3] efx_skin=kxefx.kxs
        // [4] efx_skin.next=kxmixer skin
        // [1,2,3,4] -- access order

        CKXPluginGUI::init(); // this is necessary
        // init() should be called -after- skin initialization

//-----------------------------------------------------------------------------------------------
// custom dialog initialization here...
// (title, Width, Height)
create_dialog(plugin_name(fuzz), 250, 120);
grpbox.hide();//hide useless GUI elements
w_label.hide();

    /*LCDs*/
    
    count_drive.Create("",WS_VISIBLE|SS_NOTIFY,CRect(CPoint(62,86),CSize(29,18)), this);
	//count_drive.SetID(COUNT_DRIVE);
	count_drive.SetBlankPadding(3);//празни полета от ляво
	count_drive.SetColours(RGB(0,220,0), RGB(0,0,0), RGB(0,0,0));//цифри, блат, слайдер
	count_drive.SetAllowInteraction(false);//не може да се настройва
	count_drive.SetDraw3DBar(false);//без слайдър
	count_drive.DisplayInt(true);

	count_level_drive.Create("",WS_VISIBLE|SS_NOTIFY,CRect(CPoint(187,86),CSize(29,18)), this);
	//count_level_drive.SetID(COUNT_LEVEL_DRIVE);
	count_level_drive.SetBlankPadding(3);//празни полета от ляво
	count_level_drive.SetColours(RGB(0,220,0), RGB(0,0,0), RGB(0,0,0));//цифри, блат, слайдер
	count_level_drive.SetAllowInteraction(false);//не може да се настройва
	count_level_drive.SetDraw3DBar(false);//без слайдър
	count_level_drive.DisplayInt(true);

	count_level_clean.Create("",WS_VISIBLE|SS_NOTIFY,CRect(CPoint(62,149),CSize(29,18)), this);
	//count_level_clean.SetID(COUNT_LEVEL_CLEAN);
	count_level_clean.SetBlankPadding(3);//празни полета от ляво
	count_level_clean.SetColours(RGB(0,220,0), RGB(0,0,0), RGB(0,0,0));//цифри, блат, слайдер
	count_level_clean.SetAllowInteraction(false);//не може да се настройва
    count_level_clean.SetDraw3DBar(false);//без слайдър
	count_level_clean.DisplayInt(true);

	count_o_freq.Create("",WS_VISIBLE|SS_NOTIFY,CRect(CPoint(281,92),CSize(32,14)), this);
	//count_o_freq.SetID(COUNT_O_FREQ);
	count_o_freq.SetBlankPadding(4);//празни полета от ляво
	count_o_freq.SetColours(RGB(0,220,0), RGB(0,0,0), RGB(0,0,0));//цифри, блат, слайдер
	count_o_freq.SetAllowInteraction(false);//не може да се настройва
	count_o_freq.SetDraw3DBar(false);//без слайдър
	count_o_freq.DisplayInt(true);
	
	count_i_freq.Create("",WS_VISIBLE|SS_NOTIFY,CRect(CPoint(381,92),CSize(32,14)), this);
	//count_i_freq.SetID(COUNT_I_FREQ);
	count_i_freq.SetBlankPadding(4);//празни полета от ляво
	count_i_freq.SetColours(RGB(0,220,0), RGB(0,0,0), RGB(0,0,0));//цифри, блат, слайдер
	count_i_freq.SetAllowInteraction(false);//не може да се настройва
	count_i_freq.SetDraw3DBar(false);//без слайдър
	count_i_freq.DisplayInt(true);

	/*count_i_width.Create("",WS_VISIBLE|SS_NOTIFY,CRect(CPoint(252,145),CSize(29,18)), this);
	count_i_width.SetID(COUNT_I_WID);
	//count_i_width.SetFormatString("%.f2");
	count_i_width.SetBlankPadding(3);//празни полета от ляво
	count_i_width.SetColours(RGB(0,220,0), RGB(0,0,0), RGB(0,0,0));//цифри, блат, слайдер
	count_i_width.SetAllowInteraction(false);//не може да се настройва
	count_i_width.SetDraw3DBar(false);//без слайдър
	count_i_width.DisplayInt(true);

	count_o_width.Create("",WS_VISIBLE|SS_NOTIFY,CRect(CPoint(153,145),CSize(29,18)), this);
	count_o_width.SetID(COUNT_O_WID);
	//count_o_width.SetFormatString("%.f2");
	count_o_width.SetBlankPadding(3);//празни полета от ляво
	count_o_width.SetColours(RGB(0,220,0), RGB(0,0,0), RGB(0,0,0));//цифри, блат, слайдер
	count_o_width.SetAllowInteraction(false);//не може да се настройва
	count_o_width.SetDraw3DBar(false);//без слайдър
	count_o_width.DisplayInt(true);*/
	

	
	
	/*for loading the bitmap frames for the knobs*///valid for filenames kx.bmp (e.g. k1.bmp
	for(i=0;i<FRAMES;i++){                        //k2.bmp, k3.bmp etc.) 
	   sprintf(filename, "k%d.bmp", i+1);         //
       bitmaps[i] = mf.load_image(filename);      //
	}                                             //
   /*end*///////////////////////////////////////////

   
	/*Knobs*/

	knob_drive.SetBitmaps(bitmaps);
	knob_drive.Create("",WS_CHILD| WS_VISIBLE|SS_NOTIFY, CRect(CPoint(13,76),CSize(40,40)), this);
    knob_drive.SetID(DRIVE);
	knob_drive.SetPos(plugin->_params[DRIVE]);
	
	knob_level_drive.SetBitmaps(bitmaps);
	knob_level_drive.Create("",WS_CHILD| WS_VISIBLE|SS_NOTIFY, CRect(CPoint(138,76),CSize(40,40)), this);
    knob_level_drive.SetID(LEVEL_DRIVE);
	knob_level_drive.SetPos(plugin->_params[LEVEL_DRIVE]);

	knob_level_clean.SetBitmaps(bitmaps);
	knob_level_clean.Create("",WS_CHILD| WS_VISIBLE|SS_NOTIFY, CRect(CPoint(13,139),CSize(40,40)), this);
    knob_level_clean.SetID(LEVEL_CLEAN);
	knob_level_clean.SetPos(plugin->_params[LEVEL_CLEAN]);
	
    knob_tone.SetBitmaps(bitmaps);
	knob_tone.Create("",WS_CHILD| WS_VISIBLE|SS_NOTIFY, CRect(CPoint(333,80),CSize(40,40)), this);
    knob_tone.SetID(I_FREQ);
	knob_tone.SetPos(plugin->_params[I_FREQ]);

	knob_i_width.SetBitmaps(bitmaps);
	knob_i_width.Create("",WS_CHILD| WS_VISIBLE|SS_NOTIFY, CRect(CPoint(355,133),CSize(40,40)), this);
    knob_i_width.SetID(I_WID);
	knob_i_width.SetPos(plugin->_params[I_WID]);
	
    knob_polish.SetBitmaps(bitmaps);
	knob_polish.Create("",WS_CHILD| WS_VISIBLE|SS_NOTIFY, CRect(CPoint(235,80),CSize(40,40)), this);
    knob_polish.SetID(O_FREQ);
	knob_polish.SetPos(plugin->_params[O_FREQ]);

	knob_o_width.SetBitmaps(bitmaps);
	knob_o_width.Create("",WS_CHILD| WS_VISIBLE|SS_NOTIFY, CRect(CPoint(256,133),CSize(40,40)), this);
    knob_o_width.SetID(O_WID);
	knob_o_width.SetPos(plugin->_params[O_WID]);

    
    /*Checkboxes*/
	
	led_clean.set_bitmaps(
		mf.load_image("led_off.bmp"),
		mf.load_image("led_off.bmp"),
		mf.load_image("led_on.bmp"),
		mf.load_image("led_on.bmp"));
	create_checkbox	(led_clean, LED_DC, ""	, 73, 47, 150); 
	led_clean.set_method(kMETHOD_TRANS);

	led_norm.set_bitmaps(
		mf.load_image("led_off.bmp"),
		mf.load_image("led_off.bmp"),
		mf.load_image("led_on.bmp"),
		mf.load_image("led_on.bmp"));
	create_checkbox	(led_norm, LED_X2, ""	, 73, 110, 150); 
	led_norm.set_method(kMETHOD_TRANS);

	led_bps1.set_bitmaps(
		mf.load_image("led_off.bmp"),
		mf.load_image("led_off.bmp"),
		mf.load_image("led_on_red.bmp"),
		mf.load_image("led_on_red.bmp"));
	create_checkbox	(led_bps1, LED_BPS1, ""	, 238, 109, 150); 
	led_bps1.set_method(kMETHOD_TRANS);

	led_bps2.set_bitmaps(
		mf.load_image("led_off.bmp"),
		mf.load_image("led_off.bmp"),
		mf.load_image("led_on_red.bmp"),
		mf.load_image("led_on_red.bmp"));
	create_checkbox	(led_bps2, LED_BPS2, ""	, 337, 109, 150); 
	led_bps2.set_method(kMETHOD_TRANS);

	sw_st.set_bitmaps(
		mf.load_image("switch_up.bmp"),
		mf.load_image("switch_up.bmp"),
		mf.load_image("switch_down.bmp"),
		mf.load_image("switch_down.bmp"));
	create_checkbox	(sw_st, SW_ST, ""	, 106, 57, 150); 
	sw_st.set_method(kMETHOD_TRANS);

	sw_oc.set_bitmaps(
		mf.load_image("switch_up.bmp"),
		mf.load_image("switch_up.bmp"),
		mf.load_image("switch_down.bmp"),
		mf.load_image("switch_down.bmp"));
	create_checkbox	(sw_oc, SW_OC, ""	, 151, 118, 150); 
	sw_oc.set_method(kMETHOD_TRANS);
	

	
	controls_enabled = 1; // enable updating GUI when the parameters are changed

	sync(EVERYPM_ID); // update all 'GUI' elements to the preset plugin parameters
}
Пример #17
0
/**************************************************************************
  Popup (or raise) the player list dialog.
**************************************************************************/
void popup_players_dialog(bool raise)
{
  struct widget *pWindow = NULL, *pBuf = NULL;
  SDL_Surface *pLogo = NULL, *pZoomed = NULL;
  SDL_String16 *pStr;
  SDL_Rect dst;
  int i, n, h;
  double a, b, r;
  SDL_Rect area;
  
  if (pPlayers_Dlg) {
    return;
  }
  
  n = 0;
  players_iterate(pPlayer) {
    if(is_barbarian(pPlayer)) {
      continue;
    }
    n++;
  } players_iterate_end;

  if(n < 2) {
    return;
  }
    
  pPlayers_Dlg = fc_calloc(1, sizeof(struct SMALL_DLG));
  
  pStr = create_str16_from_char(_("Players"), adj_font(12));
  pStr->style |= TTF_STYLE_BOLD;
  
  pWindow = create_window_skeleton(NULL, pStr, 0);
    
  pWindow->action = players_window_dlg_callback;
  set_wstate(pWindow, FC_WS_NORMAL);
    
  add_to_gui_list(ID_WINDOW, pWindow);
  pPlayers_Dlg->pEndWidgetList = pWindow;
  /* ---------- */
  /* exit button */
  pBuf = create_themeicon(pTheme->Small_CANCEL_Icon, pWindow->dst,
                          WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
  pBuf->info_label = create_str16_from_char(_("Close Dialog (Esc)"),
                                            adj_font(12));
  pBuf->action = exit_players_dlg_callback;
  set_wstate(pBuf, FC_WS_NORMAL);
  pBuf->key = SDLK_ESCAPE;
  
  add_to_gui_list(ID_BUTTON, pBuf);
  /* ---------- */
  
  for(i = 0; i<DS_LAST; i++) {
    switch (i) {
      case DS_ARMISTICE:
	pBuf = create_checkbox(pWindow->dst,
		(SDL_Client_Flags & CF_DRAW_PLAYERS_NEUTRAL_STATUS),
      						WF_RESTORE_BACKGROUND);
	pBuf->action = toggle_draw_neutral_status_callback;
	pBuf->key = SDLK_n;
      break;
      case DS_WAR:
	pBuf = create_checkbox(pWindow->dst,
		(SDL_Client_Flags & CF_DRAW_PLAYERS_WAR_STATUS),
      						WF_RESTORE_BACKGROUND);
	pBuf->action = toggle_draw_war_status_callback;
	pBuf->key = SDLK_w;
      break;
      case DS_CEASEFIRE:
	pBuf = create_checkbox(pWindow->dst,
		(SDL_Client_Flags & CF_DRAW_PLAYERS_CEASEFIRE_STATUS),
      						WF_RESTORE_BACKGROUND);
	pBuf->action = toggle_draw_ceasefire_status_callback;
	pBuf->key = SDLK_c;
      break;
      case DS_PEACE:
	pBuf = create_checkbox(pWindow->dst,
		(SDL_Client_Flags & CF_DRAW_PLAYERS_PEACE_STATUS),
      						WF_RESTORE_BACKGROUND);
	pBuf->action = toggle_draw_pease_status_callback;
	pBuf->key = SDLK_p;
      break;
      case DS_ALLIANCE:
	pBuf = create_checkbox(pWindow->dst,
		(SDL_Client_Flags & CF_DRAW_PLAYERS_ALLIANCE_STATUS),
      						WF_RESTORE_BACKGROUND);
	pBuf->action = toggle_draw_alliance_status_callback;
	pBuf->key = SDLK_a;
      break;
      default:
	 /* no contact */
	 continue;
      break;
    }
    set_wstate(pBuf, FC_WS_NORMAL);
    add_to_gui_list(ID_CHECKBOX, pBuf);
  } 
  /* ---------- */
  
  players_iterate(pPlayer) {
    if(is_barbarian(pPlayer)) {
      continue;
    }
                
    pStr = create_string16(NULL, 0, adj_font(10));
    pStr->style |= (TTF_STYLE_BOLD|SF_CENTER);
   
    pLogo = get_nation_flag_surface(nation_of_player(pPlayer));
    {
      /* Aim for a flag height of 60 pixels, but draw smaller flags if there
       * are more players */
      double zoom = DEFAULT_ZOOM * (60.0 - n) / pLogo->h;
      pZoomed = zoomSurface(pLogo, zoom, zoom, 1);
    }

    pBuf = create_icon2(pZoomed, pWindow->dst,
                        WF_RESTORE_BACKGROUND | WF_WIDGET_HAS_INFO_LABEL
                        | WF_FREE_THEME);
    pBuf->info_label = pStr;

    if(!pPlayer->is_alive) {
      pStr = create_str16_from_char(_("R.I.P.") , adj_font(10));
      pStr->style |= TTF_STYLE_BOLD;
      pStr->fgcol = *get_theme_color(COLOR_THEME_PLRDLG_TEXT);
      pLogo = create_text_surf_from_str16(pStr);
      FREESTRING16(pStr);
	
      dst.x = (pZoomed->w - pLogo->w) / 2;
      dst.y = (pZoomed->h - pLogo->h) / 2;
      alphablit(pLogo, NULL, pZoomed, &dst);
      FREESURFACE(pLogo);
    }
     
    if(pPlayer->is_alive) {
      set_wstate(pBuf, FC_WS_NORMAL);
    }
    
    pBuf->data.player = pPlayer;
  
    pBuf->action = player_callback;
    
    add_to_gui_list(ID_LABEL, pBuf);
    
  } players_iterate_end;
  
  pPlayers_Dlg->pBeginWidgetList = pBuf;

  resize_window(pWindow, NULL, NULL, adj_size(500), adj_size(400));

  area = pWindow->area;
  
  r = MIN(area.w, area.h);
  r -= ((MAX(pBuf->size.w, pBuf->size.h) * 2));
  r /= 2;
  a = (2.0 * M_PI) / n;
  
  widget_set_position(pWindow,
                      (Main.screen->w - pWindow->size.w) / 2,
                      (Main.screen->h - pWindow->size.h) / 2);
  
  /* exit button */
  pBuf = pWindow->prev;
  
  pBuf->size.x = area.x + area.w - pBuf->size.w - 1;
  pBuf->size.y = pWindow->size.y + adj_size(2);
    
  n = area.y;
  pStr = create_string16(NULL, 0, adj_font(10));
  pStr->style |= TTF_STYLE_BOLD;
  pStr->bgcol = (SDL_Color) {0, 0, 0, 0};
  
  for(i = 0; i<DS_LAST; i++) {
      switch (i) {
	case DS_ARMISTICE:
	  pStr->fgcol = *get_theme_color(COLOR_THEME_PLRDLG_ARMISTICE);
	break;
        case DS_WAR:
	  pStr->fgcol = *get_theme_color(COLOR_THEME_PLRDLG_WAR);
	break;
	case DS_CEASEFIRE:
	  pStr->fgcol = *get_theme_color(COLOR_THEME_PLRDLG_CEASEFIRE);
	break;
        case DS_PEACE:
	  pStr->fgcol = *get_theme_color(COLOR_THEME_PLRDLG_PEACE);
        break;
	case DS_ALLIANCE:
	  pStr->fgcol = *get_theme_color(COLOR_THEME_PLRDLG_ALLIANCE);
	break;
        default:
	   /* no contact */
	   continue;
        break;
      }
      
      copy_chars_to_string16(pStr, diplstate_type_translated_name(i));
      pLogo = create_text_surf_from_str16(pStr);
  
      pBuf = pBuf->prev;
      h = MAX(pBuf->size.h, pLogo->h);
      pBuf->size.x = area.x + adj_size(5);
      pBuf->size.y = n + (h - pBuf->size.h) / 2;
      
      dst.x = adj_size(5) + pBuf->size.w + adj_size(6);
      dst.y = n + (h - pLogo->h) / 2;
      alphablit(pLogo, NULL, pWindow->theme, &dst);
      n += h;
      FREESURFACE(pLogo);
  }
  FREESTRING16(pStr);

  /* first player shield */
  pBuf = pBuf->prev;
  pBuf->size.x = area.x + area.w / 2 - pBuf->size.w / 2;
  pBuf->size.y = area.y + area.h / 2 - r - pBuf->size.h / 2;
  
  n = 1;
  if(pBuf != pPlayers_Dlg->pBeginWidgetList) {
    do{
      pBuf = pBuf->prev;
      b = M_PI_2 + n * a;
      pBuf->size.x = area.x + area.w / 2 - r * cos(b) - pBuf->size.w / 2;
      pBuf->size.y = area.y + area.h / 2 - r * sin(b) - pBuf->size.h / 2;
      n++;
    } while(pBuf != pPlayers_Dlg->pBeginWidgetList);
  }

  players_dialog_update();
}