Ejemplo n.º 1
0
int main(int argc, char *argv[]){
  char buf[BUF_SIZE];
  coord place, holder;
  init(argc, argv);
  holder.x = holder.y = place.x = place.y = SIZE/2;

  app_1(place); show_all(holder);
  run(place);        show_all(holder);
  do{
    place = queue[qbeg].place;
    run_queue(); show_all(holder);
    run(place);  show_all(holder);
  } while(queue_population() > 0);

  SHOULD(count(INTEGER) == 1);
  SHOULD(count(LOCAL)   == 0);
  SHOULD(count(LAMBDA)  == 0);
  SHOULD(count(SYMBOL)  == 0);

  place.x = place.y = SIZE/2;
  onc_to_string(place, buf, 0);
  debug(1, "(%d,%d):%s\n", place.x, place.y, buf);
  debug(1, "integer:%d local:%d lambda:%d symbol:%d\n",
        count(INTEGER), count(LOCAL), count(LAMBDA), count(SYMBOL));
  
  /* return indicates success or failure */
  return fail_p;
}
Ejemplo n.º 2
0
void WidgetChatBubble::add_filerecv(Toxmm::EventFileRecv file) {
    auto msg_time = Glib::DateTime::create_now_utc();

    // remove seconds
    msg_time = Glib::DateTime::create_utc(msg_time.get_year(),
                                          msg_time.get_month(),
                                          msg_time.get_day_of_month(),
                                          msg_time.get_hour(),
                                          msg_time.get_minute(),
                                          0);

    bool display_time = true;

    if (m_last_timestamp != 0) {
        auto old_time = Glib::DateTime::create_now_utc(m_last_timestamp);
        // remove seconds
        old_time = Glib::DateTime::create_utc(old_time.get_year(),
                                              old_time.get_month(),
                                              old_time.get_day_of_month(),
                                              old_time.get_hour(),
                                              old_time.get_minute(),
                                              0);
        // check
        display_time = !(msg_time.compare(old_time) == 0);
    }

    // create a new row
    auto msg  = Gtk::manage(WidgetChatFileRecv::create(observable(), file));
    auto time = Gtk::manage(new Gtk::Label());
    m_last_timestamp = msg_time.to_unix();

    // get local time
    msg_time = Glib::DateTime::create_now_local(m_last_timestamp);

    time->set_text(msg_time.format("%R"));

    // add to grid
    if (m_side == RIGHT) {
        rows.emplace_back(m_grid, m_row_count, *msg, *time);
    } else {
        rows.emplace_back(m_grid, m_row_count, *time, *msg);
    }
    m_row_count += 1;

    // styling
    time->set_halign(Gtk::ALIGN_CENTER);
    time->set_valign(Gtk::ALIGN_START);
    time->get_style_context()->add_class("bubble_chat_line_time");

    msg->set_halign(Gtk::ALIGN_START);
    msg->set_valign(Gtk::ALIGN_CENTER);

    msg->show_all();
    time->show_all();
    time->set_no_show_all();
    if (!display_time) {
        time->hide();
    }
}
Ejemplo n.º 3
0
int main(int argc, char *argv[]){
  coord place, target, temp;
  init(argc, argv);
  place.x = place.y = 0;
  target.x = target.y = SIZE/2;

  AT(place).refs = 1;
  AT(place).car.hdr = LOCAL;
  PTR_OF_COORD(AT(place).car, target);
  AT(place).cdr.hdr = NIL;
  AT(target).refs = 1;
  AT(target).car.hdr = INTEGER;
  AT(target).car.car = 2;
  AT(target).cdr.hdr = INTEGER;
  AT(target).cdr.car = 2;

  COORD_OF_PTR(temp, AT(place).car);
  debug(1, "AT(place).car -> (%d,%d,%d,%d,%d)\n",
        AT(place).car.hdr, temp.x, temp.y, temp.X, temp.Y);
  show_all(place);

  update_ref_msg(place, 1);
  run_down(place);
  
  debug(1, "AT(place).refs %d == 2\n", AT(place).refs);
  SHOULD(AT(place).refs == 2);
  debug(1, "AT(target).refs %d == 2\n", AT(target).refs);
  SHOULD(AT(target).refs == 2);

  update_ref_msg(place, -1);
  run_down(place);

  show_all(place);
  debug(1, "AT(place).refs %d == 1\n", AT(place).refs);
  SHOULD(AT(place).refs == 1);
  debug(1, "AT(target).refs %d == 1\n", AT(target).refs);
  SHOULD(AT(target).refs == 1);

  update_ref_msg(place, -1);
  run_down(place);

  show_all(place);
  debug(1, "AT(place).refs %d == 0\n", AT(place).refs);
  SHOULD(AT(place).refs == 0);
  debug(1, "AT(target).refs %d == 0\n", AT(target).refs);
  SHOULD(AT(target).refs == 0);
  
  /* return indicates success or failure */
  return fail_p;
}
Ejemplo n.º 4
0
ScriptWindow::ScriptWindow() :
	Gtk::VBox(false, 6),
	_outView(Gtk::manage(new gtkutil::ConsoleView)),
	_view(Gtk::manage(new gtkutil::SourceView(SCRIPT_LANGUAGE_ID, false))) // allow editing
{
	_view->unset_focus_chain();

	Gtk::Button* runButton = Gtk::manage(new Gtk::Button(_("Run Script")));
	runButton->signal_clicked().connect(sigc::mem_fun(*this, &ScriptWindow::onRunScript));

	Gtk::HBox* buttonBar = Gtk::manage(new Gtk::HBox(false, 6));
	buttonBar->pack_start(*runButton, false, false, 0);

	Gtk::VBox* inputVBox = Gtk::manage(new Gtk::VBox(false, 3));
	inputVBox->pack_start(*Gtk::manage(new gtkutil::LeftAlignedLabel(_("Python Script Input"))), false, false, 0);
	inputVBox->pack_start(*_view, true, true, 0);
	inputVBox->pack_start(*buttonBar, false, false, 0);

	// Pack the scrolled textview and the entry box to the vbox
	Gtk::VPaned* paned = Gtk::manage(new Gtk::VPaned);
	paned->add1(*inputVBox);
	paned->add2(*_outView);

	pack_start(*paned, true, true, 0);
	show_all();
}
Ejemplo n.º 5
0
Gobby::EntryDialog::EntryDialog(Gtk::Window& parent,
                                const Glib::ustring& title,
                                const Glib::ustring& label):
	Gtk::Dialog(title, parent, true, true), m_label(label), m_box(false, 5),
	m_check_valid_entry(false)
{
	m_entry.set_activates_default(true);

	m_box.pack_start(m_label);
	m_box.pack_start(m_entry);

	get_vbox()->set_spacing(5);
	get_vbox()->pack_start(m_box);

	m_entry.signal_changed().connect(
		sigc::mem_fun(*this, &EntryDialog::on_entry_changed)
	);

	add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
	add_button(Gtk::Stock::OK, Gtk::RESPONSE_OK);
	set_default_response(Gtk::RESPONSE_OK);

	show_all();
	set_border_width(10);
	set_resizable(false);
}
Ejemplo n.º 6
0
DualSpinScale::DualSpinScale(const char* label1, const char* label2, double value, double lower, double upper, double step_inc,
                               double climb_rate, int digits, const SPAttributeEnum a, char* tip_text1, char* tip_text2)
    : AttrWidget(a),
      _s1(label1, value, lower, upper, step_inc, climb_rate, digits, SP_ATTR_INVALID, tip_text1),
      _s2(label2, value, lower, upper, step_inc, climb_rate, digits, SP_ATTR_INVALID, tip_text2),
      //TRANSLATORS: "Link" means to _link_ two sliders together
      _link(C_("Sliders", "Link"))
{
    signal_value_changed().connect(signal_attr_changed().make_slot());

    _s1.get_adjustment()->signal_value_changed().connect(_signal_value_changed.make_slot());
    _s2.get_adjustment()->signal_value_changed().connect(_signal_value_changed.make_slot());
    _s1.get_adjustment()->signal_value_changed().connect(sigc::mem_fun(*this, &DualSpinScale::update_linked));

    _link.signal_toggled().connect(sigc::mem_fun(*this, &DualSpinScale::link_toggled));

    Gtk::VBox* vb = Gtk::manage(new Gtk::VBox);
    vb->add(_s1);
    vb->add(_s2);
    pack_start(*vb);
    pack_start(_link, false, false);
    _link.set_active(true);

    show_all();
}
Ejemplo n.º 7
0
void
ExpireDialog::init()
{
    _spinner.set_numeric (true);
    _spinner.set_digits (1);
    _spinner.set_range (0, 30);
    _spinner.set_snap_to_ticks();
    _spinner.set_adjustment (_adj);
    _spinner.set_value (AppContext::get().get_expire());

    Gtk::VBox *vbox = get_vbox();
    vbox->pack_start (_label1, Gtk::PACK_SHRINK, 10);
    _box.add (*new Gtk::HBox);
    _box.pack_start (_spinner, Gtk::PACK_SHRINK, 10);
    _box.pack_start (_label2, Gtk::PACK_SHRINK, 0);
    _box.add (*new Gtk::HBox);
    vbox->pack_start (_box, Gtk::PACK_EXPAND_PADDING, 10);

    add_button (_("Do expire"), 1);
    add_button (Gtk::Stock::CANCEL, 0);

    /// Move focus to Do button
    cwidget_list_t list = get_action_area()->get_children();
    for (cwidget_list_t::iterator it = list.begin(); it != list.end(); ++it)
        if (get_response_for_widget (**it) == 1)
        { const_cast<Widget&>(**it).grab_focus(); break; }
    
    _changed_connection = _adj.signal_value_changed().connect (
            sigc::mem_fun (*this, &ExpireDialog::on_value_changed));
    
    show_all();
}
Ejemplo n.º 8
0
void SliderWindow::setWindowPosition(const iconPosition &pos)
{
	if (!get_visible()) {
#ifndef IS_GTK_2
		const int wWidth = volumeSlider_->get_allocated_width();
		const int wHeight = volumeSlider_->get_allocated_height();
#else
		const int wWidth = volumeSlider_->get_width();
		const int wHeight = SLIDER_HEIGHT;
#endif
#ifdef IS_DEBUG
		std::cout << "Screen height = " << pos.screenHeight_ << std::endl;
		std::cout << "At top = " << pos.trayAtTop_ << std::endl;
		std::cout << "wHeight = " << wHeight << std::endl;
		std::cout << "iconHeight = " << pos.iconHeight_ << std::endl;
#endif
		const int wY = pos.trayAtTop_ ? pos.iconHeight_ + 4 : pos.screenHeight_ - wHeight - pos.iconHeight_ - 4;
		int wX;
		if (pos.geometryAvailable_) {
#ifdef IS_DEBUG
			std::cout << "Geometry available" << std::endl;
			std::cout << "wY = " << wY << std::endl;
#endif
			wX = (wWidth > 1) ? pos.iconX_ - (wWidth/2 - pos.iconWidth_/2) : pos.iconX_ - pos.iconWidth_/2;
		}
		else{
			wX = (wWidth > 1) ? pos.iconX_ - wWidth/2 : pos.iconX_ - pos.iconWidth_;
		}
		show_all();
		this->move(wX, wY);
	}
	else {
		hide();
	}
}
void 
MEItemInfoWidget::redrawNames(  const OldItem* item,
                              const OldGenericMap* theMap) {
   
   MC2_ASSERT(item != NULL);
  
   Gtk::TreeModel::Row row;
 
   char tmpstr[128];
   // Set the names
   LangTypes::language_t strLang;
   ItemTypes::name_t strType;
   uint32 strIndex;
   m_listStoreNames->clear();

   for (byte j=0; j<item->getNbrNames(); j++) {
      row = *(m_listStoreNames->append());
      item->getNameAndType(j, strLang, strType, strIndex);
      sprintf(tmpstr, "%s (%s:%s)", 
                      theMap->getName(strIndex),
                      LangTypes::getLanguageAsString(strLang),
                      ItemTypes::getNameTypeAsString(strType, true));
      row[m_ColumnsNames.m_name] = tmpstr;
      row[m_ColumnsNames.m_index] = j;
      mc2dbg4 << "Adding string to name-list:" << tmpstr << endl;
   }

#ifdef MAP_EDITABLE
   row = *(m_listStoreNames->append());
   row[m_ColumnsNames.m_name]=ADD_NAME_STRING;
   row[m_ColumnsNames.m_index] = item->getNbrNames();
#endif

   show_all();
}
Ejemplo n.º 10
0
int main() 
{   
    setlocale(LC_ALL, "Ukr");
	char c;
 	if ((f_worker=fopen(file_name,"rb+"))==NULL)
 	{
 	if ((f_worker=fopen(file_name,"wb+"))==NULL)
 	{
 		cout<<"Неможливо створити файл запису бази даних працiвникiв !"<<endl;
 		return -1;
	}
		cout<<" Створено новий файл бази даних працiвникiв !"<<endl;
 	}
 	do
 	{
 		cout<<"Виберiть режим роботи"<<endl;
 		cout<<"1 - Ввiд працiвника"<<endl;
 	    cout<<"2 - Пошук за iменем"<<endl;
		cout<<"3 - Пошук за телефоном"<<endl;
        cout<<"4 - Показати всю базу"<<endl;
        cout<<"5 - Очистка бази баних"<<endl;
    	cout<<"0 - Вивiд"<<endl;
    	
 		c=getch();
 		switch(c)
 		{
		    case '0': cout<<"Роботу завершено"<<endl; fclose(f_worker); return 0;
 		 	case '1': input_worker(); break;
 	 		case '2': search_name(); break;
		    case '3': search_number(); break;
  		 	case '4': show_all(); break;
   			case '5': clear_file(); break;
 	 	}
 	} while (1);	
}
Ejemplo n.º 11
0
ConstraintDialog::ConstraintDialog(ConstraintCanvas * c)
    : QDialog(0, "ConstraintVisibilityDialog", TRUE, 0), constraint(c)
{
    setCaption(TR("Constraints visibility dialog"));

    Q3VBoxLayout * vbox = new Q3VBoxLayout(this);

    vbox->setMargin(5);

    table = new ConstraintTable(this, constraint);
    vbox->addWidget(table);
    vbox->addWidget(new QLabel(this));

    Q3HBoxLayout * hbox;

    hbox = new Q3HBoxLayout(vbox);

    cb_visible = new QCheckBox(TR("Specify visible elements rather than hidden ones"), this);
    cb_visible->setChecked(constraint->indicate_visible);
    hbox->addWidget(cb_visible);

    QPushButton * showall = new QPushButton(TR("Show all"), this);
    QPushButton * hideall = new QPushButton(TR("Hide all"), this);
    QPushButton * hideinherited = new QPushButton(TR("Hide inherited"), this);
    QSize bs = hideinherited->sizeHint();

    showall->setFixedSize(bs);
    hideall->setFixedSize(bs);
    hideinherited->setFixedSize(bs);

    hbox->addWidget(new QLabel(this));
    hbox->addWidget(showall);
    hbox->addWidget(new QLabel(this));
    hbox->addWidget(hideall);
    hbox->addWidget(new QLabel(this));
    hbox->addWidget(hideinherited);
    hbox->addWidget(new QLabel(this));

    connect(showall, SIGNAL(clicked()), this, SLOT(show_all()));
    connect(hideall, SIGNAL(clicked()), this, SLOT(hide_all()));
    connect(hideinherited, SIGNAL(clicked()), this, SLOT(hide_inherited()));

    vbox->addWidget(new QLabel(this));
    hbox = new Q3HBoxLayout(vbox);

    hbox->setMargin(5);
    QPushButton * ok = new QPushButton(TR("&OK"), this);
    QPushButton * cancel = new QPushButton(TR("&Cancel"), this);

    ok->setDefault(TRUE);
    bs = cancel->sizeHint();
    ok->setFixedSize(bs);
    cancel->setFixedSize(bs);

    hbox->addWidget(ok);
    hbox->addWidget(cancel);

    connect(ok, SIGNAL(clicked()), this, SLOT(accept()));
    connect(cancel, SIGNAL(clicked()), this, SLOT(reject()));
}
Ejemplo n.º 12
0
ChoiceWidget:: ChoiceWidget (ChoiceType type, const Choice& choice)
  : _spinButtonAdj (choice._value, -10000.0, 10000.0)
{
  if (type == ANY)
    {
      _toggleButton = manage (new Gtk::CheckButton (choice._choice));
    }
  else
    {
      _toggleButton = manage (new Gtk::RadioButton (_group, choice._choice));
    }
  pack_start (*_toggleButton);
  
  if (choice._takesInt)
    {
      _spinButton = manage (new Gtk::SpinButton (_spinButtonAdj));
      _spinButton->set_numeric ();
      this->setInput ();
      _toggleButton->signal_toggled().connect (SigC::slot (*this, &ChoiceWidget::setInput));
      pack_end (*_spinButton);
    }
  else
    _spinButton = 0;

  show_all ();
}
Ejemplo n.º 13
0
    OgreWindow::OgreWindow() :
        mOgreWidget(),
        mExited(false)
        //mRobot()
    {
      set_border_width(1);

      Gtk::VBox *vb = new Gtk::VBox(false,0);

//      Gtk::Button *mb = new Gtk::Button("Avanzar");
//      mb->signal_clicked().connect(sigc::mem_fun(*this,&OgreWindow::avanzar));
//      Gtk::Button *mb2 = new Gtk::Button("Retroceder");
//      mb2->signal_clicked().connect(sigc::mem_fun(*this,&OgreWindow::retroceder));
//      Gtk::Button *mb3 = new Gtk::Button("Giro derecha");
//      mb3->signal_clicked().connect(sigc::mem_fun(*this,&OgreWindow::derecha));
//      Gtk::Button *mb4 = new Gtk::Button("Giro izquierda");
//      mb4->signal_clicked().connect(sigc::mem_fun(*this,&OgreWindow::izquierda));
//      vb->pack_start(*mb,true,true,0);
//      vb->pack_start(*mb2,true,true,0);
//      vb->pack_start(*mb3,true,true,0);
//      vb->pack_start(*mb4,true,true,0);
      vb->pack_start(mOgreWidget,true,true,10);

      add(*vb);
      show_all();
    }
