Click here to Skip to main content
15,915,324 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Ultimate Toolbox's drawing style Pin
Maximilien18-Jun-08 3:18
Maximilien18-Jun-08 3:18 
AnswerRe: Ultimate Toolbox's drawing style Pin
James R. Twine18-Jun-08 3:32
James R. Twine18-Jun-08 3:32 
GeneralRe: Ultimate Toolbox's drawing style Pin
sawerr18-Jun-08 3:44
sawerr18-Jun-08 3:44 
GeneralRe: Ultimate Toolbox's drawing style Pin
James R. Twine18-Jun-08 4:07
James R. Twine18-Jun-08 4:07 
GeneralRe: Ultimate Toolbox's drawing style Pin
sawerr18-Jun-08 4:38
sawerr18-Jun-08 4:38 
AnswerRe: Ultimate Toolbox's drawing style Pin
Nibu babu thomas18-Jun-08 6:20
Nibu babu thomas18-Jun-08 6:20 
GeneralRe: Ultimate Toolbox's drawing style Pin
sawerr18-Jun-08 6:58
sawerr18-Jun-08 6:58 
GeneralRe: Ultimate Toolbox's drawing style Pin
Nibu babu thomas19-Jun-08 2:16
Nibu babu thomas19-Jun-08 2:16 
sawerr wrote:
I think DrawItem MEthod is not only for "items". We can paint/make entire control. Right?


You are limited in DrawItem function. The point is that it's just a helper function. The master of these functions is OnPaint or WM_PAINT message.


sawerr wrote:
For example we can make elliptic buttons in ownerdraw():
CRect rect = lpDrawItemStruct->rcItem;
dc.Ellipse(rect);


You are not free to draw anything anytime in DrawItem functions. There is a rule. You draw based on the flag's that's passed in. So if the flag tells you draw entire client area (ODA_DRAWENTIRE)then go around splashing colors, else if it's just to paint a focus rect (ODA_FOCUS) then you can't do that.

Now you may ask how to know if have to draw a focus rect or remove a focus rect, that's why we have the state flag ODS_FOCUS.

Do the same in OnPaint in and you will what I meant.


sawerr wrote:
IS that a right scenario to see that when we need onpaint and can't be done such a thing with DrawItem Method? We can draw entire button with ownerdraw method, but we can't draw Listbox or combobox with ownerdraw, only it is items?


Can you rephrase this question? Smile | :) My brain just fell apart!


Nibu babu thomas
Microsoft MVP for VC++


Code must be written to be read, not by the compiler, but by another human being.

Programming Blog: http://nibuthomas.wordpress.com

GeneralRe: Ultimate Toolbox's drawing style Pin
sawerr19-Jun-08 6:24
sawerr19-Jun-08 6:24 
GeneralRe: Ultimate Toolbox's drawing style Pin
Nibu babu thomas19-Jun-08 17:19
Nibu babu thomas19-Jun-08 17:19 
QuestionHow to get ASCII Character from Decimal value Pin
tns_ranjith18-Jun-08 2:59
tns_ranjith18-Jun-08 2:59 
AnswerRe: How to get ASCII Character from Decimal value Pin
toxcct18-Jun-08 3:04
toxcct18-Jun-08 3:04 
AnswerRe: How to get ASCII Character from Decimal value Pin
CPallini18-Jun-08 3:13
mveCPallini18-Jun-08 3:13 
QuestionRe: How to get ASCII Character from Decimal value Pin
James R. Twine18-Jun-08 3:35
James R. Twine18-Jun-08 3:35 
QuestionProperty Sheet eVC++ WinCE - Urgent Pin
Trupti Mehta18-Jun-08 2:54
Trupti Mehta18-Jun-08 2:54 
Questionget internal ip, getaddrinfo() Pin
smedowns7718-Jun-08 2:50
smedowns7718-Jun-08 2:50 
QuestionRe: get internal ip, getaddrinfo() Pin
David Crow18-Jun-08 2:57
David Crow18-Jun-08 2:57 
AnswerRe: get internal ip, getaddrinfo() Pin
Jijo.Raj18-Jun-08 3:01
Jijo.Raj18-Jun-08 3:01 
AnswerRe: get internal ip, getaddrinfo() Pin
Mark Salsbery18-Jun-08 10:23
Mark Salsbery18-Jun-08 10:23 
QuestionKeyboard messages not received by my window Pin
theCPkid18-Jun-08 2:24
theCPkid18-Jun-08 2:24 
QuestionDynamic Data Exchange using C++ : Urgent Pin
Vishrant Shah18-Jun-08 0:38
Vishrant Shah18-Jun-08 0:38 
GeneralUrgent? No cookie for you... Pin
CPallini18-Jun-08 1:41
mveCPallini18-Jun-08 1:41 
AnswerRe: Dynamic Data Exchange using C++ : Urgent Pin
Alan Balkany18-Jun-08 3:36
Alan Balkany18-Jun-08 3:36 
QuestionHow to dial a phone number ??? Pin
tina->newcoder18-Jun-08 0:32
tina->newcoder18-Jun-08 0:32 
AnswerRe: How to dial a phone number ??? Pin
Hamid_RT18-Jun-08 0:40
Hamid_RT18-Jun-08 0:40 

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.