From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: *** X-Spam-Status: No, score=3.3 required=5.0 tests=BAYES_00,INVALID_MSGID, MSGID_RANDY,PDS_OTHER_BAD_TLD autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,70a6f494fbb9b525,start X-Google-Attributes: gid103376,public From: jboulais@my-deja.com Subject: Win32 Tool-tip controls in Ada Date: 1999/11/17 Message-ID: <80ug1c$tvr$1@nnrp1.deja.com>#1/1 X-Deja-AN: 549701853 X-Http-Proxy: 1.0 x27.deja.com:80 (Squid/1.1.22) for client 140.76.238.7 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Wed Nov 17 15:02:07 1999 GMT X-MyDeja-Info: XMYDJUIDjboulais Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.08 [en] (WinNT; I ;Nav) Date: 1999-11-17T00:00:00+00:00 List-Id: Does anyone have experience using the Win32 Tool-tip control in Ada? I'm trying to create tool-tips for 2 panes of status windows, one at the top of my main window, and one at the bottom. The status window is a child of the main window, and I created the tool-tip off the status window. TopStatusWnd_Tooltip_Handle := Win32.Winuser.CreateWindowEx ( dwExStyle => 0 , lpClassName => To_Ptr ( Win32.Sikorsky.TOOLTIPS_CLASS ) , lpWindowName => To_Ptr ( "" & Win32.Nul ) , dwStyle => Win32.Sikorsky.TTS_ALWAYSTIP , X => Win32.Winuser.CW_USEDEFAULT , Y => Win32.Winuser.CW_USEDEFAULT , nWidth => Win32.Winuser.CW_USEDEFAULT , nHeight => Win32.Winuser.CW_USEDEFAULT , hWndParent => Handle_To_TopStatusWnd , hMenu => System.Null_Address , hInstance => hInstance , lpParam => System.Null_Address ) ; I setup the "regions" (it's a 4 pane status window) for the tool-tips in a procedure that is called after the above code, which re-sizes my window to one of 3 distict size. After that I call another procedure that fills out both the status windows (which works) and the corresponding tool-tip for a given, menu selectable status window configuration. I also set up a windows procedure for the status window that catches all of the mouse messages and relays them to the tool-tip's handle. Bear in mind I had to implement a lot of the bindings for this, in that they are not in the level 3 win API ( hence the Win32.Sikorsky package), but we do a lot of that, and I'm fairly confident that all is well there. Any suggestions or examples would be greatly appreciated. This code is effective called after the above, in a separate procedure that sizes all of many child windows. It devides up the status window into the 4 rectangles for it's 4 even sized panes. ------------------------------------------------------------------------ Ignore_BOOL := Win32.Winuser.GetClientRect ( hWnd => Handle_To_TopStatusWnd , lpRect => TopStatus_Rectangle'Access ) ; TopSingleStatus_Length := ( TopStatus_Rectangle.right - TopStatus_Rectangle.left ) / Win32.Long ( Number_Status_Wnd_Panes ) ; for Top_Index in 0 .. Number_Status_Wnd_Panes - 1 loop TopStatusWnd_Tooltip_Info.cbSize := Win32.Sikorsky.ToolInfo'size ; TopStatusWnd_Tooltip_Info.uflags := 0 ; TopStatusWnd_Tooltip_Info.hWnd := Handle_To_TopStatusWnd ; TopStatusWnd_Tooltip_Info.hInst := hInstance ; TopStatusWnd_Tooltip_Info.uId := 0 ; TopStatusWnd_Tooltip_Info.lpszText := To_Ptr ( TopStatusWnd_Tooltip_Array ( Win32.INT ( Top_Index ) ) ) ; TopStatusWnd_Tooltip_Info.rect.left := TopStatus_Rectangle.left + Win32.Long ( Top_Index ) * TopSingleStatus_Length ; TopStatusWnd_Tooltip_Info.rect.top := TopStatus_Rectangle.top ; TopStatusWnd_Tooltip_Info.rect.right := TopStatusWnd_Tooltip_Info.rect.left + TopSingleStatus_Length ; TopStatusWnd_Tooltip_Info.rect.bottom := TopStatus_Rectangle.bottom ; end loop ; Ignore_LRESULT := Win32.Winuser.SendMessage ( hWnd => TopStatusWnd_Tooltip_Handle , Msg => Win32.Sikorsky.TTM_ADDTOOL , wParam => 0 , lParam => To_LPARAM ( TopStatusWnd_Tooltip_Info'address ) ) ; ------------------------------------------------------------------------ ----------------- Jeffrey Boulais ----------------- Sent via Deja.com http://www.deja.com/ Before you buy.