Ejemplo n.º 14
0
Example_LineWidthComboBox::Example_LineWidthComboBox()
{

    set_title("Line Width Combo Boxes");
    set_border_width(10);

    this->add( m_vbox );

    m_frame[0].set_label( "Linear, Factor=1.0: " );
    m_LineWidthComboBox[0].set_start_stop( 1.0, 16.0 );

    m_frame[1].set_label( "Linear, Factor=2.0: " );
    m_LineWidthComboBox[1].set_start_stop( 1.0, 16.0 );
    m_LineWidthComboBox[1].set_factor( 2.0 );

    m_frame[2].set_label( "Exponential, Factor=1.15: " );
    m_LineWidthComboBox[2].set_start_stop( 1.0, 16.0 );
    m_LineWidthComboBox[2].set_increment_type( Papyrus::Gtk::INCREMENT_EXPONENTIAL );
    m_LineWidthComboBox[2].set_factor( 1.15 );

    m_frame[3].set_label( "Exponential, Factor=1.50: " );
    m_LineWidthComboBox[3].set_start_stop( 1.0, 16.0 );
    m_LineWidthComboBox[3].set_increment_type( Papyrus::Gtk::INCREMENT_EXPONENTIAL );
    m_LineWidthComboBox[3].set_factor( 1.5 );

    for ( int i = 0; i <= 4; i++ ) {
        m_frame[i].add( m_LineWidthComboBox[i] );
        m_vbox.pack_start( m_frame[i], Gtk::PACK_EXPAND_WIDGET, 10);
    }

    m_vbox.set_border_width(10);

    show_all();
}
Ejemplo n.º 15
0
ConnectView::ConnectView (Model *model,
			  Settings *settings,
			  bool show_connect)
  : Gtk::VBox(), m_connect(), m_port_label("Port:"),
    m_model(model), m_settings(settings)
{
  m_port_align.set_padding(0, 0, 6, 0);
  m_port_align.add (m_port_label);

  m_setting_state = false;

  add (m_hbox);
  m_hbox.set_spacing(2);
  m_hbox.add (m_image);
  m_hbox.add (m_connect);
  m_hbox.add (m_port_align);
  m_hbox.add (m_combo);

  m_connect.signal_toggled().connect(sigc::mem_fun(*this, &ConnectView::connect_toggled));
  m_combo.signal_changed().connect(sigc::mem_fun(*this, &ConnectView::signal_entry_changed));
  //m_combo.signal_popup_menu().connect(sigc::mem_fun(*this, &ConnectView::find_ports));

  show_all ();
  if (!show_connect)
    m_connect.hide ();
  serial_state_changed (SERIAL_DISCONNECTED);
  m_model->m_signal_serial_state_changed.connect
    (sigc::mem_fun(*this, &ConnectView::serial_state_changed));

  // TODO: Execute find_ports every time the dropdown is displayed
  find_ports();
  m_combo.set_active(0);
}
Ejemplo n.º 16
0
void InfoBox::UpdateDialog()
{
    if( !is_visible() ) return;
#if 0
    if( !f_editCharAction && f_refActionGroup )
    {
        f_editCharAction = f_refActionGroup->get_action( "Edit::Edit" );
    }
#endif

    f_infoBuffer->erase( f_infoBuffer->begin(), f_infoBuffer->end() );
    //
    if( f_char )
    {
        GenerateAbilityString();
        GenerateBuiltinString();
        GenerateStatString();
        //
        AddCR();
        AddNotesString();
        //
        //MakeReadOnly();
    }
    show_all();
}
Ejemplo n.º 17
0
PlayerView::PlayerView ( GameModel *model, GameController *controller, int id ) : 
                            model_ (model), 
                            controller_ (controller),
                            playerId_ (id) {
  
  std::stringstream ss;
  ss << playerId_+1;
  set_label ("Player " + ss.str());
  set_label_align( Gtk::ALIGN_CENTER, Gtk::ALIGN_TOP );
  set_shadow_type( Gtk::SHADOW_ETCHED_OUT );

  add (vBox_);

  pLabel_.set_text ("0");
  pointsLabel_.set_text ("points");
  pointsBox_.add (pLabel_);
  pointsBox_.add (pointsLabel_);

  dLabel_.set_text ("0");
  discardsLabel_.set_text ("discards");
  discardsBox_.add (dLabel_);
  discardsBox_.add (discardsLabel_);

  joinButton_.set_label ("Join Game");
  joinButton_.signal_clicked().connect( sigc::mem_fun( *this, &PlayerView::onJoinButtonClick ) );

  vBox_.add (pointsBox_);
  vBox_.add (discardsBox_);
  vBox_.add (joinButton_);

  show_all();

}
Ejemplo n.º 18
0
static void
main_loop()
{
	int p = 0;
	int c, n;
      L:
	show_all();
	sh(p);
	fflush(stdout);
	while (1) {
		c = getch();
		if (c == 3 || c == 4 || c == 27 || c < 0)
			break;
		if (c == 257 && p > 0)
			p--;
		if (c == 258 && p < counts - 1)
			p++;
		if (c == 259 && p < counts - 19)
			p += 19;
		if (c == 260 && p >= 19)
			p -= 19;
		if (c == 13 || c == 10) {
			bbsnet(p);
			goto L;
		}
		for (n = 0; n < counts; n++)
			if (str[n] == c)
				p = n;
		sh(p);
		fflush(stdout);
	}
}
Ejemplo n.º 19
0
MobileView::MobileView()
{
	Gtk::Button *button;
	button = Gtk::manage(new Gtk::Button("mobile"));
	pack_start(*button, false, false, 0);
	show_all();
}
Ejemplo n.º 20
0
HGTalkWindow::HGTalkWindow()
{
	int w, h;

	// set default size
	// height = screen height * 80%, width = height * 45%
	h = (int)Gdk::Screen::get_default()->get_height() * 0.80;
	w = (int)h * 0.45;
	set_default_size(w, h);

	set_title(HGTALK_WINDOW_TITLE);
	set_position(Gtk::WIN_POS_CENTER);
	set_icon_from_file(HGTALK_ICON_48);
	set_border_width(2);
	set_keep_above(TRUE);

	HGTalkLoginBox * pHGTalkLoginBox = 
		Gtk::manage(new HGTalkLoginBox);
	add(*pHGTalkLoginBox);

	signal_login_ok.connect(sigc::mem_fun(this, &HGTalkWindow::on_login_ok));
	signal_show_hide.connect(sigc::mem_fun(this, &HGTalkWindow::on_show_hide));

	show_all();
}
Ejemplo n.º 21
0
void List_bundle::show_all()
{
    temp_first->show_all();
    temp_first = temp_first->next();
    if(temp_first)
    show_all();
}
Ejemplo n.º 22
0
void nvhost_debug_dump(struct nvhost_master *master)
{
	struct output o = {
		.fn = write_to_printk
	};
	show_all(master, &o);
}
Ejemplo n.º 23
0
PopupInstancePrefab::PopupInstancePrefab(Gtk::Window* parent, Application *app) : Gtk::Dialog("Instantiate", *parent), boiteV(get_vbox())
{
    application = app;
    ToggleColumn					model2;


    boiteV->add(treeView);

    list = Gtk::ListStore::create(model2);
    treeView.set_model(list);

    treeView.append_column("Prefabs :", model2.m_col_name);
    treeView.get_column_cell_renderer(0)->set_fixed_size(300,0);


    for (GameObject* go : app->GetListPrefab())
    {
        Gtk::TreeModel::iterator iter = list->append();
        (*iter)[model2.m_col_name] = go->name;
    }

    Glib::RefPtr<Gtk::TreeSelection> treeSelection = treeView.get_selection();
    treeSelection->signal_changed().connect(sigc::mem_fun(*this, &PopupInstancePrefab::CloseWindow));

    show_all();

    Gtk::TreeModel::iterator selection = treeView.get_selection()->get_selected();
    if (selection)
        treeView.get_selection()->unselect(selection);
}
Ejemplo n.º 24
0
Archivo: debug.c Proyecto: 020gzh/linux
void host1x_debug_dump(struct host1x *host1x)
{
	struct output o = {
		.fn = write_to_printk
	};
	show_all(host1x, &o);
}
void
MEStreetSegmentItemInfoWidget::activate(MEMapArea* mapArea,
                                        OldStreetSegmentItem* ssi)
{
    MEAbstractItemInfoWidget::activate(mapArea, ssi);

    char tmpstr[128];

    // Road class + cond
    sprintf(tmpstr, "%d", uint32(ssi->getRoadClass()));
    m_roadClassVal->set_text(tmpstr);
    sprintf(tmpstr, "%d", uint32(ssi->getRoadCondition()));
    m_roadConditionVal->set_text(tmpstr);

    // Housenumber
    m_houseNumberValLS->set_value(ssi->getLeftSideNbrStart());
    m_houseNumberValLE->set_value(ssi->getLeftSideNbrEnd());
    m_houseNumberValRS->set_value(ssi->getRightSideNbrStart());
    m_houseNumberValRE->set_value(ssi->getRightSideNbrEnd());
    sprintf(tmpstr, "%d", uint32(int(ssi->getStreetNumberType())));
    m_houseNumberTypeVal->set_text(tmpstr);

    // Ramp, roundabout(ish), multi.dig. and controlled access
    m_rampVal->set_active(ssi->isRamp());
    m_roundaboutVal->set_active(ssi->isRoundabout());
    m_roundaboutishVal->set_active(ssi->isRoundaboutish());
    m_multidigVal->set_active(ssi->isMultiDigitised());
    m_controlledAccessVal->set_active(ssi->isControlledAccess());

    show_all();
}
Ejemplo n.º 26
0
// Main constructor
ModalProgressDialog::ModalProgressDialog(const Glib::RefPtr<Gtk::Window>& parent, const std::string& title)
: gtkutil::TransientWindow(title, GlobalMainFrame().getTopLevelWindow()),
  _label(Gtk::manage(new Gtk::Label)),
  _progressBar(Gtk::manage(new Gtk::ProgressBar)),
  _aborted(false)
{
  	// Window properties
	set_modal(true);
	set_position(Gtk::WIN_POS_CENTER_ON_PARENT);
	set_default_size(360, 80);
	set_border_width(12);

	// Create a vbox
	Gtk::VBox* vbx = Gtk::manage(new Gtk::VBox(false, 12));

	// Pack a progress bar into the window
	vbx->pack_start(*_progressBar, false, false, 0);

	// Pack the label into the window
	vbx->pack_start(*_label, true, false, 0);
	add(*vbx);

	// Pack a right-aligned cancel button at the bottom
	Gtk::Button* cancelButton = Gtk::manage(new Gtk::Button(Gtk::Stock::CANCEL));
	cancelButton->signal_clicked().connect(sigc::mem_fun(*this, &ModalProgressDialog::_onCancel));

	vbx->pack_end(*Gtk::manage(new gtkutil::RightAlignment(*cancelButton)), false, false, 0);

	// Connect the realize signal to remove the window decorations
	signal_realize().connect(sigc::mem_fun(*this, &ModalProgressDialog::_onRealize));

	// Show the window
	show_all();
	handleEvents();
}
DialogOperationChooserGTKMM::DialogOperationChooserGTKMM( Gtk::Window* parent )	: 
																																									Dialog( "Select an operation node", parent ),
																																									radioTextFileStorage("Text file storage"),
																																									radioExecuteSystemCommand("System command")
{
	
	// Request a minimum with
	this->set_size_request( 250 ); 
	
	// Put the radio buttons in the same group.
	Gtk::RadioButtonGroup group = radioTextFileStorage.get_group();
	radioExecuteSystemCommand.set_group( group );
	
	// Place the radio buttons in the dialog.
	Gtk::VBox* vBox = this->get_vbox();
	vBox->pack_start( radioTextFileStorage );
	vBox->pack_start( radioExecuteSystemCommand );
	
	// Add buttons
	this->add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
 	this->add_button(Gtk::Stock::OK, Gtk::RESPONSE_OK);
	
	show_all();

};
  NoteEditor(grt::Module *m, const grt::BaseListRef &args)
    : PluginEditorBase(m, args), _be(workbench_model_NoteFigureRef::cast_from(args[0])) {
    set_border_width(8);

    _xml = Gtk::Builder::create_from_file(bec::GRTManager::get()->get_data_file_path("modules/data/editor_note.glade"));

    Gtk::Widget *widget;
    _xml->get_widget("base_table", widget);

    Gtk::Image *image;
    _xml->get_widget("image", image);

    // image->set(grtm->get_data_file_path(""));

    Gtk::Entry *entry;
    _xml->get_widget("name_entry", entry);

    add_entry_change_timer(entry, sigc::mem_fun(this, &NoteEditor::set_name));

    Gtk::TextView *tview;
    _xml->get_widget("text_view", tview);

    add_text_change_timer(tview, sigc::mem_fun(_be, &NoteEditorBE::set_text));

    widget->reparent(*this);

    show_all();

    refresh_form_data();
  }
