ReactOS  0.4.13-dev-961-g238ea69
OutputWorker Struct Reference

Worker for drawing contents of file lists in child pane. More...

#include <pane.h>

Collaboration diagram for OutputWorker:

Public Member Functions

 OutputWorker ()
 
void init_output (HWND hwnd)
 
void output_text (LPDRAWITEMSTRUCT dis, int *positions, int col, LPCTSTR str, DWORD flags)
 
void output_tabbed_text (LPDRAWITEMSTRUCT dis, int *positions, int col, LPCTSTR str)
 
void output_number (LPDRAWITEMSTRUCT dis, int *positions, int col, LPCTSTR str)
 

Public Attributes

SIZE _spaceSize
 
TCHAR _num_sep
 
HFONT _hfont
 

Detailed Description

Worker for drawing contents of file lists in child pane.

Definition at line 50 of file pane.h.

Constructor & Destructor Documentation

◆ OutputWorker()

OutputWorker::OutputWorker ( )

Definition at line 860 of file pane.cpp.

861 {
862  _hfont = CreateFont(-MulDiv(8,GetDeviceCaps(WindowCanvas(0),LOGPIXELSY),72), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, TEXT("MS Sans Serif"));
863 }
#define CreateFont
Definition: wingdi.h:4428
HFONT _hfont
Definition: pane.h:61
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define TEXT(s)
Definition: k32.h:26
#define LOGPIXELSY
Definition: wingdi.h:718
#define MulDiv(x, y, z)
Definition: gdifloat.h:86

Member Function Documentation

◆ init_output()

void OutputWorker::init_output ( HWND  hwnd)

Definition at line 865 of file pane.cpp.

866 {
867  TCHAR b[16];
868 
869  WindowCanvas canvas(hwnd);
870 
871  if (GetNumberFormat(LOCALE_USER_DEFAULT, 0, TEXT("1000"), 0, b, 16) > 4)
872  _num_sep = b[1];
873  else
874  _num_sep = TEXT('.');
875 
876  FontSelection font(canvas, _hfont);
877  GetTextExtentPoint32(canvas, TEXT(" "), 1, &_spaceSize);
878 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
Definition: mk_font.cpp:20
#define LOCALE_USER_DEFAULT
HFONT _hfont
Definition: pane.h:61
char TCHAR
Definition: xmlstorage.h:189
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
SIZE _spaceSize
Definition: pane.h:59
#define TEXT(s)
Definition: k32.h:26
#define GetNumberFormat
Definition: winnls.h:1184
#define GetTextExtentPoint32
Definition: wingdi.h:4457
TCHAR _num_sep
Definition: pane.h:60

Referenced by Pane::init().

◆ output_number()

void OutputWorker::output_number ( LPDRAWITEMSTRUCT  dis,
int positions,
int  col,
LPCTSTR  str 
)

Definition at line 910 of file pane.cpp.

911 {
912  int x = dis->rcItem.left;
913  RECT rt;
914  LPCTSTR s = str;
915  TCHAR b[128];
916  LPTSTR d = b;
917  int pos;
918 
919  rt.left = x+positions[col]+_spaceSize.cx;
920  rt.top = dis->rcItem.top;
921  rt.right = x+positions[col+1]-_spaceSize.cx;
922  rt.bottom = dis->rcItem.bottom;
923 
924  if (*s)
925  *d++ = *s++;
926 
927  // insert number separator characters
928  pos = lstrlen(s) % 3;
929 
930  while(*s)
931  if (pos--)
932  *d++ = *s++;
933  else {
934  *d++ = _num_sep;
935  pos = 3;
936  }
937 
939 }
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
LONG top
Definition: windef.h:292
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define DT_RIGHT
Definition: winuser.h:538
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
#define DT_NOPREFIX
Definition: winuser.h:537
CHAR * LPTSTR
Definition: xmlstorage.h:192
#define DrawText
Definition: winuser.h:5672
const WCHAR * str
#define DT_END_ELLIPSIS
Definition: winuser.h:529
LONG cx
Definition: windef.h:319
#define b
Definition: ke_i.h:79
char TCHAR
Definition: xmlstorage.h:189
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define d
Definition: ke_i.h:81
GLdouble s
Definition: gl.h:2039
#define DT_SINGLELINE
Definition: winuser.h:540
SIZE _spaceSize
Definition: pane.h:59
#define lstrlen
Definition: winbase.h:3690
LONG bottom
Definition: windef.h:294
TCHAR _num_sep
Definition: pane.h:60

Referenced by Pane::draw_item().

◆ output_tabbed_text()

void OutputWorker::output_tabbed_text ( LPDRAWITEMSTRUCT  dis,
int positions,
int  col,
LPCTSTR  str 
)

Definition at line 894 of file pane.cpp.

895 {
896  int x = dis->rcItem.left;
897  RECT rt;
898 
899  rt.left = x+positions[col]+_spaceSize.cx;
900  rt.top = dis->rcItem.top;
901  rt.right = x+positions[col+1]-_spaceSize.cx;
902  rt.bottom = dis->rcItem.bottom;
903 
904 /* DRAWTEXTPARAMS dtp = {sizeof(DRAWTEXTPARAMS), 2};
905  DrawTextEx(dis->hDC, (LPTSTR)str, -1, &rt, DT_SINGLELINE|DT_NOPREFIX|DT_EXPANDTABS|DT_TABSTOP, &dtp);*/
906 
907  DrawText(dis->hDC, (LPTSTR)str, -1, &rt, DT_SINGLELINE|DT_EXPANDTABS|DT_TABSTOP|(2<<8));
908 }
#define DT_EXPANDTABS
Definition: winuser.h:532
#define DT_TABSTOP
Definition: winuser.h:541
LONG top
Definition: windef.h:292
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
CHAR * LPTSTR
Definition: xmlstorage.h:192
#define DrawText
Definition: winuser.h:5672
const WCHAR * str
LONG cx
Definition: windef.h:319
#define DT_SINGLELINE
Definition: winuser.h:540
SIZE _spaceSize
Definition: pane.h:59
LONG bottom
Definition: windef.h:294

Referenced by Pane::draw_item().

◆ output_text()

void OutputWorker::output_text ( LPDRAWITEMSTRUCT  dis,
int positions,
int  col,
LPCTSTR  str,
DWORD  flags 
)

Definition at line 881 of file pane.cpp.

882 {
883  int x = dis->rcItem.left;
884  RECT rt;
885 
886  rt.left = x+positions[col]+_spaceSize.cx;
887  rt.top = dis->rcItem.top;
888  rt.right = x+positions[col+1]-_spaceSize.cx;
889  rt.bottom = dis->rcItem.bottom;
890 
892 }
LONG top
Definition: windef.h:292
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
#define DT_NOPREFIX
Definition: winuser.h:537
CHAR * LPTSTR
Definition: xmlstorage.h:192
#define DrawText
Definition: winuser.h:5672
const WCHAR * str
LONG cx
Definition: windef.h:319
GLbitfield flags
Definition: glext.h:7161
#define DT_SINGLELINE
Definition: winuser.h:540
SIZE _spaceSize
Definition: pane.h:59
LONG bottom
Definition: windef.h:294

Referenced by Pane::draw_item().

Member Data Documentation

◆ _hfont

HFONT OutputWorker::_hfont

◆ _num_sep

TCHAR OutputWorker::_num_sep

Definition at line 60 of file pane.h.

Referenced by init_output(), and output_number().

◆ _spaceSize


The documentation for this struct was generated from the following files: