Click here to Skip to main content
15,881,204 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: How to get IDOK / IDCANCEL command message from an non-modal dialog set as client in CFrameWindowImpl? Pin
Philipp Kursawe17-Mar-11 0:24
Philipp Kursawe17-Mar-11 0:24 
GeneralRe: How to get IDOK / IDCANCEL command message from an non-modal dialog set as client in CFrameWindowImpl? Pin
Alain Rist17-Mar-11 9:49
Alain Rist17-Mar-11 9:49 
QuestionUsing CContainedWindowT in a base class causes assert in conrete class Pin
Philipp Kursawe10-Mar-11 20:39
Philipp Kursawe10-Mar-11 20:39 
AnswerRe: Using CContainedWindowT in a base class causes assert in conrete class Pin
Alain Rist11-Mar-11 10:13
Alain Rist11-Mar-11 10:13 
GeneralRe: Using CContainedWindowT in a base class causes assert in conrete class Pin
Philipp Kursawe13-Mar-11 11:14
Philipp Kursawe13-Mar-11 11:14 
QuestionHow to create an flicker free owner draw listbox using CDoubleBufferWindowImpl? Pin
Philipp Kursawe10-Mar-11 17:57
Philipp Kursawe10-Mar-11 17:57 
AnswerRe: How to create an flicker free owner draw listbox using CDoubleBufferWindowImpl? Pin
Alain Rist13-Mar-11 6:00
Alain Rist13-Mar-11 6:00 
GeneralRe: How to create an flicker free owner draw listbox using CDoubleBufferWindowImpl? Pin
Philipp Kursawe13-Mar-11 11:18
Philipp Kursawe13-Mar-11 11:18 
Thanks Alain, this works (almost)!
I am using your WTL::CControlDialogImpl to show the listbox in a modal dialog. The drawing is a little off now.
void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT item)
    if (item->itemID == -1) return;

    WTL::CDCHandle dc(item->hDC);

    dc.GradientFillRect(item->rcItem, RGB(200,200,200), RGB(10,10,10), false);
    if (item->itemState == ODS_FOCUS) {
      dc.SetTextColor(RGB(255,255,255));
    } else {
      dc.SetTextColor(RGB(255,255,255));
    }
    WCHAR text[1024];
    int chars = m_Ctrl.GetText(item->itemID, text);
    dc.SetBkMode(TRANSPARENT);
    dc.SelectFont(font);
    dc.DrawText(text, chars, &item->rcItem, DT_NOPREFIX | DT_SINGLELINE | DT_CENTER | DT_VCENTER | DT_END_ELLIPSIS);
}


After some rows the gradients stop to show up and the background is just the standard window color.
Happy coding,
Philipp Kursawe

QuestionQuestion about draw my own object in Word. Pin
whiteclouds8-Mar-11 16:03
whiteclouds8-Mar-11 16:03 
QuestionProblems with MFCTabCtrl/MDITabbedControl Pin
Dansveen7-Mar-11 10:26
Dansveen7-Mar-11 10:26 
QuestionNewline as <<ALT + ENTER>> in PreTranslateMessage for MultilineEdit Control Pin
Vishal_K897-Mar-11 0:13
Vishal_K897-Mar-11 0:13 
AnswerRe: Newline as > in PreTranslateMessage for MultilineEdit Control Pin
Cool_Dev7-Mar-11 2:07
Cool_Dev7-Mar-11 2:07 
Questionwrite a C program to find the area and perimeter of a circle? Pin
valyvachouama3-Mar-11 5:54
valyvachouama3-Mar-11 5:54 
AnswerRe: write a C program to find the area and perimeter of a circle? Pin
_AnsHUMAN_ 3-Mar-11 19:18
_AnsHUMAN_ 3-Mar-11 19:18 
GeneralRe: write a C program to find the area and perimeter of a circle? Pin
valyvachouama3-Mar-11 20:32
valyvachouama3-Mar-11 20:32 
GeneralRe: write a C program to find the area and perimeter of a circle? Pin
Richard MacCutchan3-Mar-11 22:11
mveRichard MacCutchan3-Mar-11 22:11 
AnswerRe: write a C program to find the area and perimeter of a circle? Pin
Stephen Hewitt4-Mar-11 17:03
Stephen Hewitt4-Mar-11 17:03 
Questionfreeing pointers in pointer array causes SegFault [solved] Pin
Jordanwb27-Feb-11 9:03
Jordanwb27-Feb-11 9:03 
AnswerRe: freeing pointers in pointer array causes SegFault Pin
Cool_Dev27-Feb-11 19:06
Cool_Dev27-Feb-11 19:06 
AnswerRe: freeing pointers in pointer array causes SegFault Pin
Richard MacCutchan27-Feb-11 23:01
mveRichard MacCutchan27-Feb-11 23:01 
GeneralRe: freeing pointers in pointer array causes SegFault Pin
Jordanwb28-Feb-11 4:18
Jordanwb28-Feb-11 4:18 
GeneralRe: freeing pointers in pointer array causes SegFault Pin
Richard MacCutchan28-Feb-11 6:10
mveRichard MacCutchan28-Feb-11 6:10 
GeneralRe: freeing pointers in pointer array causes SegFault Pin
Jordanwb28-Feb-11 6:57
Jordanwb28-Feb-11 6:57 
QuestionMAPI: MapiRecipDesc is not properly working with Lotus Notes (ver8.5) [modified] Pin
vinvino200122-Feb-11 2:55
vinvino200122-Feb-11 2:55 
AnswerRe: MAPI: MapiRecipDesc is not properly working with Lotus Notes (ver8.5) Pin
vinvino200123-Feb-11 20:17
vinvino200123-Feb-11 20:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.