Example #1
0
HWND far pascal zGetNextDlgGroupItem( HWND pp1, HWND pp2, BOOL pp3 )
{
    HWND r;

    SaveRegs();
    /*
    ** Log IN Parameters (No Create/Destroy Checking Yet!)
    */
    LogIn( (LPSTR)"APICALL:GetNextDlgGroupItem HWND+HWND+BOOL+",
        pp1, pp2, pp3 );

    /*
    ** Call the API!
    */
    RestoreRegs();
    GrovelDS();
    r = GetNextDlgGroupItem(pp1,pp2,pp3);
    UnGrovelDS();
    SaveRegs();
    /*
    ** Log Return Code & OUT Parameters (No Create/Destroy Checking Yet!)
    */
    LogOut( (LPSTR)"APIRET:GetNextDlgGroupItem HWND++++",
        r, (short)0, (short)0, (short)0 );

    RestoreRegs();
    return( r );
}
Example #2
0
/**********************************************************************
 *       BUTTON_CheckAutoRadioButton
 *
 * hwnd is checked, uncheck every other auto radio button in group
 */
static void BUTTON_CheckAutoRadioButton( HWND hwnd )
{
    HWND parent, sibling, start;

    parent = GetParent(hwnd);
    /* make sure that starting control is not disabled or invisible */
    start = sibling = GetNextDlgGroupItem( parent, hwnd, TRUE );
    do
    {
        if (!sibling) break;
        if ((hwnd != sibling) &&
            ((GetWindowLongPtrW( sibling, GWL_STYLE) & BS_TYPEMASK) == BS_AUTORADIOBUTTON))
            SendMessageW( sibling, BM_SETCHECK, BST_UNCHECKED, 0 );
        sibling = GetNextDlgGroupItem( parent, sibling, FALSE );
    } while (sibling != start);
}
Example #3
0
static INT_PTR CALLBACK
selector_dialog_proc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
  int i;
  HWND next_item = NULL;

  switch( uMsg )
  {
    case WM_INITDIALOG: 
      /* items are passed to WM_INITDIALOG as lParam */
      selector_dialog_build( hwndDlg, ( win32ui_select_info * ) lParam );
      return TRUE;

    case WM_SETFONT:
      h_ms_font = (HFONT) wParam;
      return TRUE; /* "This message does not return a value." */

    case WM_COMMAND:
      if ( HIWORD( wParam ) != BN_CLICKED ) break;

      /* service OK and Cancel buttons */
      switch( LOWORD( wParam ) )
      {
        case IDOK:
        {
          /* check which radiobutton is selected and return the selection */
          i = 0;
          while( ( next_item = GetNextDlgGroupItem( hwndDlg, next_item,
                                                    FALSE ) ) != NULL ) {
            if( SendDlgItemMessage( hwndDlg, ( IDC_SELECT_OFFSET + i ), 
                                    BM_GETCHECK, 0, 0 ) == BST_CHECKED ) {
              EndDialog( hwndDlg, i );
              return TRUE;
            }
            i++;
          }
          break; /* program should never reach here */
        }
        case IDCANCEL:
          EndDialog( hwndDlg, -1 );
          return TRUE;
      }
      /* service clicking radiobuttons */
      /* FIXME should also be checking if wParam < offset + radio count */
      if( LOWORD( wParam ) >= IDC_SELECT_OFFSET )
        return 0;
      break;

    case WM_DESTROY:
      EndDialog( hwndDlg, -1 );
      return TRUE;
  }
  return FALSE;
}
Example #4
0
static void hugsprim_GetNextDlgGroupItem_15(HugsStackPtr hugs_root)
{
    HsPtr arg1;
    HsPtr arg2;
    HsBool arg3;
    HsPtr res1;
    arg1 = hugs->getPtr();
    arg2 = hugs->getPtr();
    arg3 = hugs->getBool();
    res1 = GetNextDlgGroupItem(arg1, arg2, arg3);
    hugs->putPtr(res1);
    hugs->returnIO(hugs_root,1);
}
Example #5
0
ULONG FASTCALL WU32GetNextDlgGroupItem(PVDMFRAME pFrame)
{
    ULONG ul;
    register PGETNEXTDLGGROUPITEM16 parg16;

    GETARGPTR(pFrame, sizeof(GETNEXTDLGGROUPITEM16), parg16);

    ul = GETHWND16(GetNextDlgGroupItem(HWND32(parg16->f1),
                                       HWND32(parg16->f2),
                                       BOOL32(parg16->f3)));

    FREEARGPTR(parg16);
    RETURN(ul);
}
Example #6
0
BOOL WINAPI
CheckRadioButton(HWND hDlg, int idFirst, int idLast, int idCheck)
{
	HWND hCheck;
	HWND obj;
	UINT dc;

	hCheck = GetDlgItem(hDlg, idCheck);
	if (hCheck == NULL)
		return FALSE;

	/*  First, remove all from previuos in group.  */
	obj = GetNextDlgGroupItem(hDlg, hCheck, TRUE);
	while (obj) {
		if ((idFirst == -1 || (obj->id >= idFirst && obj->id <= idLast))
		    && (((dc =
		       SendMessage(obj, WM_GETDLGCODE, 0, 0)) & DLGC_RADIOBUTTON) != 0))
			SendMessage(obj, BM_SETCHECK, BST_UNCHECKED, 0);

		obj = GetNextDlgGroupItem(hDlg, obj, TRUE);
	}

	/*  Remove on next */
	obj = GetNextDlgGroupItem(hDlg, hCheck, FALSE);
	while (obj) {
		if ((idFirst == -1 || (obj->id >= idFirst && obj->id <= idLast))
		    && (((dc =
		       SendMessage(obj, WM_GETDLGCODE, 0, 0)) & DLGC_RADIOBUTTON) != 0))
			SendMessage(obj, BM_SETCHECK, BST_UNCHECKED, 0);

		obj = GetNextDlgGroupItem(hDlg, obj, FALSE);
	}

	SendMessage(hCheck, BM_SETCHECK, BST_CHECKED, 0);
	return TRUE;
}
Example #7
0
void WINAPI
CheckRadioButton(HWND hDlg, int nIDFirst,int nIDLast,int nIDCheckButton)
{
    HWND	hWndCheck,hWndTemp;
    WORD wID;
    DWORD dwStyle;
    ATOM atmClassName;

    if (!(hWndCheck = GetDlgItem(hDlg,nIDCheckButton)))
        return;
    hWndTemp = GetNextDlgGroupItem(hDlg,hWndCheck,FALSE);
    while(hWndTemp && (hWndCheck != hWndTemp)) {
        wID = GetWindowID(hWndTemp);
        dwStyle = GetWindowLong(hWndTemp,GWL_STYLE);
        atmClassName = GetClassWord(hWndTemp,GCW_ATOM);
        if ((wID >= (WORD)nIDFirst) && (wID <= (WORD)nIDLast) &&
                (atmClassName == atmGlobalLookup[LOOKUP_BUTTON]) &&
                ((LOWORD(dwStyle) == BS_RADIOBUTTON) ||
                 (LOWORD(dwStyle) == BS_AUTORADIOBUTTON)))
            SendMessage(hWndTemp,BM_SETCHECK,FALSE,0);
        hWndTemp = GetNextDlgGroupItem(hDlg,hWndTemp,FALSE);
    }
    SendMessage(hWndCheck,BM_SETCHECK,TRUE,0);
}
Example #8
0
/*
 *  Process messages sent to a dialog and childs
 */
