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

Вниз

Listbox   Найти похожие ветки 

 
Гость...   (2004-08-21 15:19) [0]

function RevealHint (Control: TControl; X,Y:integer): THintWindow;
var
ShortHint: string;
AShortHint: array[0..255] of Char;
HintPos: TPoint;
HintBox: TRect;
begin
Result := THintWindow.Create(Control);
ShortHint := GetShortHint(Control.Hint);
HintPos.X:=x;
HintPos.Y:=y;
Inc(HintPos.Y, Control.Height + 6);    
HintBox := Bounds(0, 0, Screen.Width, 0);
DrawText(Result.Canvas.Handle,
StrPCopy(AShortHint, ShortHint), -1, HintBox,
DT_CALCRECT or DT_LEFT or DT_WORDBREAK or DT_NOPREFIX);
OffsetRect(HintBox, HintPos.X, HintPos.Y);
Inc(HintBox.Right, 6);
Inc(HintBox.Bottom, 2);
Result.ActivateHint(HintBox, ShortHint);
end;

procedure RemoveHint (var Hint: THintWindow);
begin
Hint.ReleaseHandle;
Hint.Free;
Hint := nil;
end;

procedure Tmain.list_temaMouseMove(Sender: TObject; Shift: TShiftState; X,
 Y: Integer);
var
p:tpoint;
begin
case list_type.ItemIndex of
0:begin
if (p.X=x) and (p.Y=y) then exit;
p.X:=x;
p.Y:=y;

il:=list_tema.ItemAtPos(p,true);
list_tema.ItemIndex:=il;
if h=nil then begin

 if length(list_tema.Items[il])>45 then begin
   Application.ProcessMessages;

     list_tema.hint:=list_tema.items[il];

     revealHint(list_tema,x,y);
     

 end else removehint(h);

end;

end;
end;
end;

где h:thintwindow;

Помогите решить проблему с миганием хинта!


 
QuasiLamo ©   (2004-08-21 15:32) [1]

в код не вчитывался, лень...
двойная буферизация иногда избавляет от мограния оконных компонентов


 
Гость...   (2004-08-21 15:33) [2]

буферизацию, что включать на форме?


 
QuasiLamo ©   (2004-08-21 15:41) [3]

свойство doubleduffered не знаю где, то, что мограет то и должно быть с doblebuffered=true


 
Гость...   (2004-08-21 20:13) [4]

Все! Проблему решил!!! Сам...
Если кому надо

procedure Tmain.list_temaMouseMove(Sender: TObject; Shift: TShiftState; X,
 Y: Integer);
var
p:tpoint;
begin
case list_type.ItemIndex of
0:begin
if (p.X=x) and (p.Y=y) then exit;
p.X:=x;
p.Y:=y;

il:=list_tema.ItemAtPos(p,true);

if il=list_tema.ItemIndex then exit;

list_tema.ItemIndex:=il;

if h<>nil then removehint(h);

 if length(list_tema.Items[il])>45 then begin
   Application.ProcessMessages;

     list_tema.Hint:=list_tema.Items[il];

     h:=revealhint(list_tema,main.Left+list_tema.Left,list_tema.Top+y);

     
 end else
     if h<>nil then removehint(h);

end;
end;
end;



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

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

Наверх




Память: 0.47 MB
Время: 0.048 c
10-1035224514
Прохожий
2002-10-21 22:21
2004.09.05
OMNIORB и C++ Builder


14-1092902502
Rem
2004-08-19 12:01
2004.09.05
Кто что думает по поводу...


14-1092734667
Blackman
2004-08-17 13:24
2004.09.05
Сайт "Курс борьбы с DELPHI" закрывается 20.08.2004


3-1092027517
46_55_41_44
2004-08-09 08:58
2004.09.05
Как сбросить AutoIncrement?


1-1092979736
Alex_s
2004-08-20 09:28
2004.09.05
Chart