Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to show all the list items in a display dialog box
#1
When I use a dialog box like the following, lines 8 to 11 are hidden.
How can I have all eleven lines visible in the dialog box?
I know how to vary the position of the dialog box but not the size.

thanks

str s = "Line1[]Line2[]Line3[]Line4[]Line5[]Line6[]Line7[]Line8[]Line9[]Line10[]Line11"
sel list(s "Lines")
case 1 out "Line1"
case 2 out "Line2"
case 3 out "Line3"
case 4 out "Line4"
case 5 out "Line5"
case 6 out "Line6"
case 7 out "Line7"
case 8 out "Line8"
case 9 out "Line9"
case 10 out "Line10"
case 11 out "Line11"
case else out "Cancel"
#2
Function SetListHeight
Code:
Copy      Help
function height

;Sets list dialog box height.
;Run using mac before list.

;EXAMPLE
;str s = "Line1[]Line2[]Line3[]Line4[]Line5[]Line6[]Line7[]Line8[]Line9[]Line10[]Line11"
;mac "SetListHeight" "" 250
;sel list(s "Lines")
,;case 1 out "Line1"
,;case 2 out "Line2"
,;case 3 out "Line3"
,;case 4 out "Line4"
,;case 5 out "Line5"
,;case 6 out "Line6"
,;case 7 out "Line7"
,;case 8 out "Line8"
,;case 9 out "Line9"
,;case 10 out "Line10"
,;case 11 out "Line11"
,;case else out "Cancel"

rep 10
,int h=wait(3 WC win("" "#32770" "qm")); err ret
,int hc=child(4 "" "ListBox" h)
,if(hc) break
,0.05
if(!hc) ret

RECT r rc
GetWindowRect(h &r)
int diff=height-(r.bottom-r.top)
siz 10 r.bottom-r.top+diff h 1

GetWindowRect(hc &r)
siz 0 r.bottom-r.top+diff hc 1

hc=id(2 h)
GetWindowRect(hc &r)
GetClientRect(h &rc)
mov 0 rc.bottom-(r.bottom-r.top) hc

For older QM versions, change control id 4 to 1023:

Code:
Copy      Help
function height

;Sets list dialog box height.
;Run using mac before list.


;EXAMPLE
;str s = "Line1[]Line2[]Line3[]Line4[]Line5[]Line6[]Line7[]Line8[]Line9[]Line10[]Line11"
;mac "SetListHeight" "" 250
;sel list(s "Lines")

,;case 1 out "Line1"
,;case 2 out "Line2"
,;case 3 out "Line3"
,;case 4 out "Line4"
,;case 5 out "Line5"
,;case 6 out "Line6"
,;case 7 out "Line7"
,;case 8 out "Line8"
,;case 9 out "Line9"
,;case 10 out "Line10"
,;case 11 out "Line11"
,;case else out "Cancel"

;g1
int h=wait(1 WC win("" "#32770" "qm")); err ret
if(!id(1023 h)) 0.1; goto g1

RECT r rc
int hh=h
GetWindowRect(h &r)
int diff=height-(r.bottom-r.top)
siz 0 r.bottom-r.top+diff h 1

h=id(1023 hh)
GetWindowRect(h &r)
siz 0 r.bottom-r.top+diff h 1

h=id(2 hh)
GetWindowRect(h &r)
GetClientRect(hh &rc)
mov 0 rc.bottom-(r.bottom-r.top) h
#3
Hi Gintaras

Thanks for the code. Works perfectly. Where do I place "mac "SetListHeight" "" 250" within the following syntax?

sel list("Kjør_Skanix_Network_Manager[]-------------------------------------[]Send_en_melding[]-------------------------------------[]Åpen_VNC_Viewers_Bare_Overvåke[]Åpen_VNC_Viewers[]Lukk_VNC_Viewers[]Andre vedlikeholds oppgaver" " H v a v i l d u ? ?" " " 0 550)
case 0 end
case 1 goto Kjør_Skanix_Network_Manager
case 2 goto Velg_oppgave
case 3 Oppgave = "Send_en_melding"
case 4 goto Velg_oppgave
case 5 Oppgave = "Åpen_VNC_Viewers_Bare_Overvåke"
case 6 Oppgave = "Åpen_VNC_Viewers"
case 7 goto Lukk_VNC_Viewers
case 8 Oppgave = "Andre_Vedlikeholds_Oppgaver"
#4
before sel list(...)
#5
Brilliant, thanks.

One more question.

These multiple choice list windows, when created, are always inactive for some reason. (grey title bar)

How can I make them active.

I tried using "act". But I couldn't find where to use it in the syntax I gave above.
#6
Use flag 1.

sel list("a[]b" "" "" 0 0 0 0 1)
#7
Many thanks Big Grin


Forum Jump:


Users browsing this thread: 1 Guest(s)