ReactOS  0.4.11-dev-946-g431643b
column.c File Reference
#include "precomp.h"
Include dependency graph for column.c:

Go to the source code of this file.

Macros

#define DECLARE_COLUMN_PRESET(_name, _size, _state)   { IDS_TAB_##_name, IDC_##_name, _size, _state },
 

Functions

static int InsertColumn (int nCol, LPCWSTR lpszColumnHeading, int nFormat, int nWidth, int nSubItem)
 
INT_PTR CALLBACK ColumnsDialogWndProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 
void AddColumns (void)
 
void SaveColumnSettings (void)
 
void ProcessPage_OnViewSelectColumns (void)
 
void UpdateColumnDataHints (void)
 

Variables

UINT ColumnDataHints [COLUMN_NMAX]
 
const PresetColumnEntry ColumnPresets [COLUMN_NMAX]
 

Macro Definition Documentation

◆ DECLARE_COLUMN_PRESET

#define DECLARE_COLUMN_PRESET (   _name,
  _size,
  _state 
)    { IDS_TAB_##_name, IDC_##_name, _size, _state },

Definition at line 28 of file column.c.

Function Documentation

◆ AddColumns()

void AddColumns ( void  )

Definition at line 63 of file column.c.

Referenced by ProcessPage_OnViewSelectColumns(), and ProcessPageWndProc().

64 {
65  LRESULT size;
66  WCHAR szTemp[256];
67  unsigned int n;
68 
69  for (n=0; n<COLUMN_NMAX; n++) {
71  LoadStringW(hInst, ColumnPresets[n].dwIdsName, szTemp, sizeof(szTemp)/sizeof(WCHAR));
73  }
74  }
75 
78 
80 }
#define COLUMN_NMAX
Definition: column.h:51
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define LVCFMT_LEFT
Definition: commctrl.h:2568
int ColumnSizeArray[COLUMN_NMAX]
Definition: taskmgr.h:82
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
UINT_PTR WPARAM
Definition: windef.h:207
GLuint n
Definition: s_context.h:57
#define HDM_GETITEMCOUNT
Definition: commctrl.h:718
LONG_PTR LPARAM
Definition: windef.h:208
HWND hProcessPageHeaderCtrl
Definition: procpage.c:39
const PresetColumnEntry ColumnPresets[COLUMN_NMAX]
Definition: column.c:31
void UpdateColumnDataHints(void)
Definition: column.c:203
GLsizeiptr size
Definition: glext.h:5919
#define HDM_SETORDERARRAY
Definition: commctrl.h:794
BOOL Columns[COLUMN_NMAX]
Definition: taskmgr.h:80
HINSTANCE hInst
Definition: dxdiag.c:13
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
TASKMANAGER_SETTINGS TaskManagerSettings
Definition: taskmgr.c:52
static int InsertColumn(int nCol, LPCWSTR lpszColumnHeading, int nFormat, int nWidth, int nSubItem)
Definition: column.c:82
int ColumnOrderArray[COLUMN_NMAX]
Definition: taskmgr.h:81
LONG_PTR LRESULT
Definition: windef.h:209

◆ ColumnsDialogWndProc()

