本文整理汇总了C++中gtk::Table类的典型用法代码示例。如果您正苦于以下问题:C++ Table类的具体用法?C++ Table怎么用?C++ Table使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Table类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: manage
DlgDownload::DlgDownload(){
add_button (Gtk::Stock::OK, Gtk::RESPONSE_OK);
add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
signal_response().connect(
sigc::hide(sigc::mem_fun(this, &DlgDownload::hide_all)));
cb_w = manage(new Gtk::CheckButton("Waypoints"));
cb_a = manage(new Gtk::CheckButton("Active log"));
cb_o = manage(new Gtk::CheckButton("Saved tracks"));
Gtk::VButtonBox * bbox = manage(new Gtk::VButtonBox);
bbox->add(*cb_w);
bbox->add(*cb_a);
bbox->add(*cb_o);
Gtk::Frame * frame =
manage(new Gtk::Frame("Select data to be downloaded:"));
frame->add(*bbox);
Gtk::Label * l_dev =
manage(new Gtk::Label("GPS device:", Gtk::ALIGN_RIGHT));
e_dev = manage(new Gtk::Entry);
cb_off = manage(new Gtk::CheckButton("Turn off device after download"));
Gtk::Table * table = manage(new Gtk::Table(2,3));
table->attach(*frame, 0,2, 0,1, Gtk::FILL, Gtk::SHRINK, 3,3);
table->attach(*l_dev, 0,1, 1,2, Gtk::SHRINK, Gtk::SHRINK, 3,3);
table->attach(*e_dev, 1,2, 1,2, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK, 3,3);
table->attach(*cb_off, 0,2, 2,3, Gtk::FILL, Gtk::SHRINK, 3,3);
get_vbox()->add(*table);
}
开发者ID:ushakov,项目名称:mapsoft,代码行数:31,代码来源:download.cpp
示例2: toggleFullscreen
bool VRGuiBits::toggleFullscreen(GdkEventKey* k) {
if (k->keyval != 65480) return false;
static bool fs = false;
fs = !fs;
Gtk::Window* win; VRGuiBuilder()->get_widget("window1", win);
Gtk::Separator* hs1; VRGuiBuilder()->get_widget("hseparator1", hs1);
Gtk::Table* tab; VRGuiBuilder()->get_widget("table20", tab);
Gtk::Notebook* nb1; VRGuiBuilder()->get_widget("notebook1", nb1);
Gtk::Box* hb1; VRGuiBuilder()->get_widget("hbox1", hb1);
if (fs) {
win->fullscreen();
nb1->hide();
hb1->hide();
tab->hide();
hs1->hide();
gtk_widget_hide(term_box);
} else {
win->unfullscreen();
win->show_all();
}
return true;
}
开发者ID:TobiasHue,项目名称:polyvr,代码行数:25,代码来源:VRGuiBits.cpp
示例3: VBox
PreviewHolder::PreviewHolder() :
VBox(),
PreviewFillable(),
_scroller(0),
_insides(0),
_prefCols(0),
_updatesFrozen(false),
_anchor(SP_ANCHOR_CENTER),
_baseSize(PREVIEW_SIZE_SMALL),
_ratio(100),
_view(VIEW_TYPE_LIST),
_wrap(false),
_border(BORDER_NONE)
{
_scroller = manage(new Gtk::ScrolledWindow());
_insides = manage(new Gtk::Table( 1, 2 ));
_insides->set_col_spacings( 8 );
// Add a container with the scroller and a spacer
Gtk::Table* spaceHolder = manage( new Gtk::Table(1, 2) );
_scroller->add( *_insides );
spaceHolder->attach( *_scroller, 0, 1, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND );
pack_start(*spaceHolder, Gtk::PACK_EXPAND_WIDGET);
}
开发者ID:Spin0za,项目名称:inkscape,代码行数:25,代码来源:previewholder.cpp
示例4: add_scrolled_window
Gtk::Widget* CodeView::add_scrolled_window()
{
Gtk::Table* table = new Gtk::Table(2, 2, false);
table->attach(*this, 0, 1, 0, 1);
Gtk::VScrollbar* sb =
manage(new Gtk::VScrollbar(*get_vadjustment()));
table->attach(*sb, 1, 2, 0, 1, Gtk_FLAG(FILL));
return table;
}
开发者ID:Panke,项目名称:zerobugs,代码行数:11,代码来源:code_view_1.cpp
示例5:
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();
}
开发者ID:scott--,项目名称:papyrus,代码行数:53,代码来源:example_affine_controller.cpp
示例6: add_row
void ApplicationWizard::add_row(Gtk::Table& table, int row,
const Glib::RefPtr<Gtk::SizeGroup>& size_group,
const Glib::ustring& label_text,
Gtk::Widget& entry, Gtk::Button* btn)
{
Gtk::Label* pLabel = Gtk::manage(new Gtk::Label(label_text, true));
pLabel->set_alignment(Gtk::ALIGN_LEFT, Gtk::ALIGN_BOTTOM);
table.attach(*pLabel, 0, 1, row, row + 1, Gtk::FILL, Gtk::AttachOptions(0));
table.attach(entry, 1, 2, row, row + 1, Gtk::EXPAND|Gtk::FILL, Gtk::AttachOptions(0));
if(btn)
table.attach(*btn, 2, 3, row, row + 1, Gtk::SHRINK, Gtk::AttachOptions(0));
}
开发者ID:paulfitz,项目名称:yarp,代码行数:13,代码来源:application_wizard.cpp
示例7:
Gtk::Widget *FileSystemSyncServiceAddin::create_preferences_control(EventHandler requiredPrefChanged)
{
Gtk::Table *table = new Gtk::Table(1, 2, false);
table->set_row_spacings(5);
table->set_col_spacings(10);
// Read settings out of gconf
std::string syncPath;
if(get_config_settings(syncPath) == false) {
syncPath = "";
}
Gtk::Label *l = new Gtk::Label(_("_Folder Path:"), true);
l->property_xalign() = 1;
table->attach(*l, 0, 1, 0, 1,
Gtk::FILL,
Gtk::EXPAND | Gtk::FILL,
0, 0);
m_path_button = new Gtk::FileChooserButton(_("Select Synchronization Folder..."),
Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER);
m_path_button->signal_current_folder_changed().connect(requiredPrefChanged);
l->set_mnemonic_widget(*m_path_button);
m_path_button->set_filename(syncPath);
table->attach(*m_path_button, 1, 2, 0, 1,
Gtk::EXPAND | Gtk::FILL,
Gtk::EXPAND | Gtk::FILL,
0, 0);
table->set_hexpand(true);
table->set_vexpand(false);
table->show_all();
return table;
}
开发者ID:mjfrancis,项目名称:GnoteOSX,代码行数:35,代码来源:filesystemsyncserviceaddin.cpp
示例8: appendNamedWidget
void PrefPage::appendNamedWidget(const std::string& name, Gtk::Widget& widget)
{
Gtk::Table* table = Gtk::manage(new Gtk::Table(1, 3, true));
table->set_col_spacings(4);
table->set_row_spacings(0);
table->attach(*Gtk::manage(new gtkutil::LeftAlignedLabel(name)),
0, 1, 0, 1,
Gtk::EXPAND|Gtk::FILL, Gtk::AttachOptions(0));
table->attach(widget, 1, 3, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::AttachOptions(0));
_vbox->pack_start(*table, false, false, 0);
}
开发者ID:OpenTechEngine,项目名称:DarkRadiant,代码行数:15,代码来源:PrefPage.cpp
示例9: RADIO
ZoomControl(MainWindow *mw) : Gtk::Frame("Zoom control"), _mw(mw) {
mode = RE_AX;
set_border_width(10);
tbl = Gtk::manage(new Gtk::Table(2,4));
Gtk::RadioButton *b;
#define RADIO(LABEL,X1,Y1,MODE) do { \
b = Gtk::manage(new Gtk::RadioButton(grp, LABEL)); \
tbl->attach(*b, X1, X1+1, Y1, Y1+1); \
b->signal_toggled().connect(sigc::bind<Gtk::ToggleButton*, mode_t>( \
sigc::mem_fun(*this, &ZoomControl::do_toggle), \
b, MODE)); \
} while(0)
RADIO("Real (x) axis length", 0, 0, RE_AX);
RADIO("Imag (y) axis length", 1, 0, IM_AX);
RADIO("Real (x) pixel size", 0, 1, RE_PIX);
RADIO("Imag (y) pixel size", 1, 1, IM_PIX);
RADIO("Zoom factor", 0, 2, ZOOM);
field = Gtk::manage(new Util::HandyEntry<Fractal::Value>());
field->set_activates_default(true);
tbl->attach(*field, 0, 2, 3, 4);
add(*tbl);
}
开发者ID:crazyscot,项目名称:brot2,代码行数:25,代码来源:ParamsDialog.cpp
示例10:
Example_Scaler::Example_Scaler()
{
Gtk::HBox* hbox;
Gtk::VBox* vbox;
set_title("Scaler Example");
m_Scaler = Papyrus::Scaler::create( );
m_Viewport.add_controller( m_Scaler );
m_Viewport.set_size_request( 300, 200 );
// Create some shapes to add to the group
Papyrus::Arc::pointer arc = Papyrus::example_arc( );
// Add the shapes to the group
m_Viewport.canvas()->add( arc );
m_Scaler->add( arc );
vbox = Gtk::manage( new Gtk::VBox() );
vbox->pack_start( m_Viewport );
vbox->pack_start( *Gtk::manage( new Gtk::HSeparator() ) );
Gtk::Table* table;
table = Gtk::manage( new Gtk::Table() );
m_side_buttons[0].set_label("Top");
m_side_buttons[1].set_label("Right");
m_side_buttons[2].set_label("Bottom");
m_side_buttons[3].set_label("Left");
table->attach( m_side_buttons[0], 1, 2, 0, 1 );
table->attach( m_side_buttons[1], 2, 3, 1, 2 );
table->attach( m_side_buttons[2], 1, 2, 2, 3 );
table->attach( m_side_buttons[3], 0, 1, 1, 2 );
for ( int i=0; i < 4; i++ )
{
m_side_buttons[i].set_active(true);
m_side_buttons[i].signal_toggled().connect(sigc::bind(sigc::mem_fun(*this, &Example_Scaler::on_button_toggled), i ) );
}
vbox->pack_start( *table );
this->add( *vbox );
show_all();
}
开发者ID:scott--,项目名称:papyrus,代码行数:46,代码来源:example_scaler.cpp
示例11:
NewDialog(Gtk::Window *parent):
Gtk::Dialog(_("New project"), *this, true),
xmlmode(_("Read image names in _XML Altos"), true),
filemode(_("Match images and XML Altos _filenames"), true),
xmlpath(_("Path to the XML Alto files"), Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER),
imgpath(_("Path to the images"), Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER),
showimgpath(_("_Images are in a different folder"), true),
imgpathlab(_("Images path"))
{
add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
okbut = add_button(Gtk::Stock::OK, Gtk::RESPONSE_ACCEPT);
okbut->set_sensitive(false);
std::vector<int> altbut;
altbut.push_back(Gtk::RESPONSE_ACCEPT);
altbut.push_back(Gtk::RESPONSE_CANCEL);
set_alternative_button_order_from_array(altbut);
set_default_response(Gtk::RESPONSE_ACCEPT);
Gtk::Table *tab = Gtk::manage(new Gtk::Table(6, 2));
get_vbox()->pack_start(*tab, true, true);
tab->attach(*Gtk::manage(new Gtk::Label(_("Project name"))), 0, 1, 0, 1, Gtk::FILL, Gtk::FILL);
tab->attach(projectname, 1, 2, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL);
projectname.signal_changed().connect(sigc::mem_fun(this, &NewDialog::on_name_changed));
projectname.set_activates_default(true);
Gtk::RadioButton::Group g;
xmlmode.set_group(g);
tab->attach(xmlmode, 0, 2, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL);
filemode.set_group(g);
tab->attach(filemode, 0, 2, 2, 3, Gtk::FILL|Gtk::EXPAND, Gtk::FILL);
xmlmode.set_active(false);
xmlmode.signal_toggled().connect(sigc::mem_fun(this, &NewDialog::on_mode_changed));
tab->attach(*Gtk::manage(new Gtk::Label(_("XML Altos path"))), 0, 1, 3, 4, Gtk::FILL, Gtk::FILL);
tab->attach(xmlpath, 1, 2, 3, 4, Gtk::FILL|Gtk::EXPAND, Gtk::FILL);
xmlpath.signal_current_folder_changed().connect(sigc::mem_fun(this, &NewDialog::on_xml_folder_changed));
tab->attach(showimgpath, 0, 2, 4, 5, Gtk::FILL|Gtk::EXPAND, Gtk::FILL);
showimgpath.set_active(false);
showimgpath.signal_toggled().connect(sigc::mem_fun(this, &NewDialog::on_show_img_path));
show_all();
tab->attach(imgpathlab, 0, 1, 5, 6, Gtk::FILL, Gtk::FILL);
tab->attach(imgpath, 1, 2, 5, 6, Gtk::FILL|Gtk::EXPAND, Gtk::FILL);
}
开发者ID:Liris-Pleiad,项目名称:libcrn,代码行数:41,代码来源:nimrod.cpp
示例12: cargarVentana
void PanelRecords::cargarVentana() {
Gtk::Table* tabla = manage(new Gtk::Table(records.size(), 3, true));
tabla->set_row_spacings(10);
unsigned int contador = 0;
list< pair<string, int> >::iterator iterador = records.begin();
while (contador < records.size()) {
std::stringstream ss;
ss << (contador+1);
Gtk::Label* etiquetaNumero = manage(new Gtk::Label(ss.str()));
tabla->attach(*etiquetaNumero, 0, 1, contador, contador+1);
Gtk::Label* etiquetaNombre = manage(new Gtk::Label(iterador->first));
tabla->attach(*etiquetaNombre, 1, 2, contador, contador+1);
std::stringstream ss_dos;
ss_dos << iterador->second;
Gtk::Label* etiquetaPuntaje = manage(new Gtk::Label(ss_dos.str()));
tabla->attach(*etiquetaPuntaje, 2, 3, contador, contador+1);
++iterador;
++contador;
}
ventana->add(*tabla);
}
开发者ID:ezeperez26,项目名称:cerditosfuriosos,代码行数:21,代码来源:PanelRecords.cpp
示例13:
Gtk::Widget *WebDavSyncServiceAddin::create_preferences_control(EventHandler requiredPrefChanged)
{
Gtk::Table *table = new Gtk::Table(3, 2, false);
table->set_row_spacings(5);
table->set_col_spacings(10);
// Read settings out of gconf
Glib::ustring url, username, password;
get_config_settings(url, username, password);
m_url_entry = new Gtk::Entry();
m_url_entry->set_text(url);
m_url_entry->signal_changed().connect(requiredPrefChanged);
add_row(table, m_url_entry, _("_URL:"), 0);
m_username_entry = new Gtk::Entry();
m_username_entry->set_text(username);
m_username_entry->signal_changed().connect(requiredPrefChanged);
add_row(table, m_username_entry, _("User_name:"), 1);
m_password_entry = new Gtk::Entry();
m_password_entry->set_text(password);
m_password_entry->set_visibility(false);
m_password_entry->signal_changed().connect(requiredPrefChanged);
add_row(table, m_password_entry, _("_Password:"), 2);
table->set_hexpand(true);
table->set_vexpand(false);
table->show_all();
return table;
}
开发者ID:mattiklock,项目名称:gnote,代码行数:31,代码来源:webdavsyncserviceaddin.cpp
示例14: ZoomControl
ParamsDialog::ParamsDialog(MainWindow *_mw) : Gtk::Dialog("Parameters", *_mw, true),
mw(_mw)
{
add_button(Gtk::Stock::CANCEL, Gtk::ResponseType::RESPONSE_CANCEL);
add_button(Gtk::Stock::OK, Gtk::ResponseType::RESPONSE_OK);
Gtk::Box* box = get_vbox();
Gtk::Table *tbl = Gtk::manage(new Gtk::Table(3,2));
f_c_re = Gtk::manage(new Util::HandyEntry<Fractal::Value>());
f_c_re->set_activates_default(true);
f_c_im = Gtk::manage(new Util::HandyEntry<Fractal::Value>());
f_c_im->set_activates_default(true);
zc = Gtk::manage(new ZoomControl(mw));
Gtk::Label* label;
label = Gtk::manage(new Gtk::Label("Centre Real (x) "));
label->set_alignment(1, 0.5);
tbl->attach(*label, 0, 1, 0, 1);
tbl->attach(*f_c_re, 1, 2, 0, 1);
label = Gtk::manage(new Gtk::Label("Centre Imaginary (y) "));
label->set_alignment(1, 0.5);
tbl->attach(*label, 0, 1, 1, 2);
tbl->attach(*f_c_im, 1, 2, 1, 2);
tbl->attach(*zc, 0, 2, 2, 3);
box->pack_start(*tbl);
set_default_response(Gtk::ResponseType::RESPONSE_OK);
}
开发者ID:crazyscot,项目名称:brot2,代码行数:33,代码来源:ParamsDialog.cpp
示例15:
DirectoriesConfigDialog::DirectoriesConfigDialog(Config::Section * _poConfig) :
Gtk::Dialog(_("Directories config"), true, true),
m_poConfig(_poConfig)
{
Gtk::Table * poTable = Gtk::manage( new Gtk::Table(G_N_ELEMENTS(m_astDirs), 2, false));
poTable->set_border_width(5);
poTable->set_spacings(5);
for (guint i = 0; i < G_N_ELEMENTS(m_astDirs); i++)
{
Gtk::Label * poLabel = Gtk::manage( new Gtk::Label(gettext(m_astDirs[i].m_csLabel), Gtk::ALIGN_RIGHT) );
m_poButtons[i] = Gtk::manage( new Gtk::FileChooserButton(Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER) );
m_poButtons[i]->set_current_folder(m_poConfig->sGetKey(m_astDirs[i].m_csKey));
poTable->attach(* poLabel, 0, 1, i, i + 1);
poTable->attach(* m_poButtons[i], 1, 2, i, i + 1);
}
add_button(Gtk::Stock::CLOSE, Gtk::RESPONSE_CLOSE);
get_vbox()->pack_start(* poTable);
show_all_children();
}
开发者ID:,项目名称:,代码行数:22,代码来源:
示例16: manage
studio::Dock_Info::Dock_Info()
:Dock_CanvasSpecific("info",_("Info"),Gtk::StockID("synfig-info"))
{
set_use_scrolled(false);
Gtk::Table *table = manage(new Gtk::Table);
//pos labels
table->attach(*manage(new Gtk::Label(_("X: "))),0,1,0,2,Gtk::EXPAND|Gtk::FILL,Gtk::SHRINK|Gtk::FILL);
table->attach(*manage(new Gtk::Label(_("Y: "))),0,1,2,4,Gtk::EXPAND|Gtk::FILL,Gtk::SHRINK|Gtk::FILL);
//pos
table->attach(x,1,2,0,2,Gtk::EXPAND|Gtk::FILL,Gtk::SHRINK|Gtk::FILL);
table->attach(y,1,2,2,4,Gtk::EXPAND|Gtk::FILL,Gtk::SHRINK|Gtk::FILL);
//separator
table->attach(*manage(new Gtk::VSeparator),2,3,0,4,Gtk::EXPAND|Gtk::FILL,Gtk::SHRINK|Gtk::FILL);
//color label
table->attach(*manage(new Gtk::Label(_("R: "))),3,4,0,1,Gtk::EXPAND|Gtk::FILL,Gtk::SHRINK|Gtk::FILL);
table->attach(*manage(new Gtk::Label(_("G: "))),3,4,1,2,Gtk::EXPAND|Gtk::FILL,Gtk::SHRINK|Gtk::FILL);
table->attach(*manage(new Gtk::Label(_("B: "))),3,4,2,3,Gtk::EXPAND|Gtk::FILL,Gtk::SHRINK|Gtk::FILL);
table->attach(*manage(new Gtk::Label(_("A: "))),3,4,3,4,Gtk::EXPAND|Gtk::FILL,Gtk::SHRINK|Gtk::FILL);
//color
table->attach(r,4,5,0,1,Gtk::EXPAND|Gtk::FILL,Gtk::SHRINK|Gtk::FILL);
table->attach(g,4,5,1,2,Gtk::EXPAND|Gtk::FILL,Gtk::SHRINK|Gtk::FILL);
table->attach(b,4,5,2,3,Gtk::EXPAND|Gtk::FILL,Gtk::SHRINK|Gtk::FILL);
table->attach(a,4,5,3,4,Gtk::EXPAND|Gtk::FILL,Gtk::SHRINK|Gtk::FILL);
table->attach(*manage(new Gtk::Label),0,5,4,5);
table->show_all();
add(*table);
}
开发者ID:,项目名称:,代码行数:36,代码来源:
示例17: manage
studio::Dialog_SoundSelect::Dialog_SoundSelect(Gtk::Window &parent, etl::handle<synfigapp::CanvasInterface> ci)
:Dialog(_("Sound Select"), parent),
canvas_interface(ci)
{
Gtk::Alignment *dialogPadding = manage(new Gtk::Alignment(0, 0, 1, 1));
dialogPadding->set_padding(12, 12, 12, 12);
get_vbox()->pack_start(*dialogPadding, false, false, 0);
Gtk::Frame *soundFrame = manage(new Gtk::Frame(_("Sound Parameters")));
((Gtk::Label *) soundFrame->get_label_widget())->set_markup(_("<b>Sound Parameters</b>"));
soundFrame->set_shadow_type(Gtk::SHADOW_NONE);
dialogPadding->add(*soundFrame);
Gtk::Alignment *framePadding = manage(new Gtk::Alignment(0, 0, 1, 1));
framePadding->set_padding(6, 0, 24, 0);
soundFrame->add(*framePadding);
Gtk::Label *fileLabel = manage(new Gtk::Label(_("_Sound File"), true));
fileLabel->set_alignment(0, 0.5);
fileLabel->set_mnemonic_widget(soundfile);
Gtk::Label *offsetLabel = manage(new Gtk::Label(_("Time _Offset"), true));
offsetLabel->set_alignment(0, 0.5);
offsetLabel->set_mnemonic_widget(offset);
Gtk::Table *table = manage(new Gtk::Table(2, 2, false));
table->set_row_spacings(6);
table->set_col_spacings(12);
framePadding->add(*table);
table->attach(*fileLabel, 0, 1, 0, 1, Gtk::SHRINK | Gtk::FILL, Gtk::SHRINK | Gtk::FILL, 0, 0);
table->attach(soundfile, 1, 2, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK | Gtk::FILL, 0, 0);
table->attach(*offsetLabel, 0, 1, 1, 2, Gtk::SHRINK | Gtk::FILL, Gtk::SHRINK | Gtk::FILL, 0, 0);
table->attach(offset, 1, 2, 1, 2, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK | Gtk::FILL, 0, 0);
okbutton = manage(new Gtk::Button(Gtk::StockID("gtk-ok")));
add_action_widget(*okbutton, 0);
get_vbox()->show_all();
offset.set_value(0);
okbutton->signal_clicked().connect(sigc::mem_fun(*this,&Dialog_SoundSelect::on_ok));
}
开发者ID:ChillyCider,项目名称:synfig-reloaded,代码行数:43,代码来源:dialog_soundselect.cpp
示例18:
void
StateBrush_Context::refresh_tool_options()
{
brush_buttons.clear();
App::dialog_tool_options->clear();
App::dialog_tool_options->set_local_name(_("Brush Tool"));
App::dialog_tool_options->set_name("brush");
// create container
Gtk::Table *table = Gtk::manage(new Gtk::Table(1, 2, false));
// create options
table->attach(eraser_checkbox, 0, 1, 0, 1, Gtk::FILL, Gtk::SHRINK);
// create brushes container widget
int cols = 4;
Gtk::Table *brushes_table = Gtk::manage(new Gtk::Table(1, cols));
// load brushes
// scan directories
std::set<String> files;
for(std::set<String>::const_iterator i = paths.begin(); i != paths.end(); ++i)
scan_directory(*i, 1, files);
// load files
int col = 0; int row = 0;
Gtk::ToggleButton *first_button = NULL;
Gtk::IconSize iconsize = Gtk::ICON_SIZE_LARGE_TOOLBAR;
for(std::set<String>::const_iterator i = files.begin(); i != files.end(); ++i)
{
if (!brush_buttons.count(*i) && filename_extension(*i) == ".myb")
{
const String &brush_file = *i;
const String icon_file = filename_sans_extension(brush_file) + "_prev.png";
if (files.count(icon_file))
{
// create button
Gtk::ToggleButton *button = brush_buttons[*i] = Gtk::manage(new Gtk::ToggleButton());
Glib::RefPtr<Gdk::Pixbuf> pixbuf, pixbuf_scaled;
pixbuf = Gdk::Pixbuf::create_from_file(icon_file);
pixbuf_scaled = pixbuf->scale_simple(48, 48, Gdk::INTERP_BILINEAR);
button->set_image(*Gtk::manage(new Gtk::Image(pixbuf_scaled)));
button->set_relief(Gtk::RELIEF_NONE);
button->signal_toggled().connect(
sigc::bind(sigc::mem_fun(*this, &StateBrush_Context::select_brush), button, brush_file) );
if (first_button == NULL) first_button = button;
if (col >= cols)
{
// add row
col = 0;
++row;
brushes_table->resize(row + 1, cols);
}
// add button
brushes_table->attach(*button, col, col+1, row, row+1);
++col;
}
}
}
Gtk::ScrolledWindow *brushes_scroll = Gtk::manage(new Gtk::ScrolledWindow());
brushes_scroll->add(*brushes_table);
table->attach(*brushes_scroll, 0, 1, 1, 2);
table->show_all();
App::dialog_tool_options->add(*table);
// select first brush
if (first_button != NULL) first_button->set_active(true);
}
开发者ID:yellow-dee,项目名称:synfig,代码行数:71,代码来源:state_brush.cpp
示例19:
Gtk::Widget& DifficultyEditor::createEditingWidgets()
{
_editorPane = Gtk::manage(new Gtk::VBox(false, 6));
_editorPane->set_border_width(12);
// The "Settings" label
Gtk::Label* settingsLabel = Gtk::manage(new gtkutil::LeftAlignedLabel(std::string("<b>") + _("Setting") + "</b>"));
_editorPane->pack_start(*settingsLabel, false, false, 0);
// The table aligning the editing widgets
Gtk::Table* table = Gtk::manage(new Gtk::Table(3, 2, false));
table->set_col_spacings(12);
table->set_row_spacings(6);
_editorPane->pack_start(*Gtk::manage(new gtkutil::LeftAlignment(*table, 18, 1.0)), false, false, 0);
// ===== CLASSNAME ======
Gtk::Label* classNameLabel = Gtk::manage(new gtkutil::LeftAlignedLabel(_("Classname:")));
// Add classname widget
_classCombo = Gtk::manage(new Gtk::ComboBoxEntry(
ClassNameStore::Instance().getModel(),
ClassNameStore::Instance().getColumns().classname
));
// Add completion functionality to the combobox entry
Glib::RefPtr<Gtk::EntryCompletion> completion = Gtk::EntryCompletion::create();
completion->set_model(ClassNameStore::Instance().getModel());
completion->set_text_column(ClassNameStore::Instance().getColumns().classname);
_classCombo->get_entry()->set_completion(completion);
table->attach(*classNameLabel, 0, 1, 0, 1, Gtk::FILL, Gtk::AttachOptions(0), 0, 0);
table->attach(*_classCombo, 1, 2, 0, 1);
// ===== SPAWNARG ======
_spawnArgEntry = Gtk::manage(new Gtk::Entry);
Gtk::Label* spawnArgLabel = Gtk::manage(new gtkutil::LeftAlignedLabel(_("Spawnarg:")));
table->attach(*spawnArgLabel, 0, 1, 1, 2, Gtk::FILL, Gtk::AttachOptions(0), 0, 0);
table->attach(*_spawnArgEntry, 1, 2, 1, 2);
// ===== ARGUMENT ======
_argumentEntry = Gtk::manage(new Gtk::Entry);
Gtk::Label* argumentLabel = Gtk::manage(new gtkutil::LeftAlignedLabel(_("Argument:")));
// The appType chooser
_appTypeCombo = Gtk::manage(new Gtk::ComboBox(difficulty::Setting::getAppTypeStore()));
_appTypeCombo->signal_changed().connect(sigc::mem_fun(*this, &DifficultyEditor::onAppTypeChange));
// Add the cellrenderer for the apptype text
Gtk::CellRendererText* appTypeRenderer = Gtk::manage(new Gtk::CellRendererText);
_appTypeCombo->pack_start(*appTypeRenderer, false);
_appTypeCombo->add_attribute(appTypeRenderer->property_text(), difficulty::Setting::getTreeModelColumns().name);
// Pack the argument entry and the appType dropdown field together
Gtk::HBox* argHBox = Gtk::manage(new Gtk::HBox(false, 6));
argHBox->pack_start(*_argumentEntry, true, true, 0);
argHBox->pack_start(*_appTypeCombo, false, false, 0);
table->attach(*argumentLabel, 0, 1, 2, 3, Gtk::FILL, Gtk::AttachOptions(0), 0, 0);
table->attach(*argHBox, 1, 2, 2, 3);
// Save button
Gtk::HBox* buttonHbox = Gtk::manage(new Gtk::HBox(false, 6));
_saveSettingButton = Gtk::manage(new Gtk::Button(Gtk::Stock::SAVE));
_saveSettingButton->signal_clicked().connect(sigc::mem_fun(*this, &DifficultyEditor::onSettingSave));
buttonHbox->pack_start(*_saveSettingButton, false, false, 0);
_editorPane->pack_start(*Gtk::manage(new gtkutil::RightAlignment(*buttonHbox)), false, false, 0);
// The "note" text
_noteText = Gtk::manage(new Gtk::Label);
_noteText->set_line_wrap(true);
_editorPane->pack_start(*Gtk::manage(new gtkutil::LeftAlignment(*_noteText)), false, false, 6);
return *_editorPane;
}
开发者ID:DerSaidin,项目名称:DarkRadiant,代码行数:81,代码来源:DifficultyEditor.cpp
示例20: RadioButton
ModelGeneratorCreationDialog::ModelGeneratorCreationDialog(
openfluid::core::CoreRepository& CoreRepos,
openfluid::machine::ModelInstance* ModelInstance) :
mp_CoreRepos(&CoreRepos), mp_ModelInstance(ModelInstance)
{
mp_VarNameEntry = Gtk::manage(new Gtk::Entry());
mp_VarNameEntry->set_activates_default(true);
mp_VarNameEntry->signal_changed().connect(sigc::mem_fun(*this,
&ModelGeneratorCreationDialog::onVarNameEntryChanged));
mp_ClassCombo = Gtk::manage(new Gtk::ComboBoxText());
Gtk::RadioButton::Group RadioGrp;
mp_ScalarRadio = Gtk::manage(
new Gtk::RadioButton(RadioGrp, _("Double Value")));
mp_VectorRadio = Gtk::manage(new Gtk::RadioButton(RadioGrp,
_("Vector Value:") + std::string(" ")));
mp_VarSizeSpin = Gtk::manage(new Gtk::SpinButton());
mp_VarSizeSpin->set_numeric(true);
mp_VarSizeSpin->set_increments(1, 1);
mp_VarSizeSpin->set_range(2.0, 9.0);
mp_VarSizeSpin->set_activates_default(true);
Gtk::Table* GenInfoTable = Gtk::manage(new Gtk::Table());
GenInfoTable->set_row_spacings(10);
GenInfoTable->set_col_spacings(3);
GenInfoTable->attach(
*Gtk::manage(new Gtk::Label(_("Variable name"), 1, 0.5)), 0, 1, 0, 1,
Gtk::FILL, Gtk::SHRINK);
GenInfoTable->attach(*mp_VarNameEntry, 1, 2, 0, 1, Gtk::SHRINK, Gtk::SHRINK);
GenInfoTable->attach(*Gtk::manage(new Gtk::Label(_("Unit class"), 1, 0.5)),
0, 1, 1, 2, Gtk::FILL, Gtk::SHRINK);
GenInfoTable->attach(*mp_ClassCombo, 1, 2, 1, 2, Gtk::FILL, Gtk::SHRINK);
Gtk::HBox* VectorBox = Gtk::manage(new Gtk::HBox());
VectorBox->pack_start(*mp_VectorRadio, Gtk::PACK_SHRINK);
VectorBox->pack_start(*Gtk::manage(new Gtk::Label(_("Size"))),
Gtk::PACK_SHRINK);
VectorBox->pack_start(*mp_VarSizeSpin, Gtk::PACK_SHRINK);
mp_Dialog = new Gtk::Dialog(_("Generator creation"));
mp_InfoBarLabel = Gtk::manage(new Gtk::Label(""));
mp_InfoBar = Gtk::manage(new Gtk::InfoBar());
mp_InfoBar->set_message_type(Gtk::MESSAGE_WARNING);
((Gtk::Container*) mp_InfoBar->get_content_area())->add(*mp_InfoBarLabel);
mp_Dialog->get_vbox()->pack_start(*mp_InfoBar, Gtk::PACK_SHRINK);
mp_Dialog->get_vbox()->pack_start(*GenInfoTable, Gtk::PACK_SHRINK, 10);
mp_Dialog->get_vbox()->pack_start(*mp_ScalarRadio, Gtk::PACK_SHRINK);
mp_Dialog->get_vbox()->pack_start(*VectorBox, Gtk::PACK_SHRINK, 10);
mp_Dialog->add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
mp_Dialog->add_button(Gtk::Stock::OK, Gtk::RESPONSE_OK);
mp_Dialog->set_default_response(Gtk::RESPONSE_OK);
mp_Dialog->show_all_children();
}
开发者ID:VaysseB,项目名称:openfluid,代码行数:63,代码来源:ModelGeneratorCreationDialog.cpp
注:本文中的gtk::Table类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论