本文整理汇总了C++中set_border_width函数的典型用法代码示例。如果您正苦于以下问题:C++ set_border_width函数的具体用法?C++ set_border_width怎么用?C++ set_border_width使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了set_border_width函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: set_border_width
gui::ImageSpace::ImageSpace() {
set_border_width(BORDER_WIDTH);
originalImage_.set_label("Original Image");
currentImage_.set_label("Current Image");
pack1(originalImage_, false, false);
pack2(currentImage_, false, false);
show_all_children();
}
示例2: imageSpace_
gui::Workspace::Workspace() :
imageSpace_(), toolBox_(imageSpace_.getOriginalImage(),
imageSpace_.getCurrentImage()) {
set_border_width(BORDER_WIDTH);
pack_start(imageSpace_, true, true);
pack_end(toolBox_, false, false);
show_all_children();
}
示例3: DLMatrixHelper
DLWindow::DLWindow(DLControler *controler) :
DLMatrixHelper(controler->getSize()),
controler(controler),
size(controler->getSize()),
picSize((Gdk::Screen::get_default()->get_width() < Gdk::Screen::get_default()->get_height() ? Gdk::Screen::get_default()->get_width() : Gdk::Screen::get_default()->get_height()
- ((Gdk::Screen::get_default()->get_width() < Gdk::Screen::get_default()->get_height() ? Gdk::Screen::get_default()->get_width() : Gdk::Screen::get_default()->get_height()*25)
/100))/size),
pixBufDog(Gdk::Pixbuf::create_from_file("./res/dog.png", picSize, picSize,false)),
pixBufFlea(Gdk::Pixbuf::create_from_file("./res/flea.png", picSize, picSize,false)),
pixBufVoid(Gdk::Pixbuf::create_from_file("./res/void.png", picSize, picSize,false)),
pixBufVictory(Gdk::Pixbuf::create_from_file("./res/victory.png")),
grid(),
nbFlea(controler->getNbrFlea()),
box(Gtk::ORIENTATION_VERTICAL),
nbRun(0),
buttonStart("Start")
{
tab = new char[size*size];
for (int i = 0; i < size*size; ++i)
{
tab[i] = '_';
}
buttonStart.signal_clicked().connect(sigc::mem_fun(*this, &DLWindow::startButtonClicked));
set_border_width(10);
add(box);
box.pack_start(grid);
box.pack_start(buttonStart);
grid.override_background_color(Gdk::RGBA("black"));
for (int i = 0; i < size*size; ++i)
{
listPixVoid.push_back(this->createImage(pixBufVoid));
}
for (int i = 0; i < nbFlea; ++i)
{
listPixFlea.push_back(this->createImage(pixBufFlea));
}
pictureDog = this->createImage(pixBufDog);
pictureVictory = this->createImage(pixBufVictory);
pictureVictory->show();
for (int i = 0; i < size; ++i)
{
for (int j = 0; j < size; ++j)
{
grid.attach(*listPixVoid[this->convert(i,j)], i,j,1,1);
}
}
this->flushGrid();
this->update(tab);
this->show_all_children(true);
}
示例4: v_box
MiApp1::MiApp1() :
// Gtk_Window(GTK_WINDOW_TOPLEVEL) : not needed,
// GTK_WINDOW_TOPLEVEL is the constructor arg's default value
v_box( false, 0 ),
m_box1(), // creates a box to pack widgets into
m_button1("Run"),
m_button2("Quit"),
aCanvas(),
aLine1(aCanvas, Gdk_Color("#00000000cd00")),
aLine2(aCanvas, Gdk_Color("#ff0045000000"))
{
// this is a new call, this just sets the title of our new window to
// "Hello Buttons!"
set_title("Draw on a Canvas");
// sets the border width of the window.
set_border_width(10);
// Sets window size
set_usize( 640, 400);
// Create the vertical vbox
add(&v_box);
// put the box into the main window.
v_box.pack_start(m_box1, false, true, 0);
// Now when the button is clicked, we call the "callback" function
// with a pointer to "button 1" as it's argument
connect_to_method(m_button1.clicked, this, &run );
// instead of gtk_container_add, we pack this button into the invisible
// box, which has been packed into the window.
// note that the pack_start default arguments are true, true, 0
m_box1.pack_start(m_button1, false, true, 0);
// always remember this step, this tells GTK that our preparation
// for this button is complete, and it can be displayed now.
m_button1.show();
// call the same callback function with a different argument,
// passing a pointer to "button 2" instead.
connect_to_method(m_button2.clicked, Gtk_Main::instance(), &Gtk_Main::quit );
m_box1.pack_start(m_button2, false, true, 0);
// The order in which we show the buttons is not really important,
// but I recommend showing the window last, so it all pops up at
// once.
m_button2.show();
v_box.pack_end(aCanvas, true, true, 0);
// now show
show_all();
aCanvas.draw();
}
示例5: set_border_width
HelloWorld::HelloWorld()
:m_button("Hello World")
{
set_border_width(10);
m_button.signal_clicked().connect(sigc::mem_fun(*this,
&HelloWorld::on_button_clicked));
add(m_button);
m_button.show();
}
示例6: plotArea_
gui::PlotWindow::PlotWindow(const std::string title,
const std::vector<int>& data) :
plotArea_(data) {
set_title(title);
set_resizable(false);
set_size_request(256 + BORDER_WIDTH, 256 + BORDER_WIDTH);
set_border_width(BORDER_WIDTH);
add(plotArea_);
plotArea_.show();
}
示例7: buttonBox_
gui::ToolBox::ToolBox(const Gtk::Image& original, Gtk::Image& current) :
Gtk::Frame(FRAME_LABEL), buttonBox_(Gtk::ORIENTATION_VERTICAL), imageOriginal_(
original), imageCurrent_(current) {
set_border_width(BORDER_WIDTH);
histogramWindow_ = nullptr;
initButtons();
connectAll();
addAll();
show_all_children();
}
示例8: set_title
Example_MarkerComboBox::Example_MarkerComboBox()
{
set_title("Marker Combo Box");
set_border_width(10);
this->add( m_MarkerComboBox );
show_all();
}
示例9: BreadCrumb
BreadCrumb(const Raul::Path& path, SPtr<GraphView> view = SPtr<GraphView>())
: _path(path)
, _view(view)
{
assert(!view || view->graph()->path() == path);
set_border_width(0);
set_path(path);
set_can_focus(false);
show_all();
}
示例10: m_box
Gobby::PreferencesDialog::Page::Page():
Gtk::Frame(), m_box(false, 12)
{
Gtk::Frame::add(m_box);
m_box.show();
// Remove shadow - use the frame just as container
set_shadow_type(Gtk::SHADOW_NONE);
set_border_width(12);
}
示例11: set_title
Example_StrokeWidget::Example_StrokeWidget()
{
set_title("Line Style Widget");
set_border_width(10);
this->add( m_StrokeWidget );
show_all();
}
示例12: bigbox
GUIWindow::GUIWindow() : bigbox(Gtk::ORIENTATION_VERTICAL, 15),
filebox(Gtk::ORIENTATION_HORIZONTAL, 5),
sizebox(Gtk::ORIENTATION_VERTICAL, 5)
{
resLevel = 3;
set_border_width(10);
bigbox.set_homogeneous(false);
filebox.set_homogeneous(false);
set_size_request(400, 600);
set_title("Mosaic Masterpiece");
add(bigbox);
filename.set_max_length(300);
filename.set_text("Pick an image...");
tags.set_text("Tags...");
tags.set_max_length(300);
browse.set_label("Browse...");
close.set_label("Close");
run.set_label("RUN!");
low.set_label("Low");
med.set_label("Medium");
high.set_label("High");
sizegroup = low.get_group();
med.set_group(sizegroup);
high.set_group(sizegroup);
high.set_active(true);
run.signal_clicked().connect(sigc::mem_fun(*this, &GUIWindow::OnRun));
close.signal_clicked().connect(sigc::mem_fun(*this, &GUIWindow::OnClose));
low.signal_clicked().connect(sigc::mem_fun(*this, &GUIWindow::LowRes));
med.signal_clicked().connect(sigc::mem_fun(*this, &GUIWindow::MedRes));
high.signal_clicked().connect(sigc::mem_fun(*this, &GUIWindow::HighRes));
status.set_label("Waiting for a picture...");
//filebox.pack_start(filename);
//filebox.pack_start(run);
sizebox.pack_start(low);
sizebox.pack_start(med);
sizebox.pack_start(high);
bigbox.pack_start(status);
bigbox.pack_start(filename);
bigbox.pack_start(browse);
bigbox.pack_start(sizebox);
bigbox.pack_start(tags);
bigbox.pack_start(run);
bigbox.pack_start(close);
show_all_children();
mm.OpenPipe();
}
示例13: BuilderFrame
BuilderFrame()
{
set_shadow_type(Gtk::SHADOW_ETCHED_IN);
set_border_width(5);
m_Label = Gtk::manage(new Gtk::Label());
m_Label->set_padding(3, 0);
m_Label->set_visible(true);
set_label_widget(*m_Label);
}
示例14: _stimTypes
ClassEditor::ClassEditor(StimTypes& stimTypes) :
Gtk::VBox(false, 6),
_stimTypes(stimTypes),
_updatesDisabled(false)
{
set_border_width(6);
_list = Gtk::manage(new Gtk::TreeView);
_list->set_size_request(TREE_VIEW_WIDTH, TREE_VIEW_HEIGHT);
// Connect the signals to the callbacks
_list->get_selection()->signal_changed().connect(sigc::mem_fun(*this, &ClassEditor::onSRSelectionChange));
_list->signal_key_press_event().connect(sigc::mem_fun(*this, &ClassEditor::onTreeViewKeyPress), false);
_list->signal_button_release_event().connect(
sigc::bind(sigc::mem_fun(*this, &ClassEditor::onTreeViewButtonRelease), _list));
// Add the columns to the treeview
// ID number
Gtk::TreeViewColumn* numCol = Gtk::manage(new Gtk::TreeViewColumn("#"));
Gtk::CellRendererText* numRenderer = Gtk::manage(new Gtk::CellRendererText);
numCol->pack_start(*numRenderer, false);
numCol->add_attribute(numRenderer->property_text(), SREntity::getColumns().index);
numCol->add_attribute(numRenderer->property_foreground(), SREntity::getColumns().colour);
_list->append_column(*numCol);
// The S/R icon
Gtk::TreeViewColumn* classCol = Gtk::manage(new Gtk::TreeViewColumn(_("S/R")));
Gtk::CellRendererPixbuf* pixbufRenderer = Gtk::manage(new Gtk::CellRendererPixbuf);
classCol->pack_start(*pixbufRenderer, false);
classCol->add_attribute(pixbufRenderer->property_pixbuf(), SREntity::getColumns().srClass);
_list->append_column(*classCol);
// The Type
Gtk::TreeViewColumn* typeCol = Gtk::manage(new Gtk::TreeViewColumn(_("Type")));
Gtk::CellRendererPixbuf* typeIconRenderer = Gtk::manage(new Gtk::CellRendererPixbuf);
typeCol->pack_start(*typeIconRenderer, false);
typeCol->add_attribute(typeIconRenderer->property_pixbuf(), SREntity::getColumns().icon);
Gtk::CellRendererText* typeTextRenderer = Gtk::manage(new Gtk::CellRendererText);
typeCol->pack_start(*typeTextRenderer, false);
typeCol->add_attribute(typeTextRenderer->property_text(), SREntity::getColumns().caption);
typeCol->add_attribute(typeTextRenderer->property_foreground(), SREntity::getColumns().colour);
_list->append_column(*typeCol);
}
示例15: set_title
Example_AffineController::Example_AffineController()
{
set_title("Selector Example");
set_border_width(10);
Gtk::Table* table = Gtk::manage( new Gtk::Table() );
// Create the selector
m_AffineController = Papyrus::AffineController::create();
m_AffineController->add( m_Viewport.canvas() );
m_Viewport.canvas()->set_size( 300, 200 );
// Create some shapes to add to the group
Papyrus::Rectangle::pointer rectangle = Papyrus::example_rectangle( );
Papyrus::Circle::pointer circle = Papyrus::example_circle( );
Papyrus::Arc::pointer arc = Papyrus::example_arc( );
Papyrus::Circle::pointer center_dot = Papyrus::Circle::create( 2.0, Papyrus::RGBA(0.0, 0.0, 0.0) );
// Add the shapes to the group
m_Viewport.canvas()->add( rectangle );
m_Viewport.canvas()->add( circle );
m_Viewport.canvas()->add( arc );
m_Viewport.canvas()->add( center_dot );
// Translate the shapes so they don't necessarily overlap
rectangle->set_xywh(0, -60, 50, 30);
circle->translate(40, 20);
circle->set_radius(25);
arc->translate(0, 20);
table->attach( m_Viewport, 0, 3, 0, 1 );
// Put Gtk labels and spin buttons for the various matrix effects in the table
Gtk::Label* label;
Gtk::Button* reset;
for ( unsigned i=0; i < SCALES; i++ )
{
label = Gtk::manage( new Gtk::Label( label_string[i], Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER ) );
table->attach( *label, 0, 1, i+1, i+2, Gtk::FILL );
reset = Gtk::manage( new Gtk::Button("Reset") );
reset->signal_clicked().connect( sigc::bind(sigc::mem_fun(*this, &Example_AffineController::on_reset), (Scale)i));
table->attach( *reset, 2, 3, i+1, i+2, Gtk::SHRINK, Gtk::SHRINK );
m_scale[i] = Gtk::manage( new Gtk::HScale(adjustments[i][0], adjustments[i][1], adjustments[i][2] ) );
m_scale[i]->set_value( adjustments[i][3] );
m_scale[i]->signal_value_changed().connect( sigc::bind( sigc::mem_fun(*this, &Example_AffineController::on_scale_changed), (Scale)i ));
table->attach( *(m_scale[i]), 1, 2, i+1, i+2 );
}
this->add( *table );
show_all();
}