INT_PTR CALLBACK ColumnsDialogWndProc ( HWND  hDlg,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 166 of file column.c.

Referenced by ProcessPage_OnViewSelectColumns().

167 {
168  unsigned int i;
169 
170  switch (message)
171  {
172  case WM_INITDIALOG:
173 
174  for (i=0; i<COLUMN_NMAX; i++) {
176  CheckDlgButton(hDlg, ColumnPresets[i].dwIdcCtrl, BST_CHECKED);
177  }
178  return TRUE;
179 
180  case WM_COMMAND:
181 
182  if (LOWORD(wParam) == IDCANCEL)
183  {
184  EndDialog(hDlg, LOWORD(wParam));
185  return TRUE;
186  }
187 
188  if (LOWORD(wParam) == IDOK)
189  {
190  for (i=0; i<COLUMN_NMAX; i++)
192 
193  EndDialog(hDlg, LOWORD(wParam));
194  return TRUE;
195  }
196 
197  break;
198  }
199 
200  return 0;
201 }
BOOL WINAPI CheckDlgButton(_In_ HWND, _In_ int, _In_ UINT)
Definition: tftpd.h:59
#define TRUE
Definition: types.h:120
#define IDOK
Definition: winuser.h:824
#define COLUMN_NMAX
Definition: column.h:51
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
GLenum GLclampf GLint i
Definition: glfuncs.h:14
const PresetColumnEntry ColumnPresets[COLUMN_NMAX]
Definition: column.c:31
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL Columns[COLUMN_NMAX]
Definition: taskmgr.h:80
#define WM_COMMAND
Definition: winuser.h:1716
#define BST_CHECKED
Definition: winuser.h:197
TASKMANAGER_SETTINGS TaskManagerSettings
Definition: taskmgr.c:52
#define IDCANCEL
Definition: winuser.h:825
#define WM_INITDIALOG
Definition: winuser.h:1715
#define LOWORD(l)
Definition: pedump.c:82

◆ InsertColumn()

static int InsertColumn ( int  nCol,
LPCWSTR  lpszColumnHeading,
int  nFormat,
int  nWidth,
int  nSubItem 
)
static

Definition at line 82 of file column.c.

Referenced by CDowloadingAppsListView::AddColumn(), CAppsListView::AddColumn(), and AddColumns().

83 {
85 
86  column.mask = LVCF_TEXT|LVCF_FMT;
87  column.pszText = (LPWSTR)lpszColumnHeading;
88  column.fmt = nFormat;
89 
90  if (nWidth != -1)
91  {
92  column.mask |= LVCF_WIDTH;
93  column.cx = nWidth;
94  }
95 
96  if (nSubItem != -1)
97  {
98  column.mask |= LVCF_SUBITEM;
99  column.iSubItem = nSubItem;
100  }
101 
102  return ListView_InsertColumn(hProcessPageListCtrl, nCol, &column);
103 }
#define LVCF_WIDTH
Definition: commctrl.h:2557
#define LVCF_TEXT
Definition: commctrl.h:2558
#define LVCF_SUBITEM
Definition: commctrl.h:2559
#define LVCOLUMN
Definition: commctrl.h:2551
#define ListView_InsertColumn(hwnd, iCol, pcol)
Definition: commctrl.h:2606
#define LVCF_FMT
Definition: commctrl.h:2556
GLenum GLenum GLvoid GLvoid * column
Definition: glext.h:5664
WCHAR * LPWSTR
Definition: xmlstorage.h:184
HWND hProcessPageListCtrl
Definition: procpage.c:38

◆ ProcessPage_OnViewSelectColumns()

void ProcessPage_OnViewSelectColumns ( void  )

Definition at line 145 of file column.c.

Referenced by TaskManagerWndProc().

146 {
147  int i;
148 
150  {
151  for (i=Header_GetItemCount(hProcessPageHeaderCtrl)-1; i>=0; i--)
152  {
154  }
155 
156  for (i=0; i<COLUMN_NMAX; i++) {
159  }
160 
161  AddColumns();
162  }
163 }
#define IDOK
Definition: winuser.h:824
#define COLUMN_NMAX
Definition: column.h:51
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:47
#define ListView_DeleteColumn(hwnd, iCol)
Definition: commctrl.h:2609
int ColumnSizeArray[COLUMN_NMAX]
Definition: taskmgr.h:82
#define IDD_COLUMNS_DIALOG
Definition: resource.h:24
GLenum GLclampf GLint i
Definition: glfuncs.h:14
HWND hProcessPageHeaderCtrl
Definition: procpage.c:39
const PresetColumnEntry ColumnPresets[COLUMN_NMAX]
Definition: column.c:31
#define DialogBoxW(i, t, p, f)
Definition: winuser.h:4268
#define Header_GetItemCount(hwndHD)
Definition: commctrl.h:719
INT_PTR CALLBACK ColumnsDialogWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: column.c:166
HWND hMainWnd
Definition: magnifier.c:33
HINSTANCE hInst
Definition: dxdiag.c:13
TASKMANAGER_SETTINGS TaskManagerSettings
Definition: taskmgr.c:52
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
int ColumnOrderArray[COLUMN_NMAX]
Definition: taskmgr.h:81
HWND hProcessPageListCtrl
Definition: procpage.c:38
void AddColumns(void)
Definition: column.c:63

◆ SaveColumnSettings()

void SaveColumnSettings ( void  )

Definition at line 105 of file column.c.

Referenced by ProcessPageWndProc().

106 {
107  HDITEM hditem;
108  int i, n;
109  WCHAR text[260];
110  WCHAR szTemp[256];
111  LRESULT size;
112 
113  /* Reset column data */
114  for (i=0; i<COLUMN_NMAX; i++) {
118  }
119 
120  /* Get header order */
123 
124  /* Get visible columns */
125  for (i = 0; i < SendMessageW(hProcessPageHeaderCtrl, HDM_GETITEMCOUNT, 0, 0); i++) {
126  memset(&hditem, 0, sizeof(HDITEM));
127 
128  hditem.mask = HDI_TEXT|HDI_WIDTH;
129  hditem.pszText = text;
130  hditem.cchTextMax = 260;
131 
133 
134  for (n = 0; n < COLUMN_NMAX; n++) {
135  LoadStringW(hInst, ColumnPresets[n].dwIdsName, szTemp, sizeof(szTemp)/sizeof(WCHAR));
136  if (_wcsicmp(text, szTemp) == 0)
137  {
139  TaskManagerSettings.ColumnSizeArray[n] = hditem.cxy;
140  }
141  }
142  }
143 }
#define TRUE
Definition: types.h:120
#define COLUMN_NMAX
Definition: column.h:51
__wchar_t WCHAR
Definition: xmlstorage.h:180
const WCHAR * text
Definition: package.c:1827
int ColumnSizeArray[COLUMN_NMAX]
Definition: taskmgr.h:82
#define HDI_TEXT
Definition: commctrl.h:689
#define HDITEM
Definition: commctrl.h:682
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
UINT_PTR WPARAM
Definition: windef.h:207
GLuint n
Definition: s_context.h:57
GLenum GLclampf GLint i
Definition: glfuncs.h:14
#define HDM_GETITEMCOUNT
Definition: commctrl.h:718
LONG_PTR LPARAM
Definition: windef.h:208
HWND hProcessPageHeaderCtrl
Definition: procpage.c:39
const PresetColumnEntry ColumnPresets[COLUMN_NMAX]
Definition: column.c:31
GLsizeiptr size
Definition: glext.h:5919
BOOL Columns[COLUMN_NMAX]
Definition: taskmgr.h:80
#define HDM_GETORDERARRAY
Definition: commctrl.h:791
HINSTANCE hInst
Definition: dxdiag.c:13
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
TASKMANAGER_SETTINGS TaskManagerSettings
Definition: taskmgr.c:52
#define HDM_GETITEM
Definition: commctrl.h:734
int ColumnOrderArray[COLUMN_NMAX]
Definition: taskmgr.h:81
LONG_PTR LRESULT
Definition: windef.h:209
#define HDI_WIDTH
Definition: commctrl.h:687
#define memset(x, y, z)
Definition: compat.h:39
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)

