15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Underlining text in a tree control as mouse moves over items

Mark Eastman -- Mark_Eastman@qsp.co.uk
Friday, January 17, 1997

     Environment: MSVC 4.2b Windows 95 Windows NT 3.51
     
     I recently extracted the MFCENUM example from the msdn to look at how 
     the shell is interogated. I noticed that when the mouse moves over an 
     item in the tree control it was being redrawn underlined and if the 
     cursor was stationary for a short period a tooltip was displayed with 
     the full text of the item even if the tree control boundary normally 
     clips the text. (This is similar to the contents window in the VC++ 
     studio when the infoviewer tab is selected).
     
     I can not find ant code within the MFCENUM example which cause this 
     behaviour and I can not recreate the behaviour in my application which 
     also has a tree control.
     
     Can anyone explain how this behaviour can be achieved !
     
 ////
c  oo   Looking forward to a reply !  
|   >   Mark Eastman ( email marke@qsp.co.uk )
\  ~




pjn -- pjn@indigo.ie
Sunday, January 19, 1997

[Mini-digest: 3 responses]

On Fri, 17 Jan 1997 12:02:18 -0000, you wrote:

>     Environment: MSVC 4.2b Windows 95 Windows NT 3.51
>    =20
>     I recently extracted the MFCENUM example from the msdn to look at =
how=20
>     the shell is interogated. I noticed that when the mouse moves over =
an=20
>     item in the tree control it was being redrawn underlined and if the=
=20
>     cursor was stationary for a short period a tooltip was displayed =
with=20
>     the full text of the item even if the tree control boundary =
normally=20
>     clips the text. (This is similar to the contents window in the VC++=
=20
>     studio when the infoviewer tab is selected).
>    =20
>     I can not find ant code within the MFCENUM example which cause this=
=20
>     behaviour and I can not recreate the behaviour in my application =
which=20
>     also has a tree control.
>    =20
>     Can anyone explain how this behaviour can be achieved !
>    =20
> ////
>c  oo   Looking forward to a reply ! =20
>|   >   Mark Eastman ( email marke@qsp.co.uk )
>\  ~
>
>


You have the new version of the common control dll which MS shipped
with a number of apps such as IE3 and Office 97. The dll is currently
non-redistributable. This behaviour you observe is one of the results
of having the new dll installed.


                             '''	  =20
                             @ @
+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
ooO-(_)-Ooo=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+
|                                           PJ Naughter              |
|                                                                    |
| Software Developer                   Email: pjn@indigo.ie          |
| Softech Telecom                      Tel:   +353-1-2958384         |
|                                      Fax:   +353-1-2956290         |
| Author of DTime - A Collection       URL:   http://indigo.ie/~pjn  |
| of Date & Time classes for MFC       Mail:  Cahore,                |
|            And                              Ballygarret,           |
| Notpad, the best Notepad clone              Gorey                  |
| for Windows 95 and NT 4                     Co. Wexford            |
|                                             Ireland                |
|                                                                    |
+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+
-----From: "H. M. Hu" 

Mark,

When you create a tree control, you can specify TVS_TRACKSELECT
style to get underlining text effect. TVS_TRACKSELECT is defined
in VC++ 4.2-flat as:

  #define TVS_TRACKSELECT         0x0200

I don't know why this is not defined in 4.2b, but you can still
use 0x0200 to get underlining text.

Mike

-----From: Mike Marshall 

 I believe this has been brought up before.  The most likely cause is that you have IE 3.0 or
 higher, or possibly a recent release of the ActiveX SDK, on your machine.  I know IE 3.0
 for sure puts new common control DLL's on your machine that have extended functionality.
 What you are probably doing is passing a flag when you set the initial style in the Create
  function, and these flags specify new styles, like underlining the tree item under the mouse.

  For example, I tried creating a tree control with the WS_EX_CLIENTEDGE style.  But the hex
  value for that style bit corresponded to the new TVS_HOTTRACK style,  which may or may not be
  declared in the headers you have on your machine, depending on what patches/sdk's you might 
  have installed.

  A recently article in MSJ explained the new common controls'  functionality, and I guess these controls
  will be widely available with the internet upgrade to Win95.  

--
Mike

----------
From:  Mark Eastman[SMTP:Mark_Eastman@qsp.co.uk]
Sent:  Friday, January 17, 1997 6:02 AM
To:  mfc-l@netcom.com
Subject:  Underlining text in a tree control as mouse moves over items

     Environment: MSVC 4.2b Windows 95 Windows NT 3.51
     
     I recently extracted the MFCENUM example from the msdn to look at how 
     the shell is interogated. I noticed that when the mouse moves over an 
     item in the tree control it was being redrawn underlined and if the 
     cursor was stationary for a short period a tooltip was displayed with 
     the full text of the item even if the tree control boundary normally 
     clips the text. (This is similar to the contents window in the VC++ 
     studio when the infoviewer tab is selected).
     
     I can not find ant code within the MFCENUM example which cause this 
     behaviour and I can not recreate the behaviour in my application which 
     also has a tree control.
     
     Can anyone explain how this behaviour can be achieved !
     
 ////
c  oo   Looking forward to a reply !  
|   >   Mark Eastman ( email marke@qsp.co.uk )
\  ~





Dulepov Dmitry -- dima@ssm6000.samsung.ru
Tuesday, January 21, 1997

        [Mailer: "Groupware E-Mail". Version 1.03.000]

>        [From: Mark Eastman
>     
>     I recently extracted the MFCENUM example from the msdn to look at how 
>     the shell is interogated. I noticed that when the mouse moves over an 
>     item in the tree control it was being redrawn underlined and if the 
>     cursor was stationary for a short period a tooltip was displayed with 
>     the full text of the item even if the tree control boundary normally 
>     clips the text. (This is similar to the contents window in the VC++ 
>     studio when the infoviewer tab is selected).
>     
>     I can not find ant code within the MFCENUM example which cause this 
>     behaviour and I can not recreate the behaviour in my application which 
>     also has a tree control.
>     
>     Can anyone explain how this behaviour can be achieved !
>     

This is not MFC but COMCTL32.DLL feature. Tree views is actually
created, managed and destroyed by COMCTL32. The standart COMCTL32 (that
comes with Windows 95) does not support it but other releases (IE 3.0
for example) does.

Tooltips appears when the label is not totally visible. Does it happens
in your application ?


Dmitry A. Dulepov
Samsung Electronics Co., Ltd.
Russian Research Center
Phone: +7 (095) 213-9207
Fax: +7 (095) 213-9196
E-mail: dima@src.samsung.ru
====================================





| Вернуться в корень Архива |