Brandon Corfman | 2 Apr 04:50 2001
Picon

Re: Tool Tips in Modal Dialogs

Jay --

Why did you change the original sample around so much? Not sure from 
your example what it is you're trying to accomplish (give each child 
window a tooltip that contains the text of the child window's ID?) 
but I think you're missing the subclassing that the original code 
provided.

Change OnInitDialog to the following:

m_wndToolTip.Create(m_hWnd);
m_wndToolTip.Activate(TRUE);

HWND hWndChild = ::GetWindow(m_hWnd, GW_CHILD);	

TCHAR szText[256];
while (hWndChild)
{
int	nCtrlId = ::GetDlgCtrlID(hWndChild);
_itoa(nCtrlId, szText, 10);
CToolInfo ctiTest(TTF_CENTERTIP |TTF_IDISHWND| TTF_SUBCLASS, 
hWndChild, (WPARAM)hWndChild, 0, szText);
m_wndToolTip.AddTool(&ctiTest);

hWndChild = ::GetWindow(hWndChild, GW_HWNDNEXT);
}

Good luck!
Brandon

(Continue reading)

Brandon Corfman | 2 Apr 05:06 2001
Picon

Re: Property Sheet in a WTL dialog.

Hi Kevin

My suggestion is to look at the second DevelopMentor WTL White Paper (found at
http://www.develop.com/dm/dev_resources.asp). It has a section on property pages
and I think it has most, if not all, the answers you're looking for.

Best regards,
Brandon

kevin.burton@... wrote:

> I would like to put a property sheet on a dialog box with WTL but I seem to
> be at some what of a stand still. I know about either
> m_propertySheet.SubclassWindow(GetDlgItem(IDC_PROPERTYSHEET));
> or
> m_propertySheet.Attach(GetDlgItem(IDC_PROPERTYSHEET));
> The problem with these two approaches is that I don't know what to put on
> the dialog box resource to act as a place holder for the property sheet. In
> other words what is IDC_PROPERTSHEET in terms of a resource?
>
> The second approach is that I do the following in OnInitDialog
> m_propertySheet.Create(m_hWnd);
> m_propertySheet.ModifyStyleEx(0, WS_EX_CONTROLPARENT);
> m_propertySheet.ModifyStyle(0, WS_TABSTOP);
> m_propertySheet.CenterWindow();
> This "works" but I end up creating a child window that sits on top of the
> main dialog. When the property sheet is closed I am left with a blank dialog
> and no way to close it. I wanted the IDOK buttons on the property sheet to
> act for the whole application, or at least some "global" way of shutting
> down the application. And, I don't want to have to close the property sheet
(Continue reading)

PeteB | 2 Apr 14:16 2001
Picon

RichEdit on a Form

I've a WTL form-based app, the dialog resource for the form contains 
a rich edit control.

Everything is fine if I use version 1 rich edit control but if I 
change to version 2 or 3, the view fails to create.

What am I missing? An app based on a rich edit as it's view is fine 
with any version control, it's just if the view is a form.

Thanks

PeteB

PS: is there a move to make WTL classes conform to (or at least 
support) their MFC equivalent (e.g. WTL::CString Find method doesn't 
have a "start at" parameter). Would you include changes if I sent 
them to you Nenad?

Bernhard Doebler | 2 Apr 15:49 2001
Picon

Re: Property Sheet in a WTL dialog.

charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

Hi,
 
I built the BmpView-Sample. Then I overtook the property sheet part in a self made progra= m and=20 have now a very beautiful dialog with 3 propertypages. I can click "OK" and= =20 nothing happens, I can click on "Abort" and a MessageBox appears since=20 I query the DoModal-method for the result being unequally=20 IDOK.
 
What I'm now looking for is how to impleme= nt the=20 third button. It's the button you press, the variables are stored (settings= are=20 changed) but the dialog does not disappear. The button with me is yet still= =20 disabled. So please tell me when it will be enabled and which event is fire= d=20 when the button is pressed.
 
btw. I not yet have drawn any controls in = the=20 ressourceview on the dialogs that are used as CPropertyPageImpl.= V>
 
Regards
Bernhard Doebler
----- Original Message -----
Fro= m:=20 Brandon=20 Corfman
Sent: Monday, April 02, 2001 5:06= =20 AM
Subject: Re: [wtl] Property Sheet = in a=20 WTL dialog.

My suggestion is to look at the second DevelopMentor W= TL=20 White Paper (found at
http://www.develop= .com/dm/dev_resources.asp).=20 It has a section on property pages
and I think it has most, if not all= , the=20 answers you're looking for.
Leon Finker | 2 Apr 15:51 2001
Picon

Re: RichEdit on a Form

Have you loaded "riched20.dll" and used "RichEdit20A" in Create?

----- Original Message -----
From: <PeteB@...>
To: <wtl@...>
Sent: Monday, April 02, 2001 8:16 AM
Subject: [wtl] RichEdit on a Form

> I've a WTL form-based app, the dialog resource for the form contains
> a rich edit control.
>
> Everything is fine if I use version 1 rich edit control but if I
> change to version 2 or 3, the view fails to create.
>
> What am I missing? An app based on a rich edit as it's view is fine
> with any version control, it's just if the view is a form.
>
> Thanks
>
> PeteB
>
> PS: is there a move to make WTL classes conform to (or at least
> support) their MFC equivalent (e.g. WTL::CString Find method doesn't
> have a "start at" parameter). Would you include changes if I sent
> them to you Nenad?
>
>
>
> To unsubscribe from this group, send an email to:
> wtl-unsubscribe@...
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>

Igor Ostriz | 2 Apr 15:58 2001
Picon

Customizing Menu appearance

I'm developing skins for WTL, and right now I'm on the crossroad:
either to write from scratch CCommandBar (and Menu), or to ask Nenad if he
has the idea :-)
The problem is:

a) don't know how to customize the appearance of TrackPopupMenu,
particularly the NC area (border). I've customized menu items (by OwnerDraw
overrideables in CCommandBar -> DrawItem, MeasureItem), Toolbar buttons,
CommandBar buttons (main menu), but cannot draw the border that surrounds
menu items; that is main window in which menu items are drawn. Can I
subclass that window and where?
b) DoTrackPopupMenu is not overrideable; therefore I must copy all of the
code to make adjustments there; is there any other way?

