Re: [Dev-C++] ChooseColor frustration
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Vlada D. <dj...@im...> - 2002-10-23 07:18:23
|
----- Original Message -----
From: "Daniel Glenfield" <sp...@ho...>
To: <dj...@im...>; <dev...@li...>
Sent: Monday, October 21, 2002 1:47 PM
Subject: Re: [Dev-C++] ChooseColor frustration
> Ah, I think you mean
> switch (ID_CHOOSE_COLOR)
> {
> case: GREEN
> {
> // make green
> }
> break;
>
> case: BLUE
> {
> // etc.
> }
> break;
>
> default:
> {
> // make black
> }
> break;
>
> }
>
> The switch statement checks the variable passed in, and matches it to a
> case.
No, ID_CHOOSE_COLOR is a menu item ID, and "case ID_CHOOSE_COLOR:" is a part
of message loop. What I had in mind is to display a ChooseColor dialog,
choose a color and place its value in crCurColor variable, and then use it
to draw lines. Anyway, I just figured out what was the problem: I forgot to
select the pen! Prety stupid! Anyway, thanks for your help and sorry if I
caused any trouble with this nonsense.
Regards, Vlada
>
>
> >From: "Vlada Djurovic" <dj...@im...>
> >To: "'DevC++ help'" <dev...@li...>
> >Subject: [Dev-C++] ChooseColor frustration
> >Date: Mon, 21 Oct 2002 13:13:15 +0200
> >
> >Hi, everybody
> >I have a problem with ChooseColor common dialog. I wrote the code, it
> >compiled OK, but what ever color I choose, I get black. I can't figure
out
> >what's wrong. Here's the code, so if anyone can help me...thanks.
> >
> >case ID_CHOOSE_COLOR:
> > {
> > CHOOSECOLOR chColor;
> > chColor.lStructSize=sizeof(CHOOSECOLOR);
> > chColor.hwndOwner=hwnd;
> > chColor.lpCustColors=crCustColor;
> > chColor.Flags=CC_FULLOPEN;
> >
> > ChooseColor(&chColor);
> > crCurColor=chColor.rgbResult; /*crCurColor is
> >global variable*/
> > }
> > break;
>
>
> _________________________________________________________________
> Choose an Internet access plan right for you -- try MSN!
> http://resourcecenter.msn.com/access/plans/default.asp
>
|