|
Hi,
Thank you for checking out my post.
I am writing a simple CPropertySheet (with property pages of course) VC++ 6 Doc/View application, and I want to change the look of the OK or CANCEL buttons.
Trouble is that I don't seem to be able to create a control variable of either buttons. The buttons are provided by the framework I am thinking, but does anyone know how to access them?
The only interaction I have with the Cancel or OK buttons is to check the return value when dlg.DoModal() returns and that is it.
Thanks for any suggestions.
Michael
|
|
|
|
|
In the property sheet class, you can call GetDlgItem(IDOK) to get a CWnd* on the OK button. Change IDOK to IDCANCEL for the Cancel button.
--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
Latest art~!@#2rDFA#@(#*%$Rfa39f3fqwf--=
NO CARRIER
|
|
|
|
|
Hi Mike,
Thank you so much for replying. I seem to recognize your name...I think you have kindly helped me in the past.
Anyway, I did try GetDlgItem(ID_OK) before I posted my question and I couldn't get it to work. It must be the way I did it. It would compile ok but crash on running when doing the check "ASSERT(::IsWindow(m_hWnd));". Here's the code I used within my CPropertySheet class's constructor :-
CMyPropertySheet::CMyPropertySheet(LPCTSTR pszCaption,
CWnd* pParentWnd, UINT iSelectPage)
:CPropertySheet(pszCaption, pParentWnd, iSelectPage)
{
//add each page to the propert sheet
this->AddPage(&this->m_prop_page1);
//get pointer to OK button so I can alter it
CButton * pbutton = (CButton *)this->GetDlgItem(IDOK);
}
Actually, as I write this I realize that maybe the propertySheet is not a window (and that includes the OK button) until I run "property_sheet_obj.DoModal()", so that might be the problem right there. Do I have to alter the OK button after the DoModal().....I will try that.
Thanks Mike and thank you all for any suggestions or confirmation.
Michael
|
|
|
|
|
No windows are created until after DoModal(), so it might be easiest to do the change in the first page that gets shown:
CPropertySheet* pSheet = (CPropertySheet*) GetParent();
CWnd* pOKBtn = pSheet->GetDlgItem(IDOK);
pOKBtn->SetWindowText ( _T("'Aight") );
--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
Latest art~!@#2rDFA#@(#*%$Rfa39f3fqwf--=
NO CARRIER
|
|
|
|
|
|
I'm about to create a Word like replacement for my self, Word doesn't have CD-R burning features/XML format/Templates (HTML)/portiblility from comp to comp that i need so I'm going to make a replacement. Possibly if it is built right I'll sell copies. To start out how should I CFormView or CRichEdit?
Also I'm courious about how to include an Intelisense Like feature in a RichEdit/Edit box.
-Steven Hicks
CPACodeProjectAddict
|
|
|
|
|
|
Nope, I've had a teacher that specifily requested Arial font, 1inch margins, specific headers etc. and my other teachers hated format. Instead of modifing the default and going against it, used XML and my CMS (ltpb.8m.com/XMLHTML[^]) and it worked well, I can take all of my work from the year on a floppy disk, including the data, templates (which preserve the formating) and programs I can use it almost anywhere. Also computers at school are a niche for macro and other viruses. Plus, I don't want to have to bother with O97/2k/2k3 incompatibilities.
-Steven Hicks
CPACodeProjectAddict
|
|
|
|
|
I'm not sure you realize what you're proposing. Word required hundreds of developers and years to create.
If you wish to use MFC, the proper way to start is not with CFormView or CRichEdit -- but with CWnd (doing everything from scratch). I seriously doubt that Edit or RichEdit controls would be modifiable to do what you want.
A couple suggestions:
- IE provides a DHTML Editor.
- OpenOffice[^] -- has a Word clone with cross platform source.
Perhaps one or the other could be modified to do what you want.
|
|
|
|
|
Who ever thinks they can get a word processor is really high on something cause you would have alot of time and man power. You could just make a program like notepad but wordpad would still be hard to do. []_.(()).[]_.
[It is possible to represent everything in this universe by using 0 and 1]
I'm going to live forever or die trying.
|
|
|
|
|
snyp wrote:
[...]is really high on something[...]
Probably the same stuff that my management uses...
snyp wrote:
[It is possible to represent everything in this universe by using 0 and 1]
But not necessarily with a number of digits less than unlimited....
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
Ever heard about LaTeX to write reports ?
~RaGE();
|
|
|
|
|
How do I make a dialog box in my MFC SDI app behave like a AutoHiding dialog box in vs.net? (with the tab on the side)?
-Steven Hicks
CPACodeProjectAddict
|
|
|
|
|
If you are interested, there are a few libraries out there that can do this for you. One I found that is very good is Xtreme Docking Pane.
See: http://www.codejock.com/products/dockingpane/.
Very affordable and comes in MFC, ActiveX and .NET Windows Forms.
Cheers,
Scott Evans
|
|
|
|
|
Hi
I am looking for some good UI and a place to buy components. I know of:
http://www.componentsource.com
http://www.programmersparadise.com
Most of the components are good but is there one focused site that concentrates on MFC/C++ components? And what do you guys think of the CodeJock library as that is the one I am closely looking at purchasing After reading the CP review and such.
Your thoughts or recommendations would be greatly appreciated.
Code4Food
----
"There is no try; only do or do not"
-Yoda
|
|
|
|
|
BCGControlBar is excellent. Very similar to CodeJock, high quality, and cheaper.
HPS HwndSpy - GUI developer's aid to visually
locate and inspect windows. For the month of August
only, use coupon code CP-81239 for 30% off.
|
|
|
|
|
Xtreme Toolkit Professional Edition is much better!
BCG is nice, but are lacking when compared to the office gui's that they are thing to mimic. Codejock does a much nicer job in this area, and their components are an almost exact match to Office.
Additionally, BCG is definitely not cheaper either, I just did a price comparison and they are actually priced more than Codejock libraries by a few bucks, both standard and professional.
Cheers,
Scott Evans
|
|
|
|
|
|
Wow! Thanks I didn't even realize that library existed! I am eagerly reviewing it now.
Code4Food
----
"There is no try; only do or do not"
-Yoda
|
|
|
|
|
Don't be too excited dude. Do check carefully the licence.txt file that is distributed with the sources, you will discover that it is free for non-commercial use only.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
|
on their homepage (www.prof-uis.com) is a newer version that in this article
|
|
|
|
|
Hello!
Mr. Franks seems quite misinformed.
Codejock Software's products are completely and professionally written, and are no way a collection of articles from codeguru as he suggests. I know that one of their developers did a freeware collection way back around 97'-98, but that is no way affiliated with any of their commercial products.
If you haven’t seen their products I would suggest that you take a look at Xtreme Toolkit Professional Edition, which I would say is probably one of the best, professionally written libraries I have seen out there, and I have reviewed several including the Prof-UIS one.
See: Xtreme Toolkit Professional Edition
Cheers,
Scott Evans
|
|
|
|
|
A combobox is (according to MS) a Listbox with an associated EditBox. Listboxes can be multi-column but I could find no documentation on how to make the listbox part of a combobox have multi-columns.
I need 2 columns because the listbox needs to hold a varchar DB field and the recordID.
I have tried 3 ways so far - none of which I like:
1) Create a second set of hidden comboboxes to store the corresponding database key. So when someone selects a string from the visible combobox that GetCurSel() index is used to pull the DB key from the hidden combobox. This sucks because creating a control just to hide it seems kludgy.
2) Create a dynamically allocatted array of DB keys after I query the DB and determine how many records there are.
3) Append each string in the visible combox with their recordID and then move chars from the end of the string forwards until I hit whitespace. That is just plain ugly.
Isn't there a way to make the listbox portion of a combobox have multiple columns? I can see why it doesn't - since the selected item's text gets copied to the edit box, there is no obvious answer to what to do with the text from the other columns. If it is flat out impossible, then Microsoft should never have defined their combobox as being a combo listbox/editbox because it isn't a listbox if it can't do what listboxes do.
|
|
|
|
|