|
Hi,
if the the text line is longer than the CEdit control, how to do this:
when pointing mouse over the control, the whole line is shown in a tip like rectangle (like when pointing to an item in a listControl, the whole item text is displayed in a rectangle) ?
Thanks!
|
|
|
|
|
I believe there's an event when the text has been changed ( it's probably changed by the time WM_KEYUP fires ), so just keep setting the tooltip to the current text.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Thanks!
and, how to set the tooltip to the CEdit text?
hope there's a sample code showing it.
|
|
|
|
|
Does anyone know of any MFC API functions that allows a client to figure out the width of the dropdown arrow in dropdown buttons? Ultimately, I want to know how big MFC is going to make a button, given the text, font, bitmap, and whether or not it's a dropdown button. We can get the width of all of those, but we don't know how wide the dropdown arrow will be. Alternatively, if there's an API function that will predict for us how wide MFC will make that button, that would be even better. That is, I want to know how big the button will be before we actually create it.
|
|
|
|
|
I don't know of any system metric for the dropdown arrow size, especially before the button is
created..
Does the TB_GETITEMRECT message return the size including the arrow?
If so you could subtract the result of TB_GETBUTTONSIZE to get the arrow width...maybe
|
|
|
|
|
I've been searching for hours on a tutorial that would start me off building a Web Crawler in C++, but haven't found anything.
Anyone know of a suitable link?
Thanks.
http://www.atraeyu.org/
|
|
|
|
|
google with "Building a Web Crawler in C++" returns a number of pages that look promising.
|
|
|
|
|
Googling "Web Crawler" in 50 different ways was the second thing I tried (the first was searching through the code project articles). I searched through all the results - there were several written in Java, but I'm not familiar with Java.
http://www.atraeyu.org/
|
|
|
|
|
|
Hi,
I have a class X that instanciates many other classes that have no major relationship with it (no derivation...). However I need these classes to be able to see some members of the X instance that created them. It is not possible to use static members because they need to be specific to one instance of X.
Do you see any possibility smarter than passing a reference on class X to every instanciated class ?
Thanks.
|
|
|
|
|
Why not just create a function with which you can pass the member into.
|
|
|
|
|
No, I think that the main class may pass a reference to itself when it instantiates the other ones (and hopefully needed members are public).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
I have a Visual C++ application running in Visual Studio.net.
It will have numerous dialog windows that will display labels and data.
The labels and data will be displayed in Text Controls.
There are IDC_XXX names for the labels and data.
What I need to do is dynamically place the labels and data on the Windows dialog given X and Y coordinates.
I cant use a static dialog in my rc resource file.
QUESTION:
Can I move the controls on the dialog given X, Y coordinates?
If so, can someone tell me how this is done??...and how the X, Y system works in a dialog window.
Where is 0,0 etc...??
Thanks,
Jerry
|
|
|
|
|
jerry1211a wrote: Where is 0,0 etc...??
Just above and to the left of 1,1
Use SetWindowPos() or MoveWindow() , don't ask me for an example, ask your teacher.
|
|
|
|
|
jerry1211a wrote: Can I move the controls on the dialog given X, Y coordinates?
Are you looking for MoveWindow() or SetWindowPos() ?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Actually what I have is a dialog window with no controls at this point. I want to write text, numbers, etc to the window, using X, Y coordinates. I thought I could do this but have forgotten how...
Jerry
|
|
|
|
|
The only other way I know of is with TextOut() or DrawText() .
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I can use that Ok, but I need to get the device context for the dialog I created.
Is there a call to get the device context?
Thanks.
Jerry
|
|
|
|
|
jerry1211a wrote: Is there a call to get the device context?
GetDC() .
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Thank You...
Have a good day.
|
|
|
|
|
Ive been playing around with SetPixel(), My program draws random stuff, in random colors, but now i want it to have its own black backgorund which it can setpixel on, something that nothing else can go ontop of...
I firstly created my program in win32 console, in hopes that in fullscreen mode i culd use the console background as my black background, but it didnt work.
So now i need any way (well it can be win32 console, win32, or something MFC based dialog stuff etc) were my program creates its own big black dialog (or something)for me to setpixel on...
It would be good if i can clean the background every now and then too.
Anyone have any good ideas on how to do this?
/Johannes
|
|
|
|
|
Just create an offscreen bitmap, use the FillRect() api to fill with a black brush and away you go.
|
|
|
|
|
Hmm, i played around with FillRect() but i think i might have used it in the wrong way, as it basicly does the same thing as filling the screen using SetPixel..
How should i use FillRect() so its more ontop/permanent?
/Johannes
|
|
|
|
|
I want to compress .bmp file,which i am creating .
both option are available for compressing
1> while saving bitmap
2> after saving into .bmp file.
please tell me what should i do???
There Is Nothing Right & Wrong
|
|
|
|
|
You can easily compress the bitmap file using a zip library. Search CP, there are many articles about using zips. Another method would be to create a bitmap with less bloat, ie use a pallette which contains only the colors required for the bitmap. Another method would be to save the image as a format other than .bmp, like .gif, .png ( probably the best ) and .jpg. Again search CP for these methods.
|
|
|
|