Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CB Drop Down w/ Reg Help?
#1
Ok the code below is straight from my dialog.. i am using rget and rset to store the "File(s) List" information when you close the dialog.. What im not sure of how to do is have the preset "&Select Files List" with that code.. i know it can be done but im going crazy trying to figure it out.. The dialog is organized the best i could for easy scanning through it.

Function MAIN_DIALOG
Trigger F12     Help - how to add the trigger to the macro
Code:
Copy      Help
;\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

;BEGIN DIALOG
;0 "" 0x90CA0A40 0x100 0 0 165 118 "PC-Transfer 1.0.0 - King Mofo"
;3 ComboBox 0x54230243 0x0 6 14 96 213 ""
;4 Static 0x54000000 0x0 8 4 86 18 "File (s) List :"
;5 ComboBox 0x54230243 0x0 6 42 96 213 ""
;6 Static 0x54000000 0x0 8 32 86 16 "Transfer Friend :"
;7 ComboBox 0x54230243 0x0 6 70 96 213 ""
;8 ComboBox 0x54230243 0x0 6 98 96 213 ""
;9 Static 0x54000000 0x0 8 60 86 18 "Macro Runtime :"
;10 Static 0x54000000 0x0 8 88 88 16 "Macro / User :"
;11 Button 0x54032000 0x0 110 14 48 14 "Reset List"
;12 Button 0x54032000 0x0 110 42 48 14 "Refresh"
;13 Button 0x54032000 0x0 110 70 48 14 "Help"
;14 Button 0x54032000 0x0 110 98 48 14 "Start"
;END DIALOG
;DIALOG EDITOR: "" 0x2030005 "" "" ""

str controls = "3 5 7 8"
str cb3 cb5 cb7 cb8
;cb3 = "&Single Account"
cb5 = "&Select Transfer Friend"
cb7 = "&Select Macro Runtime[]Very Fast[]Fast[]Medium[]Slow[]Very Slow"
cb8 = "&Select Macro / User[]Give[]Recieve"
rget cb3 "cb" "\test123\test1234"
if(!ShowDialog("MAIN_DIALOG" &MAIN_DIALOG &controls)) ret
ret
;messages
sel message
,case WM_INITDIALOG
,QmRegisterDropTarget id(3 hDlg) hDlg 16
,,double+ ShortWait LongWait
,,int SpeedID

/--------------------------------------------------------------------------------------------------------------------------------------------------
;; DRAP DROP REGISTER;;

,case WM_QM_DRAGDROP
,QMDRAGDROPINFO& di=+lParam
,str s.getl(di.files 0) ;;get first dropped file
,str s2.getfile(s)
,int hcb=id(3 hDlg)
,SendMessage hcb CB_RESETCONTENT 0 0
,foreach s s2
,,CB_Add hcb s

/--------------------------------------------------------------------------------------------------------------------------------------------------
;;SAVE CB INFO WHEN CLOSED;;

,case WM_DESTROY
,    int j2 h2=id(3 hDlg); str s12 s22
,for j2 0 CB_GetCount(h2)
,,CB_GetItemText h2 j2 s12
,,s22.addline(s12)
,rset s22 "cb" "\test123\test1234"

,case WM_COMMAND goto messages2
ret
;messages2
sel wParam

/--------------------------------------------------------------------------------------------------------------------------------------------------
;;YAHOOS IN COMBO N REFRESH;;

,case CBN_DROPDOWN<<16|5
,,ARRAY(int) a; int i; str sc sn Final
,,Final=""
,,win("" "" "YAHOOMESSENGER" 0 0 0 a)
,,for(i 0 a.len)
,,,sn.getwintext(a[i])
,,,if(sn != "Yahoo! Messenger")
,,,,if(Final != "")
,,,,,Final+"[]"
,,,,,Final+sn
,,,,else
,,,,,Final+sn
,,if(Final = "")
,,,Final = "[No Instant Messages Open]"
,,ARRAY(str) b=Final    
,,b.sort(2)
,,Final=b
,,str Final2; Final2.from("&Select Transfer Friend[]" Final)
,,TO_CBFill(lParam Final2)