◆ UpdateColumnDataHints()

void UpdateColumnDataHints ( void  )

Definition at line 203 of file column.c.

Referenced by AddColumns(), and ProcessPageOnNotify().

204 {
205  HDITEM hditem;
206  WCHAR text[260];
207  ULONG Index;
208  ULONG uItems;
209  WCHAR szTemp[256];
210  UINT i;
211 
213 
214  for (Index=0; Index<uItems; Index++)
215  {
216  memset(&hditem, 0, sizeof(HDITEM));
217 
218  hditem.mask = HDI_TEXT;
219  hditem.pszText = text;
220  hditem.cchTextMax = 260;
221 
223 
224  for (i=0; i<COLUMN_NMAX; i++) {
225  LoadStringW(hInst, ColumnPresets[i].dwIdsName, szTemp, sizeof(szTemp)/sizeof(WCHAR));
226  if (_wcsicmp(text, szTemp) == 0)
228  }
229  }
230 }
#define COLUMN_NMAX
Definition: column.h:51
__wchar_t WCHAR
Definition: xmlstorage.h:180
const WCHAR * text
Definition: package.c:1827
#define HDI_TEXT
Definition: commctrl.h:689
#define HDITEM
Definition: commctrl.h:682
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
GLenum GLclampf GLint i
Definition: glfuncs.h:14
#define HDM_GETITEMCOUNT
Definition: commctrl.h:718
LONG_PTR LPARAM
Definition: windef.h:208
HWND hProcessPageHeaderCtrl
Definition: procpage.c:39
const PresetColumnEntry ColumnPresets[COLUMN_NMAX]
Definition: column.c:31
UINT ColumnDataHints[COLUMN_NMAX]
Definition: column.c:26
unsigned int UINT
Definition: ndis.h:50
static const UCHAR Index[8]
Definition: usbohci.c:18
HINSTANCE hInst
Definition: dxdiag.c:13
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define min(a, b)
Definition: monoChain.cc:55
unsigned int ULONG
Definition: retypes.h:1
#define HDM_GETITEM
Definition: commctrl.h:734
#define memset(x, y, z)
Definition: compat.h:39
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)

Variable Documentation

◆ ColumnDataHints

UINT ColumnDataHints[COLUMN_NMAX]

Definition at line 26 of file column.c.

Referenced by PerfDataGetText(), ProcessPageOnNotify(), and UpdateColumnDataHints().

◆ ColumnPresets

Initial value:
= {
}

Definition at line 31 of file column.c.

Referenced by LoadSettings().