|
I dont think you can do that.
But what I would suggest is go for GetTextExtent
and test the width and keep adding spaces until
you get enough for the column width you want to
have.
|
|
|
|
|
Thanks Prem.....But I need individual character columns to line up vertically just as they would with a fixed pitch font.
|
|
|
|
|
I think in order to do this with a TTF that is not mono-spaced you will need to create an owner-drawn version of the edit control.
When you draw the characters, you will first need to scan the font that you are creating and determine the width of the largest character in the font. You can use a function like GetCharWidth32 .
Then when you paint your characters into the edit control, the column width will be at least the width that you calculated for the widest character. You will need to paint one character at a time, one character per column.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Thanks....your suggestion appears to be exactly what must be done. I have looked at the GetCharWidth32() function and it gives exactly the information I need. I think I may just scan the strings I am trying to display at the given moment and find the widest character from that set and align the multiple stacked edit boxes based upon that width. If the user edits the string(s) again and selects some other wider character the controls repaint anyway and will find the wider character and update accordingly.
Thanks Again !!!
|
|
|
|
|
Doesn't
CFont font;
font.CreateStockObject(OEM_FIXED_FONT);
GetDlgItem(IDC_EDIT)->SetFont(&font);<pre>work?
|
|
|
|
|
I believe that your suggestion will give a result that is similar to my current use of the Courier font. I actually need to find the solution that works with the font that is already set for the dialog. This is becasue that font may have been set to a Unicode font with far eastern characters in it and I need to make sure that font gets used, not one selected by the CreateStockObject().
|
|
|
|
|
My question is: Do you really need it to be a multi-line edit?
Perhaps a simple listbox where you set tab stops would do it, or even a list control? After all, if you want to display columnar data it seems a list control indeed is what you are looking for.
|
|
|
|
|
How do you make a button not visable at runtime in MFC?
What property of CButton should I use? EnableWindow(FALSE)only grays it out I want to hide it.
Thanks!
|
|
|
|
|
You can hide the button using ShowWindow(SW_HIDE). For example:
-----
GetDlgItem (ID_APPLY_NOW)->ShowWindow (SW_HIDE);
-----
Whatever you pass into GetDlgItem(....) is the nID of the item you are interested in.
Kuphryn
|
|
|
|
|
CButton is derived from CWnd and thus you can use CWnd::ShowWindow to show/hide a button. Use SW_SHOW to show it and SW_HIDE to hide it.
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Hi Nish, try this:
MoveWindow(-999, -999, 0, 0);
Maxwell Chen
People say "No news is good news". Then, no code is good code!?
|
|
|
|
|
Why should I?
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
I want to make a dialog based program that just contains an edit box. Then I want to update that box with information every 30 seconds. Is it possible to do considering that windows hides the looping?
|
|
|
|
|
It is very possible. You can use OnTimer(). You will need to set a time count, etc. Nonetheless, yes it is very possible.
Kuphryn
|
|
|
|
|
I just wanted to say that whether or not the message loop is hidden from you, you still have the ability to process messages with the dialog proc that you create for your dialog. Or if you are using MFC, the messages that you add to the message table.
Like your previous reply stated you can call SetTimer to create a timer that will trigger an WM_TIMER or OnTimer event for whatever tiem interval that you choose.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Hi out there !
I've just a little beginners-question:
When I create a child Window with the "WS_CHILD | WS_CAPTION | WS_SYSMENU" flags, the child window's
titlebar is always shown with the system defined inactive color. Is there any way (not using MFC) to give it an activated look ?
Thanks in advance for any answers
Jay
|
|
|
|
|
include the style WS_VISIBLE?
|
|
|
|
|
Send it the message WM_NCACTIVATE .
You need to do this manually, as only top-level windows are "active" as far as Windows is concerned.
--------
I am not a connoisseur. --Shog9 --
|
|
|
|
|
Hi everyone,
Has anyone experienced problems with AVIFileOpen() locking up for a _long_ time? I'm opening VERY large (1+ GB) uncompressed AVI files, and AVIFileOpen takes absolutely ages to return. When it does, the avi stream is the correct length and resolution, but all the frames are completely blank. I thought maybe the AVI file was broken (I'm creating the AVI files in the same app), but M$ MediaPlayer opens them fine, and in a very short time. Is there any way to get around this problem?
I guess that Mediaplayer uses DirectShow, rather than the Video for Windows API, which is getting on a bit now. But it is simple to use and serves my purpose, or rather it did until now. I hope that I can avoid having to re-write all my code to use DirectShow, which at the moment would be like using a sledgehammer to crack a pistachio
If anyone has any bright ideas about this, it would really help me out.
Thanks,
Pete
|
|
|
|
|
I suggest you have a look at VirtualDub. It's GPL so source is of course available.
|
|
|
|
|
Hi there,
I know that some programming languages like Delphi cannot use MFC extention DLLs ...
Can i write an ActiveX for that ?
I mean writing an activex for using MFC extention DLLs in all of Delphi programs ?
Can you tell me how ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
yes, you could encapsulate your MFC classes into a COM object then use it in Delphi.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
you can also write a standard C-interfaced DLL. most every programming environment out there can handle one.
if you want to write an ActiveX component, you'll need to get a book on it. it's a big subject.
-c
"Should you not have a ramekin of sea salt beside the stove, you don’t deserve oatmeal."
Dean Allen
|
|
|
|
|
All games (I think) have that function that they can find the game server on the network. Do you know how to do that?
Rickard Andersson@Suza Computing
ICQ#: 50302279 (Add me!)
E-mail: nikado@pc.nu
I'm from the winter country SWEDEN!
|
|
|
|
|
Most servers send UDP packets to a master server and get as a response an UDP packet with a list of all the servers currently running.
You may download the sourcecode of "qstat" in order to watch what packets you need to send
modified 12-Sep-18 21:01pm.
|
|
|
|