- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I know this issue has been discussed in this forum some years ago, but from reading old threads is not possible to find a solution.
The problem: I am trying to enhance L. Normans example Toolbar by introducing tool tips. However, it will not work. The whole project is enclosed in the attached zip-file.
Can you help?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A stylistic nitpick: it's probably simpler to use hInst+string table ID than LoadString, i.e:
if(lpToolTipText%hdr%code == TTN_GETDISPINFOA)then
ptext = lparam
lpToolTipText%lpszText = lpToolTipText%hdr%idfrom
lpToolTipText%hinst = ghinstance
endif
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear JugoslavDujic
You are overrating my Win-skills, I am still almost there.
Could you please be more specific?
Reidar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hToolbar = CreateWindowEx(TBSTYLE_TOOLTIPS...where you should have:
hToolbar = CreateWindowEx(0, ...,IOR(WS_CHILD, TBSTYLE_TOOLTIPS)...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I understand creating the tool window should be:
hwndTB = CreateWindowEx (WS_EX_TOPMOST,TOOLBARCLASSNAMEA, &
""C, IOR(WS_CHILD, TBSTYLE_TOOLTIPS),50,100, 0, 0, hwnd,Null,&
ghInstance , NULL)
and this works fine!
The alternative highstyle code you proposeed in the case construct:
if(lpToolTipText%hdr%code == TTN_GETDISPINFOA)then
ptext = lparam
lpToolTipText%lpszText = lpToolTipText%hdr%idfrom
lpToolTipText%hinst = ghinstance
endif
does not work at all, so I stick to the original.
An additional question:
Regarding the function CreateWindowEx , argument 1 specify TOPMOST style,
argument 5-6 which is set to 50 and 100, specify the position of the window.
Whatever I specify, the toolbar appears in the upper left corner
(could not paste the screen dumppicture into here.
Creating a second toolbar will then overlap the first, so how it is possible to
specify the position?
Regards
Reidar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
FUNCTION CreateToolTips (hParent) RESULT (hTT)
IMPLICIT NONE
INTEGER, INTENT(IN) :: hParent
INTEGER :: hTT, rval
! creates a ToolTips control as a child to hParent
hTT = CreateWindowEx (0, TOOLTIPS_CLASS, ""c, &
IOR(TTS_ALWAYSTIP,WS_POPUP), &
CW_USEDEFAULT, CW_USEDEFAULT, &
CW_USEDEFAULT, CW_USEDEFAULT, &
hParent, NULL, ghInstance, NULL)
rval = SetWindowPos (hTT, HWND_TOPMOST, 0,0,0,0, &
IOR(SWP_NOACTIVATE,IOR(SWP_NOMOVE,SWP_NOSIZE)))
rval = SendMessage (hTT, TTM_SETDELAYTIME, TTDT_INITIAL, &
MakeLong(INT2( 5),INT2(0)))
rval = SendMessage (hTT, TTM_SETDELAYTIME, TTDT_AUTOPOP, & MakeLong(INT2(3000),INT2(0)))
rval = SendMessage (hTT, TTM_ACTIVATE, TRUE, 0)
END FUNCTION CreateToolTips
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Alternatively, you can use a rebar control (which provides "bands" to which toolbars can be attached), but it's fairly difficult to use & set up. I recommend stic...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Creating Tool Tips
The problem may be solved in the following steps:
1)Run the program residing in the release folder. Check tool tips at the Open and
Save buttons.
2)Repeat step 1 in Debug mode. Try to locate where to store the tool tip text.
Hint: Tool bar editor, check property prompt for the Open button.
3)What programming steps are required to make the toolbar appear in the middle of the
client window?
Hint: check questions and answers in this thread.
Are you the first one to solve the problems and check the code back?
Wish You a Merry Christmas
Reidar
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page