- Timestamp:
- 03/16/07 10:22:26 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_combobox_pm.pro
r157 r226 7 7 ; case uval of 8 8 ; 'done':widget_control, event.top, /destroy 9 ; 'dynamic_resize':BEGIN 9 ; 'dynamic_resize':BEGIN 10 10 ; widget_control, event.id, get_value = value 11 11 ; widget_control, ComboboxId, set_value = {dynamic_resize:value} 12 12 ; END 13 ; 'combobox_select':BEGIN 13 ; 'combobox_select':BEGIN 14 14 ; widget_control, event.id, get_value = value 15 15 ; widget_control, ComboboxId, set_value = {combobox_select:value} 16 16 ; END 17 ; 'value':BEGIN 17 ; 'value':BEGIN 18 18 ; widget_control, event.id, get_value = value 19 19 ; widget_control, ComboboxId, set_value = value 20 20 ; END 21 ; 'get':BEGIN 21 ; 'get':BEGIN 22 22 ; widget_control, ComboboxId, get_value = value 23 23 ; help, value, /struct … … 52 52 ; @categories 53 53 ; Compound widget 54 ; 54 ; 55 55 ; @param ID 56 56 ; … … 60 60 ; 61 61 ; @returns 62 ; 63 ; 62 ; 64 63 ; @uses 65 ; 66 ; 64 ; 67 65 ; @restrictions 68 ; 69 ; 66 ; 70 67 ; @examples 71 ; 72 ; 68 ; 73 69 ; @history 74 ; 75 ; 76 ; @version 70 ; 71 ; @version 77 72 ; $Id$ 78 73 ;- … … 104 99 ; @categories 105 100 ; Compound widget 106 ; 101 ; 107 102 ; @param ID 108 103 ; 109 ;110 104 ; @returns 111 ; 112 ; 105 ; 113 106 ; @uses 114 ; 115 ; 107 ; 116 108 ; @restrictions 117 ; 118 ; 109 ; 119 110 ; @examples 120 ; 121 ; 111 ; 122 112 ; @history 123 ; 124 ; 125 ; @version 113 ; 114 ; @version 126 115 ; $Id$ 127 116 ;- … … 147 136 ; @categories 148 137 ; Compound widget 149 ; 138 ; 150 139 ; @param EVENT 151 140 ; 152 ;153 141 ; @returns 154 ; 155 ; 142 ; 156 143 ; @uses 157 ; 158 ; 144 ; 159 145 ; @restrictions 160 ; 161 ; 146 ; 162 147 ; @examples 163 ; 164 ; 148 ; 165 149 ; @history 166 ; 167 ; 168 ; @version 150 ; 151 ; @version 169 152 ; $Id$ 170 153 ;- … … 187 170 case uval OF 188 171 'plus':BEGIN 189 if index LT (cmbbnumb - 1) then BEGIN 172 if index LT (cmbbnumb - 1) then BEGIN 190 173 index = index + 1 191 174 widget_control, ComboboxId, set_combobox_select = index … … 193 176 END 194 177 'minus':BEGIN 195 if index GT 0 then BEGIN 178 if index GT 0 then BEGIN 196 179 index = index - 1 197 180 widget_control, ComboboxId, set_combobox_select = index … … 212 195 ; @categories 213 196 ; Compound widget 214 ; 197 ; 215 198 ; @param PARENT {in}{required} 216 199 ; The widget ID of the parent widget. … … 219 202 ; Buttons will be arranged in the number of columns 220 203 ; specified by this keyword. 221 ; 204 ; 222 205 ; @keyword ROW 223 206 ; Buttons will be arranged in the number of rows 224 207 ; specified by this keyword. 225 ; 208 ; 226 209 ; @keyword UVALUE 227 210 ; The user value to be associated with the widget. 228 ; 211 ; 229 212 ; @keyword UNAME 230 213 ; The user name to be associated with the widget. 231 ; 214 ; 232 215 ; @keyword VALUE 233 216 ; … … 258 241 ; index the array of names originally used to set the widget''s 259 242 ; value 260 ; OUT:It is an integer which can take 3 values: 243 ; OUT:It is an integer which can take 3 values: 261 244 ; 1 : If we press + when the index is already at the max 262 245 ; Comment: In this case, the index stay at the max … … 271 254 ; 1) GET_VALUE 272 255 ; widget_control,wid_id,get_value=resultat 273 ; Send back, in the result variable, a structure of 3 elements whose 256 ; Send back, in the result variable, a structure of 3 elements whose 274 257 ; names are inspired by keywords we can pass at widget_control when 275 258 ; we use WIDGET_COMBOBOX: … … 285 268 ; 2) SET_VALUE 286 269 ; widget_control,wid_id,set_value=impose 287 ; Allows to modify the state of the combobox like we can do it for 288 ; WIDGET_COMBOBOX. May impose: 270 ; Allows to modify the state of the combobox like we can do it for 271 ; WIDGET_COMBOBOX. May impose: 289 272 ; a) The contents of the list widget (string or string array) 290 ; b) A structure which can have for elements (from 1 to 3): 273 ; b) A structure which can have for elements (from 1 to 3): 291 274 ; DYNAMIC_RESIZE:Set this keyword to activate (if set to 1) 292 275 ; or deactivate (if set to 0) dynamic resizing of the … … 323 306 IF (N_PARAMS() NE 1) THEN MESSAGE, 'Incorrect number of arguments' 324 307 ON_ERROR, 2 ;return to caller 325 ; che king for row and column keywords326 row = keyword_set(row)*(1-keyword_set(column)) 327 column = keyword_set(column)*(1-keyword_set(row))+(keyword_set(column) EQ row) 308 ; checking for row and column keywords 309 row = keyword_set(row)*(1-keyword_set(column)) 310 column = keyword_set(column)*(1-keyword_set(row))+(keyword_set(column) EQ row) 328 311 if NOT keyword_set(uvalue) then uvalue = '' 329 312 if NOT keyword_set(uname) then uname = '' … … 333 316 , FUNC_GET_VALUE='cw_combobox_pm_get_value' $ 334 317 , PRO_SET_VALUE='cw_combobox_pm_set_value' $ 335 , UVALUE = uvalue, UNAME = uname, _extra = ex) 318 , UVALUE = uvalue, UNAME = uname, _extra = ex) 336 319 ; 337 320 vallen = widget_info(base, string_size = 'm') 338 321 vallen = 35 + (vallen[0]-1)*max(strlen(value)) 339 if keyword_set(row) THEN BEGIN 322 if keyword_set(row) THEN BEGIN 340 323 nothing = widget_button(base, value = '-', uvalue = 'minus', xoffset = 0 $ 341 324 , yoffset = 5, xsize = 15, ysize = 15) … … 345 328 , xoffset = vallen+11, yoffset = 5 $ 346 329 , xsize = 15, ysize = 15) 347 ENDIF ELSE BEGIN 330 ENDIF ELSE BEGIN 348 331 nothing = widget_combobox(base, VALUE = value, UVALUE = 'Combobox', UNAME = 'Combobox' $ 349 332 , xoffset = 0, yoffset = 0, xsize = vallen) … … 354 337 , xoffset = vallen/2 $ 355 338 , yoffset = 24, xsize = 15, ysize = 15) 356 ENDELSE 339 ENDELSE 357 340 ; 358 341 ; widget_control,base,/realize
Note: See TracChangeset
for help on using the changeset viewer.