Anyone has the idea or hint?

kevin.burton | 2 Apr 16:01 2001

RE: Property Sheet in a WTL dialog.

Hello,

I have read this White Paper (WTL Makes UI Programming a Joy, Part 2: The
bells and whistles) but the section on property pages only shows how to
implement a "DoModal" type of dialog. It was from this example that I
started to look at deriving from CPropertySheetImpl. If I use this approach
do I have to use DoModal? If I just have a dialog based application or a
form view type of application what methods can I override at the beginning
and the end to initialize and save the results of the property pages
respectively?

Thank you for your help.

Kevin Burton
kevin.burton@...

-----Original Message-----
From: Brandon Corfman [mailto:bcorfman@...]
Sent: Sunday, April 01, 2001 10:06 PM
To: wtl@...
Subject: Re: [wtl] Property Sheet in a WTL dialog.

Hi Kevin

My suggestion is to look at the second DevelopMentor WTL White Paper (found
at
http://www.develop.com/dm/dev_resources.asp). It has a section on property
pages
and I think it has most, if not all, the answers you're looking for.

Best regards,
Brandon

kevin.burton@... wrote:

> I would like to put a property sheet on a dialog box with WTL but I seem
to
> be at some what of a stand still. I know about either
> m_propertySheet.SubclassWindow(GetDlgItem(IDC_PROPERTYSHEET));
> or
> m_propertySheet.Attach(GetDlgItem(IDC_PROPERTYSHEET));
> The problem with these two approaches is that I don't know what to put on
> the dialog box resource to act as a place holder for the property sheet.
In
> other words what is IDC_PROPERTSHEET in terms of a resource?
>
> The second approach is that I do the following in OnInitDialog
> m_propertySheet.Create(m_hWnd);
> m_propertySheet.ModifyStyleEx(0, WS_EX_CONTROLPARENT);
> m_propertySheet.ModifyStyle(0, WS_TABSTOP);
> m_propertySheet.CenterWindow();
> This "works" but I end up creating a child window that sits on top of the
> main dialog. When the property sheet is closed I am left with a blank
dialog
> and no way to close it. I wanted the IDOK buttons on the property sheet to
> act for the whole application, or at least some "global" way of shutting
> down the application. And, I don't want to have to close the property
sheet
> AND close the application. This method worked for putting a property sheet
> on a dialog with MFC but it does not seem to "attach" to the main page.
>
> Finally I derived CMainDlg from CPropertySheetImpl<CMainDlg>. This worked
> fairly well but I don't have much control over the window, OnInitDialog is
> no longer called and I am not sure where to put "initialization" and
> "shutdown" code as it seems the main dialog does not get WM_DESTROY,
> WM_QUIT, etc. Also as I mentioned OnInitDialog is not called as there is
no
> WM_CREATE or simliar point to initialize or save the property sheets.
>
> Any suggestions?
>
> Thank you.
>
> Kevin Burton
> kevin.burton@...
>
>
> To unsubscribe from this group, send an email to:
> wtl-unsubscribe@...
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

To unsubscribe from this group, send an email to:
wtl-unsubscribe@...

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 

Ramon Smits | 2 Apr 17:18 2001
Picon
Picon

RE: Customizing Menu appearance


> -----Oorspronkelijk bericht-----
> a) don't know how to customize the appearance of TrackPopupMenu,
> particularly the NC area (border). I've customized menu items (by
> OwnerDraw
> overrideables in CCommandBar -> DrawItem, MeasureItem), Toolbar buttons,
> CommandBar buttons (main menu), but cannot draw the border that surrounds
> menu items; that is main window in which menu items are drawn. Can I
> subclass that window and where?

