Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Основная";
Текущий архив: 2004.09.05;
Скачать: [xml.tar.bz2];

Вниз

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;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.45 MB
Время: 0.031 c
1-1092743572
Viktor1
2004-08-17 15:52
2004.09.05
Как привести к одному типу ScrollBar ?


1-1093116430
kraw
2004-08-21 23:27
2004.09.05
TForm и как с ней бороться


14-1092392678
Vovchik_A
2004-08-13 14:24
2004.09.05
Я рискую показаться навязчивым, но все таки...


1-1092856567
Gear
2004-08-18 23:16
2004.09.05
ReadSections и ListBox


4-1090395242
johny
2004-07-21 11:34
2004.09.05
Как узнать уникальные серийные номера материнской платы





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский