Changeset 150 for trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET
- Timestamp:
- 08/09/06 12:12:54 (18 years ago)
- Location:
- trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_bgroup.pro
r134 r150 1 ; $Id$2 ;3 ; Copyright (c) 1992-2005, Research Systems, Inc. All rights reserved.4 ; Unauthorized reproduction prohibited.5 ;+6 ; NAME:7 ; CW_BGROUP8 ;9 ; PURPOSE:10 ; CW_BGROUP is a compound widget that simplifies creating11 ; a base of buttons. It handles the details of creating the12 ; proper base (standard, exclusive, or non-exclusive) and filling13 ; in the desired buttons. Events for the individual buttons are14 ; handled transparently, and a CW_BGROUP event returned. This15 ; event can return any one of the following:16 ; - The Index of the button within the base.17 ; - The widget ID of the button.18 ; - The name of the button.19 ; - An arbitrary value taken from an array of User values.20 ;21 ; CATEGORY:22 ; Compound widgets.23 ;24 ; CALLING SEQUENCE:25 ; Widget = CW_BGROUP(Parent, Names)26 ;27 ; To get or set the value of a CW_BGROUP, use the GET_VALUE and28 ; SET_VALUE keywords to WIDGET_CONTROL. The value of a CW_BGROUP29 ; is:30 ;31 ; -----------------------------------------------32 ; Type Value33 ; -----------------------------------------------34 ; normal None35 ; exclusive Index of currently set button36 ; non-exclusive Vector indicating the position37 ; of each button (1-set, 0-unset)38 ; -----------------------------------------------39 ;40 ;41 ; INPUTS:42 ; Parent: The ID of the parent widget.43 ; Names: A string array, containing one string per button,44 ; giving the name of each button.45 ;46 ; KEYWORD PARAMETERS:47 ;48 ; BUTTON_UVALUE: An array of user values to be associated with49 ; each button and returned in the event structure.50 ; COLUMN: Buttons will be arranged in the number of columns51 ; specified by this keyword.52 ; EVENT_FUNCT: The name of an optional user-supplied event function53 ; for buttons. This function is called with the return54 ; value structure whenever a button is pressed, and55 ; follows the conventions for user-written event56 ; functions.57 ; EXCLUSIVE: Buttons will be placed in an exclusive base, with58 ; only one button allowed to be selected at a time.59 ; FONT: The name of the font to be used for the button60 ; titles. If this keyword is not specified, the default61 ; font is used.62 ; FRAME: Specifies the width of the frame to be drawn around63 ; the base.64 ; IDS: A named variable into which the button IDs will be65 ; stored, as a longword vector.66 ; LABEL_LEFT: Creates a text label to the left of the buttons.67 ; LABEL_TOP: Creates a text label above the buttons.68 ; MAP: If set, the base will be mapped when the widget69 ; is realized (the default).70 ; NONEXCLUSIVE: Buttons will be placed in an non-exclusive base.71 ; The buttons will be independent.72 ; NO_RELEASE: If set, button release events will not be returned.73 ; RETURN_ID: If set, the VALUE field of returned events will be74 ; the widget ID of the button.75 ; RETURN_INDEX: If set, the VALUE field of returned events will be76 ; the zero-based index of the button within the base.77 ; THIS IS THE DEFAULT.78 ; RETURN_NAME: If set, the VALUE field of returned events will be79 ; the name of the button within the base.80 ; ROW: Buttons will be arranged in the number of rows81 ; specified by this keyword.82 ; SCROLL: If set, the base will include scroll bars to allow83 ; viewing a large base through a smaller viewport.84 ; SET_VALUE: The initial value of the buttons. This is equivalent85 ; to the later statement:86 ;87 ; WIDGET_CONTROL, widget, set_value=value88 ;89 ; SPACE: The space, in pixels, to be left around the edges90 ; of a row or column major base. This keyword is91 ; ignored if EXCLUSIVE or NONEXCLUSIVE are specified.92 ; UVALUE: The user value to be associated with the widget.93 ; UNAME: The user name to be associated with the widget.94 ; XOFFSET: The X offset of the widget relative to its parent.95 ; XPAD: The horizontal space, in pixels, between children96 ; of a row or column major base. Ignored if EXCLUSIVE97 ; or NONEXCLUSIVE are specified.98 ; XSIZE: The width of the base.99 ; X_SCROLL_SIZE: The width of the viewport if SCROLL is specified.100 ; YOFFSET: The Y offset of the widget relative to its parent.101 ; YPAD: The vertical space, in pixels, between children of102 ; a row or column major base. Ignored if EXCLUSIVE103 ; or NONEXCLUSIVE are specified.104 ; YSIZE: The height of the base.105 ; Y_SCROLL_SIZE: The height of the viewport if SCROLL is specified.106 ;107 ; OUTPUTS:108 ; The ID of the created widget is returned.109 ;110 ; SIDE EFFECTS:111 ; This widget generates event structures with the following definition:112 ;113 ; event = { ID:0L, TOP:0L, HANDLER:0L, SELECT:0, VALUE:0 }114 ;115 ; The SELECT field is passed through from the button event. VALUE is116 ; either the INDEX, ID, NAME, or BUTTON_UVALUE of the button,117 ; depending on how the widget was created.118 ;119 ; RESTRICTIONS:120 ; Only buttons with textual names are handled by this widget.121 ; Bitmaps are not understood.122 ;123 ; MODIFICATION HISTORY:124 ; 15 June 1992, AB125 ; 7 April 1993, AB, Removed state caching.126 ; 6 Oct. 1994, KDB, Font keyword is not applied to the label.127 ; 10 FEB 1995, DJC fixed bad bug in event procedure, getting128 ; id of stash widget.129 ; 11 April 1995, AB Removed Motif special cases.130 ;-131 132 133 1 pro CW_BGROUP_SETV, id, value 134 2 compile_opt hidden, idl2, strictarrsubs … … 224 92 225 93 94 95 96 ; 97 ;+ 98 ; @file_comments 99 ; CW_BGROUP is a compound widget that simplifies creating 100 ; a base of buttons. It handles the details of creating the 101 ; proper base (standard, exclusive, or non-exclusive) and filling 102 ; in the desired buttons. Events for the individual buttons are 103 ; handled transparently, and a CW_BGROUP event returned. This 104 ; event can return any one of the following: 105 ; - The Index of the button within the base. 106 ; - The widget ID of the button. 107 ; - The name of the button. 108 ; - An arbitrary value taken from an array of User values. 109 ; 110 ; @categories 111 ; Compound widgets. 112 ; 113 ; @param PARENT {in}{required} 114 ; The ID of the parent widget. 115 ; 116 ; @param NAMES 117 ; A string array, containing one string per button, 118 ; giving the name of each button. 119 ; 120 ; @keyword BUTTON_UVALUE 121 ; An array of user values to be associated with 122 ; each button and returned in the event structure. 123 ; 124 ; @keyword COLUMN 125 ; Buttons will be arranged in the number of columns 126 ; specified by this keyword. 127 ; 128 ; @keyword EVENT_FUNCT 129 ; The name of an optional user-supplied event function 130 ; for buttons. This function is called with the return 131 ; value structure whenever a button is pressed, and 132 ; follows the conventions for user-written event functions. 133 ; 134 ; @keyword EXCLUSIVE 135 ; Buttons will be placed in an exclusive base, with 136 ; only one button allowed to be selected at a time. 137 ; 138 ; @keyword FONT 139 ; The name of the font to be used for the button 140 ; titles. If this keyword is not specified, the default 141 ; font is used. 142 ; 143 ; @keyword FRAME 144 ; Specifies the width of the frame to be drawn around the base. 145 ; 146 ; @keyword IDS 147 ; A named variable into which the button IDs will be 148 ; stored, as a longword vector. 149 ; 150 ; @keyword LABEL_LEFT 151 ; Creates a text label to the left of the buttons. 152 ; 153 ; @keyword LABEL_TOP 154 ; Creates a text label above the buttons. 155 ; 156 ; @keyword MAP 157 ; If set, the base will be mapped when the widget 158 ; is realized (the default). 159 ; 160 ; @keyword NONEXCLUSIVE 161 ; Buttons will be placed in an non-exclusive base. 162 ; The buttons will be independent. 163 ; 164 ; @keyword NO_RELEASE 165 ; If set, button release events will not be returned. 166 ; 167 ; @keyword RETURN_ID 168 ; If set, the VALUE field of returned events will be 169 ; the widget ID of the button. 170 ; 171 ; @keyword RETURN_INDEX 172 ; If set, the VALUE field of returned events will be 173 ; the zero-based index of the button within the base. 174 ; THIS IS THE DEFAULT. 175 ; 176 ; @keyword RETURN_NAME 177 ; If set, the VALUE field of returned events will be 178 ; the name of the button within the base. 179 ; 180 ; @keyword ROW 181 ; Buttons will be arranged in the number of rows 182 ; specified by this keyword. 183 ; 184 ; @keyword SCROLL 185 ; If set, the base will include scroll bars to allow 186 ; viewing a large base through a smaller viewport. 187 ; 188 ; @keyword SET_VALUE 189 ; The initial value of the buttons. This is equivalent 190 ; to the later statement: 191 ; 192 ; WIDGET_CONTROL, widget, set_value=value 193 ; 194 ; @keyword SPACE 195 ; The space, in pixels, to be left around the edges 196 ; of a row or column major base. This keyword is 197 ; ignored if EXCLUSIVE or NONEXCLUSIVE are specified. 198 ; 199 ; @keyword UVALUE 200 ; The user value to be associated with the widget. 201 ; 202 ; @keyword UNAME 203 ; The user name to be associated with the widget. 204 ; 205 ; @keyword XOFFSET 206 ; The X offset of the widget relative to its parent. 207 ; 208 ; @keyword XPAD 209 ; The horizontal space, in pixels, between children 210 ; of a row or column major base. Ignored if EXCLUSIVE 211 ; or NONEXCLUSIVE are specified. 212 ; 213 ; @keyword XSIZE 214 ; The width of the base. 215 ; @keyword X_SCROLL_SIZE 216 ; The width of the viewport if SCROLL is specified. 217 ; 218 ; @keyword YOFFSET 219 ; The Y offset of the widget relative to its parent. 220 ; 221 ; @keyword YPAD 222 ; The vertical space, in pixels, between children of 223 ; a row or column major base. Ignored if EXCLUSIVE 224 ; or NONEXCLUSIVE are specified. 225 ; 226 ; @keyword YSIZE 227 ; The height of the base. 228 ; 229 ; @keyword Y_SCROLL_SIZE 230 ; The height of the viewport if SCROLL is specified. 231 ; 232 ; @returns 233 ; The ID of the created widget is returned. 234 ; 235 ; @restrictions 236 ; This widget generates event structures with the following definition: 237 ; 238 ; event = { ID:0L, TOP:0L, HANDLER:0L, SELECT:0, VALUE:0 } 239 ; 240 ; The SELECT field is passed through from the button event. VALUE is 241 ; either the INDEX, ID, NAME, or BUTTON_UVALUE of the button, 242 ; depending on how the widget was created. 243 ; 244 ; @restrictions 245 ; Only buttons with textual names are handled by this widget. 246 ; Bitmaps are not understood. 247 ; 248 ; @history 249 ; 15 June 1992, AB 250 ; 7 April 1993, AB, Removed state caching. 251 ; 6 Oct. 1994, KDB, Font keyword is not applied to the label. 252 ; 10 FEB 1995, DJC fixed bad bug in event procedure, getting 253 ; id of stash widget. 254 ; 11 April 1995, AB Removed Motif special cases. 255 ; 256 ; Copyright (c) 1992-2005, Research Systems, Inc. All rights reserved. 257 ; Unauthorized reproduction prohibited. 258 ; 259 ; @version 260 ; $Id$ 261 ; 262 ;- 226 263 227 264 -
trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_calendar.pro
r146 r150 276 276 ;---------------------------------------------------------------------- 277 277 ;---------------------------------------------------------------------- 278 ;+ 279 ; @file_comments 280 ; 281 ; 282 ; @categories 283 ; 284 ; 285 ; @param PARENT {in}{required} 286 ; The widget ID of the parent widget. 287 ; 288 ; @param CALENDAR 289 ; 290 ; 291 ; @param JDATE0 292 ; 293 ; 294 ; @keyword CALTYPE 295 ; 296 ; 297 ; @keyword FAKECAL 298 ; 299 ; 300 ; @keyword UVALUE 301 ; 302 ; 303 ; @keyword UNAME 304 ; 305 ; 306 ; @keyword _EXTRA 307 ; Used to pass your keywords 308 ; 309 ; @returns 310 ; 311 ; 312 ; @uses 313 ; 314 ; 315 ; @restrictions 316 ; 317 ; 318 ; @examples 319 ; 320 ; 321 ; @history 322 ; 323 ; 324 ; @version 325 ; $Id$ 326 ; 327 ; @todo 328 ; seb 329 ; 330 ;- 278 331 FUNCTION cw_calendar, parent, calendar, jdate0, CALTYPE = CALTYPE, FAKECAL = fakecal, UVALUE = uvalue, UNAME = uname, _extra = ex 279 332 ; -
trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_combobox_pm.pro
r134 r150 1 ;------------------------------------------------------------2 ;------------------------------------------------------------3 ;------------------------------------------------------------4 ;+5 ; NAME: cw_combobox_pm6 ;7 ; PURPOSE: widget equivalent a WIDGET_COMBOBOX sauf qu'en plus on8 ; dispose de 2 bouttons + et - pour deplacer le widget de +/- 1.9 ;10 ; CATEGORY: compound widget (aide a l''ecriture des widgets)11 ;12 ; CALLING SEQUENCE: id=cw_combobox_pm(parent)13 ;14 ; INPUTS:15 ; Parent: The widget ID of the parent widget.16 ;17 ; KEYWORD PARAMETERS:tous ceux de WIDGET_COMBOBOX18 ;19 ; OUTPUTS:20 ; The returned value of this function is the widget ID of the21 ; newly-created animation widget.22 ;23 ; COMMON BLOCKS: none24 ;25 ; SIDE EFFECTS:26 ;27 ; Widget Events Returned by Combobox Widgets28 ;29 ; Pressing the mouse button while the mouse cursor is over an30 ; element of a combobox widget causes the widget to change the label31 ; on the combobox button and to generate an event. The appearance of32 ; any previously selected element is restored to normal at the same33 ; time. The event structure returned by the WIDGET_EVENT function is34 ; defined by the following statement:35 ;36 ; { CW_COMBOBOX_PM, ID:0L, TOP:0L, HANDLER:0L, INDEX:0L, OUT:0 }37 ;38 ; The first three fields are the standard fields found in every39 ; widget event.40 ; INDEX returns the index of the selected item. This can be used to41 ; index the array of names originally used to set the widget''s42 ; value43 ; OUT:c''est un entier qui peut prendre 3 valeurs:44 ; 1 : si on appuie sur + alors que l''index est deja aux max. rq:45 ; ds ce cas l''index reste au max46 ; -1: si on appuie sur - alors que l''index est deja aux min. rq:47 ; ds ce cas l''index reste au min48 ; 0 : ds les autres cas!49 ;50 ; Keywords to WIDGET_CONTROL51 ;52 ; A number of keywords to the WIDGET_CONTROL procedure affect the53 ; behavior of cw_slider_pm widget: GET_VALUE and SET_VALUE.54 ; 1) GET_VALUE55 ; widget_control,wid_id,get_value=resultat56 ; retourne ds la variable resultat une structure de 3 elements dont57 ; les noms sont inspires des mots cles que l''on peut passer a58 ; widget_control qd on utilise WIDGET_COMBOBOX:59 ; COMBOBOX_NUMBER: the number of elements currently60 ; contained in the specified combobox widget.61 ; COMBOBOX_SELECT: the zero-based number of the62 ; currently-selected element (i.e., the currently-displayed63 ; element) in the specified combobox widget.64 ; DYNAMIC_RESIZE: a True value (1) if the widget specified65 ; by Widget_ID is a button, combobox, or label widget that66 ; has had its DYNAMIC_RESIZE attribute set. Otherwise,67 ; False (0) is returned.68 ; 2) SET_VALUE69 ; widget_control,wid_id,set_value=impose70 ; permet de modifier l''etat de la combobox comme on peut le faire71 ; pour WIDGET_COMBOBOX Impose peut etre:72 ; a) The contents of the list widget (string or string array)73 ; b) une structure qui peut avoir comme elements (de 1 a 3):74 ; DYNAMIC_RESIZE:Set this keyword to activate (if set to 1)75 ; or deactivate (if set to 0) dynamic resizing of the76 ; specified CW_COMBOBOX_PM widget (see the documentation77 ; for the DYNAMIC_RESIZE keyword to WIDGET_COMBOBOX78 ; procedure for more information about dynamic widget79 ; resizing).80 ; COMBOBOX_SELECT:Set this keyword to return the zero-based81 ; number of the currently-selected element (i.e., the82 ; currently-displayed element) in the specified combobox83 ; widget.84 ; VALUE: The contents of the list widget (string or string85 ; array)86 ;87 ; RESTRICTIONS:88 ;89 ; EXAMPLE: cf utiliser le programme founit i-dessous: testwid et la90 ; procedure associee, testwid_event.91 ;92 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr)93 ; 6/9/199994 ;95 ;-96 ;------------------------------------------------------------97 ;------------------------------------------------------------98 ;------------------------------------------------------------99 1 ; testwid, value=strtrim(indgen(10),2) 100 2 ; PRO testwid_event, event … … 212 114 , INDEX:index, STR:cmbbtxt, OUT:out} 213 115 end 214 ;---------------------------------------------------------------------- 116 ;------------------------------------------------------------ 117 ;------------------------------------------------------------ 118 ;------------------------------------------------------------ 119 ;+ 120 ; 121 ; @file_comments 122 ; Like WIDGET_COMBOBOX but here, their are 2 buttons + and - to move the widget from +/- 1 123 ; 124 ; @categories 125 ; compound widget 126 ; 127 ; @param PARENT {in}{required} 128 ; The widget ID of the parent widget. 129 ; 130 ; @keyword COLUMN 131 ; Buttons will be arranged in the number of columns 132 ; specified by this keyword. 133 ; 134 ; @keyword ROW 135 ; Buttons will be arranged in the number of rows 136 ; specified by this keyword. 137 ; 138 ; @keyword UVALUE 139 ; The user value to be associated with the widget. 140 ; 141 ; @keyword UNAME 142 ; The user name to be associated with the widget. 143 ; 144 ; @keyword VALUE 145 ; 146 ; 147 ; @keyword _EXTRA 148 ; Used to pass your keywords 149 ; 150 ; @returns 151 ; The returned value of this function is the widget ID of the 152 ; newly-created animation widget. 153 ; 154 ; @restrictions 155 ; 156 ; Widget Events Returned by Combobox Widgets 157 ; 158 ; Pressing the mouse button while the mouse cursor is over an 159 ; element of a combobox widget causes the widget to change the label 160 ; on the combobox button and to generate an event. The appearance of 161 ; any previously selected element is restored to normal at the same 162 ; time. The event structure returned by the WIDGET_EVENT function is 163 ; defined by the following statement: 164 ; 165 ; { CW_COMBOBOX_PM, ID:0L, TOP:0L, HANDLER:0L, INDEX:0L, OUT:0 } 166 ; 167 ; The first three fields are the standard fields found in every 168 ; widget event. 169 ; INDEX returns the index of the selected item. This can be used to 170 ; index the array of names originally used to set the widget''s 171 ; value 172 ; OUT:It is an integer which can take 3 values: 173 ; 1 : If we press + when the index is already at the max 174 ; Comment: In this case, the index stay at the max 175 ; -1: If we press - when the index is already at the min 176 ; Comment: In this case, the index stay at the min 177 ; 0 : In other cases 178 ; 179 ; Keywords to WIDGET_CONTROL 180 ; 181 ; A number of keywords to the WIDGET_CONTROL procedure affect the 182 ; behavior of cw_slider_pm widget: GET_VALUE and SET_VALUE. 183 ; 1) GET_VALUE 184 ; widget_control,wid_id,get_value=resultat 185 ; Send back, in the result variable, a structure of 3 elements whose 186 ; names are inspired by keywords we can pass at widget_control when 187 ; we use WIDGET_COMBOBOX: 188 ; COMBOBOX_NUMBER: the number of elements currently 189 ; contained in the specified combobox widget. 190 ; COMBOBOX_SELECT: the zero-based number of the 191 ; currently-selected element (i.e., the currently-displayed 192 ; element) in the specified combobox widget. 193 ; DYNAMIC_RESIZE: a True value (1) if the widget specified 194 ; by Widget_ID is a button, combobox, or label widget that 195 ; has had its DYNAMIC_RESIZE attribute set. Otherwise, 196 ; False (0) is returned. 197 ; 2) SET_VALUE 198 ; widget_control,wid_id,set_value=impose 199 ; Allows to modify the state of the combobox like we can do it for 200 ; WIDGET_COMBOBOX. May impose: 201 ; a) The contents of the list widget (string or string array) 202 ; b) A structure which can have for elements (from 1 to 3): 203 ; DYNAMIC_RESIZE:Set this keyword to activate (if set to 1) 204 ; or deactivate (if set to 0) dynamic resizing of the 205 ; specified CW_COMBOBOX_PM widget (see the documentation 206 ; for the DYNAMIC_RESIZE keyword to WIDGET_COMBOBOX 207 ; procedure for more information about dynamic widget 208 ; resizing). 209 ; COMBOBOX_SELECT:Set this keyword to return the zero-based 210 ; number of the currently-selected element (i.e., the 211 ; currently-displayed element) in the specified combobox 212 ; widget. 213 ; VALUE: The contents of the list widget (string or string 214 ; array) 215 ; 216 ; @examples 217 ; See the program provided above (testwid and the associated procedure, testwid_event). 218 ; 219 ; @history 220 ; Sebastien Masson (smasson@lodyc.jussieu.fr) 221 ; 6/9/1999 222 ; 223 ; @version 224 ; $Id$ 225 ; 226 ;- 227 ;------------------------------------------------------------ 228 ;------------------------------------------------------------ 229 ;------------------------------------------------------------ 215 230 FUNCTION cw_combobox_pm, parent, VALUE = value, UVALUE = uvalue, UNAME = uname, ROW = row, COLUMN = column, _extra = ex 216 231 ; -
trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_domain.pro
r134 r150 53 53 change = changegrid(currentgrid) 54 54 ;------------------------------------------------ 55 ; quel est le type de boxzoom?55 ; What is the type of boxzoom ? 56 56 currentplot = (extractatt(top_uvalue, 'smallin'))[2]-1 57 57 options = extractatt(top_uvalue, 'options') … … 63 63 ytype = 'geographic' ELSE ytype = 'index' 64 64 ;------------------------------------------------ 65 ; comment completer la boxzoom?65 ; How to complete the boxzoom ? 66 66 IF xtype EQ 'geographic' then begin 67 67 lonn1 = lon1 … … 114 114 strict = uvalue.strict 115 115 ; 116 ; les longitudes117 ; 118 ; min et max possible116 ; Longitudes 117 ; 118 ; Possible min and max 119 119 if xtype EQ 'geographic' then BEGIN 120 120 min = floor(min([glamt,glamf], max = max)) … … 124 124 max = jpi-1 125 125 ENDELSE 126 ; les id des widgets126 ; widgets's id 127 127 lon1id = widget_info(id,find_by_uname = 'lon1') 128 128 lon2id = widget_info(id,find_by_uname = 'lon2') 129 ; doit-on changer de type d''axe x: longitude/index129 ; Do we have to change the type of x axis: longitude/index 130 130 lonbase = widget_info(id,find_by_uname = 'lonbase') 131 131 widget_control, lonbase, get_uvalue = lonbase_uvalue 132 132 if lonbase_uvalue.name NE xtype then BEGIN 133 133 widget_control, lonbase, update = 0 134 ; on casse tout134 ; We break everything 135 135 widget_control, lon1id, /destroy 136 136 widget_control, lon2id, /destroy 137 ; on reconstruit137 ; We reconstruct 138 138 lon1id = cw_slider_pm(lonbase,value=min > boxzoom[0] < ((boxzoom[1] < max)-keyword_set(strict)) $ 139 139 , uvalue={name:'lon1', strict:keyword_set(strict)},uname ='lon1' $ … … 147 147 widget_control, lonbase, update = 1 148 148 ENDIF ELSE BEGIN 149 ; la nouvelle valeur qu''ils vont avoir149 ; The new value they will have 150 150 cursorvalue1 = min > boxzoom[0] < ((boxzoom[1] < max)-strict) 151 151 cursorvalue2 = ((min > boxzoom[0])+strict) > boxzoom[1] < max 152 ; on change les bornes des slider152 ; We change slider's boundaries 153 153 widget_control, lon1id, set_value = {slider_min:min, slider_max:cursorvalue2-strict} 154 154 widget_control, lon2id, set_value = {slider_min:cursorvalue1+strict, slider_max:max} 155 ; on attribut la nouvelle valeur155 ; We attribute the new value 156 156 widget_control, lon1id , set_value = cursorvalue1 157 157 widget_control, lon2id, set_value = cursorvalue2 158 158 ENDELSE 159 159 ; 160 ; les latitudes161 ; 162 ; min et max possible160 ; Latitudes 161 ; 162 ; Possible min and max 163 163 if ytype EQ 'geographic' then begin 164 164 min = floor(min([gphit,gphif], max = max)) … … 168 168 max = jpj-1 169 169 ENDELSE 170 ; doit-on changer de type d''axe y: latitude/index170 ; Do we have to change the type of y axis: latitude/index 171 171 latbase = widget_info(id,find_by_uname = 'latbase') 172 172 widget_control, latbase, get_uvalue = latbase_uvalue … … 219 219 widget_control, dthlv2id, set_value = {value:strtrim(gdep2, 1)} 220 220 ENDIF ELSE gdep2 = gdep1+1 221 ; on s''assure que les profs donnees contiennent bien au moins un 222 ; niveau. 221 ; We make sure that given depthes contain at least one level. 223 222 if boxzoom[4] GT boxzoom[5] then begin 224 223 rien = boxzoom[4] … … 240 239 boxzoom[5] = boxzoom[4]+1 241 240 endif 242 ; maintenant que les values et les indexes sont definis proprement,243 ; on peut les appliquer241 ; Now, values and indexes are proprely defined. 242 ; So we can apply them 244 243 widget_control, dthlv1id, set_value = {combobox_select:indice1} 245 244 widget_control, dthlv2id, set_value = {combobox_select:indice2} 246 ; control er les min et les max dessliders...245 ; control mins and maxs of sliders... 247 246 if indice1 EQ 0 then min1 = 0 ELSE min1 = gdep2[indice1-1] 248 247 max1 = (min1+1) > gdep1[indice2] … … 313 312 depth2id = widget_info(event.handler,find_by_uname = 'depth2') 314 313 dthlv2id = widget_info(event.handler,find_by_uname = 'dthlv2') 315 ; faut-il changerdthlv2 ?314 ; Do we have to change dthlv2 ? 316 315 widget_control, event.id, get_value = dthlv1_value 317 316 gdep1 = fix(dthlv1_value.combobox_value) … … 319 318 gdep2 = fix(dthlv2_value.combobox_value) 320 319 if dthlv2_value.combobox_index LT event.index then BEGIN 321 ; on redefinie la valeur de dthlv2id320 ; We redefine the dthlv2id's value 322 321 widget_control, dthlv2id, set_value = {combobox_select:event.index} 323 ; donc on redefinit la valeur et le max duslider 2322 ; So we redefine the value and the max of the slider 2 324 323 if event.index EQ jpk-1 then BEGIN 325 324 max = max([gdept, gdepw]) … … 329 328 widget_control, depth2id $ 330 329 , set_value = {slider_max:max, value:gdep2[event.index]} 331 ; du coup on redefinie donc le max du slider 1330 ; So we redefine the max of the slider 1 332 331 widget_control, depth1id, set_value = {slider_max:gdep1[event.index]} 333 332 END 334 ; on redefinie la valeur et le min du slider depth 1333 ; We redefine the value and the min of the slider depth1 335 334 if event.index EQ 0 then min = 0 ELSE min = gdep1[event.index-1]+1 336 335 widget_control, depth1id, set_value = {slider_min:min, value:gdep1[event.index]} 337 ; du coup on change aussi la valeur du min duslider depth 2336 ; S we change the value of the min of the slider depth 2 338 337 widget_control, depth2id, set_value = {slider_min:gdep1[event.index]+1} 339 338 END … … 343 342 depth2id = widget_info(event.handler,find_by_uname = 'depth2') 344 343 dthlv1id = widget_info(event.handler,find_by_uname = 'dthlv1') 345 ; faut-il changerdthlv1 ?344 ; Do we have to change dthlv1 ? 346 345 widget_control, dthlv1id, get_value = dthlv1_value 347 346 gdep1 = fix(dthlv1_value.combobox_value) … … 349 348 gdep2 = fix(dthlv2_value.combobox_value) 350 349 if dthlv1_value.combobox_index GT event.index then BEGIN 351 ; on redefinie la valeur dedthlv1id350 ; We redfine the value of dthlv1id 352 351 widget_control, dthlv1id, set_value = {combobox_select:event.index} 353 ; donc on redefinit la valeur et le min duslider 1352 ; So we redefine the value and the min of the slider 1 354 353 if event.index EQ 0 then min = 0 ELSE min = gdep2[event.index-1] 355 354 widget_control, depth1id $ 356 355 , set_value = {slider_min:min, value:gdep1[event.index]} 357 ; du coup on redefinie donc le min duslider 2356 ; Se we redefine the min of the slider 2 358 357 widget_control, depth2id, set_value = {slider_min:gdep2[event.index]} 359 358 END 360 ; on redefinie la valeur et le max duslider depth 2359 ; We redefine the value and the max of the slider depth 2 361 360 if event.index EQ jpk-1 then BEGIN 362 361 max = max([gdept, gdepw]) … … 365 364 ENDIF ELSE max = gdep2[event.index+1]-1 366 365 widget_control, depth2id, set_value = {slider_max:max, value:gdep2[event.index]} 367 ; du coup on change aussi la valeur du max duslider depth 1366 ; So we change the value of the max of the slider depth 1 368 367 widget_control, depth1id, set_value = {slider_max:gdep2[event.index]-1} 369 368 END … … 372 371 depth2id = widget_info(event.handler,find_by_uname = 'depth2') 373 372 dthlv1id = widget_info(event.handler,find_by_uname = 'dthlv1') 374 ; doit-on changerdthlv1 ?373 ; Do we have to change dthlv1 ? 375 374 widget_control, dthlv1id, get_value = dthlv1_value 376 375 gdep1 = fix(dthlv1_value.combobox_value) … … 378 377 indice = indice < (jpk-1) 379 378 if indice NE dthlv1_value.combobox_index then begin 380 ; on change le min dedepth2379 ; We change the min of depth2 381 380 widget_control, depth2id, set_value = {slider_min:gdep1[indice]+1} 382 ; on redefinie la valeur dedthlv1id381 ; We redefine the value of dthlv1id 383 382 widget_control, dthlv1id, set_value = {combobox_select:indice} 384 ; donc on redefinit le min duslider 1383 ; So we redefine the min of the slider 1 385 384 if indice EQ 0 then min = 0 ELSE min = gdep1[indice-1]+1 386 385 widget_control, event.id, set_value = {slider_min:min} … … 391 390 depth1id = widget_info(event.handler,find_by_uname = 'depth1') 392 391 dthlv2id = widget_info(event.handler,find_by_uname = 'dthlv2') 393 ; doit-on changerdthlv2 ?392 ; Do we have to change dthlv2 ? 394 393 widget_control, dthlv2id, get_value = dthlv2_value 395 394 gdep2 = fix(dthlv2_value.combobox_value) … … 397 396 indice = 0 > (indice-1) 398 397 if indice NE dthlv2_value.combobox_index then begin 399 ; on change le max dedepth1398 ; We change the min of depth1 400 399 widget_control, depth1id, set_value = {slider_max:gdep2[indice]-1} 401 ; on redefinie la valeur dedthlv2id400 ; We redefine the value of dthlv2id 402 401 widget_control, dthlv2id, set_value = {combobox_select:indice} 403 ; donc on redefinit le max duslider 2402 ; So we redefine the min of the slider 2 404 403 if indice EQ jpk-1 then BEGIN 405 404 max = max([gdept, gdepw]) … … 418 417 end 419 418 ;********************************************************************* 419 ;+ 420 ; @file_comments 421 ; 422 ; 423 ; @categories 424 ; 425 ; 426 ; @param PARENT {in}{required} 427 ; The widget ID of the parent widget. 428 ; 429 ; @keyword UVALUE 430 ; The user value to be associated with the widget. 431 ; 432 ; @keyword UNAME 433 ; The user name to be associated with the widget. 434 ; 435 ; @keyword STRICT 436 ; 437 ; 438 ; @keyword UNZOOM 439 ; 440 ; 441 ; @keyword BOXZOOM 442 ; Vector indicating the geographic zone on which we want to cut the map. 443 ; If BOXZOOM has : 444 ; 1 element : The extraction is made on [lon1, lon2, lat1, lat2, 0.,boxzoom[0]] 445 ; 2 elements: The extraction is made on [lon1, lon2, lat1, lat2, boxzoom[0],boxzoom[1]] 446 ; 4 elements: The extraction is made on [Boxzoom, 0, max([gdept, gdepw])] 447 ; 5 elements: The extraction is made on [Boxzoom[0:3], 0, Boxzoom[4]] 448 ; 6 elements: The extraction is made on Boxzoom 449 ; Where lon1, lon2,lat1,lat2 are global variables defined at the last domdef! 450 ; 451 ; @keyword _EXTRA 452 ; Used to pass your keywords 453 ; 454 ; @returns 455 ; 456 ; 457 ; @uses 458 ; 459 ; 460 ; @restrictions 461 ; 462 ; 463 ; @examples 464 ; 465 ; 466 ; @history 467 ; 468 ; 469 ; @version 470 ; $Id$ 471 ; 472 ; @todo 473 ; seb: Documenter 474 ; 475 ;- 420 476 FUNCTION cw_domain, parent, BOXZOOM = boxzoom, STRICT = strict, UVALUE = uvalue, UNAME = uname, UNZOOM = unzoom, _extra = ex 421 477 ; … … 426 482 @cm_4data 427 483 ; 428 ; def de laboxzoom484 ; Definition of the boxzoom 429 485 Case N_Elements(Boxzoom) OF 430 486 0:boxzoom = [lon1, lon2, lat1, lat2 $ -
trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_droplist_pm.pro
r134 r150 1 ;------------------------------------------------------------2 ;------------------------------------------------------------3 ;------------------------------------------------------------4 ;+5 ; NAME: cw_droplist_pm6 ;7 ; PURPOSE: widget equivalent a WIDGET_DROPLIST sauf qu'en plus on8 ; dispose de 2 bouttons + et - pour deplacer le widget de +/- 1.9 ;10 ; CATEGORY: compound widget (aide a l''ecriture des widgets)11 ;12 ; CALLING SEQUENCE: id=cw_droplist_pm(parent)13 ;14 ; INPUTS:15 ; Parent: The widget ID of the parent widget.16 ;17 ; KEYWORD PARAMETERS:tous ceux de WIDGET_DROPLIST18 ;19 ; OUTPUTS:20 ; The returned value of this function is the widget ID of the21 ; newly-created animation widget.22 ;23 ; COMMON BLOCKS: none24 ;25 ; SIDE EFFECTS:26 ;27 ; Widget Events Returned by Droplist Widgets28 ;29 ; Pressing the mouse button while the mouse cursor is over an30 ; element of a droplist widget causes the widget to change the label31 ; on the droplist button and to generate an event. The appearance of32 ; any previously selected element is restored to normal at the same33 ; time. The event structure returned by the WIDGET_EVENT function is34 ; defined by the following statement:35 ;36 ; { CW_DROPLIST_PM, ID:0L, TOP:0L, HANDLER:0L, INDEX:0L, OUT:0 }37 ;38 ; The first three fields are the standard fields found in every39 ; widget event.40 ; INDEX returns the index of the selected item. This can be used to41 ; index the array of names originally used to set the widget''s42 ; value43 ; OUT:c''est un entier qui peut prendre 3 valeurs:44 ; 1 : si on appuie sur + alors que l''index est deja aux max. rq:45 ; ds ce cas l''index reste au max46 ; -1: si on appuie sur - alors que l''index est deja aux min. rq:47 ; ds ce cas l''index reste au min48 ; 0 : ds les autres cas!49 ;50 ; Keywords to WIDGET_CONTROL51 ;52 ; A number of keywords to the WIDGET_CONTROL procedure affect the53 ; behavior of cw_slider_pm widget: GET_VALUE and SET_VALUE.54 ; 1) GET_VALUE55 ; widget_control,wid_id,get_value=resultat56 ; retourne ds la variable resultat une structure de 3 elements dont57 ; les noms sont inspires des mots cles que l''on peut passer a58 ; widget_control qd on utilise WIDGET_DROPLIST:59 ; DROPLIST_NUMBER: the number of elements currently60 ; contained in the specified droplist widget.61 ; DROPLIST_SELECT: the zero-based number of the62 ; currently-selected element (i.e., the currently-displayed63 ; element) in the specified droplist widget.64 ; DYNAMIC_RESIZE: a True value (1) if the widget specified65 ; by Widget_ID is a button, droplist, or label widget that66 ; has had its DYNAMIC_RESIZE attribute set. Otherwise,67 ; False (0) is returned.68 ; 2) SET_VALUE69 ; widget_control,wid_id,set_value=impose70 ; permet de modifier l''etat de la droplist comme on peut le faire71 ; pour WIDGET_DROPLIST Impose peut etre:72 ; a) The contents of the list widget (string or string array)73 ; b) une structure qui peut avoir comme elements (de 1 a 3):74 ; DYNAMIC_RESIZE:Set this keyword to activate (if set to 1)75 ; or deactivate (if set to 0) dynamic resizing of the76 ; specified CW_DROPLIST_PM widget (see the documentation77 ; for the DYNAMIC_RESIZE keyword to WIDGET_DROPLIST78 ; procedure for more information about dynamic widget79 ; resizing).80 ; DROPLIST_SELECT:Set this keyword to return the zero-based81 ; number of the currently-selected element (i.e., the82 ; currently-displayed element) in the specified droplist83 ; widget.84 ; VALUE: The contents of the list widget (string or string85 ; array)86 ;87 ; RESTRICTIONS:88 ;89 ; EXAMPLE: cf utiliser le programme founit i-dessous: testwid et la90 ; procedure associee, testwid_event.91 ;92 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr)93 ; 6/9/199994 ;95 ;-96 ;------------------------------------------------------------97 ;------------------------------------------------------------98 ;------------------------------------------------------------99 1 ; PRO testwid_event, event 100 2 ; ; help, event, /STRUCT … … 199 101 end 200 102 ;---------------------------------------------------------------------- 103 ;------------------------------------------------------------ 104 ;------------------------------------------------------------ 105 ;------------------------------------------------------------ 106 ;+ 107 ; 108 ; @file_comments 109 ; Like WIDGET_DROPLIST but here, their are 2 buttons + and - to move the widget from +/- 1 110 ; 111 ; @categories 112 ; compound widget 113 ; 114 ; @param PARENT {in}{required} 115 ; The widget ID of the parent widget. 116 ; 117 ; @keyword COLUMN 118 ; Buttons will be arranged in the number of columns 119 ; specified by this keyword. 120 ; 121 ; @keyword ROW 122 ; Buttons will be arranged in the number of rows 123 ; specified by this keyword. 124 ; 125 ; @keyword UVALUE 126 ; The user value to be associated with the widget. 127 ; 128 ; @keyword UNAME 129 ; The user name to be associated with the widget. 130 ; 131 ; @keyword _EXTRA 132 ; Used to pass your keywords 133 ; 134 ; @returns 135 ; The returned value of this function is the widget ID of the 136 ; newly-created animation widget. 137 ; 138 ; @restrictions 139 ; 140 ; Widget Events Returned by Droplist Widgets 141 ; 142 ; Pressing the mouse button while the mouse cursor is over an 143 ; element of a droplist widget causes the widget to change the label 144 ; on the droplist button and to generate an event. The appearance of 145 ; any previously selected element is restored to normal at the same 146 ; time. The event structure returned by the WIDGET_EVENT function is 147 ; defined by the following statement: 148 ; 149 ; { CW_DROPLIST_PM, ID:0L, TOP:0L, HANDLER:0L, INDEX:0L, OUT:0 } 150 ; 151 ; The first three fields are the standard fields found in every 152 ; widget event. 153 ; INDEX returns the index of the selected item. This can be used to 154 ; index the array of names originally used to set the widget''s 155 ; value 156 ; OUT:It is an integer which can take 3 values: 157 ; 1 : If we press + when the index is already at the max 158 ; Comment: In this case, the index stay at the max 159 ; -1: If we press - when the index is already at the min 160 ; Comment: In this case, the index stay at the min 161 ; 0 : In other cases 162 ; 163 ; Keywords to WIDGET_CONTROL 164 ; 165 ; A number of keywords to the WIDGET_CONTROL procedure affect the 166 ; behavior of cw_slider_pm widget: GET_VALUE and SET_VALUE. 167 ; 1) GET_VALUE 168 ; widget_control,wid_id,get_value=resultat 169 ; Send back, in the result variable, a structure of 3 elements whose 170 ; names are inspired by keywords we can pass at widget_control when 171 ; we use WIDGET_COMBOBOX: 172 ; DROPLIST_NUMBER: the number of elements currently 173 ; contained in the specified droplist widget. 174 ; DROPLIST_SELECT: the zero-based number of the 175 ; currently-selected element (i.e., the currently-displayed 176 ; element) in the specified droplist widget. 177 ; DYNAMIC_RESIZE: a True value (1) if the widget specified 178 ; by Widget_ID is a button, droplist, or label widget that 179 ; has had its DYNAMIC_RESIZE attribute set. Otherwise, 180 ; False (0) is returned. 181 ; 2) SET_VALUE 182 ; widget_control,wid_id,set_value=impose 183 ; permet de modifier l''etat de la droplist comme on peut le faire 184 ; pour WIDGET_DROPLIST Impose peut etre: 185 ; a) The contents of the list widget (string or string array) 186 ; b) A structure which can have for elements (from 1 to 3): 187 ; DYNAMIC_RESIZE:Set this keyword to activate (if set to 1) 188 ; or deactivate (if set to 0) dynamic resizing of the 189 ; specified CW_DROPLIST_PM widget (see the documentation 190 ; for the DYNAMIC_RESIZE keyword to WIDGET_DROPLIST 191 ; procedure for more information about dynamic widget 192 ; resizing). 193 ; DROPLIST_SELECT:Set this keyword to return the zero-based 194 ; number of the currently-selected element (i.e., the 195 ; currently-displayed element) in the specified droplist 196 ; widget. 197 ; VALUE: The contents of the list widget (string or string 198 ; array) 199 ; 200 ; @examples 201 ; See the program provided above (testwid and the associated procedure, testwid_event). 202 ; 203 ; @history 204 ; Sebastien Masson (smasson@lodyc.jussieu.fr) 205 ; 6/9/1999 206 ; 207 ; @version 208 ; $Id$ 209 ; 210 ;- 211 ;------------------------------------------------------------ 212 ;------------------------------------------------------------ 213 ;------------------------------------------------------------ 201 214 FUNCTION cw_droplist_pm, parent,UVALUE = uvalue, UNAME = uname, ROW = row, COLUMN = column, _extra = ex 202 215 ; -
trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_pagelayout.pro
r134 r150 18 18 ; 19 19 @common 20 ; si on ne change pas le nombre de colonnes, on sort20 ; If we do not change the number of columns, we send 21 21 if uval.name EQ 'column' then $ 22 22 if event.index+1 EQ smallin[0] THEN $ 23 23 return,{ID:event.handler, TOP:event.top, HANDLER:0L} 24 ; si on ne change pas le nombre de lignes, on sort24 ; If we do not change the number of lines, we send 25 25 if uval.name EQ 'row' then $ 26 26 if event.index+1 EQ smallin[1] THEN $ 27 27 return,{ID:event.handler, TOP:event.top, HANDLER:0L} 28 28 ; 29 ; on efface lapage29 ; We erase the page 30 30 ; graphid = widget_info(event.top,find_by_uname = 'graph') 31 31 graphid = extractatt(top_uvalue, 'graphid') … … 46 46 nbredessin = smallin[0]*smallin[1] 47 47 ; 48 ; on remet tout a 0 en ce qui concerne lespostscripts48 ; We put all back to 0 for postscripts 49 49 createhistory, event.top, smallin 50 50 ; … … 79 79 end 80 80 ;********************************************************************* 81 ;+ 82 ; @file_comments 83 ; 84 ; 85 ; @categories 86 ; 87 ; 88 ; @param PARENT {in}{required} 89 ; The widget ID of the parent widget. 90 ; 91 ; @param SMALL 92 ; 93 ; 94 ; @keyword COLUMN 95 ; Buttons will be arranged in the number of columns 96 ; specified by this keyword. 97 ; 98 ; @keyword ROW 99 ; Buttons will be arranged in the number of rows 100 ; specified by this keyword. 101 ; 102 ; @keyword UVALUE 103 ; The user value to be associated with the widget. 104 ; 105 ; @keyword UNAME 106 ; The user name to be associated with the widget. 107 ; 108 ; @keyword _EXTRA 109 ; Used to pass your keywords 110 ; 111 ; 112 ; 113 ; @returns 114 ; 115 ; 116 ; @uses 117 ; 118 ; 119 ; @restrictions 120 ; 121 ; 122 ; @examples 123 ; 124 ; 125 ; @history 126 ; 127 ; 128 ; @version 129 ; $Id$ 130 ; 131 ; @todo 132 ; seb: documenter 133 ; 134 ;- 81 135 FUNCTION cw_pagelayout, parent, small, UVALUE = uvalue, UNAME = uname, UNZOOM = unzoom, COLUMN = column, ROW = row, _extra = ex 82 136 ;------------------------------------------------ -
trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_slide_slice.pro
r134 r150 109 109 end 110 110 ;-------------------------------------------------------------------------------- 111 ;+ 112 ; @file_comments 113 ; 114 ; 115 ; @categories 116 ; 117 ; @param PARENT {in}{required} 118 ; The widget ID of the parent widget. 119 ; 120 ; @keyword BOXZOOM 121 ; Vector indicating the geographic zone on which we want to cut the map. 122 ; If BOXZOOM has : 123 ; 1 element : The extraction is made on [lon1, lon2, lat1, lat2, 0.,boxzoom[0]] 124 ; 2 elements: The extraction is made on [lon1, lon2, lat1, lat2, boxzoom[0],boxzoom[1]] 125 ; 4 elements: The extraction is made on [Boxzoom, 0, max([gdept, gdepw])] 126 ; 5 elements: The extraction is made on [Boxzoom[0:3], 0, Boxzoom[4]] 127 ; 6 elements: The extraction is made on Boxzoom 128 ; Where lon1, lon2,lat1,lat2 are global variables defined at the last domdef! 129 ; 130 ; @keyword COLUMN 131 ; Buttons will be arranged in the number of columns 132 ; specified by this keyword. 133 ; 134 ; @keyword FRAME 135 ; Specifies the width of the frame to be drawn around the base. 136 ; 137 ; @keyword ROW 138 ; Buttons will be arranged in the number of rows 139 ; specified by this keyword. 140 ; 141 ; @keyword UVALUE 142 ; The user value to be associated with the widget. 143 ; 144 ; @keyword UNAME 145 ; The user name to be associated with the widget. 146 ; 147 ; @keyword _EXTRA 148 ; Used to pass your keywords 149 ; 150 ; @returns 151 ; 152 ; 153 ; @uses 154 ; 155 ; 156 ; @restrictions 157 ; 158 ; 159 ; @examples 160 ; 161 ; 162 ; @history 163 ; 164 ; 165 ; @version 166 ; $Id$ 167 ; 168 ; @todo 169 ; seb: documenter 170 ; 171 ;- 111 172 FUNCTION cw_slide_slice, parent, boxzoom = boxzoom, UVALUE = uvalue, UNAME = uname, FRAME = frame, ROW = row, COLUMN = column, _extra = ex 112 173 ; -
trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_slider_pm.pro
r134 r150 1 ;------------------------------------------------------------2 ;------------------------------------------------------------3 ;------------------------------------------------------------4 ;+5 ; NAME: cw_slider_pm6 ;7 ; PURPOSE: widget equivalent a WIDGET_SLIDER sauf qu'en plus on8 ; dispose de 2 bouttons + et - pour deplacer le widget de +/- 1.9 ;10 ; CATEGORY: compound widget (aide a l''ecriture des widgets)11 ;12 ; CALLING SEQUENCE: id=cw_slider_pm(parent)13 ;14 ; INPUTS:15 ; Parent: The widget ID of the parent widget.16 ;17 ; KEYWORD PARAMETERS:tous ceux de WIDGET_SLIDER18 ;19 ; OUTPUTS:20 ; The returned value of this function is the widget ID of the21 ; newly-created animation widget.22 ;23 ; COMMON BLOCKS: none24 ;25 ; SIDE EFFECTS:26 ;27 ; Widget Events Returned by the CW_SLIDER_PM Widget28 ;29 ; Slider widgets generate events when the mouse is used to change30 ; their value. The event structure returned by the WIDGET_EVENT31 ; function is defined by the following statement:32 ;33 ; {CW_SLIDER_PM, ID:0L, TOP:0L, HANDLER:0L, VALUE:0L, DRAG:0, OUT:0}34 ;35 ; ID is the widget ID of the button generating the event. TOP is the36 ; widget ID of the top level widget containing ID.37 ; HANDLER contains the widget ID of the widget associated with the38 ; handler routine.39 ; VALUE returns the new value of the slider.40 ; DRAG returns integer 1 if the slider event was generated as part of41 ; a drag operation, or zero if the event was generated when the user42 ; had finished positioning the slider. Note that the slider widget43 ; only generates events during the drag operation if the DRAG keyword44 ; is set, and if the application is running under Motif. When the45 ; DRAG keyword is set, the DRAG field can be used to avoid46 ; computationally expensive operations until the user releases the47 ; slider.48 ; OUT:c''est un entier qui peut prendre 3 valeurs:49 ; 1 : si on appuie sur + alors que le slider est deja aux max. rq:50 ; ds ce cas le slider reste au max51 ; -1: si on appuie sur - alors que le slider est deja aux min. rq:52 ; ds ce cas le slider reste au min53 ; 0 : ds les autres cas!54 ;55 ; Keywords to WIDGET_CONTROL56 ;57 ; A number of keywords to the WIDGET_CONTROL procedure affect the58 ; behavior of cw_slider_pm widget: GET_VALUE and SET_VALUE.59 ; 1) GET_VALUE60 ; widget_control,wid_id,get_value=resultat61 ; retourne ds la variable resultat une structure de 2 elements dont62 ; les noms sont inspires des mots cles que l''on peut passer a63 ; widget_control qd on utilise WIDGET_SLIDER:64 ; VALUE:the value setting of the widget65 ; SLIDER_MIN_MAX: a 2 elements array: The minimum and the66 ; maximum value of the range encompassed by the slider67 ; 2) SET_VALUE68 ; widget_control,wid_id,set_value=impose69 ; permet de modifier l''etat de la slider bar comme on peut le faire70 ; pour WIDGET_SLIDER. Impose peut etre:71 ; a) un entier: donne la nouvelle position of the slider.72 ; b) une structure qui peut avoir comme elements (de 1 a 3):73 ; VALUE:un entier qui donne la nouvelle position of the slider.74 ; SLIDER_MIN:Set to a new minimum value for the specified75 ; slider widget.76 ; SLIDER_MAX:Set to a new minimum value for the specified77 ; slider widget.78 ;79 ; RESTRICTIONS:80 ;81 ; EXAMPLE: cf utiliser le programme founit i-dessous: testwid et la82 ; procedure associee, testwid_event.83 ;84 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr)85 ; 5/9/199986 ;-87 ;------------------------------------------------------------88 ;------------------------------------------------------------89 ;------------------------------------------------------------90 1 ; PRO testwid_event, event 91 2 ; ; help, event, /STRUCT … … 249 160 end 250 161 ;---------------------------------------------------------------------- 162 ;------------------------------------------------------------ 163 ;------------------------------------------------------------ 164 ;------------------------------------------------------------ 165 ;+ 166 ; 167 ; @file_comments 168 ; Like WIDGET_SLIDER but here, their are 2 buttons + and - to move the widget from +/- 1 169 ; 170 ; @categories 171 ; compound widget 172 ; 173 ; @param PARENT {in}{required} 174 ; The widget ID of the parent widget. 175 ; 176 ; @keyword UVALUE 177 ; The user value to be associated with the widget. 178 ; 179 ; @keyword UNAME 180 ; The user name to be associated with the widget. 181 ; 182 ; @keyword VALUE 183 ; 184 ; 185 ; @keyword MAXIMUM 186 ; 187 ; 188 ; @keyword MINIMUM 189 ; 190 ; 191 ; @keyword STRMINLEN 192 ; 193 ; 194 ; @keyword _EXTRA 195 ; Used to pass your keywords 196 ; 197 ; @returns 198 ; The returned value of this function is the widget ID of the 199 ; newly-created animation widget. 200 ; 201 ; @restrictions 202 ; 203 ; Widget Events Returned by the CW_SLIDER_PM Widget 204 ; 205 ; Slider widgets generate events when the mouse is used to change 206 ; their value. The event structure returned by the WIDGET_EVENT 207 ; function is defined by the following statement: 208 ; 209 ; {CW_SLIDER_PM, ID:0L, TOP:0L, HANDLER:0L, VALUE:0L, DRAG:0, OUT:0} 210 ; 211 ; ID is the widget ID of the button generating the event. TOP is the 212 ; widget ID of the top level widget containing ID. 213 ; HANDLER contains the widget ID of the widget associated with the 214 ; handler routine. 215 ; VALUE returns the new value of the slider. 216 ; DRAG returns integer 1 if the slider event was generated as part of 217 ; a drag operation, or zero if the event was generated when the user 218 ; had finished positioning the slider. Note that the slider widget 219 ; only generates events during the drag operation if the DRAG keyword 220 ; is set, and if the application is running under Motif. When the 221 ; DRAG keyword is set, the DRAG field can be used to avoid 222 ; computationally expensive operations until the user releases the 223 ; slider. 224 ; OUT:It is an integer which can take 3 values: 225 ; 1 : If we press + when the index is already at the max 226 ; Comment: In this case, the index stay at the max 227 ; -1: If we press - when the index is already at the min 228 ; Comment: In this case, the index stay at the min 229 ; 0 : In other cases 230 ; 231 ; Keywords to WIDGET_CONTROL 232 ; 233 ; A number of keywords to the WIDGET_CONTROL procedure affect the 234 ; behavior of cw_slider_pm widget: GET_VALUE and SET_VALUE. 235 ; 1) GET_VALUE 236 ; widget_control,wid_id,get_value=resultat 237 ; retourne ds la variable resultat une structure de 2 elements dont 238 ; les noms sont inspires des mots cles que l''on peut passer a 239 ; widget_control qd on utilise WIDGET_SLIDER: 240 ; VALUE:the value setting of the widget 241 ; SLIDER_MIN_MAX: a 2 elements array: The minimum and the 242 ; maximum value of the range encompassed by the slider 243 ; 2) SET_VALUE 244 ; widget_control,wid_id,set_value=impose 245 ; Allows to modify the state of the combobox like we can do it for 246 ; WIDGET_COMBOBOX. May impose: 247 ; a) un entier: donne la nouvelle position of the slider. 248 ; b) A structure which can have for elements (from 1 to 3): 249 ; VALUE: an integer which give the new position of the slider 250 ; SLIDER_MIN:Set to a new minimum value for the specified 251 ; slider widget. 252 ; SLIDER_MAX:Set to a new minimum value for the specified 253 ; slider widget. 254 ; 255 ; 256 ; @examples 257 ; See the program provided above (testwid and the associated procedure, testwid_event). 258 ; 259 ; @history 260 ; Sebastien Masson (smasson@lodyc.jussieu.fr) 261 ; 5/9/1999 262 ; 263 ; @version 264 ; $Id$ 265 ; 266 ; @todo 267 ; seb: documenter 268 ; 269 ;- 270 ;------------------------------------------------------------ 271 ;------------------------------------------------------------ 272 ;------------------------------------------------------------ 251 273 FUNCTION cw_slider_pm, parent, MAXIMUM = maximum, MINIMUM = minimum $ 252 274 , STRMINLEN = strminlen, VALUE = value, UVALUE = uvalue $ -
trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_specifie.pro
r134 r150 72 72 'default':BEGIN 73 73 ;--------------- 74 ; on trouve le nom de la variable: 75 ;--------------- 74 ; We find the name of the variable: 76 75 vlstid = widget_info(event.top, find_by_uname = 'varlist') 77 76 fieldname = widget_info(vlstid, /combobox_gettext) … … 94 93 ;***************************************************** 95 94 ;***************************************************** 95 ;+ 96 ; @file_comments 97 ; 98 ; 99 ; @categories 100 ; 101 ; 102 ; @param PARENT {in}{required} 103 ; The widget ID of the parent widget. 104 ; 105 ; @keyword COLUMN 106 ; Buttons will be arranged in the number of columns 107 ; specified by this keyword. 108 ; 109 ; @keyword ROW 110 ; Buttons will be arranged in the number of rows 111 ; specified by this keyword. 112 ; 113 ; @keyword UVALUE 114 ; The user value to be associated with the widget. 115 ; 116 ; @keyword UNAME 117 ; The user name to be associated with the widget. 118 ; 119 ; @keyword FRAME 120 ; 121 ; 122 ; @keyword FORXXX 123 ; 124 ; 125 ; @keyword _EXTRA 126 ; Used to pass your keywords 127 ; 128 ; 129 ; @returns 130 ; 131 ; 132 ; @uses 133 ; 134 ; 135 ; @restrictions 136 ; 137 ; 138 ; @examples 139 ; 140 ; 141 ; @history 142 ; 143 ; 144 ; @version 145 ; $ID$ 146 ; 147 ; @todo 148 ; seb: documenter 149 ; 150 ;- 96 151 FUNCTION cw_specifie, parent, ROW = row, COLUMN = column, UVALUE = uvalue, UNAME = uname, FRAME = frame, FORXXX = forxxx, _extra = ex 97 152 ; cheking exclusive keywords … … 135 190 136 191 137 ; widget text cont ennant les autres mots cles passe dstop_uvalue.exextra138 ; en reste-t-il? si oui, il faut les mettres sous forme destring192 ; widget text containig other keywords pass into top_uvalue.exextra 193 ; Does it remain some? If yes, we have to put them as string 139 194 140 195 rien = widget_text(base, value = ' ', /editable, uname = 'autres', uvalue = 'autres', xsize = 54, ysize = 3, yoffset = 65, /wrap, /no_newline)
Note: See TracChangeset
for help on using the changeset viewer.