当前位置: 首页>>代码示例>>C++>>正文


C++ IupDestroy函数代码示例

本文整理汇总了C++中IupDestroy函数的典型用法代码示例。如果您正苦于以下问题:C++ IupDestroy函数的具体用法?C++ IupDestroy怎么用?C++ IupDestroy使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了IupDestroy函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: iPlayTimer_CB

static int iPlayTimer_CB(Ihandle* timer)
{
  FILE* file = (FILE*)IupGetAttribute(timer, "_IUP_PLAYFILE");
  if(feof(file) || ferror(file))
  {
    fclose(file);
    IupSetAttribute(timer, "RUN", "NO");
    IupDestroy(timer);
    IupSetGlobal("_IUP_PLAYTIMER", NULL);
    return IUP_IGNORE;
  }
  else
  {
    int cont = 1;
    int mode = IupGetInt(timer, "_IUP_PLAYMODE");

/*    while (cont)    //did not work, menus do not receive the click, why? */
    {
      cont = iPlayAction(file, mode);

      if (cont == -1)  /* error */
      {
        fclose(file);
        IupSetAttribute(timer, "RUN", "NO");
        IupDestroy(timer);
        IupSetGlobal("_IUP_PLAYTIMER", NULL);
        return IUP_IGNORE;
      }
    }

    IupFlush();
  }

  return IUP_DEFAULT;
}
开发者ID:Archs,项目名称:iup-aio,代码行数:35,代码来源:iup_recplay.c

示例2: motListSetClipboardAttrib

static int motListSetClipboardAttrib(Ihandle *ih, const char *value)
{
  Widget cbedit;
  if (!ih->data->has_editbox)
    return 0;

  XtVaGetValues(ih->handle, XmNtextField, &cbedit, NULL);

  if (iupStrEqualNoCase(value, "COPY"))
  {
    Ihandle* clipboard;
    char *str = XmTextFieldGetSelection(cbedit);
    if (!str) return 0;

    clipboard = IupClipboard();
    IupSetAttribute(clipboard, "TEXT", str);
    IupDestroy(clipboard);

    XtFree(str);
  }
  else if (iupStrEqualNoCase(value, "CUT"))
  {
    Ihandle* clipboard;
    char *str = XmTextFieldGetSelection(cbedit);
    if (!str) return 0;

    clipboard = IupClipboard();
    IupSetAttribute(clipboard, "TEXT", str);
    IupDestroy(clipboard);

    XtFree(str);

    /* disable callbacks */
    iupAttribSet(ih, "_IUPMOT_DISABLE_TEXT_CB", "1");
    XmTextFieldRemove(cbedit);
    iupAttribSet(ih, "_IUPMOT_DISABLE_TEXT_CB", NULL);
  }
  else if (iupStrEqualNoCase(value, "PASTE"))
  {
    Ihandle* clipboard;
    char *str;

    clipboard = IupClipboard();
    str = IupGetAttribute(clipboard, "TEXT");

    /* disable callbacks */
    iupAttribSet(ih, "_IUPMOT_DISABLE_TEXT_CB", "1");
    XmTextFieldRemove(cbedit);
    XmTextFieldInsert(cbedit, XmTextFieldGetInsertionPosition(cbedit), str);
    iupAttribSet(ih, "_IUPMOT_DISABLE_TEXT_CB", NULL);
  }
  else if (iupStrEqualNoCase(value, "CLEAR"))
  {
    /* disable callbacks */
    iupAttribSet(ih, "_IUPMOT_DISABLE_TEXT_CB", "1");
    XmTextFieldRemove(cbedit);
    iupAttribSet(ih, "_IUPMOT_DISABLE_TEXT_CB", NULL);
  }
  return 0;
}
开发者ID:Vulcanior,项目名称:IUP,代码行数:60,代码来源:iupmot_list.c

示例3: cleanup

void cleanup() {

    if(timeout) { IupDestroy(timeout); }
    if(timer)   { IupDestroy(timer);   }

    IupClose();
    endTimePeriod(); // try close if not closing
}
开发者ID:pkarneliuk,项目名称:clumsy,代码行数:8,代码来源:main.c

示例4: main

int main(int argc, char **argv)
{
  IupOpen(&argc, &argv);      
  IupControlsOpen();      
  func_1();
  IupShowXY(IupGetHandle("dlg"),IUP_CENTER,IUP_CENTER);
  IupMainLoop();
  IupDestroy(IupGetHandle("img1"));
  IupDestroy(IupGetHandle("img2"));
  IupDestroy(IupGetHandle("dlg"));
  IupControlsClose();      
  IupClose();  
  return 0;
}
开发者ID:svn2github,项目名称:iup-iup,代码行数:14,代码来源:cbox.c

