Beispiel #1
0
static void pagermenuact(control m)
{
    control c = getdata(m);
    ConsoleData p = getdata(c);
    if (consolecancopy(c)) {
	enable(p->mcopy);
	enable(p->mpopcopy);
	if (CharacterMode == RGui) {
	    enable(p->mpaste);
	    enable(p->mpastecmds);
	    enable(p->mpoppaste);
	    enable(p->mpoppastecmds);
	}
    } else {
	disable(p->mcopy);
	disable(p->mpopcopy);
	disable(p->mpaste);
	disable(p->mpastecmds);
	disable(p->mpoppaste);
	disable(p->mpoppastecmds);
    }
    if (ismdi())
	disable(PagerPopup[5].m);
    else {
	enable(PagerPopup[5].m);
	if (isTopmost(c))
	    check(PagerPopup[5].m);
	else
	    uncheck(PagerPopup[5].m);
    }
}
Beispiel #2
0
static void popupact(control m)
{
    if (consolegetlazy(RConsole))
	check(ConsolePopup[9].m);
    else
	uncheck(ConsolePopup[9].m);

    if (consolecancopy(RConsole)) {
	enable(ConsolePopup[0].m);
	enable(ConsolePopup[3].m);
    } else {
	disable(ConsolePopup[0].m);
	disable(ConsolePopup[3].m);
    }
    if (consolecanpaste(RConsole)) {
	enable(ConsolePopup[1].m);
	enable(ConsolePopup[2].m);
    } else {
	disable(ConsolePopup[1].m);
	disable(ConsolePopup[2].m);
    }
    if (ismdi())
	disable(ConsolePopup[10].m);
    else {
	if (isTopmost(RConsole))
	    check(ConsolePopup[10].m);
	else
	    uncheck(ConsolePopup[10].m);
    }
}
Beispiel #3
0
void bringToTop(int stay) /* stay=0 for regular, 1 for topmost, 2 for toggle */
{

  if (windowHandle) {
SetForegroundWindow(windowHandle); /* needed in Rterm */
  BringWindowToTop(windowHandle);    /* needed in Rgui --mdi */

  if (stay == 2) stay = !isTopmost(windowHandle);

  if (stay) SetWindowPos(windowHandle, HWND_TOPMOST, 0, 0, 0, 0,
          SWP_NOMOVE | SWP_NOSIZE);
else SetWindowPos(windowHandle, HWND_NOTOPMOST, 0, 0, 0, 0,
          SWP_NOMOVE | SWP_NOSIZE);

  } else
    lib::printMessage("window not bound");
}