本文整理汇总了C++中gdk::Color类的典型用法代码示例。如果您正苦于以下问题:C++ Color类的具体用法?C++ Color怎么用?C++ Color使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Color类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: borraDatosForm
/**
Borra todos los datos de un formulario al cambiar de pagina.
@param bloc, GtkNotebookPage.
@param guint, pag contiene el numero de pagina.
*/
void Preferencias::borraDatosForm(GtkNotebookPage* bloc,guint pag)
{
Gdk::Color col;
Glib::RefPtr<Gtk::TextBuffer> buf;
Gtk::TreeModel::iterator it;
col.set_rgb(0,0,0);
clasesG->set_text("");
nomClasesG->set_text("");
buf = descripClasesG->get_buffer();
buf->set_text("");
//claseLinea.set_active_text("");
estadosG->set_text("");
nomEstadosG->set_text("");
buf = descripEstadosG->get_buffer();
buf->set_text("");
colorEstadosG->set_color(col);
separPuntosGPD->set_value(0);
numColumnsG->set_value(0);
numFilasG->set_value(0);
colorEstadosG->set_sensitive(false);
claseLinea->set_sensitive(false);
iter = it;
}
示例2: memset
ScreenArea::ScreenArea(int _iWidth, int _iHeight, int _iScale) :
m_iFilterScale(1),
m_vFilter2x(NULL),
m_vFilterIB(NULL),
m_puiPixels(NULL),
m_puiDelta(NULL),
m_iScaledWidth(_iWidth),
m_iScaledHeight(_iHeight),
m_bEnableRender(true),
m_bShowCursor(true)
{
g_assert(_iWidth >= 1 && _iHeight >= 1 && _iScale >= 1);
m_iWidth = _iWidth;
m_iHeight = _iHeight;
m_iScale = _iScale;
set_events(Gdk::EXPOSURE_MASK
| Gdk::POINTER_MOTION_MASK
| Gdk::ENTER_NOTIFY_MASK
| Gdk::LEAVE_NOTIFY_MASK);
char aiEmptyData[8];
memset(aiEmptyData, 0, sizeof(aiEmptyData));
Glib::RefPtr<Gdk::Bitmap> poSource = Gdk::Bitmap::create(aiEmptyData, 8, 8);
Glib::RefPtr<Gdk::Bitmap> poMask = Gdk::Bitmap::create(aiEmptyData, 8, 8);
Gdk::Color oFg;
Gdk::Color oBg;
oFg.set_rgb(0, 0, 0);
oBg.set_rgb(0, 0, 0);
m_poEmptyCursor = new Gdk::Cursor(poSource, poMask, oFg, oBg, 0, 0);
}
示例3: manage
VCAExpAudioGUI::VCAExpAudioGUI(const std::string& URI)
{
EventBox *p_background = manage(new EventBox());
Gdk::Color* color = new Gdk::Color();
color->set_rgb(7710, 8738, 9252);
p_background->modify_bg(Gtk::STATE_NORMAL, *color);
VBox *p_mainWidget = manage(new VBox(false, 5));
Frame *p_gainFrame = manage(new Frame("Gain"));
//p_gainFrame->set_shadow_type(Gtk::SHADOW_NONE);
HBox *p_gainBox = manage(new HBox(true));
slot<void> p_slotGain1 = compose(bind<0>(mem_fun(*this, &VCAExpAudioGUI::write_control), p_gain1), mem_fun(*this, &VCAExpAudioGUI::get_gain1));
m_dialGain1 = new LabeledDial("Gain Offset", p_slotGain1, p_gain1, 0, 1, NORMAL, 0.01, 2);
p_gainBox->pack_start(*m_dialGain1);
slot<void> p_slotGain2 = compose(bind<0>(mem_fun(*this, &VCAExpAudioGUI::write_control), p_gain2), mem_fun(*this, &VCAExpAudioGUI::get_gain2));
m_dialGain2 = new LabeledDial("2nd Gain Boost", p_slotGain2, p_gain2, 0, 1, NORMAL, 0.01, 2);
p_gainBox->pack_start(*m_dialGain2);
p_gainFrame->add(*p_gainBox);
p_mainWidget->pack_start(*p_gainFrame);
Frame *p_inFrame = manage(new Frame("In"));
//p_gainFrame->set_shadow_type(Gtk::SHADOW_NONE);
HBox *p_volumeBox = manage(new HBox(true));
slot<void> p_slotIn1 = compose(bind<0>(mem_fun(*this, &VCAExpAudioGUI::write_control), p_in1), mem_fun(*this, &VCAExpAudioGUI::get_in1));
m_dialIn1 = new LabeledDial("In 1", p_slotIn1, p_in1, 0, 2, NORMAL, 0.01, 2);
p_volumeBox->pack_start(*m_dialIn1);
slot<void> p_slotIn2 = compose(bind<0>(mem_fun(*this, &VCAExpAudioGUI::write_control), p_in2), mem_fun(*this, &VCAExpAudioGUI::get_in2));
m_dialIn2 = new LabeledDial("In 2", p_slotIn2, p_in2, 0, 2, NORMAL, 0.01, 2);
p_volumeBox->pack_start(*m_dialIn2);
p_inFrame->add(*p_volumeBox);
p_mainWidget->pack_start(*p_inFrame);
slot<void> p_slotOutputLevel = compose(bind<0>(mem_fun(*this, &VCAExpAudioGUI::write_control), p_outputLevel), mem_fun(*this, &VCAExpAudioGUI::get_outputLevel));
m_dialOutputLevel = new LabeledDial("Output Level", p_slotOutputLevel, p_outputLevel, 0, 2, NORMAL, 0.01, 2);
p_mainWidget->pack_start(*m_dialOutputLevel);
p_mainWidget->set_size_request(150, 300);
p_background->add(*p_mainWidget);
add(*p_background);
Gtk::manage(p_mainWidget);
}
示例4: cpp_color_str
void Gobby::TextTabLabel::update_dots()
{
if (m_changed_by.empty())
{
m_dots.hide();
}
else
{
Glib::ustring markup;
for(UserWatcherList::iterator iter = m_changed_by.begin();
iter != m_changed_by.end(); ++iter)
{
double hue = inf_text_user_get_hue(iter->get_user());
Gdk::Color c;
c.set_hsv(360.0 * hue, 0.6, 0.6);
// We are using the C API here since
// gdk_color_to_string is available since GTK 2.12,
// but Gdk::Color::to_string only since gtkmm 2.14,
// and we want to require nothing more recent than
// 2.12 for now. See also bug #447.
gchar* color_str = gdk_color_to_string(c.gobj());
Glib::ustring cpp_color_str(color_str);
g_free(color_str);
markup += "<span color=\"" + cpp_color_str + "\">" +
m_dot_char + "</span>";
}
m_dots.set_markup(markup);
m_dots.show();
}
}
示例5: setColor
void GraphicalItem::setColor(const Gdk::Color& color,
const Cairo::RefPtr<Cairo::Context>& context)
{
context->set_source_rgb(color.get_red_p(),
color.get_green_p(),
color.get_blue_p());
}
示例6: convert
/// Converts a k3d::color to a Gdk::Color
const Gdk::Color convert(const k3d::color& RHS)
{
Gdk::Color result;
result.set_rgb_p(RHS.red, RHS.green, RHS.blue);
return result;
}
示例7: manage
AnalogMemoryGUI::AnalogMemoryGUI(const std::string& URI)
{
EventBox *p_background = manage (new EventBox());
Gdk::Color* color = new Gdk::Color();
color->set_rgb(7710, 8738, 9252);
p_background->modify_bg(Gtk::STATE_NORMAL, *color);
VBox *p_mainWidget = manage(new VBox(false));
MyBox *p_writeAddressingModeBox = manage (new MyBox("Write Addressing Mode", Gtk::Orientation::ORIENTATION_VERTICAL));
m_comboWriteAddressForm = manage (new ComboBoxText());
m_comboWriteAddressForm->append_text("Direct (no fill)");
m_comboWriteAddressForm->append_text("Linear up only, no fill");
m_comboWriteAddressForm->append_text("Linear up only, fill");
m_comboWriteAddressForm->append_text("Linear down only, no fill");
m_comboWriteAddressForm->append_text("Linear down only, fill");
m_comboWriteAddressForm->append_text("Reflected");
m_comboWriteAddressForm->signal_changed().connect(compose(bind<0> (mem_fun(*this, &AnalogMemoryGUI::write_control), p_write_addressing_mode), mem_fun(*m_comboWriteAddressForm, &ComboBoxText::get_active_row_number)));
p_writeAddressingModeBox->pack_start(*m_comboWriteAddressForm);
p_mainWidget->pack_start(*p_writeAddressingModeBox);
p_mainWidget->pack_start(*(m_dialN = CreateDial("N (for 2^N memory cells)", p_n, NORMAL, 1)));
p_mainWidget->pack_start(*(m_dialWriteThresh = CreateDial("Write Threshold", p_write_tresh, NORMAL, 0.01)));
p_background->add(*p_mainWidget);
add(*p_background);
Gtk::manage(p_background);
}
示例8: setSourceRGB
void ActivityDrawingArea::setSourceRGB(Cairo::RefPtr<Cairo::Context> cr, const Gdk::Color & col) {
double r = col.get_red_p();
double g = col.get_green_p();
double b = col.get_blue_p();
//std::cout<<"ActivityDrawingArea::setSourceRGB: "<<"("<<r<<","<<g<<","<<b<<")"<<std::endl;
cr->set_source_rgb(r, g, b);
}
示例9: setColorChooserColor
void setColorChooserColor(string drawable, OSG::Color3f col) {
Gdk::Color c;
c.set_rgb_p(col[0], col[1], col[2]);
Glib::RefPtr<Gtk::DrawingArea> darea;
darea = Glib::RefPtr<Gtk::DrawingArea>::cast_static(VRGuiBuilder()->get_object(drawable.c_str()));
darea->modify_bg(Gtk::STATE_NORMAL, c);
}
示例10: color_to_str
// Gdk::Color -> 16進数表記の文字列
std::string MISC::color_to_str( const Gdk::Color& color )
{
// R,G,Bを取得
int l_rgb[3];
l_rgb[0] = color.get_red();
l_rgb[1] = color.get_green();
l_rgb[2] = color.get_blue();
return color_to_str( l_rgb );
}
示例11: getARandColor
Gdk::Color WidgetExpanderBase::getARandColor()
{
Gdk::Color RandColor;
RandColor.set_rgb(Glib::Rand().get_int_range(0, 65535),
Glib::Rand().get_int_range(0, 65535),
Glib::Rand().get_int_range(0, 65535));
return RandColor;
}
示例12: onWidgetExpanderBaseChanged
void WidgetExpanderBase::onWidgetExpanderBaseChanged()
{
Gdk::Color CurrentColor = mp_ColorButton->get_color();
double CurrentAlpha = mp_OpacityHScale->get_value() / 100;
int CurrentWidth = mp_WidthSpinButton->get_value();
m_signal_WidgetExpanderBaseChanged.emit(CurrentWidth,
CurrentColor.get_red_p(), CurrentColor.get_green_p(),
CurrentColor.get_blue_p(), CurrentAlpha, mp_ShowIDCheckBox->get_active()/*, mp_CheckButtonGraph->get_active()*/);
}
示例13:
static Gdk::Color
color_darken(Gdk::Color x, float amount)
{
double red = x.get_red_p() * amount;
double green = x.get_green_p() * amount;
double blue = x.get_blue_p() * amount;
x.set_rgb_p( red > 1 ? 1 : red,
green > 1 ? 1 : green,
blue > 1 ? 1 : blue);
return x;
}
示例14: manage
BeatRepeaterMonoGUI::BeatRepeaterMonoGUI(const std::string& URI)
{
EventBox *p_background = manage (new EventBox());
Gdk::Color* color = new Gdk::Color();
color->set_rgb(7710, 8738, 9252);
p_background->modify_bg(Gtk::STATE_NORMAL, *color);
VBox *p_mainWidget = manage (new VBox(false));
MyBox *p_beatBox = manage (new MyBox("Beat", Gtk::Orientation::ORIENTATION_VERTICAL));
HBox *p_beatDials = manage(new HBox(false));
m_dialTempo = new LabeledDial("Tempo", p_tempo, 40, 320, NORMAL, 1, 0);
m_dialTempo->signal_value_changed().connect(compose(bind<0>(mem_fun(*this, &BeatRepeaterMonoGUI::write_control), p_tempo), mem_fun(*m_dialTempo, &LabeledDial::get_value)));
p_beatDials->pack_start(*m_dialTempo, Gtk::PACK_EXPAND_PADDING, 0);
m_dialBeatSize = new LabeledDial("Beat Size", p_beatSize, 0.0078125, 128, MULTIPLIER, 0.0078125, 7);
m_dialBeatSize->signal_value_changed().connect(compose(bind<0>(mem_fun(*this, &BeatRepeaterMonoGUI::write_control), p_beatSize), mem_fun(*m_dialBeatSize, &LabeledDial::get_value)));
p_beatDials->pack_start(*m_dialBeatSize, Gtk::PACK_EXPAND_PADDING, 0);
p_beatBox->pack_start(*p_beatDials);
Alignment* p_align = new Alignment(0.5, 0.5, 0, 0);
m_checkReverse = manage(new CheckButton("Reverse"));
m_checkReverse->signal_toggled().connect(compose(bind<0>(mem_fun(*this, &BeatRepeaterMonoGUI::write_control), p_reverse), mem_fun(*m_checkReverse, &CheckButton::get_active)));
p_align->add(*m_checkReverse);
p_beatBox->pack_start(*p_align);
p_mainWidget->pack_start(*p_beatBox);
MyBox *p_envelopeFrame = manage(new MyBox("Envelope", Gtk::Orientation::ORIENTATION_HORIZONTAL));
m_dialAttack = new LabeledDial("Attack", p_attack, 3, 25, NORMAL, 1, 0);
m_dialAttack->signal_value_changed().connect(compose(bind<0>(mem_fun(*this, &BeatRepeaterMonoGUI::write_control), p_attack), mem_fun(*m_dialAttack, &LabeledDial::get_value)));
p_envelopeFrame->pack_start(*m_dialAttack);
m_dialRelease = new LabeledDial("Release", p_release, 3, 25, NORMAL, 1, 0);
m_dialRelease->signal_value_changed().connect(compose(bind<0>(mem_fun(*this, &BeatRepeaterMonoGUI::write_control), p_release), mem_fun(*m_dialRelease, &LabeledDial::get_value)));
p_envelopeFrame->pack_start(*m_dialRelease);
p_mainWidget->pack_start(*p_envelopeFrame);
p_background->add(*p_mainWidget);
add(*p_background);
Gtk::manage(p_mainWidget);
}
示例15: manage
LfoTempoGUI::LfoTempoGUI(const std::string& URI)
{
EventBox *p_background = manage (new EventBox());
Gdk::Color* color = new Gdk::Color();
color->set_rgb(7710, 8738, 9252);
p_background->modify_bg(Gtk::STATE_NORMAL, *color);
VBox *p_mainWidget = manage (new VBox(false, 5));
Label *p_labelWaveForm = manage (new Label("Wave Form"));
p_mainWidget->pack_start(*p_labelWaveForm);
m_comboWaveForm = manage (new ComboBoxText());
m_comboWaveForm->append_text("Sine");
m_comboWaveForm->append_text("Triangle");
m_comboWaveForm->append_text("Sawtooth Up");
m_comboWaveForm->append_text("Sawtooth Down");
m_comboWaveForm->append_text("Rectangle");
m_comboWaveForm->append_text("S & H");
slot<void> p_slotWaveForm = compose(bind<0> (mem_fun(*this, &LfoTempoGUI::write_control), p_waveForm), mem_fun(*m_comboWaveForm, &ComboBoxText::get_active_row_number));
m_comboWaveForm->signal_changed().connect(p_slotWaveForm);
p_mainWidget->pack_start(*m_comboWaveForm);
Frame *p_freqFrame = manage(new Frame("Tempo"));
HBox *p_freqBox = manage(new HBox(true));
slot<void> p_slotTempo = compose(bind<0>(mem_fun(*this, &LfoTempoGUI::write_control), p_tempo), mem_fun(*this, &LfoTempoGUI::get_tempo));
m_dialTempo = new LabeledDial("Tempo", p_slotTempo, p_tempo, 1, 320, NORMAL, 1, 0);
p_freqBox->pack_start(*m_dialTempo);
slot<void> p_slotTempoMultiplier = compose(bind<0>(mem_fun(*this, &LfoTempoGUI::write_control), p_tempoMultiplier), mem_fun(*this, &LfoTempoGUI::get_tempoMultiplier));
m_dialTempoMultiplier = new LabeledDial("Tempo Multiplier", p_slotTempoMultiplier, p_tempoMultiplier, 0.0078125, 32, DIVIDER, 1, 7);
p_freqBox->pack_start(*m_dialTempoMultiplier);
p_freqFrame->add(*p_freqBox);
p_mainWidget->pack_start(*p_freqFrame);
slot<void> p_slotPhi0 = compose(bind<0> (mem_fun(*this, &LfoTempoGUI::write_control), p_phi0), mem_fun(*this, &LfoTempoGUI::get_phi0));
m_dialPhi0 = new LabeledDial("Phi0", p_slotPhi0, p_phi0, 0, 6.28, NORMAL, 0.01, 2);
p_mainWidget->pack_start(*m_dialPhi0);
p_mainWidget->set_size_request(160, 260);
p_background->add(*p_mainWidget);
add(*p_background);
Gtk::manage(p_mainWidget);
}