Public Member Functions | Public Attributes

OutputWorker Struct Reference

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

#include <pane.h>

Collaboration diagram for OutputWorker:
Collaboration graph
[legend]

List of all members.

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 (  )

Definition at line 860 of file pane.cpp.

References _hfont, and TEXT.

{
    _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"));
}

Member Function Documentation

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);
}

Here is the caller graph for this function:

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);
}

Here is the caller graph for this function:

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));
}

Here is the caller graph for this function:

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);
}

Here is the caller graph for this function:


Member Data Documentation

Definition at line 60 of file pane.h.

Referenced by init_output(), and output_number().


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

ROS Explorer Source Code Documentation
generated on 02.01.2013 by doxygen

ROS Explorer Homepage