Hint delay?
3 отговора
77 прегледа
Hint delay?
Как мога да задам hint delay времето, през което hint-a ще стои показан, след като се появил и не се мести мишката?
Виждам, че в Windows програмите, а и в C++ Builder-a, е 5 секунди, но във програмата ми (писана на C++ Builder 6) е 2-3 секунди.
Искам да го направя по-голямо, но в Google няма никой по въпроса (1-2 hit-а)... Има примери само за MFC.
Става дума за ето този message:
TTM_SETDELAYTIME
Sets the initial, pop-up, and reshow durations for a tooltip control.
TTM_SETDELAYTIME
wParam = (WPARAM)(DWORD) dwDuration;
lParam = (LPARAM)(INT) MAKELONG(iTime,0);
Parameters
dwDuration
Flag that specifies the duration value to set. This parameter can be one of the following values:
TTDT_AUTOPOP Set the length of time a tooltip window remains visible if the pointer is stationary within a tool's bounding rectangle. To return the autopop delay time to its default value, set iTime to -1.
TTDT_INITIAL Set the length of time a pointer must remain stationary within a tool's bounding rectangle before the tooltip window appears. To return the initial delay time to its default value, set iTime to -1.
TTDT_RESHOW Set the length of time it takes for subsequent tooltip windows to appear as the pointer moves from one tool to another. To return the reshow delay time to its default value, set iTime to -1.
TTDT_AUTOMATIC Set all three delay times to default proportions. The autopop time will be ten times the initial time and the reshow time will be one fifth the initial time. If this flag is set, use a positive value of iTime to specify the initial time, in milliseconds. Set iTime to a negative value to return all three delay times to their default values.
iTime
Delay time, in milliseconds.
Return Values
The return value for this message is not used.
Remarks
The default delay times are based on the double-click time. For the default double-click time of 500 ms, the initial, autopop, and reshow delay times are 500ms, 5000ms, and 100ms respectively. The following code fragment uses the GetDoubleClickTime function to determine the three delay times for any system.
initial = GetDoubleClickTime();
autopop = GetDoubleClickTime() * 10;
reshow = GetDoubleClickTime() / 5;
See Also
TTM_GETDELAYTIME
Requirements
Windows NT/2000: Requires Windows NT 3.51 or later
Windows 95/98: Requires Windows 95 or later
Header: Declared in commctrl.h.
Кой прозорец трябва да subclass-на, за да стане номера, и за кое събитие да следя, при което да пратя този message на Hint-a? А и на кой точно window трябва да пратя message-а?
Може и код на Делфи, то е същото като Билдера...
Не искам да правя наследяване на Hint window class-a, защото за такова дребно нещо няма смисъл...
Виждам, че в Windows програмите, а и в C++ Builder-a, е 5 секунди, но във програмата ми (писана на C++ Builder 6) е 2-3 секунди.
Искам да го направя по-голямо, но в Google няма никой по въпроса (1-2 hit-а)... Има примери само за MFC.
Става дума за ето този message:
TTM_SETDELAYTIME
Sets the initial, pop-up, and reshow durations for a tooltip control.
TTM_SETDELAYTIME
wParam = (WPARAM)(DWORD) dwDuration;
lParam = (LPARAM)(INT) MAKELONG(iTime,0);
Parameters
dwDuration
Flag that specifies the duration value to set. This parameter can be one of the following values:
TTDT_AUTOPOP Set the length of time a tooltip window remains visible if the pointer is stationary within a tool's bounding rectangle. To return the autopop delay time to its default value, set iTime to -1.
TTDT_INITIAL Set the length of time a pointer must remain stationary within a tool's bounding rectangle before the tooltip window appears. To return the initial delay time to its default value, set iTime to -1.
TTDT_RESHOW Set the length of time it takes for subsequent tooltip windows to appear as the pointer moves from one tool to another. To return the reshow delay time to its default value, set iTime to -1.
TTDT_AUTOMATIC Set all three delay times to default proportions. The autopop time will be ten times the initial time and the reshow time will be one fifth the initial time. If this flag is set, use a positive value of iTime to specify the initial time, in milliseconds. Set iTime to a negative value to return all three delay times to their default values.
iTime
Delay time, in milliseconds.
Return Values
The return value for this message is not used.
Remarks
The default delay times are based on the double-click time. For the default double-click time of 500 ms, the initial, autopop, and reshow delay times are 500ms, 5000ms, and 100ms respectively. The following code fragment uses the GetDoubleClickTime function to determine the three delay times for any system.
initial = GetDoubleClickTime();
autopop = GetDoubleClickTime() * 10;
reshow = GetDoubleClickTime() / 5;
See Also
TTM_GETDELAYTIME
Requirements
Windows NT/2000: Requires Windows NT 3.51 or later
Windows 95/98: Requires Windows 95 or later
Header: Declared in commctrl.h.
Кой прозорец трябва да subclass-на, за да стане номера, и за кое събитие да следя, при което да пратя този message на Hint-a? А и на кой точно window трябва да пратя message-а?
Може и код на Делфи, то е същото като Билдера...
Не искам да правя наследяване на Hint window class-a, защото за такова дребно нещо няма смисъл...
Виж това...
Specifies the time interval that passes before the control's Help Hint appears when the user places the mouse pointer on a control or menu item.
Delphi syntax:
property HintPause: Integer;
C++ syntax:
__property int HintPause = {read=FHintPause, write=FHintPause, nodefault};
Description
Use HintPause to change the default pause time of 500 ms or 1/2 second that is set in the constructor. When assigning a value to HintPause, specify the interval in milliseconds. The Help Hint displayed at the end of the pause is specified in the Hint property.
---
Колкото повече, толкова повече.
Delphi syntax:
property HintPause: Integer;
C++ syntax:
__property int HintPause = {read=FHintPause, write=FHintPause, nodefault};
Description
Use HintPause to change the default pause time of 500 ms or 1/2 second that is set in the constructor. When assigning a value to HintPause, specify the interval in milliseconds. The Help Hint displayed at the end of the pause is specified in the Hint property.
---
Колкото повече, толкова повече.
А също и това...
Specifies the time interval to wait before hiding the Help Hint if the mouse has not moved from the control or menu item.
Delphi syntax:
property HintHidePause: Integer;
C++ syntax:
__property int HintHidePause = {read=FHintHidePause, write=FHintHidePause, nodefault};
Description
Use HintHidePause to specify a wait time in milliseconds, which is different from the default value of 2500 ms or 2 1/2 seconds that is set in the constructor. The Help Hint for the control or menu item is specified in the Hint property.
Note: The default is a predefined constant value that is several times longer than HintPause.
P.S. Когато нищо не помага - е време да се прочете хелп-а
---
Колкото повече, толкова повече.
Delphi syntax:
property HintHidePause: Integer;
C++ syntax:
__property int HintHidePause = {read=FHintHidePause, write=FHintHidePause, nodefault};
Description
Use HintHidePause to specify a wait time in milliseconds, which is different from the default value of 2500 ms or 2 1/2 seconds that is set in the constructor. The Help Hint for the control or menu item is specified in the Hint property.
Note: The default is a predefined constant value that is several times longer than HintPause.
P.S. Когато нищо не помага - е време да се прочете хелп-а
---
Колкото повече, толкова повече.
Re: А също и това...
Да, това е, мерси много...
Е не се сетих за това, че е свойство на TApplication...
Е не се сетих за това, че е свойство на TApplication...