Пример #1
0
void MainMenu::draw()
{
    Fl_Boxtype box = this->box();
    Fl_Flags flags;
    Fl_Color color = this->color();
    Fl_Color lcolor = label_color();

    if (!active_r())
        flags = FL_INACTIVE;
    else if (m_open)
        flags = FL_VALUE;
    else
        flags = 0;

    if (belowmouse()) {
        flags = flags|FL_HIGHLIGHT;
        color = fl_lighter(color);
        lcolor = fl_lighter(label_color());
        if(!color) color = this->color();
        if(!lcolor) color = this->label_color();
    } 
    box->draw(0, 0, this->w(), this->h(), color, flags);

    int X=0, Y=0, W=w(), H=h();
    box->inset(X,Y,W,H);

    if(image()) {
        int imY = (h()/2)-(image()->height()/2);
        image()->draw(6, imY, image()->width(), image()->height(), flags);
        X+=image()->width()+6;
    } else {
        X += 4;
        W -= 4;
    }

    fl_font(label_font(), label_size());
    label_type()->draw(label(), X, Y, W-X, H, lcolor, flags|FL_ALIGN_LEFT);
}
Пример #2
0
Save_Widget::Save_Widget() :
    _plugin              (0),
    _color_profile_widget(0),
    _black_widget        (0),
    _white_widget        (0),
    _gamma_widget        (0),
    _version_widget      (0),
    _type_widget         (0),
    _endian_widget       (0)
{
    // Create color profile widgets.

    Group_Box * color_profile_group =
        new Group_Box(label_color_profile_group);

    _color_profile_widget =
        new Radio_Button_Group(djv_cineon::label_color_profile());

    Group_Box * film_print_group = new Group_Box(label_film_print_group);

    _black_widget = new Int_Edit_Slider(0, 1023);

    _white_widget = new Int_Edit_Slider(0, 1023);

    _gamma_widget = new Float_Edit_Slider(0.01, 4.0);

    // Create version widgets.

    Group_Box * version_group =
        new Group_Box(label_version_group);

    _version_widget = new Radio_Button_Group(label_version());

    // Create type widgets.

    Group_Box * type_group =
        new Group_Box(label_type_group);

    _type_widget = new Radio_Button_Group(label_type());

    // Create endian widgets.

    Group_Box * endian_group =
        new Group_Box(label_endian_group);

    _endian_widget = new Radio_Button_Group(label_endian());

    // Layout.

    Vertical_Layout * layout = new Vertical_Layout(this);
    layout->margin(Style::global()->margin_large());
    layout->spacing(Style::global()->spacing_large());

    layout->add(color_profile_group);
    color_profile_group->layout()->add(_color_profile_widget);

    color_profile_group->layout()->add(film_print_group);
    Form_Widget * form_widget = new Form_Widget;
    film_print_group->layout()->add(form_widget);
    form_widget->add_row(label_film_print_black, _black_widget);
    form_widget->add_row(label_film_print_white, _white_widget);
    form_widget->add_row(label_film_print_gamma, _gamma_widget);
    
    layout->add(version_group);
    version_group->layout()->add(_version_widget);

    layout->add(type_group);
    type_group->layout()->add(_type_widget);

    layout->add(endian_group);
    endian_group->layout()->add(_endian_widget);

    layout->add_stretch();

    // Initialize.

    _black_widget->default_value(Save::Options().film_print.black);
    _white_widget->default_value(Save::Options().film_print.white);
    _gamma_widget->default_value(Save::Options().film_print.gamma);

    plugin_update();
    widget_update();

    // Callbacks.

    _color_profile_widget->signal.set(this, color_profile_callback);
    _black_widget->signal.set(this, black_callback);
    _white_widget->signal.set(this, white_callback);
    _gamma_widget->signal.set(this, gamma_callback);
    _version_widget->signal.set(this, version_callback);
    _type_widget->signal.set(this, type_callback);
    _endian_widget->signal.set(this, endian_callback);
}
Пример #3
0
Scale_Op::Scale_Op()
{
    // Widgets.

    Group_Box * size_group = new Group_Box("Size");
    Int_Edit_Slider * width = new Int_Edit_Slider;
    Int_Edit_Slider * height = new Int_Edit_Slider;

    Group_Box * type_group = new Group_Box("Type");
    Choice_Widget * type = new Choice_Widget(label_type());

    Group_Box * filter_default_group = new Group_Box("Default Filter");
    Choice_Widget * filter_default_min =
        new Choice_Widget(label_filter_default());
    Choice_Widget * filter_default_mag =
        new Choice_Widget(label_filter_default());

    Group_Box * filter_custom_group = new Group_Box("Custom Filter");
    Choice_Widget * filter_custom_min =
        new Choice_Widget(label_filter_custom());
    Choice_Widget * filter_custom_mag =
        new Choice_Widget(label_filter_custom());

    // Layout.

    Layout_Item::group(List<Layout_Item *>() <<
        width <<
        height);

    Vertical_Layout * layout = new Vertical_Layout(this);
    layout->add(size_group);
    Vertical_Layout * layout_v = new Vertical_Layout(size_group);
    Horizontal_Layout * layout_h = new Horizontal_Layout(layout_v);
    layout_v->add(width);
    layout_v->add(height);

    layout->add(type_group);
    layout_v = new Vertical_Layout(type_group);
    layout_v->add(type);

    layout->add(filter_default_group);
    layout_v = new Vertical_Layout(filter_default_group);
    layout_h = new Horizontal_Layout(layout_v);
    layout_h->margin(0);
    layout_h->add(filter_default_min);
    layout_h->add(filter_default_mag);

    layout->add(filter_custom_group);
    layout_v = new Vertical_Layout(filter_custom_group);
    layout_h = new Horizontal_Layout(layout_v);
    layout_h->margin(0);
    layout_h->add(filter_custom_min);
    layout_h->add(filter_custom_mag);

    layout->add_stretch();

    // Initialize.

    width->range(1, 2048);
    height->range(1, 2048);
    width->set(_value.size.x);
    height->set(_value.size.y);
    type->set(_value.type);
    filter_default_min->set(_value.default_min);
    filter_default_mag->set(_value.default_mag);
    filter_custom_min->set(_value.custom_min);
    filter_custom_mag->set(_value.custom_mag);

    // Callbacks.

    width->signal.set(this, width_callback);
    height->signal.set(this, height_callback);
    type->signal.set(this, type_callback);
    filter_default_min->signal.set(this, default_min_callback);
    filter_default_mag->signal.set(this, default_mag_callback);
    filter_custom_min->signal.set(this, custom_min_callback);
    filter_custom_mag->signal.set(this, custom_mag_callback);
}