Worker for drawing contents of file lists in child pane. More...
#include <pane.h>

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 |
Worker for drawing contents of file lists in child pane.
Definition at line 50 of file pane.h.
| OutputWorker::OutputWorker | ( | ) |
| void OutputWorker::init_output | ( | HWND | hwnd ) |
Definition at line 865 of file pane.cpp.
References _hfont, _num_sep, _spaceSize, and TEXT.
Referenced by Pane::init().
{
TCHAR b[16];
WindowCanvas canvas(hwnd);
if (GetNumberFormat(LOCALE_USER_DEFAULT, 0, TEXT("1000"), 0, b, 16) > 4)
_num_sep = b[1];
else
_num_sep = TEXT('.');
FontSelection font(canvas, _hfont);
GetTextExtentPoint32(canvas, TEXT(" "), 1, &_spaceSize);
}

| void OutputWorker::output_number | ( | LPDRAWITEMSTRUCT | dis, |
| int * | positions, | ||
| int | col, | ||
| LPCTSTR | str | ||
| ) |
Definition at line 910 of file pane.cpp.
References _num_sep, and _spaceSize.
Referenced by Pane::draw_item().
{
int x = dis->rcItem.left;
RECT rt;
LPCTSTR s = str;
TCHAR b[128];
LPTSTR d = b;
int pos;
rt.left = x+positions[col]+_spaceSize.cx;
rt.top = dis->rcItem.top;
rt.right = x+positions[col+1]-_spaceSize.cx;
rt.bottom = dis->rcItem.bottom;
if (*s)
*d++ = *s++;
// insert number separator characters
pos = lstrlen(s) % 3;
while(*s)
if (pos--)
*d++ = *s++;
else {
*d++ = _num_sep;
pos = 3;
}
DrawText(dis->hDC, b, d-b, &rt, DT_RIGHT|DT_SINGLELINE|DT_NOPREFIX|DT_END_ELLIPSIS);
}

| void OutputWorker::output_tabbed_text | ( | LPDRAWITEMSTRUCT | dis, |
| int * | positions, | ||
| int | col, | ||
| LPCTSTR | str | ||
| ) |
Definition at line 894 of file pane.cpp.
References _spaceSize.
Referenced by Pane::draw_item().
{
int x = dis->rcItem.left;
RECT rt;
rt.left = x+positions[col]+_spaceSize.cx;
rt.top = dis->rcItem.top;
rt.right = x+positions[col+1]-_spaceSize.cx;
rt.bottom = dis->rcItem.bottom;
/* DRAWTEXTPARAMS dtp = {sizeof(DRAWTEXTPARAMS), 2};
DrawTextEx(dis->hDC, (LPTSTR)str, -1, &rt, DT_SINGLELINE|DT_NOPREFIX|DT_EXPANDTABS|DT_TABSTOP, &dtp);*/
DrawText(dis->hDC, (LPTSTR)str, -1, &rt, DT_SINGLELINE|DT_EXPANDTABS|DT_TABSTOP|(2<<8));
}

| void OutputWorker::output_text | ( | LPDRAWITEMSTRUCT | dis, |
| int * | positions, | ||
| int | col, | ||
| LPCTSTR | str, | ||
| DWORD | flags | ||
| ) |
Definition at line 881 of file pane.cpp.
References _spaceSize.
Referenced by Pane::draw_item().
{
int x = dis->rcItem.left;
RECT rt;
rt.left = x+positions[col]+_spaceSize.cx;
rt.top = dis->rcItem.top;
rt.right = x+positions[col+1]-_spaceSize.cx;
rt.bottom = dis->rcItem.bottom;
DrawText(dis->hDC, (LPTSTR)str, -1, &rt, DT_SINGLELINE|DT_NOPREFIX|flags);
}

| HFONT OutputWorker::_hfont |
Definition at line 61 of file pane.h.
Referenced by Pane::calc_single_width(), Pane::calc_widths(), Pane::init(), init_output(), and OutputWorker().
Definition at line 60 of file pane.h.
Referenced by init_output(), and output_number().
Definition at line 59 of file pane.h.
Referenced by Pane::calc_single_width(), Pane::calc_widths(), Pane::draw_item(), init_output(), output_number(), output_tabbed_text(), and output_text().
|
ROS Explorer Source Code Documentation
generated on 02.01.2013 by
|