Esempio n. 1
0
/* Main program */
int main(int argc, char **argv)
{
  /* Initializes IUP */
  IupOpen(&argc, &argv);

  /* Executes IupAlarm */
  switch (IupAlarm ("IupAlarm Example",
    "File not saved! Save it now?", "Yes", "No", "Cancel"))
  {
    /* Shows a message for each selected button */
    case 1:
      IupMessage ("Save file", "File saved successfully - leaving program");
    break;

    case 2:
      IupMessage ("Save file", "File not saved - leaving program anyway");
    break;

    case 3:
      IupMessage ("Save file", "Operation canceled");
    break;
  }
  
  /* Finishes IUP */
  IupClose();

  /* Program finished successfully */
  return EXIT_SUCCESS;
}
Esempio n. 2
0
static void Alarm(void)
{
  lua_pushnumber(IupAlarm(luaL_check_string(1), 
                          luaL_check_string(2),
                          luaL_check_string(3), 
                          luaL_opt_string(4, NULL),
                          luaL_opt_string(5, NULL)));
}
Esempio n. 3
0
static void new_alarm(void)
{
  int ret;
  IupSetGlobal("PARENTDIALOG", "_MAIN_DIALOG_TEST_");
  ret = IupAlarm ("IupAlarm Test", "Message Text\nSecond Line", "But 1", "Button 2", "B3");
  IupSetGlobal("PARENTDIALOG", NULL);
  //int ret = IupAlarm ("IupAlarm Test", "Message Text\nSecond Line\nVery long long long long long long long long long long long long text", "But 1", "Button 2", "B3");
  printf("Button(%d)\n", ret);
}
Esempio n. 4
0
static void _on_crash()
{
	int res = IupAlarm("Pic2MCMap has Crashed!", "Unfortunately, the program has crashed.\nIf this is the first time you see this message, trying repeating the same steps you made to get this "
			"message.\nIf this message reappears, please submit an issue to the project's GitHub page.\n\nThe program will now close.", "Open GitHub Page", "Exit", NULL);
	if(res == 1)
		IupHelp("https://github.com/wooky/pic2mcmap/issues");

	exit(-1);
}
Esempio n. 5
0
static int Alarm(lua_State *L)
{
  int n = IupAlarm(luaL_checkstring(L, 1), 
                   luaL_checkstring(L, 2), 
                   luaL_checkstring(L, 3), 
                   luaL_optstring(L, 4, NULL), 
                   luaL_optstring(L, 5, NULL));
  lua_pushinteger(L, n);
  return 1;
}
Esempio n. 6
0
static int cancel_cb(Ihandle* ih)
{
  int ret = IupAlarm("Warning!", "Interrupt Processing?", "Yes", "No", NULL);
  if (ret == 1) /* Yes Interrupt */
  {
    IupSetAttribute(ih, "SIMULATEMODAL", "No");
    IupHide(ih);
    return IUP_DEFAULT;
  }

  return IUP_CONTINUE;
}
Esempio n. 7
0
int save_check(Ihandle* ih)
{
  Ihandle* multitext = IupGetDialogChild(ih, "MULTITEXT");
  if (IupGetInt(multitext, "DIRTY"))
  {
    switch (IupAlarm("Warning", "File not saved! Save it now?", "Yes", "No", "Cancel"))
    {
    case 1:  /* save the changes and continue */
      item_save_action_cb(ih);
      break;
    case 2:  /* ignore the changes and continue */
      break;
    case 3:  /* cancel */
      return 0;  
    }
  }
  return 1;
}
Esempio n. 8
0
int save_check(Ihandle* ih)
{
  Ihandle* canvas = IupGetDialogChild(ih, "CANVAS");
  if (IupGetInt(canvas, "DIRTY"))
  {
    switch (IupAlarm("Warning", "File not saved! Save it now?", "Yes", "No", "Cancel"))
    {
    case 1:  /* save the changes and continue */
      save_file(canvas);
      break;
    case 2:  /* ignore the changes and continue */
      break;
    case 3:  /* cancel */
      return 0;  
    }
  }
  return 1;
}
Esempio n. 9
0
static void new_alarm(void)
{
  int ret = IupAlarm ("IupAlarm Test", "Message Text\nSecond Line", "But 1", "Button 2", "B3");
  //int ret = IupAlarm ("IupAlarm Test", "Message Text\nSecond Line\nVery long long long long long long long long long long long long text", "But 1", "Button 2", "B3");
  printf("Button(%d)\n", ret);
}
int cancelCb(){
	if(IupAlarm("nwjsmanager", "If you stop the download of the nw.js runtime files, you won't be able to run the application.\nAre you sure?", "Yes", "No", NULL) == 1)
		stop = 1;
	return IUP_IGNORE;
}