Exemple #1
0
// Select a control
void CLTGUICtrl::Select(LTBOOL bSelected)
{
	if (IsSelected() != bSelected)
	{
		m_bSelected=bSelected;
		OnSelChange();
	}
}
Exemple #2
0
/*----------------------------------------------------------------------------------------------
	Convert notifications from the IconComboPopup into notifications for the parent of the
	IconComboCombo.
----------------------------------------------------------------------------------------------*/
bool IconComboCombo::OnCommand(int cid, int nc, HWND hctl)
{
    switch (nc)
    {
    case CBN_SELENDOK:
        return OnSelEndOK();
    case CBN_SELENDCANCEL:
        return OnSelEndCancel();
    case CBN_SELCHANGE:
        return OnSelChange();
    default:
        return SuperClass::OnCommand(cid, nc, hctl);
    }
}
Exemple #3
0
static VOID
InitPagefileList(PVIRTMEM pVirtMem)
{
    TCHAR szDisplayString[256];
    TCHAR szSize[64];
    INT Index;
    INT i;

    for (i = 0; i < 26; i++)
    {
        if (pVirtMem->Pagefile[i].bUsed)
        {
            if ((pVirtMem->Pagefile[i].NewMinSize == -1) &&
                (pVirtMem->Pagefile[i].NewMaxSize == -1))
            {
                LoadString(hApplet,
                           IDS_PAGEFILE_NONE,
                           szSize,
                           sizeof(szSize) / sizeof(szSize[0]));
            }
            else if ((pVirtMem->Pagefile[i].NewMinSize == 0) &&
                     (pVirtMem->Pagefile[i].NewMaxSize == 0))
            {
                LoadString(hApplet,
                           IDS_PAGEFILE_SYSTEM,
                           szSize,
                           sizeof(szSize) / sizeof(szSize[0]));
            }
            else
            {
                _stprintf(szSize, _T("%d - %d"),
                          pVirtMem->Pagefile[i].NewMinSize,
                          pVirtMem->Pagefile[i].NewMaxSize);
            }

            _stprintf(szDisplayString,
                      _T("%s  [%s]\t%s"),
                      pVirtMem->Pagefile[i].szDrive,
                      pVirtMem->Pagefile[i].pszVolume ? pVirtMem->Pagefile[i].pszVolume : _T(""),
                      szSize);

            Index = SendMessage(pVirtMem->hListBox, LB_ADDSTRING, (WPARAM)0, (LPARAM)szDisplayString);
            SendMessage(pVirtMem->hListBox, LB_SETITEMDATA, Index, i);
        }
    }

    SendMessage(pVirtMem->hListBox, LB_SETCURSEL, (WPARAM)0, (LPARAM)0);

    OnSelChange(pVirtMem->hSelf, pVirtMem);
}
Exemple #4
0
void CListBox::OnReflectedCtrlMsg(uint iMsg)
{
	// Decode message.
	switch(iMsg)
	{
		// Selection changed.
		case LBN_SELCHANGE:
			OnSelChange();
			break;

		// Unknown.
		default:
			break;
	}
}
Exemple #5
0
	//--------------------------------------------------------------------------------
	long CTab::OnNotify( NotificationMessageHeader* pHdr )
	{
		_WINQ_FCONTEXT( "CTab::OnNotify" );

		long lResult = 0;

		if( pHdr != 0 )
		{
			switch ( pHdr->m_uiCode )
			{
			case NM_CLICK:
				{
					OnClick( pHdr );
				}
				break;
			case NM_DBLCLK:
				{
					lResult = static_cast< long >( OnDblClick( pHdr ) ? 0 : 1 );
				}
				break;
			case NM_RCLICK:
				{
					lResult = static_cast< long >( OnRClick( pHdr ) ? 0 : 1 );
				}
				break;
			case NM_RDBLCLK:
				{
					lResult = static_cast< long >( OnRDblClick( pHdr ) ? 0 : 1 );
				}
				break;
#if		( _WIN32_IE >= 0x0400 )
			case NM_RELEASEDCAPTURE:
				{
					OnReleasedCapture( pHdr );
				}
				break;
			case TCN_GETOBJECT:
				{
					OnGetObject( reinterpret_cast< NMOBJECTNOTIFY* >( pHdr ) );
				}
				break;
#endif//( _WIN32_IE >= 0x0400 )
#if		( _WIN32_IE >= 0x0500 )
			case TCN_FOCUSCHANGE:
				{
					OnFocusChange( pHdr );
				}
				break;
#endif//( _WIN32_IE >= 0x0500 )
			case TCN_KEYDOWN :
				{
					OnKeyDown( reinterpret_cast< NMTCKEYDOWN* >( pHdr ) );
				}
				break;
			case TCN_SELCHANGE:
				{
					OnSelChange( pHdr );
				}
				break;
			case TCN_SELCHANGING:
				{
					lResult = static_cast< long >( OnSelChanging( pHdr ) ? 0 : 1 );
				}
				break;
			default:
				{
					lResult = OnUnknownNotification( pHdr );
				}
				break;
			}
		}
		return lResult;
	}
