Subversion Repositories DevTools

Rev

Rev 119 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 119 Rev 161
Line 81... Line 81...
81
		
81
		
82
		compSTR = compSTR &"</select>"
82
		compSTR = compSTR &"</select>"
83
		
83
		
84
		Combo = compSTR
84
		Combo = compSTR
85
	End Function
85
	End Function
-
 
86
 
-
 
87
	'-----------------------------------------------------------------------------------------------------------------
-
 
88
    ' Combo_Multi
-
 
89
    ' Multi column combo
-
 
90
    '   - Uses a fixed length font to allow alignment of columns
-
 
91
    '     Column widths are specified
-
 
92
	'     Columns are separated by a "|" 
-
 
93
    '
-
 
94
    ' sName - Name of Combo
-
 
95
    ' aList - List array with the following columns:
-
 
96
	'      column key, column values (separated by comas), the word "selected" for selected item
-
 
97
	'   e.g  
-
 
98
	'      1, Jack, Smith, "W.A"
-
 
99
	'      2, Jill, Smith, "S.A", "selected"   
-
 
100
	' bOneBlank - to add a blank combo item 
-
 
101
	' sAttributes - HTML attributes
-
 
102
	' iColumnCount - The number of columns to be displayed in the combo.
-
 
103
	' sColumnWidth - csv string containing the combo column widths
-
 
104
	'
-
 
105
	Public Function Combo_Multi ( sName, aList, bOneBlank, sAttributes, iColumnCount, sColumnWidth)
-
 
106
		'=== List Definition ===
-
 
107
		
-
 
108
		Dim compSTR
-
 
109
		Dim rowNum, numOfRows, colNum
-
 
110
		Dim sColVals, sColVal, sPad
-
 
111
		Dim iColLen, iPadLen, iValLen, i
-
 
112
		Dim arrColWidths
-
 
113
		
-
 
114
		compSTR = ""
-
 
115
		
-
 
116
		'/* Generate Combo */		
-
 
117
		compSTR = compSTR &"<select name='"& sName &"' "& sAttributes & "  style='font-family:Courier New,Lucida Console' " &" "& msDisabled &">"
-
 
118
		
-
 
119
		'-- Blank Item --
-
 
120
		If bOneBlank Then compSTR = compSTR &"<option value=''></option>"		
-
 
121
		
-
 
122
		If IsArray(aList) Then			
-
 
123
			numOfRows = UBound( aList, 2 )
-
 
124
			
-
 
125
			For rowNum = 0 To numOfRows
-
 
126
			  ' format columns of row
-
 
127
			  arrColWidths = split(sColumnWidth,",")
-
 
128
  			  sColVals = ""
-
 
129
  			  For colNum = 0 To iColumnCount-1
-
 
130
  			    ' get column width
-
 
131
  			    iColLen = arrColWidths(colNum)
-
 
132
  			    ' format column
-
 
133
  			    sColVal = aList(colNum + 1, rowNum)
-
 
134
  			    if IsNull(sColVal) then sColVal = ""
-
 
135
  			    iValLen = Len(sColVal)
-
 
136
  			    iPadLen = iColLen - iValLen
-
 
137
  			    ' if column value length greater than truncate
-
 
138
  			    if iPadLen < 0 then
-
 
139
  			      iPadLen = 0
-
 
140
  			      sColVal = Mid(sColVal,1,iColLen)  ' truncate column value to column length
-
 
141
  			    end if  
-
 
142
                ' generate pad string with non-breaking spaces
-
 
143
                sPad = ""
-
 
144
  			    For i = 0 to iPadLen-1
-
 
145
			      sPad = sPad & "&nbsp;"
-
 
146
			    Next
-
 
147
		        sColVals = sColVals & " " & sColVal & sPad & " |"
-
 
148
 
-
 
149
			  Next
-
 
150
			  sColVals = Mid(sColVals,1,Len(sColVals)-1)
-
 
151
			  compSTR = compSTR &"<option value='"& aList( 0, rowNum ) &"' "& aList( iColumnCount + 1, rowNum ) &">"& sColVals &"</option>"
-
 
152
			Next
-
 
153
			
-
 
154
		End If
-
 
155
		
-
 
156
		
-
 
157
		compSTR = compSTR &"</select>"
-
 
158
		
-
 
159
		Combo_Multi = compSTR
-
 
160
	End Function
-
 
161
 
86
	'-----------------------------------------------------------------------------------------------------------------
162
	'-----------------------------------------------------------------------------------------------------------------
87
	Private Function Advanced_Combo ( sName, sValue, aList, sAttributes, sMore, bForceDropdown )
163
	Private Function Advanced_Combo ( sName, sValue, aList, sAttributes, sMore, bForceDropdown )
88
		Dim compSTR
164
		Dim compSTR
89
		Dim rowNum, numOfRows, Display
165
		Dim rowNum, numOfRows, Display
90
		
166