Click here to Skip to main content
16,010,473 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: casting problems for int Pin
roadragedave3-May-04 11:26
roadragedave3-May-04 11:26 
GeneralRe: casting problems for int Pin
roadragedave3-May-04 11:28
roadragedave3-May-04 11:28 
GeneralRe: casting problems for int Pin
valikac3-May-04 12:02
valikac3-May-04 12:02 
GeneralRe: casting problems for int Pin
David Crow4-May-04 2:06
David Crow4-May-04 2:06 
GeneralRe: casting problems for int Pin
David Crow4-May-04 2:05
David Crow4-May-04 2:05 
GeneralRe: casting problems for int Pin
roadragedave4-May-04 3:56
roadragedave4-May-04 3:56 
GeneralRe: casting problems for int Pin
David Crow4-May-04 4:55
David Crow4-May-04 4:55 
QuestionMFC->How to create different-shaped buttons in runtime? Pin
l00p1n63-May-04 9:59
l00p1n63-May-04 9:59 
problem:
i need different-shaped buttons to be placed in client area in runtime.
for example:
rightclick in client area opens context menu with options:
round button
triangle button
by clicking on one of the above appropriate button shoud be drawn in client area. this button (like all others created this way) should have all standard properties of a button (CButton)

my experiment:
i've tried with SetWindowRgn but id doesn't work
then i used "common" CreateWindow with BUTTON as parametar and got a nice round button but my program wouldn't accept any further rightclicks (no context menu)

this is my method wich creates squared flat button
(i could create many buttons)

void CpaintView::OnFalseCircle()
{
CPoint point;
GetCursorPos(&point);
ScreenToClient(&point);
CButton *cir = new CButton();
cir->Create("tri",BS_FLAT, CRect(point,CPoint
(point.x+20,point.y+20)),AfxGetMainWnd(),1);
cir->ShowWindow(SW_SHOWNORMAL);
}
and non-working method wich creates one circle and stucks

void CpaintView::OnCircle()
{
CPoint point;
GetCursorPos(&point);
ScreenToClient(&point);
CRect rect(point, CPoint(point.x+50, point.y+50));
CRgn rgn;
Circle *cr = new Circle();
rgn.CreateEllipticRgnIndirect(rect);
SetWindowRgn(rgn,true);
CreateWindow("BUTTON","",WS_CHILD | WS_VISIBLE, point.x-10,point.y- 10,70, 70, *this,(HMENU)101,0,0);
}

thanks
GeneralNTFS Security Descriptor Help Pin
wgordon3-May-04 9:14
wgordon3-May-04 9:14 
Generalmessages Pin
pnpfriend3-May-04 8:52
pnpfriend3-May-04 8:52 
Generalmessages Pin
Anonymous3-May-04 8:48
Anonymous3-May-04 8:48 
GeneralRe: messages Pin
David Crow3-May-04 9:42
David Crow3-May-04 9:42 
GeneralRe: messages Pin
pnpfriend3-May-04 9:52
pnpfriend3-May-04 9:52 
Questioncan any one help me Pin
shammyrly3-May-04 6:57
shammyrly3-May-04 6:57 
AnswerRe: can any one help me Pin
David Crow3-May-04 7:31
David Crow3-May-04 7:31 
GeneralA question about Network Programming Pin
nguyenvhn3-May-04 6:46
nguyenvhn3-May-04 6:46 
GeneralRe: A question about Network Programming Pin
David Crow3-May-04 7:34
David Crow3-May-04 7:34 
GeneralConnection Points and Events Pin
Ross White3-May-04 6:44
Ross White3-May-04 6:44 
Generalplease help with EVB !! Pin
bathroom3-May-04 6:39
bathroom3-May-04 6:39 
Generalabout wav Pin
hp0123-May-04 6:31
hp0123-May-04 6:31 
GeneralRe: about wav Pin
Alexander M.,4-May-04 3:23
Alexander M.,4-May-04 3:23 
GeneralRe: about wav Pin
Paul Belikian4-May-04 11:18
Paul Belikian4-May-04 11:18 
GeneralAnimation under Visual C++ Pin
3-May-04 6:05
suss3-May-04 6:05 
QuestionHow do we find a programs memory allocation Pin
Opwar3-May-04 5:02
Opwar3-May-04 5:02 
AnswerRe: How do we find a programs memory allocation Pin
David Crow3-May-04 5:24
David Crow3-May-04 5:24 

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.