На главную

On-line справка по Win32 API

Написать письмо
БЕСПЛАТНАЯ ежедневная online лотерея! Выигрывай каждый день БЕСПЛАТНО!
Список всех статей A-B-C-D-E-F-G-H-I-J-K-L-M-N-O-P-Q-R-S-T-U-V-W-X-Y-Z | Скачать Вниз

Relaying Mouse Messages to the Tooltip



A tooltip control needs to receive mouse messages to determine when to display the tooltip window. Because Windows sends mouse messages only to the window that contains the cursor, you must use the TTM_RELAYEVENT message to relay mouse messages to the tooltip control.

If a tool is implemented as a rectangular area in an application-defined window, the window procedure receives mouse messages and can relay them to the tooltip control. However, if a tool is implemented as a system-defined window, the mouse messages are sent to the window and are not readily available to the application. You must use a message hook to access and relay the mouse messages, or you must subclass the window.
When a tooltip control receives a relayed WM_MOUSEMOVE message, it determines whether the cursor is in the bounding rectangle of a tool. If the cursor is there, the tooltip control sets a timer. At the end of the time-out duration, the tooltip control checks the position of the cursor to see whether it has moved. If the cursor has not, the tooltip control retrieves the text for the tool, copies the text into the tooltip window, and shows the window. The tooltip control continues to show the window until it receives a relayed button-up or button-down message or until a relayed WM_MOUSEMOVE message indicates that the cursor has moved outside the bounding rectangle of the tool.

A tooltip control actually has three time-out durations associated with it. The initial duration is the length of time that the cursor must remain stationary within the bounding rectangle of a tool before the tooltip window is displayed. The reshow duration is the length of the delay before subsequent tooltip windows are displayed when the cursor moves from one tool to another. The autopopup duration is the length of time that the tooltip window remains displayed before it is hidden. That is, if the cursor remains stationary within the bounding rectangle after the tooltip window is displayed, the tooltip window is automatically hidden at the end of the autopopup duration. You can adjust all of the time-out durations by using the TTM_SETDELAYTIME message.

If an application includes a tool implemented as a rectangular area and the size or position of the control changes, it can use the TTM_NEWTOOLRECT message to report the change to the tooltip control. An application does not need to report size and position changes for a tool implemented as a window. Reporting that is not necessary because the tooltip control uses the window handle of a tool to determine if the cursor is on the tool, not the tool's bounding rectangle.

When it is about to be displayed, a tootip control sends the TTN_SHOW notification to the owner window. A tooltip control sends the TTN_POP notification when it is about to be hidden. Each notification is sent in the context of a WM_NOTIFY message.


Пригласи друзей и счет твоего мобильника всегда будет положительным!
Предыдущая статья
 
Сайт Народ.Ру Интернет
Следующая статья
Пригласи друзей и счет твоего мобильника всегда будет положительным!

Реле Сообщений Мыши на Tooltip



Управлению tooltip нужно получать сообщения мыши, чтобы определяться когда, чтобы отображать окно tooltip. Поскольку Окно посылает сообщения мыши только в окно, которое содержит курсор, Вы должны использовать сообщение TTM_RELAYEVENT, чтобы передавать сообщения мыши на управление tooltip.

Если средство осуществлено как прямоугольная область в определенном прикладном окне, процедура окна получает сообщения мыши и может передать им на управление tooltip. Тем не менее, если средство осуществлено как определенное системное окно, сообщения мыши посланы в окно и не легко пригодные для приложения. Вы должны использовать захват сообщения, чтобы иметь доступ к и передавать сообщения мыши, или Вы должны подкласс окно.
Когда управление tooltip получает релейное сообщение WM_MOUSEMOVE, оно определяет независимо курсор - в прямоугольнике bounding средства. Если курсор - там, управляющие комплекты tooltip таймер. В конце длительности задержки, управление tooltip проверяет позицию курсора, чтобы видеть переместилось оно. Если курсор имеет нет, управление tooltip извлекает текст для средства, копирует текст в окно tooltip, и показывает окно. Управление tooltip остается показывать окно пока оно не получит релейную кнопку-по или кнопке-вниз сообщении или пока релейное сообщение WM_MOUSEMOVE не укажет, что курсор переместился за пределами прямоугольника bounding средства.

Управление tooltip действительно имеет три задерживают длительность связывал с ним. Начальная длительность является периодом времени, что курсор должен остаться неподвижным в пределах прямоугольника bounding средства прежде, чем окно tooltip будет отображено. Длительность reshow является длиной задержки прежде, чем последующее tooltip окно будет отображено когда курсор перемещает из одного средства на другое. Длительность autopopup является периодом времени, что остатки окна tooltip отображали прежде, чем он будет спрятан. То есть, если курсор остается неподвижным в пределах прямоугольника bounding после того, как окно tooltip будет отображено, окно tooltip автоматически спрятано в конце длительности autopopup. Вы можете отрегулировать всю длительность задержки используя сообщение TTM_SETDELAYTIME.

Если приложение включает средство осуществленное как прямоугольная область и размер или позиция управляющих изменений, оно может использовать сообщение TTM_NEWTOOLRECT, чтобы сообщать изменение на управление tooltip. Приложение не нужно сообщать размер и позиция заменяет средство осуществленное как окно. Сообщая, что не необходимо поскольку управление tooltip использует ручку окна средства, чтобы определяться если курсор находится в средстве, не оснащать bounding прямоугольник.

Когда это собирается быть отображено, управление tootip посылает уведомление TTN_SHOW в окно владельца. Управление tooltip посылает уведомление TTN_POP когда оно собирается быть исчезнуто. Каждое уведомление послано в контекст сообщения WM_NOTIFY.


Вверх Version 1.3, Oct 26 2010 © 2007, 2010, mrhx Вверх
 mrhx software  Русский перевод OpenGL  Русский перевод Win32 API
 
Используются технологии uCoz