- Timestamp:
- 03/16/07 10:22:26 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_slider_pm.pro
r163 r226 6 6 ; case uval of 7 7 ; 'done':widget_control, event.top, /destroy 8 ; 'slider_min':BEGIN 8 ; 'slider_min':BEGIN 9 9 ; widget_control, event.id, get_value = value 10 10 ; widget_control, SliderBarId, set_value = {slider_min:value} 11 11 ; END 12 ; 'slider_max':BEGIN 12 ; 'slider_max':BEGIN 13 13 ; widget_control, event.id, get_value = value 14 14 ; widget_control, SliderBarId, set_value = {slider_max:value} 15 15 ; END 16 ; 'slider_value':BEGIN 16 ; 'slider_value':BEGIN 17 17 ; widget_control, event.id, get_value = value 18 18 ; widget_control, SliderBarId, set_value = value 19 19 ; END 20 ; 'get':BEGIN 20 ; 'get':BEGIN 21 21 ; widget_control, SliderBarId, get_value = value 22 22 ; help, value, /struct … … 57 57 ; 58 58 ; @returns 59 ; 60 ; 59 ; 61 60 ; @uses 62 ; 63 ; 64 ; @restrictions 65 ; 66 ; 67 ; @examples 68 ; 69 ; 70 ; @history 71 ; 72 ; 73 ; @version 61 ; 62 ; @restrictions 63 ; 64 ; @examples 65 ; 66 ; @history 67 ; 68 ; @version 74 69 ; $Id$ 75 70 ;- … … 93 88 ; 94 89 ; @returns 95 ; 96 ; 90 ; 97 91 ; @uses 98 ; 99 ; 100 ; @restrictions 101 ; 102 ; 103 ; @examples 104 ; 105 ; 106 ; @history 107 ; 108 ; 109 ; @version 92 ; 93 ; @restrictions 94 ; 95 ; @examples 96 ; 97 ; @history 98 ; 99 ; @version 110 100 ; $Id$ 111 101 ;- … … 124 114 ; @categories 125 115 ; Compound widget 126 ; 116 ; 127 117 ; @param ID 128 ;129 118 ; 130 119 ; @param VALUE … … 132 121 ; 133 122 ; @returns 134 ; 135 ; 123 ; 136 124 ; @uses 137 ; 138 ; 139 ; @restrictions 140 ; 141 ; 142 ; @examples 143 ; 144 ; 145 ; @history 146 ; 147 ; 148 ; @version 125 ; 126 ; @restrictions 127 ; 128 ; @examples 129 ; 130 ; @history 131 ; 132 ; @version 149 133 ; $Id$ 150 134 ;- … … 161 145 case strtrim(strlowcase(tagnames[tag]), 2) of 162 146 'slider_min':BEGIN 163 ; IF float(value.slider_min[0]) LT minmax[1] THEN BEGIN 147 ; IF float(value.slider_min[0]) LT minmax[1] THEN BEGIN 164 148 minmax[0] = value.slider_min[0] 165 149 widget_control, sbid, set_slider_min = floor(float(value.slider_min[0])) … … 169 153 widget_control, dcid, set_value = decvalue(value.slider_min) 170 154 widget_control, dcid, set_combobox_select = decind(value.slider_min) 171 ENDIF 172 ; ENDIF 155 ENDIF 156 ; ENDIF 173 157 end 174 158 'slider_max':BEGIN 175 ; IF float(value.slider_max[0]) GT minmax[0] THEN BEGIN 159 ; IF float(value.slider_max[0]) GT minmax[0] THEN BEGIN 176 160 minmax[1] = value.slider_max[0] 177 161 widget_control, sbid, set_slider_max = ceil(float(value.slider_max[0])) … … 181 165 widget_control, dcid, set_value = decvalue(value.slider_max) 182 166 widget_control, dcid, set_combobox_select = decind(value.slider_max) 183 ENDIF 184 ; ENDIF 167 ENDIF 168 ; ENDIF 185 169 end 186 170 'value':IF float(value.value[0]) GE minmax[0] $ … … 189 173 endcase 190 174 endfor 191 ENDIF ELSE BEGIN 175 ENDIF ELSE BEGIN 192 176 IF float(value[0]) GE minmax[0] $ 193 177 AND float(value[0]) LE minmax[1] THEN value2 = float(value[0]) 194 178 ENDELSE 195 IF n_elements(value2) NE 0 THEN BEGIN 179 IF n_elements(value2) NE 0 THEN BEGIN 196 180 widget_control, sbid, set_value = fix(value2) 197 181 widget_control, dcid, set_value = decvalue(value2) 198 182 widget_control, dcid, set_combobox_select = decind(value2) 199 ENDIF 183 ENDIF 200 184 return 201 185 end … … 206 190 ; 207 191 ; @categories 208 ; Compound widget 209 ; 192 ; Compound widget 193 ; 210 194 ; @param ID 211 195 ; 212 ; 213 ; @returns 214 ; 215 ; 196 ; @returns 197 ; 216 198 ; @uses 217 ; 218 ; 219 ; @restrictions 220 ; 221 ; 222 ; @examples 223 ; 224 ; 225 ; @history 226 ; 227 ; 228 ; @version 199 ; 200 ; @restrictions 201 ; 202 ; @examples 203 ; 204 ; @history 205 ; 206 ; @version 229 207 ; $Id$ 230 208 ;- … … 246 224 ; @categories 247 225 ; Compound widget 248 ; 226 ; 249 227 ; @param EVENT 250 ; 251 ; 252 ; @returns 253 ; 254 ; 228 ; 229 ; @returns 230 ; 255 231 ; @uses 256 ; 257 ; 258 ; @restrictions 259 ; 260 ; 261 ; @examples 262 ; 263 ; 264 ; @history 265 ; 266 ; 267 ; @version 232 ; 233 ; @restrictions 234 ; 235 ; @examples 236 ; 237 ; @history 238 ; 239 ; @version 268 240 ; $Id$ 269 241 ;- … … 284 256 'minus':if (value - 1) GE minmax[0] then value2 = value - 1 ELSE out = -1 285 257 'SliderBar':if (event.value + value - floor(value)) LE minmax[1] THEN value2 = event.value + value - floor(value) 286 'decimal':BEGIN 258 'decimal':BEGIN 287 259 CASE 1 OF 288 260 value GT minmax[1]: value2 = minmax[1] … … 313 285 ; @categories 314 286 ; Compound widget 315 ; 287 ; 316 288 ; @param PARENT {in}{required} 317 289 ; The widget ID of the parent widget. … … 319 291 ; @keyword UVALUE 320 292 ; The user value to be associated with the widget. 321 ; 293 ; 322 294 ; @keyword UNAME 323 295 ; The user name to be associated with the widget. 324 ; 296 ; 325 297 ; @keyword VALUE 326 298 ; 327 ;328 299 ; @keyword MAXIMUM 329 ; 330 ; 300 ; 331 301 ; @keyword MINIMUM 332 302 ; 333 ; 303 ; 334 304 ; @keyword STRMINLEN 335 305 ; … … 365 335 ; computationally expensive operations until the user releases the 366 336 ; slider. 367 ; OUT:It is an integer which can take 3 values: 337 ; OUT:It is an integer which can take 3 values: 368 338 ; 1 : If we press + when the index is already at the max 369 339 ; Comment: In this case, the index stay at the max … … 378 348 ; 1) GET_VALUE 379 349 ; widget_control,wid_id,get_value=resultat 380 ; Send back in the result variable a structure of 2 elements whose name 381 ; are inspired from keywords we can pass at 350 ; Send back in the result variable a structure of 2 elements whose name 351 ; are inspired from keywords we can pass at 382 352 ; widget_control when we use WIDGET_SLIDER: 383 353 ; VALUE:the value setting of the widget … … 386 356 ; 2) SET_VALUE 387 357 ; widget_control,wid_id,set_value=impose 388 ; Allows to modify the state of the combobox like we can do it for 389 ; WIDGET_COMBOBOX. May impose: 358 ; Allows to modify the state of the combobox like we can do it for 359 ; WIDGET_COMBOBOX. May impose: 390 360 ; a) a integer: give the new position of the slider. 391 ; b) A structure which can have for elements (from 1 to 3): 361 ; b) A structure which can have for elements (from 1 to 3): 392 362 ; VALUE: an integer which give the new position of the slider 393 363 ; SLIDER_MIN:Set to a new minimum value for the specified … … 428 398 if NOT keyword_set(title) then title = ' ' 429 399 ; 430 ; che king exclusive keywords400 ; checking exclusive keywords 431 401 column = (keyword_set(column)*(1-keyword_set(row))+keyword_set(vertical)) < 1 432 row = keyword_set(row)*(1-keyword_set(column)) +(keyword_set(row) EQ column) 402 row = keyword_set(row)*(1-keyword_set(column)) +(keyword_set(row) EQ column) 433 403 if NOT keyword_set(uvalue) then uvalue = '' 434 404 if NOT keyword_set(uname) then uname = '' … … 437 407 , FUNC_GET_VALUE = 'cw_slider_pm_get_value' $ 438 408 , PRO_SET_VALUE = 'cw_slider_pm_set_value' $ 439 , space = 0, UVALUE = uvalue, UNAME = uname, _extra = ex) 409 , space = 0, UVALUE = uvalue, UNAME = uname, _extra = ex) 440 410 ; 441 411 mlen = (widget_info(base, string_size = 'm'))[0]
Note: See TracChangeset
for help on using the changeset viewer.