Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dialog help
#1
I am trying to made a dialog with a drop down box that you can select diff notepads.
Like
funds for year 2009 home
funds for year 2009 office.

I have this part of the dialog

\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
str controls = "3"
str cb3
if(!ShowDialog("Dialog5" &Dialog5 &controls)) ret
BEGIN DIALOG
0 "" 0x90C80A44 0x100 0 0 223 135 "Dialog"
1 Button 0x54030001 0x4 120 116 48 14 "OK"
2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
3 ComboBox 0x54230243 0x0 0 121 96 213 ""
END DIALOG
DIALOG EDITOR: "" 0x2020105 "" "" ""

ret
messages
sel message
case WM_INITDIALOG
case WM_DESTROY
case WM_COMMAND goto messages2
ret
messages2
sel wParam
case CBN_SELENDOK<<16|3
_i=CB_SelectedItem(lParam)

case IDOK
case IDCANCEL
ret 1

How do I get funds for year 2009 home funds for year 2009 office to show up in the combo box of the dialog.
#2
Anywhere with line1 line2 etc. can be replaced with your strings.


Function Dialog9
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
str controls = "3"
str cb3 = "line1[]line2[]line3[]"                  
if(!ShowDialog("Dialog9" &Dialog9 &controls)) ret
;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 223 135 "Dialog"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;3 ComboBox 0x54230243 0x0 0 121 96 213 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2020105 "" "" ""

ret
;messages
sel message
,case WM_INITDIALOG
,CB_Add(id(3 hDlg) "line4")
,str s = "line5"
,SendMessage id(3 hDlg) CB_ADDSTRING 0 s
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case CBN_SELENDOK<<16|3
,_i=CB_SelectedItem(lParam)
,out _i
,str whichone
,CB_GetItemText(lParam _i &whichone)
,out whichone
,
,case IDOK
,case IDCANCEL
ret 1
#3
That just confused me more.
What i am trying to do is make a dialog with a drop down box with a list and when i click on something in the list it opens like

funds for year 2009 home
funds for year 2009 office
reports for sales of 2009
reports for sale of 2008

I tried to use a list box Like this

sel(list("Rental House Income Jan 09[]Rental House Income Feb 09[]Rental House Income Mar 09[]Gas Charges Jan 09[]Gas Charges Feb 09[]Gas Charges Mar 09[]funds for year 2009 home[]funds for year 2009 office[]reports for sales of 2009[]reports for sale of 2008" "My Books" "Books"))
case 1
case 2
case 3
case 4
case 5
case 6
case 7
case 8
case 9
case 10
case else ret

But it does not have a scroll box.
I want it to look like this

\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
str controls = "3"
str cb3
if(!ShowDialog("Dialog5" &Dialog5 &controls)) ret
BEGIN DIALOG
0 "" 0x90C80A44 0x100 0 0 223 50 "Dialog"
1 Button 0x54030001 0x4 120 116 48 14 "OK"
2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
3 ComboBox 0x54230243 0x0 2 24 96 213 ""
END DIALOG
DIALOG EDITOR: "" 0x2020105 "" "" ""

ret
messages
sel message
case WM_INITDIALOG
case WM_DESTROY
case WM_COMMAND goto messages2
ret
messages2
sel wParam
case CBN_SELENDOK<<16|3
_i=CB_SelectedItem(lParam)

case IDOK
case IDCANCEL
ret 1


But with all of the stuff i need in the scroll box.
#4
The code below works in a list box. But it does not have a scroll bar to move down past the last one u can see.


sel(list("Rental House Income Jan 09[]Rental House Income Feb 09[]Rental House Income Mar 09[]Gas Charges Jan 09[]Gas Charges Feb 09[]Gas Charges Mar 09[]funds for year 2009 home[]funds for year 2009 office[]reports for sales of 2009[]reports for sale of 2008" "My Books" "Books"))
case 1 run "$desktop$\New Folder\New Text Document.txt"
case 2 run "$desktop$\New Folder\New Text Document (4).txt"
case 3 run "$desktop$\New Folder\t.txt"
case 4 run "$desktop$\New Folder\t1.txt"

case 5 run "$desktop$\New Folder\t54.txt"
case 6 run "$desktop$\New Folder\t7.txt"
case 7 run "$desktop$\New Folder\45t.txt"
case 8 run "$desktop$\New Folder\t55.txt"
case 9 run "$desktop$\New Folder\555t.txt"
case 10 run "$desktop$\New Folder\5555t.txt"
case else ret

What i am trying to do is get the info about to show up in the drop down scroll box in this type of dialog



\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
str controls = "3"
str cb3
if(!ShowDialog("Dialog5" &Dialog5 &controls)) ret
BEGIN DIALOG
0 "" 0x90C80A44 0x100 0 0 223 50 "Dialog"
1 Button 0x54030001 0x4 120 116 48 14 "OK"
2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
3 ComboBox 0x54230243 0x0 2 24 96 213 ""
END DIALOG
DIALOG EDITOR: "" 0x2020105 "" "" ""