示例5: select_file

int select_file(Ihandle* parent_dlg, int is_open)
{
  Ihandle* config = (Ihandle*)IupGetAttribute(parent_dlg, "CONFIG");
  Ihandle* canvas = IupGetDialogChild(parent_dlg, "CANVAS");
  const char* dir = IupConfigGetVariableStr(config, "MainWindow", "LastDirectory");

  Ihandle* filedlg = IupFileDlg();
  if (is_open)
    IupSetAttribute(filedlg, "DIALOGTYPE", "OPEN");
  else
  {
    IupSetAttribute(filedlg, "DIALOGTYPE", "SAVE");
    IupSetStrAttribute(filedlg, "FILE", IupGetAttribute(canvas, "FILENAME"));
  }
  IupSetAttribute(filedlg, "EXTFILTER", "Image Files|*.bmp;*.jpg;*.png;*.tif;*.tga|All Files|*.*|");
  IupSetStrAttribute(filedlg, "DIRECTORY", dir);
  IupSetAttributeHandle(filedlg, "PARENTDIALOG", parent_dlg);

  IupPopup(filedlg, IUP_CENTERPARENT, IUP_CENTERPARENT);
  if (IupGetInt(filedlg, "STATUS") != -1)
  {
    char* filename = IupGetAttribute(filedlg, "VALUE");
    if (is_open)
      open_file(parent_dlg, filename);
    else
      saveas_file(canvas, filename);

    dir = IupGetAttribute(filedlg, "DIRECTORY");
    IupConfigSetVariableStr(config, "MainWindow", "LastDirectory", dir);
  }

  IupDestroy(filedlg);
  return IUP_DEFAULT;
}
开发者ID:sanikoyes,项目名称:iup,代码行数:34,代码来源:example4_2.c

示例6: main

int main(int argc, char **argv)
{
  Ihandle *dialog, *canvas;

  IupOpen(&argc, &argv);

  canvas = IupCanvas(NULL);
  IupSetAttribute(canvas, "RASTERSIZE", "300x200"); /* initial size */
  IupSetAttribute(canvas, "SCROLLBAR", "YES");
  IupSetAttribute(canvas, "XMAX", "599");
  IupSetAttribute(canvas, "YMAX", "399");

  IupSetCallback(canvas, "SCROLL_CB",  (Icallback)scroll_cb);
  IupSetCallback(canvas, "RESIZE_CB",  (Icallback)resize_cb);
  IupSetCallback(canvas, "ACTION",  (Icallback)action);
                   
  dialog = IupDialog(canvas);
  IupSetAttribute(dialog, "TITLE", "Scrollbar Test");

  IupMap(dialog);
  cdcanvas = cdCreateCanvas(CD_IUP, canvas);
  IupSetAttribute(canvas, "RASTERSIZE", NULL);  /* release the minimum limitation */
  
  IupShowXY(dialog,IUP_CENTER,IUP_CENTER);

  IupMainLoop();

  cdKillCanvas(cdcanvas);
  IupDestroy(dialog);

  IupClose();

  return EXIT_SUCCESS;

}
开发者ID:svn2github,项目名称:iup-github,代码行数:35,代码来源:scrollbar.c

示例7: iupTextUpdateFormatTags

void iupTextUpdateFormatTags(Ihandle* ih)
{
  /* called when the element is mapped */
  int i, count = iupArrayCount(ih->data->formattags);
  Ihandle** tag_array = (Ihandle**)iupArrayGetData(ih->data->formattags);

  /* must update VALUE before updating the format */
  iTextUpdateValueAttrib(ih);

  for (i = 0; i < count; i++)
  {
    char* bulk = iupAttribGet(tag_array[i], "BULK");
    if (bulk && iupStrBoolean(bulk))
    {
      Ihandle* child;
      void* state = iupdrvTextAddFormatTagStartBulk(ih);

      char* cleanout = iupAttribGet(tag_array[i], "CLEANOUT");
      if (cleanout && iupStrBoolean(cleanout))
        IupSetAttribute(ih, "REMOVEFORMATTING", "ALL");

      for (child = tag_array[i]->firstchild; child; child = child->brother)
        iupdrvTextAddFormatTag(ih, child, 1);

      iupdrvTextAddFormatTagStopBulk(ih, state);
    }
    else
      iupdrvTextAddFormatTag(ih, tag_array[i], 0);
    IupDestroy(tag_array[i]);
  }
  iupArrayDestroy(ih->data->formattags);
  ih->data->formattags = NULL;
}
开发者ID:kmx,项目名称:mirror-iup,代码行数:33,代码来源:iup_text.c

