|
Hey
I have a C++ WIN32 app having a dialog with 5 buttons.
Now i want to call the SetFocus() function to set the focus on each buttons. The focus does get set in a way, i.e., if i press the space key in key board, it will infact click the button to which the SetFocus() function was set. But visually it doesn't work.
i.e., it doesn't draw a blue border on the button giving it a visual feel that the button has focus on it.
Why is this happening? Is there a way to have SetFocus() draw the blue border along the button?
If i open a windows folder on top of it, it will draw the blue border along the button that was called with SetFocus() function.
Thanks in advance.
|
|
|
|
|
May be you have to invalidate the button to enforce a redraw ...
|
|
|
|
|
|
Ok, may be you must follow this by a call to UpdateWindow, 'cause InvalidateWindow simply raise a flag to send a WM_Paint message to the window if the message queue is empty ...
|
|
|
|
|
that's a good question... who actually draws that, the button or button's parent window? maybe invalidate the parent window?
|
|
|
|
|
AFAIK the window (and every control is a window by itself) draws itself until the style is owner-drawn.
If you invalidate the parent window, this will draw itself and then force a redraw of EVERY of its child windows.
(To minimize this effect there is a function InvalidateRegion)
But my knowledge is from old WinAPI32 - may be something changed since then ...
modified on Thursday, March 17, 2011 3:36 PM
|
|
|
|
|
i know every control is a window, but that's why i was asking who really draws the button "highlighting"? ...it would depend on how the framework implemented the highlighting, which i'm not really sure about... but if he says that dragging an explorer window over it does the trick, that has the same effect as invalidating the parent...
|
|
|
|
|
Are CDialog::SetDefID() or CDialog::GotoDlgCtrl() of any help?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
Finally i got this working.
What i did was, do a SetFocus(ParentWindow) and then do a SetFocus(ChildWindow) on this order and it worked just fine.
|
|
|
|
|
Seems that is what I replied to another question - is it that this button is the only editable control on the form ?
'Caus then, a SetFocus() will have no effect on painting, 'cause the focus didn't change really ...
|
|
|
|
|
Correct me if I'm wrong, but Visual C++ seems to have gotten properties right (this native Visual C++, non-standard attribute)...
__declspec( property( get=get_func_name, put=put_func_name ) ) declarator
I'm embarassed to say that they've had this for a long time and I'm only now messing with it (yes, I realize there are articles that talk about it here but I had never truly wanted to use this until just recently), but their approach to properties for native Visual C++ development allows the property to be used like a member (assuming proper implementation of the accessor and mutator of course) whereas the C# implementation has the restriction
"A property or indexer may not be passed as an out or ref variable".
So far it seems to work intuitively (and can do things C# properties can't ), but...
Does anyone know of any serious negative aspects to using it besides that it's not standard? Am I missing some caveat?
|
|
|
|
|
Hi All
I am loading multiple object On OpenGL.When i load Only one object ,the object movement is
very smooth.After the increase the number object on screen at that time the movement is going slow.
Please suggest the way how to increase the speed when multiple object on screen.
Thanks
|
|
|
|
|
Are you loading your objects (or textures, or anything) from a file ? If yes, are you loading the file once or for every frame ? If you are loading the files for every frame, you should load them once at the beginning of your program. File I/O is very slow.
It's the only thing I can think that could slow down performance and that has a quick fix. If you already do that, then you will have to look for yourself how you can increase the performances of your program. Your question is so vague that there's no way to give you a correct answer.
|
|
|
|
|
Ok,Here i am sending you my RenderScene function which is continuous call.
I am loading image Once only.The other are text,Line,Point and 3D object.
Void RenderScene()
{
glClear(GL_COLOR_BUFFER_BIT| GL_DEPTH_BUFFER_BIT );
float R = (float)GetRValue(m_s3DDispManagerSetting.dwScreenBkColor)/255.0;
float G = (float)GetGValue(m_s3DDispManagerSetting.dwScreenBkColor)/255.0;
float B = (float)GetBValue(m_s3DDispManagerSetting.dwScreenBkColor)/255.0;
::glClearColor(R, G, B, 0.0f);
glPushMatrix();
glLoadIdentity();
glShadeModel(GL_FLAT) ;
glEnable(GL_NORMALIZE) ;
multimap<int , stObjectInfo>::iterator it;
glScalef(m_fScale, m_fScale, m_fScale);
glRotated(m_fRAngle[0],1.0, 0.0, 0.0);
glRotated(m_fRAngle[1],0.0,1.0, 0.0);
glRotated(m_fRAngle[2],0.0,0.0,1.0);
glDepthMask(GL_TRUE);
for(it = m_sMapObjectInfo.begin(); it != m_sMapObjectInfo.end(); it++)
{
stObjectInfo sObjectInfo = (*it).second;
if(sObjectInfo.eObjectType == OBJECT_LINE)
glCallList((*it).first);
}
for(it = m_sMapObjectInfo.begin(); it != m_sMapObjectInfo.end(); it++)
{
stObjectInfo sObjectInfo = (*it).second;
if(sObjectInfo.eObjectType == OBJECT_POINT)
glCallList((*it).first);
}
for(it = m_sMapObjectInfo.begin(); it != m_sMapObjectInfo.end(); it++)
{
stObjectInfo sObjectInfo = (*it).second;
if(sObjectInfo.eObjectType == OBJECT_TEXT)
glCallList((*it).first);
}
for(it = m_sMapObjectInfo.begin(); it != m_sMapObjectInfo.end(); it++)
{
stObjectInfo sObjectInfo = (*it).second;
if(sObjectInfo.eObjectType == OBJECT_IMAGE)
glCallList((*it).first);
}
for(it = m_sMapObjectInfo.begin(); it != m_sMapObjectInfo.end(); it++)
glEnable(GL_CULL_FACE);
glCullFace(GL_BACK);
glFrontFace(GL_CW);
for(it = m_sMapObjectInfo.begin(); it != m_sMapObjectInfo.end(); it++)
{
stObjectInfo sObjectInfo = (*it).second;
if(sObjectInfo.eObjectType == OBJECT_3D)
{
glMaterialfv(GL_FRONT_AND_BACK , GL_DIFFUSE, sObjectInfo.fIntensity);
glCallList((*it).first);
}
}
glDisable(GL_CULL_FACE);
glDisable(GL_BLEND);
glPopMatrix();
}
|
|
|
|
|
when bmp image is used in the dialog background then the button creates a white border.
how to remove this border.
sample of how it looks is below
http://i55.tinypic.com/25qdj79.png[^]
Some Day I Will Prove MySelf :: GOLD
|
|
|
|
|
Not sure but, try setting Transparent property of button to true. (WS_EX_TRANSPARENT style).
|
|
|
|
|
i have checked it's not working.
Some Day I Will Prove MySelf :: GOLD
|
|
|
|
|
goldenrose9 wrote: http://i55.tinypic.com/25qdj79.png[^]
not able to open the link due to corporate issue. anyways.. if by any mean i can able to see the bitmap, i can comment on same!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
sir what do i do so u can see the bitmap?
sir a small brief of my program is as follows.
my program is in win32,
i had used BMP image on the Dialog,
the BMP image cover the entire dialog.
BMP image is in blue color.
And added a button on the dialog.
without using manifest the button is ok, but after enabling xp visual style a strange border is created around the button. As the Dialog has BMP image loaded, it creates a strange look, if some how the extra border of the button can be removed, then it will be ok. I am unable to remove the extra border.
i don't want to remove the button border, i want to remove only the extra border that is created around the button after enabling xp visual styles.
please help.
Some Day I Will Prove MySelf :: GOLD
|
|
|
|
|
May be this is the 'default button' signal - I'm not sure.
Try to add another HIDDEN button to the form and make that button the default one.
HTH
|
|
|
|
|
this is not the default signal, because i have four buttons on the dialog, and each button have the same problem. When the button are in classic style every thing is ok. But after enabling XP Visual Styles this problem occurs.
Some Day I Will Prove MySelf :: GOLD
|
|
|
|
|
Hi all!
I am developing an application which will work for two monitors. The additional monitor has a touch screen. Now I want to get the force of click for it. I found it seems like some APIs can get it because some applications can respond for it. But I don't know which API(s) can do it. Is here somebody be kind to tell me? Thank you!
Sincerely!
There is some white cloud floating on the blue sky. That's the landscape I like.
|
|
|
|
|
|
Nope...
You hadn't get my meaning. I try to find a API to get the value of strength when I click the touch pad. Not insert mouse event into message-queue.
There is some white cloud floating on the blue sky. That's the landscape I like.
|
|
|
|
|
Sorry for my misunderstanding (read error) . You mean touch pressure strength or, I think, sometimes called pressure size. I'm not sure that this is standard information beside location information reported by device. This theoretically possible feature may not be carried out by all manufacturers.
|
|
|
|