Ejemplo n.º 29
0
Start::Start()
: m_button_1("North"), m_button_2("South")  // creates a new button with label "Hello World".

{
  // Parametry okna.
  set_border_width(30); //odleg³oœæ pomiêdzy obramowaniem okna, a elementami wewn¹trz
  set_title("Learn 2015"); //tytu³
  set_size_request(300,150); //rozmiar
  set_position(Gtk::WIN_POS_CENTER); // pozyzja okna - wyœrodkowana wzgledem pulpitu
  set_resizable( false ); // blokowanie zmiany rozmiaru okna

  // Kontener poziomy 1
  Kontener_poziomy_1.pack_start( m_button_1, Gtk::PACK_EXPAND_WIDGET, 10 );
  Kontener_poziomy_1.pack_start( m_button_2, Gtk::PACK_EXPAND_WIDGET, 10 );

  Kontener_poziomy_1.set_homogeneous( true ); //Ujednolicenie rozmiaru przycisków


  // When the button receives the "clicked" signal, it will call the
  // on_button_clicked() method defined below.
  m_button_1.signal_clicked().connect(sigc::mem_fun(*this, &Start::on_button_clicked_1));
  m_button_2.signal_clicked().connect(sigc::mem_fun(*this, &Start::on_button_clicked_2));

  // This packs the button into the Window (a container).
  add( Kontener_poziomy_1 );
  show_all();
  //add(m_button);

  // The final step is to display this newly created widget...
  //m_button_1.show();
  //m_button_2.show();
}
Ejemplo n.º 30
0
void show_Hex_window()
{
	show_all();
	gtk_widget_set_sensitive(button1, FALSE);
	gtk_widget_set_sensitive(button2, FALSE);
	gtk_widget_set_sensitive(button3, FALSE);
	gtk_widget_set_sensitive(button4, FALSE);
}