Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2004.04.25;
Скачать: CL | DM;

Вниз

Мастера! Можно ли стандартные хинты сделать вечными?   Найти похожие ветки 

 
Layner ©   (2004-04-05 14:49) [0]

Т.е. пока мышь не убрал с объекта?


 
Романов Р.В. ©   (2004-04-05 14:56) [1]

F1 - TApplication.HintHidePause


 
Layner ©   (2004-04-05 15:10) [2]

Пишу в DPR,

begin
 Application.Initialize;
 Application.CreateForm(Tmf, mf);
 Application.Run;
 Application.HintHidePause:=15000; //или так Application.HintPause:=15000;
end.

И без изменений...


 
Locker   (2004-04-05 15:16) [3]

Application.HintHidePause:=15000;
Application.Run;


 
pasha_golub ©   (2004-04-05 15:19) [4]

THintInfo.ReshowTimeout

Правда прийдется ловить CM_HINTSHOW в компоненте


 
Layner ©   (2004-04-05 15:45) [5]

Спасибо за советы, нашел код, так получилось:


unit Unit1;

interface

uses
 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
 Dialogs, StdCtrls;

type
 TForm1 = class(TForm)
   ListBox1: TListBox;
   ListBox2: TListBox;
   Button1: TButton;
   procedure FormShow(Sender: TObject);
   procedure FormHide(Sender: TObject);
 private
   { Private declarations }
 public
procedure ShowHint (var HintStr: string;
    var CanShow: Boolean; var HintInfo: THintInfo);

   { Public declarations }
 end;

var
 Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.ShowHint (var HintStr: string;
var CanShow: Boolean; var HintInfo: THintInfo);
var
ListRect,a: TRect;
begin
with HintInfo do
begin
  if (HintControl = ListBox1)or(HintControl = ListBox2) then
  with HintControl as TListBox do
  begin
    if (ItemAtPos(CursorPos,true)<>-1)and
 (Canvas.TextWidth(items.Strings[ItemAtPos(CursorPos,true)]) >
 ItemRect(ItemAtPos(CursorPos,true)).Right-2)then
    begin
      HintStr := items.Strings[ItemAtPos(CursorPos,true)];
      ListRect := ClientRect;
      ListRect.Top := ListRect.Top + (ItemAtPos(CursorPos,true)-TopIndex)*ItemHeight;
      ListRect.Bottom := ListRect.Top + ItemHeight;
      CursorRect := ListRect;
      GetWindowRect(Handle,a);
      HintInfo.HintPos:=Point(ListRect.Left+a.Left+1,ListRect.Top+a.Top-1);
    end;
  end;
end;
end;

procedure TForm1.FormShow(Sender: TObject);
begin
Application.OnShowHint := ShowHint;
Application.HintHidePause:=5000;  
Application.HintPause:=300;       end;

procedure TForm1.FormHide(Sender: TObject);
begin
Application.HintHidePause:=2500;
Application.HintPause:=500;
end;

end.


 
pasha_golub ©   (2004-04-05 16:40) [6]


procedure TForm1.ShowHint (var HintStr: string;
var CanShow: Boolean; var HintInfo: THintInfo);
var
ListRect,a: TRect;
begin
with HintInfo do
begin
 if (HintControl = ListBox1)or(HintControl = ListBox2) then
 with HintControl as TListBox do
 begin
   if (ItemAtPos(CursorPos,true)<>-1)and
(Canvas.TextWidth(items.Strings[ItemAtPos(CursorPos,true)]) >
ItemRect(ItemAtPos(CursorPos,true)).Right-2)then
   begin
     HintStr := items.Strings[ItemAtPos(CursorPos,true)];
     ReshowTimeout := MaxInt;//и можно забыть про всякие беды, и не нужно никаких других выкрутасов
     ListRect := ClientRect;
     ListRect.Top := ListRect.Top + (ItemAtPos(CursorPos,true)-TopIndex)*ItemHeight;
     ListRect.Bottom := ListRect.Top + ItemHeight;
     CursorRect := ListRect;
     GetWindowRect(Handle,a);
     HintInfo.HintPos:=Point(ListRect.Left+a.Left+1,ListRect.Top+a.Top-1);
   end;
 end;
end;
end;



Страницы: 1 вся ветка

Текущий архив: 2004.04.25;
Скачать: CL | DM;

Наверх




Память: 0.48 MB
Время: 0.022 c
1-1081543614
Lelik_R
2004-04-10 00:46
2004.04.25
Опять макросы


14-1080649747
Vovchik_A
2004-03-30 16:29
2004.04.25
Я плакалъ


9-1064094783
Cash
2003-09-21 01:53
2004.04.25
DXInput - возможна ли настройка


1-1081603595
Ilg
2004-04-10 17:26
2004.04.25
Максимальное количество строк в Memo


1-1081628476
Ertong
2004-04-11 00:21
2004.04.25
Proxies.dcu