,case 12
,CB_SelectString id(5 hDlg) "Select Transfer Friend"

/--------------------------------------------------------------------------------------------------------------------------------------------------
;;START N STOP;;

,case 14
,str A.getwintext(id(14 hDlg))
,if(A = "Start")
,,str B = "Stop"; B.setwintext(id(14 hDlg))
,,SpeedID = CB_SelectedItem(id(7 hDlg))
,,sel SpeedID
,,,case 0 CB_SelectItem(id(7 hDlg) 3); ShortWait = 12.5; LongWait = 25
,,,case 1 ShortWait = 3.125; LongWait = 6.25
,,,case 2 ShortWait = 6.25; LongWait = 12.5
,,,case 3 ShortWait = 12.5; LongWait = 25
,,,case 4 ShortWait = 25; LongWait = 50
,,,case 5 ShortWait = 50; LongWait = 100

,if(A = "Stop")
,,str C = "Start"; C.setwintext(id(14 hDlg))

/--------------------------------------------------------------------------------------------------------------------------------------------------
;;CB SELECTION OF WAIT TIME;;

,case CBN_CLOSEUP<<16|7
,,SpeedID = CB_SelectedItem(id(7 hDlg))
,,sel SpeedID
,,,case 0 CB_SelectItem(id(7 hDlg) 3); ShortWait = 12.5; LongWait = 25
,,,case 1 ShortWait = 3.125; LongWait = 6.25
,,,case 2 ShortWait = 6.25; LongWait = 12.5
,,,case 3 ShortWait = 12.5; LongWait = 25
,,,case 4 ShortWait = 25; LongWait = 50
,,,case 5 ShortWait = 50; LongWait = 100

/--------------------------------------------------------------------------------------------------------------------------------------------------
;;RESET LIST;;

,case 11
,SendMessage id(3 hDlg) CB_RESETCONTENT 0 0


,case IDOK
,case IDCANCEL
ret 1
#2
Function MAIN_DIALOG
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

;BEGIN DIALOG
;0 "" 0x90CA0A40 0x100 0 0 165 118 "PC-Transfer 1.0.0 - King Mofo"
;3 ComboBox 0x54230243 0x0 6 14 96 213 ""
;4 Static 0x54000000 0x0 8 4 86 18 "File (s) List :"
;5 ComboBox 0x54230243 0x0 6 42 96 213 ""
;6 Static 0x54000000 0x0 8 32 86 16 "Transfer Friend :"
;7 ComboBox 0x54230243 0x0 6 70 96 213 ""
;8 ComboBox 0x54230243 0x0 6 98 96 213 ""
;9 Static 0x54000000 0x0 8 60 86 18 "Macro Runtime :"
;10 Static 0x54000000 0x0 8 88 88 16 "Macro / User :"
;11 Button 0x54032000 0x0 110 14 48 14 "Reset List"
;12 Button 0x54032000 0x0 110 42 48 14 "Refresh"
;13 Button 0x54032000 0x0 110 70 48 14 "Help"
;14 Button 0x54032000 0x0 110 98 48 14 "Start"
;END DIALOG
;DIALOG EDITOR: "" 0x2030005 "" "" ""

str controls = "3 5 7 8"
str cb3 cb31 cb5 cb7 cb8 var1
var1 = "&Select Files List[]"
;cb3 = "&Single Account"
cb5 = "&Select Transfer Friend"
cb7 = "&Select Macro Runtime[]Very Fast[]Fast[]Medium[]Slow[]Very Slow"
cb8 = "&Select Macro / User[]Give[]Recieve"
rget cb31 "cb" "\test123\test1234"
cb3.from(var1 cb31)
if(!ShowDialog("MAIN_DIALOG" &MAIN_DIALOG &controls)) ret
ret
;messages
sel message
,case WM_INITDIALOG
,QmRegisterDropTarget id(3 hDlg) hDlg 16
,,double+ ShortWait LongWait
,,int SpeedID

