|
Dear all,
What is the simplest way to change the font size of an edit control? For ex., to change from 8 pt to 10 pt.
Thanks.
BRs.
____
Tuan
|
|
|
|
|
Assuming that this is a dialog project, call CEdit::SetFont() in the dialog's OnInitDialog() method. You'll first need to create a font, presumably with a CFont object that belongs to the dialog itself.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Thanks so much, David. Is that the simplest and fastest way?
____
Tuan
|
|
|
|
|
Yes. I think you can also do it in the resource editor, but that might force you to change the font for the entire dialog page in question, and you might not want to do that.
Sometimes I feel like I'm a USB printer in a parallel universe.
|
|
|
|
|
Tuan Dang wrote:
Is that the simplest...
If by "simple" you mean "shortest," then I would have to say yes.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
|
Hi,
I am making an SDI program that needs to switch between "2 panes on the left, 1 on the right" and "1 left, 1 right"
I'm creating the 2 left panes by nesting a CreateStatic in another Splitter. (I make my CreateStatic calls from OnCreateClient) My idea is to somehow (after OnCreateClient) change the nested splitter from 2 rows to just one.
** My question is this: Is there a way I can Redefine my nested splitter and change the number of rows that it displays?
If there is a simpler way to solve this problem please let me know. I have looked at the splitter classes here on CP, but they seem to offer a lot of features that i don't want/need, and if a simpler solution exists I would prefer that.
Thanks.
Mike
"I bet Einstein turned himself all sorts of colors before he invented the light bulb." -- Homer J.
|
|
|
|
|
I've recently been through this process with an application of mine. The key to managing the content of splitter windows is the dialog control ID and parent window assigned to the windows in the splitter panes.
CSplitterWnd requires that the windows that occupy each pane be child windows of the splitter, and have the control ID returned by the CSplitterWnd function IdFromRowCol(int row,int col) . This function returns the control ID required for a given row and column within the splitter. Use SetDlgCtrlId() to set the control ID for the window you want to occupy the splitter pane at row,col. You also need to call SetParent for that same window to set its parent to be the splitter.
Note that the window occupying a splitter pane can be another splitter.
Software Zen: delete this;
|
|
|
|
|
I have a 32 bit (RGBA) image in CBitmap, and for processing purposes i get the array using GetBitmapBits & SetBitmapBits. And after that plot to screen.
The problem is that is only works if the target system is also running on 32bit screen depth. How can i get an array of pixel values from CBitmap to a DIB then after processing plot to screen?
Also, any DIB class? I'm completely lost.
|
|
|
|
|
uus99 wrote:
The problem is that is only works if the target system is also running on 32bit screen depth
why doesn't it work on other bit depths? what happens?
Cleek | Losinger Designs | ClickPic | ThumbNailer
|
|
|
|
|
RGBA: sounds like you are using GDI+. In which case look up GDI+ here at CP, there are several aticles on working with bitmaps. Also, check out Bitmaps & Palettes: CxImage, CDIBSection, CDibData uses GDI and sould give you an insight on converting from one format to anouther if needed. Using GetBitampBits and SetBitmapBits is not garanteed to give you the bits in any given format; therefore, they could eventualy return/set bits using a different format (driver dependent).
Well I hope this helps.
Good Luck!
INTP
|
|
|
|
|
The thing is i am receiving an image from a frame grabber in MemDC, which the image is RGBA (32bits) and tha A=0 all the times, so actually it is RGB (24bits+8bits empty).
At the moment, i can plot to screen using
pDC->StretchBlt(20,40,180,180,&MemDC,10,40,512,512,SRCCOPY);
It works, coz my screen is on 32bit depth. If my screen is changed to 24bit or 16bit, nothing comes out.
So, how can i make sure that i can always plot to any screen depth? I should use DIB is it?
|
|
|
|
|
Sorry I have be gone for a few days.
It almost sounds like the MemDC and the pDC are incompatible, because the color depth of the bitmap should not be the problem. If you select a bitmap of higher resolution than the screen and then blit it to the screen all you should notice, if any thing, is that the colors appear wrong. The only reason (normaly) for using a DIB, insted of a the normal windows bitmap type, is when you need to access the bits directly (more efficeintly). I do no beleive using a DIB will fix the problem. If you do not have a copy of Programming Windows by Charles Petzold, then I recommend you get one, it provides good information on GDI as well as code for working with DIBs. The bit manipulation code in CDibData was based mosly on information from that book.
Good Luck!
P.S. if you figure out what the problem is, please post it.
INTP
|
|
|
|
|
I am working on an OpenSSL application and need to call certain functions within my code. I have declared the following variables:
private: BIGNUM *bnPrime;
private: BIGNUM *bnSecret;
I make the following call and recieve the subsequent error:
StreamReader *sr = new StreamReader(fs);
BN_hex2bn(&bnPrime, sr->ReadLine());
error C2664: 'BN_hex2bn': cannot convert parameter 1 from 'BIGNUM *__gc *' to 'BIGNUM **'
The spec for BN_hex2bn is:
int BN_hex2bn(BIGNUM **a, const char *str);
I'm sure the String* returned from the ReadLine() call will cause an error as well, but if I could get some help with the first part. Thanks!
Alex
|
|
|
|
|
I know you can put what is returned from StreamReader's ReadLine() function into a CString object. Maybe you could do something like this:
CString str = sr->ReadLine();<br />
int nHex = atoi(str);
then convert the number. Just trying to help; don't scold me if it sounds stupid!!!
If it's broken, I probably did it
bdiamond
|
|
|
|
|
I'm just curious...why is it that the number of visual c++ programmers overwhelmed the number of those using Visual Basic/VB.NET and C#, I'm just a newbiew in programming, and looking for a language most suitable for mobile (embedded) development. And in microsoft roadmap for VS.NET whidbey/orca i saw that visual c++ .net will be enhanced for native coding ( i really dont know what this mean and its diff in "manage" offered by .net ). Can anyone help me on this. i'm recently stdying embedded visual C++ 4.0, do you think my knowledge in this PL will be usefull in the future?
|
|
|
|
|
monn wrote:
why is it that the number of visual c++ programmers overwhelmed the number of those using Visual Basic/VB.NET and C#,
How in the world could you possibly gather statistics to support such a claim? If a person has been using VC++ for a number of years, but then starts using VB for a project, how would they go about answering a "What programming language do you use?" poll? Answering VB would mean that all prior work done with VC++ is not considered. Answering VC++ would mean that current work done with VB is not considered. Answering both would effectively cancel each other out.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
God is Real, unless declared Integer.
|
|
|
|
|
It usually helps to put some useful text with a smiley so the recipient does not have to guess as to what is being said/implied.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
"WTF" :no-comments:
God is Real, unless declared Integer.
|
|
|
|
|
monn wrote:
i'm recently stdying embedded visual C++ 4.0, do you think my knowledge in this PL will be usefull in the future?
Maybe, although I am guessing the applications for specifically Visual embedded C++ are limited. There are a ton of applications for C or C++ in an embedded environment, but unlike in the desktop relm, Microsoft does *not* dominate the embedded environment... there are many different platforms out there running embedded systems. It may be running Embedded NT, Linux, or something else...
Your best bet is to learn good overall programming and design practices, and learn whatever specific technologies are needed (or are best) for the particular task in question.
Sometimes I feel like I'm a USB printer in a parallel universe.
|
|
|
|
|
C programmers have been around longer and many (if not most) switched to C++ as a better C (or they had no choise). Visual Basic has not been around as long and is almost usless if someone has not written the controls to interface with in C, C++, Pascal, or some other lower level language first. VB.NET and C# are the new kids on the block and are still MS specific (well VB is too!). If you learn how to program in C/C++ then your skills may be cross platform (more or less). There may in fact be more VB (so called) programmers than C++ programers because the amount of, low level, knowlegde required is less.
INTP
|
|
|
|
|
I wanted to know the coordinate of a child window in relation to a parent window.
To recap my resource script
EDITTEXT IDC_EDIT1,34,50,26,14,ES_AUTOHSCROLL | NOT WS_BORDER<br />
PUSHBUTTON "&Size Info",IDC_SIZE_INFO,69,91,56,26<br />
Someone replied (thanks) saying that i code as follows:
CPoint pt(0,0);
<br />
child->ClientToScreen(&pt);
parent->ScreenToClient(&pt);
My problem is that not getting the correct correct coordinates can anyone explain why it's happening and how to I go about doing it.
Many thanks in advance.
Alton
|
|
|
|
|
To get a client rectangle of a child do the following:
CRect crChild;
pWndChild->GetWindowRect(&crChild);
ScreenToClient(&crChild);
Things to Note:
This is called from the CWnd derived class of the parent.
pWndChild is a pointer to the child window you want the coordinates for.
Ant.
|
|
|
|
|
Coordinates in a resource file are specified in dialog base units, while coordinates used in Windows get/move/size APIs are specified in pixels. GetDialogBaseUnits() is one method you can use to convert between the two.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|