Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
more then 1 trackbar in a dialog
#1
Im Having Problems with having more then 1 trackbar in 1 dialog, if i make it 18<<16
and do this
--------------------------------------------------------------------------
int i=SendMessage(id(3 hDlg) TBM_GETPOS 0 0)
int e=SendMessage(id(5 hDlg) TBM_GETPOS 0 0)
if i=0;_s="test";_s.setwintext(id(4 hDlg))
if e=0;_s="test1";_s.setwintext(id(6 hDlg))
---------------------------------------------------------------------------
the problem i am having is that it will change the text correctly but it changes the text on both , i only want it to change the text on test not test 1
and when i move trackbar on test 1 only change text on test 1,
really all i need to know is how to make it start at 20 instead of 0-10 start at 20-30
;;
SendMessage id(3 hDlg) TBM_SETRANGE 0 18<<16
SendMessage id(5 hDlg) TBM_SETRANGE 20 10<<16
-----
i cant get it to start the trackbar at 20 instead of 0 << 18 i want it to start at 20 and have only 10 of them please any help
#2
Function dlg_2_trackbars
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

if(!ShowDialog("dlg_2_trackbars" &dlg_2_trackbars)) ret

;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 223 135 "Dialog"
;3 msctls_trackbar32 0x54030000 0x0 6 4 94 18 ""
;4 msctls_trackbar32 0x54030000 0x0 114 4 92 18 ""
;5 Static 0x54000000 0x0 6 30 48 12 ""
;6 Static 0x54000000 0x0 114 30 48 12 ""
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2030300 "" "" ""

ret
;messages
sel message
,case WM_INITDIALOG
,SendMessage id(3 hDlg) TBM_SETRANGE 0 MakeInt(20 30)
,SendMessage id(4 hDlg) TBM_SETRANGE 0 MakeInt(20 30)
,
,case WM_DESTROY
,case WM_COMMAND goto messages2
,
,case WM_HSCROLL ;;lParam is scrollbar handle
,int pos staticId
,sel(GetWinId(lParam)) case 3 staticId=5; case 4 staticId=6; case else ret
,pos=SendMessage(lParam TBM_GETPOS 0 0)
,str s=pos
,s.setwintext(id(staticId hDlg))
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
#3
thanks gint
#4
i got everything going and all just wondering how to add bars to all the numbers i think thats why i used 18<<16 to make the bars on the trackbar instead of just 2 bars one on left and one on right how would i get it to put bars thruout the trackbar as you select the number
#5
Add TBS_AUTOTICKS style. It is 1.
http://msdn.microsoft.com/en-us/library ... 85%29.aspx

If was

3 msctls_trackbar32 0x54030000 0x0 6 4 94 22 ""

, change to

3 msctls_trackbar32 0x54030001 0x0 6 4 94 22 ""
#6
nice thanks for the help..


Forum Jump:


Users browsing this thread: 1 Guest(s)