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

Вниз

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

 
Delph   (2004-05-28 11:22) [0]

Здравствуйте.
Как грамотно показывать хинты в зависимости от того на какую Panel TStatusPanel-и наведен курсор мыши?
Ну или как хотя-бы узнать координаты курсора мыши?
Заранее спасибо.


 
Семен Сорокин ©   (2004-05-28 11:39) [1]

Ну или как хотя-бы узнать координаты курсора мыши?
Mouse.CursorPos;

вот шмат кода из программы, посмотри може поможет :)

procedure TfmGraphs.stBarMouseMove(Sender: TObject; Shift: TShiftState; X,
 Y: Integer);
var
 _i    : integer;
 _rect1: TRect;
 _rect2: TRect;
begin
_rect1.Left := 0;
for _i := 0 to 1 do
 _rect1.Left := _rect1.Left + fmMain.stBar.Panels[_i].Width;
_rect2.Left := fmMain.stBar.Panels[0].Width;
_rect1.Right := _rect1.Left + fmMain.stBar.Panels[2].Width;
_rect2.Right := _rect2.Left + fmMain.stBar.Panels[1].Width;
_rect1.Top := 0;
_rect1.Bottom := fmMain.stBar.Height;
_rect2.Top := 0;
_rect2.Bottom := fmMain.stBar.Height;
if PtInRect(_rect1, Point(X, Y)) and ((FGraphMode <> gmNone) or FFinder.Worked) then begin
 fmMain.stBar.Hint := EmptyStr;
 if FGraphMode <> gmNone then
  fmMain.stBar.Hint := GRAPH_MODE_HINT[FGraphMode] + iif(FFinder.Worked, CRLF, EmptyStr);
 if FFinder.Worked then begin
  fmMain.stBar.Hint := fmMain.stBar.Hint + "&#211;&#241;&#235;&#238;&#226;&#232;&#255; &#239;&#238;&#232;&#241;&#234;&#224;:" + CRLF;
  for _i := 0 to FFinder.CountConditions-1 do
   fmMain.stBar.Hint := fmMain.stBar.Hint + "(" + FFinder.CondString[_i] + ")" +
                 iif(_i <> FFinder.CountConditions-1, iif(FFinder.All, " &#232; " + CRLF, " &#232;&#235;&#232; " + CRLF), EmptyStr);
 end;
 Application.ActivateHint(Mouse.CursorPos)
end
else if PtInRect(_rect2, Point(X, Y)) and Assigned(Current) then begin
 fmMain.stBar.Hint := Current.Name;
 Application.ActivateHint(Mouse.CursorPos)
end
else begin
 fmMain.stBar.Hint := EmptyStr;
 Application.HideHint
end
end;



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

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

Наверх




Память: 0.47 MB
Время: 0.046 c
6-1082544631
rimd1
2004-04-21 14:50
2004.06.13
процессы и сеть


4-1083775339
RTWolf
2004-05-05 20:42
2004.06.13
Как Baloon-подсказку сделать поверх всех окон?


1-1085863581
S4nya
2004-05-30 00:46
2004.06.13
Алгоритм


3-1084620607
muk07
2004-05-15 15:30
2004.06.13
в CBuilder или DElphi (BDE) подсоединиться к БД Access без alias


6-1082877505
Daniel
2004-04-25 11:18
2004.06.13
Сокеты в Unix