示例8: main

/* main program */
int main(int argc, char **argv)
{
  char *error=NULL;

  /* IUP initialization */
  IupOpen(&argc, &argv);
  IupControlsOpen () ;

  /* loads LED */
  if((error = IupLoad("vbox.led")))
  {
    IupMessage("LED error", error);
    return 1 ;
  }

  dlg = IupGetHandle("Alinhav");

  /* sets callbacks */
//  IupSetFunction( "acao_pausa", (Icallback) btn_pause_cb );

  /* shows dialog */
//  IupShowXY(dlg,IUP_CENTER,IUP_CENTER);
  IupShow(dlg);

  /* main loop */
  IupMainLoop();

  IupDestroy(dlg);

  /* ends IUP */
  IupControlsClose() ;
  IupClose();

  return 0 ;
}
开发者ID:armornick,项目名称:iupd,代码行数:36,代码来源:vbox.c

示例9: main

int main(int argc, char **argv)
{
  IupOpen(&argc, &argv);

  memset(password, 0, 100);

  text = IupText(NULL);
  IupSetAttribute(text, "SIZE",  "200x");
  IupSetCallback(text, "ACTION", (Icallback) action);
  IupSetCallback(text, "K_ANY", (Icallback) k_any);

  pwd = IupText(NULL);
  IupSetAttribute(pwd, "READONLY", "YES");
  IupSetAttribute(pwd, "SIZE", "200x");

  dlg = IupDialog(IupVbox(text, pwd, NULL));
  IupSetAttribute(dlg, "TITLE", "IupText");

  IupShowXY(dlg, IUP_CENTER, IUP_CENTER);

  IupMainLoop();
  IupDestroy(dlg);
  IupClose();
  return 0;
}
开发者ID:svn2github,项目名称:iup-iup,代码行数:25,代码来源:text.c

示例10: main

int main(int argc, char **argv)
{
  Ihandle *dlg, *bt, *box, *lbl, *ml, *vbox;
  IupOpen(&argc, &argv);

  bt = IupButton("Button", NULL);
  //IupSetAttribute(bt, "EXPAND", "VERTICAL");  /* This is the only necessary EXPAND */
  IupSetAttribute(bt, "EXPAND", "YES");

  box = IupSbox(bt);
  IupSetAttribute(box, "DIRECTION", "SOUTH");  /* place at the bottom of the button */
//  IupSetAttribute(box, "COLOR", "0 255 0");

  ml = IupMultiLine(NULL);
  IupSetAttribute(ml, "EXPAND", "YES");
  IupSetAttribute(ml, "VISIBLELINES", "5");
  vbox = IupVbox(box, ml, NULL);

  lbl = IupLabel("Label");
  IupSetAttribute(lbl, "EXPAND", "VERTICAL");

  dlg = IupDialog(IupHbox(vbox, lbl, NULL));
  IupSetAttribute(dlg, "TITLE", "IupSbox Example");
  IupSetAttribute(dlg, "MARGIN", "10x10");
  IupSetAttribute(dlg, "GAP", "10");

  IupShow(dlg);

  IupMainLoop();
  IupDestroy(dlg);
  IupClose();
  return 1;
}
开发者ID:svn2github,项目名称:iup-iup,代码行数:33,代码来源:sbox1.c

示例11: winDialogUnMapMethod

static void winDialogUnMapMethod(Ihandle* ih)
{
    if (ih->data->menu)
    {
        ih->data->menu->handle = NULL; /* the dialog will destroy the native menu */
        IupDestroy(ih->data->menu);
    }

    if (iupAttribGet(ih, "_IUPDLG_HASTRAY"))
        winDialogSetTrayAttrib(ih, NULL);

    iupwinTipsDestroy(ih);
    iupwinDestroyDragDrop(ih);

    /* remove the association before destroying */
    iupwinHandleRemove(ih->handle);

    /* Destroys the window, so we can destroy the class */
    if (iupAttribGetBoolean(ih, "MDICHILD"))
    {
        /* for MDICHILDs must send WM_MDIDESTROY, instead of calling DestroyWindow */
        Ihandle* client = (Ihandle*)iupAttribGet(ih, "MDICLIENT_HANDLE");
        SendMessage(client->handle, WM_MDIDESTROY, (WPARAM)ih->handle, 0);

        winDialogMDIRefreshMenu(ih);
    }
    else
        DestroyWindow(ih->handle); /* this will destroy the Windows children also. */
    /* but IupDestroy already destroyed the IUP children */
    /* so it is safe to call DestroyWindow */
}
开发者ID:xubingyue,项目名称:iup,代码行数:31,代码来源:iupwin_dialog.c

