![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
снова TrackBar [Delphi, Windows]
Robt © (2007-06-26 19:28:00)а как работать с "тиками" ?
менять растояние между ними
типа frequency в vcl
и как вариант фиксированое "прыганье" ползунка
по "тикам"
Vladimir Kladov (2007-06-28 18:44:00) [21]А у меня работатет. Код:
procedure TForm1.TrackBar1Scroll(Sender: PTrackbar; Code: Integer);
begin
Form.Caption := Int2Str(Sender.Position);
end;
robt (2007-06-28 16:24:00) [22]с mhtrackbar такаяже ситуация
robt (2007-06-28 16:20:00) [23]дело в том что програмно ничо не присваеваеца
это тупо форма+тракбар+
procedure TForm1.TrackBar1Scroll(Sender: PTrackbar; Code: Integer);
begin
inc(i);
form.Caption:=int2str(i);
end;
и все!
никакой реакции ни на мышь ни на клаву хоть куда тыкай
Vladimir Kladov (2007-06-28 15:28:00) [24]Если только вы программно присваиваете Position, то да, не сработает. Так сами и обработайте, что присвоили.
robt (2007-06-28 10:53:00) [25]фишка вся в том что OnScroll кокраз и не срабатывает вабще :(
хоть чо с ним делай например :
procedure TForm1.TrackBar1Scroll(Sender: PTrackbar; Code: Integer);
begin
inc(i);
form.Caption:=int2str(i);
end;
Vladimir Kladov (2007-06-27 22:26:00) [26]Ну так это отрабатывается в OnScroll.
Galkov (2007-06-27 20:30:00) [27]А мой MSDN пишет примерно такое:
Trackbar Notification Messages
A trackbar notifies its parent window of user actions by sending the parent a WM_HSCROLL or WM_VSCROLL message. A trackbar with the TBS_HORZ style sends WM_HSCROLL messages. A trackbar with the TBS_VERT style sends WM_VSCROLL messages. The low-order word of the wParam parameter of WM_HSCROLL or WM_VSCROLL contains the notification code. For the TB_THUMBPOSITION and TB_THUMBTRACK notifications, the high-order word of the wParam parameter specifies the position of the slider. For all other notifications, the high-order word is zero; send the TBM_GETPOS message to determine the slider position. The lParam parameter is the handle to the trackbar.
The system sends the TB_BOTTOM, TB_LINEDOWN, TB_LINEUP, and TB_TOP notification messages only when the user interacts with a trackbar by using the keyboard. The TB_THUMBPOSITION and TB_THUMBTRACK notification messages are only sent when the user is using the mouse. The TB_ENDTRACK, TB_PAGEDOWN, and TB_PAGEUP notification messages are sent in both cases. The following table lists the trackbar notification messages and the events (virtual key codes or mouse events) that cause the notifications to be sent.
Notification message Reason sent
TB_BOTTOM VK_END
TB_ENDTRACK WM_KEYUP(the user released a key that sent a relevant virtual key code)
TB_LINEDOWN VK_RIGHT or VK_DOWN
TB_LINEUP VK_LEFT or VK_UP
TB_PAGEDOWN VK_NEXT (the user clicked the channel below or to the right of the slider)
TB_PAGEUP VK_PRIOR (the user clicked the channel above or to the left of the slider)
TB_THUMBPOSITION WM_LBUTTONUP following a TB_THUMBTRACK notification message
TB_THUMBTRACK Slider movement (the user dragged the slider)
TB_TOP VK_HOME
Vladimir Kladov (2007-06-27 16:37:00) [28]MSDN:
Notifications
NM_CUSTOMDRAW (trackbar)
Sent by a trackbar control to notify its parent windows about drawing operations. This notification is sent in the form of a WM_NOTIFY message.
NM_RELEASEDCAPTURE (trackbar)
Notifies a trackbar control's parent window that the control is releasing mouse capture. This notification is sent in the form of a WM_NOTIFY message.
Других нотификаций для тракбара нет.
robt (2007-06-27 16:06:00) [29]патаму что быть такого не может
чтобы системный контрол не посылал
уведомлений о изменении своего основного параметра
=BuckLr= (2007-06-27 15:50:00) [30]
> не через события же мыши и клавы определять ?
А почему бы и нет?
robt (2007-06-27 14:01:00) [31]а как определить изменение позиции то? :(
OnChange как в VCL нету не через события же мыши и клавы определять ?
Vladimir Kladov (2007-06-26 19:46:00) [32]Как в VCL - не знаю. В исходник KOLTrackbar'а посмотрите. Там есть все, что предоставляет API для тракбара.