int iupDialogShowXY(Ihandle* ih, int x, int y) { int was_visible; /* Calling IupShow for a visible dialog shown with IupPopup does nothing. */ if (iupAttribGetBoolean(ih, "MODAL")) /* already a popup */ return IUP_NOERROR; if (ih->data->popup_level != 0) { /* was disabled by a Popup, re-enable it */ iupdrvSetActive(ih, 1); ih->data->popup_level = 0; /* Now it is at the current popup level */ } /* save visible state before iupdrvDialogSetPlacement */ /* because it can also show the window when changing placement. */ was_visible = iupdrvDialogIsVisible(ih); /* Update the position and placement */ if (!iupdrvDialogSetPlacement(ih)) { iDialogAdjustPos(ih, &x, &y); iupdrvDialogSetPosition(ih, x, y); } if (was_visible) /* already visible */ { /* only re-show to raise the window */ iupdrvDialogSetVisible(ih, 1); /* flush, then process show_cb and startfocus */ iDialogAfterShow(ih); return IUP_NOERROR; } ih->data->first_show = 1; /* actually show the window */ /* test if placement turn the dialog visible */ if (!iupdrvDialogIsVisible(ih)) iupdrvDialogSetVisible(ih, 1); /* increment visible count */ iupDlgListVisibleInc(); /* flush, then process show_cb and startfocus */ iDialogAfterShow(ih); return IUP_NOERROR; }
int iupDialogPopup(Ihandle* ih, int x, int y) { int ret = iupClassObjectDlgPopup(ih, x, y); if (ret != IUP_INVALID) /* IUP_INVALID means it is not implemented */ return ret; ih->data->show_state = IUP_SHOW; /* Update only the position */ iupDialogAdjustPos(ih, &x, &y); iupdrvDialogSetPosition(ih, x, y); if (iupdrvDialogIsVisible(ih)) /* already visible */ { /* only re-show to raise the window */ iupdrvDialogSetVisible(ih, 1); iDialogCallShowCb(ih); return IUP_NOERROR; } if (iupAttribGetInt(ih, "MODAL")) /* already a popup */ return IUP_NOERROR; iDialogSetModal(ih); /* actually show the window */ iupdrvDialogSetVisible(ih, 1); /* increment visible count */ iupDlgListVisibleInc(); iDialogCallShowCb(ih); /* interrupt processing here */ IupMainLoop(); /* if window is still valid (IupDestroy not called), hide the dialog if still visible. */ if (iupObjectCheck(ih)) { iDialogUnSetModal(ih); IupHide(ih); } return IUP_NOERROR; }
void iupDialogHide(Ihandle* ih) { /* hidden at the system and marked hidden in IUP */ if (!iupdrvDialogIsVisible(ih) && ih->data->show_state == IUP_HIDE) return; /* marked hidden in IUP */ ih->data->show_state = IUP_HIDE; /* if called IupHide for a Popup window */ if (iupAttribGetBoolean(ih, "MODAL")) { iDialogUnSetModal(ih); IupExitLoop(); } ih->data->ignore_resize = 1; /* actually hide the window */ iupdrvDialogSetVisible(ih, 0); ih->data->ignore_resize = 0; /* decrement visible count */ iupDlgListVisibleDec(); /* process flush and process show_cb */ iDialogAfterHide(ih); iDialogListCheckLastVisible(); }
void iupDialogHide(Ihandle* ih) { /* hidden at the system and marked hidden in IUP */ if (!iupdrvDialogIsVisible(ih) && ih->data->show_state == IUP_HIDE) return; /* marked hidden in IUP */ ih->data->show_state = IUP_HIDE; /* if called IupHide for a Popup window */ if (iupAttribGetInt(ih, "MODAL")) { iDialogUnSetModal(ih); IupExitLoop(); } /* actually hide the window */ iupdrvDialogSetVisible(ih, 0); /* decrement visible count */ iupDlgListVisibleDec(); if (iupDlgListVisibleCount() <= 0) { /* if this is the last window visible, exit message loop except when LOCKLOOP==YES */ if (!iupStrBoolean(IupGetGlobal("LOCKLOOP"))) IupExitLoop(); } iDialogCallShowCb(ih); }
int iupDialogShowXY(Ihandle* ih, int x, int y) { int was_visible; if (iupAttribGetInt(ih, "MODAL")) /* already a popup */ return IUP_NOERROR; if (ih->data->popup_level != 0) { /* was disabled by a Popup, re-enable it */ iupdrvSetActive(ih, 1); ih->data->popup_level = 0; /* Now it is at the current popup level */ } /* save visible state before iupdrvDialogSetPlacement */ /* because it can also show the window when changing placement. */ was_visible = iupdrvDialogIsVisible(ih); /* Update the position and placement */ if (!iupdrvDialogSetPlacement(ih, x, y)) { iupDialogAdjustPos(ih, &x, &y); iupdrvDialogSetPosition(ih, x, y); } if (was_visible) /* already visible */ { /* only re-show to raise the window */ iupdrvDialogSetVisible(ih, 1); iDialogCallShowCb(ih); return IUP_NOERROR; } /* actually show the window */ /* test if placement turn the dialog visible */ if (!iupdrvDialogIsVisible(ih)) iupdrvDialogSetVisible(ih, 1); /* increment visible count */ iupDlgListVisibleInc(); iDialogCallShowCb(ih); return IUP_NOERROR; }
static int iDialogSetHideTaskbarAttrib(Ihandle *ih, const char *value) { iupdrvDialogSetVisible(ih, !iupStrBoolean(value)); return 0; }
int iupDialogPopup(Ihandle* ih, int x, int y) { int was_visible; int ret = iupClassObjectDlgPopup(ih, x, y); if (ret != IUP_INVALID) /* IUP_INVALID means it is not implemented */ return ret; ih->data->show_state = IUP_SHOW; /* save visible state before iupdrvDialogSetPlacement */ /* because it can also show the window when changing placement. */ was_visible = iupdrvDialogIsVisible(ih); /* Update the position and placement */ if (!iupdrvDialogSetPlacement(ih)) { iDialogAdjustPos(ih, &x, &y); iupdrvDialogSetPosition(ih, x, y); } if (was_visible) /* already visible */ { /* only re-show to raise the window */ iupdrvDialogSetVisible(ih, 1); /* flush, then process show_cb and startfocus */ iDialogAfterShow(ih); return IUP_NOERROR; } if (iupAttribGetBoolean(ih, "MODAL")) /* already a popup */ return IUP_NOERROR; iDialogSetModal(ih); ih->data->first_show = 1; /* actually show the window */ /* test if placement turn the dialog visible */ if (!iupdrvDialogIsVisible(ih)) iupdrvDialogSetVisible(ih, 1); /* increment visible count */ iupDlgListVisibleInc(); /* flush, then process show_cb and startfocus */ iDialogAfterShow(ih); /* interrupt processing here */ IupMainLoop(); /* if window is still valid (IupDestroy not called), hide the dialog if still visible. */ if (iupObjectCheck(ih)) { iDialogUnSetModal(ih); IupHide(ih); } return IUP_NOERROR; }