/--------------------------------------------------------------------------------------------------------------------------------------------------
;;;DRAP DROP REGISTER;;

,case WM_QM_DRAGDROP
,QMDRAGDROPINFO& di=+lParam
,str s.getl(di.files 0) ;;get first dropped file
,str s2.getfile(s)
,int hcb=id(3 hDlg)
,SendMessage hcb CB_RESETCONTENT 0 0
,foreach s s2
,,CB_Add hcb s

/--------------------------------------------------------------------------------------------------------------------------------------------------
;;SAVE CB INFO WHEN CLOSED;;

,case WM_DESTROY
,int j2 h2=id(3 hDlg); str s12 s22
,for j2 0 CB_GetCount(h2)
,,CB_GetItemText h2 j2 s12
,,s22.addline(s12)
,rset s22 "cb" "\test123\test1234"

,case WM_COMMAND goto messages2
ret
;messages2
sel wParam

/--------------------------------------------------------------------------------------------------------------------------------------------------
;;YAHOOS IN COMBO N REFRESH;;

,case CBN_DROPDOWN<<16|5
,,ARRAY(int) a; int i; str sc sn Final
,,Final=""
,,win("" "" "YAHOOMESSENGER" 0 0 0 a)
,,for(i 0 a.len)
,,,sn.getwintext(a[i])
,,,if(sn != "Yahoo! Messenger")
,,,,if(Final != "")
,,,,,Final+"[]"
,,,,,Final+sn
,,,,else
,,,,,Final+sn
,,if(Final = "")
,,,Final = "[No Instant Messages Open]"
,,ARRAY(str) b=Final
,,b.sort(2)
,,Final=b
,,str Final2; Final2.from("&Select Transfer Friend[]" Final)
,,TO_CBFill(lParam Final2)

,case 12
,CB_SelectString id(5 hDlg) "Select Transfer Friend"

/--------------------------------------------------------------------------------------------------------------------------------------------------
;;START N STOP;;

,case 14
,str A.getwintext(id(14 hDlg))
,if(A = "Start")
,,str B = "Stop"; B.setwintext(id(14 hDlg))
,,SpeedID = CB_SelectedItem(id(7 hDlg))
,,sel SpeedID
,,,case 0 CB_SelectItem(id(7 hDlg) 3); ShortWait = 12.5; LongWait = 25
,,,case 1 ShortWait = 3.125; LongWait = 6.25
,,,case 2 ShortWait = 6.25; LongWait = 12.5
,,,case 3 ShortWait = 12.5; LongWait = 25
,,,case 4 ShortWait = 25; LongWait = 50
,,,case 5 ShortWait = 50; LongWait = 100

,if(A = "Stop")
,,str C = "Start"; C.setwintext(id(14 hDlg))

/--------------------------------------------------------------------------------------------------------------------------------------------------
;;CB SELECTION OF WAIT TIME;;

,case CBN_CLOSEUP<<16|7
,,SpeedID = CB_SelectedItem(id(7 hDlg))
,,sel SpeedID
,,,case 0 CB_SelectItem(id(7 hDlg) 3); ShortWait = 12.5; LongWait = 25
,,,case 1 ShortWait = 3.125; LongWait = 6.25
,,,case 2 ShortWait = 6.25; LongWait = 12.5
,,,case 3 ShortWait = 12.5; LongWait = 25
,,,case 4 ShortWait = 25; LongWait = 50
,,,case 5 ShortWait = 50; LongWait = 100

/--------------------------------------------------------------------------------------------------------------------------------------------------
;;RESET LIST;;

,case 11
,SendMessage id(3 hDlg) CB_RESETCONTENT 0 0


,case IDOK
,case IDCANCEL
ret 1
#3
ty bro


Forum Jump:


Users browsing this thread: 1 Guest(s)