Exemple #6
0
INT_PTR CALLBACK
VirtMemDlgProc(HWND hwndDlg,
               UINT uMsg,
               WPARAM wParam,
               LPARAM lParam)
{
    PVIRTMEM pVirtMem;

    UNREFERENCED_PARAMETER(lParam);

    pVirtMem = (PVIRTMEM)GetWindowLongPtr(hwndDlg, DWLP_USER);

    switch (uMsg)
    {
        case WM_INITDIALOG:
            pVirtMem = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(VIRTMEM));
            if (pVirtMem == NULL)
            {
                EndDialog(hwndDlg, 0);
                return FALSE;
            }

            SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pVirtMem);

            OnInitDialog(hwndDlg, pVirtMem);
            break;

        case WM_DESTROY:
            OnDestroy(pVirtMem);
            break;

        case WM_COMMAND:
            switch (LOWORD(wParam))
            {
                case IDCANCEL:
                    EndDialog(hwndDlg, 0);
                    return TRUE;

                case IDOK:
                    OnOk(pVirtMem);
                    EndDialog(hwndDlg, pVirtMem->bModified);
                    return TRUE;

                case IDC_NOPAGEFILE:
                    OnNoPagingFile(pVirtMem);
                    return TRUE;

                case IDC_SYSMANSIZE:
                    OnSysManSize(pVirtMem);
                    return TRUE;

                case IDC_CUSTOM:
                    OnCustom(pVirtMem);
                    return TRUE;

                case IDC_SET:
                    OnSet(pVirtMem);
                    return TRUE;

                case IDC_PAGEFILELIST:
                    switch (HIWORD(wParam))
                    {
                        case LBN_SELCHANGE:
                            OnSelChange(hwndDlg, pVirtMem);
                            return TRUE;
                    }
                    break;
            }
            break;
    }

    return FALSE;
}
Exemple #7
-5
static INT_PTR CALLBACK DialogProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
	static activePage = 0;

	switch (msg)
	{
	/* init */
	case WM_INITDIALOG:
		{
			LOCALDATA *data = LocalAlloc(LPTR, sizeof(LOCALDATA));
			HINSTANCE inst = (HINSTANCE)lParam;
			TCITEM item;

			/* init */
			SetWindowLong(hwnd, GWL_USERDATA, (LONG)data);
			data->htab = GetDlgItem(hwnd, IDC_TABS);
			data->hdlg = NULL;
			/* add pages */
			item.mask = TCIF_TEXT;
			data->all[0] = CreateDialog(inst, MAKEINTRESOURCE(IDD_CONFIG_GENERAL), hwnd, GeneralProc);
			item.pszText = "General";
			TabCtrl_InsertItem(data->htab, 0, &item);

			data->all[1] = CreateDialog(inst, MAKEINTRESOURCE(IDD_CONFIG_OUTPUT), hwnd, OutputProc);
			item.pszText = "Output";
			TabCtrl_InsertItem(data->htab, 1, &item);
			/* get rect (after adding pages) */
			GetWindowRect(data->htab, &data->r);
			ScreenToClientRect(hwnd, &data->r);
			TabCtrl_AdjustRect(data->htab, 0, &data->r);
			/* simulate item change */
			TabCtrl_SetCurSel(data->htab, activePage);
			OnSelChange(hwnd);
		}
		return TRUE;
	/* destory */
	case WM_DESTROY:
		{
			LOCALDATA *data = (LOCALDATA*)GetWindowLong(hwnd, GWL_USERDATA);
			int i;

			activePage = TabCtrl_GetCurSel(data->htab);

			for (i=0; i<NUM_PAGES; i++)
				DestroyWindow(data->all[i]);

			LocalFree(data);
		}
		break;
	/* commands */
	case WM_COMMAND:
		switch (LOWORD(wParam))
		{
		/* ok/cancel */
		case IDOK:
			BroadcastCommand(hwnd, IDOK);
			/* fall through */
		case IDCANCEL:
			EndDialog(hwnd, LOWORD(wParam));
			return TRUE;
		case IDC_RESET:
			SendCommand(hwnd, IDC_RESET);
			break;
		}
		break;
	/* notification */
	case WM_NOTIFY:
		if (LOWORD(wParam) == IDC_TABS)
		{
			NMHDR *hdr = (NMHDR*)lParam;

			switch (hdr->code)
			{
			case TCN_SELCHANGE:
				OnSelChange(hwnd);
				break;
			}
		}
		break;
	}

	return 0;
}