Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DIALOG AND SPEEDS
#8
ok im trying this on peeds and im not to sure what im doing wrong heree but it wont save the speed settings for me



Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

str controls = "3"
str cb3
rget cb3 "ComboBox" "\test"
cb3="Fast[]Normal[]Slow[]Super Slow"
if(!ShowDialog("c1" &c1 &controls)) ret
rset cb3 "ComboBox" "\test"

BEGIN DIALOG
0 "" 0x90C80A44 0x100 0 0 220 132 "Settings"
1 Button 0x54030001 0x4 120 116 48 14 "OK"
2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
3 ComboBox 0x54230243 0x0 34 6 96 213 ""
END DIALOG
DIALOG EDITOR: "" 0x2010900 "" ""

ret
messages
double+ f_speed
sel message
    case WM_INITDIALOG
    DT_Init(hDlg lParam)     
    if(!f_speed) f_speed=0.1
     select item that match current speed
    _i=f_speed*1000
    sel _i
        case 10 _i=0
        case 100 _i=1
        case 1000 _i=2
        case 20000 _i=3
        case else ret 1
    CB_SelectItem(id(3 hDlg) _i)
    
    ret 1
    case WM_DESTROY DT_DeleteData(hDlg)
    case WM_COMMAND goto messages2
ret
messages2
sel wParam
    case CBN_SELENDOK<<16|3
     set speed
    _i=CB_SelectedItem(lParam)
    sel _i
        case 0 f_speed=0.01
        case 1 f_speed=0.1
        case 2 f_speed=1
        case 3 f_speed=20


    case IDOK
    DT_Ok hDlg
    case IDCANCEL DT_Cancel hDlg
ret 1


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)