You can draw outside of the given drawitem rectangle. You can retrieve the
dimensions of the whole window in you 1st DrawItem call and then draw the
background. You can retrieve the dimensions with the windowhandle of the
menu.

I do not know these right out of my mind but I shouldn't be much trouble
finding the right API calls. Afterall I also found them :-))

Yours sincerely,
Ramon Smits

Steve Maier | 2 Apr 17:29 2001

Re: RichEdit on a Form

Also look in your stdafx.h file, you will see this line:

#define _RICHEDIT_VER	0x0100

I have gotten version 2 to work fine by loading the DLL like Leon said and 
then I had to change the stdafx.h line to be using version 2.

#define _RICHEDIT_VER	0x0200

Steve Maier, MCSD

----Original Message Follows----
From: "Leon Finker" <lf21@...>
Reply-To: wtl@...
To: <wtl@...>
Subject: Re: [wtl] RichEdit on a Form
Date: Mon, 2 Apr 2001 09:51:05 -0400

Have you loaded "riched20.dll" and used "RichEdit20A" in Create?

----- Original Message -----
From: <PeteB@...>
To: <wtl@...>
Sent: Monday, April 02, 2001 8:16 AM
Subject: [wtl] RichEdit on a Form

> I've a WTL form-based app, the dialog resource for the form contains
> a rich edit control.
>
> Everything is fine if I use version 1 rich edit control but if I
> change to version 2 or 3, the view fails to create.
>
> What am I missing? An app based on a rich edit as it's view is fine
> with any version control, it's just if the view is a form.
>
> Thanks
>
> PeteB
>
> PS: is there a move to make WTL classes conform to (or at least
> support) their MFC equivalent (e.g. WTL::CString Find method doesn't
> have a "start at" parameter). Would you include changes if I sent
> them to you Nenad?
>
>
>
> To unsubscribe from this group, send an email to:
> wtl-unsubscribe@...
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>

To unsubscribe from this group, send an email to:
wtl-unsubscribe@...

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

Jay Giganti | 3 Apr 00:31 2001
Picon

Re: Tool Tips in Modal Dialogs

Brandon,

I changed it because I wrote my code before before I saw the message. 
Once I ran into problems I then tracked down the info at this site. 

>From what I can tell the flags you are using are not the same as the 
AddTool method I was calling. When I updated the flags the code works 
properly in Modal dialogs.

Thanks.

Jay

--- In wtl@..., "Brandon Corfman" <bcorfman <at> a...> wrote:
> Jay --
> 
> Why did you change the original sample around so much? Not sure 
from 
> your example what it is you're trying to accomplish (give each 
child 
> window a tooltip that contains the text of the child window's ID?) 
> but I think you're missing the subclassing that the original code 
> provided.
> 
> Change OnInitDialog to the following:
> 
> m_wndToolTip.Create(m_hWnd);
> m_wndToolTip.Activate(TRUE);
> 
> HWND hWndChild = ::GetWindow(m_hWnd, GW_CHILD);	
> 
> TCHAR szText[256];
> while (hWndChild)
> {
> int	nCtrlId = ::GetDlgCtrlID(hWndChild);
> _itoa(nCtrlId, szText, 10);
> CToolInfo ctiTest(TTF_CENTERTIP |TTF_IDISHWND| TTF_SUBCLASS, 
> hWndChild, (WPARAM)hWndChild, 0, szText);
> m_wndToolTip.AddTool(&ctiTest);
> 
> hWndChild = ::GetWindow(hWndChild, GW_HWNDNEXT);
> }
> 
> Good luck!
> Brandon


Gmane