1 2 3 4XmComboBox(3Xm) Harry's Motif Tools XmComboBox(3Xm) 5 6 7NNAAMMEE 8 XmComboBox - The Combo Box widget class 9 10SSYYNNOOPPSSIISS 11 ##iinncclluuddee <<CCoommbbooBBooxx..hh>> 12 13 Depending on your system's configuration the place of this 14 include file may vary. In doubt, contact your local system 15 administrator. Or run in circles and shout. 16 17 18DDEESSCCRRIIPPTTIIOONN 19 The ComboBox widget allows the user to select elements 20 from a list of choices, and enter their own values in a 21 text widget. To conserve screen space, the list of choices 22 is shown only when the user selects the down arrow button. 23 The choices may then be selected from this list. The list 24 will automatically by removed when the user selects an 25 item in the list. When the list is removed, the item that 26 was selected will be placed in the text widget. Typing the 27 escape key when the list is up, cancels the list popup. 28 29 CCllaasssseess 30 ComboBox inherits behaviour and resources from CCoorree and 31 CCoommppoossiittee, CCoonnssttrraaiinntt and XXmmMMaannaaggeerr classes. 32 33 The class pointer is xxmmCCoommbbooBBooxxWWiiddggeettCCllaassss. 34 35 The class name is XXmmCCoommbbooBBooxx. 36 37 NNeeww RReessoouurrcceess 38 The following table defines a set of widget resources used 39 by the programmer to specify data. The programmer can also 40 set the resource values for the inherited classes to set 41 attributes for this widget. To reference a resource by 42 name or by class in a .Xdefaults file, remove the XXmmNN or 43 XXmmCC prefix and use the remaining letters. To specify one 44 of the defined values for a resource in a .Xdefaults file, 45 remove the XXmm prefix and use the remaining letters (in 46 either lowercase or uppercase, but include any underscores 47 between words). The codes in the access column indicate if 48 the given resource can be set at creation time (C), set by 49 using XXttSSeettVVaalluueess (S), retrieved by using XXttGGeettVVaalluueess (G), 50 or is not applicable (N/A). 51 52 XXmmCCoommbbooBBooxx RReessoouurrccee SSeett 53 ----------------------------------------------------------------- 54 NNaammee DDeeffaauulltt AAcccceessss 55 CCllaassss TTyyppee 56 ----------------------------------------------------------------- 57 XmNactivateCallback NULL C 58 XmCCallback XtCallbackList 59 ----------------------------------------------------------------- 60 61 62 63 64Version 1.31 20 March 1995 1 65 66 67 68 69 70XmComboBox(3Xm) Harry's Motif Tools XmComboBox(3Xm) 71 72 73 XmNalignment XmALIGNMENT_CENTER CSG 74 XmCAlignment unsigned char 75 ----------------------------------------------------------------- 76 XmNarrowSpacingOn False CSG 77 XmNCArrowSpacingOn Boolean 78 ----------------------------------------------------------------- 79 XmNautomaticSelection False CSG 80 XmCAutomaticSelection Boolean 81 ----------------------------------------------------------------- 82 XmNblinkRate 500 CSG 83 XmCBlinkRate int 84 ----------------------------------------------------------------- 85 XmNcolumns dynamic CSG 86 XmCColumns short 87 ----------------------------------------------------------------- 88 XmNcursorPosition 0 CSG 89 XmCCursorPosition XmTextPosition 90 ----------------------------------------------------------------- 91 XmNcursorPositionVisible True CSG 92 XmCCursorPositionVisible Boolean 93 ----------------------------------------------------------------- 94 XmNdefaultActionCallback NULL CSG 95 XmCCallback XtCallbackList 96 ----------------------------------------------------------------- 97 XmNdropDownCallback NULL CSG 98 XmCDropDownCallback XtCallbackList 99 ----------------------------------------------------------------- 100 XmNdropDownCursor center_ptr CSG 101 XmCDropDownCursor Cursor 102 ----------------------------------------------------------------- 103 XmNdropDownOffset dynamic CSG 104 XmCDropDownOffset Position 105 ----------------------------------------------------------------- 106 XmNeditable False CG 107 XmCEditable Boolean 108 ----------------------------------------------------------------- 109 XmNfontList dynamic CSG 110 XmCFontList XmFontList 111 ----------------------------------------------------------------- 112 XmNitemCount 0 CSG 113 XmCItemCount int 114 ----------------------------------------------------------------- 115 XmNitems NULL CSG 116 XmCItems XmStringTable 117 ----------------------------------------------------------------- 118 XmNlabelFontList dynamic CSG 119 XmCLabelFontList XmFontList 120 ----------------------------------------------------------------- 121 XmNlabelInsensitivePixmap XmUNSPECIFIED_PIXMAP CSG 122 XmCLabelInsensitivePixmap Pixmap 123 ----------------------------------------------------------------- 124 XmNlabelMarginBottom 0 CSG 125 126 127 128 129 130Version 1.31 20 March 1995 2 131 132 133 134 135 136XmComboBox(3Xm) Harry's Motif Tools XmComboBox(3Xm) 137 138 139 XmCLabelMarginBottom Dimension 140 ----------------------------------------------------------------- 141 XmNlabelMarginHeight 2 CSG 142 XmCLabelMarginHeight Dimension 143 ----------------------------------------------------------------- 144 XmNlabelMarginLeft 0 CSG 145 XmCLabelMarginLeft Dimension 146 ----------------------------------------------------------------- 147 XmNlabelMarginRight 0 CSG 148 XmCLabelMarginRight Dimension 149 ----------------------------------------------------------------- 150 XmNlabelMarginTop 0 CSG 151 XmCLabelMarginTop Dimension 152 ----------------------------------------------------------------- 153 XmNlabelMarginWidth 0 CSG 154 XmCLabelMarginWidth Dimension 155 ----------------------------------------------------------------- 156 XmNlabelPixmap XmUNSPECIFIED_PIXMAP CSG 157 XmCLabelPixmap Pixmap 158 ----------------------------------------------------------------- 159 XmNlabelString dynamic CSG 160 XmCXmString XmString 161 ----------------------------------------------------------------- 162 XmNlabelType XmSTRING CSG 163 XmCLabelType unsigned char 164 ----------------------------------------------------------------- 165 XmNlistMarginHeight 0 CSG 166 XmCListMarginHeight Dimension 167 ----------------------------------------------------------------- 168 XmNlistMarginWidth 0 CSG 169 XmCListMarginWidth Dimension 170 ----------------------------------------------------------------- 171 XmNlistSizePolicy XmVARIABLE CG 172 XmCListSizePolicy unsigned char 173 ----------------------------------------------------------------- 174 XmNlistSpacing 0 CSG 175 XmCListSpacing Dimension 176 ----------------------------------------------------------------- 177 XmNmarginHeight 5 CSG 178 XmCMarginHeight Dimension 179 ----------------------------------------------------------------- 180 XmNmarginWidth 5 CSG 181 XmCMarginWidth Dimension 182 ----------------------------------------------------------------- 183 XmNmaxLength largest integer CSG 184 XmCMaxLength int 185 ----------------------------------------------------------------- 186 XmNmodifyVerifyCallback NULL CSG 187 XmCCallback XtCallbackList 188 ----------------------------------------------------------------- 189 XmNmotionVerifyCallback NULL CSG 190 XmCCallback XtCallbackList 191 ----------------------------------------------------------------- 192 193 194 195 196Version 1.31 20 March 1995 3 197 198 199 200 201 202XmComboBox(3Xm) Harry's Motif Tools XmComboBox(3Xm) 203 204 205 XmNpersistentDropDown False CSG 206 XmCPersistentDropDown Boolean 207 ----------------------------------------------------------------- 208 XmNscrollBarDisplayPolicy XmAS_NEEDED CSG 209 XmCScrollBarDisplayPolicy unsigned char 210 ----------------------------------------------------------------- 211 XmNselectionCallback NULL CSG 212 XmCCallback XtCallbackList 213 ----------------------------------------------------------------- 214 XmNselectionPolicy XmBROWSE_SELECT CG 215 XmCSelectionPolicy unsigned char 216 ----------------------------------------------------------------- 217 XmNselectThreshold 5 CSG 218 XmCSelectThreshold int 219 ----------------------------------------------------------------- 220 XmNshowLabel False CG 221 XmCShowLabel Boolean 222 ----------------------------------------------------------------- 223 XmNsorted False CSG 224 XmCSorted Boolean 225 ----------------------------------------------------------------- 226 XmNsortingCallback NULL CSG 227 XmCCallback XtCallbackList 228 ----------------------------------------------------------------- 229 XmNsquareArrow False CSG 230 XmCSquareArrow Boolean 231 ----------------------------------------------------------------- 232 XmNstaticList False CSG 233 XmCStaticList Boolean 234 ----------------------------------------------------------------- 235 XmNstringDirection dynamic CSG 236 XmCStringDirection XmStringDirection 237 ----------------------------------------------------------------- 238 XmNtwmHandlingOn False CSG 239 XmCTwmHandlingOn Boolean 240 ----------------------------------------------------------------- 241 XmNtopItemPostion 1 G 242 XmCTopItemPostion int 243 ----------------------------------------------------------------- 244 XmNunselectionCallback NULL CSG 245 XmCCallback XtCallbackList 246 ----------------------------------------------------------------- 247 XmNvalue "" CSG 248 XmCValue String 249 ----------------------------------------------------------------- 250 XmNvalueChangedCallback NULL CSG 251 XmCCallback XtCallbackList 252 ----------------------------------------------------------------- 253 XmNvisibleItemCount 8 CSG 254 XmCVisibleItemCount Int 255 ----------------------------------------------------------------- 256 257 XXmmNNaaccttiivvaatteeCCaallllbbaacckk 258 Specifies a list of callbacks to be called when the 259 260 261 262Version 1.31 20 March 1995 4 263 264 265 266 267 268XmComboBox(3Xm) Harry's Motif Tools XmComboBox(3Xm) 269 270 271 user presses either the key "Enter" or "Activate". 272 The type of the structure passed to this callback 273 is XXmmAAnnyyCCaallllbbaacckkSSttrruucctt and the reason is 274 XXmmCCRR__AACCTTIIVVAATTEE. 275 276 XXmmNNaalliiggnnmmeenntt 277 The alignment (left to right) for the label's text 278 or pixmap. Possible values are XXmmAALLIIGGNN-- 279 MMEENNTT__BBEEGGIINNNNIINNGG, XXmmAALLIIGGNNMMEENNTT__CCEENNTTEERR, and XXmmAALLIIGGNN-- 280 MMEENNTT__EENNDD. 281 282 XXmmNNaauuttoommaattiiccSSeelleeccttiioonn 283 Indicates whether the XXmmNNsseelleeccttiioonnCCaallllbbaacckk is 284 invoked each time the user moves into a new item if 285 XXmmNNaauuttoommaattiiccSSeelleeccttiioonn is TTrruuee and the selection 286 mode is XXmmBBRROOWWSSEE__SSEELLEECCTT. If set to FFaallssee the XXmmNNss-- 287 eelleeccttiioonnCCaallllbbaacckk is not invoked until the user 288 releases the mouse button. 289 290 XXmmNNaarrrroowwSSppaacciinnggOOnn 291 Indicates whether a gap is displayed between the 292 arrow button and the text input field if this 293 resource is set to TTrruuee and XXmmNNeeddiittaabbllee is also set 294 to TTrruuee. If this resource is set to FFaallssee the 295 combo box widget will never display a gab between 296 the arrow button and the text area, irrespective of 297 the setting of XXmmNNeeddiittaabbllee. Note that setting 298 XXmmNNaarrrroowwSSppaacciinnggOOnn to FFaallssee doesn not conform to 299 common GUI styles. And it prevents the user from 300 easily recognizing whether the combo box is 301 editable or not. 302 303 XXmmNNbblliinnkkRRaattee 304 The time in milliseconds that the cursor spends 305 being visible or invisible. A value of 0 prevents 306 the cursor from blinking. 307 308 XXmmNNbboorrddeerrWWiiddtthh 309 That's no new resource but is already introduced in 310 the core class. This class overrides the default 311 value and sets it to zero. You can however override 312 it again if you're dissatisfied with the new 313 default setting. 314 315 XXmmNNccoolluummnnss 316 Specifies the initial width of the input field mea- 317 sured in character spaces. The default value 318 depends on the value of the width of the combo box. 319 320 XXmmNNccuurrssoorrPPoossiittiioonn 321 Indicates the position in the text where the insert 322 cursor is to be located. Its position is the offset 323 of characters and it starts with offset 0 at the 324 beginning of the text. 325 326 327 328Version 1.31 20 March 1995 5 329 330 331 332 333 334XmComboBox(3Xm) Harry's Motif Tools XmComboBox(3Xm) 335 336 337 XXmmNNccuurrssoorrPPoossiittiioonnVViissiibbllee 338 Flags whether the insert cursor position is marked 339 by a blinking cursor. 340 341 XXmmNNddeeffaauullttAAccttiioonnCCaallllbbaacckk 342 Specifies a list of callbacks that is called every 343 time an item is double clicked. The reason is 344 XXmmCCRR__DDEEFFAAUULLTT__AACCTTIIOONN. Please remember that you 345 can't use this callback if XXmmNNssttaattiiccLLiisstt is FFaallssee 346 because the list is immediatly hidden after the 347 user selected an item from the list. Thus the user 348 can't double click on any item within the list. 349 350 XXmmNNddrrooppDDoowwnnCCaallllbbaacckk 351 This is a list of callbacks to be called when the 352 list is about to be shown or hidden. The reasons 353 are XXmmCCRR__SSHHOOWW__LLIISSTT or XXmmCCRR__HHIIDDEE__LLIISSTT. 354 355 XXmmNNddrrooppDDoowwnnCCuurrssoorr 356 Specifies the cursor to be used whenever the mouse 357 cursor is within the drop down list. 358 359 XXmmNNddrrooppDDoowwnnOOffffsseett 360 Specifies the distance between the left border of 361 the list and the left border of the input field. 362 The default value is set to the width of the arrow 363 button. Only positive values are allowed for XXmmNN-- 364 ddrrooppDDoowwnnOOffffsseett, negative ones will be ignored. 365 366 XXmmNNeeddiittaabbllee 367 Specifies the type of combo box. If set to True, 368 the combo box contains an editable input field. 369 Therefore, the user is free to select entries out 370 of the list and to enter new text or modify it. In 371 the other case, with XmNeditable set to False the 372 user can solely browse in and select entries out of 373 the list. 374 375 XXmmNNffoonnttLLiisstt 376 Indicates the font list to be used for the input 377 field and the list. If the value is NULL at ini- 378 tialization, it is initialized by looking up the 379 parent hierarchy of the widget for an ancestor that 380 is a subclass of XXmmBBuulllleettiinnBBooaarrdd, XXmmVVeennddoorrSShheellll or 381 XXmmMMeennuuSShheellll. If such an ancestor is found, it's 382 font list will be taken by the combo box widget. 383 384 XXmmNNiitteemmCCoouunntt 385 Specifies the total number of items in the list. 386 387 XXmmNNiitteemmss 388 Points to an array of compound strings representing 389 the items to be displayed in the list. By means of 390 this a program can find out what items the list 391 392 393 394Version 1.31 20 March 1995 6 395 396 397 398 399 400XmComboBox(3Xm) Harry's Motif Tools XmComboBox(3Xm) 401 402 403 contains. It is also possible to set the contents 404 of the list box in one step by setting this 405 resource to a new array of compound strings. Please 406 remember: always set XXmmNNiitteemmss and XXmmNNiitteemmCCoouunntt 407 together in the same call to XXttSSeettVVaalluueess or 408 XXttVVaaSSeettVVaalluueess. If you ignore this rule the combo 409 box will ignore you and your attempt to set these 410 resources. 411 412 XXmmNNllaabbeellIInnsseennssiittiivveePPiixxmmaapp 413 Specifies a pixmap used as the button face if XXmmNN-- 414 llaabbeellTTyyppee is set to XXmmPPIIXXMMAAPP and the combo box wid- 415 get is insensitive. 416 417 XXmmNNllaabbeellPPiixxmmaapp 418 Specifies a pixmap to be displayed to the left of 419 the input field if XXmmNNllaabbeellTTyyppee is XXmmPPIIXXMMAAPP and 420 XXmmNNsshhoowwLLaabbeell is True (of course). 421 422 XXmmNNllaabbeellSSttrriinngg 423 Specifies the the compound string to be displayed 424 if XXmmNNllaabbeellTTyyppee is set to XXmmSSTTRRIINNGG and XXmmNNsshhoowwLLaabbeell 425 is True. 426 427 XXmmNNllaabbeellTTyyppee 428 The type of label (either string or pixmap). Possi- 429 ble values are XXmmPPIIXXMMAAPP and XXmmSSTTRRIINNGG. 430 431 XXmmNNllaabbeellMMaarrggiinnTToopp,, XXmmNNllaabbeellMMaarrggiinnBBoottttoomm 432 XXmmNNllaabbeellMMaarrggiinnLLeefftt,, XXmmNNllaabbeellMMaarrggiinnRRiigghhtt 433 The amount of space between one side of the label 434 and the nearest margin. 435 436 XXmmNNllaabbeellMMaarrggiinnHHeeiigghhtt,, XXmmNNllaabbeellMMaarrggiinnWWiiddtthh 437 The spacing between one side of the label and the 438 nearest edge of a shadow. 439 440 XXmmNNlliissttMMaarrggiinnHHeeiigghhtt,, XXmmNNlliissttMMaarrggiinnWWiiddtthh 441 The height or width of the margin between the bor- 442 der of the list and the items in the list. 443 444 XXmmNNlliissttSSiizzeePPoolliiccyy 445 Controls the reaction of the list when an item 446 grows horizontally beyond the current width of the 447 list and XXmmNNssttaattiiccLLiisstt is set to TTrruuee. If set to 448 XXmmCCOONNSSTTAANNTT, the list does not grow, and a horizon- 449 tal scroll bar is shown. If this resource is set to 450 XXmmVVAARRIIAABBLLEE, the list instead trys to grow such that 451 it match the size of the longest item, thus no hor- 452 izontal scroll bar will appear. When XXmmNNlliisstt-- 453 SSiizzeePPoolliiccyy is the list will again try to grow but 454 in case the width of the longest item in the list 455 is wider than the viewing area of the list a hori- 456 zontal scroll bar appears. 457 458 459 460Version 1.31 20 March 1995 7 461 462 463 464 465 466XmComboBox(3Xm) Harry's Motif Tools XmComboBox(3Xm) 467 468 469 XXmmNNlliissttSSppaacciinngg 470 The spacing between items in the list. 471 472 XXmmNNmmaarrggiinnHHeeiigghhtt 473 Specifies the distance between the top and the bot- 474 tom of the widget window and the text displayed in 475 the input field. 476 477 XXmmNNmmaarrggiinnWWiiddtthh 478 Like XmNmarginHeight this resource specifies the 479 distance between the left and the right border of 480 the widget window and the text. 481 482 XXmmNNmmaaxxLLeennggtthh 483 Specifies the maximum length of the text string 484 that can be entered from the keyboard into the 485 input field of the combo box. Strings that are put 486 into the input field using XXmmCCoommbbooBBooxxSSeettSSttrriinngg 487 ignore this resource. 488 489 XXmmNNmmooddiiffyyVVeerriiffyyCCaallllbbaacckk 490 Contains a list of callbacks called before text is 491 deleted from or inserted into the text area of the 492 combo box widget. The callbacks are called only if 493 XXmmNNeeddiittaabbllee is set to TTrruuee. The reason is 494 XXmmCCRR__MMOODDIIFFYYIINNGG__TTEEXXTT__VVAALLUUEE and the type of the 495 structure passed to this callback is XXmmCCoommbbooBBooxx-- 496 TTeexxttVVeerriiffyyCCaallllbbaacckkSSttrruucctt. 497 498 XXmmNNmmoottiioonnVVeerriiffyyCCaallllbbaacckk 499 Specifies the list of callbacks that is called 500 before the insert cursor gets moved to another 501 position. The reason is XXmmCCRR__MMOOVVIINNGG__IINNSSEERRTT__CCUURRSSOORR 502 and the type of the structure whose address is 503 passed to the callback is XXmmCCoommbbooBBooxxTTeexxttVVeerriiffyyCCaallll-- 504 bbaacckk--SSttrruucctt. 505 506 XXmmNNssccrroollllBBaarrDDiissppllaayyPPoolliiccyy 507 Controls the display of the vertical scroll bar in 508 the list when XXmmNNssttaattiiccLLiisstt is set to TTrruuee..When 509 XXmmNNssccrroollllBBaarrDDiissppllaayyPPoolliiccyy is set to XXmmAASS__NNEEEEDDEEDD, 510 the vertical scroll bar is displayed only when the 511 list contains more items than can be currently dis- 512 played. If set to XXmmSSTTAATTIICC the vertical scroll bar 513 is always displayed. 514 515 XXmmNNppeerrssiisstteennttDDrrooppDDoowwnn 516 Welcome to the sad section in the life of X11 517 applications. This resource and the inherent prob- 518 lems are due to the focus policy of the window man- 519 ager you're using. See the further details in the 520 later sections. 521 522 523 524 525 526Version 1.31 20 March 1995 8 527 528 529 530 531 532XmComboBox(3Xm) Harry's Motif Tools XmComboBox(3Xm) 533 534 535 XXmmNNsseelleeccttiioonnCCaallllbbaacckk 536 Specifies a list of callbacks that is called when 537 an item is selected. The reason is 538 XXmmCCRR__SSIINNGGLLEE__SSEELLEECCTT. The callbacks are NOT called 539 when the user browses through the items in the 540 list. 541 542 XXmmNNsseelleeccttiioonnPPoolliiccyy 543 This resource controls whether the user can dese- 544 lect the currently selected item within a combo 545 box. The default value is XXmmBBRROOWWSSEE__SSEELLEECCTT, so 546 always one item gets selected if the combo box is 547 editable. In the case of XXmmSSIINNGGLLEE__SSEELLEECCTT the user 548 may deselect the current item either by clicking on 549 it in the drop down list or pressing the key 550 "Delete". Other values for XXmmNNsseelleeccttiioonnPPoolliiccyy are 551 currently not allowed. (Multiple selections will be 552 probably availabe with the next release.) 553 554 XXmmNNsseelleeccttTThhrreesshhoolldd 555 Specifies the amount of pixels the mouse must move 556 until the selection of text is recognized in click 557 and drag mode. 558 559 XXmmNNsshhoowwLLaabbeell 560 Specifies, whether a label containing text or a 561 pixmap should be displayed on the left side of the 562 combo box. This resource can only be specified dur- 563 ing the creation of the combo box, afterwards it 564 will have no effect. 565 566 XXmmNNssoorrtteedd 567 Specifies whether the items in the list are sorted 568 or not In an unsorted list, the items are shown in 569 the order in which they're put into the list. When 570 adding an item to a sorted list, this item will be 571 put at the right place (alphabetically sorted). 572 573 XXmmNNssoorrttiinnggCCaallllbbaacckk 574 Contains a list of callbacks that is called when- 575 ever a new item is added to the combo box widget 576 and XXmmNNssoorrtteedd is TTrruuee. The reason is XXmmCCRR__SSOORRTTIINNGG 577 and the type of the structure whose address is 578 passed to the callback is XXmmCCoommbbooBBooxxSSoorrttiinnggCCaallll-- 579 bbaacckk--SSttrruucctt. For detailed information see the fol- 580 lowing sections. 581 582 XXmmNNssqquuaarreeAArrrrooww 583 Controls the width of the arrow button in respect 584 to its height. If this resource is TTrruuee the arrow 585 button is always layed out square. Otherwise the 586 arrow button's width will be approximatly 4/5th of 587 its height. 588 589 590 591 592Version 1.31 20 March 1995 9 593 594 595 596 597 598XmComboBox(3Xm) Harry's Motif Tools XmComboBox(3Xm) 599 600 601 XXmmNNssttaattiiccLLiisstt 602 Controls whether the list is always statically dis- 603 played right below the text input area of the combo 604 box if set to TTrruuee. If you use a combo box with 605 XXmmNNssttaattiiccLLiisstt set to TTrruuee and XXmmNNeeddiittaabbllee set to 606 FFaallssee you should consider using a simple list wid- 607 get instead. 608 609 XXmmNNssttrriinnggDDiirreeccttiioonn 610 Specifies the initial direction to draw the string 611 (from the left to the right or in the opposite 612 direction). The whole story seems to be incompre- 613 hensible... therefore this resource is provided for 614 completeness only. 615 616 XXmmNNttwwmmHHaannddlliinnggOOnn 617 If you have trouble with the list then this 618 resource may help you. Set it to True, if the list 619 gets hidden at the moment the mouse cursor enters 620 the list. 621 622 XXmmNNttooppIItteemmPPoossiittiioonn 623 This resource is intended as an informal hint. It 624 specifies the index of the item which is displayed 625 at the visible top of the list. 626 627 XXmmNNvvaalluuee 628 Contains the text of the input field. This also 629 concerns combo boxes which are not editable ( 630 XXmmNNeeddiittaabbllee set to False). 631 632 XXmmNNuunnsseelleeccttiioonnCCaallllbbaacckk 633 Specifies a list of callbacks that is called when- 634 ever the currently selected item is deselected and 635 no other item gets selected. This callback is acti- 636 vated only when XXmmNNsseelleeccttiioonnPPoolliiccyy is XXmmSSIINN-- 637 GGLLEE__SSEELLEECCTT. The reason is XXmmCCRR__UUNNSSEELLEECCTT. The type 638 of the structure whose address is passed to this 639 callback is XXmmAAnnyyCCaallllbbaacckkSSttrruucctt. 640 641 XXmmNNvvaalluuee 642 Contains the text of the input field. This also 643 concerns combo boxes which are not editable ( 644 XXmmNNeeddiittaabbllee set to FFaallssee). 645 646 XXmmNNvvaalluueeCChhaannggeeddCCaallllbbaacckk 647 Specifies a list of callbacks to be called after 648 text is deleted from or inserted into the text area 649 of the combo box widget. The reason is 650 XXmmCCRR__VVAALLUUEE__CCHHAANNGGEEDD. The type of the structure 651 whose address is passed to this callback is XXmmAAnnyy-- 652 CCaallllbbaacckkSSttrruucctt. 653 654 655 656 657 658Version 1.31 20 March 1995 10 659 660 661 662 663 664XmComboBox(3Xm) Harry's Motif Tools XmComboBox(3Xm) 665 666 667 XXmmNNvviissiibblleeIItteemmCCoouunntt 668 Specifies the number of items that can fit in the 669 visible space of the list. The combo box uses this 670 value to determine the height of its list. 671 672 IInnhheerriitteedd RReessoouurrcceess 673 XmComboBox inherits behaviour and resources from the fol- 674 lowing superclasses. For a complete description of each 675 resource, refer to the man page for that superclass. 676 677 CCaallllbbaacckk IInnffoorrmmaattiioonn 678 A pointer to the following structure is passed to the 679 XXmmNNddrrooppDDoowwnnCCaallllbbaacckk callback: 680 681 ttyyppeeddeeff ssttrruucctt {{ 682 iinntt _r_e_a_s_o_n;; 683 XXEEvveenntt **_e_v_e_n_t;; 684 }} XXmmCCoommbbooBBooxxDDrrooppDDoowwnnCCaallllbbaacckkSSttrruucctt;; 685 686 _r_e_a_s_o_n Within this structure, _r_e_a_s_o_n indicates the 687 reason why the callback was activated. This 688 can be XXmmCCRR__SSHHOOWW__LLIISSTT as well as 689 XXmmCCRR__HHIIDDEE__LLIISSTT. A callback is called with 690 the reason XXmmCCRR__SSHHOOWW__LLIISSTT just before the 691 list is dropped down, whereas the callback 692 is called with XXmmCCRR__HHIIDDEE__LLIISSTT after the 693 list is hidden. 694 695 696 _e_v_e_n_t Points to the XXEEvveenntt, which triggered the 697 callback. May be NNUULLLL if the callback is 698 triggered by a call to XXmmCCoommbbooBBooxxSShhoowwLLiisstt 699 or XXmmCCoommbbooBBooxxHHiiddeeLLiisstt. 700 701 A pointer to the following structure is passed to the 702 XXmmNNaaccttiivvaatteeCCaallllbbaacckk callback: 703 704 ttyyppeeddeeff ssttrruucctt {{ 705 iinntt _r_e_a_s_o_n;; 706 XXEEvveenntt **_e_v_e_n_t;; 707 }} XXmmAAnnyyCCaallllbbaacckkSSttrruucctt;; 708 709 _r_e_a_s_o_n Indicates why the callback was invoked. 710 This is XXmmCCRR__AACCTTIIVVAATTEE for XXmmNNaaccttiivvaatteeCCaallll-- 711 bbaacckk. 712 713 _e_v_e_n_t Points to the XXEEvveenntt, which triggered the 714 callback. 715 716 A pointer to the following structure is passed to the 717 XXmmNNsseelleeccttiioonnCCaallllbbaacckk and XXmmNNddeeffaauullttAAccttiioonnCCaallllbbaacckk: 718 719 ttyyppeeddeeff ssttrruucctt {{ 720 iinntt _r_e_a_s_o_n;; 721 722 723 724Version 1.31 20 March 1995 11 725 726 727 728 729 730XmComboBox(3Xm) Harry's Motif Tools XmComboBox(3Xm) 731 732 733 XXEEvveenntt **_e_v_e_n_t;; 734 XXmmSSttrriinngg _v_a_l_u_e;; 735 iinntt _i_n_d_e_x;; 736 }} XXmmCCoommbbooBBooxxSSeelleeccttiioonnCCaallllbbaacckkSSttrruucctt,, XXmmCCoommbbooBBooxxDDeeffaauullttAAcc-- 737 ttiioonnCCaallllbbaacckkSSttrruucctt;; 738 739 _r_e_a_s_o_n Within this structure, _r_e_a_s_o_n indicates the 740 reason why the callback was activated. At 741 this time, the reason can be either 742 XXmmCCRR__SSIINNGGLLEE__SSEELLEECCTT or XXmmCCRR__BBRROOWWSSEE__SSEELLEECCTT 743 depending on the setting of XXmmNNsseelleeccttiioonn-- 744 PPoolliiccyy. It indicates that the user 745 selected a (potentially new) item in the 746 list. Whether this callback is activated 747 every time the user moves into a new item 748 of the list or only when the user releases 749 the mouse button is controlled through the 750 setting of XXmmNNaauuttoommaattiiccSSeelleeccttiioonn. 751 752 _e_v_e_n_t Points to the XXEEvveenntt, which triggered the 753 callback. 754 755 _v_a_l_u_e Points to a XXmmSSttrriinngg, which contains the 756 text of the current selected item. This 757 XXmmSSttrriinngg must never be freed or changed by 758 the called program code! 759 760 _i_n_d_e_x Index (starting from 1) of the currently 761 selected item in the list. 762 763 A pointer to the following structure is passed to the 764 XXmmNNuunnsseelleeccttiioonnCCaallllbbaacckk callback: 765 766 ttyyppeeddeeff ssttrruucctt {{ 767 iinntt _r_e_a_s_o_n;; 768 XXEEvveenntt **_e_v_e_n_t;; 769 }} XXmmCCoommbbooBBooxxUUnnsseelleeccttiioonnCCaallllbbaacckkSSttrruucctt;; 770 771 _r_e_a_s_o_n Indicates why the callback was invoked. 772 This is XXmmCCRR__UUNNSSEELLEECCTT. 773 774 _e_v_e_n_t Points to the XXEEvveenntt, which triggered the 775 callback. 776 777 A pointer to the following structure is passed to the 778 XXmmNNmmooddiiffyyVVeerriiffyyCCaallllbbaacckk and XXmmNNmmoottiioonnVVeerriiffyyCCaallllbbaacckk call- 779 backs: 780 781 ttyyppeeddeeff ssttrruucctt {{ 782 iinntt _r_e_a_s_o_n;; 783 XXEEvveenntt **_e_v_e_n_t;; 784 BBoooolleeaann _d_o_i_t;; 785 PPoossiittiioonn _c_u_r_r_I_n_s_e_r_t_, _n_e_w_I_n_s_e_r_t;; 786 PPoossiittiioonn _s_t_a_r_t_P_o_s_, _e_n_d_P_o_s;; 787 788 789 790Version 1.31 20 March 1995 12 791 792 793 794 795 796XmComboBox(3Xm) Harry's Motif Tools XmComboBox(3Xm) 797 798 799 XXmmTTeexxttBBlloocckk _t_e_x_t;; 800 }} XXmmCCoommbbooBBooxxTTeexxttVVeerriiffyyCCaallllbbaacckkSSttrruucctt,, **XXmmCCoommbbooBBooxxTTeexxttVVeerrii-- 801 ffyyPPttrr;; 802 803 _r_e_a_s_o_n Indicates the reason why the callback was 804 activated. This can be either 805 XXmmCCRR__MMOODDIIFFYYIINNGG__TTEEXXTT__VVAALLUUEE or 806 XXmmCCRR__MMOOVVIINNGG__IINNSSEERRTT__CCUURRSSOORR. 807 808 _e_v_e_n_t Points to the XXEEvveenntt, which triggered the 809 callback. 810 811 _d_o_i_t Indicates whether the offending action 812 should be performed. Setting this field of 813 the callback structure to FFaallssee denies the 814 action. 815 816 _c_u_r_r_I_n_s_e_r_t Specifies the current position of the 817 insert cursor. 818 819 Indicates the position at which the user 820 attempts to position the cursor. 821 822 _s_t_a_r_t_P_o_s Indicates the starting position of the text 823 to modify. If the reason is 824 XXmmCCRR__MMOOVVIINNGG__IINNSSEERRTT__CCUURRSSOORR this value is the 825 same as ccuurrrrIInnsseerrtt. 826 827 _e_n_d_P_o_s Specifies the ending position of the text 828 to modify. If no text is replaced or 829 deleted, then the value will be the same as 830 ssttaarrttPPooss. If the reason is 831 XXmmCCRR__MMOODDIIFFYYIINNGG__TTEEXXTT__VVAALLUUEE this value is the 832 same as _c_u_r_r_I_n_s_e_r_t. 833 834 _t_e_x_t Holds the address of a structure of type 835 XXmmTTeexxttBBlloocckkRReecc which holds the textual 836 information to be inserted. 837 838 The following table describes the reasons why the individ- 839 ual verification callback structure fields are valid. 840 841 RReeaassoonn VVaalliidd FFiieellddss 842 ----------------------------------------------------- 843 XXmmCCRR__MMOODDIIFFYYIINNGG__TTEEXXTT__VVAALLUUEE _r_e_a_s_o_n, _e_v_e_n_t, _d_o_i_t, 844 _s_t_a_r_t_P_o_s, _e_n_d_P_o_s, _t_e_x_t 845 846 XXmmCCRR__MMOOVVIINNGG__IINNSSEERRTT__CCUURRSSOORR _r_e_a_s_o_n, _e_v_e_n_t, _d_o_i_t, 847 _c_u_r_r_I_n_s_e_r_t, _n_e_w_I_n_s_e_r_t, 848 849 A pointer to the following structure is passed to the XXmmNN-- 850 ssoorrttiinnggCCaallllbbaacckk callback: ttyyppeeddeeff ssttrruucctt {{ 851 iinntt _r_e_a_s_o_n;; 852 XXEEvveenntt **_e_v_e_n_t;; 853 854 855 856Version 1.31 20 March 1995 13 857 858 859 860 861 862XmComboBox(3Xm) Harry's Motif Tools XmComboBox(3Xm) 863 864 865 iinntt _o_p_e_r_a_t_i_o_n;; 866 vvooiidd **_i_t_e_m___i_n_t_e_r_n_a_l;; 867 XXmmSSttrriinngg _i_t_e_m;; 868 iinntt _r_e_s_u_l_t;; 869 }} XXmmCCoommbbooBBooxxSSoorrttiinnggCCaallllbbaacckkSSttrruucctt,, **XXmmCCoommbbooBBooxxSSoorrttiinnggPPttrr;; 870 871 _r_e_a_s_o_n Indicates the reason why the callback was 872 activated. This is XXmmCCRR__SSOORRTTIINNGG. 873 874 _e_v_e_n_t Contains always NNUULLLL and is just there for 875 compatibility reasons. 876 877 _o_p_e_r_a_t_i_o_n Indicates the operation to carry out and 878 can be either XXmmOOPP__IINNIITT,XXmmOOPP__DDOONNEE or 879 XXmmOOPP__CCOOMMPPAARREE. 880 881 _i_t_e_m___i_n_t_e_r_n_a_l Must be set during the XXmmOOPP__IINNIITT operation 882 to a suitable representation of the new 883 item which is to be added to the list. In 884 all subsequent calls to this callback with 885 XXmmOOPP__CCOOMMPPAARREEorXXmmOOPP__DDOONNEE this field will 886 contain whatever you've put into it during 887 XXmmOOPP__IINNIITT. For detailed information refer 888 to the documentation "_T_h_e _C_o_m_b_o_B_o_x _W_i_d_g_e_t". 889 890 _i_t_e_m During XXmmOOPP__IINNIITT this field points to the 891 item to be added to the list. When sorting 892 the list ( XXmmOOPP__CCOOMMPPAARREE) the field contains 893 the address of an item in the list which 894 should be compared against the new item (as 895 remembered in _i_t_e_m___i_n_t_e_r_n_a_l). 896 897 _r_e_s_u_l_t When comparing an item (out of the list) in 898 _i_t_e_m with the new item (as remembered in 899 _i_t_e_m___i_n_t_e_r_n_a_l) the result has to be stored 900 into this structure's field. 901 902 The following table describes which individual callback 903 structure fields are valid during which operations. 904 905 RReeaassoonn VVaalliidd FFiieellddss 906 --------------------------------------------- 907 XXmmOOPP__IINNIITT _r_e_a_s_o_n, _e_v_e_n_t, _o_p_e_r_a_t_i_o_n, 908 _i_t_e_m, _i_t_e_m___i_n_t_e_r_n_a_l 909 XXmmOOPP__DDOONNEE _r_e_a_s_o_n, _e_v_e_n_t, _o_p_e_r_a_t_i_o_n, 910 _i_t_e_m___i_n_t_e_r_n_a_l 911 XXmmOOPP__CCOOMMPPAARREE _r_e_a_s_o_n, _e_v_e_n_t, _o_p_e_r_a_t_i_o_n, 912 _i_t_e_m, _i_t_e_m___i_n_t_e_r_n_a_l, _r_e_s_u_l_t 913 914 For more information about controlling the sorting order 915 see the acompanying documentation "_T_h_e _C_o_m_b_o_B_o_x _W_i_d_g_e_t". 916 917 CCoonnvveenniieennccee rroouuttiinneess 918 ComboBox has a number of convenience routines to control 919 920 921 922Version 1.31 20 March 1995 14 923 924 925 926 927 928XmComboBox(3Xm) Harry's Motif Tools XmComboBox(3Xm) 929 930 931 the behavior and contents of its children. 932 933 vvooiidd XXmmCCoommbbooBBooxxAAddddIItteemm((WWiiddggeett ww,, XXmmSSttrriinngg iitteemm,, iinntt ppooss)) 934 Add a new item to the list's contents. If XXmmNNssoorrtteedd 935 is set to True, the new item is inserted alphabeti- 936 cally. If the list is unsorted, the same assump- 937 tions can be applied as with XXmmLLiissttAAddddIItteemm. 938 939 940 vvooiidd XXmmCCoommbbooBBooxxAAddddIItteemmss((WWiiddggeett ww,, XXmmSSttrriinngg **iitteemmss,, 941 iinntt iitteemm__ccoouunntt,, iinntt ppooss)) 942 Similar to XXmmCCoommbbooBBooxxAAddddIItteemm. Also see XXmmLLiissttAAdd-- 943 ddIItteemmss. 944 945 946 vvooiidd XXmmCCoommbbooBBooxxAAddddIItteemmUUnnsseelleecctteedd((WWiiddggeett ww,, XXmmSSttrriinngg 947 iitteemm,, iinntt ppooss)) 948 See XXmmLLiissttAAddddIItteemmUUnnsseelleecctteedd. 949 950 951 vvooiidd XXmmCCoommbbooBBooxxCClleeaarrIItteemmSSeelleeccttiioonn((WWiiddggeett ww)) 952 Deselects all currently selected items when 953 XXmmNNsseelleeccttiioonnPPoolliiccyy is XXmmSSIINNGGLLEE__SSEELLEECCTT. 954 955 956 vvooiidd XXmmCCoommbbooBBooxxDDeelleetteeIItteemm((WWiiddggeett ww,, XXmmSSttrriinngg iitteemm)) 957 See XXmmLLiissttDDeelleetteeIItteemm. 958 959 960 vvooiidd XXmmCCoommbbooBBooxxDDeelleetteeIItteemmss((WWiiddggeett ww,, XXmmSSttrriinngg 961 **iitteemmss,, iinntt iitteemm__ccoouunntt)) 962 See XXmmLLiissttDDeelleetteeIItteemmss. 963 964 965 vvooiidd XXmmCCoommbbooBBooxxDDeelleetteePPooss((WWiiddggeett ww,, iinntt ppooss)) 966 See XXmmLLiissttDDeelleetteePPooss. 967 968 969 vvooiidd XXmmCCoommbbooBBooxxDDeelleetteeIItteemmssPPooss((WWiiddggeett ww,, iinntt iitteemm__ccoouunntt,, 970 iinntt ppooss)) 971 See XXmmLLiissttDDeelleetteeIItteemmssPPooss. 972 973 974 vvooiidd XXmmCCoommbbooBBooxxDDeelleetteeAAllllIItteemmss((WWiiddggeett ww)) 975 See XXmmLLiissttDDeelleetteeAAllllIItteemmss. 976 977 978 vvooiidd XXmmCCoommbbooBBooxxRReeppllaacceeIItteemmss((WWiiddggeett ww,, XXmmSSttrriinngg 979 **oolldd__iitteemmss,, iinntt iitteemm__ccoouunntt,, XXmmSSttrriinngg **nneeww__iitteemmss)) 980 See XXmmLLiissttRReeppllaacceeIItteemmss. 981 982 983 vvooiidd XXmmCCoommbbooBBooxxRReeppllaacceeIItteemmssPPooss((WWiiddggeett ww,, XXmmSSttrriinngg 984 **nneeww__iitteemmss,, iinntt iitteemm__ccoouunntt,, iinntt ppoossiittiioonn)) 985 986 987 988Version 1.31 20 March 1995 15 989 990 991 992 993 994XmComboBox(3Xm) Harry's Motif Tools XmComboBox(3Xm) 995 996 997 See XXmmLLiissttRReeppllaacceeIItteemmssPPooss. 998 999 1000 BBoooolleeaann XXmmCCoommbbooBBooxxIItteemmEExxiissttss((WWiiddggeett ww,, XXmmSSttrriinngg iitteemm)) 1001 See XXmmLLiissttIItteemmEExxiissttss. 1002 1003 1004 iinntt XXmmCCoommbbooBBooxxIItteemmPPooss((WWiiddggeett ww,, XXmmSSttrriinngg iitteemm)) 1005 See XXmmLLiissttIItteemmPPooss. 1006 1007 1008 BBoooolleeaann XXmmCCoommbbooBBooxxGGeettMMaattcchhPPooss((WWiiddggeett ww,, XXmmSSttrriinngg 1009 iitteemm,, iinntt ****ppooss__lliisstt,, iinntt **ppooss__ccoouunntt)) 1010 See XXmmLLiissttGGeettMMaattcchhPPooss. 1011 1012 1013 vvooiidd XXmmCCoommbbooBBooxxSSeelleeccttPPooss((WWiiddggeett ww,, iinntt ppooss,, BBoooolleeaann 1014 nnoottiiffyy)) 1015 See XXmmLLiissttSSeelleeccttPPooss. 1016 1017 1018 vvooiidd XXmmCCoommbbooBBooxxSSeelleeccttIItteemm((WWiiddggeett ww,, XXmmSSttrriinngg iitteemm,, 1019 BBoooolleeaann nnoottiiffyy)) 1020 See XXmmLLiissttSSeelleeccttIItteemm. 1021 1022 1023 iinntt XXmmCCoommbbooBBooxxGGeettSSeelleecctteeddPPooss((WWiiddggeett ww)) 1024 This function differs from XXmmLLiissttGGeettSSeelleecctteeddPPooss. 1025 The list in a combo box can contain only one 1026 selected item. Therefore this function returns the 1027 index of the selected item in the list or zero, if 1028 none is currently selected. 1029 1030 1031 vvooiidd XXmmCCoommbbooBBooxxCClleeaarrSSeelleeccttiioonn((WWiiddggeett ww,, TTiimmee ttiimmee)) 1032 See XXmmTTeexxttFFiieellddCClleeaarrSSeelleeccttiioonn. 1033 1034 1035 BBoooolleeaann XXmmCCoommbbooBBooxxCCooppyy((WWiiddggeett ww,, TTiimmee ttiimmee)) 1036 See XXmmTTeexxttFFiieellddCCooppyy. 1037 1038 1039 BBoooolleeaann XXmmCCoommbbooBBooxxCCuutt((WWiiddggeett ww,, TTiimmee ttiimmee)) 1040 See XXmmTTeexxttFFiieellddCCuutt. 1041 1042 1043 XXmmTTeexxttPPoossiittiioonn XXmmCCoommbbooBBooxxGGeettIInnsseerrttiioonnPPoossiittiioonn((WWiiddggeett ww)) 1044 See XXmmTTeexxttFFiieellddGGeettIInnsseerrttiioonnPPoossiittiioonn. 1045 1046 1047 XXmmTTeexxttPPoossiittiioonn XXmmCCoommbbooBBooxxGGeettLLaassttPPoossiittiioonn((WWiiddggeett ww)) 1048 See XXmmTTeexxttFFiieellddGGeettLLaassttPPoossiittiioonn. 1049 1050 1051 1052 1053 1054Version 1.31 20 March 1995 16 1055 1056 1057 1058 1059 1060XmComboBox(3Xm) Harry's Motif Tools XmComboBox(3Xm) 1061 1062 1063 iinntt XXmmCCoommbbooBBooxxGGeettMMaaxxLLeennggtthh((WWiiddggeett ww)) 1064 See XXmmTTeexxttFFiieellddGGeettMMaaxxLLeennggtthh. 1065 1066 1067 cchhaarr **XXmmCCoommbbooBBooxxGGeettSSeelleeccttiioonn((WWiiddggeett ww)) 1068 See XXmmTTeexxttFFiieellddGGeettSSeelleeccttiioonn. 1069 1070 1071 BBoooolleeaann XXmmCCoommbbooBBooxxGGeettSSeelleeccttiioonnPPoossiittiioonn((WWiiddggeett ww,, 1072 XXmmTTeexxttPPoossiittiioonn **lleefftt,, XXmmTTeexxttPPoossiittiioonn **rriigghhtt)) 1073 See XXmmTTeexxttFFiieellddGGeettSSeelleeccttiioonnPPoossiittiioonn. 1074 1075 1076 cchhaarr **XXmmCCoommbbooBBooxxGGeettSSttrriinngg((WWiiddggeett ww)) 1077 See XXmmTTeexxttFFiieellddGGeettSSttrriinngg. 1078 1079 1080 vvooiidd XXmmCCoommbbooBBooxxIInnsseerrtt((WWiiddggeett ww,, XXmmTTeexxttPPoossiittiioonn 1081 ppoossiittiioonn,, cchhaarr **vvaalluuee)) 1082 See XXmmTTeexxttFFiieellddIInnsseerrtt. 1083 1084 1085 BBoooolleeaann XXmmCCoommbbooBBooxxPPaassttee((WWiiddggeett ww)) 1086 See XXmmTTeexxttFFiieellddPPaassttee. 1087 1088 1089 BBoooolleeaann XXmmCCoommbbooBBooxxRReemmoovvee((WWiiddggeett ww)) 1090 See XXmmTTeexxttFFiieellddRReemmoovvee. 1091 1092 1093 vvooiidd XXmmCCoommbbooBBooxxRReeppllaaccee((WWiiddggeett ww,, XXmmTTeexxttPPoossiittiioonn 1094 ffrroomm__ppooss,, XXmmTTeexxttPPoossiittiioonn ttoo__ppooss,, cchhaarr **vvaalluuee)) 1095 See XXmmTTeexxttFFiieellddRReeppllaaccee. 1096 1097 1098 vvooiidd XXmmCCoommbbooBBooxxSSeettAAddddMMooddee((WWiiddggeett ww,, BBoooolleeaann ssttaattee)) 1099 See XXmmTTeexxttFFiieellddSSeettAAddddMMooddee. 1100 1101 1102 vvooiidd XXmmCCoommbbooBBooxxSSeettHHiigghhlliigghhtt((WWiiddggeett ww,, XXmmTTeexxttPPoossiittiioonn 1103 lleefftt,, XXmmTTeexxttPPoossiittiioonn rriigghhtt,, XXmmHHiigghhlliigghhttMMooddee mmooddee)) 1104 See XXmmTTeexxttFFiieellddSSeettHHiigghhlliigghhtt. 1105 1106 1107 vvooiidd XXmmCCoommbbooBBooxxSSeettIInnsseerrttiioonnPPoossiittiioonn((WWiiddggeett ww,, 1108 XXmmTTeexxttPPoossiittiioonn ppoossiittiioonn)) 1109 See XXmmTTeexxttFFiieellddSSeettIInnsseerrttiioonnPPoossiittiioonn. 1110 1111 1112 vvooiidd XXmmCCoommbbooBBooxxSSeettMMaaxxLLeennggtthh((WWiiddggeett ww,, iinntt mmaaxx__lleennggtthh)) 1113 See XXmmTTeexxttFFiieellddSSeettMMaaxxLLeennggtthh. 1114 1115 1116 1117 1118 1119 1120Version 1.31 20 March 1995 17 1121 1122 1123 1124 1125 1126XmComboBox(3Xm) Harry's Motif Tools XmComboBox(3Xm) 1127 1128 1129 vvooiidd XXmmCCoommbbooBBooxxSSeettSSeelleeccttiioonn((WWiiddggeett ww,, XXmmTTeexxttPPoossiittiioonn 1130 ffiirrsstt,, XXmmTTeexxttPPoossiittiioonn llaasstt,, TTiimmee ttiimmee)) 1131 See XXmmTTeexxttFFiieellddSSeettSSeelleeccttiioonn. 1132 1133 1134 vvooiidd XXmmCCoommbbooBBooxxSSeettSSttrriinngg((WWiiddggeett ww,, cchhaarr **vvaalluuee)) 1135 At least Motif 1.1 contains a very anoying bug. If 1136 you try to set the contents of an XmTextField to an 1137 empty string (""), you'll get garbage, when asking 1138 the XmTextField for its contents afterwards. This 1139 interface function provides a work around. Also see 1140 XXmmTTeexxttFFiieellddSSeettSSttrriinngg. 1141 1142 1143 vvooiidd XXmmCCoommbbooBBooxxSShhoowwPPoossiittiioonn((WWiiddggeett ww,, XXmmTTeexxttPPoossiittiioonn ppoossii-- 1144 ttiioonn)) 1145 See XXmmTTeexxttFFiieellddSShhoowwPPoossiittiioonn. 1146 1147 1148 TThhee DDiisslliikkeedd KKeeyybbooaarrdd FFooccuuss 1149 Now I'll annotate a somewhat tricky subject. If the 1150 resource XXmmNNppeerrssiisstteennttDDrrooppDDoowwnn defaults to its initial 1151 value of FFaallssee, one can observe the following effect (this 1152 may be annoying). 1153 1154 When the user drops down the list and then moves the mouse 1155 cursor out of the window where the combo box resides in, 1156 the list will be hidden. This is because the widget lost 1157 the keyboard focus. Some users are irritated because they 1158 didn't expect that behavior, because they just moved the 1159 mouse to get it out of the way. If your window manager's 1160 focus policy is "pointer focus", i.e. if you move the 1161 pointer into another window, that window will automati- 1162 cally get the keyboard focus. On the other hand, if your 1163 window manager's focus policy is "explicit", you have to 1164 move the pointer into another window and click a mouse 1165 button to give that window the keyboard focus. This is 1166 often referred to as the "click-to-type" method. In 1167 "explicit" mode, you will never see the list's annoying 1168 behavior. 1169 1170 To bypass this behavior on some window managers a really 1171 dirty hack was used. The user can activate that hack, if 1172 he sets XXmmNNppeerrssiisstteennttDDrrooppDDoowwnn to TTrruuee in the application's 1173 resources. Sorry, on some window managers this will not 1174 fix the annoying behavior. 1175 1176 Try it if you like - but don't complain at me if it 1177 doesn't work as expected. But at least it worked on the 1178 author's machine: a cute little SGI Indigo running 4dwm as 1179 the window manager. 1180 1181 On some other window managers like twm you will face 1182 another problem: the list gets hidden as soon as the mouse 1183 1184 1185 1186Version 1.31 20 March 1995 18 1187 1188 1189 1190 1191 1192XmComboBox(3Xm) Harry's Motif Tools XmComboBox(3Xm) 1193 1194 1195 cursor enters the list. Try to set XXmmNNttwwmmHHaannddlliinnggOOnn to 1196 TTrruuee. This resource will also work with other window man- 1197 agers. 1198 1199 1200 CCrreeaattiinngg aa CCoommbbooBBooxx 1201 Using the combo box in your own programs is easy. Just 1202 create the widget with one of the innumerable X toolkit 1203 functions (like XXttCCrreeaatteeMMaannaaggeeddWWiiddggeett or XXttVVaaCCrreeaatteeMMaann-- 1204 aaggeeddWWiiddggeett). 1205 1206 1207 Specify as the widget class xmComboBoxWidgetClass - that's 1208 all. There is also a so-called creation convenience func- 1209 tion called XXmmCCrreeaatteeCCoommbbooBBooxx, but it isn't really needed. 1210 1211 WWiiddggeett XXmmCCrreeaatteeCCoommbbooBBooxx((_p_a_r_e_n_t_, _n_a_m_e_, _a_r_g_l_i_s_t_, _a_r_g_c_o_u_n_t)) 1212 WWiiddggeett _p_a_r_e_n_t; 1213 SSttrriinngg _n_a_m_e; 1214 AArrggLLiisstt _a_r_g_l_i_s_t; 1215 CCaarrddiinnaall _a_r_g_c_o_u_n_t; 1216 1217 Somewhere in your program you'll need something like the 1218 following code fragment: 1219 1220 1221 Widget ComboBox; 1222 1223 ComboBox = XtVaCreateManagedWidget("combobox", 1224 xmComboBoxWidgetClass, Parent, 1225 XmNeditable, True or False, 1226 other Resources... 1227 NULL); 1228 1229 1230 Setting the resource XXmmNNeeddiittaabbllee is not absolutely neces- 1231 sary, but it's better to do so. 1232 1233 After creation, items can be added to the combo box's list 1234 by means of interface functions like XXmmCCoommbbooBBooxxAAdd-- 1235 ddIItteemm((......)). Which item the user selected can be deter- 1236 mined by calling XXmmCCoommbbooBBooxxGGeettSSttrriinngg((......)). 1237 1238 1239 If you want to preselect an item (that is setting a 1240 default item to the input field of the combo box) you can 1241 use several convenience functions. On a combo box with a 1242 non editable input field there are two ways to select an 1243 item: 1244 1245 1246 XmComboBoxSelectPos(ComboBox, item #, False); 1247 1248 or: 1249 1250 1251 1252Version 1.31 20 March 1995 19 1253 1254 1255 1256 1257 1258XmComboBox(3Xm) Harry's Motif Tools XmComboBox(3Xm) 1259 1260 1261 XmComboBoxSelectItem(ComboBox, itemString, False); 1262 1263 The third parameter in these two function calls indicates 1264 whether the XXmmNNsseelleeccttiioonnCCaallllbbaacckk should be called. The 1265 only difference between these functions is the first one 1266 is expecting an item number whereas the second one expects 1267 a XmString. The list is then searched for this string and 1268 if it is found the input field will be updated. 1269 1270 On a combo box with XXmmNNeeddiittaabbllee set to TTrruuee use another 1271 function: 1272 1273 XmComboBoxSetString(ComboBox, string); 1274 1275 This sets the contents of the text input field to string. 1276 1277 1278 1279BBUUGGSS 1280 Not more than currently available in Motif 1.2.3 or Motif 1281 1.2.4, but less than in the upcomming Motif 2.0. Report 1282 bugs to albrecht@igpm.rwth-aachen.de. Include a thoroughly 1283 description, and say which version of the ComboBox widget 1284 you are using. 1285 1286 1287 1288CCOOPPYYRRIIGGHHTT 1289 Copyright 1993, 1994 Harald Albrecht. 1290 1291 The ComboBox widget is free software; you can redistribute 1292 it and/or modify it under the terms of the GNU General 1293 Public License as published by the Free Software Founda- 1294 tion; either version 2, or (at your option) any later ver- 1295 sion. 1296 1297 1298 1299AAVVAAIILLAABBIILLIITTYY 1300 The most recent released version of the ComboBox widget is 1301 always available for anonymous ftp from either 1302 1303 ftp.x.org (198.112.44.100) 1304 /contrib/widgets/motif/ComboBox 1305 1306 or from 1307 1308 ftp.informatik.rwth-aachen.de (137.226.112.172) 1309 /pub/packages/ComboBox 1310 1311 1312 1313AAUUTTHHOORR 1314 Author of Software & Documentation: 1315 1316 1317 1318Version 1.31 20 March 1995 20 1319 1320 1321 1322 1323 1324XmComboBox(3Xm) Harry's Motif Tools XmComboBox(3Xm) 1325 1326 1327 Harald Albrecht 1328 Institut fuer Geometrie und Praktische Mathematik 1329 RWTH Aachen, Bundesrepublik Deutschland 1330 e-mail: albrecht@igpm.rwth-aachen.de 1331 1332 English Documentation: 1333 Chris Marotz 1334 Sterling Software ITD 1335 e-mail: marotz@itd.sterling.com 1336 1337 1338 1339RREELLAATTEEDD IINNFFOORRMMAATTIIOONN 1340 "_T_h_e _C_o_m_b_o_B_o_x _W_i_d_g_e_t" documentation 1341 CCoorree((33XX)), XXmmCCoommppoossiittee((33XX)), XXmmLLiisstt((33XX)), XXmmTTeexxttFFiieelldd((33XX)) 1342 _D_o_u_g_l_a_s _A_d_a_m_s_: _T_h_e _H_i_t_c_h_h_i_k_e_r_'_s _G_u_i_d_e _t_o _t_h_e _G_a_l_a_x_y_. 1343 ffiillee::////113344..113300..116611..3300//aarrcc//ppuubb//uunniixx//hhttmmll//mmoottiiffccoorrnneerr..hhttmmll 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384Version 1.31 20 March 1995 21 1385 1386 1387