示例12: iupTextSetAddFormatTagHandleAttrib

int iupTextSetAddFormatTagHandleAttrib(Ihandle* ih, const char* value)
{
  Ihandle* formattag = (Ihandle*)value;
  if (!iupObjectCheck(formattag))
    return 0;

  if (ih->handle)
  {
    /* must update VALUE before updating the format */
    iTextUpdateValueAttrib(ih);

    iupdrvTextAddFormatTag(ih, formattag);
    IupDestroy(formattag);
  }
  else
  {
    Ihandle** tag_array;
    int i;

    if (!ih->data->formattags)
      ih->data->formattags = iupArrayCreate(10, sizeof(Ihandle*));

    i = iupArrayCount(ih->data->formattags);
    tag_array = (Ihandle**)iupArrayInc(ih->data->formattags);
    tag_array[i] = formattag;
  }
  return 0;
}
开发者ID:Airr,项目名称:iup_mac,代码行数:28,代码来源:iup_text.c

示例13: item_saveas_action_cb

int item_saveas_action_cb(Ihandle* item_saveas)
{
  Ihandle* multitext = IupGetDialogChild(item_saveas, "MULTITEXT");
  Ihandle *filedlg = IupFileDlg();
  IupSetAttribute(filedlg, "DIALOGTYPE", "SAVE");
  IupSetAttribute(filedlg, "FILTER", "*.txt");
  IupSetAttribute(filedlg, "FILTERINFO", "Text Files");
  IupSetAttributeHandle(filedlg, "PARENTDIALOG", IupGetDialog(item_saveas));

  IupPopup(filedlg, IUP_CENTERPARENT, IUP_CENTERPARENT);

  if (IupGetInt(filedlg, "STATUS") != -1)
  {
    Ihandle* config = (Ihandle*)IupGetAttribute(multitext, "CONFIG");
    char* filename = IupGetAttribute(filedlg, "VALUE");
    char* str = IupGetAttribute(multitext, "VALUE");
    int count = IupGetInt(multitext, "COUNT");
    write_file(filename, str, count);

    IupConfigRecentUpdate(config, filename);
  }

  IupDestroy(filedlg);
  return IUP_DEFAULT;
}
开发者ID:carblue,项目名称:iup,代码行数:25,代码来源:example3_11.c

示例14: iupwinVersion

void iupwinVersion(void)
{
   Ihandle* dial, *ok;

   dial = IupDialog(IupVbox(IupFrame(IupVbox(
                        IupLabel(IupVersion()),
                        IupLabel(IUP_VERSION_DATE),
                        IupLabel(IUP_COPYRIGHT),
                        NULL)), 
                      ok = IupButton("Ok", NULL),
                      NULL));

   IupSetCallback(ok, "ACTION", (Icallback)ok_cb);

   IupSetAttribute(dial,IUP_TITLE,"IUP");
   IupSetAttribute(dial,IUP_MENUBOX,IUP_NO);
   IupSetAttribute(dial,IUP_MINBOX,IUP_NO);
   IupSetAttribute(dial,IUP_MAXBOX,IUP_NO);
   IupSetAttribute(dial,IUP_RESIZE,IUP_NO);

   IupSetAttribute(dial,"GAP","5");
   IupSetAttribute(dial,"MARGIN","5");

   IupPopup(dial, IUP_CENTER, IUP_CENTER);
   IupDestroy(dial);
}
开发者ID:svn2github,项目名称:iup-iup,代码行数:26,代码来源:winver.c

示例15: iMatrixExSetPasteAttrib

static int iMatrixExSetPasteAttrib(Ihandle *ih, const char* value)
{
  int lin=0, col=0;

  Ihandle* clipboard = IupClipboard();
  char* data = IupGetAttribute(clipboard, "TEXT");
  IupDestroy(clipboard);

  if (iupStrEqualNoCase(value, "FOCUS"))
    IupGetIntInt(ih, "FOCUS_CELL", &lin, &col);
  else if (iupStrEqualNoCase(value, "MARKED"))
  {
    char *marked = IupGetAttribute(ih,"MARKED");
    if (marked)
    {
      int num_lin = IupGetInt(ih, "NUMLIN");
      int num_col = IupGetInt(ih, "NUMCOL");
      iMatrixExCellMarkedStart(marked, num_lin, num_col, &lin, &col);
    }
  }
  else
  {
    if (iupStrToIntInt(value, &lin, &col, ':')!=2)
      return 0;
  }

  iMatrixExPasteData(ih, data, lin, col, "PASTECLIP");
  return 0;
}
开发者ID:defdef,项目名称:iup,代码行数:29,代码来源:iupmatex_clipboard.c


注:本文中的IupDestroy函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。