ReactOS 0.4.15-dev-7958-gcd0bb1a
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 TEXT(s)
Definition: k32.h:26
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
Definition: muldiv.c:25
HFONT _hfont
Definition: pane.h:61
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define LOGPIXELSY
Definition: wingdi.h:719
#define CreateFont
Definition: wingdi.h:4443

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}
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
Definition: mk_font.cpp:20
#define LOCALE_USER_DEFAULT
SIZE _spaceSize
Definition: pane.h:59
TCHAR _num_sep
Definition: pane.h:60
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define GetTextExtentPoint32
Definition: wingdi.h:4472
#define GetNumberFormat
Definition: winnls.h:1187
char TCHAR
Definition: xmlstorage.h:189

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}
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLdouble s
Definition: gl.h:2039
#define d
Definition: ke_i.h:81
#define b
Definition: ke_i.h:79
const WCHAR * str
LONG cx
Definition: kdterminal.h:27
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
#define lstrlen
Definition: winbase.h:3876
#define DT_NOPREFIX
Definition: winuser.h:537
#define DT_END_ELLIPSIS
Definition: winuser.h:529
#define DT_SINGLELINE
Definition: winuser.h:540
#define DrawText
Definition: winuser.h:5771
#define DT_RIGHT
Definition: winuser.h:538
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
CHAR * LPTSTR
Definition: xmlstorage.h:192

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
908}
#define DT_TABSTOP
Definition: winuser.h:541
#define DT_EXPANDTABS
Definition: winuser.h:532

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}
GLbitfield flags
Definition: glext.h:7161

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: