Example #1
0
void MyDialog::button2clicked()
{
  boost::shared_ptr<MyDialog> new_dialog(new MyDialog(m_string + "R"));
  m_children.push_back(new_dialog);
  new_dialog->setModal(true);
  new_dialog->show();
}
Example #2
0
menu_dialog_t *menu_dialog_new_message(const char *message) {
    menu_dialog_t *dialog = new_dialog(message);
    dialog->selections[0] = menu_label("Ok");
    dialog->active_selections = 1;

    return dialog;
}
Example #3
0
void DialogTest(void)
{
  create_images();

  new_dialog(0, "IupDialog as a main window,\n"
                "all decorations.\n"
                "rastersize+centered.");
}
Example #4
0
menu_dialog_t *menu_dialog_new(const char *question, void (*yes_func)(), void (*no_func)()) {
    menu_dialog_t *dialog = new_dialog(question);
    dialog->selections[0] = menu_label("Yes");
    dialog->selections[1] = menu_label("No");
    dialog->selection_funcs[0] = yes_func;
    dialog->selection_funcs[1] = no_func;
    dialog->active_selections = 2;

    return dialog;
}
void CompetitorInspector::addCompetitorAction()
{
	NewCompetitorDialog new_dialog(this);

	if (new_dialog.exec() == QDialog::Accepted)
	{
		refresh();
		emit informationMessage("New Competitor added");
	}
}
Example #6
0
int main(int argc, char* argv[])
{
//  IupOpen(&argc, &argv);
IupOpen(NULL, NULL);
  create_images();

  new_dialog(0, "IupDialog as a main window,\n"
                "all decorations.\n"
                "rastersize+centered.");

  IupMainLoop();

  destroy_images();

  IupClose();

  return 0;
}
Example #7
0
static int k_any(Ihandle *ih, int c)
{
  if (iup_isprint(c))
    printf("K_ANY(%s, %d = %s \'%c\')", IupGetAttribute(ih, "TESTTITLE"), c, iupKeyCodeToName(c), (char)c);
  else
    printf("K_ANY(%s, %d = %s)", IupGetAttribute(ih, "TESTTITLE"), c, iupKeyCodeToName(c));
  printf("  MODKEYSTATE(%s)\n", IupGetGlobal("MODKEYSTATE"));

  switch(c)
  {
  case K_r:
    IupSetAttribute(ih, "RASTERSIZE", "300x300");
    IupRefresh(ih);
    break;
  case K_1:
    new_dialog(1, "SIZE=FULLxFULL + IupShow.\n"
                  "Check also F1 = RASTERSIZE+IupRefresh.\n"
                  "close_cb returns IGNORE.");
    break;
  case K_2:
    new_dialog(2, "Only common dlg decorations.\n"
                  "ShowXY.\n"
                  "min/max size.");
    break;
  case K_3:
    new_dialog(3, "NO decorations");
    break;
  case K_4:
    new_dialog(4, "PLACEMENT.\n"
                  "Repeat key to test variations.");
    break;
  case K_5:
    new_dialog(5, "IupPopup");
    break;
  case K_6:
    new_dialog(6, "FULLSCREEN");
    break;
  case K_p:
    {
      static int count = 0;
      if (count == 0)
        IupSetAttribute(ih, "PLACEMENT", "MAXIMIZED");
      else if (count == 1)
        IupSetAttribute(ih, "PLACEMENT", "MINIMIZED");
      else if (count == 2)
        IupSetAttribute(ih, "PLACEMENT", "NORMAL");
      else 
        IupSetAttribute(ih, "PLACEMENT", "FULL");

      count++;
      if (count == 4) // cicle from 0 to 3
        count = 0;

      IupShow(ih);
    }
    break;
  case K_s:
    IupShow(IupGetHandle("_MAIN_DIALOG_TEST_"));
    break;
  case K_f:
    if (IupGetInt(ih, "FULLSCREEN"))
      IupSetAttribute(ih, "FULLSCREEN", "NO");
    else 
      IupSetAttribute(ih, "FULLSCREEN", "YES");
    break;
  case K_ESC:
    IupDestroy(ih);
    return IUP_IGNORE;
  case K_c:
    return IUP_CLOSE;
  case K_h:
    IupHide(ih);
    break;
  }
  return IUP_DEFAULT;
}
Example #8
0
void MainWindow::sync_tracker_output_to_session(bool sync) {
    if(sync) {
        connect(this->ui->dialog_combBox, SIGNAL(currentIndexChanged(QString)), &tracker_output_viewer, SLOT(new_dialog(QString)));
        tracker_output_viewer.new_dialog(this->ui->dialog_combBox->currentText());
    }
    else
        disconnect(this->ui->dialog_combBox, SIGNAL(currentIndexChanged(QString)), &tracker_output_viewer, SLOT(new_dialog(QString)));
}
/* Основная функция */
int main() {
	# define ACTION(str) if (!strcmp(#str, action))
	setlocale(LC_ALL, "Ru");
	BookDB* db = NULL;
	char filename[MAX_STRING_LENGTH] = "\0";
	char action[MAX_STRING_LENGTH];
	print_hello();
	/* Цикл обработки событий */
	forever {
		printf("<! ");
		scanf("%s", action);
		
		ACTION(help) {
			print_help();
			continue;
		}
		
		ACTION(exit) {
			if (db) {
				close_db(db, filename);
				db = NULL;
				filename[0] = '\0';
			}
			break;
		}
		
		ACTION(close) {
			if (db) {
				close_db(db, filename);
				db = NULL;
				filename[0] = '\0';
				output("База данных закрыта!\n");
			} else db_not_loaded_error();
			continue;
		}
		
		ACTION(create) {
			if (db) {
				close_db(db, filename);
				filename[0] = '\0';
				db = NULL;
			}
			int n = 0;
			output("Предполагаемая размерность Базы Данных\n");
			input("%d", &n);
			db = create_db(n);
			output("База данных для %i элементов создана!\n", n);
			continue;
		}
		
		ACTION(load) {
			if (db) {
				close_db(db, filename);
				filename[0] = '\0';
				db = NULL;
			}
			do {
				output("Имя файла базы данных\n");
				input("%s", filename);
			} while (strlen(filename) < 1);
			db = load_db(filename);
			if (!db) {
				output("Неверное имя файла!\n");
				filename[0] = '\0';
			} else {
				output(">> База данных успешно загружена!\n");
			}
			continue;
		}
		
		ACTION(save) {
			if (db) {
				save_db_dialog(db, filename);
				output(">> База данных успешно сохранена!\n");
			} else db_not_loaded_error();
			continue;
		}
		
		ACTION(list) {
			if (db != 0) {
				list_db(db);
			} else db_not_loaded_error();
			continue;
		}
		
		ACTION(find) {
			if (db) {
				find_dialog(db);
			} else db_not_loaded_error();
			continue;
		}
		
		ACTION(new) {
			if (db) {
				new_dialog(db);
			} else db_not_loaded_error();
			continue;
		}
		
		ACTION(delete) {
			if (db) {
				delete_dialog(db);
			} else db_not_loaded_error();
			continue;
		}
		
		ACTION(size) {
			if (db) {
				output("Книг в базе данных - %d\n", db->count);
			} else db_not_loaded_error();
			continue;
		}
		
		ACTION(sort) {
			if (db) {
				sort_dialog(db);
			} else db_not_loaded_error();
			continue;
		}
		
		printf("!! Неизвестная команда \"%s\"\n", action);
	}
	# undef ACTION
	return 0;
}