ret
messages
sel message
case WM_INITDIALOG
case WM_DESTROY
case WM_COMMAND goto messages2
ret
messages2
sel wParam
case CBN_SELENDOK<<16|3
_i=CB_SelectedItem(lParam)

case IDOK
case IDCANCEL
ret 1
#5
Like this?

Function Dialog10
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
str controls = "3 4"
str cb3 = "Rental House Income Jan 09[]Rental House Income Feb 09[]Rental House Income Mar 09[]Gas Charges Jan 09[]Gas Charges Feb 09[]Gas Charges Mar 09[]funds for year 2009 home[]funds for year 2009 office[]reports for sales of 2009[]reports for sale of 2008"
str lb4 = "Rental House Income Jan 09[]Rental House Income Feb 09[]Rental House Income Mar 09[]Gas Charges Jan 09[]Gas Charges Feb 09[]Gas Charges Mar 09[]funds for year 2009 home[]funds for year 2009 office[]reports for sales of 2009[]reports for sale of 2008"
if(!ShowDialog("Dialog10" &Dialog10 &controls)) ret   ;;*****Change where it says "Dialog10" to whatever this dialog is named
;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 253 151 "Dialog"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;3 ComboBox 0x54230243 0x0 12 80 96 213 ""
;4 ListBox 0x54230101 0x200 12 18 124 46 ""
;5 Button 0x54032000 0x0 140 22 48 14 "GetSelected"
;END DIALOG
;DIALOG EDITOR: "" 0x203000B "" "" ""

ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case CBN_SELENDOK<<16|3
,_i=CB_SelectedItem(lParam)
,out _i
,str whichone
,CB_GetItemText(lParam _i &whichone)
,mes whichone
,
,sel _i
,,case 0 run "$desktop$\New Folder\New Text Document.txt"
,,case 1 run "$desktop$\New Folder\New Text Document (4).txt"
,,case 2 run "$desktop$\New Folder\t.txt"
,,case 3 run "$desktop$\New Folder\t1.txt"
,,case 4 run "$desktop$\New Folder\t54.txt"
,,case 5 run "$desktop$\New Folder\t7.txt"
,,case 6 run "$desktop$\New Folder\45t.txt"
,,case 7 run "$desktop$\New Folder\t55.txt"
,,case 8 run "$desktop$\New Folder\555t.txt"
,,case 9 run "$desktop$\New Folder\5555t.txt"
,,case else ret
,
,case 5     ;;5 = id of check button
,,str itemtext
,,int itemnumber = LB_SelectedItem(id(4) &itemtext)     ;;4 = id of list box
,,mes itemtext
,,
,,sel itemnumber
,,,case 0 run "$desktop$\New Folder\New Text Document.txt"
,,,case 1 run "$desktop$\New Folder\New Text Document (4).txt"
,,,case 2 run "$desktop$\New Folder\t.txt"
,,,case 3 run "$desktop$\New Folder\t1.txt"
,,,case 4 run "$desktop$\New Folder\t54.txt"
,,,case 5 run "$desktop$\New Folder\t7.txt"
,,,case 6 run "$desktop$\New Folder\45t.txt"
,,,case 7 run "$desktop$\New Folder\t55.txt"
,,,case 8 run "$desktop$\New Folder\555t.txt"
,,,case 9 run "$desktop$\New Folder\5555t.txt"
,,,case else ret
,,
,case IDOK
,case IDCANCEL
ret 1
#6
or like this.


Function Dialog3
Trigger 8     Help - how to add the trigger to the macro
Code:
Copy      Help
;\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
str controls = "3"
str cb3 = "Rental House Income Jan 09[]Rental House Income Feb 09[]Rental House Income Mar 09[]Gas Charges Jan 09[]Gas Charges Feb 09[]Gas Charges Mar 09[]funds for year 2009 home[]funds for year 2009 office[]reports for sales of 2009[]reports for sale of 2008"
if(!ShowDialog("Dialog3" &Dialog3 &controls)) ret

;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 153 73 "Dialog"
;1 Button 0x54030001 0x4 16 46 48 14 "OK"
;2 Button 0x54030000 0x4 94 46 48 14 "Cancel"
;3 ComboBox 0x54230243 0x0 0 14 152 213 ""
;END DIALOG
;DIALOG EDITOR: "" 0x203000C "" "" ""

ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case CBN_SELENDOK<<16|3
,str Dfile Dfolder
,Dfolder = "$desktop$\New Folder\" ;;Destination folder to search
,_i=CB_SelectedItem(lParam Dfile) ;;Gets selected items text
,if(dir(Dfolder.from(Dfolder Dfile ".txt"))) ;;Checks to see if file exsists
,,run Dfolder ;;opens if found
,else out "Not Found"
,case IDOK
,case IDCANCEL
ret 1
#7
yes ty both very much. im still kind of new to qm. That is just what i was trying to do.Ty both very much


Forum Jump:


Users browsing this thread: 1 Guest(s)