BOOL WINAPI
IsDialogMessage(HWND hDlg, LPMSG lpMsg)
{
	static BOOL kShiftStatus = FALSE;
	HWND hChild;
	int dlgCode;

	if (lpMsg->hwnd == hDlg || ISDLGCONTROL(hDlg, lpMsg->hwnd)) {
		/*  first check if message is a key message...  */
		switch (lpMsg->message) {
		case WM_KEYUP:
			switch (lpMsg->wParam) {
			case VK_LSHIFT:
			case VK_RSHIFT:
			case VK_SHIFT:
				kShiftStatus = FALSE;
				break;
			}
			dlgCode = SendMessage(lpMsg->hwnd, WM_GETDLGCODE,
					    lpMsg->wParam, (LPARAM) lpMsg);
			if ((dlgCode & DLGC_WANTMESSAGE))
				goto skipKeyProcess;

			/* msg is sent to top-child */
			if (ISDLGCONTROL(hDlg, lpMsg->hwnd))
				lpMsg->hwnd = dlgGetCtrlTop(hDlg, lpMsg->hwnd);
			break;

		case WM_KEYDOWN:
			switch (lpMsg->wParam) {
			case VK_LSHIFT:
			case VK_RSHIFT:
			case VK_SHIFT:
				kShiftStatus = TRUE;
				break;
			}
			dlgCode = SendMessage(lpMsg->hwnd, WM_GETDLGCODE,
					    lpMsg->wParam, (LPARAM) lpMsg);
			if ((dlgCode & DLGC_WANTMESSAGE))
				goto skipKeyProcess;

			/* msg is sent to top-child */
			if (ISDLGCONTROL(hDlg, lpMsg->hwnd))
				lpMsg->hwnd = dlgGetCtrlTop(hDlg, lpMsg->hwnd);
			break;

		case WM_CHAR:
			dlgCode = SendMessage(lpMsg->hwnd, WM_GETDLGCODE,
					    lpMsg->wParam, (LPARAM) lpMsg);
			if ((dlgCode & DLGC_WANTMESSAGE))
				goto skipKeyProcess;

			/* msg is sent to top-child */
			if (ISDLGCONTROL(hDlg, lpMsg->hwnd))
				lpMsg->hwnd =
					dlgGetCtrlTop(hDlg, lpMsg->hwnd);
			break;

		case WM_SYSCHAR:
			dlgCode = SendMessage(lpMsg->hwnd, WM_GETDLGCODE,
					    lpMsg->wParam, (LPARAM) lpMsg);

			/* msg is sent to top-child */
			if (ISDLGCONTROL(hDlg, lpMsg->hwnd)
			    && !(dlgCode & DLGC_WANTMESSAGE))
				lpMsg->hwnd = dlgGetCtrlTop(hDlg, lpMsg->hwnd);
			break;
		}

		/*  then parse special key messages...  */
		switch (lpMsg->message) {
		case WM_KEYDOWN:
			switch (lpMsg->wParam) {
			case VK_TAB:
				if ((dlgCode & DLGC_WANTTAB))
					break;
				DPRINTF("Handle VK_TAB key\n");
				hChild = nextTabStop(hDlg, dlgGetCtrlFocus(hDlg),
						     kShiftStatus);
				if (hChild)
					SendMessage(hDlg, WM_NEXTDLGCTL,
						    (WPARAM) hChild, 1);
				return TRUE;

			case VK_DOWN:
			case VK_LEFT:
			case VK_UP:
			case VK_RIGHT:
				if ((dlgCode & DLGC_WANTARROWS))
					break;
				DPRINTF("Handle ARROWS key\n");
				hChild = GetNextDlgGroupItem(hDlg, dlgGetCtrlFocus(hDlg),
						((lpMsg->wParam == VK_LEFT)
						  || (lpMsg-> wParam == VK_UP)));
				if (hChild != NULL) {
					SendMessage(hDlg, WM_NEXTDLGCTL, (WPARAM) hChild, 1);
					if ((dlgCode & DLGC_RADIOBUTTON))
						PostMessage(hChild, WM_CHAR, ' ', 0);
				}
				return TRUE;

			case VK_RETURN:
				hChild = firstDefButton(hDlg);
				if (hChild) {
					PostMessage(hDlg, WM_COMMAND,
						    MAKELONG(GetDlgCtrlID(hChild), BN_CLICKED),
						    (LPARAM) hChild);
				} else
					SendMessage(hDlg, WM_COMMAND, IDOK, 0);
				return TRUE;

			case VK_CANCEL:
			case VK_ESCAPE:
				PostMessage(hDlg, WM_COMMAND, IDCANCEL,
					    (LPARAM) GetDlgItem(hDlg, IDCANCEL));
				return TRUE;
			}
			break;

		case WM_CHAR:
			if ((dlgCode & (DLGC_WANTCHARS)))
				break;
			if ((lpMsg->wParam == '\t')
			    && (dlgCode & DLGC_WANTTAB))
				break;
			if (parseAccelerator(hDlg, lpMsg->wParam))
				return TRUE;
			break;

		case WM_SYSCHAR:
			if (parseAccelerator(hDlg, lpMsg->wParam))
				return TRUE;
			DPRINTF("SYSCHAR %08X %08X\n", lpMsg->wParam,
			       lpMsg->lParam);
			break;
		}

skipKeyProcess:
		TranslateMessage(lpMsg);
		DispatchMessage(lpMsg);
		return TRUE;
	}

	return FALSE;
}
Example #9
0
static void
DoTest2(HWND hwnd)
{
    HWND hCtrl;
    HWND hRad1, hRad2, hRad3, hPsh1, hRad5, hRad6, hRad7, hOK, hCancel;

    // check control IDs
    hCtrl = GetDlgItem(hwnd, rad1);
    ok(GetDlgCtrlID(hCtrl) == rad1, "\n");
    hCtrl = GetDlgItem(hwnd, rad2);
    ok(GetDlgCtrlID(hCtrl) == rad2, "\n");
    hCtrl = GetDlgItem(hwnd, rad3);
    ok(GetDlgCtrlID(hCtrl) == rad3, "\n");
    hCtrl = GetDlgItem(hwnd, psh1);
    ok(GetDlgCtrlID(hCtrl) == psh1, "\n");
    hCtrl = GetDlgItem(hwnd, rad5);
    ok(GetDlgCtrlID(hCtrl) == rad5, "\n");
    hCtrl = GetDlgItem(hwnd, rad6);
    ok(GetDlgCtrlID(hCtrl) == rad6, "\n");
    hCtrl = GetDlgItem(hwnd, rad7);
    ok(GetDlgCtrlID(hCtrl) == rad7, "\n");
    hCtrl = GetDlgItem(hwnd, IDOK);
    ok(GetDlgCtrlID(hCtrl) == IDOK, "\n");
    hCtrl = GetDlgItem(hwnd, IDCANCEL);
    ok(GetDlgCtrlID(hCtrl) == IDCANCEL, "\n");

    // get dialog items
    hRad1 = GetDlgItem(hwnd, rad1);
    hRad2 = GetDlgItem(hwnd, rad2);
    hRad3 = GetDlgItem(hwnd, rad3);
    hPsh1 = GetDlgItem(hwnd, psh1);
    hRad5 = GetDlgItem(hwnd, rad5);
    hRad6 = GetDlgItem(hwnd, rad6);
    hRad7 = GetDlgItem(hwnd, rad7);
    hOK = GetDlgItem(hwnd, IDOK);
    hCancel = GetDlgItem(hwnd, IDCANCEL);

    // group next
    hCtrl = GetNextDlgGroupItem(hwnd, hRad1, FALSE);
    ok(hCtrl == hRad2, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
    hCtrl = GetNextDlgGroupItem(hwnd, hRad2, FALSE);
    ok(hCtrl == hRad3, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
    hCtrl = GetNextDlgGroupItem(hwnd, hRad3, FALSE);
    ok(hCtrl == hPsh1, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
    hCtrl = GetNextDlgGroupItem(hwnd, hPsh1, FALSE);
    ok(hCtrl == hRad5, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
    hCtrl = GetNextDlgGroupItem(hwnd, hRad5, FALSE);
    ok(hCtrl == hRad6, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
    hCtrl = GetNextDlgGroupItem(hwnd, hRad6, FALSE);
    ok(hCtrl == hRad7, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
    hCtrl = GetNextDlgGroupItem(hwnd, hRad7, FALSE);
    ok(hCtrl == hOK, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
    hCtrl = GetNextDlgGroupItem(hwnd, hOK, FALSE);
    ok(hCtrl == hCancel, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
    hCtrl = GetNextDlgGroupItem(hwnd, hCancel, FALSE);
    ok(hCtrl == hRad1, "hCtrl is %s\n", GetNameFromHWND(hCtrl));

    // group prev
    hCtrl = GetNextDlgGroupItem(hwnd, hRad1, TRUE);
    ok(hCtrl == hCancel, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
    hCtrl = GetNextDlgGroupItem(hwnd, hRad2, TRUE);
    ok(hCtrl == hRad1, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
    hCtrl = GetNextDlgGroupItem(hwnd, hRad3, TRUE);
    ok(hCtrl == hRad2, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
    hCtrl = GetNextDlgGroupItem(hwnd, hPsh1, TRUE);
    ok(hCtrl == hRad3, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
    hCtrl = GetNextDlgGroupItem(hwnd, hRad5, TRUE);
    ok(hCtrl == hPsh1, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
    hCtrl = GetNextDlgGroupItem(hwnd, hRad6, TRUE);
    ok(hCtrl == hRad5, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
    hCtrl = GetNextDlgGroupItem(hwnd, hRad7, TRUE);
    ok(hCtrl == hRad6, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
    hCtrl = GetNextDlgGroupItem(hwnd, hOK, TRUE);
    ok(hCtrl == hRad7, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
    hCtrl = GetNextDlgGroupItem(hwnd, hCancel, TRUE);
    ok(hCtrl == hOK, "hCtrl is %s\n", GetNameFromHWND(hCtrl));

    // hide
    ok(ShowWindow(hRad3, SW_HIDE) != 0, "\n");
    ok(ShowWindow(hRad6, SW_HIDE) != 0, "\n");

    // group next with hidden
    hCtrl = GetNextDlgGroupItem(hwnd, hRad1, FALSE);
    ok(hCtrl == hRad2, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
    hCtrl = GetNextDlgGroupItem(hwnd, hRad2, FALSE);
    ok(hCtrl == hPsh1, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
    hCtrl = GetNextDlgGroupItem(hwnd, hPsh1, FALSE);
    ok(hCtrl == hRad5, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
    hCtrl = GetNextDlgGroupItem(hwnd, hRad5, FALSE);
    ok(hCtrl == hRad7, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
    hCtrl = GetNextDlgGroupItem(hwnd, hRad7, FALSE);
    ok(hCtrl == hOK, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
    hCtrl = GetNextDlgGroupItem(hwnd, hOK, FALSE);
    ok(hCtrl == hCancel, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
    hCtrl = GetNextDlgGroupItem(hwnd, hCancel, FALSE);
    ok(hCtrl == hRad1, "hCtrl is %s\n", GetNameFromHWND(hCtrl));

    // group prev with hidden
    hCtrl = GetNextDlgGroupItem(hwnd, hRad1, TRUE);
    ok(hCtrl == hCancel, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
    hCtrl = GetNextDlgGroupItem(hwnd, hRad2, TRUE);
    ok(hCtrl == hRad1, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
    hCtrl = GetNextDlgGroupItem(hwnd, hPsh1, TRUE);
    ok(hCtrl == hRad2, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
    hCtrl = GetNextDlgGroupItem(hwnd, hRad5, TRUE);
    ok(hCtrl == hPsh1, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
    hCtrl = GetNextDlgGroupItem(hwnd, hRad7, TRUE);
    ok(hCtrl == hRad5, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
    hCtrl = GetNextDlgGroupItem(hwnd, hOK, TRUE);
    ok(hCtrl == hRad7, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
    hCtrl = GetNextDlgGroupItem(hwnd, hCancel, TRUE);
    ok(hCtrl == hOK, "hCtrl is %s\n", GetNameFromHWND(hCtrl));

    // show
    ShowWindow(hRad3, SW_SHOWNOACTIVATE);
    ShowWindow(hRad6, SW_SHOWNOACTIVATE);
}