ELF              ̙  4   t     4    (                  $ $          $ 4 4 G	 K	           l  |  | x   x             '  >            k  B           ;       Q                         u   @     ]                   v   o         M  h         o             H               $          .   E          m  t      N  3  b              S   O       X     !  7          v          d       r      1                                      4   F  6   l  ~   i        u  j   Y   x       s           ]            A     =           c      ;  E      ~  j  \            H  %  Z  W  _            3   "   =  y  V   t   S             f            R              C                                                   n          z      k      d         6  U   w         '   Q  -                  @     K      K     T  <              e                          4      [          J          c                             #                 	   8       |                   \  T                      Y  F                               I  B   J  
      ^   (  .          :              P                    `               q                                             W      M                 9  /      ,  L  q     -  e  p                                                      f      L       G                w     "        &                           *                      *       ?  <   
                                                          %           a      7           {                   `                        _   &         D                        s                +                                              	         >             z                            2   0                                1                                        D       h                     }         )  U          G                 O  P   9           i               x                           $                      5  I                 ^  p                                                  :   m   A      N              a               /                 C      }      n      g       8                +               ,                                         |  ?            2                      0  !                  V                         [           b                                (               X   R                   5   l                           y   )              r   {             g                  #                                   Z                       |      
   v                      /   Ѕ        5         
 ;     p    	 K          	 ^   8      	 p         	                                                >    	          	    ܛ  G   	      u    	      M    	                   *    	     e    	 1             C        	 ^             h             v  t  %   	                p  t   	     y   	         	     '    	   D  '    	 	    '    	        	 ,  x      	 ;             G        	 \             j             w  `  k    	         	                      	     V    	         	   8  X    	                p      	 
                                       %    i    	 ?    I   	 S             f             z                              ]   	                                                                                            '    	   	 ;    (    	 H  8     	 T             j             z  н      	                                                             	                d  K   	                           
       	         	 0  x     	 D    h    	 Q       	 b             m             }                                  	        	   d  (    	                                                                               &  X  5    	 <             O       	 e             w        	                             P      	                $  `    	                  `    	                  `    	               /  D  d    	 B             O        	 a       	 t  L!    	   = 4    	       	         	   ,r    	       	   u    	    a   	       	   7        7        7        7      (  7      7             J             Q             `             o  ܚ ^    	                4V                     O        lD D        '    	   L D     	  DN D     #	  H D     5	             E	  l     	 V	    D    	 i	  l  =    	 x	             	             	        	 	        	 	  ,  >    	 	             	             	             	             	  0      	 	  L  g    	 
        	 *
    2    	 <
    1    	 M
  (      	 `
        	 s
    o    	 
    e    	 
        	 
        	 
    V    	 
        	 
    x    	 
  $      	 	               d  r    	 /    t    	 F  L     	 Z             f  X  .   	 {               l  *    	     *    	     -    	     *    	                \     	 
     t    	                      	 +    /    	 ?  ܹ     	 S        	 g                 v    	                                                                                              ?          )    	 *    9    	 A             V             h    v    	 w                                                                                                            d    	    9    	 &   )    	 9   5    	 J  $      	 X  D      	 o  d &    	    F    	       	   
    	                              O    	   < O    	       	    @      /       	 B       	 T   b    	 l             {  H                     ,!      	   0' 2   	                 k    	   | /    	         	   x ;    	 )  @ ;    	 ?   I    	 T             c             s             }                            p* T    	                                                                    d(     	                           $             8  << |    	 P  < }    	 n  8= {    	   _    	   E Y    	   `? c    	   0O a    	   R V    	   R t   	   P    	   tP S    	   Li    	 .  Q     	 A  Q     	 V             g  lx     	 r  y    	   z     	   z     	   d{    	                                                                                                                                                %       	 ;             C             N   Y    	 ^  h .   	 s   U    	                 h    	                 2    	     w    	                                                     ,             <             H             N             Y             e   D    	 x               p Y    	    d    	   0 :    	    :    	   p	    	   ( F    	    E    	    I    	    -    	 5   0    	 D   E    	 V  8 E    	 g       	 z  \      	   T     	       	                                                       о    	    $   	 +  ,     	 B  D ?   	 Y   \   	 n       	       	   X     	    k    	    N   	        	       	                             x W    	 /       	 B  P	     	 V             \             c             x                    	                i     	   [ r    	    a :    	    m :    	    ] :    	   c :    	   XF e    	   H     	 -  : I    	 B  & ^   	 Q  ; 4    	 l  8    	   G C    	   G Y    	   |j _    	   l     	   : =    	                j    	                           $             2             ?             M             ^             m             ~                                                                                                                       < P    	        	                           !             (        /  |      6  |      B  P       _DYNAMIC _GLOBAL_OFFSET_TABLE_ __gmon_start__ _init _fini TixGetHashTable TixSaveInterpState Tix_GlobalVarEval TixRestoreInterpState Tcl_ResetResult Tcl_AppendResult malloc tixStrDup Tix_SimpleListInit Tix_ClassCmd Tix_ArgcError TixItclSetGlobalNameSp free Tix_SimpleListAppend Tix_UninitializedClassCmd Tcl_CreateCommand TixItclRestoreGlobalNameSp __ctype_b Tcl_SplitList Tix_FindConfigSpecByName Tcl_SetVar2 Tix_CreateWidgetCmd Tix_CreateInstanceCmd Tix_SimpleListIteratorInit Tix_SimpleListStart Tix_SimpleListDelete Tix_SimpleListNext Tix_InstanceCmd Tix_CallMethod Tcl_GetVar2 Tix_CallConfigMethod Tcl_SetResult Tcl_Preserve Tix_FindPublicMethod Tix_UnknownPublicMethodError strncmp Tix_QueryAllOptions Tix_QueryOneOption Tix_ChangeOptions Tix_GetVar sprintf Tix_EvalArgv Tcl_Release strcmp realloc Tix_GetConfigSpecFullName Tix_ChangeOneOption Tcl_FirstHashEntry Tcl_DeleteHashEntry Tcl_NextHashEntry Tcl_DeleteHashTable Tix_DoWhenIdleCmd Tcl_InitHashTable Tk_MainWindow Tk_NameToWindow Tcl_Merge Tk_DeleteEventHandler Tk_CreateEventHandler Tcl_DoWhenIdle Tix_DoWhenMappedCmd Tix_FalseCmd Tix_FileCmd Tcl_TranslateFileName Tcl_DStringFree Tix_Get3DBorderCmd Tk_GetUid Tk_GetColor Tcl_AppendElement Tk_FreeColor Tix_GetBooleanCmd Tcl_GetBoolean Tix_GetIntCmd Tcl_GetInt Tcl_GetDouble Tix_HandleOptionsCmd Tix_ParentWindow TixpSetWindowParent Tix_StrEqCmd Tix_StringSubCmd Tcl_GetVar Tcl_DStringInit Tcl_DStringAppend Tcl_SetVar Tix_TmpLineCmd TixpDrawTmpLine Tix_TrueCmd Tcl_CancelIdleCall Tcl_GlobalEval Tcl_AddErrorInfo Tcl_BackgroundError Tk_GetColorByValue strcpy Tix_ValueMissingError Tcl_EventuallyFree Tix_ManageGeometryCmd Tk_ManageGeometry Tix_GeometryRequestCmd Tk_GetPixels Tk_GeometryRequest Tix_MoveResizeWindowCmd Tk_MoveResizeWindow Tix_MapWindowCmd Tk_MapWindow Tix_FlushXCmd XFlush Tix_UnmapWindowCmd Tk_UnmapWindow Tix_RaiseWindowCmd XRaiseWindow Tix_CallMethodCmd Tix_ChainMethodCmd Tix_ItemStyleCmd Tix_FormCmd Tix_HListCmd Tix_GetMethodCmd Tix_InputOnlyCmd Tix_MwmCmd Tix_NoteBookFrameCmd Tix_TListCmd Tix_GridCmd tixNormalUid tixCellUid tixRowUid tixColumnUid tixDisabledUid Tk_ConfigureWidget getenv Tk_FreeOptions Tcl_PkgRequire TixMwmProtocolHandler Tk_CreateGenericHandler tixPixmapImageType Tk_CreateImageType tixCompoundImageType tix_ImageTextItemType Tix_AddDItemType tix_TextItemType tix_WindowItemType tix_ImageItemType Tk_DefineBitmap Tix_DefinePixmap Tix_CreateCommands TixLoadLibrary _IO_stderr_ fprintf Tix_Init TixInitSam Tix_SafeInit Tcl_Eval Tcl_CreateNamespace Tcl_PushCallFrame Tcl_PopCallFrame Tix_LinkListInit Tix_LinkListAppend Tix_LinkListIteratorInit Tix_LinkListStart Tix_LinkListNext Tix_LinkListDelete Tix_LinkListInsert Tix_LinkListFindAndDelete Tix_LinkListFind Tix_LinkListDeleteRange Tix_FindMethod Tix_GetContext Tix_SuperClass Tix_GetMethodFullName Tix_ExistMethod Tcl_GetCommandInfo Tix_InitScrollInfo Tix_GetScrollFractions Tix_UpdateScrollBar Tcl_VarEval Tix_SetScrollBarView Tk_GetScrollInfo Tix_SimpleListInsert Tix_SimpleListFindAndDelete Tix_SimpleListDeleteRange Tix_SimpleListFind Tcl_UnsetVar2 Tix_HandleSubCmds Tix_Exit exit Tix_LoadTclLibrary Tix_DrawAnchorLines TixpDrawAnchorLines Tix_CreateSubWindow Tk_CreateWindowFromPath Tix_GetRenderBuffer Tk_CreateErrorHandler Tk_GetPixmap XSync Tk_DeleteErrorHandler Tcl_GetAssocData Tcl_SetAssocData Tcl_CallWhenDeleted tixConfigRelief Tix_SetRcFileName TixComputeTextGeometry Tk_ComputeTextLayout Tk_FreeTextLayout TixDisplayText Tk_DrawTextLayout Tk_UnderlineTextLayout Tcl_DStringAppendElement Tk_DestroyWindow Tcl_DeleteCommand Tcl_UnsetVar Tcl_DoOneEvent Tk_GetOption Tix_GetDItemType Tix_DItemCreate Tix_DItemConfigure Tix_DItemDisplay Tix_DItemFree Tix_DItemCalculateSize Tix_DItemComponent Tix_FreeArgumentList Tix_SplitConfig Tix_MultiConfigureInfo Tk_ConfigureInfo Tk_ConfigureValue Tix_ConfigureValue2 Tix_ConfigureInfo2 Tix_WidgetConfigure2 tixConfigItemType TixGetColorDItemGC TixDItemGetAnchor Tix_DItemDrawBackground XFillRectangle tixConfigItemStyle Tk_FreeImage TixDItemStyleFree TixGetDefaultDItemStyle Tk_GetImage TixpStartSubRegionDraw TixpSubRegFillRectangle TixpSubRegDrawImage TixpSubRegDrawBitmap TixpSubRegDisplayText TixpEndSubRegionDraw Tk_SizeOfImage Tk_SizeOfBitmap Tk_FontId Tk_GetGC Tk_FreeGC TixDItemStyleChanged Tk_FreeFont Tk_NameOfFont Tk_GetFont Tk_NameOfColor Tcl_GetCommandName Tix_SetDefaultStyleTemplate panic Tk_UnmaintainGeometry Tk_MaintainGeometry Tix_SetWindowItemSerial Tix_UnmapInvisibleWindowItems Tix_WindowItemListRemove TixFm_Info TixFm_FindClientPtrByName TixFm_ForgetOneClient TixFm_StructureProc TixFm_Unlink TixFm_GetFormInfo TixFm_UnlinkFromMaster TixFm_AddToMaster TixFm_Configure TixFm_DeleteMaster TixFm_FreeMasterInfo Tk_3DBorderColor AddNewLine AddNewBitmap AddNewImage AddNewSpace AddNewText Tk_NameOfImage Tk_ImageChanged Tk_Fill3DRectangle Tk_RedrawImage XCopyPlane Tk_DeleteImage open Tcl_PosixError __fxstat read close TixpXpmAllocTmpBuffer strncpy strcasecmp TixpXpmSetPixel TixpXpmRealizePixmap TixpXpmFreeTmpBuffer Tk_FreePixmap TixpXpmFreeInstanceData Tk_MakeWindowExist TixpInitPixmapInstance TixpXpmDisplay Tk_IdToWindow Tk_InternAtom TkWmProtocolEventProc XGetWindowProperty XChangeProperty XRootWindow XFree XQueryTree Tk_SetClass TixGridDataSetInit Tk_SetBackgroundFromBorder Tix_GrDoWhenIdle Tix_GrFormat Tix_GrSelection Tix_GrSetSize Tix_GrSort Tix_GrCancelDoWhenIdle TixGrDataFirstRow TixGrDataFirstCell TixGridDataDeleteSearchedEntry Tix_GrFreeElem TixGrDataNextCell TixGrDataNextRow TixGridDataSetFree Tix_GrFreeUnusedColors TixGridDataGetGridSize TixGridDataGetRowColSize XCopyArea Tk_Draw3DRectangle Tk_3DBorderGC Tk_DrawFocusHighlight Tix_GrGetElementPosn TixGridDataGetIndex TixGridDataDeleteEntry TixGridDataDeleteRange TixGridDataMoveRange Tix_GrAddChangedRect Tix_GrScrollPage TixGridDataCreateEntry TixGridDataFindEntry TixGridDataUpdateSort TixGridDataConfigRowColSize Tix_GrConfigSize XDrawLine Tk_Free3DBorder Tix_GrGetCellText Tix_GrGetSortItems Tix_GrFreeSortItems qsort printf Tcl_DStringSetLength __strtol_internal Tix_GetChars __strtod_internal Tix_HLCreateHeaders Tix_HLAllocColumn Tix_HLColumn Tix_HLHeader Tix_HLItem Tix_HLIndicator Tix_HLFindElement Tix_HLMarkElementDirty Tix_HLResizeWhenIdle Tix_HLItemInfo Tix_HLCancelResizeWhenIdle Tix_HLComputeGeometry Tix_HLElementLeftOffset Tix_HLElementTopOffset Tix_HLFreeHeaders Tix_HLComputeHeaderGeometry Tix_HLResizeNow strrchr Tix_HLDrawHeader XLowerWindow XDrawRectangle XCreateWindow Tk_GetBitmap Tk_FreeBitmap Tk_Fill3DPolygon XSetClipOrigin Tk_Draw3DPolygon Tk_GetRootCoords XCreateGC XFreeGC XDrawPoints XSetClipRectangles XCreateImage XDestroyImage XPutPixel XPutImage Tixsam_Init Tixsam_SafeInit ___brk_addr __environ atexit _etext _edata __bss_start _end  4    4    4    4    4    4    4    4 s  4     5 t  5    5   5    5 u  5    5 9  5     5 A  $5    (5 B  ,5    05 C  45    85 m  <5    @5 v  D5    H5 w  L5    P5 u  T5    X5 f  \5    `5 F  d5    h5 K  l5    p5 M  t5    x5 x  |5    5 P  5    5 y  5    5 d  5    5 k  5    5 i  5    5 z  5    5 {  5    5 q  5    5 T  5    5 S  5    5 Y  5    5 [  5    5 o  5    5   5    5 9  5    5 |  5     6 }  6    6    6    6    06    46    86    <6    P6    T6    X6    \6    p6    t6    x6    |6    6    6    6    6    6    6    6    6    6    6    6    6    X7    \7    `7    d7    h7    l7    p7    t7    x7    |7    7    7    7    7    7    7    7    d8    h8    l8    p8    t8    x8    |8    8    8    8    8    8    8    8    8    8    8    8    8    8    8    8    8    8    8    8    8    8    8    8    8    8    9     :    :    :    :    :    :    :    :     :    $:    (:    ,:    0:    4:    8:    <:    @:    D:    H:    L:    P:    T:    X:    \:    `:    d:    h:    l:    p:    t:    x:    |:    :    :    :    :    :    :    :    :    :    :    :    :    :    :    :     ;    ;    ;    ;    ;    ;    ;    ;     ;    $;    (;    ,;    0;    ;    ;    ;    ;    ;    ;    ;    ;    ;    ;    ;    ;    ;    ;    ;    ;    ;    ;    ;     <    <    <    <    <    <    <    <     <    $<    (<    ,<    0<    4<    8<    <<    @<    D<    p<    t<    x<    |<    <    <    <    <    <    <    <    <    <    <    <    <    <    <    <    <    <    <    <    <    <    <    <    <    =    =    =    =    =    =     =    $=    (=    ,=    0=    4=    8=    =    =    =    =    =    =    =    =    =    =    =    =    =    =    =    =     >    $>    (>    ,>    0>    4>    8>    <>    @>    D>    H>    L>    P>    T>    X>    \>    |>    >    >    >    >    >    >    >    >    >    >    >    >    >    >    >    >    >    >    >    >    >    >    >    >    >    >    >    >    >    >    >    >     ?    ?    ?    ?    ?    ?     @    @    @    @    @    @    0@    4@    8@    <@    P@    T@    X@    \@    h@   p@    t@    x@    |@    @    @    @    @    @    @    @    @    @   @    @    @    @    @    @    @    @    0A    4A    8A    <A    PA    TA    pA    tA    A    A    A    A    A    A    A    A    A    A    A    A    A    A    A    A    B    B    B    B    0B    4B    8B    <B    PB    TB    XB    \B    pB    tB    xB    |B    B    B    B    B    B    B    B    B    B    B    B    B    B    B    B    B    C    C    C    C    0C    4C    8C    <C    PC    TC    XC    \C    pC    tC    xC    |C    C    C    C    C    C    C    C    C    C    C    C    C    C    C    C    C    D    D    D    D    0D    4D    8D    <D    lD    tD    xD    |D    D    D    D    D    D    D    D    D    D    D    D    D    D    D    D    D    D    D     E    E    E   E    E     E    $E    0E   XE    \E    `E    dE    xE    |E    E    E    E    E    E    E    E    E    E    E    E    E     F    F    F    F     F    $F    8F    <F    @F    DF    XF    \F    `F    dF    xF    |F    F    F    F    F    F    F    F    F    F    F    F    F    F    F    F    F     G    G    G    G     G    $G    8G    <G    @G    DG    XG    \G    `G    dG    xG    |G    G    G    G    G    G    G    G    G    G    G    G    G    G    G    H    H     H    $H    (H    ,H    0H    4H    8H    <H    @H    DH    HH    LH    PH    XH    H    H    H    H    H    H    H    H    H    H    H    H    H    H     I    I    I   I    I     I    $I    0I   8I    <I    @I    DI    XI    \I    `I    dI    I    I    I    I    I    I    I    I    I    I     J    J    J    J     J    $J    8J    <J    @J    DJ    XJ    \J    `J    dJ    xJ    |J    J    J    J    J    J    J    J    J    J    J    J    J    J    J    J    J     K    K    K    K     K    $K    8K    <K    @K    DK    XK    \K    `K    dK    xK    |K    K    K    K    K    K    K    K    K    K    K    K    K    K    K    K    K     L    L    L    L     L    $L    8L    <L    @L    DL    XL    \L    `L    dL    xL    |L    L    L    L    L    L    L    L    L    L    L    L    L    L    L    L    L    L    L    (M    ,M    0M    4M    @M   HM    LM    PM    TM    `M   hM    M    M    M    M    M    M    M    M    M    M    M    M    N    N    N    N    DN    LN    PN    TN    XN    \N    `N    dN    hN    lN    pN    tN    xN    |N    N    N    N    N    N    N    N    N    N    N    N    N    N    N    N    N    N     O    O    O    O    (O  ,O    8O    DO    HO    TO    `O    dO    |O    O    O    O    O    O    O    O    O    O    O    O    O    O    O    O    O    O    O    O    O    O    O     P    P    P    P    8P    <P    XP    \P    dP    xP    |P    P    P    P    P    P    P    P    P    P    P    P    P    P    Q    Q    $Q    8Q    DQ    XQ    dQ    xQ    Q    Q    Q    Q    Q    R    8R    DR    XR    \R    `R    dR    xR    |R    R    R    R    R    R    R    R    R    R    S    S    $S    XS    dS    xS    S    S    S    S    S    T    T    $T    XT    dT    xT    |T    T    T    T    T    T    T    T    T    T    U    U    $U    8U    DU    XU    dU    xU    U    U    U    U    4V    8V    <V    @V    DV    HV    \V    `V    dV    hV    |V    V    V    V    V    V    V    V    V    V    V    V    V     W    W    W    W     W    $W    (W    <W    @W    DW    HW    \W    `W    |W    W    W    W    W    W    W    W    W    W    W    W    W    W    W    W    W     X    X    X    X     X    $X    (X    <X    @X    DX    HX    \X    `X    dX    hX    |X    X    X    X    X    X    X    X    X    X    X    X    X    X    X    X    X     Y    Y    Y    Y     Y    $Y    (Y    4Y   <Y    @Y    DY    HY    \Y    `Y    dY    hY    |Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y     Z    Z    Z    Z     Z    $Z    (Z    <Z    @Z    DZ    HZ    \Z    `Z    dZ    hZ    |Z    Z    Z    Z    Z    Z    Z    Z    Z    Z    Z    Z    Z    Z    Z     [    [    [    [     [    $[    ([    <[    @[    D[    H[    [    [    [    [    [    [    [    [    [    [    [     \    \    \    \    (\    4\    8\    D\    P\    T\    `\    l\    p\    |\    \    \    \    \    \    \    \ ; \    \    \    \    \    \    \    ]    ]    ]    $]    0]    4]    @]    L]    P]    \]    h] < l]    x]    ]    ]    ]    ] = ]    ]    ] > ]    ]    ]    ]    ]    ]    ]    ^    ^    ^    (^    ,^    0^    4^    8^    D^    H^    L^    P^    d^    h^    l^    p^    ^    ^    ^    ^    ^    ^    ^    ^    ^    ^    ^    ^    _    _    _    _    $_    (_    ,_    0_    D_    H_    L_    P_    d_    h_    l_    p_    _    _    _    _    _    _    _    _    _    _    _    _    `    `    `    `    $`    (`    ,`    0`    D`    H`    L`    P`    d`    h`    l`    p`    `    `    `    `    `    `    `    `    `    `    `    `    a    a    a    a    $a    (a    ,a    0a    Da    Ha    La    Pa    da    ha    la    pa    a    a    a    a    a    a    a    a    a    a    a    a    a    a    a    a    $b    0b    4b    @b    Lb    Pb    db    lb    xb    |b    b    b    b    b    b    b    b    b    b    b    b    b    b    c    c    c    $c    0c    4c    Hc    Tc    Xc    \c    `c    tc    xc    |c    c    c    c    c    c    c    c    c    c    c    c    c     d    d    d    d     d    4d    8d    <d    @d    Td    Xd    \d    `d    td    xd    |d    d    d    d    d    d    d    d    d    d    d    d    d    d    d     e    e    e    e     e    4e    8e    <e    @e    Te    Xe    \e    `e    te    xe    |e    e    e    e    e    e    e    e    e    e    e    e    e    e    e    e    e     f    f    f    f     f    4f    8f    <f    @f    Tf    Xf    \f    `f    tf    xf    |f    f    f    f    f    f    f    f    f    f    f   f    f    f    f    f    f    f     g    g    g    g     g    4g    8g    <g    @g    Tg    Xg    \g    `g    tg    xg    |g    g    g    g    g    g    g    g    g    g    g    g    g    g    g    g    g     h    h    h    h     h    4h    8h    <h    @h    Th    Xh    \h    `h    th    xh    |h    h    h    h    h    h    h    h    h    h    h     i    i     i    Ti    `i    di    pi    |i    i    i    i    i    i    i    i    i    i g i    i    i    i    i    j    j    j    $j    (j    4j    @j    Dj    Pj    \j    `j    lj    xj    |j    j    j    j    j    j h j    j    j    j    j    j i j    j    k j k    k     k    $k    0k    <k    @k    Lk    Xk    \k    hk    tk    xk    k    k    k    k    k    k    k    k    k    k    k    k    k    l    l    l     l    ,l    0l    <l    Hl    Ll    Xl    dl    hl    |l    l    l    l    l    l    l    l    l    l    l    l    l    l    m    m    m     m    ,m    0m    <m    Hm    Lm    `m    hm    lm    m    m    m    m    m    m    m    m    m    m    m    m    m    m    m    m    (n    4n    8n    Dn    Pn    Tn    `n    ln    pn    |n    n    n    n    n    n    n    n    n    n    n    n    n    n     o    o    o    o     o    $o    (o    ,o    o    o    o    o    o    o    o    o    o    o    o    o    o     p    p    p    p     p    <p    @p    \p    `p    dp    hp    |p    p    p    p    p    p    p    p    p    p    p    p    p    p    p     q    q    q    q     q    $q    (q    <q    @q    Dq    Hq    \q    `q    dq    hq    |q    q    q    q    q    q    q    q    q    q    q    q    q    q    q    q    q     r    r    r    r     r    $r    (r    <r    @r    Dr    Hr    \r    `r    dr    hr    |r    r    r    r    r    r    r    r    r    s    s    (s    <s    Hs    \s    hs    |s    s    s    s    s    s    s    s    s     t    t    t    t     t    <t    @t    \t    `t    dt    ht    |t    t    t    t    t    t    t    t    t    t    t    t    t    t    t    t    t     u    u    u    u     u    <u    @u    Du    Hu    \u    `u    du    hu    |u    u    u    u    u    u    u    u    u    u    u    u    u    u    u    u    u     v    v    v    v     v    $v    (v    4v   <v    @v    Dv    Hv    \v    `v    dv    hv    |v    v    v    v    v    v    v    v    v    v    v    v    v    v    v    v    v     w    w    w    w     w    $w    (w    <w    @w    Dw    Hw    \w    `w    dw    hw    |w    w    w    w    w    w    w    w    w    w    w    w    w    w    w     x    x    x    x     x    $x    (x    \x    hx    x    x    x    x    x    x    x    x    x    x    y    y    y     y    $y    0y    <y    @y    Ly    Xy    \y    hy    ty    xy    y    y    y    y    y    y    y    y    y    y    y    y    y     z    z    z    z     z    ,z    8z    <z    Hz    Tz    Xz    dz    pz    tz    z    z    z    z    {   |  {   {   |   { !  {    |   {   |  |  {   { ~  {   | p |   |  {   {   {   {   {   {   {   v   v +  v  v U v O v  v =  v ) v a  v p  v  v x  w D  w + w   w   w X w   w t w 0  w ` $w d (w   ,w _  0w n 4w  8w   <w   @w   Dw   Hw   Lw I Pw   Tw   Xw  \w ( `w   dw C hw   lw   pw c tw } xw  |w ^  w c  w   w  w  w   w   w V w s w  w : w   w $  w   w   w  w   w | w r  w  w b w 0  w   w _ w   w   w   w   w   w   w   w &  w    x S x  x l x 4 x ^ x  x   x    x ?  $x  (x   ,x   0x   4x ? 8x   <x e @x   Dx   Hx   Lx 	 Px 6 Tx  Xx J \x - `x   dx   hx   lx   px  tx A xx I  |x ,  x ;  x  x   x  x 
 x B x   x   x   x \ x   x v x   x %  x   x L  x   x 7  x   x L x >  x `  x K x g  x   x   x   x   x   x   x   x D  y   y   y   y   y  y   y   y .  y   $y  (y   ,y 5 0y   4y E  8y { <y   @y   Dy 2 Hy :  Ly   Py " Ty M Xy w \y  `y 9 dy ]  hy X  ly )  py   ty 8  xy 1 |y   y  y % y p y 3 y & y W  y   y   y 2  y  y   y 
  y   y '  y G y O  y 	  y   y 6  y   y   y   y $ y  y R y   y @ y U  y   y   y  y l   z   z r z   z   z   z  z F z    z a $z *  (z   ,z   0z Z 4z   8z   <z   @z , Dz Z  Hz P Lz   Pz 1  Tz G  Xz N  \z   `z   dz  hz  lz 4  pz   tz .  xz 5  |z  z m z * z   z   z <  z   z   z   z   z / z   z ' z R  z q z   z (  z #  z /  z N z n  z   z z z   z   z @  z   z Q z E z J  z ] z y z    { f { ~ { [ {   { e  { 8 { ! { o  { H ${    ({  ,{   0{ 7 4{ -  8{   <{   @{   D{   H{ \  L{   P{  T{  X{  \{ j  `{ V  d{   h{ h  l{ T p{ k t{   x{ Y |{  { H  { 3  {  { W {  { "  {   {   { # {   {   {  {   {  {   {           US    [    t  > ]]             h       h      h      h      h        h(   $   h0   (   h8   p,   h@   `0   hH   P4   hP   @8   hX   0<   h`    @   hh   D   hp    H   hx   L   h   P   h   T   h   X   h   \   h   `   h   d   h   h   h   pl   h   `p   h   Pt   h   @x   h   0|   h       h      h       h      h      h     h     h     h      h(     h0     h8  p   h@  `   hH  P   hP  @   hX  0   h`      hh     hp      hx     h     h     h     h     h     h     h     h  p   h  `   h  P   h  @   h  0   h      h    h     h    h     h    h    h    h      h(  $  h0  (  h8  p,  h@  `0  hH  P4  hP  @8  hX  0<  h`   @  hh  D  hp   H  hx  L  h  P  h  T  h  X  h  \  h  `  h  d  h  h  h  pl  h  `p  h  Pt  h  @x  h  0|  h     h    h     h    h     h    h    h    h     h(    h0    h8  p  h@  `  hH  P  hP  @  hX  0  h`     hh    hp     hx    h    h    h    h    h    h    h    h  p  h  `  h  P  h  @  h  0  h      h    h     h    h     h    h    h    h      h(  $  h0  (  h8  p,  h@  `0  hH  P4  hP  @8  hX  0<  h`   @  hh  D  hp   H  hx  L  h  P  h  T  h  X  h  \  h  `  h  d  h  h  h  pl  h  `p  h  Pt  h  @x  h  0|  h     h    h     h    h     h    h    h    h     h(    h0    h8  p  h@  `  hH  P  hP  @  hX  0  h`     hh    hp     hx    h    h    h    h    h    h    h    h  p  h  `  h  P  h  @  h  0  h      h    h     h    h     h    h    h    h      h(  $  h0  (  h8  p,  h@  `0  hH  P4  hP  @8  hX  0<  h`   @  hh  D  hp   H  hx  L  h  P  h  T  h  X  h  \  h  `  h  d  h  h  h  pl  h  `p  h  Pt  h  @x  h  0|  h     h    h     h    h     h    h    h    h     h(    h0    h8  p  h@  `  hH  P  hP  @  hX  0  h`     hh    hp     hx    h    h    h    h    h    h    h    h  p  h  `  h  P  h  @  h  0  h      h    h     h    h     h    h    h    h      h(  $  h0  (  h8  p,  h@  `0  hH  P4  hP  @8  hX  0<  h`   @  hh  D  hp   H  hx  L  h  P  h  T  h  X  h  \  h  `  h  d  h  h  h  pl  h  `p  h  Pt  h  @x  h  0|  h     h    h     h    h 	    h	    h	    h	    h 	    h(	    h0	    h8	  p  h@	  `  hH	  P  hP	  @  hX	  0  h`	     hh	    hp	     hx	    h	    h	    h	    h	    h	    h	    h	    h	  p  h	  `  h	  P  h	  @  h	  0UVS    [ px tЃ> ue[^ÐUS    [û ]ÐUWVS    [Þ tBWiNVuEuWVuPUB,Ѕu1@e[^_ÐUWVS    [B }EPWuWyƃu(j uNPuWtuWMƃEPWe[^_UWVS    [ tBWiNVuEEPuWVuPUB0Љǃ} u*u:j NPuNPu1rv jLF    UVu:FF    F    F    F    F     UV$F,    F<    F0PWF@PNwe[^_ÐU@WVS    [ E    URUċUUU2N	   1t
FO)E   uE    }tNPjuuu  uEPtuE    E   s  j8EPUru  t u E    E   3  uuIƃuuuuuƃt~< t4u|j NPučNPuE      Uȃz$ t0z$u1JUr$uu4Ur$uuuuUr$uZFtx<u*uPVuu  Eu  F,    ,v j V0Pj V   vu0UȉV, uEP}u} tuL  E̍e[^_ÐUWVS    [Ò uE    UBBBBBB BBB(B$B,B4    0uP[Eu9 to  E DP tUUA}DG u9#u9
tA9 u9 t,A뵐9 t#v 9
tAF9 u9 tAF돍v  E4PE0Puu tE     UJ0$)ǉuJj NPB4tNj )OPU}4+OPu7E   F  E    U}9W00  W4U}U4N    u}DU  }G4U4N}    uDUB  }G4U4N}    uDUB  }G4U4N}	    uDUBW  }G4U4N}    uDUB'  }G4U4N}    uDUB   }G4U4N}    uDUB   }G4U4O}
    uDUB   }G4U4O}    uDUB jv }G4U4O}    uDUB$:v }4}U4 O	    UB4}DB,EU}9W0} tUz4 tr4k}G4    uVEe[^_Ív UVS    [V u~4 tv4&Ve[^ÉUWVS    [ }E    MIMwMAwQu	    uwuu    ? t8 tPuus  a  uu  K  1.MA tpQuMAPFM9q̃  t!G 8 tjPuuL     t!G8 tj Puu%     t!G8 tjPuu    wuu	       $ tjw$VhNPFOPuu~VuQOPuueVw[OPuuO(VweOPuu6VwmOPuu (VwwOPuuVwOPuu(Vw OPuu, tVO	VOPOPuu} t	VOVOPOPuu~} tj u  j u  Mquj OPMqOPutE      v MA<   uV5VE0P} tdMM}0v uv,uVvuEu6~, tv,kF,    uWuWD} uEe[^_UWVS    [Ê Uz trZUz trF1v UB4  FU9rUz tr1UB 4FU9rUz  tr uVVE0P} t%}u0WVWVO} uuVVE@P@} tFUU}@v uuW<vTvLVFuW} uɋUz, tr,ue[^_ÐUS    [ EMPt/v z tRutj OPrOPQ"j OPQ   ]Ív U8WVS    [î }uE    OPjVWu2  UUЋVUuEP|   jUrQOPuu'jUr[OPuu(jUrPPuuj u  uuJ(FPGPuuu  j j PPűUru,t
E   S16UЋB4t'jvuuPVuuu2$uGU9zjuu5uEPEȍe[^_Ív U`WVS    [2 M	MMqMMIM}PPjuuul  v uuEPu  0ЍxVuuuVuuu   EPEPRuuuu1  W%PPVugu}uuuu3  v }uMquuuf^EPEPuuu>  v W/PPVu;u}uMquuuƃQ  N   My 3  W4PPV5   u"}   Mq>PPuVjVuuAtF}ujPu1   v MAEPEPuƃ   j )OPMqCPPu   qWPPjuuu%ƃSMy tCWgPWVEu.u6EPEPWuuuƃ   uEPue[^_ÐUWVS    [& UMIMt': t"EPEPRut      E    E    }} tMyMy    P MA 19u~FE4MA F9u%v +EMQ 4iMA F9|ڃ} tu81e[^_ÉU,WVS    [6 UMIM܅  :   EPEPRu8  } tmuVVE܃@P} tNuj.vGvGj WE@PEPE܃@P$} uE    M9M   MM؋M@MԐEPEPEM4up  }:  uBuu} tVuvE0Lu)uuvvVv uua} uj!ǋE0GEpGj WuuqEM9MuVVE@P	} tNUj PPrPPrMqPPu uWEPE@P} u} tu1?j )OPEM4rPPuu} tu   e[^_ÐU WVS    [â u}URUE    } t7M9 t/EPEPQV0t'     v E     E    E    UUE} tMIʉUUBM    PrUBE    M9M~8WEU4V  EMAMUoBU9Uʃ}   E       119}~4v UBMpUBp   F9uυ   MAUpw   MAUpwnuoMAU $'A $'A $':MA<sUBM43  ƋURMA4AEUM9QMU9JtR    PMqUB} tuNEe[^_Ív UWVS    [J }EE    1E    PUEEPjW-M  7EEPEPuW'  } tEw=Ev1Wwj )OPu썃PPPPW   v jƀ&&&&F    } t?E0]FEpOFEpAFEp3F3v E0FFFEpF} t
}t
.}u&   } t   E4F
v F    } tu} tue[^_UWVS    [É }jƊ$&$&$&$& tG9tP0F	F tG9tPF	F tG9tPF	F tG9tPF	F twFF    F    e[^_UVS    [z u~ tF9t	PA~ tF9t	P'~ tF9t	P~ tF9t	P~ tvVe[^ÉUWVS    [ }EPEPuut   nv u   \19u~JE4uutЃt	tv tv v F9uu+1e[^_ÐUWVS    [* }EPEPuut   yv u   gMOM    Pw[Gw9u~/+WE4Wu4   GG< tF9uҋMOup1e[^_ÉUVS    [o EPEPuuu^jƀ&&&E0'FEpFFFF    F    u1e[^Ív UWVS    [־ 1dv UBEprEj PVuEEPuj VuPUB0ЋUP uSGU9z1e[^_ÐUWVS    [I }Ut'j )OPMtPPu`   |19w~-G uj jpPuWuuF9w19u~>U4Wutjj MtPuWu^u9u1e[^_ÐUWVS    [~ }EPWRƃt+UUv vVruWƃuWWe[^_ÐUWVS    [ u uj   Pǃ   E0ҋ}JRQRusu6}"Q4uPvuǃu-      }?QPjVuu   1FPEHPƍ  EPVRB0ЉE} u	VXjEMEpxMAt#WPVh   W4WVh   Wg uDQPU1e[^_Ív UWVS    [ò UtUQPjuRu   uPMquǃu       uj  Pmǃ     URWP@0ЉE} up6juƋM~F    MqVRPh   WkjAǋMqFG~1e[^_Ív US    [ë j gQPuk1]U   WVS    [{ UtiQPjuRuQ  }W0։Ѝp:t  VyQPRuW,P}wu
uuj wu,   v j Vu,P   }W:t   VQPR[uxǅ(    wƉ> t59/u( u!/Bǅ(   Bǅ(    A9 u 9vJ:/u9t jVu 1#j QP}wQPuN   [^_ÉUWVS    [ U}tQPj WRu9   uwPVuǃt{hff?hffffWV  Et`h33?h3333WV  ƃtFuu&  Pu1V  Pu"W uV1v    e[^_Ív UWVS    [ U1}u rQ    uW   R
}uFREPRutu   9E    j U4u_1v QPjRuue[^_Ív U0WVS    [R E    E       9U~Gv M4Q    u
E   M4Q    u*B9UEH9t(QPjuuuE   MMѐEPuutiEPuuuE}܋EܴEm]m:v } u*uj RPuЍ5RPu   'E    u荃7RPuVjVu1e[^_ÐUWVS    [ UE    E    E    E    ~0Mq:R    uE   MAJMtERPjuRu	k  EPEPMqu>   EPEPMquuwU$)ȃuo} uuuEt  tj \RPUEtfRj 5RPUEtQPu"E      v 19u~~uuE4w  u@} uWj rRPMquRPE4QPuE   (v j Et4Mqu69u} tu} tuEe[^_ÐUWVS    [
 }UtRPjuRW]   Wƃuj RPW      VMqWEu	   gVMqWƃuBEPMqWt+Wj RPMq5RPW   uVuWe[^_Ív UVS    [ uMUtRPjRQVp/rr1u
j Qj gQPV1e[^U   WVS    [ï Uǅ    tRPjuRu2  j Epu$(u+j  SQEpSQu     v E@$MI 0ҋ$։H ҉H,(ǅ    > D  v $8tF> u>     $8   ǅ    $t)v 9}GB? t: t8tڃ uǅ   9uG9(s(L 2(V(((8 t t@P t"j ,Mqu ,P$1[^_Ív UWVS    [. u}UUEvSPj WuVu   EPwVSuUEPwV?uAEPwV+u-EPwVu}uuwVu   VPuuuu1e[^_Ív US    [W j QPu1]UWVS    [* E}8uTEP  Pt=p9~u$PVDQPvVEPuče[^_UVS    [ò u  vP@,ЃtSPv6t+~ t
:StSP6R6v-V'e[^UWVS    [- }19}"U4uVu   F9|1e[^_ÐUWVS    [ E8   UURRPh   r  UrP@,Ѓt	PUztJ7U2tSPU2\U263V-uue[^_ÉUVS    [" UBPBPBPSP  V   tv 8 u 0@8 u  e[^ÐUS    [ UEBP$}MMm$XmfEBP$}MMm$XmfEBP$}UUm$XmfEEPu]ÐUWVS    [ u0PaVW踻e[^_ÐUWVS    [٫ }j SPu19}%9u~j TPU4uF9|j TPuu   e[^_Ív US    [c j TPuTPu   ]Ív UWVS    [) !Tj "TPu.TPuI1 j UB 4Wu,?TFUBH9|׋Uz~j BTPuUz ~j B 4u   e[^_UVS    [Â uvXVRe[^Ív UVS    [V uFu5j Fp,STPv6t^TP66ɺe[^ÉUVS    [ uFuhj Fp,TPv6}t^TP6踻6qP  uP@,Ѓt	PNtUPV莻e[^Ív UVS    [r Eu8u6Fu0P  vP@,Ѓt	PfNtUPV2e[^Ív UWVS    [ UEtTPjuRuc   PMquǃu      , ujP  Pǃ,   P  URWP@0ЉE} upv\MqaFJjżƉ~MMq@FfMqV PWuVVPh   W袼1e[^_UWVS    [ U}EtTPjWRuRYPwuƃt?EPwVu+u(EPwVuuuuV11   e[^_Ív UWVS    [f U}EtTPjWRu   PwutƃtsEPwVu苾u\EPwVutuEEPwVu]u.EPwVuFuuuuuV-1   e[^_Ív UVS    [Ö uUMEtTPjQRV$v PqVtPI1   e[^UVS    [6 uUMEtTPjQRV$v PqVFt0(1   e[^UVS    [֥ uUMEtTPjQRV%$v PqVtPi1   e[^UVS    [v uUMEtTPjQRV(v PqVtp0E1   e[^UWVS    [   ǃ      @    @    @    @    @    @    j Pj j HPu迺Pu胼t       M  WMQuVNjVWPWWuE MquV#jVXWPWu  My t0yȃu`  x tpWP蝶  Bu	WBj  WPWPu-j  vWPWPuvw  G    jwxWPWVuLjw=WPVu7(jwWPVujwWPVu
(j u0WHP1e[^_ÐUWVS    [ }jWPWPW蒷  jWPWPWq  W蠸E\ )  ǃ\   WPǿ  WP豿  WP蛿  WP腿   WPo$  j (  H,  轹 0  诹4  8  <  ޶@  Ӷjj`PXPPW(j
j~PXVؾPWPVPW jjPYP蝾PWjjPYP|PW(jjP$YPXPW^jjP+YP7PW=(jj.P2YPPWjjHP8YPPW(jjdP>YPνPWԿjjhPCYP譽PW賿(jjPHYV艽PW菿PVrPW蘶 j
jPYVNPWTPV7PW] j j 4PYPPWj j PYPPW(jj4PYPμPWԾ8P\P豼PW׵ jjP	\P荼PW蓾j	j	P\VlPWr(PVRPWxj	j	(PX\V1PW7 <PVPW=j j pP\PPW Pd]PֻPWj
jPm]P赻PW軽 j
jPv]V葻PW藽PVzPW蠴 j	j	P]VVPW\ PV?PWe j	j	0P]VPW!DPVPW* jjxP]PPWjjP]P迺PWż(jjP]P蛺PW衼jjP ^VzPW耼(PV`PW膳jj$P:^P?PWE jjBPA^VPW!\PVPW* jjPq^PPWP_PùPW  jVP#_PWPW'j/_P3_PWεj?_PE_PW踵 jT_P^_PW蟵j u0PW药 W   jj_PWy}    W趰   x_PW.t}_PD  j_PW&P_PD   ?_P_PD  ǲ_PD  赲%`PD  裲W͵ J`PW蝴t   jVP_PW芴1e[^_US    [Ϛ ju]ÐUS    [ï j u]ÐUVS    [Î ujWPT`PWPVOVYe[^ÉUVS    [N ujWP_PVֳHVe[^ÐUVS    [ uj j 
hPVktj PuV蘫u   1e[^Ív US    [ÿ ux]ÐUEUMȉUE     @    @    UWVS    [m }uWt9t;Mu u
wwVwuwj Vuse[^_ÐUE`UEUx u    B    
@BbJÉUVuMy tAtaAQAuÍv UWVS    [Ñ }u~    F   G9GuG    G    F    eW9VuMGFGGv G9FuGj PupF    #v VM46QQMFNe[^_ÉUWVS    [ї u}U: uj VRuUBGav  tXUB9Burrv GU9BurwVu7wv V7uwVu7Ue[^_ÉUWVS    [* }uuuV踵FuVWuVuWu蕱u1VWu辳   e[^_ÐUWVS    [ú uE    1uuVBFuMVuu}<v U9VuE   } tVuuGGU9VtVuuߩ~ ue[^_UWVS    [) }uFuVWuVWuU9Vu   VWuz~ u1e[^_ÐUWVS    [þ }MIMMIM}hPjuuW   jhPuWvƃu!Wj $hPu&hPW莱kuVWªtEPEPuuRW
  @WƯj AhPVDhPuThPW5 j7ihPW聮   e[^_UWVS    [þ }MIMMIM}hPjuuW   uW蟤ƃ   EPVW   } u"W j AhPVshPWyrv uuW訩tEPEPuuRW  BW誮j AhPVDhPu􍃖hPW j7ihPWe   e[^_UWVS    [å }MUBrthPjRQWDv VPWt!VP&Wj VW蕯V/j hPW1e[^_Ív UWVS    [ uuЦEsWhVu'EEPuWVuPUB0Љƃ u誵} u	FEXUUtGuuu`u!EPuuu} u1} tuZEEFEe[^_ÉUWVS    [A u}WuV貧uCVլj AhPuDhPWThPVD j6ihPV萫   uuWuPV  e[^_Ív UWVS    [ù u}jhPWV褰t	P臢 V>j $hPW&hPV跭1e[^_ÐUVS    [Z ujVhPuu#Ve[^ÉUS    [# juhPuu]UWVS    [ u}jhPWVuV胫j $hPW&hPV1e[^_ÉUWVS    [Ú }ujhPVW腯Eu'W%j hPVhPW螬   -v 0ҋ}uU    	UE1e[^_ÉUWVS    [
 U0щMUEHE})W8uV荟fh}f7uD7Pre[^_U(WVS    [Ò uuHE܍EPuu֩E؃u9j u܍hPuuU2h    uE   uj j uE؍e[^_UWVS    [ u}uu"Eu   yVuuuV臢E   PƋMMN1҃9}MDB9|VGPu蔭uuuVNuFe[^_U(WVS    [F }uVU2W蕨   VhPW|u!W迨j 	iPW@      hE؋UE܍EPjWuEЃt	   QEPU2Wu*WXj $hPU2,iPWͩ   uuWuEЍe[^_ÐUWVS    [Y 0}Ѝx1/MA M8uWQR֦uMA FM9q1e[^_ÐUWVS    [ }EPW辪ƃt,Ft	P觯VާEP£ƃuWsW}e[^_ÐUVS    [Â uuuV褥t% t@@jPuVVj PV荨1   e[^UWVS    [) }uuVWJu   PuVW  jVWƢVЮ1e[^_ÉUWVS    [΋ FiU1M9y~WUB< tBx t9PuRu  j HiPVuuç$VZJiMGU9z1e[^_Ív UWVS    [B uUrEEj MiVuQuj VuAPG,Љuޭ tF   v 0}HEE    11MU9J~9uUBpuYu"GMAEFU9rȃ} t"EBu$j XiPuZiuj XiPumiPu}1e[^_Ív UWVS    [ 0UщO}UEPJuV蟙u}W葙e[^_Ív UWVS    [î }E          tAUtuu賢tj ~iPUtiPu蝥E   H19}BU4uuktj j UtPuuuʦu9|Ee[^_ÐU   WVS    [ uuǋMqiP8V蒦VWu8 tM00PjVGiPWuu14v MA0M40PjiPuRu藪$[^_UWVS    [& u}E    E    tv} u-t(j XiPviPu%E      }  u2} u,t'j XiPviPuE      ~ t0FE}EPju蓦u5U2bǉ}}  uD} u>WVuuutE   2U: t8 tRסjWvuu} tuީEe[^_Ív US    [܆ EMt.x tAEA@AEA@EEPj0QUAEAEAEjRuu~EEPj]ÐUEUB    u!B   B   B    B   Ív B    B  ?B    B  ?B    B    B     B$  ?ÉUUME8u@@@	@@@E@tEu#    B        A  ?ÐUtWVS    [j }?u; }	G    qA9A}A    `v AA9A}Rq+qqGZEtBZEuB    B    v BBZEu	BbZ t]EPEPW{EUPREUPRiPuV{$j Vwu
tiPutu,e[^_UWVS    [^ u} t0EPM1u裡u>uEF   E   u̞EPEPEPEPuޔM9u^P   +,|v ă   l EO}EEm_m`EGGTEGGHPw@+|d \ T l    ENFv F MF^1e[^_ÐUS    [3 u輘]Ív US    [ uuuLPO]ÉUS    [ u耡]Ív US    [ǂ uuLP覣]ÐUS    [ß uuLP]ÐUS    [w uuLPF]ÐUS    [O uuuLP]ÉUS    [# uuuLP迗]ÉUS    [ uuuuLP萕]Ív US    [ǁ uuuLPS]ÐUWVS    [Ù }u? t7x    jj %jPWitPLFF    jj /jPW<tPF	F    e[^_ÐUWVS    [ }u> tj6W~ t$jvj %jPW贡v謣v jj %jPW蓘~ tjvj /jPWvvnjj /jPW[e[^_Ív UWVS    [Z E   UJUM9QytC9Q}>j 9jPUr<jPM1>jPuPQ  v E      M0UzHEE    uMU9
   ~ u6~ t"EPE@PuuFЃ   EPE@Pa>u0~HVUMy8uIuRWu8U9V<~t	9V-EPuuuFf  v EUM9<}u2j XjPv<jPMqP1>jPu  j 9jPUrZjPuM9 t(U4@4M| u:Ov U:uj kjPu誚   u#j jPMqjPu聚   j jPukE    u9}}_G9Eu j jPvjPu5+G9Euj <j
j jPvuE9}|   e[^_ÐUWVS    [Ù} }} t<tL? t37jVD  j%jPWPVD  ؔ$tjPWԖuiUWVS    ["} TEu貏EuMM}0ҋ}։uTU}҉UTRU}ҋ}΋E)TaURjuuuuuuuuuuuuuV+@VuߕV'e[^_ÐUWVS    [)| }u> tv Wuv6u[> ue[^_US    [{ u uuuuuu~]ÐU   WVS    [ï{ ,V$EP,$0щHPRVϕjjWVU0щHPuV袕(j ,uu$V $[^_Ív UE    1UWVS    [z }E    EPPjjju4Wuuuu ǃ,j uV{} tEe[^_ÉU   WVS    [{z uU(,P,v FtjPW蕔,(迓ƍ,P[^_UWVS    [y uEPVҗt}PWuV蜓V覜e[^_ÉUWVS    [éy }j uW輏ƃu=j4j V袒Vj uW} t	Vuv VPWe[^_UWVS    [6y uUUU   0ЍxWjPV貒u      WjPV蒒u   xWjPVvu   \WjPVZu   @WjPV>u   $WjPV"u    jU1!v j jPVkPuw   e[^_ÉUS    [x EEJ   +v pw hw @w `w @w @w @w Xw @w @w @w @w @w @w @w Pw @w @w @w @w @w @w @w @w @w @w @w @w @w @w @w Hw j.j&jjjj*k]ÐUS    [+w ju2kPu踐]Ív US    [v uuj j uuuu P謒]Ív UWVS    [þv u EPPj u(u$uuuǃ jj VuWu0uu u,VuWu0uuW6e[^_ÐU(  WVS    [Cv Uǅ    ǅ    u}AkPjuuuo  URPRu"t3u胐j TkPekPu     v uPuP融  jskVj tkPuIjVj ~kPu5(u0Ѓ	P草kPߒjrkPuϕ(jrkPu謕jrkPu茕(jkPuljkPuO(EPEPkPru萖;  uݎEPEPu#     VtkPV觍V蛍V菍 u豓$tV脌ǅ      Pdj   uőj j kPru裕,uRj j kPruzu)j j kPruQtǅ   s1BB4t0jvuđPVu^$uG9zju[ \  U: t2Vǃv 1jj tkPuGjj ~kPu. u͌B$ tr1Pu7t0Puǎu蹎ju詊tj V躂v j=utjWuW t: tjRv jWj tkPu4 tjj ~kPu    tuP9[^_UWVS    [p Ut+j kPMtkPu      Ur$uuώEt1CUB4u3vvu贁uFj jPVuuuuGM9y19}~Nv U4uuKƃbjj MtVuuu褍=9}1e[^_ÐUS    [o U8B@8]ÐUWVS    [Ùo }8t6WČu)v@u} tj lPWlPu蒋1e[^_UVS    [6o uuvt
PV@1e[^Ív US    [n EuuuPBЋ]Ív US    [n Eu$u uuuPuuBЋ]Ív US    [×n EPBЋ]US    [wn EPBЋ]US    [Wn EuuPBЋ]ÉUWVS    [-n }19w~tF9wG9t7e[^_ÉU$WVS    [m E    Ut,j /lPMt9lPu     v }~JU    PE;j lPMU4ElPu觉E   H  M MMU 
MJ19}+U<    M    W老UDF9uE    M9M   0UM<HEE    1U9U   M<?    tvuwUM4Ru[UUMLMUMUMUMTU܋MUDMU܉ME    ?xF9u^} EU9U}uu }Ee[^_Ív U   WVS    [k } 
  0}Ѝxǅ(    U9(}G(U4>t$v ~ tWvu2tG >u(M9(|1҅u(j lPuElPu聇   K  v }$u2(U< -  u u4U4uu1  (U<    u u4U4uu{   ,P<ǅ(    M9(   ,( tjVlPVЄ(M< tu j 4M4uu腆U$0$HPRVz(U9(zu躄j ,u:,P辂1[^_ÐUS    [i MEUE@8EUMju uEPjEPuu]ÐUS    [|i MEUE@8EUMju uEPjEPuuƆ]ÐU8WVS    [*i E    }, uUԉU,UŰU@8EЍEPu ujEPuu\t      v E؃8 ~ u$up0uuu臀u7} t[E؃x }( tLUrzu$EppR~t	E   !U9ru9ztU,   	U,    EPyEȍe[^_Ív UVS    [&h EuutPuzu   11e[^Ív UUEu1Ë UWVE}uMP@t   /}     tBttBd    t   1v t   tBxtBh    e^_Ív UWVS    [-g uUE}(9L)}wBM+ f f f f f f f f f ֋M$1M9M AU+U }w]M+`v |f |f tf Tf Tf Tf tf |f tf M&M)Ѓu	Ue[^_Ív UVS    [7f u@t;t6u$EPEPV膅} tu uuuuuF0e[^ÐUWVS    [e }ujX)z0x@    @    @    @    @    @    @     @$    @(    @,    @0    @8    @4    @<    @@    @L@P   @T   e[^_ÉUWVS    [)e u~( tv(视~ tvWUj F0VHP螅Vȇe[^_UWVS    [d }VUuVuuHPFppq|u^~ uj W4  vcyF~( tv(F(    ~$ t+VPv$FppzF(u   !} tU9Vt
W`  VF  1e[^_UWVS    [c u}   }    u$EPEPV?vvu uuuj j }}WuuF0肂@EPEPvvu uuuFpLu$} t u uuuWuuF0~ ~( tcN+N0F@X)~)1Ƀ~P t/VEBXPEBTPuv0v,j j v(EPdw$F~,x~ t|} tvN+N F@X)~)1Ƀ~P t9jVEBXPEBTPv vj j vEPuuF0s0F~   E~4 tt~T tn} thN+N@F@X)~)1vLV   v<EBXPEBTPv8v4   EPuuF0y0EPuuF08e[^_UWVS    [ýa uF    F    ~( t+F0PF,Pv(FN,   NF0F4~ t-F PFPvF0a}FN   NF F~4 tH0~4ȉJV8F@PF<PF   Rv4   lyN<NF@9F}FF@TFF@XFe[^_ÐUS    [` ]ÐUVS    [î` u~ tVFx tV@Ѝe[^Ív UVS    [r` uj V4  v?uFVe[^Ív UVS    [:` uVbFx tV@Ѝe[^ÐUS    [` h   ^tǂ       ǂ       ǂ       ǂ       BT    BX    BL   1ɐD\    D`    Dh    Dd    A~ՉЋ]ÉUlWVS    [r_ EuE        uE   u-PVuuhPvDv@wt         tEE    E    UUv }D7\ ED7` Euh@ vDE|7d tt7dFD0y}UT7dD7\ Euh@ vDE|7h tt7hFD05EUT0hE}\} u	VvHyv1e[^_Ív UWVS    [)^ u1|0h tt0hFD0ʀ|0d tt0dFD0譀G~j FD0VhP~V誀e[^_ÉUWVS    [í] }MAt7    t   ^pMq,mPwDw@y   MAtA$GTMAtA(GX1v Mt>|8\ tt8\|MttPwDw@T8\F~1 Mt>|8` tt8`|MtltPwDw@~T8`F~h   j j ue[^_ÐUWVS    [m\ }uj(p0x@    @    @    @    @    @    @     @$    e[^_UWVS    [	\ u~ tv}~ tvW5wj F0VP~|V~e[^_UWVS    [ê[ }VUuVuuPFppQsu^~ uj W@  vCpF~ tv|F    ~ t+V@PvFppqFu   !} tU9Vt
W  V:  1e[^_UWVS    [Z } u}       u$EPEPVzvvWuuuj j UURuuF0cy@EPEPvvWuuuFpLml$} t WuuuuuuF0u ~ tSN+N$F@X)~ȉ1ɋVEBXPEBTPuv$v j j vEPNn$EPuuF0'|e[^_Ív UVS    [êY uF    F    ~ tF$PF PvxF FF$FF@TFF@XFe[^Ív US    [GY ]ÐUVS    [*Y u~ tV`Fx tV@Ѝe[^Ív UVS    [X uj V@  vmFVe[^Ív UVS    [öX uVFx tV@Ѝe[^ÐUS    [ÃX h   lBT    BX    BL   1ɐD\    D`    Dh    Dd    A~ՉЋ]ÉUhWVS    [X E}u,PWuuPwDw@ot      E    E    UUuD>\ ED>` Euh  wDxE|>d tt>dGD0IzuUT>dD>\ Euh  wDxE|>h tt>hGD0zEUT8hE}\1e[^_ÉUWVS    [	W u1|0h tt0hFD0y|0d tt0dFD0yG~j FD0VP`wVye[^_ÉUWVS    [ÍV }MAtA$GTMAtA(GX1v Mt>|8\ tt8\vMtmPwDw@(xT8\F~1Mt>|8` tt8`uMtmPwDw@wT8`F~h   j j ue[^_ÐUS    [ÏU uu	  ]U   WVS    [gU EEE     ui
  }qPjuuur&  v UrugE  }L  Mt&j rPUt!rQuq     ǅ|   E9|   Uxx0щOW-rPR5nlu(uUturE   I  v W8rQE4mǃu@UTUR  ǃtPj CrQEtSrRu<p   v 9|tM|ULL|9u|E} u"[rPuVdquUUM	MEEj uuUR  ǃtVj EPEPWuk  u0WPh   ugumj uuVo1W     `[^_ÉUWVS    [R }uufVWuuPPpuee[^_ÐUS    [×R EUj 2PPHr<pDuc]Ív UVS    [bR uEMUuj j tjQPRV`   j 1RBHp<rDVTne[^ÐUS    [R E@<uP   1j rPu'n   ]ÐUS    [Q EPHuuuPB,Ѕu1v    ]ÉUVS    [ÎQ uF<t
~8 u%	F8    FP<kvPDtFHV@0Ѝe[^US    [CQ E     @<uP   ]ÉUVS    [Q uF<uQN<> t6v@gPv@mt  vPP@,Ѓt	PkV~  hPVbe[^ÉUVS    [âP u u    uP@,Ѕu @v @@4t90t@u1e[^UWVS    [>P  uM  jdǋMMO  URuP@0ЉE} up> tIMy4 t@6uA44j89dF4        uhPh   u3dMqF4G~4e[^_U   WVS    [ÃO  u  Epuƃ   ,VpjrPViE@P,0щHPRVnijrPV_i(E0щHPRV>i(P,uuJ  ƃ( tj j j VE@,ЀN<VEpuO,Pgg} tuu  uVo  [^_ÉUWVS    [RN  ua    URuP@0ЉE} uFHMȃǋE   My4tkx4 tuw@4ЃuLj89bE@4    EuǋE   uhPh   ubuMqe[^_ÐUWVS    [vM } u  t  URuP@0ЉE} up   v uuwwMA(ЉƍPVPuw\kGF@GFDMNH$u]FPFT    FX    FL   F8    F<    jFPeMq} tEMe[^_ÉUS    [ËL  u  t  uP@,Ѕt@1]ÐUWVS    [FL }EPEPjtupG ЃV'cue[^_UWVS    [K u}EPWFPF4Ѓ} urPZfxF8e[^_ÉUWVS    [åK uuFPF0ЉǃusPfWfN8~8 uF<uhPVU]e[^_ÐUWVS    [6K }EPGPiƃt2VGHx$ t	R@$ЃV!fEPbƃuЍe[^_US    [J  u&j t  Pcj  Pcǃ   ]UWVS    [ÊJ Eu8u^ u  VP@,ЉEt9PUz4tvVmuu
muBee[^_ÉUS    [J E8uu]Ív UWVS    [I MMMM	M􃻸 u} t0}u0} t#MA<t	u   } tuu1uv uƃtkF<ueVHM9t/j 3sP2:sP0JsPRsPugeH9ut} tuuVuVM11!j gsPussPue   e[^_UUEu1Ë@PÐUWVS    [áH uj,\ǋ8  wj W8  V\]GG    G    G    G    G    G     G$    G(e[^_Ív UVS    ["H u~ tvVacj F0V0PhVje[^ÐUWVS    [G }VUuVuu0PFpp}_t
   ?v ~ uj W8  ve\F} tU9Vt	W  VV  1e[^_UWVS    [BG u}   }     u$EPEPVfvvu uuuj j }WuuF0e@} t u uuuWuuF0[b EPEPvvu uuuFpLX$} tT~ tNFMHTMFUPXЉEv(V   v PQvv   EPuuF0I^0EPuuF0he[^_ÉUS    [F 4]ÐUWVS    [E u~ tE0~JVF$PF PF   Rv   ^F FF$FF    F    F@TFF@XFe[^_UVS    [nE u~ tVTFx tV@Ѝe[^Ív UVS    [2E uj V8  vYFVe[^Ív US    [D h   RYǂ       ǂ       ǂ       BT    BX    BL   1ɍv D\    D`    Dh    Dd    A~BT    BX    Ћ]UlWVS    [bD EuE        uE   u-PVuuPvDv@[t         YEE    E    UUv }D7\ ED7` Euh@ vDdE|7d tt7dFD0if}UT7dD7\ Euh@ vDdE|7h tt7hFD0%fEUT0hE}\} u	VvHi[1e[^_Ív UWVS    [C u1|0h tt0hFD0e|0d tt0dFD0eG~j FD0VPpcVee[^_ÉUWVS    [ÝB }MAt7    t   NUMq,RPwDw@^   MAtA$GTMAtA(GX1v 8Mt>|8\ tt8\aMtYPwDw@cT8\F~1HMt>|8` tt8`{aMt\YPwDw@cT8`F~h   j j ue[^_ÐUWVS    []A }uj$U0x@    @    @    @    @    e[^_ÐUWVS    [A u~ t,VPh   v.Xj j v"avP ~ tvW\j F0V`PaaVce[^_Ív UWVS    [Í@ }uWPh   VTWPV`we[^_UVS    [J@ uuPh   VsWj j Vi`VOe[^UWVS    [@ u~}~}uVuu`PFppW   ~ uj u<  vTF}9~   tWu:~ t{NVA 9Bt+j Bp,vPvPq,5wPr[iN   t(j VBp,@wPq,VwPrd[6vuu} t}9~tu|  V  1F       e[^_UWVS    [> } u~    EPEPvvWuuuFpLPF@TEF@XEVJTM    )ERXU    )ǃ$} ~$FV@9B t
PRsTvNBFV@9B uRZWuuuv~_WuuuFpvSe[^_UUz tB   BB   BB    B    B@TBB@XBÉUS    [Ë= ]ÐUVS    [n= u~ tVtFx tV@Ѝe[^Ív UVS    [2= uj V<  vQFVe[^Ív UWVS    [< E}8uG    wWUW9wuU9WtGx tW@Ѝe[^_Ív UVS    [Ú< uVFx tV@Ѝe[^ÐUWVS    [e< }u~ tZF    VPh   WSj j Wv\F@9G t
PWQRWKV&Fx tV@Ѝe[^_UVS    [; Ept@@9F t
PVQVKe[^Ív US    [ç; j\P@T    @X    @L   ]Ív UWVS    [n; Eu~TVXUu+PVuu PvDv@St
   v 9~TuU9VXt	VvHJS1e[^_UVS    [: uj FD0V P[V]e[^Ív UVS    [: MUBtB$ATBtB(FXh   j j Qe[^ÐUWVS    [z: }uVYUW VuXPI[} t"u9}t+VuXPM} uj WuXPlRe[^_UWVS    [9 }uVXVWXPZ} t=uEU9P tPVWXPVVWXP8M} uǍe[^_Ív UWVS    [~9 }uVXVWXPUZ} t;uE9EuPRVWXPVVWXPL} uɍe[^_ÐUE} t   Ë   US    [8 uuuuPPV]UlWVS    [ò8 }uU2uVt/jP  ƃt,t"j 2xPXxPuT      u#v vyxPuVVj VuzTfEPUruUuEPUrumUu} ~} j xPu)TzEFEF V  1e[^_UWVS    [ò7 }UU19}.uU4uLu   PMF9|1e[^_UVS    [Z7 utDVH  h   6Nj j 6vWF 9B t
PRPM6FVpFe[^ÐUWVS    [6 }uu6W%Uu
   Rv j PP  u!j xP6xPWR   !ptp,WqLvu1e[^_ÐUWVS    [f6 uE0uT  j RRJEuj xQE0xQ   EPMqujS   E@E0ҋ}ҍrVxRu~Ou   1   VxPMqUOu   kVyPMq1Ou11MV	yPMqOt(j yPMqyPuvQ   3  1       MEM
   qx4   T
UMщʁ   uE}        M   M9    E   uM9
twE   u: t]Mʁ   u       
    E   EuE    M	       E4   uM
Ep  1e[^_ÐUVS    [3 uEu0VRu   1jP<  PF  uj #y	j %yPVO1e[^UE} ~ 8.t1Ð   ÐUWVS    [R3 UU} ~Uu#j 'yPXxPugO   J  U2MUuVuBQEtыU   tj QyPVuyPuO몐juFE}~:U2y    u#uruPcEEUz uUB BjP  ƃUrU9rtDz t2j j 2yRUB
 9A t
PQPHuuSuVA} ~ uuuuu|JUr  1e[^_Ív UWVS    [õ1 }uuVWOt&j PEuj xPVxPWM1e[^_Ív UWVS    [V1 }wtV> tI1ɐ1҉}}D0H    D0L    B~Dh    A~F    V
  vu}wt:> t-1ɐDhtV  u   v A~֋vu1e[^_ÐUVS    [Ö0 uF 9B uRF06F6A@e[^ÉUWVS    [R0 u}MFU 9B uQWuuRQv QWuuF06E6Ke[^_ÐUS    [/ E@$uH$PhPZO]ÐUVS    [/ uF$tVhPPf$e[^ÉU@WVS    [Ê/ uu      }G$   ug$  utyPD  F  u  }G9   uG9   t?uFF2f$vv6PV  yPD  NF}G       Y     uԉz@)ǉ}؋RD)ЉE܃} 0  (  u  t(zPH}}   uű}?    E    p}ȍv 1ɋuuЋ}̍|7}čv uЍ}ȋủu}A~ދu    }̋D:+:u+D28+D2<@}DG}~} ~"} ~} |} |u9u}9}~u'uuEuF@EPEF8EPV}}uf$e[^_ÉUWVS    [2- }uUDW4u@8 u uED8H    D8L       u7MD8ET<Uj%   PQW  u   tEMuD8HUD:Ht
t)Hv EMuD8L+EUD:L"EMuML8LUL:L1e[^_ÐUVuEMD1D2HD1 D2L1uÉUWVS    [+ uM    }D8Ej %   PQu   u
   ]v EuMDH}D:HEMu}    MT
LMT M}TL1e[^_ÉUWVS    [B+ }U    EMtj WRV?   t*ET0HMTHMt0LUt
 tL1   e[^_Ív UWVS    [* u}} uDh   }uDh   ~ ~} taF~MT4wW+d* @* X* L* uWV"uWVFuWV
uWVu	   } u
Lhv LhN1e[^_ÉUWVS    [) }1Dhuj j VWtDhuj jVWu   	F~1e[^_U@WVE    U҉UUuvu  E8      u    UuF8F<EUr@rDuE    v EEԋU|HtPuDLEuԋtTu1E    E    }tًEЋULș} ~-UuЋE9TtUTU܋t+uuԋEܙE9}u
u9u|{p9}~_EЋDEԅu} ~UUԋUuЋE9Tu} }u)uԃ} ~9uԋEЋUtu؋E)Eԉ}ԉE} }} 	E    1ɋu9L}LU܋E9T}TE؋u9D}DEЃ}URU`EUUEу}   uNM}   EHe^_US    [Ë' EUw<+D' 8' 8' 8' 8' P' rLz tR6]Ív US    ['' Etp]US    [' EUw:+ & & & & & & z ~RRI]ÐUVS    [â& uVH  h   6=F 9B t
PR<6=6V5e[^UÍv US    [G& UM9Qt3Qz uJJBHA    JBQP1JF]ÐUWV}}O   9M   E    1}<y}}}}}G4<*<|&}}9|
u}G4D
    D
pD
 F~}       }98u     E}~Ih}OʅtA9Mu39u}uG    A}Gy u}WAB	ʋIu}Oe^_ÉUS    [$ uG]Ív UWVS    [$ }G$ugWPh   7;wtv vP:u  7P@,Ѓt	P?WO$L  WR6e[^_ÉUWVS    [5$ }WE  7P@,Ѓt	P2?    wWFVe[^_ÉUWVS    [#  u)ǃ   j  P<j  P<} u+  uP@,ЉEu	1  UB     URuP@0ЉE} u	@   h   7ƋUF    F    11ɍ~UUD4     ED0    UD2     D28    D0H    D0L    Ǆ2   Ǆ2       A~Ǆ       Ǆ       GtUrVH  h   u7e[^_UWVS    [f"  u)ǃ   j  Pf;j  PX;} u'  uP@,Љǅu
1   v G     URuP@0Љǃ} uwGj(=6ƋMF    F    f$f$F    F    Fd   F d   wVPh   u	6e[^_Ív UWVS    [f! }uDw4} u@8 u} uGp       V7D8EL<Mj} %   PVW@  u   ]} t
}t,M    Mt8pDpu +E&v     Mt8pDpuM1e[^_Ív UWVMuURU   }@@)E@D)E    E4DUDH}|UDL}Dp1e^_ÉUWVS    [  uU    M|j %   PRW  u   BUUMDpEDpu UM    UL Lp1e[^_ÉUWVS    [y UM    4M|j %   PuW}  tMDpT>pt 01   e[^_Ív UWVS    [ u}F~MT4wY+     uWVR"uWV&uWV
uWVu	   } u
Lhv LhN1e[^_ÉUS    [g j2]US    [K u$A]Ív UVS    [* E0t6Pue[^UWVS    [ }us    r? uWGWGe[^_ÐUWVS    [í u}+zFe[^_ÐULWVS    [v MIMȋ   E    E    E    ҋ@@)ЉE@D)ЉEu}}MMĉ}T75w+    VuMΔ   t}D74<t<t뭐VuuMɉM}}v MT14w+l X  X 9utVu}   tM|15t뭐9utVu} =  uFUҀ|4 '  E@|5   E    E    tT}}v uF0VMD8D<EP$]؃    ~Eڄ   ]ԋ6uEPM        ~Eڄ   ]ԋMDE@LH}DDL]ɋE@LPDT]EeeUE/  E]]uE  ?u  MMF}ۄ   ۄ   ɍ<zEuɍ<zEuE    9ut=ɍ<zEu F}   $)uE@z9ut
@zEu}EEm]mMMEu}EEm]mV}    tXE̋M}EEmTpmEE]WF0EP$]̃> uE]̋FE̋Mv EEŰFM}UUm\pmuF0{EP$FM}UUmTtmE]̃> u-Dz]EuFE}UUm\tmFMLhFLh6EP1.utF}Ǆ      6uEP   e[^_Ív UWVS    [ý }u} uDhu`}uDhuS ~} u
   Qv     |Dht    |)Dhu"    uuVWu1v uVWe[^_ÉUWVS    [ }1Dhuj j VW6tDhuj jVWu   	F~1e[^_UVS    [ú Ept0> t#1ҐDh    Ǆ       B~F    vuыpt;> t-1ҐDhtV.u   v B~֋vu1e[^ÐU  WVS    [ uU2u<,u     }   ǅ    1v Ur3tb4Ur3t\G~~j zPUrzPu2     v Wu     t8zP V3j VuD2   v ǅ     1j zR    4u1Wuy    j u1t8zP73j u1,GdM1[^_U   WVS    [ uMUr|4  +$v   x , zPu*       Ut tzP Vh2j zPVu0       <Ut zP V,2j zPVzPUD p,zJv     <Ut zP V1j zPVzPUD p,zPu$0[^_ÐUWVS    [ }E    EPEPuuf,t   <  EH  E  <&t|<#t"<%t  <.   <nD  s  v EPE @Pu0Q  UMQUD4M    EEUMD  WE @Pu01     tj zPuz   jP&VUr"MUJMD4fv WE0u0     tj zPuz   v jPd&VUr&"MUJMD4U    Mt  }u4E0z    uUMQUD4 L  }t*j zPuzPu.E     EPE0Wu)   MUJMD4U    uMt |uEE0{    u.U    MEUBMDMD   U    MUD    nv }uJEPEpWu[(tE   Bv M    UEEMUD
 M    UMD     } tuk3}u)UMQUD4 M    UD     Ee[^_ÐUWVS    [: }uEPuuu'uM    ED:81v    e[^_Ív UWVS    [ u0}ЍxW{Puk)uǆ         W
{PuD)uǆ       ǆ         W{Pu)uǆ      ǆ      Sv WzPu(t%j {Pu0{PuR+   v ǆ       ǆ       1e[^_ÉUWVS    [ MMuEPuu,t   #  }}EM
   }y|4   T
UM
   uE}    }    M   8    }8   uM9t|}M   u8 tc}M   u}}        M9   MuM}    M       }M   u}81e[^_ÉUWVS    [j E    o  v EAMU4A{E   M uj E{Pue)   9  v U4v{E   M u#M4j j uuu  v U4`zE   M u#M4j j uuut  v U4y{E   M u#M4jj uuu4  v U4YzE   M u#M4jj uuuK  v U4TzE   M u#M4j juuu  v U4|{E   M u#M4j juuut  v U4LzE   M u#M4jjuuu4  v U4{E   M u#M4jjuuuK  v U4{E   M uGM4j j uuuUM4jj uuul  U4{E   M uGM4j juuu/NUM4jjuuu)  U4zE	   M u#M4j j uuu  v U4{E   M u#M4j j uuu  v U4yzE
   M u#M4jj uuuKl  v U4{E   M u#M4jj uuu,  v U4qzE   M u#M4j juuu  v U4{E   M u#M4j juuu  v U4fzE   M u#M4jjuuuKl  v U4{E   M u#M4jjuuu,  v U4{E   M u#M4j j uuu3  v U4{E   M u#M4j j uuu  v U4{E   M u#M4jj uuul  v U4{E   M u#M4jj uuus,  v U4{E   M u#M4j juuu3   v U4{E   M u#M4j juuu   v U4{E   M uM4jjuuuoU4{E   M uM4jjuuuw3U4{    u"M4uuu6u.j {PUM4{Pu;"EU9U1e[^_ÐUWVS    [ ujPǉ7UWPWPuR#GG    G    G    G    G    G     G$    G(    G,    G0    G4    G8    G<    G@    GD    GH    GL    j uuW&   (uU :1W     e[^_ÐUpWVS    [ Et,j @}QMtB}PMq    Y  19u~nEE0ҋ}JR|Ruu/Ep[RMtEp"MQt9uEx uj ]}QpU bE@EHuPuuQpp+u@Ph   Mq?E@<MEp0I$UMq87UE    EPh@ Mq$ƃ$Ex@ tp@H1&Ep@Pi  1e[^_Ív UWVS    [* EE}E0}PE0   EP20ɉ׈щOaS  W}PR:  }}Pjuuu ;  EP20ɉ׈щOlu;W}PR%u&EPEPu8    Ex( uj j P  buIW}PEpu-EPEPEp(P  o  iuKW}PEptu/EPEPEp(P   !  v suKW}PEp$u/EPEPEp(P"     v tuGW}PEpu+EPEPEp(Pqu4  v j }P~PEp%~PuX  EH(y uQv E@(@PE@(Pu  1#  cs  W6~PEp uWvR}tj ;~PE0I~  v j EpuPu&Ru8  c   Wc~PEp      }u(j j uPuPu   }u*j EpuPuRue   <EE}0ҍzW|Ru   FE9|jEPEPu/   iu/W~PEpuj ~PunluKW~PEptu/j ~Pu:j m~Py~Pu j ~PEp~Pu   e[^_ÐUWVS    [M
 uj$ǉ7G    G    G    G    G    G   G    G   jWuuPvv t
W@	  1~$ u
~(~$F(x~(e[^_ÐU\WVS    [â
 uj0ǉ7G    G   GG    G    G    G    G     G$    G(    G,    jWuupPUrr ub( tG( EUr0 E$ tG$UB< EE    EPh  UrG,v WV  1e[^_UWVS    [á
 uj(ǉ7G    G   GG    G    G    G    G$    G     jWuuPUrr
 u/$ t#WPw$UrrG t
W  1e[^_UWVS    [
 uj 8ǉ7G    G   GG    G    G    G    jWuu0PUrrX tW  1v e[^_ÉU\WVS    [R
 uj@ǉ7G    G   G G    G    G    G    G     G$    G(   G0G,    G4    G8    G<    jWuuPUrr uZ4 tG4	v UB< E8 tw8Ur8)EE    EPh@ UrG<	W  1e[^_UVS    [>
 Eu9Ftpj @}PFp,~P6PPvDPv$6Pv3Pvv{
1v e[^Ív UWVS    [â
 MMA    A    y$P  v MA    A     q   V   +
 
 4
 
 
 FPFPv nv ~  te~8 t~8}	MI8M0~ HF$VRVRv,Pv u;FPFPv }G0NM    F~}    F~MyA 9F~FA vMIM    }GOM    G }GM9A~AG}O }O}}MAA,A}G G,GGPMQRPRj j 1}GH    e[^_ÉUS    [
 ExH u@H   PPP7]ÉUWVS    [Ú
 u(UU  zD tWr4r,z }    R)P}}    UR)P}G +EPE$G+EPw0uw`	$Ur uz,}U)U}$P  E$UB+EE}}URU}}    UR)Љ}+Oww@+P	
 |
 |
 |
 
 
 
 
 
 1ȉMUr  v ~}URU    } )ǉ+NVUwA+	
 
 
 
 
 
 
 
 
 ȉ1~}  +$
v 
 
 
 $
 
 EPuuVU    ~)ǉPVU    ~)ǉPj j v 	    ~     ~8 tV8U	}8}v<v0v(VU    ~)ǉPEPuv$v uuUB0IjEPu~}    V)P~}    V)Pj j v,uv }G0,F+FEv\UB +BEz}e[^_ÉUÍv UVS    [Î
 uj @0VP&VPe[^ÐUVS    [V
 uV   +
 
  
 
 
 ~  tv j  @0Vsv j  @0V0\~< tv< @0j  @0V.~, tv, @0ej  @0VpP:Vae[^ÉUWVS    [b
 UUz    R-u@Ph   Urs
UzL tRa   UBL   z$t4v }UrtvPuu>uϋUzH tRPPU    z t!rr	UB    PrUz@ tr@r:j UrRPuu/e[^_Ív UVS    [2
 uV
~Lt'> t"vt6PvV4e[^ÐUS    [
 E 0]Ív UVS    [ö
 uE8u!~ tvvF    Pv{e[^UWVS    [q
 uj4ǉ7UW`!PWXPuRGG    G    G    G(    G,    G0    j uuW'   (uU :1v W     e[^_ÐUWVS    [
 }wOMOMuWuuPwPwh    u u tWw   u_j MPwFw0tV  vu( tWRGPRP
j j j j j j 71A t9wtw tM9OtwwMOMO   e[^_U$WVS    [î
 u1E    E    ~ tvu  E    L~ tEPvuK  ~ tEPvu  E   uP	u   +  v EPEP7uui}~cEPE0uPuKEPEpu7u2EPEpuuEPEput
E   ]} tEE@9EtE   } u=~, t~( tv(AUV,~(EFEFEF$EF 2v } tt	Wuj PuL
} tuE܍e[^_UVS    [
 u tD  VP@,Ѓuj PVPu	1@e[^ÉUWVS    [~
 }   DP t	GDA ujWP  19 tKu89"u   39/u.y*u( A A9 t!9*uy/u A 9"u1A9 u9 t9{   A9 u1π? tIu89"u   3  DB u9,t9}u v  
v 9"u1A9 uEPEPWu2u3} u} tu7AuEUEv j Pug1e[^_ÐU4  WVS    [
 ǅ    PuuƃG  j j V!}$j uPPV  v EPjuj u}PPVJE@Puǃ}7j u1PPVPuVryu6 uRuHPPv j uPPVPu t`PA1[^_UVS    [R
 uM9 (    DB tA9 u9   9mu*y t$A  DB t      v 9    9gu6y t0y4u*y t$A  DB t      v 9    9gu&y t A  DB t   n9 t[9cu&y t A  DB t   >9 t+9su&y t A  DB t      1ȍe[^Ív UWVS    [
 u}tEPVwƃu
1   v E> t  DB tF> u}	v FG> tM  DB t> t6EPVu%> t   DB tFG> u믐 e[^_Ív UXWVS    [
 E    E    E    E@HM@PE    |E܍MQEPuu2E   MI MIUREE    KE@    MD    Ex$u !Mq$E@M؉T EEM9A E    EM9A <  UUE@(4Mq$0҉HPjEԉ0҉HPNE1   >    EPuVƃ   MԀ9 t}UJwR+d
 |
 l
 \
 } t0}u*z} t }uj} t}~
Z} tREvuuu   PEx$u7M4IU@(UȊ
E؈@uu   Ív Mq$UUA(4MIEtty2Pu   uRMquǋE@4    M؉|1uX7PRMqu\E؉T0-7QREpu3ƋMIE؉tuuEME9H MI ME    (  v UUE@(UE    EM9A   My$   19q ~&E̊ Ečv    EċM8tFE9p M̀9    AM   EPMtuuuuuƍEPMt9uuuuu51)Mq$v<    Mt9utFE9p 1v E9p$~EFM̀9 uEME9HEEM9AM؋EHuuuPuuuuu4e[^_UWVS    [i
 Myy tqA0aMA0j QNMy tX19w ~Cv MQv| tt$tMAvtF9w MqMAx u	PuWwe[^_ÐU(WVS    [Ú
 MM܃}M1=PM1I   MQ
M0Ѝp}c   VrPRuRvM}tj wPM1  j Mqu܍PuPu
   }cuzVPMq{u`v[}u)j j u܍PuPu   }u
j MqjEPEPu}}ruRVPMqu81ҋM܋A0t	@uRPuVjVu1&v j PMq܀Pu.   e[^_ÐUWVS    [
 }w0tM9Nt`vuj   ~MNF    G0FF    w0VWV~ u+( tWRGPRPj j j j j j 7e[^_Ív US    ['
 u(u$u uuuuuux]Ív UWVS    [
 u}?     twVVjW tP19Wv| tt[Gx$tGvt`FG9p wLW9z0u	GB0GP09zt	R9zuGBWe[^_UVS    [
 u~0 tP    ~ tvvPv~, t~( tv(F(    j j VPeVe[^UVS    [Ö
 uF    > tvt6RPve[^ÉUWVS    [J
 u} uǃ   jD  PDD  URVP@0Ѓ} tx1j !PV6Pu'   e[^_ÐUWVS    [
 uEE} j ?P6[Pu  F E0ҋ~щHEuvuE[  E   uj uPvuy6  uu1  ǃ  }du2uPvuFPEPWuM     }iuNuPv|u5Wu  tj v j Pu1   }pu2uPv(uFPEPWu!  bv }tu2uPvuFPEPuWu	  'j ÁPӁPvPu>   e[^_ÐUWVS    [
 }?!u:ww[ƃt&!PV%9GuWV   v 1e[^_ÉUWVS    [}
 u0ЍxW4PV
u      W9PVu      WAPVu      WJPVu   uWQPVu   YWWPVru    =WaPVVt#j kPVmPuv @   e[^_Ív UVS    [W
 uF   FPEPEPEPEPFPj jj PFp02uE9Fu} u} uF~   e[^UVS    [
 uvvfTe[^ÐUS    [û
 E@TuHTP&P"]ÐU,WVS    [Æ
 }I  u	}    UBPPuVVu"MAPPV VuUBPPVVuMAPPV(VuUBPPVVuMAPPVf(Vuj=  U2uƃu     v Mqtj 
j Pu{   Ut$j kPMtƂPuM랍v 19}~xU4ubƃwEPMtuY} tU	r
ЋM!Au} tUJ~	Ma9}UB   jEPj j BPPBp0MA    tQ|1e[^_ÉUWVS    [&
 u} uJEPE P%  uBpuVu   v E0ҋ}ҍzWRuYu}uvvuu      WP6%u}uvuu  |WP6u}uvuu*  PWP6u}uvuu>  $j  P60Pu&   v 1e[^_ÉUWVS    [ý
 u}WUrPuV  ƃ~ tvo~ uWpFubF0}HFNu   e[^_ÉUWVS    [1
 }uuvPVW  HV   e[^_Ív UWVS    [
 }uuvQPVW  `Vw   e[^_Ív UWVS    [ñ
 uUrPE PUBLЉǃt"wv`vXVRWu	   e[^_ÐUS    [G
 E@TuHTP+P]ÐUX  WVS    [
 uV8    P] PkEPF Pǅ        xGtAww7AP:0HP$EPGuQPv!Pv|ǃFTu$j `PFp,xP6NTj j jWFp0 $@P j jFp0  PPUfTF   tV[^_ÐUWVS    [=
 uPUrǃu1Eu;uU2uGt$jPj j j!WUBp01v    e[^_Ív UWVS    [ö
 EUU8   EPE Puǃt4wvavYVSWEPqǃűE Px  UrP@,Љǃt	WKUBTtR+P2UbTue[^_UWVS    [
  ujx  Pǃ   x  URuP@0Љǃ} uGrjXƋMMNfTfTfTFx u	PjPvFjF PjVwV<.Ph   ue[^_ÉUWVS    [

 U}EPWB PBPЉƃ} uFv j=8@    @    Fe[^_ÉU(WVS    [ê
 E    MAp0E؍PMqƍEPEPEPEPEPVj jj Vu؋MA0a@9uu} u}w} tu1sv    HEx1EPEPEPEPu؋MA08t19uvUv 9<t@9Ew} tu{} tuje[^_UWVS    [Ý
 E}%j PU2'Pu  v j UrPuǃ^  BPWh  Ɖ~UV?FFL    F4    F0    ǆ       F(    F    F,    F     F8    F@    FD    FH    FT    F\    F`    F$   FP    Fl    Fp    FtFxǆ   ǆ   F|ǆ   ǆ       ǆ       ǆ       ǆ       ǆ       ǆ       ǆ       ǆ       ǆ      ǆ      ǆ   '  ǆ   '  ǆ       ǆ       '   ǆ       ǆ     ǆ0      ǆ4    $@ǆ(     ǆ,     ǆ8     ǆL  3333ǆP  33?ǆD     ǆH     ǆ       ǆ       F    F       F<ǆx      |  |  |  |  |  ߀|  ǆ       ǆ       ǆ      ǆ      ǆ       ǆ       ǆ     ?ǆ      ǆ     ǆ      ǆ      ǆ    ?T  P`  Pl  PV8Ph " v( ;PV<8PFp,uFj EPEPVu1   (uF@,U1v v$   e[^_Ív U   WVS    [
 u~LhuVuuPvutt     v ~T~~X  V<9t:$  9t0j JPRiPu   F<   k  h9~L   |    P  Pj jPvLi1ɃI2  t<u]݄20  ڌ  ٽppl٭lۜ2$  ٭p&u  $  u  @  A~v(vF4 EE    EPh  vh~@ tv@6h~@vLEF8 Ev, EE    EPh@ v0h~D tvD6h~DF0 EF4 EE    E   EE   EPh,! vh~H tvH6Hh~HF8 EF\ EE    EPh  vh~` tv`6h~`FLEFdEFhEF0|F4xF8Ev,EǅtU  tPvAjVi1\[^_UWVS    [ù
 }uuVWuuPXPue[^_ÐUWVS    [i
 Uu
0  +8v @
 4
 
 
 
 
 
 
 
 
 
 
 
 
 ~ tF    vvPvV9PV   ǆ       ǆ       F@@H   F@DH   jv   9B}	B      9B}	B   BBHzz J9   }   9   }   |  
v |  |  @jVe[^_ÉU,WVS    [
 }    tjEP   uFu؍UUVuuVuNVtuVt   @ tw@7AD twD7.H twH7` tw`7    t   W3  jWl   tYPj 7WPWe[^_Ív US    [
 Uz tBB    P]ÉU0WVS    [â
 EUEUUEPRM   11M9   ~UvEؐ9|~EEPEPM؍  EPWVM   Qg)DEE)DGM9   | ~M   9D.vMD    D    D  ?(  E   LME    |OM9   cvEԅ|VEPEPMԍ  EPWVM   Q)DEEL)ȉDt|EOM9   ~} uE   vDM+   +EMDE    M   9|~HvEЉEPEPMЍ  EPWVM   QE܋EEE܃G9|ËL)M܍vE}M\F.1vM| }D    v    MD9D}DDF~Íe[^_Ív U(WVS    [J
 MMIMUEPRM   1MLM܅uMAMD    19}~JvE؍v EPEPM؍  EPWVM   QDEEDG9}MATADFyM   9Eu   9EtuuuM䀉|  |   |  @jQe[^_Ív UWVS    [2
 uNVT҉UQ@+UUVU    )EyD+})Ǎ   PWuV>jV)      t   V>/  EPEPWuV5+     ǆ       ǆ       F@@H   F@DH   e[^_ÐUS    [s
 E@tjP]ÐUS    [K
 EUt	t|  
v |  |  u|  P@P]Ív US    [
 E|  t8|  |  t|  Pev |  t|  PN   ]ÐUVS    [Ò
 u|  |  |  tV@P|  e[^ÉUWVS    [F
 uVU   5     NTɉMR@)ʋNM    )UURD+U)U}     |  tV|  |   tV%  |  ߃   9FX~	FX      9FX~	FX   MA@+FX9   |H   UBD+FX9   |H      +   AM   +   BU      MqRuq6QǃU9zuuu      
uuj j v@W6    tuuWV   M9yt2      uuj j v@qW6(W6v$vVTUҋMAD)PA@)Puuv(qQ$|  @t6~T ~0|  tF`jv(ugUrvTPRtǆ   '  ǆ   '  ǆ       ǆ       e[^_U4WVS    [޼
 }Gu9puwTwuԋwTwuGTG+   EԋGTG+   E؋uux  uЉ   1ɋ   9   v E    Ћu9p~uv BUD       @D       @D       @D       @dE̋   u9rA   9
kuuVW&  uVW(   uVWR  Ǉ       $j We[^_ÐU4WVS    [Ê
 MqqTuE    E       :  MMMỦUЋBUDHȋu9     9     E    E    M}9O  uu܋}}}MЉMЋqu}}ԋD>HEuM9   Y  9   M  }ЋGME̋UDugDt`jj uԋ}D7u+D+DPMЋAu܋D0u+D+DPE}GDPEGDPMq,uqp$u   űF}EEԅ   MЋxu/jVEtFut0uuQj }Gp_uMq}   HMЋ}܋<9u؋uMqPE<ujtM܋utuu؋}7j u M   UpTUEEЋ}9xDM   UpTUE}98E    M   u90~{E    Ћ}9x~Uv BMEEԅt%xuu   REl  PE}   M9JEu   }9:M   El  Pe[^_UWVS    [V
 u}j j jj EPvxvtVY t.E+E@PE+E@PEGPEGPvHuF0De[^_UWVS    [
 M}UBp  9uE    E   0   uFp9uE   E   1`  E    MUU1ɉ|t݃} t'} t!9Mu    u   D   v DU9   It+   D9   | }}$ rD    U   D9}$ Nu   HD    E    U9T~.u   DEEUDEu9tԋU   DEEϋuTHDA}  t#uvX7URXWuvXwURXW   e[^_ÐU   WVS    [
 u}dpǅl    ǅh    t&t!PjEPFPu9  EP}7uuPEP}wuu7u>EP}wuuEP}wut   6  EEp   uu  d    t	|  tdd|  dGT+G)EdGT+G)E1ҐDǄ|    Ǆt    1d   94   DD+A^|t#D9D~	~|4A+D9D}%D9ߋD++Axt~||tI)LFd   94oB-td9   ~} |ǅh   'v xd9   ~} |ǅl   } }E    } }E    l t1h tuuy/l tuuh tuuPEPE uj EPu^1X[^_ÐUWVS    [
 EEE    MQEPMq1uuSt
   ?  E   M}   Et1j QMtPuE      v    9u~HMM}0JRRuu
EDE9uuut`uuuu  uuƃt9MN? t
7s7jj EPEPWu  tE   v Wu  }t
juEe[^_ÐUWVS    [b
 }EuURURp0VWt   7uuVW;  ǃtuu   1WjV1e[^_ÐUS    [
 UEj 0RPru]ÉUVS    [ò
 uEMUuj j tjQPRVj 1RPrVe[^UVS    [W
 uEPEPEPuuVuv  uuuu   V1   e[^U   WVS    [
 EE 0ҋҍrV҈Rd   }t!j PEpPuPPEppu۾t
   .  ,W֊PW@p,WPV VWVVW   v VPE0nuY}t!j PEpPu,VPV5@p,V#&j PE0&Pu   ,uƍ,P[^_Ív UWVS    [
 }uEPEPw7Vu[uXuuVu  tj w2PRvu)j 7PwHP7JPu   e[^_Ív UWVS    [V
 }uEPEPw7Vu軼t      uuVu)  u,j 7PwHP7JPu,   G}uj j %}tj jGPEPRV  j w2PRvue[^_ÉU   WVS    [{
 u}}u<XP6uu\Pvut#      G@@XG@D\GGTX)XGGT\)\`PRQW)1MT`Pv GGT)X    TPD*PvPPW  F~EUPREUPREUPREUPRRPuV$(j Vu1@[^_ÐUlWVS    ["
 }EURURp0uW臺u,uubPuVWj VW1v    e[^_Ív UWVS    [î
 uEEE0ҋ}ҍzWhRu+uB}u\EPEPvvuuӹ   uuuu     WmP6   }t PjFPEPud}EPEPvvuuWuVuuuu  tj 
j Puk1"v j tP6&Pu   e[^_ÐUWVS    [V
 }uEPEPEPWjVuu  u2EPwuuuuuu   V1   e[^_Ív U   WVS    [ר
 uUUz}EP6uuEPvut
     U   uu0   v }    t	|  tuU|  }GT+G)EUBT+B)E11}   E94~?UT|+|D~FU   U94Ћ}   94U   4NtA~}   M@EEUppbPuVgu?j Vu1t[^_Ív U   WVS    [[
 E    E|E@x0ҋxҍzW;Rxu|t5WPEpu|Ƅ   ||E x0ҋxҍzWRxDu'v6bPuVFjVu;  W҈PE0   }usEPEPEpp|u蠵t   *  E9uE9F   UUEEEFEE   EF   j jWPE0^u}}u?>u
~   EEEFEE   Fej PEpP|@p,Puo   Ej PċPE0ȋPuD   } tjEP|1l[^_UWVS    [¤
 u1       E    jjujEPUMt4V td   9E}E         9E~E         9E}E         9E~E      E}htjV蔶e[^_UDWVS    [
 UURM   E܃}   E}WP   4UDM9   }  u
A@@}G@DEUBTB)EE    }M9   ~YI4MU9L~EEPEP2  EPQR}   WT)EEE)EEMU9   }   }    }܋O}U   M<}؍    UԐuE    MM}9L~eUUԉUЉEPEPMЋ}荄  EPuWU   R訳)ƋEE)ƃuE|EE}M9|} uE   UUM} bUM}+   M܉Q   v M܋QM}   U}    IM̍<    }ȋuE    UJUM}9   lUUȉUčv EPEPMċ}荄  EPuWU   R贲)ƋEE)ƃuE|MEUM}9   ~} uE   M)MEWM}U+   }܉Oe[^_ÐU   WVS    [
 }MAǅp   8xu
ǅp       l  h} uXEPEPpM    ȍ   PW	  EUPREUPR׋PuVG(j Vu詼^  pM    ȍ   EPM1u蝽uEF   v uк|PEPEPEPu߰P   +$`
 p
 X
 ̟
       VEuf}]؋F@EP$ٽxxt٭t^٭x(v p|W|FF~ }F    F9F}FFl9   uh9  t|  |   jW薱1\[^_ÐUVS    [
 uEURuuuu0RPvv色(t
   v } tjjV$1e[^Ív U  WVS    [o
 u0   ЃO=  ~P該ǃ   UP,   p(p p$ph4   PWл Wv脷tPvȯv耮9tW[^_UWVS    [Ö
 U         0+   x+   }1}1M    9   ~EU   UM   @9   ~Ev U   UM    ~S~O      U   H   BHB M   @$       UJP(jQ4M    ~R~N   @       UJP         P$M   A$HA(ju} ~J} ~DU   @       MIH    @$       UJP(j u~b~^M      U   H   BHB M     U   H$   B$HB(jue[^_ÐU(WVS    [Æ
 uV莶VE`  P}   }}u9G}}WuF}9G	uuvu	}}9U'  uF}9G}Ev uvu}Gu9F	~u}}
uvu}9}   Uu9   }}؋u9   v U}+u+wu܋}Gt0
tjv t;`u   @EdC}   @EL'u   @ETҀdTE؋}9}bEu9u?EPE`  Pi} le[^_U,WVS    [î
 }E       u90~=1ɉ9H~"v BuԋdA   9JEԋ   u92ŋ   0+   u@+   E} }E    } }E        9   ~E
   u؋   @9   ~E
   u܃} ~A} ~;E    uNuE    uNuE    E    EPEPW    ~M} ~G      uEHEE    uNu   EE    EPEPW    ~M} ~GE    uNu     uEHEE      EEPEPWW} ~V} ~P      uEHE     uEHE   E苇  EEPEPWe[^_UEUM`x ~Hp@ÉUDWVS    [B
 URU1UĉUU   f~ ~NvF	v > tM$$9Pu貴j u6uC(t @Pu譨ueGrU    t8} t2   rtmPUrYUre[^_ÉUVS    [B
 ux uj萪x     xuu   z9xu
ǃx    e[^ÐUS    [ߕ
 Euu   ,]Ív UVS    [ò
 u> t
6DV{e[^UÍv ULWVS    [v
 u}U      MU     Mu}j蠩E     UB    rz11E    M9   ~_vEԉ9|~NEPEPUԍ  EPuVM   QǋEEǋUE؋U؋M9   LM9|~PvEЉEPEPUЍ  EPuVM   Q蛥ǋEEǋUE9|9|uD   v D    F
EMEUM܋PlU܉BBPZM܉A1v 1U9<   vM̋U9   ~}v DM+   EEPEPU̍ҍ  EPuVM   Q赤EU܋DMUTM܋LEUM܋LEDGU9<fFHM܋	    P肧U܉B192~Xv M܋APaǋU܋B<19z~)M܋AU    AdG9yFM911U92   1M9y   U9   ~uEM+   EȋU9   ~}v EM+   EuuȋU   裤EM܋AUMU܋BUȋMTM܋AMċULGU9zWFM91;11U94~/M܋DUMTMTTFM94G~E܍e[^_ÉUWVS    [Å
 }197~G4QF97wAw9w1W+e[^_Ív UtVS    [+
 UB   tPj jj j EPrxrtR% t1E+E@PE+E@PuuPuV訮j Vu1e[^UWVS    [î
 uE0ҋ}ҍzW{Ru1uXE     uMQvPuuӟ   }uuEPvPhM	E~WP6uhM     EPuQvuueu&}u*EPuPvuu:t   v E M1e[^_UWVS    [Å
 ujTܣǉw4G8   G<    GL    GP    GD   GH   G@    jW^e[^_UVS    ["
 jp|jV2jF4P'FhFle[^UWVS    [ڎ
 1UUv uUP蛬t@p~ ~v4WPD  V\Vfu若uG~u6E4P*u2e[^_ÉUWVS    [5
 }uWG,Ѓt6puG4PG`Ѓt PB9F~
VRB,v RVF,Ѕu1@e[^_ÐUWVS    [ɍ
 u}uVF,Љt@UuF4PF`ЉGu1G@UB   e[^_Ív UWVS    [^
 EUEU1vEPtEPMD0Љǃ} u	GD(t{DGMDh9D~DDhF~EuVuP@0Љǃ} t'MOyEVuP@0ЉǋMOyEGe[^_ÐUWVS    [Ê
 EPEPuuut'EuP@,ЉǋEuP@,Љƃuu14v ttWRVLVWuuɌP褦   e[^_Ív UWVS    [
 E+E@   P7EE    }9}|aUR4    WEPMD1,ЉEuUM    v UBMUu荦GE9}}E    }9}|dMIEv UMt+uU< t3EPWEEPMUD
0ЉEMUBx4}GE9}}uƭE@MU9DhE@9DhtDh   1e[^_ÉUWVS    [Þ
 UE   z u@6EPR^t"}@ M9t~tWlue[^_Ív UWVS    [2
 MIuUR}D,ЃuMQA}Azv pV8wu+(vȉ
 p
 
 
 uVuu1V<+v FL}Mڌ  }EEm$ZmFD}FHM 7}? uWVuu	v MQ}GMG} Ѝe[^_ÐUWVS    ["
 EUMuuEUME    }|    D   Ɖ u0uT}   DhT9   ~z   ouD   Ɖ t#uttuܥt8   R}Du   ThBT9   ~	   }D8 }     E}1e[^_UWVS    [
 }URuURMD0ЉE} u@!u,uFuM9th}thu(u$8Pu uuup}( tuM(	1e[^_ÉUWVS    [b
 E   E   Uz tLzL tF1}WvUPt @@4@9D}DWuF~} tEU} tEUe[^_UVS    [ʆ
 uFPu蜤Fu       
F@1e[^Ív UVS    [Â
 uFP臝Fu       v F@1e[^Ív UVS    [:
 UuFP2
Fu       F@1e[^Ív UVS    [
 uFPFu       v F@1e[^Ív UVS    [æ
 E0v躠v負e[^Ív U WVS    [r
 UE    }1҃} }E    9U}EU1} u   UM9   <E    ǉ}䐋MIuUR}D,ЉE   HMEPMP躢tHv @uP@,Љƃt FtE   P7V辟EP袛uu裟uKuSE}9}E} t
jue[^_ÐUWVS    [2
 }} 2  }1} }E    9}}E}ǋEy4ڋE)@9~4:FPWuuuy9}   UEE} ~9U|UB
v 9|GPRuuu5} ~EO}EMAME   Eu9tnMIEv uuuuVMuD,Ѓt.xMMMO4P;EPuuMD0ЉxuuM9Mue[^_US    [ۂ
 UM    t%EPE@PQR\PP̠j PPQҞ   ]UWVS    [u
 }u}"ݎPjGPEPu辟M  V7u蝟ueFPwu臟uOFPwuqu9FPwu[u#j VGPEPuMqu襙t      v 9V}FVV9V}	FFVM   9B |3M   F9B"M   F9B(|M   F9B$~	   ^M   9B~BM   F9B }B FM   F9B$~B$FM   F9B(}B(F1e[^_UWVS    [ހ
 }uM$EUUE UE(   @,Ewm+h6
 
 t
 \
    )   )9@  U )  U():&   )   )  E )  E()8e[^_ÉUWV119M|M9Mu}79Mu!}   PtH}$}   PtA9M}119M|K9Mu} 79Mu!}   PtH}(}   PtA9M}}   @}}   @}$}   @} }   @}(e^_ÉUWVS    ["
 }}}9}  u} 9y  },    EPEPEPEPVuVuu}   @}$MDtMjj E+E@PE+E@PuuQ}   0w豐   @}L$   }   @}D   }9}uD}09~D}9}u*}   @}D}09G~GD9uu+}   @}UD}09G~GD9u u+}   @}U D}09G~GDF9u E}9}j}$    EPEPEPEPu uuuu$}9}uF} 9}u>}   @}EDt}(uE(   v }(uE(   u(u$E+E@PE+E@Puuu}   0w)e[^_ÐUhWVS    [ê|
 UUE    E    E    E    E    E    E    E   E    E    E    E    E    |PEPuuuRE   } uE+E@EE    } uE+E@EE    EPEPEPEPuuuuuUȉU$9U   u9u|lUUEExuEH9}}}9M}MEEEEEURuuPQWuuuuu ,EE9u}EEEU9Uw}uE    } uMuj	u  uE    uj	u  uE    j U2EP|P胛Ee[^_U   WVS    [ïz
 UUE    E    E    E    E    E    E    E    E   E   E    E   E    E    <PEPuuuRE=  juԋUr@EEPEPEPEPuuuuuE    E    E    E    0EvuEEEwrEEEwrEEEwrEEUU9U  v UU9Ue  U|EExUxEp9}}}9u}uEPujj VWx|uuu,}    EPEPEPEPVWx|u$Evu#EPuPuuU   02`Ew(r#EPuPuuU   020Ew(r#uEPuPuU   02 Ew(r#uEPuPuU   02ДEEEU9UEEEU9Uw}uE    } uhuj	uk   uE    uj	uP   uE    uj	u5   uE    j U2EP<PEl[^_ÉUWVS    [Bw
 E}u
E8v EPǗ8uV)VET  P誓} t+MMuT  U9zt,uVo} uj/}uMJMx  B   /MJMJzMx  Bj RET  P蜍1e[^_ÉUWVS    [Zv
 uVbVET  P} tlUU}T  v u} uFU9x  ~1uWȐ~uv跕	vVØuWg} ue[^_ÐUS    [óu
 EPE@PuuPP诓]ÉUH  WVS    [ou
 M}Gǅ   8cu
ǅ    PM1u蔒	  0}ȉNu蹏V(PM1觎t(j 0P}7SPu     MqqdPV|PV}        ЉƋ1  PEPEHPQuE,  >  ubǄ>      uǇ0      Ǉ4    $@8M    ȍ    ȋǄ80  Ǆ84  ?M    ȍ    ȋ8  t
t9   M    ȍ    ȋ8   8$     M    ȍ    ȋ݄80  ڌ  ٽ٭ۜ8$  ٭[MqqdPVԐPVEPEHP   Wu4 tj@[^_ÐUS    [Ër
 EPE@PuuPxP臐]ÉU1ÐU1ÐU1ÐUWVS    [2r
 UB      z upz ujzuazuXuVVE`  P腎} t7UU}`  uuW而V蚔uW>} uًUzuj Rv j uE`  P衈j EPume[^_ÐUWVS    [Nq
 }uh  VUFEFEFE9Q}AEE9A~AEE9A}AEE9A~AEFAFAFAFAj EPW҄V謓e[^_UWVS    [îp
 uuE    }t,}t&PjEPEPu  uF8au1u`   j Pu舌  v E   ,v uF8cu	   uF   8su   jdExEPu6uJo  EPvu-R  }   EPvut0F׏      u,uFEPuvu躌tBF׏       uuFuFFFF  uFp9tuV9V}FVFv uF    F   uFp9tuV9V}FVFuF    F} tuu*uu9u|   1v } tuB   e[^_ÐUS    [Cn
 Euu   萀t& @t
tv @@41]ÐUWVS    [m
 u9u1Vv E)   P&E19u|1Ut} uuVVuu(UFG9u}ЋEe[^_ÐUS    [km
 uD]Ív U0WVS    [Fm
 EEE     tۏE   7  UU0ɋ}؈щNVRu蠆uE   1@VPU2ztj PU24   E       } u6j URj Epuu{Jj URj Ep4URj Epj uu{URj Epj uu{UEPRU   ~M9M}	EEMUE9T~E9Eu
1  v Eu%j FRUtPPu{Uǃ      ǃ	     ǃ	      E苴   uE   U9U7  EUE0ɋ}؈щNV\Ru؄   EUtb    uǃ        EUth    uǃ       EUtp    uǃ     g  j uPUEt"  VPUE4uyUEt    uǃ	        UEt    uǃ	         j REUtP  VREU4zuU} uEPj UEtj v j URj EUtuuytLǃ	     z  v VPUE4   ǃ     UETU܃EE9E  u  V荊juVRu+uFuuuuu贈ǃ   ,PjVW'|E    9u}Ut;P%yE9u|WuuuU   貊t9ju?j PUE4,Ru菄ǃ	     Nv E耈|  jPzVWua|	   uu轂  u  Pŀǃ    	  e[^_ÐU(WVS    [g
 EU:E    	   t	1  uu  v          uWQ贄E    uoEPQ賄uEPW蜄t!?Pyǃ	     T  E9E|eE9E4  E(    ugEPQˁuEPW贁t	u놐E]EuE      v E]E   념  u؋vQu/Wu&  E	  VuƂ 	   tPxfEj j P2?yEU9t: t+蜀j ϑPǃ	     	   u]Ee[^_ÐUWVS    [Þe
 u}Ej PVv]9u   E8 t  DB tEU: ujPu~uOEE8 t)E   DP tEE8 uE8 u]EtE1!v j PVPu   e[^_ÉUtWVS    [òd
 E    }   j PuрU
w|+`d
  d
 Td
 ,d
 j "^Ep/RuVj Vu{BEpp2RuVj VuPv j 'Pu7j 9Pu#Ur/WuV蝁j Vu$j APuUrWVqj Vu  Etj RUtI  }u   E    U9U  EEUEU0ɋ}щJRudP|   UEt"    uE    E    `  UEt'    uE   E    1  uUEtUruyuE   EE   u}EPUEtut   E   EUEU   jUE<    u)utUrulyupEEsv pEU<    u)utEpu(yu,EE/v j vREU4Pu}      EU9U$}  tkE 9EtE   UR9UtE   E@EE@tE   UR9UtE   E@9EtE   EU }u   1e[^_ÐUWVS    [`
 E}"j ^PU2sPu|h  j UrPuK|ǃJ  PWunqEuW%  PWPu hx  tj    PFy~UV FFD    F<    F8    F0    F     F4    F$    F@    FH    FL    FP    FT    FX    Ft    Fx    F|    F(   F\    F,    t  t  t  F`    Fd    ǆ       ǆ       ǆ       ǆ       ǆ       F    ǆ       ǆ       ǆ       ǆ       ǆ       ǆ       ǆ       ǆd     ǆh     ǆ      ǆ     t  ߀t  t  t  ǆ      Fl    ǆ,      ǆ      ǆ      ǆ       ǆ     ǆ     ǆ`      ǆ       ǆ       ǆ$      ǆ(      Ul  ǆp         Ps VDPh " vorVPh  l  Wr PVPFp,u|Fj EPEPVu  (uXVu{ruHj V|}  j Vn}  j j j j V"     t   F@,U1vd{   e[^_Ív UWVS    []
 }uupVWuuPP	{upe[^_ÐUWVS    [þ\
 uMMUJUEPj QVRuu%  ǃu	   U} ~jj VuWu*  j j j GPprtWu=     j w(usx1e[^_ÐUWVS    [\
 uuu6utE˖    uE    UJUEEPuj uRuu$  ǃu   W} ~jj uuWu)  j j j GPpqtWuG<     j w(uw1e[^_ÐUWVS    [:[
 EEE@E0ҋ}ҍzWRutuu   3WPEptuu   
u   E E0ҋ}ҍzWWRuAtut}u6Epuu1|u      9      j [PEpjPE@p,lPu^v   gv WPE0su> t4    2j PPE0Puv   1tu.  1e[^_US    [×Y
 UEj 0RPruj]ÉUVS    [bY
 uEMUuj j tjQPRVD  j 1RPrVSue[^UWVS    [Y
 UUU2    u&U   RlU   R9  -  v UU0}Ѝp}tZVPRDr   VęPU2'r   VϙPU2
r      Uruuyǃ   VPU2quwu&lWu8  ^v VęPU2quWukWu8  .v VϙPU2fqu#WukWu58  uu1<j ؙPU2j PU2APus   e[^_ÉUWVS    [5W
 u}6WuxtBBPx tj vp,PRwui!j RP6cPus   e[^_ÐUWVS    [ùV
 }u7Vuixu   G}uj j !}tj jGPEHPRV$  j wBPp,PRvuqe[^_ÉUxWVS    [2V
 }u}u7EP7uysuEPwucst      F@@EF@DEF Ft)EF Ft)E$   t	(  )UEPEPvdu  9  EPEPv`u  9  (EUPREUPREUPREUPRjPuV!s(j Vuq1|[^_ÉUWVS    [!U
 }EpWuvƃtvWiNtWr1   e[^_Ív UWVS    [T
 }EpWu|vƃtvWhftWr1   e[^_Ív UWVS    [vT
 uEEE0ҋ}ҍzWRumu*E    u  j    p(uWp]  WzP6mu6}8  vuuu  Ruu-    WP6emuzEHv  }t}uF8 uE   vuu*u@  r  v(u%ivu  WP6lu2}\  vuut  j r<  v WP6lu*E      j    p(un   WP6Mlu*E       j    p(un   WP6luF}  vuustj v ulj P  WP6kuN}8  vuus  Btt	v Pug1  WP6MkuFPEHPuuBb}  WP6kuN}   vuus$  Ru5  vj r(u^mdWP6ju.}uDvuur   j Bp(uv WP6ujuj}t$2PjFPEPun   v vuuFrt`Ru<5  j r(ulWїP6it*j PP6APu]l   E   Puj!  e[^_U4WVS    [O
 Uut ,PjFPBPu/m  EP6u
muEPvult     v M   @tu	t  tuouxiuu  E  M}+O t)}dMԋuM+q +qtq`$   t+(  uum})ǉ}uuj)Ɖu؃+  M9q0    }`     M9O,   }l   GM9   uA,A,%}WBM9   uR@+Q,	}GP@MIlMЋAA)AA}L)ǉM)щM̋u)ƅi  }9O]  U  9wL  Mq(ucPuc}Gl 0ucVuwl-aPuc  v M`   u}GM9   t	},)}11E    M̋}9       MЋ}̍MT9U|tG}̋M9     v ~})}u̍0PuVjMq(ubVub}WPM̍4    |2 t8D2 0ubuu܋GPt0*`Pubv uTg1e[^_ÉUWVS    [ÂL
 }UuEP2Wit   A   @tu	t  tVlV_fuV  tj p(Wah1e[^_Ív UWVS    [L
 }u7Vumu
   >v t  t'p   tp  n7\p  
jPV#  1e[^_ÐUxWVS    [ÆK
 }uG         @tu	t  tWkWpeVWVg+G`EO OtMWJ@)MRD)UE   } E   v0uE   M9M}ZEE~PuUW WtMD9}}}9|G9|&PMD1PRV3PuVmhjVuba1|[^_ÐU WVS    [nJ
 }uOdMO`MVW&iEVW\fEFPx t	@@FP@Ev0uWG Gtr@)ƋRD)U$   t	(  )M   }    9u}H  u?OdMM9OdUGd9~)9u}+EM)Mv OdMW`M9M}P+E9E))9~E+EU)%M9O`~Uv uuEG`9~+UM9Mu9Ut&MOdW`} tj W*  W     1e[^_ÉUWVS    [H
 uUU0>ЍxE    E    WP6^bu}uEPU   R(    vuu6jǃw  }u#vuujX  j ]  v Gt  Wuq'  c  W?P6auFvuui  @ttj 	j Pud;  v WHP6mauJ}t$˖PjFPEPue   v U   Ru  E   v WWP6a   Ev#LPjFPEPud   vuuhǃt}u3vuuhu
E   UjPWu  E@Gtu:Wu%  E   %j VP6APubE   } tu  Ee[^_Ív U0WVS    [bF
 }uNdMЃ} u!Q0PuVdj Vuub   7VugtPVd   EP7ubc   u`EPEPGPEPuVPw`+LE
 |E
 pE
 E
    eEڎ  }؋EشEm]muV_(  
uV;(  EM9MtEFdj V'  V	  u_1e[^_U0WVS    ["E
 }uN`MЃ} u!Q0PuVbj Vu5a   7VuftPV`   EP7u"b   u__EPEPGPEPutUPw`+\D
 <D
 0D
 dD
    eEڎ  }؋EشEm]muV'  
uV/'  EM9MtEF`j V%  V  u^1e[^_U   WVS    [C
 uVDp  uVuuPvu[t     t   t+9  t#j Pu_          
ǆ         t   8 u"t	PfmPT   p9VDt$h  Pd  Pj jPvDW[v0vi\F< EE    EPh  vcǃ~H tvH6te~HvDFXEF8 EF< EE    EPh@ vcǃ~L tvL6&e~LvDWEF@ Ev4b EE    EPh@ vXcǃ~P tvP6d~PF8 EF< EE    E   EE   EPh,! vcǃ~T tvT6~d~TF8 EF< EE    E   EPh vbǃ~X tvX64d~XF@ EFx EE   EPh  vvbǃ~| tv|6c~|FDE   E   EF8|F<xF@Ev4aEǅtU  tPv7RV^1d[^_UVS    [ò@
 Eu   +t@
 ?
 ?
 ?
 ?
 ?
 ?
 ?
 T@
 ?
 ?
 ?
 ?
 @
 ~ tF    vvDWPv+]V`V  LPVR*V  jV!  t  
v t  Vo  e[^US    [?
 UE8ul   tR>  ]ÐUVS    [ê?
 u    t   V     V  ~H tvH64b~L tvL6!b~P tvP6b~T tvT6a~X tvX6a~| tv|6a   t  a   t  ap   tp  aǆp      Vv*Q    tP2Yl   t
ǆl         PPXj 6VP_VIae[^ÉUS    [O>
 Uz tBB    Pg\]ÉUWVS    [>
 ut  $   tt  @t	VYN   @tu	t  t"`   tv,v j    V  E    E    M9       }ME|t  D}D:\   @PMUDE   P$   t9U}  }T8v   M}|  MTUAM9  Rt  }     @4  }~ ~Nd  M~ ~Vh  v    P4F Ft  F Ft  F FtE$   t(  Ruv]jV  V   e[^_ÐUVS    [2<
 ut  ut  VP  [t  tV   e[^Ív UVS    [;
 ut  tt  VP  \VUe[^Ív US    [ç;
 Et  tt  PP  \]US    [s;
 Ut  u B   tt  RPZ]Ív US    [/;
 Et  tt  PP0\]Ív UVS    [:
 EPtPtt@t#8rv Bt  @$   tPօtVvNvXe[^ÉUWVS    [~:
 EtPuRǃu1L  v 1jxNƃ} t!EPuE   PU   Љp} tUB$U  ~VRZFP!FTFPFT   FXv\F`    Fd    } tuJF(F(    } tuJF,	F,       vUVUVF    F    F    F    F     F$    FPxFl    F0    F4    ftftft   F8F<    F@    FD    tFPGe[^_Ív UWVS    [8
 }GttWu(  M9   u
ǁ       M9   u
ǁ       M9   u
ǁ       1CWP| t0TxuRE   PPGPtZFM9  l t(WlxuRE   PpPwlZGT9GPtwPZ( t'w(E   PM   Ѓt	PS, tw,Z( tw(Z< tw<ZWZe[^_ÐUWV}uM uwwF    F       v } | Gtv } ~
@Mut} t,U9Wuwv UBpUVBFr<t 9OuwApAFNqGpGFF    we^_Ív U   WVS    [û6
 E    E   UE    E    E    E    EE    } {  Mtj ˛PUt՛Q  v 1E    E9E3  v UU}0щOWxPROEuUTU   WQE4OEu+UtuuWE  E   v WQE4EOEuUtuu9WEWQE4Oǃu(URMtuRǃ   E#v 9utEUMDDE9uUM E      }~%j PPuQ1  v } uU,  
MuueGu
1  v }    EEtPuu4VEuQ  U   UMq$0PuVR} uV#EEE   =  0}҉RYHEE   VEPuJPuQ   v EPuoJǃuuE    nw+}~GPGEUUu*ME8ux u
E    -UMA Wuu\ME } uU   UJuuuTEu0uMj RPu9Pu1O1   v uuuTtj QPubNv } t"EM9Atj lRq(nQ&} t.UE9Pt#j lQp(PuN1PuMuVuuuƃt,uuuVuuVu;F uP} tuT} tE9EtU9UtuTt[^_ÐUWVS    [ú1
 u}EPuuuuGPp,PWvv\E(t	   "} tWVEViO	v V1e[^_UWV}   1ɋG Gtu)w`$   t+(  }+    t^   PtQBt   Ru=9r4;   z t"Btv @tt@utۍv 9   u<1:RtBtu!9B49}B09|J0׍v J4RuȉЍe^_Ív UVS    [b0
 Uut=V   P   Ѓt@'j PVPucL1	v    e[^Ív UWVS    [/
 }uE    VWKEuWK9E~Euƍv Ftu+Ft9Et } t	VW  VW  E   9utJ~ tv뿍v ~ tv뱐Fx u9   t֋Vz t9   t	Fp끐Ee[^_ÐUVS    [&/
 Eu9   u1/vPKFP0@t9t@tuP4@uЍe[^Ív UVS    [.
 uU9   tB9   u1rVsMF,e[^ÐUWVS    [Å.
 }Ept0Ft$<uv(WFD~ tVuWvu1e[^_Ív UEHt@t@ttÐUWVS    [
.
 UBtu}t    Ubt}9   u8B0    Bh    19  ~:URPD    A}9  uuu   UR,U}G0G4WU   v }Gtu{GtuUt  tuuu+1}9  ~?v URPUE}OPDU9D~D}DFU9  ċ}W4}W4}}ke[^_Ív UWVS    [þ,
 uMqhA0    Qu   E    Mu9  ~lMQPuDEMI$ɉM}tPKuvuMyu9~0}~0MAPuMLFuM9  uFPMHe[^_ÉUWVS    [+
 UBPH  xuZy( tA,A,Ey0y t*AAEy A9~6)&uF,F,UB,B,EyquVTUvTuAAEUR0+QU   uNLwJ+*
 *
 *
 *
 *
 *
 *
 *
 *
 E    v EEE}UU.uF,F,EUz0E    Eu`   tUB9   uv,uuNUr@OzDuNrHuNrLz@ }B@    UzD }BD    u~H }FH    UzL }BL    uV$uV@uV$uVDuV$uVHuV$uVLe[^_Ív U WVS    [)
 }OMwut    p   tFp  WVqKuVTDv j PWp  eLǇp      l t$GW Wtҋ@@)ЉGp9  ~	  GpWO M    RD)wtu    )WhO Otwd)MO Otw`)M$   t(  MMqqDq@q7FEuvDv@j j wHu7I0G Gt+GdPuu   wLuW    ~+w(w WtFD)PF@)PRRw0uw?$t ~1t  tG|jw0w?uwtPuAMu9Nt,j j vDv@j j wLvQ7s=(u7F$     W Wtuv@)Ɖu(  MwdQuRRl  5Il  Cl  puup7DE,uuj j wHu7HVuuj j wLuW@l  <M9Ht,j j uuj j wLpQ7<(u7CE    tA   w@t,Pw8w7l  6     P9e[^_U8WVS    [ö&
 }uE    E    E    U$   t	(  MMU9      9rh~A09Eu VWQuuR  UJ@MJDMU`   tMA9   uR,U    My,}Ur0uM9M~M}0v }uUUE    Mytv Gttҋu} 2  Uz   v Gt   MOHMuwLMU9Jh~PG49EFu QuWuuRU    t{M9   tVuVuuu2AU    tLM9   tA9}u<UU̅}E    MA9pD}pDVuuuuuU2AO4M#U`   4  MMUz   v Gt  uwLUM9Qh   G49E   l    GlHM؋@EԉuЋMU9   uB,B,r rt+rduEE)ƋEE)EE    WlUȋxu1M  RE   PEGl@   uE   juuuVwluu0< } tGl@p03W4Ue[^_Ív U(WVS    [b#
 u E   E    Myh}Myl typ}u%v MAPP}$}    BEMM}Gtt5jMq$w0uuuq4uq5}P}M@$M}M9   uM GtuM}M9   u#G0HPEHPuuqXuA0bBuE    M؋}9  @  v MM}GPM؍t}  O$ɉM܋T)ʉUt/u}G0)PuEMA$PEA$PVuu> } u}h}MIh)M   E    xu.}  VE   PCF   uE   uMI$M    }0)ǉPuEMA$PEA$PVuu9 } tFp0<1}  M؍TUAM9  M}9   u EHQ0JRPuuwTuG053e[^_ÐUS    [ 
 E@tuHtpu   ]Ív US    [ë 
 E@tt`tpu   ]Ív UWVS    [y 
 E}@tt
   `tx  t"@     ptWVuvue[^_US    [# 
 UE@ @tux 9   t	pR]ÐUS    [
 UEH @tux  9   t	pR]ÐUWVS    [é
 }UrtVWvPWuUB    B    e[^_ÐUWVS    [U
 }Gpt9tVu   vue[^_ÐUWVS    [
 }u~ tFVWGV9ruFB	VFBV9ruFBv VFBVWe[^_UtWVS    [æ
 }EPEPuuu  EPEPEPEPޜPuV><,j Vuw6tPw70w.e[^_Ív UWVS    [!
 uj V  jV      t9F~ }    @@)Љ~t}    )vdR     V    tJ  F~ }    @D)Љ~t}    )F`$   t+(  PRQ   V    t2} t,   v6tPv4/v-e[^_UUEd  BdÍv UEPMJ@PdÍv UVS    [
 uj Vt@0v    x t@@01EF`e[^UVMAq u    @D)Љqtu    )$   t+(  EA`uUWV}}u;Gw u    HD)ыwtu    )$   t+(    uW`*Gw u    H@)ыwtu    )  uWd|9M}19E}U)ʃ}uW`Wde^_ÉUWVUuEM}t9}    A        G  ?R$P<$P<$e^_UUEx t@Ãx t@Ð9   t@v 1UUEx t@x t	@x uÐ@9   u1ÐUWVS    [
 u  P=/19  ~5   <|}|D    DA9  ̉Ѝe[^_ÉUWVS    [z
 }7uu+<ƃtCEPwu7u-EM9  ~}"j <PwMPu_61Ev } t2EVP| u"j wVP7yPu%6čv EMe[^_ÉUS    [û
 EPE@Puu PP7]ÉUWVS    [z
 }ujEPVWut(j vERPDP p8wuY*v    e[^_Ív UWVS    [
 }jEPuWujƃu	   l}uj j @}t2VW,W6jEPEPEVPt/'j MqEVPDP p8wu4e[^_ÉUWVS    [^
 uEEE    j MQuPVEt$Et*j +QMt5PVQ4   '  v    9u~HMM}0JRARu}1u
EDE9u} uM,  Euu/ƃuMыEHPNj EPMQV->EPPM<|: t6T:xuRE   P^/EPPM<t9EPPM<tPu
+u41e[^_UWVS    [
 }jEPuWuƃu	   y} uj KPu2   YEVPTxuR   P.EVPt8EVPD    VWM*W'41e[^_ÐUVS    [
 uj EPuuVcu
   0v ERP| uj j
j lPV11e[^US    [Û
 EPE@PuuPP3]ÉU   WVS    [W
 Mt|P}7u2u5|t9  ~}(j <P}7MPu?1     }unt   @tu	t  tt85t.|t  tPuVa2j Vu0y  }uRMA8 txxP}wtqu+Gx    ǅx       }   }w   ǉ ujMA8 uǅxwv xP}wu31x }
ǅx    xtd  x&nPjEPEPu0qv |t  D9xtK|t      xDt  D9xtt  Q11d[^_ÐUS    [
 EPE@PuuPP0]ÉUWVS    [é
 u}6WuY4t<xl tj v@lP p8wu# j &P6CPu.   e[^_ÐUWVS    [5
 }U2Wu3ƃu      ~l u&j &PU2CPu-.   V}uj j 4}t&VW%W/jEPEHPvl(j UrFlP p8wu-e[^_UWVS    [r
 uEEE    M1PV3Et$Eu*j KQMtUPVi-     v    9u~HMM}0JRaRu*u
EDE9u} uM,  Euu(ƃuxu
Mt  EFj MQEHPV&<Myl t+QlxuRE   P(Mql2EplPuB$u.1e[^_UWVS    [
 }M1Wu1ƃu   f~l u&j &PM1CPu+   ;VlxuR   P'vl-2Fl    VW#Wy-1e[^_Ív UVS    [Z
 uE0uV
1u   !xl u
j kj mPV]+1e[^UdWVS    [
 }u6uW0tGxl t)@lppoPuV,j VW*1 v j &P6CPW*   e[^_ÐUWVS    [}
 uj "   wG    G    G    G   G   j Wj j Pvu%u1e[^_ÉUS    [
 EpE   P0&]Ív UWVS    [
 }u~ t#F xuVWuvJ0j 7VPF.Vp0e[^_UWVS    [r
 u}EPWu*t1aE9  ~}j #v } t2E   x u j +PW"PuG)1v U   e[^_UWVS    [
 }      P$!   19  ~       F9  19  ~-Wu   u	   F9  Ӏt  @1e[^_ÉUWVS    [=
 }    t919  ~$   < t4Wu(F9     .e[^_ÐU$WVS    [
 M+M$M}}E    My yt}耹t   }l  p0E    #  M   }4  DE싁  H9uEE9E~	M+MMvv}(  uuuvuw\$~    MNM}~}܋F xu}M}jNM    }(  )P  MMD)Puuvuu5# t   }/Vxu$֋Fx u	P'Fp0}}}EM}9  Mt  e[^_ÉUWVUǂ(      19  ~ku   x t@PUH	E    1ɋu   EPU    EuFU9(  }(  Gu9  Ut  e^_ÐUS    [Û	
 EPE@Puu`PP']ÉUWVS    []	
 }uj6Wutj vrPRwu   e[^_Ív UWVS    [
 }uj7Vudth}u	j j v }uj wrPRvu#RE    EPj jGPEHPrPRvuR(t   } tt  @Va&1e[^_Ív UWVS    [>
 EEE    j M1PuE@  Eu%j ʠQMtԠPu.$     9u~HMM}0JRRua!u
EDE9u} uM,  Euuƃ   xu
Mt  EFx t*HxuuuuMq)Epj jj MQEHPVQuEpp(uMt  @Q$1   e[^_Ív UWVS    [ñ
 E}j0Wuƃu
   9v F xuVWucv)F    t  @WX$1e[^_ÉUVS    [:
 uEj 0uVu	   #x u
j j PV9"1e[^U   WVS    [
 }uj6uW=tFx t(@ppPuVo#j VW!1j +P6PW!   t[^_UVS    [S
 E0      tv6`F x u	P"F PPh H  j jj j vDv@v<v8R68$N0VEPQ8  Ph  Љpǆ       FT    ǆ       e[^Ív UWVS    [Í
 E}%j >PU2SPu    v j UrPu ǃ   j Ɖ>FUVF    F    F    F    nPW$VV`Ph   6i PVPp,u"Fj EPEPVu  (u@,U16!   e[^_UWVS    [n
 u}"j {PM1Pu:  VMQ
M0Ѝx}c   WPRu^}uj j }u&j MqVP6u ǃ   jEPEPVu   ǃ   }cuZWPMq7u@}uj MqVP6uYPjuuu>v j ¡PMqPubVVVJ   e[^_ÐUVS    [
 uuVuuP6uuvv6Y#1   e[^UVS    [Ö
 Eu t64u/> t    vvmPvTPVTe[^ÐUVS    [:
 uj vVP!V $e[^ÐUS    [
 U: t    P"]ÐUWVS    [ 
 E}%j pPU2Pur  v j UrPu[ǃQ  PWA!h   Ɖ>FUVF@   F    VF    F    F     F0    F,    FL    FX    F\    F(    F$    FD    FH    FP    FT    F4   F`    Fd    Fh    F8    F<    Fl    Fp    F|          VPh " 6PV Pp,uF0j EPEPVu  u@,U16m   e[^_U,WVS    [	 UUE    }$j PU2ȤPu+R  uURUԊU0}ЍpauVPuRt(}f   VPUr.   }t%j PUrP2Ȥ}  Uru    u }auUBl    UBp    6UrdtDvUr6u'}au	UrlUrpu    6uj PU2  }auzV
PUr?u`}j PU2"  EPEPUru    u  uM  }  }c   V;PUruH}u&j UruPU2u  @Pjuuu1rv }cuvVGPUrSu\}uj j u]  }uj UruA  jEPEPuu  E܃  }d   VQPUr   }tX  v Urdt!Urv*t6uu#j PUr]PUr   9u(UBd9BhuBh    Bd    UBdU9rhuzhV  u  u    }guNVkPUru4u  UrrxPuVj VuP \  }i  V~PUr   }t&j PU2ȤPu  EPUru  EPUru  EU9Bx~HE    Jdt:BB8< EqU9U|9u  A9t  uԋ	uuk  v }i  VPUr  u}g  Ur    u+Urd  vu6u  v }  Ur    uUzl   j Blp  }   Ur    uUzp }  j Bppe  }   Ur
    u*Uzp A  Bp8 t UBdj p  }uZUr
    uBUBp9BduJh"UBd  U9Bptu    v j P˥Pu  }muVPUr  }p2  VPUruP}t
@vUruu'  @  j UrPPU2u   }p   VPUrK   }"Pjuuu   v Uruu     }uj j }u&j UrQPU2uIE܃eEPEPQu  E܃Ej PPHPUrwPu#v j quu	Ev u	   e[^_Ív U\WVS    [n	 uuVuuP6u!  ~8F8   ~<F<   v 6F, EE    EPh  63ǃ~0 tv0v~0FH Ev w EvDjEE    EPh@ 6ǃ~P tvPvZ~P~L t"FL Ev  E@  Yv v  E~X u.PP6uFXu      v E   FXEԿI  vD
EEPW6/ǃ~\ tv\v~\FH Ev s EE    E   EEPh, ! 6ǃ~T tvTvV~TV^  V  1e[^_ÉUVS    [f	 Mu   +	 	 	 	 	 	 	 	 	 	 	 	 	 	 > t    vv
PvVD  hPV0yt)   ~p uFlFpyt   V  e[^ÉUWVS    [Í	 }wdt6P  u0 tw0w"P twPwT twTwX twXw&\ tw\wj wWPWe[^_Ív US    [	 U: t    P]ÐUWVS    [í	 E}pdtWvu!6uj PW]Pu1e[^_Ív UWVS    [M	 ujVuuPM1q	u@~0 tv0F0    ~4 t-V$Pv4M1qF0u      ~ t60~HF VRVRv(PvMqD
P~0 tFPFPv0
3~8 tFPFPv8Mqhv F    F    u  u^  1e[^_UWVS    [%	 uj<|    UWVG   GG    G    G    G     G$   G(    G,G0    G4    G8    G   uuWu>t
   $v Uzd uzhzdv UBh8zh1e[^_Ív UVS    [R	 uF9ppu@p    F9plu@l    ~ tv~0 tv0F8 tj  0VPVe[^ÐUS    [	 U   u   t   RP)]US    [Ó	 E   t   PP]Ív UWVMuEfyff8fQxfPffPfyffxy}    ffxfQfP
}fwy8}    ffpfP
fPfxfyfxfPfPfPfPfPfPe^_U,WVS    [þ	 u}} tUR U	MI(MEPWVu%Uz}J8Mzz<Jx+NR)щMԋMI<M    )Eԃ} ~SVU؃wH+v 	 	 	 	 	 	 	 	 	 }v EEjMqjEPuu1~ tf  F9u-UrPv,v$vWuv vrDur   Mq\v,v$vWuv vqDuqm   ~0 tWuuvvj j v0wv ~8 tn  F9uURPUMI\MWuu܋Ur)jWuvvj j uuv8Mq<j j u܋Ure[^_UWVS    [	 uU9VluV v V(U}WuuV.jvjWv$u6%
,U9VlujFFPjWuu6	e[^_Ív UWVS    [:	 }d u:    4  w4wpDp@j j w pP0p  v ppDp@pw	EpDp@j j w0u00w4wBD+GxPr@wxj w uRE    wd$tbv 9wluMMujQ	uj uVW9wpu   tuuVWsGG8MAMNM6uw4wBD+GxPr@wxj w uRj$l tAMOMWlO8M    BwPwxujw 7PuwM9Ht+j j pDp@j j wPpQw(uw   e[^_UWVS    [i	 Myd u)MyyMyyAt    Ax      MAt    Ax    qd   ~ t60VHF VRVRv(PvMqDEN~0 tFPFPv0J3~8 tFPFPv8}wv F    F    MAA8AtN}OtF9Gx}Gx6J}<}    MAAxAtAy}    MAxAe[^_Ív UVS    [	 uV~@ u~ ~FFvP6
e[^Ív UVS    [	 uvve[^ÐUWVS    [å	 E}%j PU2-Pu  v j UrPu'ǃ  HPW	h  Ɖ~UVFFH    F4    F0    ǆ       F(    F    F,    F     F8    F<    F@    FD    FP    FT    FX    F$   FL          Fd    ǆ       ǆ       ǆ       ǆ       ǆ       ǆ       ǆ       ǆ       ǆ       ǆ          Fhj   F|   Fx   F    F    FlPj   Pj   P$VPh " v@PVPFp,uF$j EPEPVu0   uF@,U1v   e[^_Ív U   WVS    [;	 uFHpuVuuPvut        l0ҋlҍzWRlxu  eWQP   QtBj \P   ~PuP        	      Vh9t8$  9t.j PRPua   Fh     p9FHt$   P   Pj jPvH@v(vRF4 EE    EPh  vǃ~< tv<6]~<vH/EF8 Ev, EE    EPh@ vǃ~@ tv@6
~@F0 EF4 EE    E   EE   EPh,! v:ǃ~D tvD6~DF8 EFT EE    EPh  vǃ~X tvX6r~XFHEF\EF`EF0|F4xF8Ev,EǅtU  tPvV  V  1`[^_ÐUWVS    [1	 }uuVWuuPP)u?e[^_ÐUVS    [	 Eu   +D<	 0	 #	 )	 #	 #	 #	 #	 	 #	 #	 #	 #	 D	 ~ tF    vvtPv[V  V8  PVO"V    
v   V  e[^UVS    [	 u~< tv<6~@ tv@6~D tvD6~X tvX6~l ~]E    E    E_EEPEPEPjVv`  v,} t} tuuV      t   *j 6VPVe[^ÐUS    [	 Uz tBB    P/]ÉUWVS    [	 u~  NPM    W@)NɉM)ʋD)ǉ)PRV  jVH"  V.  e[^_ÉUS    [Ã	 EH   P   RQp]ÉUS    [K	 E@tP   ]Ív UVS    ["	 u  t	V     u  VPqe[^ÉUVS    [	 u  tVP V  e[^ÉUS    [×	 E  t  PP ]Ív US    [_	 U  u)  u B   t  R!P]ÉUS    [	 E  t  P!P ]Ív UWVS    [	 u~     wwDw@w6EwDw@j j v<u6NPM    W@)NɉM)ʋOD)+E0~~uV  v$vVPGD)PG@)PRRv(uv$~P ~0  tFXjv(v?uvPPWOj j wDw@j j v<wu6>(u6e[^_ÐUWVS    [ò	 }U9zl8j uElPPlEPuElPPRNuVVElPPC} t(uv tOVElPP} u1e[^_US    [	 ja@    `@    ]ÉUWVS    [	 u}9   u.? t   ǆ       Fptv 98tߋ u9   u
ǆ       9   u
ǆ       9   u
ǆ       9   u
ǆ        twj 6WPW
e[^_ÉU\WVS    [
	 EEE    E    E    jMQE0uun  S  MЋ   Eȃ}   MME)ȃt3j cQEMtmPuE   	     9u~HMM}0JR>Ruu
EDEȃ9uuu   uEuuM̉QteE̋@MЉHE̋@HẺHHAM̉AuQuu)E   jj EPEHPuu  t
E   u4}u7} tO} tj űEЃlPPuuE!v uԍyPuVj VuJEe[^_Ív UpWVS    [	 }    uVt1VElPP} tQuU9UtVElPP$G} uڃ} t WyPuVCj Vu|P
u1e[^_ÉUhWVS    [*	 }Uj EP2Wu  u!uyPuVj VW11   e[^_Ív U   WVS    [	 ExE p0ҋpҍrV+Rp4ux   (VAPE0
ux   uP@  VPE0uEPEHPj  VPE0uEPEHPjP  VPE0ruEPEHPj   VPE0Bumxpp1   EtFt>tj PuWyPtj tuk6GuEv VPE0u-xplyP|Vj Vu1^VPE0rt%j PE0ѬPu   EPEHPjux   d[^_ÐUWVS    [Y	 u_    uUBlMbuuuuW  tHuuunt   kU: }$j PuPu   A} tMU9Bl}BlMU9BlRlJM9 }    1e[^_ÐUlWVS    [v	 UutCPjFPBPuj EP6uut
      Myl uu   M   @  tƺ   	   MIMw6+4+	 	 	 	 })
})}|M9yl}WyPuV[j Vu1e[^_ÉUS    [c	 UEj 0RPrug]ÉUVS    [.	 uEMUuj j tjQPRVj 1RPrVe[^UTWVS    [	 u}}u7EP6uuEPvut      G@@EG@DEGGP)EGGP)E1MMGGP)D    EPD*Pv   PF~ɋEUPREUPREUPREUPRPuV(j Vu+1e[^_ÐUWVS    [	 Uu1Bv#߫PjEPBPu   CEPEPuRVu_  t    } tuuV   tV!e[^_Ív UWVS    [2	 uVE    VElPP} t]UU}lu9uuE   } tuWPVu9utuWPB} uEe[^_ÉUWVS    [Æ	 u}EPEPVjWuI  u@} t j vUrPRwu2j P6-Puf   e[^_ÐUWVS    [	 }uEPEPWjVu  t
   uv } u"j P7-Pu   K}uj j %}tj jGPEHPuV   j wUrPRvue[^_ÉUpWVS    [F	 }uUUEP6WuEPvW{t   9EPu   WtVyPuVj VW1e[^_UWVS    [ö	 E}8@uIpEj j PVE9ut-E8,u%uFEj j PVE9utE8 t   EPu   1e[^_UWVS    [.	 }u  tW2l u   GGP)WWP)VOOPMɋG@@)ȉEWRD)ʉU9|HM9N|IN> }    ~ }F      ЉUUMM      VMMEM   EE4M   Eu   pu9wlwlNe[^_ÉUWVS    [	 uj EP}7uVu}u#j EP}wuVjt   |v EEU9U}	EUE11ҋE9FlVtыE9FlVtuNp} ~MM	} uʃ} ~M} }} t}1e[^_Ív UWVS    [.	 uEEE0ҋ}ҍzE    W:Ruuw}u!EPp  v bu  EPEPFPEHPuu(  } k  v E`U9U[  EW@P6   }t$CPjFPEPu  v EPEPFPEHPuu   E@tj 
j Pu#   v WIP6yuvEv߫PjFPEPugEPEPFPEHPuuXt	E   D} t>EHU9Ut3Ej MP6ѬPurE   1tuEe[^_Ív UVS    [	 MUu}u9EPEPRjVQt   A} t8E   VC'j wPrPFp,~PQ1e[^ÐUWVS    [j	 EEE@E0ҋ}ҍzW+Ruuuƈ   [WAPEpuuƌ   2W֫PEpuuƔ   
uƐ   E E0ҋ}ҍzWIRuI   }uFEPEPEPjuuFt      9E   E   v j PEpPE@p,~PuR   gv W:PE0u> t4    2j PPE0­Pu   1tu61e[^_U`WVS    [Æ	 }uMA   8xu1҅uSEPEPU    Ѝ   PEUPREUPRѭPuV$j Vu_1@v j uWU    Ѝ   Puuj V	  Vt1   e[^_Ív UWVS    [ú	 }uEPuuuuvPVww_(t   )} tF@FF@FW.W1e[^_UWVS    [=	 }u   9wxtP      wxe[^_UHWVS    [	 }u  tE    E   E   E    }u	G@@EuGpDEEul uA           @      @      @    G|   c  E   E   wpt;v VŰEȋM9D~TUȋNM̋UE9T~LM6uȋUE   EȋM܉   t}ȉEE   G|    E    E    E    wpu   M܋FLMEE9Et	>    U9WxPW,MM̋U􋇀   MMM̋   UMMM̋   U؉UM̋   TEG|E    ME    6KEUǄ       MɋEǄ       19w|   ҉UU    MEE܍    UЉM̋EEȋ   M9   UUŰ   ʉUȋEЋ8   9~MЉ9   F9w|EUЍ4    L>   EUЋL   >    Ǆ>      EUЍ4    >    Ǆ>      MɋE4    >    Ǆ>      UҋMʍ4    >    Ǆ>      G|4E    9wx~
VWjW  e[^_ULWVS    [F	 Uzl     t}E    E   B@@~v EMMȉE}   UE  M+ȋ}>   )ƉUT)ЋMD  E  E   E    }G@DEċUBPBMD)Eă} E   }      E    E    UU    Ћ   EE    E    wptU    Mܐ}9      UEM9LuE    EEE܋DE6Eu}}    4    EċU   MMM9~
+Mĉ   }}    MU9   }   }}    MU9   tj R  }Ǉ       E    E    UU    ЋM    t}9y|  U؋   Mċ}}    4    }    Uv EEEċMU}9>   M9   EU9W|}M9y|1  UU    EԍU    щMЋ}GPGUDE    E    M   ME4}Uԃ:       }9|  FUTUUM}9   })M+TЋU   )ЋL)ȋ}D>}UЋM9   u
E6$v E6U   EM9L{}   EU9T   MMȉE   FtET   }  t   UȋDE̋F@EM   }ȋD8EċF@Euuuuuvj u U9   u#EHPEHPuurDuB0MD}   DE6   MU9L+}U    M   ȋ|8DEMU9J|e[^_ÐUVS    [J	 u   Pv   Pv    t2} t,   vt٭Pvve[^ÐUdWVS    [ν	 u   uv v    tEPEPVEF@HUVDJM9M19E,M9M$9UvM)MM)MM)MM)MMq1ƃE   E   E   EPh  VM1uuuuWVM1,WM1Ie[^_ÐUWVS    [ڼ	 u}       GPFPuuuuufMfMfMfMfUffJfUfMfMfMfMfEffHfEfUfEj jEPuuue[^_Ív UWVS    [1	 Eu }$U(M,9U09M4~1@   f0fxfPfHj jPuuuu
v @    e[^_ÐUS    [ǻ	 Ex t+f   f@  f@ Nf@ Nj jPj j uut]Ív US    [{	 uu4u0u,u(u$u uuuuF]ÐUS    [?	 u$u uuuuu6]ÐUWVS    [
	 uM}    9U$}+E$)EU$U$}?}}}E9~u+u$}W9U(}+E()EU(U(ʋ}}}}E9~M+M(u(u$u QVuuue[^_ÉUS    [C	 u4u0u,u(u$u uuuuu]ÐUVS    [	 uj]     @    Fe[^ÉUWVS    [ι	 UBU@~       ~   j VUrrj j jPUBpuǃ(G(UBPGj VUrrj j jjUBpuƃ,F(UBPFU:U2e[^_ÉUWVS    [	 u}tvF    VgtwG    WKe[^_Ív UWVS    [í	 }uEt0VWujVWuv j VWuU    e[^_Ív U`WVS    [N	 MA0IMpMqqpVlMAj j qJǃ Mqqj j j j uWMqV(WV} tajMqqMApVMj j PVgǃ$Mqqj j j j uWM1V(WVv M       M9 t  	 E    MEEPRMqvǋMye[^_ÉUWVS    [!	 }Ep> t6W    ~ tvWF    } tVE@    e[^_UWVS    [ù	 }(Ur~ tN+EPE$+EPvuWu$u uuuvuUru8j j vume[^_ÐU1ÐUD  WVS    [3	 }6gelPsz*c>!% /?RU<]y2 +$(f,0094=8D<\\@AbDmHLPTu'X8\3@`dDdShi`lhkp(ytLxѥ|E4EfGEzoEE/E3EEFE EE:EUEkYEC]EVdEhEnEčrEȍnE̍EЍEԍE؍1EE܍XEs}E䍃ԎE荃E썃әELEfEE1v Wt   	FP~1[^_ÐUVS    [~	 uVu#VuPVu1   e[^US    [/	 uh]ÐUVS    [	 pxtЃ>ue[^ÐUS    [۱	 T  X  ]Ð    US    [ë	 ]] tixClassTab :AutoLoad " redefined Class " tixClass className {...} " missing value for " -alias -configspec -classname -default -flag -forcecall -method -readonly -static -superclass -virtual " unknown parsePtr->option " superClass className ClassName options forceCall defaults methods staticOptions 1 virtual 0 isWidget :AutoLoad {} {} proc  " not defined Superclass " Unknown Tix internal error name ?arg? ... context Constructor option ... configure cget subwidget w:%s unknown subwidget " name ?args ...? subwidgets bad subwidget default format " ] widgetDefault  [list  option add * subst config spec list " Wrong number of elements in  tixSpecTab missing argument for " tixWidgetDoWhenIdle command window ?arg arg ...? command ?arg arg ...?  pathname command 0 option filename tildesubst trimslash ", must be tildesubst or trimslash unknown option " colorName 1 -nocomplain ?-nocomplain? string -trunc ?-nocomplain? ?-trunc? string " is not a valid numerical value " %d -nounknown w validOptions argList " missing value for " ". "; must be one of " window parent interpreter does not have a main window " must be a window pathname or ID string1 string2 strVar from to  does not exist variable  tixTmpLine x1 y1 x2 y2 ?window? 
    (idle event handler executed by tixWidgetDoWhenIdle) 
    (idle event handler executed by tixDoWhenIdle) 
    (event handler executed by tixDoWhenMapped) #%4x%4x%4x wrong # of arguments, should be "   ". " missing value for "  ": must be  unknown option " ,   or  tixGeometry  -request  
    (geometry request command executed by tixManageGeometry)  -lostslave  pathname command pathname reqwidth reqheight pathname x y width height pathname tixGrid tixTList tixWidgetDoWhenIdle tixWidgetClass tixUnmapWindow tixTrue tixTmpLine tixStrEq tixStringSub tixRaiseWindow tixNoteBookFrame tixMwm tixMoveResizeWindow tixMapWindow tixManageGeometry tixInputOnly tixHandleOptions tixGetMethod tixGetInt tixGetBoolean tixGet3DBorder tixGeometryRequest tixItemStyle tixHList tixForm tixFlushX tixFile tixFalse tixDoWhenMapped tixDoWhenIdle tixDisplayStyle tixClass tixChainMethod tixCallMethod  TixLibrary tixLibrary -tixlibrary 79 TixSchemePriority tixSchemePriority TixGray TixScheme tixScheme -scheme 14Point TixFontSet tixFontSet -fontset TixDebug tixDebug -debug Motif TixBinding binding -binding 1 TixBeta tixBeta -beta %d tix_priv TIX_LIBRARY /usr/lib/tix4.1 -libdir -schemepriority 8.0 Tcl Tk normal cell row column disabled maximize act_fold ..XXXXXXXXXX..   .X.XXXXXXXXXXX.  .o.XXXXXXXXXXX.  .Xo.XXXXXXXXXX.  .oX.XXXXXXXXXXX. .XoX............ .oXoXoXoXoXo.    .............     .XXXXXX.          .XXXX.            ....          o	c #5B5B57574646 X	c yellow .	c black  	s None	c None 16 12 4 1 balarrow cbxarrow ck_def ck_off ck_on cross decr drop file  ..........   .XXXXXXXX.   .XXXXXX...   .XXXXXX.     ........    X	c #FFFFFFFFF3CE 12 12 3 1 folder .XXXXXXXXXXX.    X	c #f0ff80 16 12 3 1 harddisk hourglas incr    .XXXXXXXX.......XXXXXXXX.     .XXXXXXXXXXX.......XXXXXXXXXXX.  .XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.  .XXXXXXXXXXXXX...XXXXXXXXXXXXX.   .XXXXXXXXXXX.....XXXXXXXXXXX.    .XXXXXXXXXX.......XXXXXXXXXX.     .XXXXXXXXX.......XXXXXXXXX.       .XXXXXXXXX.....XXXXXXXXX.        .XXXXXXXXXX...XXXXXXXXXX.         .XXXXXXXXXXXXXXXXXXXXX.           ..XXXXXXXXXXXXXXXXX..              .XXXXXXXXXXXXXXX.                 ...XXXXXXXXX...                     .........                                              X	c white .	c #000000000000 32 32 3 1 info minimize minus  .     .   .......             	c black .	s None	c None 9 9 2 1 minusarm  .X   X.   .XXXXX.  X	c #808080808080 .	c yellow 9 9 3 1 network .XXX.ooooooooooooooooooooo.XXX.  .XXX.......................XXX.   .XXXXXXXXXXXXXXXXXXXXXXXXXXX.     .XXXXXXXXXXXXXXXXXXXXXXXXX.       .XXXXXXXXXXXXXXXXXXXXXXX.     o	c yellow X	c red 32 32 4 1 no_entry openfile openfold .XX.XXXXXXXXXX.  .XX.XXXXXXXXXXX. .XXX............ plus  ... ...  plusarm  .  X  .   ..X X..  X	c gray40 resize1 resize2 restore srcfile  .X.XXXXXX.   .X.XXX.XX.   .XX...XXX.  X	c gray91 system textfile  .X.....XX.   .X...XXXX.   .X....XXX.  tick      ..XXXXXXX...XXXXXXX..           .XXXXXXXX.....XXXXXXXX.       .XXXXXXXXXXXX...XXXXXXXXXXXX.   .XXXXXXXXXXXX.....XXXXXXXXXXXX.      .XXXXXXXXX...XXXXXXXXX.      warning slaveInterp 4.1 tix_version 4.1.0 tix_patchLevel 4.1.0.006 tix_release argv0 tixwish tixScriptVersion Warning: Tix script library version (pre 4.0.2)
 tix_library   in "%s"
   does not match binary version (%s).
   Please check your TIX_LIBRARY environment  variable and your Tix installation.
 __tixInit isSafe if [catch {file join a a}] {
    proc tixFileJoin {args} {
	set p [join $args /]
	regsub -all {/+} $p / p
	return $p
    }
} else {
    proc tixFileJoin {args} {
	return [eval file join $args]
   }
}

proc init {} {
    global tix_library tix_version tix_patchLevel env errorInfo
    rename init {}
    set dirs {}
    set errors {}
    if [info exists env(TIX_LIBRARY)] {
	lappend dirs $env(TIX_LIBRARY)
    }
    if [info exists tix_library] {
	lappend dirs $tix_library
    }
    if [string match {*[ab]*} $tix_patchLevel] {
	set lib tix$tix_patchLevel
	set Lib Tix$tix_patchLevel
    } else {
	set lib tix$tix_version
	set Lib Tix$tix_version
    }
    catch {
        # [pwd] may not work inside safe Tcl
        set p [pwd]
	lappend dirs [tixFileJoin $p library]
        set p [file dirname $p]
	lappend dirs [tixFileJoin $p library]
        set p [file dirname $p]
	lappend dirs [tixFileJoin $p library]
    }
    set instDir [file dirname [info library]]
    lappend dirs [tixFileJoin $instDir $lib]
    lappend dirs [tixFileJoin [tixFileJoin $instDir lib] $lib]
    catch {
    lappend dirs [tixFileJoin [tixFileJoin [file dirname [file dirname [info nameofexecutable]]] lib] $lib]
    }
    lappend dirs [tixFileJoin [tixFileJoin [file dirname [file dirname [info library]]] $lib] library]
    lappend dirs [tixFileJoin [tixFileJoin [file dirname [file dirname [info library]]] $Lib] library]
    foreach i $dirs {
	set tix_library $i
        set tixfile [tixFileJoin $i Init.tcl]
        if {[interp issafe] || [file exists $tixfile]} {
            if ![catch {uplevel #0 [list source $tixfile]} err] {
                return
            } else {
                append errors "
$tixfile: $err
$errorInfo
"
	    }
        }
    }
    set msg "Can't find a usable Init.tcl in the following directories: 
"
    append msg "    $dirs
"
    append msg "$errors

"
    append msg "This probably means that Tix wasn't installed properly.
"
    error $msg
}
init :: w method ... className " invalid object reference " ". " for context " cannot call method " errorInfo no superclass exists for context " cannot chain method " w class method  tixMethodTab context superClass ";  invalid class " : auto_load  1 auto_load cannot execute command "auto_load" cannot autoload command " { }  { tixSpecTab " ambiguous option " unknown option " " missing value for " config%s config cannot assigned to readonly variable " cannot assigned to static variable "  %f %f 
    (scrolling command executed by tixTList) errorInfo errorCode ".   wrong # args: should be " " unknown option "  This command does not take any options. .  Must be  or  ,  %s
 exit .tixsw: raised flat sunken groove ridge solid  ":  must be flat, groove, raised, ridge, solid or sunken bad relief type " unknown tcl_rcFileName pathname ?arg? ... " already exists window name "  errorInfo errorCode %s:root className ClassName context w:root rootCmd CreateRootWidget rename InitWidgetRec ConstructWidget SetBindings " missing argument for " " unknown display type " " missing value for " unknown option "   -1 Underline underline -underline Text text -text ImageTextStyle imageTextStyle -style ShowText showText -showtext 1 ShowImage showImage -showimage imagetext ItemType itemType -itemtype Image image -image  Bitmap bitmap -bitmap DisabledForeground disabledForeground -disabledforeground #a3a3a3 DisabledBackground disabledBackground -disabledbackground SelectForeground selectForeground -selectforeground #c3c3c3 SelectBackground selectBackground -selectbackground ActiveForeground activeForeground -activeforeground #ececec ActiveBackground activeBackground -activebackground Black Foreground -foreground White #d9d9d9 Background -background 0 WrapLength wrapLength -wraplength padY -pady 2 Pad padX -padx left Justyfy justify -justify 4 Gap gap -gap -Adobe-Helvetica-Bold-R-Normal--*-120-* Font font -font foreground -fg background -bg w Anchor anchor -anchor body ImageStyle imageStyle -style ItemType itemType -itemtype  Image image -image DisabledForeground disabledForeground -disabledforeground #a3a3a3 DisabledBackground disabledBackground -disabledbackground SelectForeground selectForeground -selectforeground #c3c3c3 SelectBackground selectBackground -selectbackground ActiveForeground activeForeground -activeforeground #ececec ActiveBackground activeBackground -activebackground Black Foreground -foreground White #d9d9d9 Background -background padY -pady 0 Pad padX -padx foreground -fg background -bg w Anchor anchor -anchor body itemtype ?option value ... " missing value for " -refwindow -stylename " already exist style " tixStyle%d  delete ?option? ?value? ?option value ... ? configure option cget ?option? arg ?arg ...? Cannot delete default item style style : DItem is already associated with style DItem is not associated with style  style  style but got  Needed  Style type mismatch  " not found Display style " -1 Underline underline -underline Text -text  TextStyle textStyle -style text ItemType itemType -itemtype DisabledForeground disabledForeground -disabledforeground #a3a3a3 DisabledBackground disabledBackground -disabledbackground SelectForeground selectForeground -selectforeground #c3c3c3 SelectBackground selectBackground -selectbackground ActiveForeground activeForeground -activeforeground #ececec ActiveBackground activeBackground -activebackground Black Foreground -foreground White #d9d9d9 Background -background 0 WrapLength wrapLength -wraplength padY -pady 2 Pad padX -padx left Justyfy justify -justify -Adobe-Helvetica-Bold-R-Normal--*-120-* Font font -font foreground -fg background -bg w Anchor anchor -anchor body Window -window -widget  WindowStyle windowStyle -style window ItemType itemType -itemtype padY -pady 0 Pad padX -padx w Anchor anchor -anchor tixWindowItem  of   in a window item of the master widget: must be a child can't use   as a window item of  can't manage toplevel window body tixForm slave side strength spring slaves slave ?-flag? info master ?x_grids y_grids? grid slave ?slave ...? forget slave ?-flag value ...? configure master check ?option? arg ?arg ...? tixForm grid master ?x_grids y_grids? Wrong # of arguments, should be  %d %d Grid sizes must be positive integers " is not a tixForm master window Window " " is not managed by the tixForm manager -top -bottom -left -right " Unknown option " 0 1 tixForm configure slave ?-flag value ...? "in a form: it's a top-level window can't put " -in circular dependency.
 (TixForm) Error:Trying to use more than one geometry
          manager for the same master window.
          Giving up after 50 iterations.
 circular dependency        @MbP?-bottom -top -right -left -padbottom -padtop -padright -padleft %d " Unknown option "   none {%%%d %d} }  { {& Malformed attachment value " ": it's a top-level window can't attach to " -0 x y both ": must be none, x, y, or both bad fill style " -in "-in " must be the first option given to tixForm -l -r -t -b -padx -pady -lp -rp -tp -bp -leftspring -ls -rightspring -rs -topspring -ts -bottomspring -bs -fill ". Wrong option " compound -window -showbackground flat -relief -pady -padx Black Foreground -foreground -Adobe-Helvetica-Bold-R-Normal--*-120-* Font font -font foreground -fg 0 -borderwidth -bg borderWidth -bd White #d9d9d9 Background background -background c -anchor -bitmap  -image -width -height -wraplength -1 -underline -text left -justify " value missing for option " no value given for -window option. wrong # args: should be "%.50s option ?arg arg ...?" add type ?option value? ... line bitmap image space text space, text or widget ", must be bitmap, image, line,  unknown option " cget  cget option" wrong # args: should be " configure be changed. The -window option cannot  itemconfigure unimplemented lineconfigure ": must be cget or configure bad option " " can only be assigned to window " Image " 
    (while configuring image " ") -id -file -data pixmap must specify one of -data, -file or -id ImgXpmGetData(): -data, -file and -id are all NULL File format error " unknown pixmap ID " /* XPM ":  couldn't read file " couldn't stat file " error in reading file " error closing file " none black wrong # args: should be "%.50s option ?arg arg ...?" cget  cget option" wrong # args: should be " configure refcount %d ": must be cget, configure or refcount bad option " tried to delete pixmap image when instances still exist " is already defined pixmap "  option pathname ?arg ...?" wrong # args: should be "  is not a toplevel window. decorations ismwmrunning 1 0 protocol transientfor or transientfor ": must be decorations, ismwmrunning, protocol  unknown or ambiguous option " _MOTIF_WM_MESSAGES -all -border -resizeh -title -menu -minimize -maximize " unknown decoration " -border %d -resizeh %d -title %d -menu %d -minimize %d -maximize %d value missing for option " add activate deactivate delete " should be add, activate, deactivate or delete unknown option "  f.send_msg %d
 _MOTIF_WM_MENU  _MOTIF_WM_MESSAGES {;} wm protocol  WM_TRANSIENT_FOR _MOTIF_WM_HINTS _MOTIF_WM_INFO yScrollCommand -yscrollcommand ScrollCommand xScrollCommand -xscrollcommand 4 Width width -width TopMargin topMargin -topmargin TakeFocus takeFocus -takefocus normal -state SizeCmd sizeCmd -sizecmd row SelectUnit selectUnit -selectunit single SelectMode selectMode -selectmode selectForeground -selectforeground selectBorderWidth -selectborderwidth #ececec selectBackground -selectbackground sunken Relief relief -relief padY -pady Pad padX -padx text ItemType itemType -itemtype 1 LeftMargin leftMargin -leftmargin HighlightThickness highlightThickness -highlightthickness HighlightColor highlightColor -highlightcolor HighlightBackground highlightBackground -highlightbackground 10 Height height -height FormatCmd formatCmd -formatcmd Black Foreground -foreground -Adobe-Helvetica-Bold-R-Normal--*-120-* Font font -font FloatingRows floatingRows -floatingrows 0 FloatingCols floatingCols -floatingcols foreground -fg EditNotifyCmd editNotifyCmd -editnotifycmd EditDoneCmd editDoneCmd -editdonecmd  Cursor cursor -cursor 2 BorderWidth -borderwidth -bg borderWidth -bd White #d9d9d9 Background background -background  pathName ?options?" wrong # args:  should be " TixGrid ":  must be normal or disabled bad state value " yview args xview unset dimension start end ?args ...? sort size x y ?option value ...? set option x1 y1 ?x2 y2? selection nearest option from to by move x y index info ?width height? geometryinfo format x y ?option? ?value? ?option value ... ? entryconfigure option ?args ...? edit x y option entrycget dropsite dragsite option from ?to? delete ?option? ?value? ?option value ... ? configure option cget x y ?xbdWidth ybdWidth? bdtype option ?x y? anchor ?option? arg ?arg ...? tixGrid: mappedWindows not NULL xy %d %d x %d %d y %d %d " missing value for "  edit set x y wrong # of arguments, must be:  tixGrid:EditCell %d apply  edit apply tixGrid:EditApply ", must be apply or set unknown option " " does not exist , entry " {%f %f} {%f %f} %d %d bbox exists ": must be bbox or exists get  set x y   clear  clear must be clear, get or set ",  wrong option " %f %f main y-margin x-margin s-margin %s %s %d %d %d %d 
    (format command executed by tixGrid)  %f %f 
    (scrolling command executed by tixGrid) 
    (size command executed by tixGrid) %d %d %d %d column Grid hash entry leaked: %d : %d
 Inconsistent grid dataset: (%d,%d) : %x %x max end Yon yon -yon Yoff yoff -yoff 1 Xon xon -xon Xoff xoff -xoff Black #ececec Foreground selectBackground -selectbackground sunken Relief relief -relief 0 Filled filled -filled 2 BorderWidth -borderwidth -bg borderWidth -bd White #d9d9d9 Background background -background BorderColor borderColor -bordercolor se Anchor anchor -anchor grid x1 y1 x2 y2 ?option value ...? border ?option? ?arg ...? by the -formatcmd handler of the tixGrid widget the "format" command can only be called  x1 y1 x2 y2 ... column index ?option value ...? row option index ?arg ...? default "; must be an integer or "default" unknown option " %s %s ?option value ...? toggle set includes clear x1 y1 ?x2 y2? adjust ?option? ?arg ...? selection list is empty max can't invoke the tixGrid sort command recursively rows column ", should be row or column wrong dimension " " missing value for " -type ascii integer real ": must be ascii, integer or real wrong type " -order increasing decreasing ": must be increasing or decreasing wrong order " -key -command ": must be -command, -key, -order or -type wrong option " %d
 
    (converting list element from string to integer) 
    (converting list element from string to real) 
    (user-defined comparison command) comparison command returned non-numeric result char " bad screen distance " -size  auto default %d %fchar  -pad0   -pad1  value missing for option " -size -pad0 -pad1 "; must be -pad0, -pad1 or -size Unknown option " yScrollCommand -yscrollcommand ScrollCommand xScrollCommand -xscrollcommand 20 Width width -width WideSelection wideSelection -wideselection TakeFocus takeFocus -takefocus SizeCmd sizeCmd -sizecmd . Separator separator -separator browse SelectMode selectMode -selectmode selectForeground -selectforeground selectBorderWidth -selectborderwidth #ececec selectBackground -selectbackground sunken Relief relief -relief padY -pady Pad padX -padx text ItemType itemType -itemtype IndicatorCmd indicatorCmd -indicatorcmd Indicator indicator -indicator Indent indent -indent HighlightThickness highlightThickness -highlightthickness HighlightColor highlightColor -highlightcolor HighlightBackground highlightBackground -highlightbackground 10 Height height -height 0 Header header -header 5 Gap gap -gap Black Foreground -foreground -Adobe-Helvetica-Bold-R-Normal--*-120-* Font font -font foreground -fg DropCmd dropCmd -dropcmd true DrawBranch drawBranch -drawbranch DragCmd dragCmd -dragcmd Cursor cursor -cursor Command command -command 1 Columns columns -columns  BrowseCmd browseCmd -browsecmd 2 BorderWidth -borderwidth -bg borderWidth -bd White #d9d9d9 Background background -background normal -state -data  pathName ?options?" wrong # args:	 should be " TixHList TixHListHeader yview args xview show option arg ?arg ...? selection see y nearest info item option entryPath hide option ?args ...? ?width height? geometryinfo entryPath ?option? ?value? ?option value ... ? entryconfigure entryPath option entrycget dropsite dragsite delete ?option? ?value? ?option value ... ? configure ?option? ?args ...? column option cget option ?entryPath? anchor parentEntryPath addchild entryPath add ?option? arg ?arg ...? set  set entryPath   wrong # of arguments, must be:  clear must be clear or set ",  wrong option " all entry offsprings siblings  entryPath wrong # of arguments, should be pathName delete  " must be all, entry, offsprings or siblings unknown option " " does not exist Item " {%f %f} {%f %f} bbox children ?entryPath? data exists hidden next parent prev exists, hidden, item, next, parent, prev or selection ": must be anchor, bbox, children, data, dragsite, dropsite,  x y %d %d %d %d %d includes get from ?to? ": must be anchor, clear, get, includes or set Cannot change the number of columns  tixHList: mappedWindows not NULL " missing value for " -after -before -at and -at options can be used No more than one of the -after, -before  parent element " %s%c%s " already exists element " " cannot add entry after " cannot add entry before " " not found Entry " 
	   (size command executed by tixHList)  %g %g 
    (scrolling command executed by tixHList) 
    (size command executed by tixHList) " does not exist Column " " does not have an item at column  entry " exists entryPath column delete entryPath column ?option value ...? create entryPath column ?option? ?value ...? configure entryPath column option cget ?option? ?arg ...? " missing value for " -itemtype Cannot delete item at column 0 0 1 column ?-char? ?size? width %d -char size exists entryPath delete entryPath ?option value ...? create entryPath ?option? ?value ...? configure entryPath option cget ?option? ?arg ...? " does not have an indicator entry " " missing value for " -itemtype 0 1 %d %d raised Relief headerRelief -relief White #d9d9d9 Background headerBackground -headerbackground 2 BorderWidth headerBorderWidth -borderwidth borderWidth -bd " does not exist Column " " does not have a header size exist column delete column ?option value ...? create column ?option? ?value ...? configure column option cget ?option? ?arg ...? " missing value for " -itemtype 0 1 entry " %d %d Width width -width 0 Height height -height  Cursor cursor -cursor  pathName ?options?" wrong # args:  should be " TixInputOnly  option ?arg arg ...?" wrong # args: should be " configure cget option ":  must be cget or configure bad option " 10 Width width -width TakeFocus takeFocus -takefocus 5 tabPadY -tabpady 6 Pad tabPadX -tabpadx 1 Slave slave -slave sunken Relief relief -relief #c3c3c3 inactiveBackground -inactivebackground Foreground -foreground -Adobe-Helvetica-Bold-R-Normal--*-120-* Font font -font Black FocusColor focusColor -focuscolor foreground -fg #a3a3a3 DisabledForeground disabledForeground -disabledforeground  Cursor cursor -cursor 2 BorderWidth -borderwidth -bg borderWidth -bd BackPageColor backPageColor -backpagecolor White #d9d9d9 Background background -background 0 -wraplength -1 -underline normal -state -label center -justify -image -bitmap c -anchor  pathName ?options?" wrong # args:  should be " TixNoteBookFrame  option ?arg arg ...?" wrong # args: should be " activate focus  name"   " unknown tab " add  add name ?options? wrong # args: should be  cget option configure delete page Unknown tab " geometryinfo %d %d identify  identify x y" info pages active focusnext focusprev unknown option wrong number of arguments or  move pagecget pageconfigure page ?option value ...? geometryinfo, identify, move, pagecget or  ":  must be activate, add, configure, delete,  bad option " gray50 yScrollCommand -yscrollcommand ScrollCommand xScrollCommand -xscrollcommand 20 Width width -width TakeFocus takeFocus -takefocus SizeCmd sizeCmd -sizecmd normal -state browse SelectMode selectMode -selectmode selectForeground -selectforeground 1 selectBorderWidth -selectborderwidth #ececec selectBackground -selectbackground sunken Relief relief -relief padY -pady Pad padX -padx vertical Orient orient -orient text ItemType itemType -itemtype HighlightThickness highlightThickness -highlightthickness HighlightColor highlightColor -highlightcolor 10 Height height -height Black Foreground -foreground -Adobe-Helvetica-Bold-R-Normal--*-120-* Font font -font foreground -fg Cursor cursor -cursor Command command -command  BrowseCmd browseCmd -browsecmd 2 BorderWidth -borderwidth HighlightBackground highlightBackground -highlightbackground -bg borderWidth -bd White #d9d9d9 Background background -background  pathName ?options?" wrong # args:  should be " TixTList horizontal ": must be vertical or horizontal bad orientation " ":  must be normal or disabled bad state value " 0 yview args xview option arg ?arg ...? selection entryPath see x y nearest where ?option value ... insert option ?args ...? info index ?width height? geometryinfo index ?option? ?value? ?option value ... ? entryconfigure entryPath option entrycget dropsite option ?entryPath? dragsite from ?to? delete ?option? ?value? ?option value ... ? configure option cget anchor option ?index? active ?option? arg ?arg ...? end " missing value for " %d TList list entry is invalid down left right   size up ": must be anchor or selection unknown option " " expected non-negative integer but got " {%f %f} {%f %f} " does not exist list entry " clear includes set ": must be anchor, clear, includes or set  index wrong # of arguments, must be:   set index must be clear or set ",  wrong option " {%f %f} 
    (size command executed by tixTList) __tixInit ,         +   d        g     X     O     ?     1     !                                                                      q     d     P     I     8     )                                                              W O G E                < 4 ) #                 
 E                                                                       v u                                                                      pppppppp U@         s b Q @ /      Q 	   p p p p p  p     UUUUUq!    88>  B    d   R E 8 +                s b Q u u u u u u u Q                                       HUHUUHUUHUU                                |  ||  ||  |  ~  ~  ~ {~{<y<x<wx<89x<`x<88x<qx<x<y { { ~ ~~||||||>     ` ?      y X X 7          X X X y      ? `                       }            }}}}  V  K 9    / % /            @  _  
P  
R  
R  Q  
P  JP  
P  
P  _  @RU@j_
P
R 
R Q 
P JP 
P
P ?@RUj                ` ?            f f f f f f           ? ` RU*V
 !@	      s b Q u e T C    Q }       { {  { {   mmmm  V  K    {    {    !  1 m  `  ` m 1  !          r

r  d    E 8 +                    ?  ??          z:  d   R E 8 + (               8     >        ` ?      y X X X           | 7 y   [ :  ? `      lappend auto_path $%s 
if [file exists $%s/%s] {
source $%s/%s
} else {
set msg "
can't find $%s/%s;\nperhaps you "
append msg "need to install %s\nor set your %s "
append msg "environment variable?"
error $msg
}                                              $                                    P               | s  T              l ] N               H C >  4             3 )   L                                             q j c a L              ] R                        N C                        = 8 3                                                       T                  X                                 R   \              R  y \             m C b \ `             m C b \ `             J 9 (   l             J 9 ( \ l                \ p                y p                 |                \ |               | \                | y              h U B :              h U B y              &    \              &    \                                                     H  D   @ ,A     y                    @                                               ~                                                  L                                                                 z v t T              n i v t X              ]  R J \             ]  R D \             8  - ' `             8  - ' `                 l                ' l                ' p                D p                { |                ' |             i X G '              i X G D              3                  3    D                 '                 '                                              L   t     8   ,  D TE                         @              h       $$ a     W     X$ 2     +         $ *           m , -                             u t              n  i t              ^ T J G (                                                 L                                                                                                      ~ T              x s  ~ X              g \ Q O               C  8 0 \             C  8 * \                 `                 `                 l                 l                 p                * p              z i a |              z i  |             O > -               O > - *                                  *                                                                                . . 0 0 t/ . L1 1 1 T2 3 4 H I                         @            p g ^ W                P D 8 7              /                            ' W   7                                                  L                  T               z   X                                          W    \5 6 8 09 7 5 L9 9 ; H; ; ; $M M       : T: 7 < O P            B          dC          ?          > y     t           f     _       ?      X       P@ D                 dC     DC        $    G = 5 *  p ||  $ T     	       0          	      } 0             y m                        i                         \ m     Z ,              V K                        E @ ;  8               K   <              K   <                      Z                        Z             
             4                       Z D                                                                                                        Z                        Z                                                                          (             i                                                 V K                         K   $                      Z                        Z                                                                                   $                      Z                        Z                                                       Z                        Z                                                                      V K                        E          8              K   4                       (                       Z                        Z                                                 0                       Z ,                                                                                                                                                       
 H   ̖                     4                 4                                                                 y w               o h a ` P             S G ; `              ,   `                                                                              w L              k  ` Z 0             k  ` Z 0             O E ; `              3 , % "            	       (          	       (                Z \                Z \               } w T              q f [ Y               O F = 8               2 - ) w d              #  ) w h           
       $           	     `  ,          	     ` Z ,               y Y                   Z 8                 8              w l e l              Y N C ? p              6 . & `                        <                 Y                 Y                                    `               y  `                                                                                 X                                                          `       w        X       n        X       d         Y      T         B      3     ` 
               B              8           B                          `                                             z        B      u        V     P       T      J         E     ?         E                    	                 	                                                                      {  o m               e ^ W U 0           
   M F ? 8            	   &  
            	   &  
                  U $                                    U ,                  (                                                 4           	                 	                 	                 	                                                                      {  o m               e ^ W U 8           
   M F ? 8             	   &  
            	   &  
                  U (                  $                 U 0                  ,                                          .          
                5     D          D             i        [     U        [     L       l [     H        [     A        [           p            <                 <                                                                                                    ~ v t             k c [               S L E  \             < 4 ,                  
                                                              D                  8                 8               { y               q j c a $             Y R K H            	   3    0          	   3    0                 x                 x                 t                 H ,               x n a `             ` S F               < 3 * % ,                                              
    
 
 
 (           	   
 
  
 4          	   
 
   4             
 
  t $              
 {
   @             
 {
   @             o
 d
 Y
 R
               G
 =
 3
 1
               (
  
 
               
 
 	 t              	 	 	  l              	 	 	 	               	 	 	               {	 l	 	                                                        <                       8                                                                      |             $                         X m     f             ]       |      T       |      J        9     *                           j                    !                    x                 @"             4*             *             -      {       !      u        T0 p     j        1 p                   <]          ]          X^ d     ]       _ L     E       ` L            H       \a 2                   d          d          De t     m       f c     \       `g c     W       g c                                                       	    u j b           	    u j \           
   T G @ 9                                           v       \m h     ^    m B     ;    xn !            p             p             p            {                                                                                                                         i                 	                  	                         ,                 ,             { o                        k                         ^ o R P               H A : 9 `             %    L             %   9 L                                   	       $          	       $                 D              |  q  H             |  q  H          	   ] J  B (          	   ] J   (          
   : 3 , % 4                  @                  8                  <                  |                                                              ,         *               "         9 8                      9 4                       $                       9                                                ,                        (                                                     4                     4                                                                	     o  [    (          	     o  [    (             N    B  @                5  +  !                                              L                                          H                  0                 0              ~ w t               d U F  T             d U F  T             2   @  P                                                     @  \                 @  `           
       $           	    r  j ,          	    r   ,             W E B  C                1      8             1       8              	   d                        h                                    C                                 | n                 ^ O n                                                                                                        #       L "     "       L "     "       X "     "      "     "        "     "       L "     ~"       L "     t"       0 c"     T"     )"     "         "     "        "     "     !     !     !     !       p !     !        !     !        !     !        0 !     !        0 !           # proc tixPref:InitFontSet:12Point {} { 

    global tixOption

    set tixOption(font)         -*-helvetica-medium-r-normal-*-12-*-*-*-*-*-*-*
    set tixOption(bold_font)    -*-helvetica-bold-r-normal-*-12-*-*-*-*-*-*-*
    set tixOption(menu_font)    -*-helvetica-bold-r-normal-*-12-*-*-*-*-*-*-*
    set tixOption(italic_font)  -*-helvetica-bold-o-normal-*-12-*-*-*-*-*-*-*
    set tixOption(fixed_font) -*-courier-medium-r-*-*-12-*-*-*-*-*-*-*
    set tixOption(border1)      1

}
proc tixPref:SetFontSet:12Point {} { 
global tixOption
option add *Font			$tixOption(font) $tixOption(prioLevel)
option add *font			$tixOption(font) $tixOption(prioLevel)
option add *Menu.font			$tixOption(menu_font) $tixOption(prioLevel)
option add *TixMenu.font			$tixOption(menu_font) $tixOption(prioLevel)
option add *Menubutton.font			$tixOption(menu_font) $tixOption(prioLevel)
option add *Label.font              	$tixOption(bold_font) $tixOption(prioLevel)
option add *Scale.font			$tixOption(italic_font) $tixOption(prioLevel)
option add *TixBalloon*Label.font 			$tixOption(font) $tixOption(prioLevel)
option add *TixBitmapButton*label.font 			$tixOption(font) $tixOption(prioLevel)
option add *TixControl*label.font              	$tixOption(bold_font) $tixOption(prioLevel)
option add *TixLabelEntry*label.font              	$tixOption(bold_font) $tixOption(prioLevel)
option add *TixLabelFrame*label.font 	 		$tixOption(bold_font) $tixOption(prioLevel)
option add *TixMwmClient*title.font			$tixOption(menu_font) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.font			$tixOption(menu_font) $tixOption(prioLevel)
option add *TixOptionMenu*menubutton.font		$tixOption(font) $tixOption(prioLevel)
option add *TixComboBox*Entry.font				$tixOption(font) $tixOption(prioLevel)
option add *TixFileSelectBox*Label.font            		$tixOption(bold_font) $tixOption(prioLevel)
}

 proc tixPref:InitFontSet:14Point {} { 


    global tixOption

    set tixOption(font)         -*-helvetica-medium-r-normal-*-14-*-*-*-*-*-*-*
    set tixOption(bold_font)    -*-helvetica-bold-r-normal-*-14-*-*-*-*-*-*-*
    set tixOption(menu_font)    -*-helvetica-bold-r-normal-*-14-*-*-*-*-*-*-*
    set tixOption(italic_font)  -*-helvetica-bold-o-normal-*-14-*-*-*-*-*-*-*
    set tixOption(fixed_font) -*-courier-medium-r-*-*-14-*-*-*-*-*-*-*

}
proc tixPref:SetFontSet:14Point {} { 
global tixOption
option add *Font			$tixOption(font) $tixOption(prioLevel)
option add *font			$tixOption(font) $tixOption(prioLevel)
option add *Menu.font			$tixOption(menu_font) $tixOption(prioLevel)
option add *TixMenu.font			$tixOption(menu_font) $tixOption(prioLevel)
option add *Menubutton.font			$tixOption(menu_font) $tixOption(prioLevel)
option add *Label.font              	$tixOption(bold_font) $tixOption(prioLevel)
option add *Scale.font			$tixOption(italic_font) $tixOption(prioLevel)
option add *TixBalloon*Label.font 			$tixOption(font) $tixOption(prioLevel)
option add *TixBitmapButton*label.font 			$tixOption(font) $tixOption(prioLevel)
option add *TixControl*label.font              	$tixOption(bold_font) $tixOption(prioLevel)
option add *TixLabelEntry*label.font              	$tixOption(bold_font) $tixOption(prioLevel)
option add *TixLabelFrame*label.font 	 		$tixOption(bold_font) $tixOption(prioLevel)
option add *TixMwmClient*title.font			$tixOption(menu_font) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.font			$tixOption(menu_font) $tixOption(prioLevel)
option add *TixOptionMenu*menubutton.font		$tixOption(font) $tixOption(prioLevel)
option add *TixComboBox*Entry.font				$tixOption(font) $tixOption(prioLevel)
option add *TixFileSelectBox*Label.font            		$tixOption(bold_font) $tixOption(prioLevel)
}

 proc tixPref:InitFontSet:TK {} { 


    global tixOption

    set tixOption(font)         -Adobe-Helvetica-Medium-R-Normal--*-120-*
    set tixOption(bold_font)    -Adobe-Helvetica-Bold-R-Normal--*-120-*
    set tixOption(menu_font)    -Adobe-Helvetica-Bold-R-Normal--*-120-*
    set tixOption(italic_font)  -Adobe-Helvetica-Bold-O-Normal--*-120-*
    set tixOption(fixed_font) -*-courier-medium-r-*-*-14-*-*-*-*-*-*-*
    set tixOption(border1)      1

}
proc tixPref:SetFontSet:TK {} { 
global tixOption
}

 proc tixPref:SetScheme-Color:Bisque {} {

    global tixOption

    set tixOption(bg)           bisque1
    set tixOption(fg)           black

    set tixOption(dark1_bg)     bisque2
    set tixOption(dark1_fg)     black
    set tixOption(dark2_bg)     bisque3
    set tixOption(dark2_fg)     black
    set tixOption(inactive_bg)  bisque3
    set tixOption(inactive_fg)  black

    set tixOption(light1_bg)    bisque1
    set tixOption(light1_fg)    white
    set tixOption(light2_bg)    bisque1
    set tixOption(light2_fg)    white

    set tixOption(active_bg)    $tixOption(dark1_bg)
    set tixOption(active_fg)    $tixOption(fg)
    set tixOption(disabled_fg)  gray55

    set tixOption(input1_bg)    bisque2
    set tixOption(input2_bg)    bisque2
    set tixOption(output1_bg)   $tixOption(dark1_bg)
    set tixOption(output2_bg)   $tixOption(bg)

    set tixOption(select_fg)    black
    set tixOption(select_bg)    bisque2

    set tixOption(selector)	#b03060

option add *background 		$tixOption(bg) 10
option add *Background		$tixOption(bg) $tixOption(prioLevel)
option add *background		$tixOption(bg) $tixOption(prioLevel)
option add *Foreground		$tixOption(fg) $tixOption(prioLevel)
option add *foreground		$tixOption(fg) $tixOption(prioLevel)
option add *activeBackground	$tixOption(active_bg) $tixOption(prioLevel)
option add *activeForeground	$tixOption(active_fg) $tixOption(prioLevel)
option add *HighlightBackground	$tixOption(bg) $tixOption(prioLevel)
option add *selectBackground	$tixOption(select_bg) $tixOption(prioLevel)
option add *selectForeground	$tixOption(select_fg) $tixOption(prioLevel)
option add *selectBorderWidth	0 $tixOption(prioLevel)
option add *Menu.selectColor		$tixOption(selector) $tixOption(prioLevel)
option add *TixMenu.selectColor		$tixOption(selector) $tixOption(prioLevel)
option add *Menubutton.padY			5 $tixOption(prioLevel)
option add *Button.borderWidth		2 $tixOption(prioLevel)
option add *Button.anchor		c $tixOption(prioLevel)
option add *Checkbutton.selectColor		$tixOption(selector) $tixOption(prioLevel)
option add *Radiobutton.selectColor		$tixOption(selector) $tixOption(prioLevel)
option add *Entry.relief		sunken $tixOption(prioLevel)
option add *Entry.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *Entry.background		$tixOption(input1_bg) $tixOption(prioLevel)
option add *Entry.foreground		black $tixOption(prioLevel)
option add *Entry.insertBackground	black $tixOption(prioLevel)
option add *Label.anchor		w $tixOption(prioLevel)
option add *Label.borderWidth		0 $tixOption(prioLevel)
option add *Listbox.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *Listbox.relief		sunken $tixOption(prioLevel)
option add *Scale.foreground		$tixOption(fg) $tixOption(prioLevel)
option add *Scale.activeForeground	$tixOption(bg) $tixOption(prioLevel)
option add *Scale.background		$tixOption(bg) $tixOption(prioLevel)
option add *Scale.sliderForeground	$tixOption(bg) $tixOption(prioLevel)
option add *Scale.sliderBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *Scrollbar.relief		sunken $tixOption(prioLevel)
option add *Scrollbar.borderWidth		1 $tixOption(prioLevel)
option add *Scrollbar.width			15 $tixOption(prioLevel)
option add *Text.background		$tixOption(input1_bg) $tixOption(prioLevel)
option add *Text.relief		sunken $tixOption(prioLevel)
option add *TixBalloon*background 			#ffff60 $tixOption(prioLevel)
option add *TixBalloon*foreground 			black $tixOption(prioLevel)
option add *TixBalloon.background 			black $tixOption(prioLevel)
option add *TixBalloon*Label.anchor 			w $tixOption(prioLevel)
option add *TixControl*entry.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixControl*entry.background		$tixOption(input1_bg) $tixOption(prioLevel)
option add *TixControl*entry.foreground		black $tixOption(prioLevel)
option add *TixControl*entry.insertBackground	black $tixOption(prioLevel)
option add *TixDirTree*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixDirTree*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.activeBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.disabledBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*f1.borderWidth		1 $tixOption(prioLevel)
option add *TixDirTree*f1.relief			sunken $tixOption(prioLevel)
option add *TixDirList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixDirList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixDirList*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.activeBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.disabledBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*f1.borderWidth		1 $tixOption(prioLevel)
option add *TixDirList*f1.relief			sunken $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.activeBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.disabledBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*f1.borderWidth		1 $tixOption(prioLevel)
option add *TixScrolledHList*f1.relief			sunken $tixOption(prioLevel)
option add *TixTree*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixTree*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.activeBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.disabledBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*f1.borderWidth		1 $tixOption(prioLevel)
option add *TixTree*f1.relief			sunken $tixOption(prioLevel)
option add *TixFileEntry*Entry.background 		$tixOption(input1_bg) $tixOption(prioLevel)
option add *TixHList.background			$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixHList.activeBackground		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixHList.disabledBackground		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.background		$tixOption(input1_bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.foreground		black $tixOption(prioLevel)
option add *TixLabelEntry*entry.insertBackground	black $tixOption(prioLevel)
option add *TixMultiList*Listbox.borderWidth		0 $tixOption(prioLevel)
option add *TixMultiList*Listbox.highlightThickness	0 $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.relief		sunken $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.width		15 $tixOption(prioLevel)
option add *TixMultiList*f1.borderWidth		2 $tixOption(prioLevel)
option add *TixMultiList*f1.relief			sunken $tixOption(prioLevel)
option add *TixMultiList*f1.highlightThickness		2 $tixOption(prioLevel)
option add *TixMDIMenuBar*menubar.relief		raised $tixOption(prioLevel)
option add *TixMDIMenuBar*menubar.borderWidth		2 $tixOption(prioLevel)
option add *TixMDIMenuBar*Menubutton.padY 		2 $tixOption(prioLevel)
option add *TixNoteBook.Background			$tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.Background		$tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.backPageColor		$tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.inactiveBackground	$tixOption(inactive_bg) $tixOption(prioLevel)
option add *TixPanedWindow.handleActiveBg 		$tixOption(active_bg) $tixOption(prioLevel)
option add *TixPanedWindow.seperatorBg    		$tixOption(bg) $tixOption(prioLevel)
option add *TixPanedWindow.handleBg       		$tixOption(dark1_bg) $tixOption(prioLevel)
option add *TixPopupMenu*menubutton.background 	$tixOption(dark1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledTList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledTList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledTList*tlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledTList*tlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledListBox*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledListBox*listbox.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*listbox.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledText*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledText*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledWindow*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledWindow*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledWindow.frame.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixTree*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.borderWidth		1 $tixOption(prioLevel)
option add *TixComboBox*Entry.highlightBacground		$tixOption(bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.background			$tixOption(input1_bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.foreground			black $tixOption(prioLevel)
option add *TixComboBox*Entry.insertBackground		black $tixOption(prioLevel)
}
proc tixPref:SetScheme-Mono:Bisque {} {


    global tixOption

    set tixOption(bg)           lightgray
    set tixOption(fg)           black

    set tixOption(dark1_bg)     gray70
    set tixOption(dark1_fg)     black
    set tixOption(dark2_bg)     gray60
    set tixOption(dark2_fg)     white
    set tixOption(inactive_bg)  lightgray
    set tixOption(inactive_fg)  black

    set tixOption(light1_bg)    gray90
    set tixOption(light1_fg)    white
    set tixOption(light2_bg)    gray95
    set tixOption(light2_fg)    white

    set tixOption(active_bg)    gray90
    set tixOption(active_fg)    $tixOption(fg)
    set tixOption(disabled_fg)  gray55

    set tixOption(input1_bg)    $tixOption(light1_bg)
    set tixOption(input2_bg)    $tixOption(light1_bg)
    set tixOption(output1_bg)   $tixOption(light1_bg)
    set tixOption(output2_bg)   $tixOption(light1_bg)

    set tixOption(select_fg)    white
    set tixOption(select_bg)    black

    set tixOption(selector)	black

option add *background 		$tixOption(bg) 10
option add *Background		$tixOption(bg) $tixOption(prioLevel)
option add *background		$tixOption(bg) $tixOption(prioLevel)
option add *Foreground		$tixOption(fg) $tixOption(prioLevel)
option add *foreground		$tixOption(fg) $tixOption(prioLevel)
option add *activeBackground	$tixOption(active_bg) $tixOption(prioLevel)
option add *activeForeground	$tixOption(active_fg) $tixOption(prioLevel)
option add *HighlightBackground	$tixOption(bg) $tixOption(prioLevel)
option add *selectBackground	$tixOption(select_bg) $tixOption(prioLevel)
option add *selectForeground	$tixOption(select_fg) $tixOption(prioLevel)
option add *selectBorderWidth	0 $tixOption(prioLevel)
option add *Menu.selectColor		$tixOption(selector) $tixOption(prioLevel)
option add *TixMenu.selectColor		$tixOption(selector) $tixOption(prioLevel)
option add *Menubutton.padY			5 $tixOption(prioLevel)
option add *Button.borderWidth		2 $tixOption(prioLevel)
option add *Button.anchor		c $tixOption(prioLevel)
option add *Checkbutton.selectColor		$tixOption(selector) $tixOption(prioLevel)
option add *Radiobutton.selectColor		$tixOption(selector) $tixOption(prioLevel)
option add *Entry.relief		sunken $tixOption(prioLevel)
option add *Entry.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *Entry.background		$tixOption(input1_bg) $tixOption(prioLevel)
option add *Entry.foreground		black $tixOption(prioLevel)
option add *Entry.insertBackground	black $tixOption(prioLevel)
option add *Label.anchor		w $tixOption(prioLevel)
option add *Label.borderWidth		0 $tixOption(prioLevel)
option add *Listbox.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *Listbox.relief		sunken $tixOption(prioLevel)
option add *Scale.foreground		$tixOption(fg) $tixOption(prioLevel)
option add *Scale.activeForeground	$tixOption(bg) $tixOption(prioLevel)
option add *Scale.background		$tixOption(bg) $tixOption(prioLevel)
option add *Scale.sliderForeground	$tixOption(bg) $tixOption(prioLevel)
option add *Scale.sliderBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *Scrollbar.relief		sunken $tixOption(prioLevel)
option add *Scrollbar.borderWidth		1 $tixOption(prioLevel)
option add *Scrollbar.width			15 $tixOption(prioLevel)
option add *Text.background		$tixOption(input1_bg) $tixOption(prioLevel)
option add *Text.relief		sunken $tixOption(prioLevel)
option add *TixBalloon*background 			#ffff60 $tixOption(prioLevel)
option add *TixBalloon*foreground 			black $tixOption(prioLevel)
option add *TixBalloon.background 			black $tixOption(prioLevel)
option add *TixBalloon*Label.anchor 			w $tixOption(prioLevel)
option add *TixControl*entry.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixControl*entry.background		$tixOption(input1_bg) $tixOption(prioLevel)
option add *TixControl*entry.foreground		black $tixOption(prioLevel)
option add *TixControl*entry.insertBackground	black $tixOption(prioLevel)
option add *TixDirTree*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixDirTree*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.activeBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.disabledBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*f1.borderWidth		1 $tixOption(prioLevel)
option add *TixDirTree*f1.relief			sunken $tixOption(prioLevel)
option add *TixDirList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixDirList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixDirList*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.activeBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.disabledBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*f1.borderWidth		1 $tixOption(prioLevel)
option add *TixDirList*f1.relief			sunken $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.activeBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.disabledBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*f1.borderWidth		1 $tixOption(prioLevel)
option add *TixScrolledHList*f1.relief			sunken $tixOption(prioLevel)
option add *TixTree*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixTree*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.activeBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.disabledBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*f1.borderWidth		1 $tixOption(prioLevel)
option add *TixTree*f1.relief			sunken $tixOption(prioLevel)
option add *TixFileEntry*Entry.background 		$tixOption(input1_bg) $tixOption(prioLevel)
option add *TixHList.background			$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixHList.activeBackground		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixHList.disabledBackground		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.background		$tixOption(input1_bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.foreground		black $tixOption(prioLevel)
option add *TixLabelEntry*entry.insertBackground	black $tixOption(prioLevel)
option add *TixMultiList*Listbox.borderWidth		0 $tixOption(prioLevel)
option add *TixMultiList*Listbox.highlightThickness	0 $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.relief		sunken $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.width		15 $tixOption(prioLevel)
option add *TixMultiList*f1.borderWidth		2 $tixOption(prioLevel)
option add *TixMultiList*f1.relief			sunken $tixOption(prioLevel)
option add *TixMultiList*f1.highlightThickness		2 $tixOption(prioLevel)
option add *TixMDIMenuBar*menubar.relief		raised $tixOption(prioLevel)
option add *TixMDIMenuBar*menubar.borderWidth		2 $tixOption(prioLevel)
option add *TixMDIMenuBar*Menubutton.padY 		2 $tixOption(prioLevel)
option add *TixNoteBook.Background			$tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.Background		$tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.backPageColor		$tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.inactiveBackground	$tixOption(inactive_bg) $tixOption(prioLevel)
option add *TixPanedWindow.handleActiveBg 		$tixOption(active_bg) $tixOption(prioLevel)
option add *TixPanedWindow.seperatorBg    		$tixOption(bg) $tixOption(prioLevel)
option add *TixPanedWindow.handleBg       		$tixOption(dark1_bg) $tixOption(prioLevel)
option add *TixPopupMenu*menubutton.background 	$tixOption(dark1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledTList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledTList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledTList*tlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledTList*tlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledListBox*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledListBox*listbox.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*listbox.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledText*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledText*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledWindow*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledWindow*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledWindow.frame.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixTree*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.borderWidth		1 $tixOption(prioLevel)
option add *TixComboBox*Entry.highlightBacground		$tixOption(bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.background			$tixOption(input1_bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.foreground			black $tixOption(prioLevel)
option add *TixComboBox*Entry.insertBackground		black $tixOption(prioLevel)
}

 proc tixPref:SetScheme-Color:Blue {} {

    global tixOption

    set tixOption(bg)           #9090f0
    set tixOption(fg)           black

    set tixOption(dark1_bg)     #8080d0
    set tixOption(dark1_fg)     black
    set tixOption(dark2_bg)     #7070c0
    set tixOption(dark2_fg)     black
    set tixOption(inactive_bg)  #8080da
    set tixOption(inactive_fg)  black

    set tixOption(light1_bg)    #a8a8ff
    set tixOption(light1_fg)    black
    set tixOption(light2_bg)    #c0c0ff
    set tixOption(light2_fg)    black

    set tixOption(active_bg)    $tixOption(dark1_bg)
    set tixOption(active_fg)    $tixOption(fg)
    set tixOption(disabled_fg)  gray25

    set tixOption(input1_bg)    $tixOption(light1_bg)
    set tixOption(input2_bg)    $tixOption(bg)
    set tixOption(output1_bg)   $tixOption(light1_bg)
    set tixOption(output2_bg)   $tixOption(bg)

    set tixOption(select_fg)    white
    set tixOption(select_bg)    black

    set tixOption(selector)	yellow

option add *background 		$tixOption(bg) 10
option add *Background		$tixOption(bg) $tixOption(prioLevel)
option add *background		$tixOption(bg) $tixOption(prioLevel)
option add *Foreground		$tixOption(fg) $tixOption(prioLevel)
option add *foreground		$tixOption(fg) $tixOption(prioLevel)
option add *activeBackground	$tixOption(active_bg) $tixOption(prioLevel)
option add *activeForeground	$tixOption(active_fg) $tixOption(prioLevel)
option add *HighlightBackground	$tixOption(bg) $tixOption(prioLevel)
option add *selectBackground	$tixOption(select_bg) $tixOption(prioLevel)
option add *selectForeground	$tixOption(select_fg) $tixOption(prioLevel)
option add *selectBorderWidth	0 $tixOption(prioLevel)
option add *Menu.selectColor		$tixOption(selector) $tixOption(prioLevel)
option add *TixMenu.selectColor		$tixOption(selector) $tixOption(prioLevel)
option add *Menubutton.padY			5 $tixOption(prioLevel)
option add *Button.borderWidth		2 $tixOption(prioLevel)
option add *Button.anchor		c $tixOption(prioLevel)
option add *Checkbutton.selectColor		$tixOption(selector) $tixOption(prioLevel)
option add *Radiobutton.selectColor		$tixOption(selector) $tixOption(prioLevel)
option add *Entry.relief		sunken $tixOption(prioLevel)
option add *Entry.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *Entry.background		$tixOption(input1_bg) $tixOption(prioLevel)
option add *Entry.foreground		black $tixOption(prioLevel)
option add *Entry.insertBackground	black $tixOption(prioLevel)
option add *Label.anchor		w $tixOption(prioLevel)
option add *Label.borderWidth		0 $tixOption(prioLevel)
option add *Listbox.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *Listbox.relief		sunken $tixOption(prioLevel)
option add *Scale.foreground		$tixOption(fg) $tixOption(prioLevel)
option add *Scale.activeForeground	$tixOption(bg) $tixOption(prioLevel)
option add *Scale.background		$tixOption(bg) $tixOption(prioLevel)
option add *Scale.sliderForeground	$tixOption(bg) $tixOption(prioLevel)
option add *Scale.sliderBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *Scrollbar.relief		sunken $tixOption(prioLevel)
option add *Scrollbar.borderWidth		1 $tixOption(prioLevel)
option add *Scrollbar.width			15 $tixOption(prioLevel)
option add *Text.background		$tixOption(input1_bg) $tixOption(prioLevel)
option add *Text.relief		sunken $tixOption(prioLevel)
option add *TixBalloon*background 			#ffff60 $tixOption(prioLevel)
option add *TixBalloon*foreground 			black $tixOption(prioLevel)
option add *TixBalloon.background 			black $tixOption(prioLevel)
option add *TixBalloon*Label.anchor 			w $tixOption(prioLevel)
option add *TixControl*entry.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixControl*entry.background		$tixOption(input1_bg) $tixOption(prioLevel)
option add *TixControl*entry.foreground		black $tixOption(prioLevel)
option add *TixControl*entry.insertBackground	black $tixOption(prioLevel)
option add *TixDirTree*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixDirTree*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.activeBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.disabledBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*f1.borderWidth		1 $tixOption(prioLevel)
option add *TixDirTree*f1.relief			sunken $tixOption(prioLevel)
option add *TixDirList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixDirList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixDirList*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.activeBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.disabledBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*f1.borderWidth		1 $tixOption(prioLevel)
option add *TixDirList*f1.relief			sunken $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.activeBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.disabledBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*f1.borderWidth		1 $tixOption(prioLevel)
option add *TixScrolledHList*f1.relief			sunken $tixOption(prioLevel)
option add *TixTree*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixTree*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.activeBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.disabledBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*f1.borderWidth		1 $tixOption(prioLevel)
option add *TixTree*f1.relief			sunken $tixOption(prioLevel)
option add *TixFileEntry*Entry.background 		$tixOption(input1_bg) $tixOption(prioLevel)
option add *TixHList.background			$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixHList.activeBackground		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixHList.disabledBackground		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.background		$tixOption(input1_bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.foreground		black $tixOption(prioLevel)
option add *TixLabelEntry*entry.insertBackground	black $tixOption(prioLevel)
option add *TixMultiList*Listbox.borderWidth		0 $tixOption(prioLevel)
option add *TixMultiList*Listbox.highlightThickness	0 $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.relief		sunken $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.width		15 $tixOption(prioLevel)
option add *TixMultiList*f1.borderWidth		2 $tixOption(prioLevel)
option add *TixMultiList*f1.relief			sunken $tixOption(prioLevel)
option add *TixMultiList*f1.highlightThickness		2 $tixOption(prioLevel)
option add *TixMDIMenuBar*menubar.relief		raised $tixOption(prioLevel)
option add *TixMDIMenuBar*menubar.borderWidth		2 $tixOption(prioLevel)
option add *TixMDIMenuBar*Menubutton.padY 		2 $tixOption(prioLevel)
option add *TixNoteBook.Background			$tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.Background		$tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.backPageColor		$tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.inactiveBackground	$tixOption(inactive_bg) $tixOption(prioLevel)
option add *TixPanedWindow.handleActiveBg 		$tixOption(active_bg) $tixOption(prioLevel)
option add *TixPanedWindow.seperatorBg    		$tixOption(bg) $tixOption(prioLevel)
option add *TixPanedWindow.handleBg       		$tixOption(dark1_bg) $tixOption(prioLevel)
option add *TixPopupMenu*menubutton.background 	$tixOption(dark1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledTList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledTList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledTList*tlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledTList*tlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledListBox*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledListBox*listbox.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*listbox.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledText*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledText*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledWindow*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledWindow*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledWindow.frame.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixTree*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.borderWidth		1 $tixOption(prioLevel)
option add *TixComboBox*Entry.highlightBacground		$tixOption(bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.background			$tixOption(input1_bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.foreground			black $tixOption(prioLevel)
option add *TixComboBox*Entry.insertBackground		black $tixOption(prioLevel)
}
proc tixPref:SetScheme-Mono:Blue {} {


    global tixOption

    set tixOption(bg)           lightgray
    set tixOption(fg)           black

    set tixOption(dark1_bg)     gray70
    set tixOption(dark1_fg)     black
    set tixOption(dark2_bg)     gray60
    set tixOption(dark2_fg)     white
    set tixOption(inactive_bg)  lightgray
    set tixOption(inactive_fg)  black

    set tixOption(light1_bg)    gray90
    set tixOption(light1_fg)    white
    set tixOption(light2_bg)    gray95
    set tixOption(light2_fg)    white

    set tixOption(active_bg)    gray90
    set tixOption(active_fg)    $tixOption(fg)
    set tixOption(disabled_fg)  gray55

    set tixOption(input1_bg)    $tixOption(light1_bg)
    set tixOption(input2_bg)    $tixOption(light1_bg)
    set tixOption(output1_bg)   $tixOption(light1_bg)
    set tixOption(output2_bg)   $tixOption(light1_bg)

    set tixOption(select_fg)    white
    set tixOption(select_bg)    black

    set tixOption(selector)	black

option add *background 		$tixOption(bg) 10
option add *Background		$tixOption(bg) $tixOption(prioLevel)
option add *background		$tixOption(bg) $tixOption(prioLevel)
option add *Foreground		$tixOption(fg) $tixOption(prioLevel)
option add *foreground		$tixOption(fg) $tixOption(prioLevel)
option add *activeBackground	$tixOption(active_bg) $tixOption(prioLevel)
option add *activeForeground	$tixOption(active_fg) $tixOption(prioLevel)
option add *HighlightBackground	$tixOption(bg) $tixOption(prioLevel)
option add *selectBackground	$tixOption(select_bg) $tixOption(prioLevel)
option add *selectForeground	$tixOption(select_fg) $tixOption(prioLevel)
option add *selectBorderWidth	0 $tixOption(prioLevel)
option add *Menu.selectColor		$tixOption(selector) $tixOption(prioLevel)
option add *TixMenu.selectColor		$tixOption(selector) $tixOption(prioLevel)
option add *Menubutton.padY			5 $tixOption(prioLevel)
option add *Button.borderWidth		2 $tixOption(prioLevel)
option add *Button.anchor		c $tixOption(prioLevel)
option add *Checkbutton.selectColor		$tixOption(selector) $tixOption(prioLevel)
option add *Radiobutton.selectColor		$tixOption(selector) $tixOption(prioLevel)
option add *Entry.relief		sunken $tixOption(prioLevel)
option add *Entry.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *Entry.background		$tixOption(input1_bg) $tixOption(prioLevel)
option add *Entry.foreground		black $tixOption(prioLevel)
option add *Entry.insertBackground	black $tixOption(prioLevel)
option add *Label.anchor		w $tixOption(prioLevel)
option add *Label.borderWidth		0 $tixOption(prioLevel)
option add *Listbox.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *Listbox.relief		sunken $tixOption(prioLevel)
option add *Scale.foreground		$tixOption(fg) $tixOption(prioLevel)
option add *Scale.activeForeground	$tixOption(bg) $tixOption(prioLevel)
option add *Scale.background		$tixOption(bg) $tixOption(prioLevel)
option add *Scale.sliderForeground	$tixOption(bg) $tixOption(prioLevel)
option add *Scale.sliderBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *Scrollbar.relief		sunken $tixOption(prioLevel)
option add *Scrollbar.borderWidth		1 $tixOption(prioLevel)
option add *Scrollbar.width			15 $tixOption(prioLevel)
option add *Text.background		$tixOption(input1_bg) $tixOption(prioLevel)
option add *Text.relief		sunken $tixOption(prioLevel)
option add *TixBalloon*background 			#ffff60 $tixOption(prioLevel)
option add *TixBalloon*foreground 			black $tixOption(prioLevel)
option add *TixBalloon.background 			black $tixOption(prioLevel)
option add *TixBalloon*Label.anchor 			w $tixOption(prioLevel)
option add *TixControl*entry.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixControl*entry.background		$tixOption(input1_bg) $tixOption(prioLevel)
option add *TixControl*entry.foreground		black $tixOption(prioLevel)
option add *TixControl*entry.insertBackground	black $tixOption(prioLevel)
option add *TixDirTree*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixDirTree*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.activeBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.disabledBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*f1.borderWidth		1 $tixOption(prioLevel)
option add *TixDirTree*f1.relief			sunken $tixOption(prioLevel)
option add *TixDirList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixDirList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixDirList*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.activeBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.disabledBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*f1.borderWidth		1 $tixOption(prioLevel)
option add *TixDirList*f1.relief			sunken $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.activeBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.disabledBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*f1.borderWidth		1 $tixOption(prioLevel)
option add *TixScrolledHList*f1.relief			sunken $tixOption(prioLevel)
option add *TixTree*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixTree*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.activeBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.disabledBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*f1.borderWidth		1 $tixOption(prioLevel)
option add *TixTree*f1.relief			sunken $tixOption(prioLevel)
option add *TixFileEntry*Entry.background 		$tixOption(input1_bg) $tixOption(prioLevel)
option add *TixHList.background			$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixHList.activeBackground		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixHList.disabledBackground		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.background		$tixOption(input1_bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.foreground		black $tixOption(prioLevel)
option add *TixLabelEntry*entry.insertBackground	black $tixOption(prioLevel)
option add *TixMultiList*Listbox.borderWidth		0 $tixOption(prioLevel)
option add *TixMultiList*Listbox.highlightThickness	0 $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.relief		sunken $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.width		15 $tixOption(prioLevel)
option add *TixMultiList*f1.borderWidth		2 $tixOption(prioLevel)
option add *TixMultiList*f1.relief			sunken $tixOption(prioLevel)
option add *TixMultiList*f1.highlightThickness		2 $tixOption(prioLevel)
option add *TixMDIMenuBar*menubar.relief		raised $tixOption(prioLevel)
option add *TixMDIMenuBar*menubar.borderWidth		2 $tixOption(prioLevel)
option add *TixMDIMenuBar*Menubutton.padY 		2 $tixOption(prioLevel)
option add *TixNoteBook.Background			$tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.Background		$tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.backPageColor		$tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.inactiveBackground	$tixOption(inactive_bg) $tixOption(prioLevel)
option add *TixPanedWindow.handleActiveBg 		$tixOption(active_bg) $tixOption(prioLevel)
option add *TixPanedWindow.seperatorBg    		$tixOption(bg) $tixOption(prioLevel)
option add *TixPanedWindow.handleBg       		$tixOption(dark1_bg) $tixOption(prioLevel)
option add *TixPopupMenu*menubutton.background 	$tixOption(dark1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledTList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledTList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledTList*tlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledTList*tlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledListBox*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledListBox*listbox.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*listbox.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledText*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledText*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledWindow*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledWindow*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledWindow.frame.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixTree*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.borderWidth		1 $tixOption(prioLevel)
option add *TixComboBox*Entry.highlightBacground		$tixOption(bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.background			$tixOption(input1_bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.foreground			black $tixOption(prioLevel)
option add *TixComboBox*Entry.insertBackground		black $tixOption(prioLevel)
}

 proc tixPref:SetScheme-Color:Gray {} {


    global tixOption

    set tixOption(bg)           lightgray
    set tixOption(fg)           black

    set tixOption(dark1_bg)     gray
    set tixOption(dark1_fg)     black
    set tixOption(dark2_bg)     gray50
    set tixOption(dark2_fg)     black
    set tixOption(inactive_bg)  gray50
    set tixOption(inactive_fg)  black

    set tixOption(light1_bg)    gray90
    set tixOption(light1_fg)    white
    set tixOption(light2_bg)    gray95
    set tixOption(light2_fg)    white

    set tixOption(active_bg)    $tixOption(dark1_bg)
    set tixOption(active_fg)    $tixOption(fg)
    set tixOption(disabled_fg)  gray55

    set tixOption(input1_bg)    $tixOption(dark1_bg)
    set tixOption(input2_bg)    $tixOption(bg)
    set tixOption(output1_bg)   $tixOption(dark1_bg)
    set tixOption(output2_bg)   $tixOption(bg)
	
    set tixOption(select_fg)    black
    set tixOption(select_bg)    lightblue
	
    set tixOption(selector)	yellow

option add *background 		$tixOption(bg) 10
option add *Background		$tixOption(bg) $tixOption(prioLevel)
option add *background		$tixOption(bg) $tixOption(prioLevel)
option add *Foreground		$tixOption(fg) $tixOption(prioLevel)
option add *foreground		$tixOption(fg) $tixOption(prioLevel)
option add *activeBackground	$tixOption(active_bg) $tixOption(prioLevel)
option add *activeForeground	$tixOption(active_fg) $tixOption(prioLevel)
option add *HighlightBackground	$tixOption(bg) $tixOption(prioLevel)
option add *selectBackground	$tixOption(select_bg) $tixOption(prioLevel)
option add *selectForeground	$tixOption(select_fg) $tixOption(prioLevel)
option add *selectBorderWidth	0 $tixOption(prioLevel)
option add *Menu.selectColor		$tixOption(selector) $tixOption(prioLevel)
option add *TixMenu.selectColor		$tixOption(selector) $tixOption(prioLevel)
option add *Menubutton.padY			5 $tixOption(prioLevel)
option add *Button.borderWidth		2 $tixOption(prioLevel)
option add *Button.anchor		c $tixOption(prioLevel)
option add *Checkbutton.selectColor		$tixOption(selector) $tixOption(prioLevel)
option add *Radiobutton.selectColor		$tixOption(selector) $tixOption(prioLevel)
option add *Entry.relief		sunken $tixOption(prioLevel)
option add *Entry.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *Entry.background		$tixOption(input1_bg) $tixOption(prioLevel)
option add *Entry.foreground		black $tixOption(prioLevel)
option add *Entry.insertBackground	black $tixOption(prioLevel)
option add *Label.anchor		w $tixOption(prioLevel)
option add *Label.borderWidth		0 $tixOption(prioLevel)
option add *Listbox.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *Listbox.relief		sunken $tixOption(prioLevel)
option add *Scale.foreground		$tixOption(fg) $tixOption(prioLevel)
option add *Scale.activeForeground	$tixOption(bg) $tixOption(prioLevel)
option add *Scale.background		$tixOption(bg) $tixOption(prioLevel)
option add *Scale.sliderForeground	$tixOption(bg) $tixOption(prioLevel)
option add *Scale.sliderBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *Scrollbar.relief		sunken $tixOption(prioLevel)
option add *Scrollbar.borderWidth		1 $tixOption(prioLevel)
option add *Scrollbar.width			15 $tixOption(prioLevel)
option add *Text.background		$tixOption(input1_bg) $tixOption(prioLevel)
option add *Text.relief		sunken $tixOption(prioLevel)
option add *TixBalloon*background 			#ffff60 $tixOption(prioLevel)
option add *TixBalloon*foreground 			black $tixOption(prioLevel)
option add *TixBalloon.background 			black $tixOption(prioLevel)
option add *TixBalloon*Label.anchor 			w $tixOption(prioLevel)
option add *TixControl*entry.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixControl*entry.background		$tixOption(input1_bg) $tixOption(prioLevel)
option add *TixControl*entry.foreground		black $tixOption(prioLevel)
option add *TixControl*entry.insertBackground	black $tixOption(prioLevel)
option add *TixDirTree*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixDirTree*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.activeBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.disabledBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*f1.borderWidth		1 $tixOption(prioLevel)
option add *TixDirTree*f1.relief			sunken $tixOption(prioLevel)
option add *TixDirList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixDirList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixDirList*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.activeBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.disabledBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*f1.borderWidth		1 $tixOption(prioLevel)
option add *TixDirList*f1.relief			sunken $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.activeBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.disabledBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*f1.borderWidth		1 $tixOption(prioLevel)
option add *TixScrolledHList*f1.relief			sunken $tixOption(prioLevel)
option add *TixTree*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixTree*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.activeBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.disabledBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*f1.borderWidth		1 $tixOption(prioLevel)
option add *TixTree*f1.relief			sunken $tixOption(prioLevel)
option add *TixFileEntry*Entry.background 		$tixOption(input1_bg) $tixOption(prioLevel)
option add *TixHList.background			$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixHList.activeBackground		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixHList.disabledBackground		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.background		$tixOption(input1_bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.foreground		black $tixOption(prioLevel)
option add *TixLabelEntry*entry.insertBackground	black $tixOption(prioLevel)
option add *TixMultiList*Listbox.borderWidth		0 $tixOption(prioLevel)
option add *TixMultiList*Listbox.highlightThickness	0 $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.relief		sunken $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.width		15 $tixOption(prioLevel)
option add *TixMultiList*f1.borderWidth		2 $tixOption(prioLevel)
option add *TixMultiList*f1.relief			sunken $tixOption(prioLevel)
option add *TixMultiList*f1.highlightThickness		2 $tixOption(prioLevel)
option add *TixMDIMenuBar*menubar.relief		raised $tixOption(prioLevel)
option add *TixMDIMenuBar*menubar.borderWidth		2 $tixOption(prioLevel)
option add *TixMDIMenuBar*Menubutton.padY 		2 $tixOption(prioLevel)
option add *TixNoteBook.Background			$tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.Background		$tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.backPageColor		$tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.inactiveBackground	$tixOption(inactive_bg) $tixOption(prioLevel)
option add *TixPanedWindow.handleActiveBg 		$tixOption(active_bg) $tixOption(prioLevel)
option add *TixPanedWindow.seperatorBg    		$tixOption(bg) $tixOption(prioLevel)
option add *TixPanedWindow.handleBg       		$tixOption(dark1_bg) $tixOption(prioLevel)
option add *TixPopupMenu*menubutton.background 	$tixOption(dark1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledTList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledTList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledTList*tlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledTList*tlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledListBox*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledListBox*listbox.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*listbox.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledText*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledText*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledWindow*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledWindow*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledWindow.frame.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixTree*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.borderWidth		1 $tixOption(prioLevel)
option add *TixComboBox*Entry.highlightBacground		$tixOption(bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.background			$tixOption(input1_bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.foreground			black $tixOption(prioLevel)
option add *TixComboBox*Entry.insertBackground		black $tixOption(prioLevel)
}
proc tixPref:SetScheme-Mono:Gray {} {


    global tixOption

    set tixOption(bg)           lightgray
    set tixOption(fg)           black

    set tixOption(dark1_bg)     gray70
    set tixOption(dark1_fg)     black
    set tixOption(dark2_bg)     gray60
    set tixOption(dark2_fg)     white
    set tixOption(inactive_bg)  lightgray
    set tixOption(inactive_fg)  black

    set tixOption(light1_bg)    gray90
    set tixOption(light1_fg)    white
    set tixOption(light2_bg)    gray95
    set tixOption(light2_fg)    white

    set tixOption(active_bg)    gray90
    set tixOption(active_fg)    $tixOption(fg)
    set tixOption(disabled_fg)  gray55

    set tixOption(input1_bg)    $tixOption(light1_bg)
    set tixOption(input2_bg)    $tixOption(light1_bg)
    set tixOption(output1_bg)   $tixOption(light1_bg)
    set tixOption(output2_bg)   $tixOption(light1_bg)

    set tixOption(select_fg)    white
    set tixOption(select_bg)    black

    set tixOption(selector)	black

option add *background 		$tixOption(bg) 10
option add *Background		$tixOption(bg) $tixOption(prioLevel)
option add *background		$tixOption(bg) $tixOption(prioLevel)
option add *Foreground		$tixOption(fg) $tixOption(prioLevel)
option add *foreground		$tixOption(fg) $tixOption(prioLevel)
option add *activeBackground	$tixOption(active_bg) $tixOption(prioLevel)
option add *activeForeground	$tixOption(active_fg) $tixOption(prioLevel)
option add *HighlightBackground	$tixOption(bg) $tixOption(prioLevel)
option add *selectBackground	$tixOption(select_bg) $tixOption(prioLevel)
option add *selectForeground	$tixOption(select_fg) $tixOption(prioLevel)
option add *selectBorderWidth	0 $tixOption(prioLevel)
option add *Menu.selectColor		$tixOption(selector) $tixOption(prioLevel)
option add *TixMenu.selectColor		$tixOption(selector) $tixOption(prioLevel)
option add *Menubutton.padY			5 $tixOption(prioLevel)
option add *Button.borderWidth		2 $tixOption(prioLevel)
option add *Button.anchor		c $tixOption(prioLevel)
option add *Checkbutton.selectColor		$tixOption(selector) $tixOption(prioLevel)
option add *Radiobutton.selectColor		$tixOption(selector) $tixOption(prioLevel)
option add *Entry.relief		sunken $tixOption(prioLevel)
option add *Entry.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *Entry.background		$tixOption(input1_bg) $tixOption(prioLevel)
option add *Entry.foreground		black $tixOption(prioLevel)
option add *Entry.insertBackground	black $tixOption(prioLevel)
option add *Label.anchor		w $tixOption(prioLevel)
option add *Label.borderWidth		0 $tixOption(prioLevel)
option add *Listbox.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *Listbox.relief		sunken $tixOption(prioLevel)
option add *Scale.foreground		$tixOption(fg) $tixOption(prioLevel)
option add *Scale.activeForeground	$tixOption(bg) $tixOption(prioLevel)
option add *Scale.background		$tixOption(bg) $tixOption(prioLevel)
option add *Scale.sliderForeground	$tixOption(bg) $tixOption(prioLevel)
option add *Scale.sliderBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *Scrollbar.relief		sunken $tixOption(prioLevel)
option add *Scrollbar.borderWidth		1 $tixOption(prioLevel)
option add *Scrollbar.width			15 $tixOption(prioLevel)
option add *Text.background		$tixOption(input1_bg) $tixOption(prioLevel)
option add *Text.relief		sunken $tixOption(prioLevel)
option add *TixBalloon*background 			#ffff60 $tixOption(prioLevel)
option add *TixBalloon*foreground 			black $tixOption(prioLevel)
option add *TixBalloon.background 			black $tixOption(prioLevel)
option add *TixBalloon*Label.anchor 			w $tixOption(prioLevel)
option add *TixControl*entry.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixControl*entry.background		$tixOption(input1_bg) $tixOption(prioLevel)
option add *TixControl*entry.foreground		black $tixOption(prioLevel)
option add *TixControl*entry.insertBackground	black $tixOption(prioLevel)
option add *TixDirTree*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixDirTree*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.activeBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.disabledBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*f1.borderWidth		1 $tixOption(prioLevel)
option add *TixDirTree*f1.relief			sunken $tixOption(prioLevel)
option add *TixDirList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixDirList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixDirList*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.activeBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.disabledBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*f1.borderWidth		1 $tixOption(prioLevel)
option add *TixDirList*f1.relief			sunken $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.activeBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.disabledBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*f1.borderWidth		1 $tixOption(prioLevel)
option add *TixScrolledHList*f1.relief			sunken $tixOption(prioLevel)
option add *TixTree*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixTree*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.activeBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.disabledBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*f1.borderWidth		1 $tixOption(prioLevel)
option add *TixTree*f1.relief			sunken $tixOption(prioLevel)
option add *TixFileEntry*Entry.background 		$tixOption(input1_bg) $tixOption(prioLevel)
option add *TixHList.background			$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixHList.activeBackground		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixHList.disabledBackground		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.background		$tixOption(input1_bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.foreground		black $tixOption(prioLevel)
option add *TixLabelEntry*entry.insertBackground	black $tixOption(prioLevel)
option add *TixMultiList*Listbox.borderWidth		0 $tixOption(prioLevel)
option add *TixMultiList*Listbox.highlightThickness	0 $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.relief		sunken $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.width		15 $tixOption(prioLevel)
option add *TixMultiList*f1.borderWidth		2 $tixOption(prioLevel)
option add *TixMultiList*f1.relief			sunken $tixOption(prioLevel)
option add *TixMultiList*f1.highlightThickness		2 $tixOption(prioLevel)
option add *TixMDIMenuBar*menubar.relief		raised $tixOption(prioLevel)
option add *TixMDIMenuBar*menubar.borderWidth		2 $tixOption(prioLevel)
option add *TixMDIMenuBar*Menubutton.padY 		2 $tixOption(prioLevel)
option add *TixNoteBook.Background			$tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.Background		$tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.backPageColor		$tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.inactiveBackground	$tixOption(inactive_bg) $tixOption(prioLevel)
option add *TixPanedWindow.handleActiveBg 		$tixOption(active_bg) $tixOption(prioLevel)
option add *TixPanedWindow.seperatorBg    		$tixOption(bg) $tixOption(prioLevel)
option add *TixPanedWindow.handleBg       		$tixOption(dark1_bg) $tixOption(prioLevel)
option add *TixPopupMenu*menubutton.background 	$tixOption(dark1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledTList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledTList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledTList*tlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledTList*tlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledListBox*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledListBox*listbox.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*listbox.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledText*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledText*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledWindow*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledWindow*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledWindow.frame.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixTree*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.borderWidth		1 $tixOption(prioLevel)
option add *TixComboBox*Entry.highlightBacground		$tixOption(bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.background			$tixOption(input1_bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.foreground			black $tixOption(prioLevel)
option add *TixComboBox*Entry.insertBackground		black $tixOption(prioLevel)
}

 proc tixPref:SetScheme-Color:SGIGray {} {


    global tixOption

    set tixOption(bg)           lightgray
    set tixOption(fg)           black

    set tixOption(dark1_bg)     gray
    set tixOption(dark1_fg)     black
    set tixOption(dark2_bg)     gray50
    set tixOption(dark2_fg)     black
    set tixOption(inactive_bg)  gray50
    set tixOption(inactive_fg)  black

    set tixOption(light1_bg)    gray90
    set tixOption(light1_fg)    white
    set tixOption(light2_bg)    gray95
    set tixOption(light2_fg)    white

    set tixOption(active_bg)    $tixOption(bg)
    set tixOption(active_fg)    $tixOption(fg)
    set tixOption(disabled_fg)  gray35

    set tixOption(input1_bg)    rosybrown
    set tixOption(input2_bg)    rosybrown
    set tixOption(output1_bg)   $tixOption(dark1_bg)
    set tixOption(output2_bg)   $tixOption(bg)

    set tixOption(select_fg)    black
    set tixOption(select_bg)    lightblue

    set tixOption(selector)	yellow

option add *background 		$tixOption(bg) 10
option add *Background		$tixOption(bg) $tixOption(prioLevel)
option add *background		$tixOption(bg) $tixOption(prioLevel)
option add *Foreground		$tixOption(fg) $tixOption(prioLevel)
option add *foreground		$tixOption(fg) $tixOption(prioLevel)
option add *activeBackground	$tixOption(active_bg) $tixOption(prioLevel)
option add *activeForeground	$tixOption(active_fg) $tixOption(prioLevel)
option add *HighlightBackground	$tixOption(bg) $tixOption(prioLevel)
option add *selectBackground	$tixOption(select_bg) $tixOption(prioLevel)
option add *selectForeground	$tixOption(select_fg) $tixOption(prioLevel)
option add *selectBorderWidth	0 $tixOption(prioLevel)
option add *Menu.selectColor		$tixOption(selector) $tixOption(prioLevel)
option add *TixMenu.selectColor		$tixOption(selector) $tixOption(prioLevel)
option add *Menubutton.padY			5 $tixOption(prioLevel)
option add *Button.borderWidth		2 $tixOption(prioLevel)
option add *Button.anchor		c $tixOption(prioLevel)
option add *Checkbutton.selectColor		$tixOption(selector) $tixOption(prioLevel)
option add *Radiobutton.selectColor		$tixOption(selector) $tixOption(prioLevel)
option add *Entry.relief		sunken $tixOption(prioLevel)
option add *Entry.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *Entry.background		$tixOption(input1_bg) $tixOption(prioLevel)
option add *Entry.foreground		black $tixOption(prioLevel)
option add *Entry.insertBackground	black $tixOption(prioLevel)
option add *Label.anchor		w $tixOption(prioLevel)
option add *Label.borderWidth		0 $tixOption(prioLevel)
option add *Listbox.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *Listbox.relief		sunken $tixOption(prioLevel)
option add *Scale.foreground		$tixOption(fg) $tixOption(prioLevel)
option add *Scale.activeForeground	$tixOption(bg) $tixOption(prioLevel)
option add *Scale.background		$tixOption(bg) $tixOption(prioLevel)
option add *Scale.sliderForeground	$tixOption(bg) $tixOption(prioLevel)
option add *Scale.sliderBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *Scrollbar.relief		sunken $tixOption(prioLevel)
option add *Scrollbar.borderWidth		1 $tixOption(prioLevel)
option add *Scrollbar.width			15 $tixOption(prioLevel)
option add *Text.background		$tixOption(input1_bg) $tixOption(prioLevel)
option add *Text.relief		sunken $tixOption(prioLevel)
option add *TixBalloon*background 			#ffff60 $tixOption(prioLevel)
option add *TixBalloon*foreground 			black $tixOption(prioLevel)
option add *TixBalloon.background 			black $tixOption(prioLevel)
option add *TixBalloon*Label.anchor 			w $tixOption(prioLevel)
option add *TixControl*entry.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixControl*entry.background		$tixOption(input1_bg) $tixOption(prioLevel)
option add *TixControl*entry.foreground		black $tixOption(prioLevel)
option add *TixControl*entry.insertBackground	black $tixOption(prioLevel)
option add *TixDirTree*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixDirTree*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.activeBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.disabledBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*f1.borderWidth		1 $tixOption(prioLevel)
option add *TixDirTree*f1.relief			sunken $tixOption(prioLevel)
option add *TixDirList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixDirList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixDirList*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.activeBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.disabledBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*f1.borderWidth		1 $tixOption(prioLevel)
option add *TixDirList*f1.relief			sunken $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.activeBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.disabledBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*f1.borderWidth		1 $tixOption(prioLevel)
option add *TixScrolledHList*f1.relief			sunken $tixOption(prioLevel)
option add *TixTree*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixTree*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.activeBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.disabledBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*f1.borderWidth		1 $tixOption(prioLevel)
option add *TixTree*f1.relief			sunken $tixOption(prioLevel)
option add *TixFileEntry*Entry.background 		$tixOption(input1_bg) $tixOption(prioLevel)
option add *TixHList.background			$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixHList.activeBackground		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixHList.disabledBackground		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.background		$tixOption(input1_bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.foreground		black $tixOption(prioLevel)
option add *TixLabelEntry*entry.insertBackground	black $tixOption(prioLevel)
option add *TixMultiList*Listbox.borderWidth		0 $tixOption(prioLevel)
option add *TixMultiList*Listbox.highlightThickness	0 $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.relief		sunken $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.width		15 $tixOption(prioLevel)
option add *TixMultiList*f1.borderWidth		2 $tixOption(prioLevel)
option add *TixMultiList*f1.relief			sunken $tixOption(prioLevel)
option add *TixMultiList*f1.highlightThickness		2 $tixOption(prioLevel)
option add *TixMDIMenuBar*menubar.relief		raised $tixOption(prioLevel)
option add *TixMDIMenuBar*menubar.borderWidth		2 $tixOption(prioLevel)
option add *TixMDIMenuBar*Menubutton.padY 		2 $tixOption(prioLevel)
option add *TixNoteBook.Background			$tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.Background		$tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.backPageColor		$tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.inactiveBackground	$tixOption(inactive_bg) $tixOption(prioLevel)
option add *TixPanedWindow.handleActiveBg 		$tixOption(active_bg) $tixOption(prioLevel)
option add *TixPanedWindow.seperatorBg    		$tixOption(bg) $tixOption(prioLevel)
option add *TixPanedWindow.handleBg       		$tixOption(dark1_bg) $tixOption(prioLevel)
option add *TixPopupMenu*menubutton.background 	$tixOption(dark1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledTList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledTList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledTList*tlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledTList*tlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledListBox*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledListBox*listbox.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*listbox.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledText*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledText*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledWindow*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledWindow*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledWindow.frame.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixTree*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.borderWidth		1 $tixOption(prioLevel)
option add *TixComboBox*Entry.highlightBacground		$tixOption(bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.background			$tixOption(input1_bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.foreground			black $tixOption(prioLevel)
option add *TixComboBox*Entry.insertBackground		black $tixOption(prioLevel)
}
proc tixPref:SetScheme-Mono:SGIGray {} {


    global tixOption

    set tixOption(bg)           lightgray
    set tixOption(fg)           black

    set tixOption(dark1_bg)     gray70
    set tixOption(dark1_fg)     black
    set tixOption(dark2_bg)     gray60
    set tixOption(dark2_fg)     white
    set tixOption(inactive_bg)  lightgray
    set tixOption(inactive_fg)  black

    set tixOption(light1_bg)    gray90
    set tixOption(light1_fg)    white
    set tixOption(light2_bg)    gray95
    set tixOption(light2_fg)    white

    set tixOption(active_bg)    gray90
    set tixOption(active_fg)    $tixOption(fg)
    set tixOption(disabled_fg)  gray55

    set tixOption(input1_bg)    $tixOption(light1_bg)
    set tixOption(input2_bg)    $tixOption(light1_bg)
    set tixOption(output1_bg)   $tixOption(light1_bg)
    set tixOption(output2_bg)   $tixOption(light1_bg)

    set tixOption(select_fg)    white
    set tixOption(select_bg)    black

    set tixOption(selector)	black

option add *background 		$tixOption(bg) 10
option add *Background		$tixOption(bg) $tixOption(prioLevel)
option add *background		$tixOption(bg) $tixOption(prioLevel)
option add *Foreground		$tixOption(fg) $tixOption(prioLevel)
option add *foreground		$tixOption(fg) $tixOption(prioLevel)
option add *activeBackground	$tixOption(active_bg) $tixOption(prioLevel)
option add *activeForeground	$tixOption(active_fg) $tixOption(prioLevel)
option add *HighlightBackground	$tixOption(bg) $tixOption(prioLevel)
option add *selectBackground	$tixOption(select_bg) $tixOption(prioLevel)
option add *selectForeground	$tixOption(select_fg) $tixOption(prioLevel)
option add *selectBorderWidth	0 $tixOption(prioLevel)
option add *Menu.selectColor		$tixOption(selector) $tixOption(prioLevel)
option add *TixMenu.selectColor		$tixOption(selector) $tixOption(prioLevel)
option add *Menubutton.padY			5 $tixOption(prioLevel)
option add *Button.borderWidth		2 $tixOption(prioLevel)
option add *Button.anchor		c $tixOption(prioLevel)
option add *Checkbutton.selectColor		$tixOption(selector) $tixOption(prioLevel)
option add *Radiobutton.selectColor		$tixOption(selector) $tixOption(prioLevel)
option add *Entry.relief		sunken $tixOption(prioLevel)
option add *Entry.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *Entry.background		$tixOption(input1_bg) $tixOption(prioLevel)
option add *Entry.foreground		black $tixOption(prioLevel)
option add *Entry.insertBackground	black $tixOption(prioLevel)
option add *Label.anchor		w $tixOption(prioLevel)
option add *Label.borderWidth		0 $tixOption(prioLevel)
option add *Listbox.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *Listbox.relief		sunken $tixOption(prioLevel)
option add *Scale.foreground		$tixOption(fg) $tixOption(prioLevel)
option add *Scale.activeForeground	$tixOption(bg) $tixOption(prioLevel)
option add *Scale.background		$tixOption(bg) $tixOption(prioLevel)
option add *Scale.sliderForeground	$tixOption(bg) $tixOption(prioLevel)
option add *Scale.sliderBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *Scrollbar.relief		sunken $tixOption(prioLevel)
option add *Scrollbar.borderWidth		1 $tixOption(prioLevel)
option add *Scrollbar.width			15 $tixOption(prioLevel)
option add *Text.background		$tixOption(input1_bg) $tixOption(prioLevel)
option add *Text.relief		sunken $tixOption(prioLevel)
option add *TixBalloon*background 			#ffff60 $tixOption(prioLevel)
option add *TixBalloon*foreground 			black $tixOption(prioLevel)
option add *TixBalloon.background 			black $tixOption(prioLevel)
option add *TixBalloon*Label.anchor 			w $tixOption(prioLevel)
option add *TixControl*entry.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixControl*entry.background		$tixOption(input1_bg) $tixOption(prioLevel)
option add *TixControl*entry.foreground		black $tixOption(prioLevel)
option add *TixControl*entry.insertBackground	black $tixOption(prioLevel)
option add *TixDirTree*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixDirTree*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.activeBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.disabledBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*f1.borderWidth		1 $tixOption(prioLevel)
option add *TixDirTree*f1.relief			sunken $tixOption(prioLevel)
option add *TixDirList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixDirList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixDirList*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.activeBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.disabledBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*f1.borderWidth		1 $tixOption(prioLevel)
option add *TixDirList*f1.relief			sunken $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.activeBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.disabledBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*f1.borderWidth		1 $tixOption(prioLevel)
option add *TixScrolledHList*f1.relief			sunken $tixOption(prioLevel)
option add *TixTree*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixTree*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.activeBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.disabledBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*f1.borderWidth		1 $tixOption(prioLevel)
option add *TixTree*f1.relief			sunken $tixOption(prioLevel)
option add *TixFileEntry*Entry.background 		$tixOption(input1_bg) $tixOption(prioLevel)
option add *TixHList.background			$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixHList.activeBackground		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixHList.disabledBackground		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.background		$tixOption(input1_bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.foreground		black $tixOption(prioLevel)
option add *TixLabelEntry*entry.insertBackground	black $tixOption(prioLevel)
option add *TixMultiList*Listbox.borderWidth		0 $tixOption(prioLevel)
option add *TixMultiList*Listbox.highlightThickness	0 $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.relief		sunken $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.width		15 $tixOption(prioLevel)
option add *TixMultiList*f1.borderWidth		2 $tixOption(prioLevel)
option add *TixMultiList*f1.relief			sunken $tixOption(prioLevel)
option add *TixMultiList*f1.highlightThickness		2 $tixOption(prioLevel)
option add *TixMDIMenuBar*menubar.relief		raised $tixOption(prioLevel)
option add *TixMDIMenuBar*menubar.borderWidth		2 $tixOption(prioLevel)
option add *TixMDIMenuBar*Menubutton.padY 		2 $tixOption(prioLevel)
option add *TixNoteBook.Background			$tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.Background		$tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.backPageColor		$tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.inactiveBackground	$tixOption(inactive_bg) $tixOption(prioLevel)
option add *TixPanedWindow.handleActiveBg 		$tixOption(active_bg) $tixOption(prioLevel)
option add *TixPanedWindow.seperatorBg    		$tixOption(bg) $tixOption(prioLevel)
option add *TixPanedWindow.handleBg       		$tixOption(dark1_bg) $tixOption(prioLevel)
option add *TixPopupMenu*menubutton.background 	$tixOption(dark1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledTList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledTList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledTList*tlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledTList*tlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledListBox*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledListBox*listbox.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*listbox.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledText*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledText*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledWindow*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledWindow*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledWindow.frame.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixTree*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.borderWidth		1 $tixOption(prioLevel)
option add *TixComboBox*Entry.highlightBacground		$tixOption(bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.background			$tixOption(input1_bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.foreground			black $tixOption(prioLevel)
option add *TixComboBox*Entry.insertBackground		black $tixOption(prioLevel)
}

 proc tixPref:SetScheme-Color:TK {} {

    global tixOption

    set tixOption(bg)           #d9d9d9
    set tixOption(fg)           black

    set tixOption(dark1_bg)     #c3c3c3
    set tixOption(dark1_fg)     black
    set tixOption(dark2_bg)     #a3a3a3
    set tixOption(dark2_fg)     black
    set tixOption(inactive_bg)  #a3a3a3
    set tixOption(inactive_fg)  black

    set tixOption(light1_bg)    #ececec
    set tixOption(light1_fg)    white
    set tixOption(light2_bg)    #fcfcfc
    set tixOption(light2_fg)    white

    set tixOption(active_bg)    $tixOption(dark1_bg)
    set tixOption(active_fg)    $tixOption(fg)
    set tixOption(disabled_fg)  gray55

    set tixOption(input1_bg)    #d9d9d9
    set tixOption(input2_bg)    #d9d9d9
    set tixOption(output1_bg)   $tixOption(dark1_bg)
    set tixOption(output2_bg)   $tixOption(bg)

    set tixOption(select_fg)    black
    set tixOption(select_bg)    #c3c3c3

    set tixOption(selector)	#b03060

}
proc tixPref:SetScheme-Mono:TK {} {


    global tixOption

    set tixOption(bg)           lightgray
    set tixOption(fg)           black

    set tixOption(dark1_bg)     gray70
    set tixOption(dark1_fg)     black
    set tixOption(dark2_bg)     gray60
    set tixOption(dark2_fg)     white
    set tixOption(inactive_bg)  lightgray
    set tixOption(inactive_fg)  black

    set tixOption(light1_bg)    gray90
    set tixOption(light1_fg)    white
    set tixOption(light2_bg)    gray95
    set tixOption(light2_fg)    white

    set tixOption(active_bg)    gray90
    set tixOption(active_fg)    $tixOption(fg)
    set tixOption(disabled_fg)  gray55

    set tixOption(input1_bg)    $tixOption(light1_bg)
    set tixOption(input2_bg)    $tixOption(light1_bg)
    set tixOption(output1_bg)   $tixOption(light1_bg)
    set tixOption(output2_bg)   $tixOption(light1_bg)

    set tixOption(select_fg)    white
    set tixOption(select_bg)    black

    set tixOption(selector)	black

}

 proc tixPref:SetScheme-Color:TixGray {} {


    global tixOption

    set tixOption(bg)           lightgray
    set tixOption(fg)           black

    set tixOption(dark1_bg)     gray86
    set tixOption(dark1_fg)     black
    set tixOption(dark2_bg)     gray77
    set tixOption(dark2_fg)     black
    set tixOption(inactive_bg)  gray77
    set tixOption(inactive_fg)  black

    set tixOption(light1_bg)    gray92
    set tixOption(light1_fg)    white
    set tixOption(light2_bg)    gray95
    set tixOption(light2_fg)    white

    set tixOption(active_bg)    $tixOption(dark1_bg)
    set tixOption(active_fg)    $tixOption(fg)
    set tixOption(disabled_fg)  gray55

    set tixOption(input1_bg)    gray95
    set tixOption(input2_bg)    gray95
    set tixOption(output1_bg)   $tixOption(dark1_bg)
    set tixOption(output2_bg)   $tixOption(bg)

    set tixOption(select_fg)    black
    set tixOption(select_bg)    lightblue

    set tixOption(selector)	yellow

option add *background 		$tixOption(bg) 10
option add *Background		$tixOption(bg) $tixOption(prioLevel)
option add *background		$tixOption(bg) $tixOption(prioLevel)
option add *Foreground		$tixOption(fg) $tixOption(prioLevel)
option add *foreground		$tixOption(fg) $tixOption(prioLevel)
option add *activeBackground	$tixOption(active_bg) $tixOption(prioLevel)
option add *activeForeground	$tixOption(active_fg) $tixOption(prioLevel)
option add *HighlightBackground	$tixOption(bg) $tixOption(prioLevel)
option add *selectBackground	$tixOption(select_bg) $tixOption(prioLevel)
option add *selectForeground	$tixOption(select_fg) $tixOption(prioLevel)
option add *selectBorderWidth	0 $tixOption(prioLevel)
option add *Menu.selectColor		$tixOption(selector) $tixOption(prioLevel)
option add *TixMenu.selectColor		$tixOption(selector) $tixOption(prioLevel)
option add *Menubutton.padY			5 $tixOption(prioLevel)
option add *Button.borderWidth		2 $tixOption(prioLevel)
option add *Button.anchor		c $tixOption(prioLevel)
option add *Checkbutton.selectColor		$tixOption(selector) $tixOption(prioLevel)
option add *Radiobutton.selectColor		$tixOption(selector) $tixOption(prioLevel)
option add *Entry.relief		sunken $tixOption(prioLevel)
option add *Entry.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *Entry.background		$tixOption(input1_bg) $tixOption(prioLevel)
option add *Entry.foreground		black $tixOption(prioLevel)
option add *Entry.insertBackground	black $tixOption(prioLevel)
option add *Label.anchor		w $tixOption(prioLevel)
option add *Label.borderWidth		0 $tixOption(prioLevel)
option add *Listbox.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *Listbox.relief		sunken $tixOption(prioLevel)
option add *Scale.foreground		$tixOption(fg) $tixOption(prioLevel)
option add *Scale.activeForeground	$tixOption(bg) $tixOption(prioLevel)
option add *Scale.background		$tixOption(bg) $tixOption(prioLevel)
option add *Scale.sliderForeground	$tixOption(bg) $tixOption(prioLevel)
option add *Scale.sliderBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *Scrollbar.relief		sunken $tixOption(prioLevel)
option add *Scrollbar.borderWidth		1 $tixOption(prioLevel)
option add *Scrollbar.width			15 $tixOption(prioLevel)
option add *Text.background		$tixOption(input1_bg) $tixOption(prioLevel)
option add *Text.relief		sunken $tixOption(prioLevel)
option add *TixBalloon*background 			#ffff60 $tixOption(prioLevel)
option add *TixBalloon*foreground 			black $tixOption(prioLevel)
option add *TixBalloon.background 			black $tixOption(prioLevel)
option add *TixBalloon*Label.anchor 			w $tixOption(prioLevel)
option add *TixControl*entry.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixControl*entry.background		$tixOption(input1_bg) $tixOption(prioLevel)
option add *TixControl*entry.foreground		black $tixOption(prioLevel)
option add *TixControl*entry.insertBackground	black $tixOption(prioLevel)
option add *TixDirTree*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixDirTree*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.activeBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.disabledBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*f1.borderWidth		1 $tixOption(prioLevel)
option add *TixDirTree*f1.relief			sunken $tixOption(prioLevel)
option add *TixDirList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixDirList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixDirList*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.activeBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.disabledBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*f1.borderWidth		1 $tixOption(prioLevel)
option add *TixDirList*f1.relief			sunken $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.activeBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.disabledBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*f1.borderWidth		1 $tixOption(prioLevel)
option add *TixScrolledHList*f1.relief			sunken $tixOption(prioLevel)
option add *TixTree*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixTree*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.activeBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.disabledBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*f1.borderWidth		1 $tixOption(prioLevel)
option add *TixTree*f1.relief			sunken $tixOption(prioLevel)
option add *TixFileEntry*Entry.background 		$tixOption(input1_bg) $tixOption(prioLevel)
option add *TixHList.background			$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixHList.activeBackground		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixHList.disabledBackground		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.background		$tixOption(input1_bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.foreground		black $tixOption(prioLevel)
option add *TixLabelEntry*entry.insertBackground	black $tixOption(prioLevel)
option add *TixMultiList*Listbox.borderWidth		0 $tixOption(prioLevel)
option add *TixMultiList*Listbox.highlightThickness	0 $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.relief		sunken $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.width		15 $tixOption(prioLevel)
option add *TixMultiList*f1.borderWidth		2 $tixOption(prioLevel)
option add *TixMultiList*f1.relief			sunken $tixOption(prioLevel)
option add *TixMultiList*f1.highlightThickness		2 $tixOption(prioLevel)
option add *TixMDIMenuBar*menubar.relief		raised $tixOption(prioLevel)
option add *TixMDIMenuBar*menubar.borderWidth		2 $tixOption(prioLevel)
option add *TixMDIMenuBar*Menubutton.padY 		2 $tixOption(prioLevel)
option add *TixNoteBook.Background			$tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.Background		$tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.backPageColor		$tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.inactiveBackground	$tixOption(inactive_bg) $tixOption(prioLevel)
option add *TixPanedWindow.handleActiveBg 		$tixOption(active_bg) $tixOption(prioLevel)
option add *TixPanedWindow.seperatorBg    		$tixOption(bg) $tixOption(prioLevel)
option add *TixPanedWindow.handleBg       		$tixOption(dark1_bg) $tixOption(prioLevel)
option add *TixPopupMenu*menubutton.background 	$tixOption(dark1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledTList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledTList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledTList*tlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledTList*tlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledListBox*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledListBox*listbox.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*listbox.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledText*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledText*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledWindow*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledWindow*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledWindow.frame.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixTree*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.borderWidth		1 $tixOption(prioLevel)
option add *TixComboBox*Entry.highlightBacground		$tixOption(bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.background			$tixOption(input1_bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.foreground			black $tixOption(prioLevel)
option add *TixComboBox*Entry.insertBackground		black $tixOption(prioLevel)
}
proc tixPref:SetScheme-Mono:TixGray {} {


    global tixOption

    set tixOption(bg)           lightgray
    set tixOption(fg)           black

    set tixOption(dark1_bg)     gray70
    set tixOption(dark1_fg)     black
    set tixOption(dark2_bg)     gray60
    set tixOption(dark2_fg)     white
    set tixOption(inactive_bg)  lightgray
    set tixOption(inactive_fg)  black

    set tixOption(light1_bg)    gray90
    set tixOption(light1_fg)    white
    set tixOption(light2_bg)    gray95
    set tixOption(light2_fg)    white

    set tixOption(active_bg)    gray90
    set tixOption(active_fg)    $tixOption(fg)
    set tixOption(disabled_fg)  gray55

    set tixOption(input1_bg)    $tixOption(light1_bg)
    set tixOption(input2_bg)    $tixOption(light1_bg)
    set tixOption(output1_bg)   $tixOption(light1_bg)
    set tixOption(output2_bg)   $tixOption(light1_bg)

    set tixOption(select_fg)    white
    set tixOption(select_bg)    black

    set tixOption(selector)	black

option add *background 		$tixOption(bg) 10
option add *Background		$tixOption(bg) $tixOption(prioLevel)
option add *background		$tixOption(bg) $tixOption(prioLevel)
option add *Foreground		$tixOption(fg) $tixOption(prioLevel)
option add *foreground		$tixOption(fg) $tixOption(prioLevel)
option add *activeBackground	$tixOption(active_bg) $tixOption(prioLevel)
option add *activeForeground	$tixOption(active_fg) $tixOption(prioLevel)
option add *HighlightBackground	$tixOption(bg) $tixOption(prioLevel)
option add *selectBackground	$tixOption(select_bg) $tixOption(prioLevel)
option add *selectForeground	$tixOption(select_fg) $tixOption(prioLevel)
option add *selectBorderWidth	0 $tixOption(prioLevel)
option add *Menu.selectColor		$tixOption(selector) $tixOption(prioLevel)
option add *TixMenu.selectColor		$tixOption(selector) $tixOption(prioLevel)
option add *Menubutton.padY			5 $tixOption(prioLevel)
option add *Button.borderWidth		2 $tixOption(prioLevel)
option add *Button.anchor		c $tixOption(prioLevel)
option add *Checkbutton.selectColor		$tixOption(selector) $tixOption(prioLevel)
option add *Radiobutton.selectColor		$tixOption(selector) $tixOption(prioLevel)
option add *Entry.relief		sunken $tixOption(prioLevel)
option add *Entry.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *Entry.background		$tixOption(input1_bg) $tixOption(prioLevel)
option add *Entry.foreground		black $tixOption(prioLevel)
option add *Entry.insertBackground	black $tixOption(prioLevel)
option add *Label.anchor		w $tixOption(prioLevel)
option add *Label.borderWidth		0 $tixOption(prioLevel)
option add *Listbox.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *Listbox.relief		sunken $tixOption(prioLevel)
option add *Scale.foreground		$tixOption(fg) $tixOption(prioLevel)
option add *Scale.activeForeground	$tixOption(bg) $tixOption(prioLevel)
option add *Scale.background		$tixOption(bg) $tixOption(prioLevel)
option add *Scale.sliderForeground	$tixOption(bg) $tixOption(prioLevel)
option add *Scale.sliderBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *Scrollbar.relief		sunken $tixOption(prioLevel)
option add *Scrollbar.borderWidth		1 $tixOption(prioLevel)
option add *Scrollbar.width			15 $tixOption(prioLevel)
option add *Text.background		$tixOption(input1_bg) $tixOption(prioLevel)
option add *Text.relief		sunken $tixOption(prioLevel)
option add *TixBalloon*background 			#ffff60 $tixOption(prioLevel)
option add *TixBalloon*foreground 			black $tixOption(prioLevel)
option add *TixBalloon.background 			black $tixOption(prioLevel)
option add *TixBalloon*Label.anchor 			w $tixOption(prioLevel)
option add *TixControl*entry.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixControl*entry.background		$tixOption(input1_bg) $tixOption(prioLevel)
option add *TixControl*entry.foreground		black $tixOption(prioLevel)
option add *TixControl*entry.insertBackground	black $tixOption(prioLevel)
option add *TixDirTree*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixDirTree*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.activeBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*hlist.disabledBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirTree*f1.borderWidth		1 $tixOption(prioLevel)
option add *TixDirTree*f1.relief			sunken $tixOption(prioLevel)
option add *TixDirList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixDirList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixDirList*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.activeBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*hlist.disabledBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixDirList*f1.borderWidth		1 $tixOption(prioLevel)
option add *TixDirList*f1.relief			sunken $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.activeBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.disabledBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*f1.borderWidth		1 $tixOption(prioLevel)
option add *TixScrolledHList*f1.relief			sunken $tixOption(prioLevel)
option add *TixTree*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixTree*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.activeBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.disabledBackground	$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*f1.borderWidth		1 $tixOption(prioLevel)
option add *TixTree*f1.relief			sunken $tixOption(prioLevel)
option add *TixFileEntry*Entry.background 		$tixOption(input1_bg) $tixOption(prioLevel)
option add *TixHList.background			$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixHList.activeBackground		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixHList.disabledBackground		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.background		$tixOption(input1_bg) $tixOption(prioLevel)
option add *TixLabelEntry*entry.foreground		black $tixOption(prioLevel)
option add *TixLabelEntry*entry.insertBackground	black $tixOption(prioLevel)
option add *TixMultiList*Listbox.borderWidth		0 $tixOption(prioLevel)
option add *TixMultiList*Listbox.highlightThickness	0 $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.relief		sunken $tixOption(prioLevel)
option add *TixMultiList*Scrollbar.width		15 $tixOption(prioLevel)
option add *TixMultiList*f1.borderWidth		2 $tixOption(prioLevel)
option add *TixMultiList*f1.relief			sunken $tixOption(prioLevel)
option add *TixMultiList*f1.highlightThickness		2 $tixOption(prioLevel)
option add *TixMDIMenuBar*menubar.relief		raised $tixOption(prioLevel)
option add *TixMDIMenuBar*menubar.borderWidth		2 $tixOption(prioLevel)
option add *TixMDIMenuBar*Menubutton.padY 		2 $tixOption(prioLevel)
option add *TixNoteBook.Background			$tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.Background		$tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.backPageColor		$tixOption(bg) $tixOption(prioLevel)
option add *TixNoteBook.nbframe.inactiveBackground	$tixOption(inactive_bg) $tixOption(prioLevel)
option add *TixPanedWindow.handleActiveBg 		$tixOption(active_bg) $tixOption(prioLevel)
option add *TixPanedWindow.seperatorBg    		$tixOption(bg) $tixOption(prioLevel)
option add *TixPanedWindow.handleBg       		$tixOption(dark1_bg) $tixOption(prioLevel)
option add *TixPopupMenu*menubutton.background 	$tixOption(dark1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledHList*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledTList*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledTList*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledTList*tlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledTList*tlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledListBox*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledListBox*listbox.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledListBox*listbox.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledText*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledText*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledWindow*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixScrolledWindow*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixScrolledWindow.frame.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.background		$tixOption(bg) $tixOption(prioLevel)
option add *TixTree*Scrollbar.troughColor		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.highlightBacground	$tixOption(bg) $tixOption(prioLevel)
option add *TixTree*hlist.background		$tixOption(light1_bg) $tixOption(prioLevel)
option add *TixTree*hlist.borderWidth		1 $tixOption(prioLevel)
option add *TixComboBox*Entry.highlightBacground		$tixOption(bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.background			$tixOption(input1_bg) $tixOption(prioLevel)
option add *TixComboBox*Entry.foreground			black $tixOption(prioLevel)
option add *TixComboBox*Entry.insertBackground		black $tixOption(prioLevel)
}

 # Balloon.tcl --
#
#	The help widget. It provides both "balloon" type of help
#	message and "status bar" type of help message. You can use
#	this widget to indicate the function of the widgets inside
#	your application.
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#


tixWidgetClass tixBalloon {
    -classname TixBalloon
    -superclass tixShell
    -method {
	bind post unbind
    }
    -flag {
	-installcolormap -initwait -state -statusbar
    }
    -configspec {
	{-installcolormap installColormap InstallColormap false}
	{-initwait initWait InitWait 1000}
	{-state state State both}
	{-statusbar statusBar StatusBar ""}

 	{-cursor cursor Cursur left_ptr}
    }
    -default {
	{*background 			#ffff60}
	{*foreground 			black}
	{*borderWidth 			0}
	{.borderWidth 			1}
	{.background 			black}
	{*Label.anchor			w}
	{*Label.justify			left}
    }
}

# Class Record
#
set tixBalloon(bals) ""

proc tixBalloon:InitWidgetRec {w} {
    upvar #0 $w data
    global tixBalloon

    tixChainMethod $w InitWidgetRec

    set data(isActive)    0
    set data(client)    ""

    lappend tixBalloon(bals) $w
}

proc tixBalloon:ConstructWidget {w} {
    upvar #0 $w data

    tixChainMethod $w ConstructWidget

    wm overrideredirect $w 1
    wm withdraw $w

    # Frame 1 : arrow
    frame $w.f1 -bd 0
    set data(w:label) [label $w.f1.lab -bd 0 -relief flat  		       -bitmap [tix getbitmap balarrow]]
    pack $data(w:label) -side left -padx 1 -pady 1
    
    # Frame 2 : Message
    frame $w.f2 -bd 0
    set data(w:message) [label $w.f2.message -padx 0 -pady 0 -bd 0]
    pack $data(w:message) -side left -expand yes -fill both -padx 10 -pady 1

    # Pack all
    pack $w.f1 -fill both
    pack $w.f2 -fill both    

    # This is an event tag used by the clients
    #
    bind TixBal$w <Destroy> "tixBalloon:ClientDestroy $w %W"
}

proc tixBalloon:Destructor {w} {
    global tixBalloon

    set bals ""
    foreach b $tixBalloon(bals) {
	if {$w != $b} {
	    lappend bals $b
	}
    }
    set tixBalloon(bals) $bals

    tixChainMethod $w Destructor
}

#----------------------------------------------------------------------
# Config:
#----------------------------------------------------------------------
proc tixBalloon:config-state {w value} {
    upvar #0 $w data

    case $value {
	{none balloon status both} ""
	default {
	   error "invalid value $value, must be none, balloon, status, or both"
	}
    }
}

#----------------------------------------------------------------------
# "RAW" event bindings:
#----------------------------------------------------------------------

bind all <B1-Motion> 	    "+tixBalloon_XXMotion %X %Y 1"
bind all <B2-Motion> 	    "+tixBalloon_XXMotion %X %Y 2"
bind all <B3-Motion> 	    "+tixBalloon_XXMotion %X %Y 3"
bind all <B4-Motion> 	    "+tixBalloon_XXMotion %X %Y 4"
bind all <B5-Motion> 	    "+tixBalloon_XXMotion %X %Y 5"
bind all <Any-Motion> 	    "+tixBalloon_XXMotion %X %Y 0"
bind all <Leave>      	    "+tixBalloon_XXMotion %X %Y %b"
bind all <Button>      	    "+tixBalloon_XXButton   %X %Y %b"
bind all <ButtonRelease>    "+tixBalloon_XXButtonUp %X %Y %b"

proc tixBalloon_XXMotion {rootX rootY b} {
    global tixBalloon

    foreach w $tixBalloon(bals) {
	tixBalloon:XXMotion $w $rootX $rootY $b
    }
}

proc tixBalloon_XXButton {rootX rootY b} {
    global tixBalloon

    foreach w $tixBalloon(bals) {
	tixBalloon:XXButton $w $rootX $rootY $b
    }
}

proc tixBalloon_XXButtonUp {rootX rootY b} {
    global tixBalloon

    foreach w $tixBalloon(bals) {
	tixBalloon:XXButtonUp $w $rootX $rootY $b
    }
}


# return true if d is a descendant of w
#
proc tixIsDescendant {w d} {
    if [string match $w .] {
	return 1
    }
    return [string match $w.* $d]
}

# All the button events are fine if the ballooned widget is
# a descendant of the grabbing widget
#
proc tixBalloon:GrabBad {w cw} {
    global tixBalloon

    set g [grab current $w]
    if {$g == ""} {
	return 0
    }
    if [info exists tixBalloon(g_ignore,$g)] {
	return 1
    }
    if [info exists tixBalloon(g_ignore,[winfo class $g])] {
	return 1
    }
    if {$g == $cw || [tixIsDescendant $g $cw]} {
	return 0
    }
    return 1
}

proc tixBalloon:XXMotion {w rootX rootY b} {
    upvar #0 $w data

    if {$data(-state) == "none"} {
	return
    }

    if {$b == 0} {
	if [info exists data(b:1)] {unset data(b:1)}
	if [info exists data(b:2)] {unset data(b:2)}
	if [info exists data(b:3)] {unset data(b:3)}
	if [info exists data(b:4)] {unset data(b:4)}
	if [info exists data(b:5)] {unset data(b:5)}
    }


    if {[array names data b:*] != ""} {
	# Some buttons are down. Do nothing
	#
	return
    }

    set cw [winfo containing $rootX $rootY]
    if [tixBalloon:GrabBad $w $cw] {
	return
    }

    # Find the a client window that matches
    #
    if {$w == $cw || [string match $w.* $cw]} {
	# Cursor moved over the balloon -- Ignore
	return
    }

    while {$cw != ""} {
	if [info exists data(m:$cw)] {
	    set client $cw
	    break
	} else {
	    set cw [winfo parent $cw]
	}
    }
    if {![info exists client]} {
	# The cursor is at a position covered by a non-client
	# Popdown the balloon if it is up
	if {$data(isActive)} {
	    tixBalloon:Deactivate $w
	}
	set data(client) ""
	if [info exists data(cancel)] {
	    unset data(cancel) 
	}
	return
    }

    if {$data(client) != $client} {
	if {$data(isActive)} {
	    tixBalloon:Deactivate $w
	}
	set data(client) $client
	after $data(-initwait) tixBalloon:SwitchToClient $w $client
    }
}

proc tixBalloon:XXButton {w rootX rootY b} {
    upvar #0 $w data

    tixBalloon:XXMotion $w $rootX $rootY $b

    set data(b:$b) 1

    if {$data(isActive)} {
	tixBalloon:Deactivate $w
    } else {
	set data(cancel) 1
    }
}

proc tixBalloon:XXButtonUp {w rootX rootY b} {
    upvar #0 $w data

    tixBalloon:XXMotion $w $rootX $rootY $b
    if [info exists data(b:$b)] {
	unset data(b:$b)
    }
}

#----------------------------------------------------------------------
# "COOKED" event bindings:
#----------------------------------------------------------------------

# switch the balloon to a new client
#
proc tixBalloon:SwitchToClient {w client} {
    upvar #0 $w data

    if {![winfo exists $w]} {
	return
    }
    if {![winfo exists $client]} {
	return
    }
    if {$client != $data(client)} {
	return
    }
    if [info exists data(cancel)] {
	unset data(cancel)
	return
    }

    if [tixBalloon:GrabBad $w $w] {
	return
    }

    tixBalloon:Activate $w
}

proc tixBalloon:ClientDestroy {w client} {
    if {![winfo exists $w]} {
	return
    }

    upvar #0 $w data

    if {$data(client) == $client} {
	tixBalloon:Deactivate $w
	set data(client) ""
    }

    # Maybe thses have already been unset by the Destroy method
    #
    if [info exists data(m:$client)] {unset data(m:$client)}
    if [info exists data(s:$client)] {unset data(s:$client)}
}

#----------------------------------------------------------------------
# Popping up balloon:
#----------------------------------------------------------------------
proc tixBalloon:Activate {w} {
    upvar #0 $w data

    if [tixBalloon:GrabBad $w $w] {
	return
    }
    if {[winfo containing [winfo pointerx $w] [winfo pointery $w]] == ""} {
	return
    }

    switch $data(-state) {
	"both" {
	    tixBalloon:PopUp $w
	    tixBalloon:SetStatus $w
	}
	"balloon" {
	    tixBalloon:PopUp $w
	}
	"status" {
	    tixBalloon:SetStatus $w
	}
    }

    set data(isActive) 1

    after 200 tixBalloon:Verify $w
}


# %% Perhaps this is no more needed
#
proc tixBalloon:Verify {w} {
    upvar #0 $w data

    if {![winfo exists $w]} {
	return
    }
    if {!$data(isActive)} {
	return
    }

    if [tixBalloon:GrabBad $w $w] {
	tixBalloon:Deactivate $w
	return
    }
    if {[winfo containing [winfo pointerx $w] [winfo pointery $w]] == ""} {
	tixBalloon:Deactivate $w
	return
    }
    after 200 tixBalloon:Verify $w
}

proc tixBalloon:Deactivate {w} {
    upvar #0 $w data

    tixBalloon:PopDown $w
    tixBalloon:ClearStatus $w
    set data(isActive) 0
    if [info exists data(cancel)] {
	unset data(cancel)
    }
}

proc tixBalloon:PopUp {w} {
    upvar #0 $w data

    if [tixGetBoolean -nocomplain $data(-installcolormap)] {
	wm colormapwindows [winfo toplevel $data(client)] $w
    }

    # trick: the following lines allow the balloon window to
    # acquire a stable width and height when it is finally
    # put on the visible screen
    #
    set client $data(client)
    $data(w:message) config -text $data(m:$client)
    wm geometry $w +10000+10000
    wm deiconify $w
    raise $w
    update

    # The windows may become destroyed as a result of the "update" command
    #
    if {![winfo exists $w]} {
	return
    }
    if {![winfo exists $client]} {
	return
    }
    # Put it on the visible screen
    #
    set x [expr [winfo rootx $client]+[winfo width  $client]/2]
    set y [expr int([winfo rooty $client]+[winfo height $client]/1.3)]

    set width  [winfo reqwidth $w]
    set height [winfo reqheight $w]
    set scrwidth  [winfo vrootwidth  $w]
    set scrheight [winfo vrootheight $w]

    # If the balloon is too far right, pull it back to the left
    #
    if {[expr $x + $width] > $scrwidth} {
	set x [expr $scrwidth - $width]
    }

    # If the balloon is too far left, pull it back to the right
    #
    if {$x < 0} {
	set x 0
    }

    # If the listbox is below bottom of screen, put it upwards
    #
    if {[expr $y + $height] > $scrheight} {
	set y [expr $scrheight-$height]
    }
    if {$y < 0} {
	set y 0
    }

    wm geometry $w +$x+$y
}

proc tixBalloon:PopDown {w} {
    upvar #0 $w data

    # Close the balloon
    #
    wm withdraw $w

    # We don't set the data(client) to be zero, so that the balloon
    # will re-appear only if you move out then in the client window
    # set data(client) ""
}

proc tixBalloon:SetStatus {w} {
    upvar #0 $w data

    if {![winfo exists $data(-statusbar)]} {
	return
    }
    if {![info exists data(s:$data(client))]} {
	return
    }

    set vv [$data(-statusbar) cget -textvariable]
    if {$vv == ""} {
	$data(-statusbar) config -text $data(s:$data(client))
    } else {
	uplevel #0 set $vv [list $data(s:$data(client))]
    }
}

proc tixBalloon:ClearStatus {w} {
    upvar #0 $w data

    if {![winfo exists $data(-statusbar)]} {
	return
    }

    # Clear the StatusBar widget
    #
    set vv [$data(-statusbar) cget -textvariable]
    if {$vv == ""} {
	$data(-statusbar) config -text ""
    } else {
	uplevel #0 set $vv [list ""]
    }
}

#----------------------------------------------------------------------
# PublicMethods:
#----------------------------------------------------------------------

# %% if balloon is already popped-up for this client, change mesage
#
proc tixBalloon:bind {w client args} {
    upvar #0 $w data

    if [info exists data(m:$client)] {
	set alreadyBound 1
    } else {
	set alreadyBound 0
    }

    set opt(-balloonmsg) ""
    set opt(-statusmsg)  ""
    set opt(-msg)        ""

    tixHandleOptions opt {-balloonmsg -msg -statusmsg} $args

    if {$opt(-balloonmsg) != ""} {
	set data(m:$client) $opt(-balloonmsg)
    } else {
	set data(m:$client) $opt(-msg)
    }
    if {$opt(-statusmsg) != ""} {
	set data(s:$client) $opt(-statusmsg)
    } else {
	set data(s:$client) $opt(-msg)
    }

    tixAppendBindTag $client TixBal$w
}

proc tixBalloon:post {w client} {
    upvar #0 $w data

    if {![info exists data(m:$client)]} {
	return
    }
    tixBalloon:Enter $w $client
    incr data(fakeEnter)
}

proc tixBalloon:unbind {w client} {
    upvar #0 $w data

    if [info exists data(m:$client)] {
	if [info exists data(m:$client)] {unset data(m:$client)}
	if [info exists data(s:$client)] {unset data(s:$client)}

	if [winfo exists $client] {
	    catch {tixDeleteBindTag $client TixBal$w}
	}
    }
}

#----------------------------------------------------------------------
#
# Utility function
#
#----------------------------------------------------------------------
#
# $w can be a widget name or a classs name
proc tixBalIgnoreWhenGrabbed {wc} {
    global tixBalloon
    set tixBalloon(g_ignore,$wc) ""
}

tixBalIgnoreWhenGrabbed TixComboBox
tixBalIgnoreWhenGrabbed Menu
tixBalIgnoreWhenGrabbed Menubutton

 # BtnBox.tcl --
#
#	Implements the tixButtonBox widget
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

tixWidgetClass tixButtonBox {
    -superclass tixPrimitive
    -classname  TixButtonBox
    -method {
	add invoke button buttons
    }
    -flag {
	-orientation -orient -padx -pady -state
    }
    -static {
	-orientation
    }
    -configspec {
	{-orientation orientation Orientation horizontal}
	{-padx padX Pad 0}
	{-pady padY Pad 0}
	{-state state State normal}
    }
    -alias {
	{-orient -orientation}
    }
    -default {
	{.borderWidth 		1}
	{.relief 		raised}
	{.padX 			5}
	{.padY 			10}
	{*Button.anchor		c}
	{*Button.padX		5}
    }
}

proc tixButtonBox:InitWidgetRec {w} {
    upvar #0 $w data

    tixChainMethod $w InitWidgetRec

    set data(g:buttons) ""
}

#----------------------------------------------------------------------
#                           CONFIG OPTIONS
#----------------------------------------------------------------------
proc tixButtonBox:config-padx {w arg} {
    upvar #0 $w data

    foreach item $data(g:buttons) {
	pack configure $w.$item -padx $arg
    }
}

proc tixButtonBox:config-pady {w arg} {
    upvar #0 $w data

    foreach item $data(g:buttons) {
	pack configure $w.$item -pady $arg
    }
}

proc tixButtonBox:config-state {w arg} {
    upvar #0 $w data

    foreach item $data(g:buttons) {
	$w.$item config -state $arg
    }
}

#----------------------------------------------------------------------
# Methods
#                     WIDGET COMMANDS
#----------------------------------------------------------------------
proc tixButtonBox:add {w name args} {
    upvar #0 $w data

    eval button $w.$name $args
    if {$data(-orientation) == "horizontal"} {
	pack $w.$name -side left -expand yes -fill y 	    -padx $data(-padx) -pady $data(-pady)
    } else {
	pack $w.$name -side top -expand yes  -fill x 	    -padx $data(-padx) -pady $data(-pady)
    }

    # allow for subwidget access
    #
    lappend data(g:buttons) $name
    set data(w:$name) $w.$name

    return $w.$name
}

proc tixButtonBox:button {w name args} {
    return [eval tixCallMethod $w subwidget $name $args]
}

proc tixButtonBox:buttons {w args} {
    return [eval tixCallMethod $w subwidgets -group buttons $args]
}

#
# call the command
proc tixButtonBox:invoke {w name} {
    upvar #0 $w data

    $w.$name invoke
}

 # CObjView.tcl --
#
#	This file implements the Canvas Object View widget. This is a base
#	class of IconView. It implements:

#	(1) Automatic placement/adjustment of the scrollbars according
#	to the canvas objects inside the canvas subwidget. The
#	scrollbars are adjusted so that the canvas is just large
#	enough to see all the objects.
#
#	(2) D+D bindings of the objects (%% not implemented)
#
#	(3) Keyboard traversal of the objects (%% not implemented). By the
#	virtual method :SelectObject.
#
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

tixWidgetClass tixCObjView {
    -classname TixCObjView
    -superclass tixScrolledWidget
    -method {
	adjustscrollregion
    }
    -flag {
	-xscrollincrement -yscrollincrement
    }
    -static {
    }
    -configspec {
	{-xscrollincrement xScrollIncrement ScrollIncrement 10}
	{-yscrollincrement yScrollIncrement ScrollIncrement 10}
    }
    -default {
	{.scrollbar			auto}
	{*borderWidth			1}
	{*canvas.background		#c3c3c3}
	{*canvas.highlightBackground	#d9d9d9}
	{*canvas.relief			sunken}
	{*canvas.takeFocus		1}
	{*Scrollbar.background		#d9d9d9}
	{*Scrollbar.relief		sunken}
	{*Scrollbar.troughColor		#c3c3c3}
	{*Scrollbar.takeFocus		0}
	{*Scrollbar.width		15}
    }
    -forcecall {
	-scrollbar
    }
}

proc tixCObjView:ConstructWidget {w} {
    upvar #0 $w data

    tixChainMethod $w ConstructWidget

    set data(w:canvas)  	[canvas $w.canvas]
    set data(w:hsb)  	[scrollbar $w.hsb -orient horizontal]
    set data(w:vsb)  	[scrollbar $w.vsb -orient vertical]

    set data(pw:client) $data(w:canvas)

    set data(xorig) 0
    set data(yorig) 0

    set data(sx1) 0
    set data(sy1) 0
    set data(sx2) 0
    set data(sy2) 0
}

proc tixCObjView:SetBindings {w} {
    upvar #0 $w data

    tixChainMethod $w SetBindings

# %% scan/drag of canvas??
#
#    $data(w:canvas) config  #	-xscrollcommand "tixCObjView:XScroll $w" #	-yscrollcommand "tixCObjView:YScroll $w"

    $data(w:hsb) config -command "tixCObjView:UserScroll $w x"
    $data(w:vsb) config -command "tixCObjView:UserScroll $w y"
}

#----------------------------------------------------------------------
#
#		option configs
#----------------------------------------------------------------------
proc tixCObjView:config-takefocus {w value} {
    upvar #0 $w data
  
    $data(w:canvas) config -takefocus $value
}	

#----------------------------------------------------------------------
#
#		Widget commands
#----------------------------------------------------------------------
proc tixCObjView:adjustscrollregion {w} {
    upvar #0 $w data

    set cW [tixWinWidth  $data(w:canvas)]
    set cH [tixWinHeight $data(w:canvas)]

    tixCObjView:GetScrollRegion $w $cW $cH 1 1
}

#----------------------------------------------------------------------
#
#		Private Methods
#----------------------------------------------------------------------

proc tixCObjView:GeometryInfo {w cW cH} {
    upvar #0 $w data

    set bd  	[expr [$data(w:canvas) cget -bd] + [$data(w:canvas) cget -highlightthickness]]

    incr cW -[expr 2*$bd]
    incr cH -[expr 2*$bd]

    return [tixCObjView:GetScrollRegion $w $cW $cH 0 0]
}

proc tixCObjView:PlaceWindow {w} {
    upvar #0 $w data

    set cW [tixWinWidth  $data(w:canvas)]
    set cH [tixWinHeight $data(w:canvas)]

    tixCObjView:GetScrollRegion $w $cW $cH 1 0

    tixChainMethod $w PlaceWindow
}

proc tixCObjView:GetScrollRegion {w cW cH setReg callConfig} {
    upvar #0 $w data

    set x1max $data(xorig)
    set y1max $data(yorig)

    set x2min [expr $x1max + $cW - 1]
    set y2min [expr $y1max + $cH - 1]
 
    set bbox [$data(w:canvas) bbox all]

    if {$bbox == ""} {
	set bbox {0 0 1 1}
    }

    set x1 [lindex $bbox 0]
    set y1 [lindex $bbox 1]
    set x2 [lindex $bbox 2]
    set y2 [lindex $bbox 3]

    set bd  	[expr [$data(w:canvas) cget -bd] + [$data(w:canvas) cget -highlightthickness]]

    incr x1 -$bd
    incr y1 -$bd
    incr x2 -$bd
    incr y2 -$bd

    if {$x1 > $x1max} {
	set x1 $x1max
    }
    if {$y1 > $y1max} {
	set y1 $y1max
    }
    if {$x2 < $x2min} {
	set x2 $x2min
    }
    if {$y2 < $y2min} {
	set y2 $y2min
    }

    set data(sx1) $x1
    set data(sy1) $y1
    set data(sx2) $x2
    set data(sy2) $y2

    set sW [expr $x2 - $x1 + 1]
    set sH [expr $y2 - $y1 + 1]

#    puts "sregion = {$x1 $y1 $x2 $y2}; sW=$sW; cW=$cW"

    if {$sW > $cW} {
	set hsbSpec {0.5 1}
    } else {
	set hsbSpec {0 1}
    }
    if {$sH > $cH} {
	set vsbSpec {0.5 1}
    } else {
	set vsbSpec {0 1}
    }

    if $setReg {
	tixCObjView:SetScrollBars $w $cW $cH $sW $sH
    }
    if $callConfig {
	tixWidgetDoWhenIdle tixScrolledWidget:Configure $w
    }

    return [list $hsbSpec $vsbSpec]
}

#xF = xFirst
#
proc tixCObjView:SetScrollBars {w cW cH sW sH} {
    upvar #0 $w data

#    puts "$data(xorig) <--> $data(sx1)"

    set xF [expr ($data(xorig).0-$data(sx1).0)/$sW.0]
    set xL [expr $cW.0/$sW.0 + $xF]

    set yF [expr ($data(yorig).0-$data(sy1).0)/$sH.0]
    set yL [expr $cH.0/$sH.0 + $yF]

#    puts "$xF $xL : $yF $yL"
    $data(w:hsb) set $xF $xL    
    $data(w:vsb) set $yF $yL    
}

proc tixCObjView:UserScroll {w dir type args} {
    upvar #0 $w data

    $data(w:canvas) config -xscrollincrement 1 -yscrollincrement 1

    case $dir {
	x {
	    set n $data(xorig)
	    set orig $data(xorig)
	    set s1 $data(sx1)
	    set total [expr $data(sx2)-$data(sx1)]
	    set page  [tixWinWidth $data(w:canvas)]
	    set min $data(sx1)
	    set max [expr $data(sx1)+$total-$page]
	    set inc $data(-xscrollincrement)
	}
	y {
	    set n $data(yorig)
	    set orig $data(yorig)
	    set s1 $data(sy1)
	    set total [expr $data(sy2)-$data(sy1)]
	    set page  [tixWinHeight $data(w:canvas)]
	    set min $data(sy1)
	    set max [expr $data(sy1)+$total-$page]
	    set inc $data(-yscrollincrement)
	}
    }
	    
    case $type {
	scroll {
	    set amt  [lindex $args 0] 
	    set unit [lindex $args 1] 

	    case $unit {
		units {
		    incr n [expr int($inc)*$amt]
		}
		pages {
		    incr n [expr $page*$amt]
		}
	    }
	}
	moveto {
	    set first [lindex $args 0] 
	    set n [expr round($first*$total)+$s1]
	}
    }

    if {$n < $min} {
	set n $min
    }
    if {$n > $max} {
	set n $max
    }

#    puts "n=$n min=$min max=$max"

    case $dir {
	x {
	    $data(w:canvas) xview scroll [expr $n-$orig] units
	    set data(xorig) $n
	}
	y {
	    $data(w:canvas) yview scroll [expr $n-$orig] units
	    set data(yorig) $n
	}
    }

    set cW [tixWinWidth $data(w:canvas)]
    set cH [tixWinHeight $data(w:canvas)]
    set sW [expr $data(sx2)-$data(sx1)+1]
    set sH [expr $data(sy2)-$data(sy1)+1]

    tixCObjView:SetScrollBars $w $cW $cH $sW $sH
}

# Junk
#
#
proc tixCObjView:XScroll {w first last} {
    upvar #0 $w data

    set sc [$data(w:canvas) cget -scrollregion]
    if {$sc == ""} {
	set x1 1
	set x2 [tixWinWidth $data(w:canvas)]
    } else {
	set x1 [lindex $sc 0]
	set x2 [lindex $sc 2]
    }
    
    set W [expr $x2 - $x1]
    if {$W < 1} {
	set W 1
    }

    $data(w:hsb) set $first $last

#    tixWidgetDoWhenIdle tixScrolledWidget:Configure $w
}

# Junk
#
proc tixCObjView:YScroll {w first last} {
    upvar #0 $w data

    set sc [$data(w:canvas) cget -scrollregion]

    if {$sc == ""} {
	set y1 1
	set y2 [tixWinHeight $data(w:canvas)]
    } else {
	set y1 [lindex $sc 1]
	set y2 [lindex $sc 3]
    }
    
    set H [expr $y2 - $y1]
    if {$H < 1} {
	set H 1
    }

    $data(w:vsb) set $first $last

#   tixWidgetDoWhenIdle tixScrolledWidget:Configure $w
}

 # ChkList.tcl --
#
#	This file implements the TixCheckList widget.
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

tixWidgetClass tixCheckList {
    -classname TixCheckList
    -superclass tixTree
    -method {
	getselection getstatus setstatus
    }
    -flag {
	-radio
    }
    -configspec {
	{-radio radio Radio false tixVerifyBoolean}

	{-ignoreinvoke ignoreInvoke IgnoreInvoke true tixVerifyBoolean}
    }
    -static {
	-radio
    }
    -default {
	{.scrollbar			auto}
	{.doubleClick			false}
	{*Scrollbar.background          #d9d9d9}
	{*Scrollbar.relief              sunken}
	{*Scrollbar.takeFocus           0}
	{*Scrollbar.troughColor         #c3c3c3}
	{*Scrollbar.width               15}
	{*borderWidth                   1}
	{*hlist.background              #c3c3c3}
	{*hlist.drawBranch              1}
	{*hlist.height                  10}
	{*hlist.highlightBackground      #d9d9d9}
	{*hlist.indicator               1}
	{*hlist.indent                  20}
	{*hlist.itemType                imagetext}
	{*hlist.padX                    3}
	{*hlist.padY                    0}
	{*hlist.relief                  sunken}
	{*hlist.takeFocus               1}
	{*hlist.wideSelection           0}
	{*hlist.width                   20}
    }
}

proc tixCheckList:InitWidgetRec {w} {
    upvar #0 $w data

    tixChainMethod $w InitWidgetRec

    if {$data(-radio)} {
	set data(selected) ""
    }
}

#----------------------------------------------------------------------
#
#			Widget commands
#
#----------------------------------------------------------------------

# Helper function for getselection
#
proc tixCheckList:GetSel {w var ent mode} {
    upvar #0 $w data
    upvar $var img

    set ents ""

    catch {
	if ![string comp [$data(w:hlist) entrycget $ent -bitmap] $img($mode)] {
	    lappend ents $ent
	}
    }

    foreach child [$data(w:hlist) info children $ent] {
	set ents [concat $ents [tixCheckList:GetSel $w img $child $mode]]
    }

    return $ents
}


# Mode can be on, off, default
#
proc tixCheckList:getselection {w {mode on}} {
    upvar #0 $w data

    set img(on)      [tix getbitmap ck_on]
    set img(off)     [tix getbitmap ck_off]
    set img(default) [tix getbitmap ck_def]

    set ents ""
    foreach child [$data(w:hlist) info children] {
	set ents [concat $ents [tixCheckList:GetSel $w img $child $mode]]
    }
    return $ents
}

proc tixCheckList:getstatus {w ent} {
    upvar #0 $w data

    if {[$data(w:hlist) entrycget $ent -itemtype] == "imagetext"} {
	set img(on)      [tix getbitmap ck_on]
	set img(off)     [tix getbitmap ck_off]
	set img(default) [tix getbitmap ck_def]

	set bitmap [$data(w:hlist) entrycget $ent -bitmap]

	if {"x$bitmap" == "x$img(on)"} {
	    set status on
	}
	if {"x$bitmap" == "x$img(off)"} {
	    set status off
	}
	if {"x$bitmap" == "x$img(default)"} {
	    set status default
	}
    }

    if [info exists status] {
	return $status
    } else {
	return "none"
    }
}

proc tixCheckList:setstatus {w ent {mode on}} {
    upvar #0 $w data

    if {$data(-radio)} {
	set status [tixCheckList:getstatus $w $ent]

	if {"x$status" == "x$mode"} {
	    return
	}

	if {$mode == "on"} {
	    if {$data(selected) != ""} {
		tixCheckList:Select $w $data(selected) off
	    }
	    set data(selected) $ent
	    tixCheckList:Select $w $ent $mode
	} elseif {$mode == "off"} {
	    if {"x$data(selected)" == "x$ent"} {
		return
	    }
	    tixCheckList:Select $w $ent $mode
	} else {
	    tixCheckList:Select $w $ent $mode
	}
    } else {
	tixCheckList:Select $w $ent $mode
    }
}

proc tixCheckList:Select {w ent mode} {
    upvar #0 $w data

    if {[$data(w:hlist) entrycget $ent -itemtype] == "imagetext"} {
	set img(on)      ck_on
	set img(off)     ck_off
	set img(default) ck_def

	if [catch {
	    set bitmap [tix getbitmap $img($mode)]
	    $data(w:hlist) entryconfig $ent -bitmap $bitmap
	}] {
	    # must be the "none" mode
	    #
	    catch {
		$data(w:hlist) entryconfig $ent -bitmap ""
	    }
	}
    }

    return $mode
}

proc tixCheckList:HandleCheck {w ent} {
    upvar #0 $w data

    if {[$data(w:hlist) entrycget $ent -itemtype] == "imagetext"} {
	set img(on)      [tix getbitmap ck_on]
	set img(off)     [tix getbitmap ck_off]
	set img(default) [tix getbitmap ck_def]

	set curMode [tixCheckList:getstatus $w $ent]

	case $curMode {
	    on {
		tixCheckList:setstatus $w $ent off
	    }
	    off {
		tixCheckList:setstatus $w $ent on
	    }
	    none {
		return
	    }
	    default {
		tixCheckList:setstatus $w $ent on
	    }
	}
    }
}

proc tixCheckList:Command {w B} {
    upvar #0 $w data
    upvar $B bind

    set ent [tixEvent flag V]
    tixCheckList:HandleCheck $w $ent

    tixChainMethod $w Command $B
}

proc tixCheckList:BrowseCmd {w B} {
    upvar #0 $w data
    upvar $B bind

    set ent [tixEvent flag V]

    case [tixEvent type] {
	{<ButtonPress-1> <space>} {
	    tixCheckList:HandleCheck $w $ent
	}
    }

    tixChainMethod $w BrowseCmd $B 
}

 # tixCombobox --
#
#	A combobox widget is basically a listbox widget with an entry
#	widget.
#
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.

tixWidgetClass tixComboBox {
    -classname TixComboBox
    -superclass tixLabelWidget
    -method {
	addhistory align appendhistory flash invoke insert pick popdown
    }
    -flag {
	-anchor -arrowbitmap -browsecmd -command -crossbitmap
	-disablecallback -disabledforeground -dropdown -editable
	-fancy -grab -histlimit -historylimit -history -listcmd
	-listwidth -prunehistory -selection -selectmode -state
	-tickbitmap -validatecmd -value -variable
    }
    -static {
	-dropdown -fancy
    }
    -forcecall {
	-variable -selectmode -state
    }
    -configspec {
	{-arrowbitmap arrowBitmap ArrowBitmap ""}
	{-anchor anchor Anchor w}
	{-browsecmd browseCmd BrowseCmd ""}
        {-command command Command ""}
	{-crossbitmap crossBitmap CrossBitmap ""}
	{-disablecallback disableCallback DisableCallback 0 tixVerifyBoolean}
	{-disabledforeground disabledForeground DisabledForeground #606060}
	{-dropdown dropDown DropDown true tixVerifyBoolean}
	{-editable editable Editable false tixVerifyBoolean}
	{-fancy fancy Fancy false tixVerifyBoolean}
	{-grab grab Grab global}
	{-listcmd listCmd ListCmd ""}
	{-listwidth listWidth ListWidth ""}
	{-historylimit historyLimit HistoryLimit ""}
	{-history history History false tixVerifyBoolean}
	{-prunehistory pruneHistory PruneHistory true tixVerifyBoolean}
	{-selectmode selectMode SelectMode browse}
	{-selection selection Selection ""}
        {-state state State normal}
	{-validatecmd validateCmd ValidateCmd ""}
	{-value value Value ""}
	{-variable variable Variable ""}
	{-tickbitmap tickBitmap TickBitmap ""}
    }
    -alias {
	{-histlimit -historylimit}
    }
    -default {
	{*Entry.relief				sunken}
	{*TixScrolledListBox.scrollbar		auto}
	{*Listbox.exportSelection		false}
	{*Listbox.takeFocus			false}
	{*shell.borderWidth			2}
	{*shell.relief				raised}
	{*shell.cursor				arrow}
	{*Button.anchor				c}
	{*Button.borderWidth			1}
	{*Button.highlightThickness		0}
	{*Button.padX				0}
	{*Button.padY				0}
	{*tick.width				18}
	{*tick.height				18}
	{*cross.width				18}
	{*cross.height				18}
	{*arrow.anchor				c}
	{*arrow.width				15}
	{*arrow.height				18}
	{*Entry.background			#c3c3c3}
	{*Label.font         -Adobe-Helvetica-Bold-R-Normal--*-120-*-*-*-*-*-*}
    }
}

# States: normal numbers: for dropdown style
#         d+digit(s)    : for non-dropdown style
#
proc tixComboBox:InitWidgetRec {w} {
    upvar #0 $w data

    tixChainMethod $w InitWidgetRec

    set data(curIndex)    ""
    set data(varInited)	  0
    set data(state)       none
    set data(ignore)      0

    if {$data(-history)} {
        set data(-editable) 1
    }

    if ![string compare $data(-arrowbitmap) ""] {
	set data(-arrowbitmap) [tix getbitmap cbxarrow]
    }
    if ![string compare $data(-crossbitmap) ""] {
	set data(-crossbitmap) [tix getbitmap cross]
    }
    if ![string compare $data(-tickbitmap) ""] {
	set data(-tickbitmap) [tix getbitmap tick]
    }
}

proc tixComboBox:ConstructFramedWidget {w frame} {
    upvar #0 $w data

    tixChainMethod $w ConstructFramedWidget $frame

    if {$data(-dropdown)} {
	tixComboBox:ConstructEntryFrame $w $frame
	tixComboBox:ConstructListShell $w
    } else {
	set f1 [frame $frame.f1]
	set f2 [frame $frame.f2]

	tixComboBox:ConstructEntryFrame $w $f1
	tixComboBox:ConstructListFrame  $w $f2
	pack $f1 -side top -pady 2 -fill x
	pack $f2 -side top -pady 2 -fill both -expand yes
    }
}

proc tixComboBox:ConstructEntryFrame {w frame} {
    upvar #0 $w data

    # (1) The entry
    #
    set data(w:entry) [entry $frame.entry]

    if {!$data(-editable)} {
	set bg [$w cget -bg]
	$data(w:entry) config -bg $bg -state disabled -takefocus 1
    }

    # This is used during "config-state"
    #
    set data(entryfg) [$data(w:entry) cget -fg]

    # (2) The dropdown button, not necessary when not in dropdown mode
    #
    set data(w:arrow) [button $frame.arrow -bitmap $data(-arrowbitmap)]
    if {!$data(-dropdown)} {
	set xframe [frame $frame.xframe -width 19]
    }

    # (3) The fancy tick and cross buttons
    #
    if {$data(-fancy)} {
	if {$data(-editable)} {
           set data(w:cross)  [button $frame.cross -bitmap $data(-crossbitmap)]
	   set data(w:tick)   [button $frame.tick  -bitmap $data(-tickbitmap)]

	   pack $frame.cross -side left -padx 1
	   pack $frame.tick  -side left -padx 1
	} else {
	   set data(w:tick)   [button $frame.tick  -bitmap $data(-tickbitmap)]
	   pack $frame.tick  -side left -padx 1
	}
    }

    if {$data(-dropdown)} {
	pack $data(w:arrow) -side right -padx 1
	foreach wid "$data(w:frame) $data(w:label)" {
	    tixAddBindTag $wid TixComboWid
	    tixSetMegaWidget $wid $w TixComboBox
	}
    } else {
	pack $xframe -side right -padx 1
    }
    pack $frame.entry -side right -fill x -expand yes -padx 1
}

proc tixComboBox:ConstructListShell {w} {
    upvar #0 $w data

    # Create the shell and the list
    #------------------------------
    set data(w:shell) [menu $w.shell -bd 2 -relief raised -tearoff 0]
    wm overrideredirect $data(w:shell) 1
    wm withdraw $data(w:shell)

    set data(w:slistbox) [tixScrolledListBox $data(w:shell).slistbox  	-anchor $data(-anchor)  	-options {listbox.selectMode "browse"}]

    set data(w:listbox) [$data(w:slistbox) subwidget listbox]

    pack $data(w:slistbox) -expand yes -fill both -padx 2 -pady 2
}

proc tixComboBox:ConstructListFrame {w frame} {
    upvar #0 $w data

    set data(w:slistbox) [tixScrolledListBox $frame.slistbox  	-anchor $data(-anchor)]

    set data(w:listbox) [$data(w:slistbox) subwidget listbox]

    pack $data(w:slistbox) -expand yes -fill both
}


proc tixComboBox:SetBindings {w} {
    upvar #0 $w data

    tixChainMethod $w SetBindings

    # (1) Fix the bindings for the combobox
    #
    bindtags $w "$w TixComboBox [winfo toplevel $w] all"

    # (2) The entry subwidget
    #
    tixSetMegaWidget $data(w:entry) $w TixComboBox

    bindtags $data(w:entry) [list $data(w:entry) Entry TixComboEntry 	TixComboWid [winfo toplevel $data(w:entry)] all]

    # (3) The listbox and slistbox
    #
    $data(w:slistbox) config -browsecmd  	"tixComboBox:LbBrowse  $w"
    $data(w:slistbox) config -command 	"tixComboBox:LbCommand $w"
    $data(w:listbox) config -takefocus 0

    tixAddBindTag $data(w:listbox)  TixComboLb
    tixAddBindTag $data(w:slistbox) TixComboLb
    tixSetMegaWidget $data(w:listbox)  $w TixComboBox
    tixSetMegaWidget $data(w:slistbox) $w TixComboBox

    # (4) The buttons
    #
    if {$data(-dropdown)} {
	$data(w:arrow) config -takefocus 0
	tixAddBindTag $data(w:arrow) TixComboArrow
	tixSetMegaWidget $data(w:arrow) $w TixComboBox

	bind $data(w:root) <1>                "tixComboBox:RootDown $w"
	bind $data(w:root) <ButtonRelease-1>  "tixComboBox:RootUp   $w"
    }

    if {$data(-fancy)} {
	if {$data(-editable)} {
	    $data(w:cross) config -command "tixComboBox:CrossBtn $w"  		-takefocus 0
	}
	$data(w:tick) config -command "tixComboBox:Invoke $w" -takefocus 0
    }

    if {$data(-dropdown)} {
	set data(state) 0
    } else {
	set data(state) n0
    }	
}

proc tixComboBoxBind {} {
    #----------------------------------------------------------------------
    # The class bindings for the TixComboBox
    #
    tixBind TixComboBox <Escape> {
	if [tixComboBox:EscKey %W] {
	    break
	}
    }
    tixBind TixComboBox <Configure> {
	tixWidgetDoWhenIdle tixComboBox:align %W
    }
    # Only the two "linear" detail_fields  are for tabbing (moving) among
    # widgets inside the same toplevel. Other detail_fields are sort
    # of irrelevant
    #
    tixBind TixComboBox <FocusOut>  {
	if {![string compare %d NotifyNonlinear] ||
	    ![string compare %d NotifyNonlinearVirtual]} {

	    if [info exists %W(cancelTab)] {
		unset %W(cancelTab)
	    } else {
		if [string compare [set %W(-state)] disabled] {
		    if [string compare [set %W(-selection)] [set %W(-value)]] {
			tixComboBox:Invoke %W
		    }
		}
	    }
	}
    }
    tixBind TixComboBox <FocusIn>  {
	if {[tixStrEq %d NotifyNonlinear] || 
	    [tixStrEq %d NotifyNonlinearVirtual]} {

	    focus [%W subwidget entry]
	    [set %W(w:entry)] selection from 0
	    [set %W(w:entry)] selection to end
	}
    }

    #----------------------------------------------------------------------
    # The class tixBindings for the arrow button widget inside the TixComboBox
    #

    tixBind TixComboArrow <1>               {
	tixComboBox:ArrowDown [tixGetMegaWidget %W TixComboBox]
    }
    tixBind TixComboArrow <ButtonRelease-1> {
	tixComboBox:ArrowUp   [tixGetMegaWidget %W TixComboBox]
    }
    tixBind TixComboArrow <Escape>          {
	if [tixComboBox:EscKey [tixGetMegaWidget %W TixComboBox]] {
	    break
	}
    }


    #----------------------------------------------------------------------
    # The class tixBindings for the entry widget inside the TixComboBox
    #
    tixBind TixComboEntry <Up>		{
	tixComboBox:EntDirKey [tixGetMegaWidget %W TixComboBox] up
    }
    tixBind TixComboEntry <Down>	{
	tixComboBox:EntDirKey [tixGetMegaWidget %W TixComboBox] down
    }
    tixBind TixComboEntry <Prior>	{
	tixComboBox:EntDirKey [tixGetMegaWidget %W TixComboBox] pageup
    }
    tixBind TixComboEntry <Next>	{
	tixComboBox:EntDirKey [tixGetMegaWidget %W TixComboBox] pagedown
    }
    tixBind TixComboEntry <Return>	{	
	tixComboBox:EntReturnKey [tixGetMegaWidget %W TixComboBox]
    }
    tixBind TixComboEntry <KeyPress>	{
	tixComboBox:EntKeyPress [tixGetMegaWidget %W TixComboBox]
    }
    tixBind TixComboEntry <Escape> 	{
	if [tixComboBox:EscKey [tixGetMegaWidget %W TixComboBox]] {
	    break
	}
    }
    tixBind TixComboEntry <Tab> 	{
	if {[set [tixGetMegaWidget %W TixComboBox](-state)] != "disabled"} {
	    if [tixComboBox:EntTab [tixGetMegaWidget %W TixComboBox]] {
		break
	    }
	}
    }
    tixBind TixComboEntry <1>	{
	if {[set [tixGetMegaWidget %W TixComboBox](-state)] != "disabled"} {
	    focus %W
	}
    }
    tixBind TixComboEntry <ButtonRelease-2>	{
	tixComboBox:EntKeyPress [tixGetMegaWidget %W TixComboBox]
    }

    #----------------------------------------------------------------------
    # The class bindings for the listbox subwidget
    #

    tixBind TixComboWid <Escape> {
	if [tixComboBox:EscKey [tixGetMegaWidget %W TixComboBox]] {
	    break
	}
    }

    #----------------------------------------------------------------------
    # The class bindings for some widgets inside ComboBox
    #
    tixBind TixComboWid <ButtonRelease-1> {
	tixComboBox:WidUp [tixGetMegaWidget %W TixComboBox]
    }
    tixBind TixComboWid <Escape> {
	if [tixComboBox:EscKey [tixGetMegaWidget %W TixComboBox]] {
	    break
	}
    }
}

#----------------------------------------------------------------------
#              Cooked events
#----------------------------------------------------------------------
proc tixComboBox:ArrowDown {w} {
    upvar #0 $w data

    if ![string compare $data(-state) disabled] {
	return
    }
    
    case $data(state) {
	{0} {
	    tixComboBox:GoState 1 $w
	}
	{2} {
	    tixComboBox:GoState 19 $w
	}
	default {
	    tixComboBox:StateError $w
	}
    }
}

proc tixComboBox:ArrowUp {w} {
    upvar #0 $w data
    
    case $data(state) {
	{1} {
	    tixComboBox:GoState 2 $w
	}
	{19} {
	    # data(ignore) was already set in state 19
	    tixComboBox:GoState 4 $w
	}
	{5} {
	    tixComboBox:GoState 13 $w
	}
	default {
	    tixComboBox:StateError $w
	}
    }
}

proc tixComboBox:RootDown {w} {
    upvar #0 $w data
    
    case $data(state) {
	{0} {
	    # Ignore
	}
	{2} {
	    tixComboBox:GoState 3 $w
	}
	default {
	    tixComboBox:StateError $w
	}
    }
}

proc tixComboBox:RootUp {w} {
    upvar #0 $w data
    
    case $data(state) {
	{1} {
	    tixComboBox:GoState 12 $w
	}
	{3} {
	    # data(ignore) was already set in state 3
	    tixComboBox:GoState 4 $w
	}
	{5} {
	    tixComboBox:GoState 7 $w
	}
	default {
	    tixComboBox:StateError $w
	}
    }
}

proc tixComboBox:WidUp {w} {
    upvar #0 $w data
    
    case $data(state) {
	{1} {
	    tixComboBox:GoState 12 $w
	}
	{5} {
	    tixComboBox:GoState 13 $w
	}
    }
}

proc tixComboBox:LbBrowse {w args} {
    upvar #0 $w data

    set event [tixEvent type]
    set x [tixEvent flag x]
    set y [tixEvent flag y]
    set X [tixEvent flag X]
    set Y [tixEvent flag Y]

    if ![string compare $data(-state) disabled] {
	return
    }

    case $event {
	<1> {
	    case $data(state) {
		{2} {
		    tixComboBox:GoState 5 $w $x $y $X $Y
		}
		{5} {
		    tixComboBox:GoState 5 $w $x $y $X $Y
		}
		{n0} {
		    tixComboBox:GoState n6 $w $x $y $X $Y
		}
		default {
		    tixComboBox:StateError $w
		}
	    }
	}
	<ButtonRelease-1> {
	    case $data(state) {
		{5} {
		    tixComboBox:GoState 6 $w $x $y $X $Y
		}
		{n6} {
		    tixComboBox:GoState n0 $w
		}
		default {
		    tixComboBox:StateError $w
		}
	    }
	}
	default {
	    # Must be a motion event
	    case $data(state) {
		{1} {
		    tixComboBox:GoState 9 $w $x $y $X $Y
		}
		{5} {
		    tixComboBox:GoState 5 $w $x $y $X $Y
		}
		{n6} {
		    tixComboBox:GoState n6 $w $x $y $X $Y
		}
		default {
		    tixComboBox:StateError $w
		}
	    }
	}
    }
}

proc tixComboBox:LbCommand {w} {
    upvar #0 $w data

    case $data(state) {
	{n0} {
	    tixComboBox:GoState n1 $w
	}
    }
}

#----------------------------------------------------------------------
#           General keyboard event

# returns 1 if the combobox is in some special state and the Escape key
# shouldn't be handled by the toplevel bind tag. As a result, when a combobox
# is popped up in a dialog box, Escape will popdown the combo. If the combo
# is not popped up, Escape will invoke the toplevel bindtag (which can
# pop down the dialog box)
#
proc tixComboBox:EscKey {w} {
    upvar #0 $w data

    if ![string compare $data(-state) disabled] {
	return
    }

    case $data(state) {
	{0} {
	    tixComboBox:GoState 17 $w
	}
	{2} {
	    tixComboBox:GoState 16 $w
	    return 1
	}
	{n0} {
	    tixComboBox:GoState n4 $w
	}
	default {
	    # ignore
	    return 1
	}
    }

    return 0
}

#----------------------------------------
# Keyboard events
#----------------------------------------
proc tixComboBox:EntDirKey {w dir} {
    upvar #0 $w data

    if ![string compare $data(-state) disabled] {
	return
    }

    case $data(state) {
	{0} {
	    tixComboBox:GoState 10 $w $dir
	}
	{2} {
	    tixComboBox:GoState 11 $w $dir
	}
	{5} {
	    # ignore
	}
	{n0} {
	    tixComboBox:GoState n3 $w $dir
	}
    }
}

proc tixComboBox:EntReturnKey {w} {
    upvar #0 $w data

    if ![string compare $data(-state) disabled] {
	return
    }

    case $data(state) {
	{0} {
	    tixComboBox:GoState 14 $w
	}
	{2} {
	    tixComboBox:GoState 15 $w
	}
	{5} {
	    # ignore
	}
	{n0} {
	    tixComboBox:GoState n1 $w
	}
    }
}

# Return 1 == break from the binding == no keyboard focus traversal
proc tixComboBox:EntTab {w} {
    upvar #0 $w data

    case $data(state) {
	{0} {
	    tixComboBox:GoState 14 $w
	    set data(cancelTab) ""
	    return 0
	}
	{2} {
	    tixComboBox:GoState 15 $w
	    set data(cancelTab) ""
	    return 0
	}
	{n0} {
	    tixComboBox:GoState n1 $w
	    set data(cancelTab) ""
	    return 0
	}
	default {
	    return 1
	}
    }
}

proc tixComboBox:EntKeyPress {w} {
    upvar #0 $w data

    if {!$data(-editable)} {
	return
    }
    if [tixStrEq $data(-state) disabled] {
	return
    }

    case $data(state) {
	{0 2 n0} {
	    tixComboBox:ClearListboxSelection $w
	    tixComboBox:SetSelection $w [$data(w:entry) get] 0 0
	}

    }
}

#----------------------------------------------------------------------

proc tixComboBox:HandleDirKey {w dir} {
    upvar #0 $w data

    if [tixComboBox:CheckListboxSelection $w] {
	case $dir {
	    "up" {
		tkListboxUpDown $data(w:listbox) -1
		set data(curIndex) [lindex [$data(w:listbox) curselection] 0]
		tixComboBox:SetSelectionFromListbox $w
	    }
	    "down" {
		tkListboxUpDown $data(w:listbox)  1
		set data(curIndex) [lindex [$data(w:listbox) curselection] 0]
		tixComboBox:SetSelectionFromListbox $w
	    }
	    "pageup" {
		$data(w:listbox) yview scroll -1 pages
	    }
	    "pagedown" {
		$data(w:listbox) yview scroll  1 pages
	    }
	}
    } else {
	# There wasn't good selection in the listbox.
	#
	tixComboBox:SetSelectionFromListbox $w
    }
}

proc tixComboBox:Invoke {w} {
    upvar #0 $w data

    tixComboBox:SetValue $w $data(-selection)
    if ![winfo exists $w] {
	return
    }

    if {$data(-history)} {
	tixComboBox:addhistory $w $data(-value)
	set data(curIndex) 0
    }
    $data(w:entry) selection from 0
    $data(w:entry) selection to end
    $data(w:entry) icursor end
}

#----------------------------------------------------------------------
#                   MAINTAINING THE -VALUE
#----------------------------------------------------------------------
proc tixComboBox:SetValue {w newValue {noUpdate 0} {updateEnt 1}} {
    upvar #0 $w data

    if {$data(-validatecmd) != ""} {
       set data(-value) [tixEvalCmdBinding $w $data(-validatecmd) "" $newValue]
    } else {
	set data(-value) $newValue
    }

    if {! $noUpdate} {
	tixVariable:UpdateVariable $w
    }

    if {$updateEnt} {
	if {!$data(-editable)} {
	    $data(w:entry) delete 0 end
	    $data(w:entry) insert 0 $data(-value)
	}
    }

    if {!$data(-disablecallback) && $data(-command) != ""} {
	if {![info exists data(varInited)]} {
	    set bind(specs) {%V}
	    set bind(%V)    $data(-value)

	    tixEvalCmdBinding $w $data(-command) bind $data(-value)
	    if ![winfo exists $w] {
		# The user destroyed the window!
		return
	    }
	}
    }

    set data(-selection) $data(-value)
    if {$updateEnt} {
	tixSetEntry $data(w:entry) $data(-value)

	if {$data(-anchor) == "e"} {
	    tixComboBox:EntryAlignEnd $w
	}
    }
}

# markSel: should the all the text in the entry be highlighted?
#
proc tixComboBox:SetSelection {w value {markSel 1} {setent 1}} {
    upvar #0 $w data

    if {$setent} {
	tixSetEntry $data(w:entry) $value
    }
    set data(-selection) $value

    if {$data(-selectmode) == "browse"} {
	if {$markSel} {
	    $data(w:entry) selection range 0 end
	}
	if {$data(-browsecmd) != ""} {
	    set bind(specs) {%V}
	    set bind(%V)    [$data(w:entry) get]
	    tixEvalCmdBinding $w $data(-browsecmd) bind [$data(w:entry) get]
	}
    } else {
	tixComboBox:SetValue $w $value 0 0
    }
}

proc tixComboBox:ClearListboxSelection {w} {
    upvar #0 $w data

    $data(w:listbox) selection clear 0 end
}

proc tixComboBox:UpdateListboxSelection {w index} {
    upvar #0 $w data

    if {$index != ""} {
	$data(w:listbox) selection set $index
	$data(w:listbox) selection anchor $index
    }
}


proc tixComboBox:Cancel {w} {
    upvar #0 $w data

    tixSetEntry $data(w:entry) $data(-value)
    tixComboBox:SetSelection $w $data(-value)

    if {"x[tixComboBox:LbGetSelection $w]" != "x$data(-selection)"} {
	tixComboBox:ClearListboxSelection $w
    }
}

proc tixComboBox:flash {w} {
    tixComboBox:BlinkEntry $w
}

# Make the entry blink when the user selects a choice
#
proc tixComboBox:BlinkEntry {w} {
    upvar #0 $w data

    if {![info exists data(entryBlacken)]} {
	set old_bg [$data(w:entry) cget -bg]
	set old_fg [$data(w:entry) cget -fg]

	$data(w:entry) config -fg $old_bg
	$data(w:entry) config -bg $old_fg

	set data(entryBlacken) 1
	after 50 tixComboBox:RestoreBlink $w [list $old_bg] [list $old_fg]
    }
}

proc tixComboBox:RestoreBlink {w old_bg old_fg} {
    upvar #0 $w data

    if {[info exists data(w:entry)] && [winfo exists $data(w:entry)]} {
	$data(w:entry) config -fg $old_fg
	$data(w:entry) config -bg $old_bg
    }

    if [info exists data(entryBlacken)] {
	unset data(entryBlacken)
    }
}

#----------------------------------------
#  Handle events inside the list box
#----------------------------------------

proc tixComboBox:LbIndex {w {flag ""}} {
    upvar #0 $w data

    set sel [lindex [$data(w:listbox) curselection] 0]
    if {$sel != ""} {
	return $sel
    } else {
	if {$flag == "emptyOK"} {
	    return ""
	} else {
	    return 0
	}
    }
}

#----------------------------------------------------------------------
#
#			STATE MANIPULATION
#
#----------------------------------------------------------------------
proc tixComboBox:GoState-0 {w} {
    upvar #0 $w data
}

proc tixComboBox:GoState-1 {w} {
    upvar #0 $w data

    tixComboBox:Popup $w
}

proc tixComboBox:GoState-2 {w} {
    upvar #0 $w data

}

proc tixComboBox:GoState-3 {w} {
    upvar #0 $w data

    set data(ignore) 1
    tixComboBox:Popdown $w
}

proc tixComboBox:GoState-4 {w} {
    upvar #0 $w data

    tixComboBox:Ungrab $w
    if {$data(ignore)} {
	tixComboBox:Cancel $w
    } else {
	tixComboBox:Invoke $w
    }
    tixComboBox:GoState 0 $w
}

proc tixComboBox:GoState-5 {w x y X Y} {
    upvar #0 $w data

    tixComboBox:LbSelect $w $x $y $X $Y
}

proc tixComboBox:GoState-6 {w x y X Y} {
    upvar #0 $w data

    tixComboBox:Popdown $w

    if [tixWithinWindow $data(w:shell) $X $Y] {
	set data(ignore) 0
    } else {
	set data(ignore) 1
    }

    tixComboBox:GoState 4 $w
}

proc tixComboBox:GoState-7 {w} {
    upvar #0 $w data

    tixComboBox:Popdown $w
    set data(ignore) 1
    catch {
	global tkPriv
	if {$tkPriv(afterId) != ""} {
	    tkCancelRepeat
	}
    }

    set data(ignore) 1
    tixComboBox:GoState 4 $w
}

proc tixComboBox:GoState-9 {w x y X Y} {
    upvar #0 $w data

    catch {
	tkButtonUp $data(w:arrow)
    }
    tixComboBox:GoState 5 $w $x $y $X $Y
}

proc tixComboBox:GoState-10 {w dir} {
    upvar #0 $w data

    tixComboBox:Popup $w
    if {![tixComboBox:CheckListboxSelection $w]} {
	# There wasn't good selection in the listbox.
	#
	tixComboBox:SetSelectionFromListbox $w
    }

    tixComboBox:GoState 2 $w
}

proc tixComboBox:GoState-11 {w dir} {
    upvar #0 $w data

    tixComboBox:HandleDirKey $w $dir

    tixComboBox:GoState 2 $w
}

proc tixComboBox:GoState-12 {w} {
    upvar #0 $w data

    catch {
	tkButtonUp $data(w:arrow)
    }

    tixComboBox:GoState 2 $w
}

proc tixComboBox:GoState-13 {w} {
    upvar #0 $w data

    catch {
	global tkPriv
	if {$tkPriv(afterId) != ""} {
	    tkCancelRepeat
	}
    }
    tixComboBox:GoState 2 $w
}

proc tixComboBox:GoState-14 {w} {
    upvar #0 $w data

    tixComboBox:Invoke $w
    tixComboBox:GoState 0 $w
}

proc tixComboBox:GoState-15 {w} {
    upvar #0 $w data

    tixComboBox:Popdown $w
    set data(ignore) 0
    tixComboBox:GoState 4 $w
}

proc tixComboBox:GoState-16 {w} {
    upvar #0 $w data

    tixComboBox:Popdown $w
    tixComboBox:Cancel $w
    set data(ignore) 1
    tixComboBox:GoState 4 $w
}

proc tixComboBox:GoState-17 {w} {
    upvar #0 $w data

    tixComboBox:Cancel $w
    tixComboBox:GoState 0 $w
}

proc tixComboBox:GoState-19 {w} {
    upvar #0 $w data

    if {"x$data(-selection)" != "x$data(-value)"} {
	set data(ignore) 0
    } else {
	set data(ignore) 1
    }
    tixComboBox:Popdown $w
}

#----------------------------------------------------------------------
#                      Non-dropdown states
#----------------------------------------------------------------------
proc tixComboBox:GoState-n0 {w} {
    upvar #0 $w data
}

proc tixComboBox:GoState-n1 {w} {
    upvar #0 $w data

    tixComboBox:Invoke $w
    tixComboBox:GoState n0 $w
}

proc tixComboBox:GoState-n3 {w dir} {
    upvar #0 $w data

    tixComboBox:HandleDirKey $w $dir
    tixComboBox:GoState n0 $w
}

proc tixComboBox:GoState-n4 {w} {
    upvar #0 $w data

    tixComboBox:Cancel $w
    tixComboBox:GoState n0 $w
}

proc tixComboBox:GoState-n6 {w x y X Y} {
    upvar #0 $w data

    tixComboBox:LbSelect $w $x $y $X $Y
}

#----------------------------------------------------------------------
#                      General State Manipulation
#----------------------------------------------------------------------
proc tixComboBox:GoState {s w args} {
    upvar #0 $w data

    tixComboBox:SetState $w $s
    eval tixComboBox:GoState-$s $w $args
}

proc tixComboBox:SetState {w s} {
    upvar #0 $w data

#    catch {puts [info level -2]}
#    puts "setting state $data(state) --> $s"
    set data(state) $s
}

proc tixComboBox:StateError {w} {
    upvar #0 $w data

#    error "wrong state $data(state)"
}

#----------------------------------------------------------------------
#                      Listbox handling
#----------------------------------------------------------------------

# Set a selection if there isn't one. Returns true if there was already
# a good selection inside the listbox
#
proc tixComboBox:CheckListboxSelection {w} {
    upvar #0 $w data

    if {[$data(w:listbox) curselection] == ""} {
	if {$data(curIndex) == ""} {
	    set data(curIndex) 0
	}

	$data(w:listbox) activate $data(curIndex)
	$data(w:listbox) selection clear 0 end
	$data(w:listbox) selection set $data(curIndex)
	$data(w:listbox) see $data(curIndex)
	return 0
    } else {
	return 1
    }
}

proc tixComboBox:SetSelectionFromListbox {w} {
    upvar #0 $w data

    set string [$data(w:listbox) get $data(curIndex)] 
    tixComboBox:SetSelection $w $string
    tixComboBox:UpdateListboxSelection $w $data(curIndex)
}

proc tixComboBox:LbGetSelection {w} {
    upvar #0 $w data
    set index [tixComboBox:LbIndex $w emptyOK]

    if {$index >=0} {
	return [$data(w:listbox) get $index]
    } else {
	return ""
    }
}

proc tixComboBox:LbSelect {w x y X Y} {
    upvar #0 $w data

    set index [tixComboBox:LbIndex $w emptyOK]
    if {$index == ""} {
	set index [$data(w:listbox) nearest $y]
    }

    if {$index >= 0} {
	if {"x[focus -lastfor $data(w:entry)]" != "x$data(w:entry)" &&
	    "x[focus -lastfor $data(w:entry)]" != "x$data(w:listbox)"} {
	    focus $data(w:entry)
	}

	set string [$data(w:listbox) get $index] 
	tixComboBox:SetSelection $w $string

	tixComboBox:UpdateListboxSelection $w $index
    }
}

#----------------------------------------------------------------------
# Internal commands
#----------------------------------------------------------------------
proc tixComboBox:CrossBtn {w} {
    upvar #0 $w data

    $data(w:entry) delete 0 end
    tixComboBox:ClearListboxSelection $w
    tixComboBox:SetSelection $w ""
}

#--------------------------------------------------
#		Popping up list shell
#--------------------------------------------------

# Popup the listbox and grab
#
#
proc tixComboBox:Popup {w} {
    upvar #0 $w data

    if {![winfo ismapped $data(w:root)]} {
	return
    }

    #---------------------------------------------------------------------
    # 				Pop up
    #
    if {$data(-listcmd) != ""} {
	# This option allows the user to fill in the listbox on demand
	#
	tixEvalCmdBinding $w $data(-listcmd)
    }

    # calculate the size
    set  y [winfo rooty $data(w:entry)]
    incr y [winfo height $data(w:entry)]
    incr y 3

    set bd [$data(w:shell) cget -bd]
#   incr bd [$data(w:shell) cget -highlightthickness]
    set height [expr [winfo reqheight $data(w:slistbox)] + 2*$bd]

    set x1 [winfo rootx $data(w:entry)]
    if {$data(-listwidth) == ""} {
	if [winfo ismapped $data(w:arrow)] {
	    set x2  [winfo rootx $data(w:arrow)]
	    if {$x2 >= $x1} {
		incr x2 [winfo width $data(w:arrow)]
		set width  [expr "$x2 - $x1"]
	    } else {
		set width  [winfo width $data(w:entry)]
		set x2 [expr $x1 + $width]
	    }
	} else {
	    set width  [winfo width $data(w:entry)]
	    set x2 [expr $x1 + $width]
	}
    } else {
	set width $data(-listwidth)
	set x2 [expr $x1 + $width]
    }

    set reqwidth [winfo reqwidth $data(w:shell)]
    if {$reqwidth < $width} {
	set reqwidth $width
    } else {
	if {$reqwidth > [expr $width *3]} {
	    set reqwidth [expr $width *3]
	}
	if {$reqwidth > [winfo vrootwidth .]} {
	    set reqwidth [winfo vrootwidth .]
	}
    }
    set width $reqwidth


    # If the listbox is too far right, pull it back to the left
    #
    set scrwidth [winfo vrootwidth .]
    if {$x2 > $scrwidth} {
	set x1 [expr $scrwidth - $width]
    }

    # If the listbox is too far left, pull it back to the right
    #
    if {$x1 < 0} {
	set x1 0
    }

    # If the listbox is below bottom of screen, put it upwards
    #
    set scrheight [winfo vrootheight .]
    set bottom [expr $y+$height]
    if {$bottom > $scrheight} {
	set y [expr $y-$height-[winfo height $data(w:entry)]-5]
    }

    # OK , popup the shell
    #
    global tcl_platform

    wm geometry $data(w:shell) $reqwidth\x$height+$x1+$y
    if {$tcl_platform(platform) == "windows"} {
	update
    }
    wm deiconify $data(w:shell)
    if {$tcl_platform(platform) == "windows"} {
	update
    }
    raise $data(w:shell)
    focus $data(w:entry)
    set data(popped) 1

    tixComboBox:Grab $w
}

proc tixComboBox:SetCursor {w cursor} {
    upvar #0 $w data

    $w config -cursor $cursor
}

proc tixComboBox:Popdown {w} {
    upvar #0 $w data

    wm withdraw $data(w:shell)
    tixComboBox:SetCursor $w ""
}

# Grab the server so that user cannot move the windows around
proc tixComboBox:Grab {w} {
    upvar #0 $w data

    tixComboBox:SetCursor $w arrow
    catch {
	# We catch here because grab may fail under a lot of circumstances
	# Just don't want to break the code ...
	case $data(-grab) {
	    global {
		tixPushGrab -global $data(w:root)
	    }
	    local {
		tixPushGrab $data(w:root)
	    }
	}
    }
}

proc tixComboBox:Ungrab {w} {
    upvar #0 $w data

    case $data(-grab) {
	global {
	    tixPopGrab
	}
	local {
	    tixPopGrab
	}
    }
}

#----------------------------------------------------------------------
#		 Alignment
#----------------------------------------------------------------------
# The following two routines can emulate a "right align mode" for the
# entry in the combo box.

proc tixComboBox:EntryAlignEnd {w} {
    upvar #0 $w data
    $data(w:entry) xview end
}


proc tixComboBox:Destructor {w} {
    upvar #0 $w data

    tixUnsetMegaWidget $data(w:entry)
    tixVariable:DeleteVariable $w

    # Chain this to the superclass
    #
    tixChainMethod $w Destructor
}


#----------------------------------------------------------------------
#                           CONFIG OPTIONS
#----------------------------------------------------------------------

proc tixComboBox:config-state {w value} {
    upvar #0 $w data
    catch {if {"x[$data(w:arrow) cget -state]" == "x$value"} {
	set a 1
    }}
    if [info exists a] {
	return
    }

    catch {$data(w:arrow) config -state $value}
    catch {$data(w:tick)  config -state $value}
    catch {$data(w:cross) config -state $value}
    catch {$data(w:slistbox) config -state $value}

    if ![string compare $value normal] {
	set fg [$data(w:arrow) cget -fg]
	set entryFg $data(entryfg)
    } else {
	set fg [$data(w:arrow) cget -disabledforeground]
	set entryFg $data(-disabledforeground) 
    }
    if [string compare $fg ""] {
	$data(w:label) config -fg $fg
	$data(w:listbox) config -fg $fg -selectforeground $fg
    }
    $data(w:entry) config -fg $entryFg -selectforeground $entryFg

    if ![string compare $value normal] {
	if {$data(-editable)} {
	    $data(w:entry) config -state normal
	}
        $data(w:entry) config -takefocus 1
    } else {
	if {$data(-editable)} {
	   $data(w:entry) config -state disabled
        }
        $data(w:entry) config -takefocus 0
    }
}

proc tixComboBox:config-value {w value} {
    upvar #0 $w data

    tixComboBox:SetValue $w $value

    set data(-selection) $value

    if {"x[tixComboBox:LbGetSelection $w]" != "x$value"} {
	tixComboBox:ClearListboxSelection $w
    }
}

proc tixComboBox:config-selection {w value} {
    upvar #0 $w data

    tixComboBox:SetSelection $w $value

    if {"x[tixComboBox:LbGetSelection $w]" != "x$value"} {
	tixComboBox:ClearListboxSelection $w
    }
}

proc tixComboBox:config-variable {w arg} {
    upvar #0 $w data

    if [tixVariable:ConfigVariable $w $arg] {
       # The value of data(-value) is changed if tixVariable:ConfigVariable 
       # returns true
       set data(-selection) $data(-value)
       tixComboBox:SetValue $w $data(-value) 1
    }
    catch {
	unset data(varInited)
    }
    set data(-variable) $arg
}


#----------------------------------------------------------------------
#                     WIDGET COMMANDS
#----------------------------------------------------------------------
proc tixComboBox:align {w args} {
    upvar #0 $w data

    if {$data(-anchor) == "e"} {
	tixComboBox:EntryAlignEnd $w
    }
}

proc tixComboBox:addhistory {w value} {
    upvar #0 $w data

    tixComboBox:insert $w 0 $value
    $data(w:listbox) selection clear 0 end

    if {$data(-prunehistory)} {
	# Prune from the end
	# 
	set max [$data(w:listbox) size]
	if {$max <= 1} {
	    return
	}
	for {set i [expr $max -1]} {$i >= 1} {incr i -1} {
	    if {"x[$data(w:listbox) get $i]" == "x$value"} {
		$data(w:listbox) delete $i
		break
	    }
	}
    }
}

proc tixComboBox:appendhistory {w value} {
    upvar #0 $w data

    tixComboBox:insert $w end $value
    $data(w:listbox) selection clear 0 end

    if {$data(-prunehistory)} {
	# Prune from the end
	# 
	set max [$data(w:listbox) size]
	if {$max <= 1} {
	    return
	}
	for {set i [expr $max -2]} {$i >= 0} {incr i -1} {
	    if {"x[$data(w:listbox) get $i]" == "x$value"} {
		$data(w:listbox) delete $i
		break
	    }
	}
    }
}

proc tixComboBox:insert {w index newitem} {
    upvar #0 $w data

    $data(w:listbox) insert $index $newitem

    if {$data(-history) && $data(-historylimit) != ""} {
	if {"x[$data(w:listbox) size]"  == "x$data(-historylimit)"} {
	    $data(w:listbox) delete 0
	}
    }
}

proc tixComboBox:pick {w index} {
    upvar #0 $w data

    $data(w:listbox) activate $index
    $data(w:listbox) selection clear 0 end
    $data(w:listbox) selection set active
    $data(w:listbox) see active
    set text [$data(w:listbox) get $index]

    tixComboBox:SetValue $w $text

    set data(curIndex) $index
}

proc tixComboBox:invoke {w} {
    tixComboBox:Invoke $w
}

proc tixComboBox:popdown {w} {
    upvar #0 $w data

    if {$data(-dropdown)} {
	tixComboBox:Popdown $w
    }
}

 # Compat.tcl --
#
# 	This file wraps around many incompatibilities from Tix 3.6
#	to Tix 4.0.
#
#	(1) "box" to "Box" changes
#	(2) "DlgBtns" to "ButtonBox" changes
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#


proc tixDlgBtns {args} {
    return [eval tixButtonBox $args]
}

proc tixStdDlgBtns {args} {
    return [eval tixStdButtonBox $args]
}

proc tixCombobox {args} {
    return [eval tixComboBox $args]
}

proc tixFileSelectbox {args} {
    return [eval tixFileSelectBox $args]
}

proc tixScrolledListbox {args} {
    return [eval tixScrolledListBox $args]
}

proc tixInit {args} {
    eval tix config $args
    puts stderr "tixInit no longer needed for this version of Tix"
}

 # Console.tcl --
#
#	This code constructs the console window for an application.
#	It can be used by non-unix systems that do not have built-in
#	support for shells.
#
#	This file was distributed as a part of Tk 4.1 by Sun
#	Microsystems, Inc. and subsequently modified by Expert
#	Interface Techonoligies and included as a part of Tix.
#
#	Some of the functions in this file have been renamed from
#	using a "tk" prefix to a "tix" prefix to avoid namespace
#	conflict with the original file.
#
# Copyright (c) 1995-1996 Sun Microsystems, Inc.
# Copyright (c) 1996 Expert Interface Technologies.
#
# See the file "docs/license.tcltk" for information on usage and
# redistribution of the original file "console.tcl". These license
# terms do NOT apply to other files in the Tix distribution.
#
# See the file "license.terms" for information on usage and
# redistribution * of this file, and for a DISCLAIMER OF ALL
# WARRANTIES.

# tixConsoleInit --
# This procedure constructs and configures the console windows.
#
# Arguments:
# 	None.

proc tixConsoleInit {} {
    global tcl_platform

    uplevel #0 set tixConsoleTextFont Courier
    uplevel #0 set tixConsoleTextSize 14

    set f [frame .f]
    set fontcb [tixComboBox $f.size -label "" -command "tixConsoleSetFont"  	-variable tixConsoleTextFont  	-options {
	    entry.width    15
	    listbox.height 5
	}]
    set sizecb [tixComboBox $f.font -label "" -command "tixConsoleSetFont"  	-variable tixConsoleTextSize  	-options {
	    entry.width    4
	    listbox.width  6
	    listbox.height 5
	}]
    pack $fontcb $sizecb -side left
    pack $f -side top -fill x -padx 2 -pady 2
    foreach font {
	"Courier New"
	"Courier"
	"Helvetica"
	"Lucida"
	"Lucida Typewriter"
	"MS LineDraw"
	"System"
	"Times Roman"
    } {
	$fontcb subwidget listbox insert end $font
    }

    for {set s 6} {$s < 25} {incr s} {
	$sizecb subwidget listbox insert end $s
    }

    bind [$fontcb subwidget entry] <Escape> "focus .console"
    bind [$sizecb subwidget entry] <Escape> "focus .console"

    text .console  -yscrollcommand ".sb set" -setgrid true  	-highlightcolor [. cget -bg] -highlightbackground [. cget -bg]  	-cursor left_ptr
    scrollbar .sb -command ".console yview" -highlightcolor [. cget -bg]  	-highlightbackground [. cget -bg]
    pack .sb -side right -fill both
    pack .console -fill both -expand 1 -side left

    tixConsoleBind .console

    .console tag configure stderr -foreground red
    .console tag configure stdin -foreground blue

    focus .console
    
    wm protocol . WM_DELETE_WINDOW { wm withdraw . }
    wm title . "Console"
    flush stdout
    .console mark set output [.console index "end - 1 char"]
    tkTextSetCursor .console end
    .console mark set promptEnd insert
    .console mark gravity promptEnd left

    tixConsoleSetFont
}

proc tixConsoleSetFont {args} {
    if ![winfo exists .console] tixConsoleInit

    global tixConsoleTextFont tixConsoleTextSize

    set font  -*-$tixConsoleTextFont-medium-r-normal-*-$tixConsoleTextSize-*-*-*-*-*-*-*
    .console config -font $font
}

# tixConsoleInvoke --
# Processes the command line input.  If the command is complete it
# is evaled in the main interpreter.  Otherwise, the continuation
# prompt is added and more input may be added.
#
# Arguments:
# None.

proc tixConsoleInvoke {args} {
    if ![winfo exists .console] tixConsoleInit

    if {[.console dlineinfo insert] != {}} {
	set setend 1
    } else {
	set setend 0
    }
    set ranges [.console tag ranges input]
    set cmd ""
    if {$ranges != ""} {
	set pos 0
	while {[lindex $ranges $pos] != ""} {
	    set start [lindex $ranges $pos]
	    set end [lindex $ranges [incr pos]]
	    append cmd [.console get $start $end]
	    incr pos
	}
    }
    if {$cmd == ""} {
	tixConsolePrompt
    } elseif [info complete $cmd] {
	.console mark set output end
	.console tag delete input
	set err [catch {
	    set result [interp record $cmd]
	} result]

	if {$result != ""} {
	    if {$err} {
		.console insert insert "$result\n" stderr
	    } else {
		.console insert insert "$result\n"
	    }
	}
	tixConsoleHistory reset
	tixConsolePrompt
    } else {
	tixConsolePrompt partial
    }
    if {$setend} {
	.console yview -pickplace insert
    }
}

# tixConsoleHistory --
# This procedure implements command line history for the
# console.  In general is evals the history command in the
# main interpreter to obtain the history.  The global variable
# histNum is used to store the current location in the history.
#
# Arguments:
# cmd -	Which action to take: prev, next, reset.

set histNum 1
proc tixConsoleHistory {cmd} {
    if ![winfo exists .console] tixConsoleInit

    global histNum
    
    switch $cmd {
    	prev {
	    incr histNum -1
	    if {$histNum == 0} {
		set cmd {history event [expr [history nextid] -1]}
	    } else {
		set cmd "history event $histNum"
	    }
    	    if {[catch {interp eval $cmd} cmd]} {
    	    	incr histNum
    	    	return
    	    }
	    .console delete promptEnd end
    	    .console insert promptEnd $cmd {input stdin}
    	}
    	next {
	    incr histNum
	    if {$histNum == 0} {
		set cmd {history event [expr [history nextid] -1]}
	    } elseif {$histNum > 0} {
		set cmd ""
		set histNum 1
	    } else {
		set cmd "history event $histNum"
	    }
	    if {$cmd != ""} {
		catch {interp eval $cmd} cmd
	    }
	    .console delete promptEnd end
	    .console insert promptEnd $cmd {input stdin}
    	}
    	reset {
    	    set histNum 1
    	}
    }
}

# tixConsolePrompt --
# This procedure draws the prompt.  If tcl_prompt1 or tcl_prompt2
# exists in the main interpreter it will be called to generate the 
# prompt.  Otherwise, a hard coded default prompt is printed.
#
# Arguments:
# partial -	Flag to specify which prompt to print.

proc tixConsolePrompt {{partial normal}} {
    if ![winfo exists .console] tixConsoleInit

    if {$partial == "normal"} {
	set temp [.console index "end - 1 char"]
	.console mark set output end
    	if [interp eval "info exists tcl_prompt1"] {
    	    interp eval "eval \[set tcl_prompt1\]"
    	} else {
    	    puts -nonewline "% "
    	}
    } else {
	set temp [.console index output]
	.console mark set output end
    	if [interp eval "info exists tcl_prompt2"] {
    	    interp eval "eval \[set tcl_prompt2\]"
    	} else {
	    puts -nonewline "> "
    	}
    }

    flush stdout
    .console mark set output $temp
    tkTextSetCursor .console end
    .console mark set promptEnd insert
    .console mark gravity promptEnd left
}

# tixConsoleBind --
# This procedure first ensures that the default bindings for the Text
# class have been defined.  Then certain bindings are overridden for
# the class.
#
# Arguments:
# None.

proc tixConsoleBind {win} {
    if ![winfo exists .console] tixConsoleInit

    bindtags $win "$win Text . all"

    # Ignore all Alt, Meta, and Control keypresses unless explicitly bound.
    # Otherwise, if a widget binding for one of these is defined, the
    # <KeyPress> class binding will also fire and insert the character,
    # which is wrong.  Ditto for <Escape>.

    bind $win <Alt-KeyPress> {# nothing }
    bind $win <Meta-KeyPress> {# nothing}
    bind $win <Control-KeyPress> {# nothing}
    bind $win <Escape> {# nothing}
    bind $win <KP_Enter> {# nothing}

    bind $win <Tab> {
	tixConsoleInsert %W \t
	focus %W
	break
    }
    bind $win <Return> {
	%W mark set insert {end - 1c}
	tixConsoleInsert %W "\n"
	tixConsoleInvoke
	break
    }
    bind $win <Delete> {
	if {[%W tag nextrange sel 1.0 end] != ""} {
	    %W tag remove sel sel.first promptEnd
	} else {
	    if [%W compare insert < promptEnd] {
		break
	    }
	}
    }
    bind $win <BackSpace> {
	if {[%W tag nextrange sel 1.0 end] != ""} {
	    %W tag remove sel sel.first promptEnd
	} else {
	    if [%W compare insert <= promptEnd] {
		break
	    }
	}
    }
    foreach left {Control-a Home} {
	bind $win <$left> {
	    if [%W compare insert < promptEnd] {
		tkTextSetCursor %W {insert linestart}
	    } else {
		tkTextSetCursor %W promptEnd
            }
	    break
	}
    }
    foreach right {Control-e End} {
	bind $win <$right> {
	    tkTextSetCursor %W {insert lineend}
	    break
	}
    }
    bind $win <Control-d> {
	if [%W compare insert < promptEnd] {
	    break
	}
    }
    bind $win <Control-k> {
	if [%W compare insert < promptEnd] {
	    %W mark set insert promptEnd
	}
    }
    bind $win <Control-t> {
	if [%W compare insert < promptEnd] {
	    break
	}
    }
    bind $win <Meta-d> {
	if [%W compare insert < promptEnd] {
	    break
	}
    }
    bind $win <Meta-BackSpace> {
	if [%W compare insert <= promptEnd] {
	    break
	}
    }
    bind $win <Control-h> {
	if [%W compare insert <= promptEnd] {
	    break
	}
    }
    foreach prev {Control-p Up} {
	bind $win <$prev> {
	    tixConsoleHistory prev
	    break
	}
    }
    foreach prev {Control-n Down} {
	bind $win <$prev> {
	    tixConsoleHistory next
	    break
	}
    }
    bind $win <Control-v> {
	if [%W compare insert > promptEnd] {
	    catch {
		%W insert insert [selection get -displayof %W] {input stdin}
		%W see insert
	    }
	}
	break
    }
    bind $win <Insert> {
	catch {tixConsoleInsert %W [selection get -displayof %W]}
	break
    }
    bind $win <KeyPress> {
	tixConsoleInsert %W %A
	break
    }
    foreach left {Control-b Left} {
	bind $win <$left> {
	    if [%W compare insert == promptEnd] {
		break
	    }
	    tkTextSetCursor %W insert-1c
	    break
	}
    }
    foreach right {Control-f Right} {
	bind $win <$right> {
	    tkTextSetCursor %W insert+1c
	    break
	}
    }
    bind $win <Control-Up> {
	%W yview scroll -1 unit
	break;
    }
    bind $win <Control-Down> {
	%W yview scroll 1 unit
	break;
    }
    bind $win <Prior> {
	%W yview scroll -1 pages
    }
    bind $win <Next> {
	%W yview scroll  1 pages
    }
    bind $win <F9> {
	eval destroy [winfo child .]
	source $tix_library/Console.tcl
    }
    foreach copy {F16 Meta-w Control-i} {
	bind $win <$copy> {
	    if {[selection own -displayof %W] == "%W"} {
		clipboard clear -displayof %W
		catch {
		    clipboard append -displayof %W [selection get -displayof %W]
		}
	    }
	    break
	}
    }
    foreach paste {F18 Control-y} {
	bind $win <$paste> {
	    catch {
	        set clip [selection get -displayof %W -selection CLIPBOARD]
		set list [split $clip \n\r]
		tixConsoleInsert %W [lindex $list 0]
		foreach x [lrange $list 1 end] {
		    %W mark set insert {end - 1c}
		    tixConsoleInsert %W "\n"
		    tixConsoleInvoke
		    tixConsoleInsert %W $x
		}
	    }
	    break
	}
    }
}

# tixConsoleInsert --
# Insert a string into a text at the point of the insertion cursor.
# If there is a selection in the text, and it covers the point of the
# insertion cursor, then delete the selection before inserting.  Insertion
# is restricted to the prompt area.
#
# Arguments:
# w -		The text window in which to insert the string
# s -		The string to insert (usually just a single character)

proc tixConsoleInsert {w s} {
    if ![winfo exists .console] tixConsoleInit

    if {[.console dlineinfo insert] != {}} {
	set setend 1
    } else {
	set setend 0
    }
    if {$s == ""} {
	return
    }
    catch {
	if {[$w compare sel.first <= insert]
		&& [$w compare sel.last >= insert]} {
	    $w tag remove sel sel.first promptEnd
	    $w delete sel.first sel.last
	}
    }
    if {[$w compare insert < promptEnd]} {
	$w mark set insert end	
    }
    $w insert insert $s {input stdin}
    if $setend {
	.console see insert
    }
}



# tixConsoleOutput --
#
# This routine is called directly by ConsolePutsCmd to cause a string
# to be displayed in the console.
#
# Arguments:
# dest -	The output tag to be used: either "stderr" or "stdout".
# string -	The string to be displayed.

proc tixConsoleOutput {dest string} {
    if ![winfo exists .console] tixConsoleInit

    if {[.console dlineinfo insert] != {}} {
	set setend 1
    } else {
	set setend 0
    }
    .console insert output $string $dest
    if $setend {
	.console see insert
    }
}

# tixConsoleExit --
#
# This routine is called by ConsoleEventProc when the main window of
# the application is destroyed.
#
# Arguments:
# None.

proc tixConsoleExit {} {
    if ![winfo exists .console] tixConsoleInit

    exit
}


 # Control.tcl --
#
# 	Implements the TixControl Widget. It is called the "SpinBox"
# 	in other toolkits.
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

tixWidgetClass tixControl {
    -classname  TixControl
    -superclass tixLabelWidget
    -method {
	incr decr invoke update
    }
    -flag {
	-allowempty -autorepeat -command -decrcmd -disablecallback
	-disabledforeground -incrcmd -initwait -integer -llimit
	-repeatrate -max -min -selectmode -step -state -validatecmd
	-value -variable -ulimit
    }
    -forcecall {
	-variable -state
    }
    -configspec {
	{-allowempty allowEmpty AllowEmpty false}
	{-autorepeat autoRepeat AutoRepeat true}
	{-command command Command ""}
	{-decrcmd decrCmd DecrCmd ""}
	{-disablecallback disableCallback DisableCallback 0 tixVerifyBoolean}
	{-disabledforeground disabledForeground DisabledForeground #303030}
	{-incrcmd incrCmd IncrCmd ""}
	{-initwait initWait InitWait 500}
	{-integer integer Integer false}
	{-max max Max ""}
	{-min min Min ""}
	{-repeatrate repeatRate RepeatRate 50}
	{-step step Step 1}
	{-state state State normal}
	{-selectmode selectMode SelectMode normal}
	{-validatecmd validateCmd ValidateCmd ""}
	{-value value Value 0}
	{-variable variable Variable ""}
    }
    -alias {
	{-llimit -min}
	{-ulimit -max}
    }
    -default {
	{.borderWidth 			0}
	{*entry.relief			sunken}
	{*entry.width			5}
	{*label.anchor			e}
	{*label.borderWidth		0}
	{*Label.font                   -Adobe-Helvetica-Bold-R-Normal--*-120-*}
	{*Button.anchor			c}
	{*Button.borderWidth		2}
	{*Button.highlightThickness	1}
	{*Button.takeFocus		0}
	{*Entry.background		#c3c3c3}
    }
}

proc tixControl:InitWidgetRec {w} {
    upvar #0 $w data

    tixChainMethod $w InitWidgetRec

    set data(varInited)	  0
    set data(serial)	0
}

proc tixControl:ConstructFramedWidget {w frame} {
    upvar #0 $w data

    tixChainMethod $w ConstructFramedWidget $frame

    set data(w:entry)  [entry $frame.entry]

    set data(w:incr) [button $frame.incr -bitmap [tix getbitmap incr]  	-takefocus 0]
    set data(w:decr) [button $frame.decr -bitmap [tix getbitmap decr]  	-takefocus 0]

#    tixForm $data(w:entry) -left 0 -top 0 -bottom -1 -right $data(w:decr) 
#    tixForm $data(w:incr) -right -1 -top 0 -bottom %50
#    tixForm $data(w:decr) -right -1 -top $data(w:incr) -bottom -1

    pack $data(w:entry) -side left   -expand yes -fill both
    pack $data(w:decr)  -side bottom -fill both -expand yes
    pack $data(w:incr)  -side top    -fill both -expand yes

    $data(w:entry) delete 0 end
    $data(w:entry) insert 0 $data(-value)

    # This value is used to configure the disable/normal fg of the ebtry
    set data(entryfg) [$data(w:entry) cget -fg]
    set data(labelfg) [$data(w:label) cget -fg]
}

proc tixControl:SetBindings {w} {
    upvar #0 $w data

    tixChainMethod $w SetBindings

    bind $data(w:incr) <ButtonPress-1> "tixControl:StartRepeat $w  1"
    bind $data(w:decr) <ButtonPress-1> "tixControl:StartRepeat $w -1"

    # These bindings will stop the button autorepeat when the 
    # mouse button is up
    foreach btn "$data(w:incr) $data(w:decr)" {
	bind $btn <ButtonRelease-1> "tixControl:StopRepeat $w"
    }

    tixSetMegaWidget $data(w:entry) $w

    # If user press <return>, verify the value and call the -command
    #
    tixAddBindTag $data(w:entry) TixControl:Entry 
}

proc tixControlBind {} {
    tixBind TixControl:Entry <Return> {
	tixControl:Invoke [tixGetMegaWidget %W] 1
    }
    tixBind TixControl:Entry <Escape> {
	tixControl:Escape [tixGetMegaWidget %W]
    }
    tixBind TixControl:Entry <Up> {
	[tixGetMegaWidget %W] incr
    }
    tixBind TixControl:Entry <Down> {
	[tixGetMegaWidget %W] decr
    }
    tixBind TixControl:Entry <FocusOut> {
	if {"%d" == "NotifyNonlinear" || "%d" == "NotifyNonlinearVirtual"} {
	    tixControl:Tab [tixGetMegaWidget %W] %d
	}
    }
    tixBind TixControl:Entry <Any-KeyPress> {
	tixControl:KeyPress [tixGetMegaWidget %W]
    }
    tixBind TixControl:Entry <Any-Tab> {
	# This has a higher priority than the <Any-KeyPress>  binding
	# --> so that data(edited) is not set
    }
}

#----------------------------------------------------------------------
#                           CONFIG OPTIONS
#----------------------------------------------------------------------
proc tixControl:config-state {w arg} {
    upvar #0 $w data

    if {$arg == "normal"} {
	$data(w:incr)  config -state $arg
	$data(w:decr)  config -state $arg
	catch {
	    $data(w:label) config -fg $data(labelfg)
	}
	$data(w:entry) config -state $arg -fg $data(entryfg)
    } else {
	$data(w:incr)  config -state $arg
	$data(w:decr)  config -state $arg
	catch {
	    $data(w:label) config -fg $data(-disabledforeground)
	}
	$data(w:entry) config -state $arg -fg $data(-disabledforeground)
    }
}

proc tixControl:config-value {w value} {
    upvar #0 $w data

    tixControl:SetValue $w $value 0 1

    # This will tell the Intrinsics: "Please use this value"
    # because "value" might be altered by SetValues
    #
    return $data(-value)
}

proc tixControl:config-variable {w arg} {
    upvar #0 $w data

    if [tixVariable:ConfigVariable $w $arg] {
       # The value of data(-value) is changed if tixVariable:ConfigVariable 
       # returns true
       tixControl:SetValue $w $data(-value) 1 1
    }
    catch {
	unset data(varInited)
    }
    set data(-variable) $arg
}

#----------------------------------------------------------------------
#                         User Commands
#----------------------------------------------------------------------
proc tixControl:incr {w {by 1}} {
    upvar #0 $w data

    if {$data(-state) != "disabled"} {
	if {[catch {$data(w:entry) index sel.first}] == 0} {
	    $data(w:entry) select from end
	    $data(w:entry) select to   end
	}
	
	tixControl:SetValue $w [$data(w:entry) get] 0 1
	tixControl:AdjustValue $w $by
    }
}

proc tixControl:decr {w {by 1}} {
    upvar #0 $w data

    if {$data(-state) != "disabled"} {
	if {[catch {$data(w:entry) index sel.first}] == 0} {
	    $data(w:entry) select from end
	    $data(w:entry) select to   end
	}

	tixControl:SetValue $w [$data(w:entry) get] 0 1
	tixControl:AdjustValue $w [expr 0 - $by]
    }
}

proc tixControl:invoke {w} {
    upvar #0 $w data

    tixControl:Invoke $w 0
}

proc tixControl:update {w} {
    upvar #0 $w data

    if [info exists data(edited)] {
	tixControl:invoke $w
    }
}

#----------------------------------------------------------------------
#                       Internal Commands
#----------------------------------------------------------------------

# Change the value by a multiple of the data(-step)
#
proc tixControl:AdjustValue {w amount} {
    upvar #0 $w data

    if {$amount == 1 && $data(-incrcmd) != ""} {
	set newValue [tixEvalCmdBinding $w $data(-incrcmd) "" $data(-value)]
    } elseif {$amount == -1 && $data(-decrcmd) != ""} {
	set newValue [tixEvalCmdBinding $w $data(-decrcmd) "" $data(-value)]
    } else {
	set newValue [expr $data(-value) + $amount * $data(-step)]
    }

    if {$data(-state) != "disabled"} {
	tixControl:SetValue $w $newValue 0 1
    }
}

proc tixControl:SetValue {w newvalue noUpdate forced} {
    upvar #0 $w data

    if {[$data(w:entry) selection present]} {
	set oldSelection  	    "[$data(w:entry) index sel.first] [$data(w:entry) index sel.last]"
    }

    set oldvalue $data(-value)
    set oldCursor [$data(w:entry) index insert]
    set changed 0


    if {$data(-validatecmd) != ""} {
	# Call the user supplied validation command
	#
       set data(-value) [tixEvalCmdBinding $w $data(-validatecmd) "" $newvalue]
    } else {
	# Here we only allow int or floating numbers
	#
	# If the new value is not a valid number, the old value will be
	# kept due to the "catch" statements
	#
	if [catch {expr 0+$newvalue}] {
	    set newvalue 0
	    set data(-value) 0
	    set changed 1
	}

	if {$newvalue == ""} {
	    if {![tixGetBoolean -nocomplain $data(-allowempty)]} {
		set newvalue 0
		set changed 1
	    } else {
		set data(-value) ""
	    }
	}

	if {$newvalue != ""} {
	    # Change this to a valid decimal string (trim leading 0)
	    #
	    regsub {^[0]*} $newvalue "" newvalue
	    if [catch {expr 0+$newvalue}] {
		set newvalue 0
		set data(-value) 0
		set changed 1
	    }
	    if {$newvalue == ""} {
		set newvalue 0
	    }

	    if [tixGetBoolean -nocomplain $data(-integer)] {
		set data(-value) [tixGetInt -nocomplain $newvalue]
	    } else {
		if [catch {set data(-value) [format "%d" $newvalue]}] {
		    if [catch {set data(-value) [expr $newvalue+0.0]}] {
			set data(-value) $oldvalue
		    }
		}
	    }
	    
	    # Now perform boundary checking
	    #
	    if {$data(-max) != "" && $data(-value) > $data(-max)} {
		set data(-value) $data(-max)
	    }
	    if {$data(-min) != "" && $data(-value) < $data(-min)} {
		set data(-value) $data(-min)
	    }
	}
    }

    if {! $noUpdate} {
	tixVariable:UpdateVariable $w
    }

    if {$forced || "x$newvalue" != "x$data(-value)" || $changed} {
	$data(w:entry) delete 0 end
	$data(w:entry) insert 0 $data(-value)
	$data(w:entry) icursor $oldCursor
	if {[info exists oldSelection]} {
	    eval $data(w:entry) selection range $oldSelection
	}
    }

    if {!$data(-disablecallback) && $data(-command) != ""} {
	if {![info exists data(varInited)]} {
	    set bind(specs) ""
	    tixEvalCmdBinding $w $data(-command) bind $data(-value)
	}
    }
}

proc tixControl:Invoke {w forced} {
    upvar #0 $w data

    catch {
	unset data(edited)
    }

    if {[catch {$data(w:entry) index sel.first}] == 0} {
	# THIS ENTRY OWNS SELECTION --> TURN IT OFF
	#
	$data(w:entry) select from end
	$data(w:entry) select to   end
    }

    tixControl:SetValue $w [$data(w:entry) get] 0 $forced
}

#----------------------------------------------------------------------
# The three functions StartRepeat, Repeat and StopRepeat make use of the
# data(serial) variable to discard spurious repeats: If a button is clicked
# repeatedly but is not hold down, the serial counter will increase
# successively and all "after" time event handlers will be discarded
#----------------------------------------------------------------------
proc tixControl:StartRepeat {w amount} {
    if {![winfo exists $w]} {
	return
    }

    upvar #0 $w data

    if {[catch {$data(w:entry) index sel.first}] == 0} {
	$data(w:entry) select from end
	$data(w:entry) select to   end
    }

    if [info exists data(edited)] {
	unset data(edited)
	tixControl:SetValue $w [$data(w:entry) get] 0 1
    }

    incr data(serial)

    tixControl:AdjustValue $w $amount

    if {$data(-autorepeat)} {
	after $data(-initwait) tixControl:Repeat $w $amount $data(serial)
    }

    focus $data(w:entry)
}

proc tixControl:Repeat {w amount serial} {
    if {![winfo exists $w]} {
	return
    }
    upvar #0 $w data

    if {$serial == $data(serial)} {
	tixControl:AdjustValue $w $amount

	if {$data(-autorepeat)} {
	   after $data(-repeatrate) tixControl:Repeat $w $amount $data(serial)
	}
    }
}

proc tixControl:StopRepeat {w} {
    upvar #0 $w data

    incr data(serial)
}

proc tixControl:Destructor {w} {

    tixVariable:DeleteVariable $w

    # Chain this to the superclass
    #
    tixChainMethod $w Destructor
}

# ToDo: maybe should return -code break if the value is not good ...
#
proc tixControl:Tab {w detail} {
    upvar #0 $w data

    if {![info exists data(edited)]} {
	return
    } else {
	unset data(edited)
    }

    tixControl:invoke $w
}

proc tixControl:Escape {w} {
    upvar #0 $w data

    $data(w:entry) delete 0 end
    $data(w:entry) insert 0 $data(-value)
}

proc tixControl:KeyPress {w} {
    upvar #0 $w data

    if {$data(-selectmode) == "normal"} {
	set data(edited) 0
	return
    } else {
	# == "immediate"
	after 1 tixControl:invoke $w
    }
}

 # DefSchm.tcl --
#
#	Implements the default color and font schemes for Tix.
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

proc tixSetDefaultFontset {} {
    global tixOption

    set tixOption(font)         -Adobe-Helvetica-Medium-R-Normal--*-120-*
    set tixOption(bold_font)    -Adobe-Helvetica-Bold-R-Normal--*-120-*
    set tixOption(menu_font)    -Adobe-Helvetica-Bold-R-Normal--*-120-*
    set tixOption(italic_font)  -Adobe-Helvetica-Bold-O-Normal--*-120-*
    set tixOption(fixed_font)   -*-courier-medium-r-*-*-14-*-*-*-*-*-*-*
}

proc tixSetDefaultScheme-Color {} {
    global tixOption

    set tixOption(bg)           #d9d9d9
    set tixOption(fg)           black

    set tixOption(dark1_bg)     #c3c3c3
    set tixOption(dark1_fg)     black
    set tixOption(dark2_bg)     #a3a3a3
    set tixOption(dark2_fg)     black
    set tixOption(inactive_bg)  #a3a3a3
    set tixOption(inactive_fg)  black

    set tixOption(light1_bg)    #ececec
    set tixOption(light1_fg)    white
    set tixOption(light2_bg)    #fcfcfc
    set tixOption(light2_fg)    white

    set tixOption(active_bg)    $tixOption(dark1_bg)
    set tixOption(active_fg)    $tixOption(fg)
    set tixOption(disabled_fg)  gray55

    set tixOption(input1_bg)    #d9d9d9
    set tixOption(input2_bg)    #d9d9d9
    set tixOption(output1_bg)   $tixOption(dark1_bg)
    set tixOption(output2_bg)   $tixOption(bg)

    set tixOption(select_fg)    black
    set tixOption(select_bg)    #c3c3c3

    set tixOption(selector)	#b03060
}

proc tixSetDefaultScheme-Mono {} {

    global tixOption

    set tixOption(bg)           lightgray
    set tixOption(fg)           black

    set tixOption(dark1_bg)     gray70
    set tixOption(dark1_fg)     black
    set tixOption(dark2_bg)     gray60
    set tixOption(dark2_fg)     white
    set tixOption(inactive_bg)  lightgray
    set tixOption(inactive_fg)  black

    set tixOption(light1_bg)    gray90
    set tixOption(light1_fg)    white
    set tixOption(light2_bg)    gray95
    set tixOption(light2_fg)    white

    set tixOption(active_bg)    gray90
    set tixOption(active_fg)    $tixOption(fg)
    set tixOption(disabled_fg)  gray55

    set tixOption(input1_bg)    $tixOption(light1_bg)
    set tixOption(input2_bg)    $tixOption(light1_bg)
    set tixOption(output1_bg)   $tixOption(light1_bg)
    set tixOption(output2_bg)   $tixOption(light1_bg)

    set tixOption(select_fg)    white
    set tixOption(select_bg)    black

    set tixOption(selector)	black
}

 # DialogS.tcl --
#
#
#	Implements the DialogShell widget. It tells the window
#	manager that it is a dialog window and should be treated specially.
#	The exact treatment depends on the treatment of the window
#	manager
#
# Copyright (c) 1994-1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

tixWidgetClass tixDialogShell {
    -superclass tixShell
    -classname  TixDialogShell
    -method {
	popdown popup center
    }
    -flag   {
	-mapped -minheight -minwidth -parent -transient
    }
    -static {}
    -configspec {
	{-mapped mapped Mapped 0}
	{-minwidth minWidth MinWidth 0}
	{-minheight minHeight MinHeight 0}
	{-transient transient Transient true}
	{-parent parent Parent ""}
    }
}

#----------------------------------------------------------------------
#		Construct widget
#----------------------------------------------------------------------

proc tixDialogShell:ConstructWidget {w} {
    upvar #0 $w data

    tixChainMethod $w ConstructWidget

    # Set the title of this shell appropriately
    #
    if {$data(-title) == ""} {
	# dynamically sets the title
	#
	set data(-title) [winfo name $w]
    }
    wm title $w $data(-title)

    # Set the parent of this dialog shell
    #
    if {$data(-parent) == ""} {
	set data(-parent) [winfo parent $w]
    }

    # Set the minsize and maxsize of the thing
    #
    wm minsize $w $data(-minwidth) $data(-minheight)
}

# The next procedures manage the dialog boxes
#
proc tixDialogShell:popup {w {parent ""}} {
    upvar #0 $w data

    # First update to make sure the boxes are the right size
    #
    update idletask

    # Then we set the position and update
    #
    tixDialogShell:center $w $parent

    # and now make it visible. Viola!  Centered over parent.
    #
    wm deiconify $w
}

# This procedure centers a dialog box over a window making sure that the 
# dialog box doesn't appear off the screen
#
# However, if the parent is smaller than this dialog, make this dialog
# appear at parent(x,y) + (20,20)
#
proc tixDialogShell:center {w {parent ""}} {
    upvar #0 $w data

    # Tell the WM that we'll do this ourselves.
    wm sizefrom $w user
    wm positionfrom $w user

    if {$parent == ""} {
	set parent $data(-parent)
    }
    if [catch {set parent [winfo toplevel $parent]}] {
	set parent "."
    }

    # Where is my parent and what are it's dimensions
    #
    if {$parent != ""} {
	set pargeo [split [wm geometry $parent] "+x"]
	set parentW [lindex $pargeo 0]
	set parentH [lindex $pargeo 1]
	set parx [lindex $pargeo 2]
	set pary [lindex $pargeo 3]

	if {[tixGetBoolean -nocomplain $data(-transient)]} {
	    wm transient $w $parent
	}
    } else {
	set parentW [winfo screenwidth $w]
	set parentH [winfo screenheight $w]
	set parx 0
	set pary 0
	set parent [winfo parent $w]
    }

    # What are is the offset of the virtual window
    set vrootx [winfo vrootx $parent]
    set vrooty [winfo vrooty $parent]

    # What are my dimensions ?
    set dialogW [winfo reqwidth $w]
    set dialogH [winfo reqheight $w]

    if {$dialogW < [expr $parentW-30] || $dialogW < [expr $parentH-30]} {
	set dialogx [expr $parx+($parentW-$dialogW)/2+$vrootx]
	set dialogy [expr $pary+($parentH-$dialogH)/2+$vrooty]
    } else {
	# This dialog is too big. Place it at (parentx, parenty) + (20,20)
	#
	set dialogx [expr $parx+20+$vrootx]
	set dialogy [expr $pary+20+$vrooty]
    }

    set maxx [expr "[winfo screenwidth  $parent] - $dialogW"]
    set maxy [expr "[winfo screenheight $parent] - $dialogH"]

    # Make sure it doesn't go off screen
    #
    if {$dialogx < 0} {
	set dialogx 0
    } else {
	if {$dialogx > $maxx} {
	    set dialogx $maxx
	}
    }
    if {$dialogy < 0} {
	set dialogy 0
    } else {
	if {$dialogy > $maxy} {
	    set dialogy $maxy
	}
    }

    # set my new position (and dimensions)
    #
    if {[wm geometry $w] == "1x1+0+0"} {
	wm geometry $w $dialogW\x$dialogH\+$dialogx\+$dialogy
    }
}

proc tixDialogShell:popdown {w args} {
    wm withdraw $w
}


 # DirBox.tcl --
#
#	Implements the tixDirSelectBox widget.
#
# 	   - overrides the -browsecmd and -command options of the
#	     HList subwidget
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

tixWidgetClass tixDirSelectBox {
    -classname TixDirSelectBox
    -superclass tixPrimitive
    -method {
    }
    -flag {
	-command -disablecallback -value
    }
    -configspec {
	{-command command Command ""}
	{-disablecallback disableCallback DisableCallback 0 tixVerifyBoolean}
	{-label label Label "Directory:"}
	{-value value Value ""}
    }
    -forcecall {
	-value -label
    }
    -default {
	{*combo*listbox.height 		5}
	{*combo.label.anchor		w}
	{*combo.labelSide		top}
	{*combo.hostory			true}
	{*combo.historyLimit		20}
    }
}

proc tixDirSelectBox:InitWidgetRec {w} {
    upvar #0 $w data
    tixChainMethod $w InitWidgetRec
}

proc tixDirSelectBox:ConstructWidget {w} {
    upvar #0 $w data

    tixChainMethod $w ConstructWidget
    set data(w:dircbx) [tixFileComboBox $w.dircbx]
    set data(w:dirlist)  [tixDirList $w.dirlist]

    pack $data(w:dircbx) -side top -fill x -padx 4 -pady 2
    pack $data(w:dirlist) -side top -fill both -expand yes -padx 4 -pady 2

    if ![string comp $data(-value) ""] {
	set data(-value) [tixFSPWD]
    }
}

proc tixDirSelectBox:SetBindings {w} {
    upvar #0 $w data

    tixChainMethod $w SetBindings

    $data(w:dircbx) config -command "tixDirSelectBox:Cmd-DirCbx $w"
    $data(w:dirlist) config -command "tixDirSelectBox:Cmd-DirList $w" 	-browsecmd "tixDirSelectBox:Browse-DirList $w"
}

#----------------------------------------------------------------------
# Incoming event: User
#----------------------------------------------------------------------

# User activates the FileComboBox
#
#
proc tixDirSelectBox:Cmd-DirCbx {w args} {
    upvar #0 $w data

    set fInfo [tixEvent value]
    set path [lindex $fInfo 0]

    if {![file exists $path]} {
	tk_dialog .tix_error "" "Directory \"$path\" does not exist."  	    error 0 Ok
	$data(w:dircbx) config  	    -text [tixFSDisplayName [tixFSNormDir $data(-value)]]  	    -directory $data(-value)
	return

	#
	# The following code is not used because directories cannot be created
	# on Windows
	#

	# 1.1 Check for validity. The pathname cannot contain invalid chars
	#
	if ![tixFSIsValid $path] {
	    tk_dialog .tix_error "Error"  		"\"$path\" is not a valid directory name"  		error 0 Ok
	    $data(w:dircbx) config  		-text [tixFSDisplayName [tixFSNormDir $data(-value)]]  		-directory $data(-value)
	    return
	}

	# 1.2 Prompt for creation
	#
	set choice [tk_dialog .tix_error ""  	    "Directory \"$path\" does not exist. Do you want to create it?"  	    question 1 Yes No]
	if {$choice == 1} {
	    $data(w:dircbx) config  		-text [tixFSDisplayName [tixFSNormDir $data(-value)]]  		-directory $data(-value)
	    return
	} else {
	    if ![tixFSCreateDirs $path] {
		tk_dialog .tix_error "Error"  		    "Cannot create directory \"$path\". Permission denied"  		    error 0 Ok
		$data(w:dircbx) config  		    -text [tixFSDisplayName [tixFSNormDir $data(-value)]]  		    -directory $data(-value)
		return
	    }
	    tixDirSelectBox:SetValue $w $path 1 1
	}
    } elseif {![file isdirectory $path]} {
	# 2.1: Can't choose a non-directory file
	#
	tk_dialog .tix_error "Error"  	    "\"$path\" is not a directory."  	    error 0 Ok
	$data(w:dircbx) config  	    -text [tixFSDisplayName [tixFSNormDir $data(-value)]]  	    -directory $data(-value)
	return
    } else {
	# OK. It is an existing directory
	#
	tixDirSelectBox:SetValue $w $path 1 1
    }
}

# User activates the dir list
#
#
proc tixDirSelectBox:Cmd-DirList {w args} {
    upvar #0 $w data

    set dir $data(-value)
    catch {
	set dir [tixEvent flag V]
    }
    set dir [tixFSNormDir $dir]
    tixDirSelectBox:SetValue $w $dir 0 0
}

# User browses the dir list
#
#
proc tixDirSelectBox:Browse-DirList {w args} {
    upvar #0 $w data

    set dir $data(-value)
    catch {
	set dir [tixEvent flag V]
    }
    set dir [tixFSNormDir $dir]
    tixDirSelectBox:SetValue $w $dir 0 0
}

#----------------------------------------------------------------------
# Incoming event: Application
#----------------------------------------------------------------------
proc tixDirSelectBox:config-value {w value} {
    upvar #0 $w data
    set value [tixFSNormDir $value]

    tixDirSelectBox:SetValue $w $value 1 1
    return $value
}

proc tixDirSelectBox:config-label {w value} {
    upvar #0 $w data

    $data(w:dircbx) subwidget combo config -label $value
}

#----------------------------------------------------------------------
#
#			Internal functions
#
#----------------------------------------------------------------------

# Arguments:
#	callback:Bool	Should we invoke the the -command.
# 	setlist:Bool	Should we set the -value of the DirList subwidget.
#
proc tixDirSelectBox:SetValue {w dir callback setlist} {
    upvar #0 $w data

    set data(-value) $dir
    $data(w:dircbx) config -text [tixFSDisplayName $dir]  	-directory [tixFSDisplayName $dir] 
    if {$setlist && [file isdirectory $dir]} {
	tixSetSilent $data(w:dirlist) $dir
    }

    if {$callback} {
	if {!$data(-disablecallback) && ![tixStrEq $data(-command) ""]} {
	    set bind(specs) {%V}
	    set bind(%V)    $data(-value)

	    tixEvalCmdBinding $w $data(-command) bind $data(-value)
	}
    }
}

 # DirDlg.tcl --
#
#	Implements the Directory Selection Dialog widget.
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

tixWidgetClass tixDirSelectDialog {
    -classname TixDirSelectDialog
    -superclass tixDialogShell
    -method {}
    -flag   {
	-command
    }
    -configspec {
	{-command command Command ""}
	{-title title Title "Select A Directory"}
    }

    -default {
	{*ok.text		"OK"}
	{*ok.underline		0}
	{*ok.width		6}
	{*cancel.text		"Cancel"}
	{*cancel.underline	0}
	{*cancel.width		6}
	{*dirbox.borderWidth	1}
	{*dirbox.relief		raised}
    }
}

proc tixDirSelectDialog:ConstructWidget {w} {
    upvar #0 $w data

    tixChainMethod $w ConstructWidget

    # the buttons
    frame $w.f -relief raised -bd 1
    set data(w:ok)     [button $w.f.ok -command  	"tixDirSelectDialog:OK $w"]
    set data(w:cancel) [button $w.f.cancel -command  	"tixDirSelectDialog:Cancel $w"]

    pack $data(w:ok) $data(w:cancel) -side left -expand yes -padx 10 -pady 8
    pack $w.f -side bottom -fill x
    # the dir select box
    set data(w:dirbox) [tixDirSelectBox $w.dirbox  	-command "tixDirSelectDialog:DirBoxCmd $w"]
    pack $data(w:dirbox) -expand yes -fill both
}

proc tixDirSelectDialog:SetBindings {w} {
    upvar #0 $w data

    tixChainMethod $w SetBindings

    bind $w <Alt-Key-d> "focus [$data(w:dirbox) subwidget dircbx]"
}

proc tixDirSelectDialog:OK {w} {
    upvar #0 $w data

    wm withdraw $w
    $data(w:dirbox) subwidget dircbx invoke
}

proc tixDirSelectDialog:DirBoxCmd {w args} {
    upvar #0 $w data

    set value [tixEvent flag V]
    wm withdraw $w
    tixDirSelectDialog:CallCmd $w $value
}

proc tixDirSelectDialog:CallCmd {w value} {
    upvar #0 $w data

    if {$data(-command) != ""} {
	set bind(specs) "%V"
	set bind(%V) $value
	tixEvalCmdBinding $w $data(-command) bind $value
    }
}

proc tixDirSelectDialog:Cancel {w} {
    wm withdraw $w
}

 # DirList.tcl --
#
#	Implements the tixDirList widget.
#
# 	   - overrides the -browsecmd and -command options of the
#	     HList subwidget
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

tixWidgetClass tixDirList {
    -classname TixDirList
    -superclass tixScrolledHList
    -method {
	chdir
    }
    -flag {
	 -browsecmd -command -dircmd -disablecallback 
	 -root -rootname -showhidden -value
    }
    -configspec {
	{-browsecmd browseCmd BrowseCmd ""}
	{-command command Command ""}
	{-dircmd dirCmd DirCmd ""}
	{-disablecallback disableCallback DisableCallback 0 tixVerifyBoolean}
	{-root root Root ""}
	{-rootname rootName RootName ""}
	{-showhidden showHidden ShowHidden 0 tixVerifyBoolean}
	{-value value Value ""}
    }
    -default {
	{.scrollbar			auto}
	{*borderWidth			1}
	{*hlist.background		#c3c3c3}
	{*hlist.indent			7}
	{*hlist.relief			sunken}
	{*hlist.height			10}
	{*hlist.width			20}
	{*hlist.padX			2}
	{*hlist.padY			0}
	{*hlist.wideSelection		0}
	{*hlist.drawBranch		0}
	{*hlist.highlightBackground	#d9d9d9}
	{*hlist.itemType		imagetext}
	{*hlist.takeFocus		1}
    }
    -forcecall {
	-value
    }
}

# Important data members:
#
# data(vpath)
#	The currently selected vpath. This internal variable is useful on
#	the Win95 platform, where an directory may correspond to more than
#	one node in the hierarchy. For example, C:\Windows\Desktop\Foo
#	can appead as "Desktop\Foo" and
#	"Desktop\My Computer\C:\Windows\Desktop\Foo". This variable tells us
#	which icon should we show given the same DOS pathname.
#

proc tixDirList:InitWidgetRec {w} {
    upvar #0 $w data

    tixChainMethod $w InitWidgetRec
}

proc tixDirList:ConstructWidget {w} {
    upvar #0 $w data

    tixChainMethod $w ConstructWidget

    $data(w:hlist) config  	-separator [tixFSSep]  	-selectmode "single"

    # We must creat an extra copy of these images to avoid flashes on
    # the screen when user changes directory
    #
#    set data(images) [image create compound -window $data(w:hlist)]
#    $data(images) add image -image [tix getimage act_fold]
#    $data(images) add image -image [tix getimage folder]
#    $data(images) add image -image [tix getimage openfold]
}

proc tixDirList:SetBindings {w} {
    upvar #0 $w data

    tixChainMethod $w SetBindings

    $data(w:hlist) config  	-browsecmd "tixDirList:Browse $w"  	-command "tixDirList:Command $w"

    if [tixStrEq $data(-value) ""] {
	set data(-value) [tixFSPWD]
    }
    if [catch {
	set data(vpath) [tixFSVPath [tixFSNormDir $data(-value)]]
    }] {
	set data(vpath) [tixFSVPath [tixFSNormDir [tixFSPWD]]]
    }
}

#----------------------------------------------------------------------
# Incoming-Events
#----------------------------------------------------------------------
proc tixDirList:Browse {w args} {
    upvar #0 $w data

    uplevel #0 set TRANSPARENT_GIF_COLOR [$data(w:hlist) cget -bg]
    set vpath [tixEvent flag V]
    set value [$data(w:hlist) info data $vpath]

    tixDirList:HighLight $w $vpath

    set data(vpath)  $vpath
    set data(-value) $value

    tixDirList:CallBrowseCmd $w $data(-value)
}

proc tixDirList:Command {w args} {
    upvar #0 $w data

    set vpath [tixEvent value]
    set value [$data(w:hlist) info data $vpath]
    set data(-value) $value

    tixDirList:LoadDir $w [tixFSNormDir $value] $vpath
    tixDirList:HighLight $w $vpath

    set data(vpath) $vpath
    tixDirList:CallCommand $w $data(-value)
}

#----------------------------------------------------------------------
# Outgoing-Events
#----------------------------------------------------------------------

proc tixDirList:CallBrowseCmd {w value} {
    upvar #0 $w data

    if {$data(-browsecmd) != ""} {
	set bind(specs) "%V"
	set bind(%V) $value
	tixEvalCmdBinding $w $data(-browsecmd) bind $value
    }
}

proc tixDirList:CallCommand {w value} {
    upvar #0 $w data

    if {$data(-command) != "" && !$data(-disablecallback)} {
	set bind(specs) "%V"
	set bind(%V) $value
	tixEvalCmdBinding $w $data(-command) bind $value
    }
}

#----------------------------------------------------------------------
# 		Directory loading
#----------------------------------------------------------------------
proc tixDirList:LoadDir {w {npath ""} {vpath ""}} {
    upvar #0 $w data

    tixBusy $w on $data(w:hlist)

    $data(w:hlist) delete all

    if {![string compare $npath ""]} {
	set npath [tixFSNormDir $data(-value)]
	set vpath [tixFSVPath $npath]
    }

    tixDirList:ListHierachy $w $npath $vpath
    tixDirList:ListSubDirs $w $npath $vpath

    tixWidgetDoWhenIdle tixBusy $w off $data(w:hlist)
}

proc tixDirList:ListHierachy {w dir vpath} {
    upvar #0 $w data
    uplevel #0 set TRANSPARENT_GIF_COLOR [$data(w:hlist) cget -bg]

    foreach p [tixFSSplit $vpath] {
	set vpath [lindex $p 0]
	set text  [lindex $p 1]
	set path  [lindex $p 2]

	$data(w:hlist) add $vpath -text $text -data $path  	    -image [tix getimage openfold]
    }
}

proc tixDirList:ListSubDirs {w dir vpath} {
    upvar #0 $w data
    uplevel #0 set TRANSPARENT_GIF_COLOR [$data(w:hlist) cget -bg]

    $data(w:hlist) entryconfig $vpath  	-image [tix getimage act_fold]

    foreach ent [tixFSListDir $vpath 1 0 0 $data(-showhidden)] {
	set vp   [lindex $ent 0]
	set name [lindex $ent 1]
	set path [lindex $ent 2]

	$data(w:hlist) add $vp -text $name -data $path  	    -image [tix getimage folder]
    }
}

proc tixDirList:SetValue {w npath vpath {flag ""}} {
    upvar #0 $w data

    if {![string compare $flag reload] ||
	![$data(w:hlist) info exists $vpath]} {
    	tixDirList:LoadDir $w $npath $vpath
    }

    tixDirList:HighLight $w $vpath

    set data(-value) [tixFSDisplayName $npath]
    set data(vpath) $vpath
    tixDirList:CallCommand $w $data(-value)
}

proc tixDirList:HighLight {w vpath} {
    upvar #0 $w data

    if {![tixStrEq $data(vpath) $vpath]} {
	set old $data(vpath)

	if [$data(w:hlist) info exists $old] {
	    # Un-highlight the originally selected entry by changing its
	    # folder image

	    if {[$data(w:hlist) info children $old] == ""} {
		$data(w:hlist) entryconfig $old 		    -image [tix getimage folder]
	    } else {
		$data(w:hlist) entryconfig $old 		    -image [tix getimage openfold]
	    }
	}
    }

    # Highlight the newly selected entry
    #
    $data(w:hlist) entryconfig $vpath  	-image [tix getimage act_fold]
    $data(w:hlist) anchor set $vpath
    $data(w:hlist) select clear
    $data(w:hlist) select set $vpath
    $data(w:hlist) see $vpath
}

#----------------------------------------------------------------------
# Config options
#----------------------------------------------------------------------
proc tixDirList:config-value {w value} {
    upvar #0 $w data

    tixDirList:chdir $w $value
    return $data(-value)
}

proc tixDirList:config-showhidden {w value} {
    upvar #0 $w data

    tixWidgetDoWhenIdle tixDirList:LoadDir $w
}

#----------------------------------------------------------------------
# Public methods
#----------------------------------------------------------------------
proc tixDirList:chdir {w value} {
    upvar #0 $w data

    set path [tixFSNormDir $value]
    tixDirList:SetValue $w $path [tixFSVPath $path]
}

 # DirTree.tcl --
#
#	Implements directory tree for Unix file systems
#
#       What the indicators mean:
#
#	(+): There are some subdirectories in this directory which are not
#	     currently visible.
#	(-): This directory has some subdirectories and they are all visible
#
#      none: The dir has no subdirectori(es).
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

tixWidgetClass tixDirTree {
    -classname TixDirTree
    -superclass tixVTree
    -method {
	activate chdir refresh
    }
    -flag {
	-browsecmd -command -directory -disablecallback -showhidden -value
    }
    -configspec {
	{-browsecmd browseCmd BrowseCmd ""}
	{-command command Command ""}
	{-disablecallback disableCallback DisableCallback 0 tixVerifyBoolean}
	{-showhidden showHidden ShowHidden 0 tixVerifyBoolean}
	{-value value Value ""}
    }
    -alias {
	{-directory -value}
    }
    -default {
	{.scrollbar			auto}
	{*Scrollbar.background          #d9d9d9}
	{*Scrollbar.relief              sunken}
	{*Scrollbar.takeFocus           0}
	{*Scrollbar.troughColor         #c3c3c3}
	{*Scrollbar.width               15}
	{*borderWidth                   1}
	{*hlist.indicator               1}
	{*hlist.background              #c3c3c3}
	{*hlist.drawBranch              1}
	{*hlist.height                  10}
	{*hlist.highlightBackground      #d9d9d9}
	{*hlist.indent                  20}
	{*hlist.itemType                imagetext}
	{*hlist.padX                    3}
	{*hlist.padY                    0}
	{*hlist.relief                  sunken}
	{*hlist.takeFocus               1}
	{*hlist.wideSelection           0}
	{*hlist.width                   20}
    }
}

proc tixDirTree:InitWidgetRec {w} {
    upvar #0 $w data

    tixChainMethod $w InitWidgetRec

    if {$data(-value) == ""} {
	global env
	if {[info exists env(PWD)]} {
	    set data(-value) $env(PWD)
	} else {
	    set data(-value) [pwd]
	}
    }

    tixDirTree:SetDir $w [tixFileIntName $data(-value)]
}

proc tixDirTree:ConstructWidget {w} {
    upvar #0 $w data

    tixChainMethod $w ConstructWidget
    tixDoWhenMapped $w "tixDirTree:StartUp $w"

    $data(w:hlist) config  	-separator [tixDirSep]  	-selectmode "single" -drawbranch 1

    # We must creat an extra copy of these images to avoid flashes on
    # the screen when user changes directory
    #
    set data(images) [image create compound -window $data(w:hlist)]
    $data(images) add image -image [tix getimage act_fold]
    $data(images) add image -image [tix getimage folder]
    $data(images) add image -image [tix getimage openfold]
}

proc tixDirTree:SetBindings {w} {
    upvar #0 $w data

    tixChainMethod $w SetBindings

# %% do I still need this?
#   bind $data(w:hlist) <3> "tixDirTree:DeleteSib $w %x %y"
}

# This procedure is supposed to "trim" the directory tree view to
# just the current directory and its ancestors.
#
#proc tixDirTree:DeleteSib {w x y} {
#    upvar #0 $w data
#
#    set ent [$data(w:hlist) nearest $y]
#
#    if {$ent != ""} {
#	$data(w:hlist) anchor set $ent
#
#	for {set e $ent} {$e != "/"} {set e [$data(w:hlist) info parent $e]} {
#	    $data(w:hlist) delete siblings $e
#	}
#	tixDirTree:Browse $w $ent
#    }
#}

# %% This functions needs to be optimized
#
#
proc tixDirTree:HasSubDir {w dir} {
    upvar #0 $w data

    if {[tixListDir $dir 1 0 0 $data(-showhidden)] != ""} {
	return 1
    } else {
	return 0
    }
}


# Add one dir into the parent directory, sorted alphabetically
#
proc tixDirTree:AddToList {w dir parent name image} {
    upvar #0 $w data

    set added 0
    foreach sib [$data(w:hlist) info children $parent] {
	if {[string compare $dir $sib] < 0} {
	    $data(w:hlist) add $dir -before $sib -text $name -image $image
	    set added 1
	    break
	}
    }
    if !$added {
	$data(w:hlist) add $dir -text $name -image $image
    }

    if [tixDirTree:HasSubDir $w $dir] {
	tixVTree:SetMode $w $dir open
    }
}

# Add $dir and all ancestors of $dir into the HList widget
#
#
proc tixDirTree:AddAncestors {w dir} {
    upvar #0 $w data
    uplevel #0 set TRANSPARENT_GIF_COLOR [$data(w:hlist) cget -bg]

    set path ""
    set parent ""
    foreach name [tixFileSplit $dir] {
	set path [tixSubFolder $path $name]
	if {![$data(w:hlist) info exists $path]} {
	    tixDirTree:AddToList $w $path $parent [tixFileDisplayName $path]  		[tix getimage openfold]
	}
	set parent $path
    }
}

# Add all the sub directories of $dir into the HList widget
#
#
proc tixDirTree:ListDirs {w dir} {
    upvar #0 $w data
    uplevel #0 set TRANSPARENT_GIF_COLOR [$data(w:hlist) cget -bg]

    tixBusy $w on $data(w:hlist)

    foreach name [tixListDir $dir 1 0 0 $data(-showhidden)] {
	set subdir [tixSubFolder $dir $name]
	if {![$data(w:hlist) info exists $subdir]} {
	    tixDirTree:AddToList $w $subdir $dir [tixFileDisplayName $subdir]  		[tix getimage folder]
	}
    }

    tixWidgetDoWhenIdle tixBusy $w off $data(w:hlist)
}

proc tixDirTree:LoadDir {w dir {mode toggle}} {
    if {![winfo exists $w]} {
	return
    }

    upvar #0 $w data
    uplevel #0 set TRANSPARENT_GIF_COLOR [$data(w:hlist) cget -bg]

    # Add the directory and set it to the active directory
    #
    if ![$data(w:hlist) info exists $dir] {
	tixDirTree:AddAncestors $w $dir
    }
    $data(w:hlist) entryconfig $dir -image [tix getimage act_fold]

    if {$mode == "toggle"} {
	if {[$data(w:hlist) info children $dir] == ""} {
	    set mode expand
	} else {
	    set mode flatten
	}
    }

    if {$mode == "expand"} {
	tixDirTree:ListDirs $w $dir
	if {[$data(w:hlist) info children $dir] == ""} {
	    tixVTree:SetMode $w $dir none
	} else {
	    tixVTree:SetMode $w $dir close
	}
    } else {
	$data(w:hlist) delete offsprings $dir
	tixVTree:SetMode $w $dir open
    }
}

proc tixDirTree:ToggleDir {w value mode} {
    upvar #0 $w data

    tixDirTree:LoadDir $w $value $mode
    tixDirTree:CallCommand $w
}

proc tixDirTree:CallCommand {w} {
    upvar #0 $w data

    if {$data(-command) != "" && !$data(-disablecallback)} {
	set bind(specs) {%V}
	set bind(%V)    $data(-value)

	tixEvalCmdBinding $w $data(-command) bind $data(-value)
    }
}

proc tixDirTree:CallBrowseCmd {w ent} {
    upvar #0 $w data

    if {$data(-browsecmd) != "" && !$data(-disablecallback)} {
	set bind(specs) {%V}
	set bind(%V)    $data(-value)

	tixEvalCmdBinding $w $data(-browsecmd) bind [list $data(-value)]
    }
}

proc tixDirTree:StartUp {w} {
    if {![winfo exists $w]} {
	return
    }

    upvar #0 $w data

    tixDirTree:LoadDir $w $data(i-directory)
}

proc tixDirTree:ChangeDir {w value {forced 0}} {
    upvar #0 $w data

    if {!$forced && $data(i-directory) == $value} {
	return
    }
    uplevel #0 set TRANSPARENT_GIF_COLOR [$data(w:hlist) cget -bg]

    if {!$forced && [$data(w:hlist) info exists $value]} {
	# Set the old directory to "non active"
	#
	if [$data(w:hlist) info exists $data(i-directory)] {
	    $data(w:hlist) entryconfig $data(i-directory)  		-image [tix getimage folder]
	}

	$data(w:hlist) entryconfig $value   		-image [tix getimage act_fold]

    } else {
	if {$forced} {
	    if {[$data(w:hlist) info children $value] == ""} {
		set mode flatten
	    } else {
		set mode expand
	    }
	} else {
	    set mode toggle
	}
	tixDirTree:LoadDir $w $value $mode
	tixDirTree:CallCommand $w
    }
    tixDirTree:SetDir $w $value
}


proc tixDirTree:SetDir {w intName} {
    upvar #0 $w data

    set data(i-directory) $intName
    set data(-value)  [tixNativeName $intName]
}

#----------------------------------------------------------------------
#
# Virtual Methods
#
#----------------------------------------------------------------------
proc tixDirTree:OpenCmd {w ent} {
    tixDirTree:ToggleDir $w $ent expand
    tixDirTree:ChangeDir $w $ent
    tixDirTree:CallBrowseCmd $w $ent
}

proc tixDirTree:CloseCmd {w ent} {
    tixDirTree:ToggleDir $w $ent flatten
    tixDirTree:ChangeDir $w $ent
    tixDirTree:CallBrowseCmd $w $ent
}

proc tixDirTree:Command {w B} {
    upvar #0 $w data
    upvar $B bind

    set ent [tixEvent flag V]
    tixChainMethod $w Command $B

    if {$data(-command) != ""} {
	tixEvalCmdBinding $w $data(-command) bind $ent
    }
}

# This is a virtual method
#
proc tixDirTree:BrowseCmd {w B} {
    upvar #0 $w data
    upvar $B bind
    
    set ent [tixEvent flag V]

#    if {[$data(w:hlist) indicator exist $ent] && 
#	[$data(w:hlist) info children $ent] == ""} {
#	
#	tixVTree:Activate $w $ent open
#   }

    if {[string index $ent 0] != "/"} {
        # This is a hack because %V may have been modified by
	# callbrowsecmd ....
        set ent [tixFileIntName $ent]
    } 
    tixDirTree:ChangeDir $w $ent
    tixDirTree:CallBrowseCmd $w $ent
}

#----------------------------------------------------------------------
#
# Public Methods
#
#----------------------------------------------------------------------
proc tixDirTree:chdir {w value} {
    tixDirTree:ChangeDir $w [tixFileIntName $value]
}

proc tixDirTree:refresh {w {dir ""}} {
    upvar #0 $w data

    if {$dir == ""} {
	set dir $data(-value)
    }

    tixDirTree:ChangeDir $w [tixFileIntName $dir] 1


    # Delete any stale directories that no longer exist
    #
    foreach sub [$data(w:hlist) info children [tixFileIntName $dir]] {
	if {![file exists [tixNativeName $sub]]} {
	    $data(w:hlist) delete entry $sub
	}
    }
}

proc tixDirTree:config-directory {w value} {
    tixDirTree:ChangeDir $w [tixFileIntName $value]
}

 # DragDrop.tcl ---
#
#	Implements drag+drop for Tix widgets.
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

tixClass tixDragDropContext {
    -superclass {}
    -classname  TixDragDropContext
    -method {
	cget configure drag drop set startdrag
    }
    -flag {
	-command -source
    }
    -configspec {
	{-command ""}
	{-source ""}
    }
}

proc tixDragDropContext:Constructor {w} {
    upvar #0 $w data
}

#----------------------------------------------------------------------
# Private methods
#
#----------------------------------------------------------------------
proc tixDragDropContext:CallCommand {w target command X Y} {
    upvar #0 $w data
     
    set x [expr $X-[winfo rootx $target]]
    set y [expr $Y-[winfo rooty $target]]
    
    regsub %x $command $x command
    regsub %y $command $y command
    regsub %X $command $X command
    regsub %Y $command $Y command
    regsub %W $command $target command
    regsub %S $command [list $data(-command)] command

    eval $command
}

proc tixDragDropContext:Send {w target event X Y} {
    upvar #0 $w data
    global tixDrop

    foreach tag [tixDropBindTags $target] {
	if [info exists tixDrop($tag,$event)] {
	    tixDragDropContext:CallCommand $w $target  		$tixDrop($tag,$event) $X $Y
	}
    }
}

#----------------------------------------------------------------------
# set --
#
#	Set the "small data" of the type supported by the source widget
#----------------------------------------------------------------------

proc tixDragDropContext:set {w type data} {

}

#----------------------------------------------------------------------
# startdrag --
#
#	Start the dragging action
#----------------------------------------------------------------------
proc tixDragDropContext:startdrag {w x y} {
    upvar #0 $w data

    set data(oldTarget) ""

    $data(-source) config -cursor "[tix getbitmap drop] black"
    tixDragDropContext:drag $w $x $y
}

#----------------------------------------------------------------------
# drag --
#
#	Continue the dragging action
#----------------------------------------------------------------------
proc tixDragDropContext:drag {w X Y} {
    upvar #0 $w data
    global tixDrop

    set target [winfo containing $X $Y]
 
    if {$target != $data(oldTarget)} {
	if {$data(oldTarget) != ""} {
	    tixDragDropContext:Send $w $data(oldTarget) <Out> $X $Y 
	}
	if {$target != ""} {
	    tixDragDropContext:Send $w $target <In> $X $Y
	}
	set data(oldTarget) $target
    }
    if {$target != ""} {
	tixDragDropContext:Send $w $target <Over> $X $Y
    }
}

proc tixDragDropContext:drop {w X Y} {
    upvar #0 $w data
    global tixDrop

    set target [winfo containing $X $Y]
    if {$target != ""} {
	tixDragDropContext:Send $w $target <Drop> $X $Y
    }

    if {$data(-source) != ""} {
	$data(-source) config -cursor ""
    }
    set data(-source) ""
}

#----------------------------------------------------------------------
# Public Procedures -- This is NOT a member of the tixDragDropContext
#		       class!
#
# parameters :
#	$w:	who wants to start dragging? (currently ignored)
#----------------------------------------------------------------------
proc tixGetDragDropContext {w} {
    global tixDD
    if {[info exists tixDD]} {
	return tixDD
    }

    return [tixDragDropContext tixDD]
}

proc tixDropBind {w event command} {
    global tixDrop

    set tixDrop($w) 1
    set tixDrop($w,$event) $command
}

proc tixDropBindTags {w args} {
    global tixDropTags

    if {$args == ""} {
	if [info exists tixDropTags($w)] {
	    return $tixDropTags($w)
	} else {
	    return [list [winfo class $w] $w]
	}
    } else {
	set tixDropTags($w) $args
    }
}

 # DtlList.tcl --
#
#	This file implements DetailList widgets
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

tixWidgetClass tixDetailList {
    -classname TixDetailList
    -superclass tixScrolledGrid
    -method {
    }
    -flag {
	-hdrbackground
    }
    -configspec {
	{-hdrbackground hdrBackground HdrBackground #606060}
    }
    -alias {
	{-hdrbg -hdrbackground}
    }
    -default {
	{*grid.topMargin		1}
	{*grid.leftMargin		0}
    }
}


proc tixDetailList:FormatCmd {w area x1 y1 x2 y2} {
    upvar #0 $w data

    case $area {
	main {
	}
	default {
	    $data(w:grid) format border $x1 $y1 $x2 $y2  		-filled 1  		-relief raised -bd 1 -bg $data(-hdrbackground)
	}
    }
}

 # EFileBox.tcl --
#
#	Implements the Extended File Selection Box widget.
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#


#
# ToDo
#   (1)	If user has entered an invalid directory, give an error dialog
#

tixWidgetClass tixExFileSelectBox {
    -classname TixExFileSelectBox
    -superclass tixPrimitive
    -method {
	filter invoke
    }
    -flag {
	-browsecmd -command -dialog -dir -dircmd -directory 
	-disablecallback -filetypes -pattern -selection -showhidden -value
    }
    -forcecall {
	-filetypes
    }
    -configspec {
	{-browsecmd browseCmd BrowseCmd ""}
	{-command command Command ""}
	{-dialog dialog Dialog ""}
	{-dircmd dirCmd DirCmd ""}
	{-directory directory Directory ""}
	{-disablecallback disableCallback DisableCallback 0 tixVerifyBoolean}
	{-filetypes fileTypes FileTypes ""}
	{-pattern pattern Pattern *}
	{-showhidden showHidden ShowHidden 0 tixVerifyBoolean}
	{-value value Value ""}
    }
    -alias {
	{-dir -directory}
	{-selection -value}
    }

    -default {
	{*dir.label 			{Directories:}}
	{*dir.editable 			true}
	{*dir.history 			true}
	{*dir*listbox.height 		5}
	{*file.label  			Files:}
	{*file.editable 		true}
	{*file.history 			false}
	{*file*listbox.height 		5}
	{*types.label 			{List Files of Type:}}
	{*types*listbox.height 		3}
	{*TixComboBox.labelSide 	top}
	{*TixComboBox*Label.anchor 	w}
	{*dir.label.underline 		0}
	{*file.label.underline		0}
	{*types.label.underline 	14}
	{*TixComboBox.anchor 		e}
	{*TixHList.height 		7}
	{*filelist*listbox.height 	7}
	{*hidden.wrapLength 		3c}
	{*hidden.justify 		left}
    }
}

proc tixExFileSelectBox:InitWidgetRec {w} {
    upvar #0 $w data
    global env

    tixChainMethod $w InitWidgetRec

    if {$data(-directory) == ""} {
	global env

	if {[info exists env(PWD)]} {
	    set data(-directory) $env(PWD)
	} else {
	    set data(-directory) [pwd]
	}
    }
    set data(oldDir)    ""
    set data(flag)      0
}


#----------------------------------------------------------------------
#		Construct widget
#----------------------------------------------------------------------
proc tixExFileSelectBox:ConstructWidget {w} {
    upvar #0 $w data

    tixChainMethod $w ConstructWidget

    # listbox frame
    set lf [frame $w.lf]

    # The pane that contains the two listboxes
    #
    set pane  [tixPanedWindow $lf.pane -orientation horizontal]
    set fpane [$pane add 1 -size 160]
    set dpane [$pane add 2 -size 160]

    $dpane config -relief flat
    $fpane config -relief flat

    # The File List Pane
    #
    set data(w:file)  [tixComboBox $fpane.file 	-command "tixExFileSelectBox:Cmd-FileCombo $w" 	-prunehistory true  	-options {  	    label.anchor w  	}]
    set data(w:filelist) [tixScrolledListBox $fpane.filelist  	-command "tixExFileSelectBox:Cmd-FileList $w 1" 	-browsecmd "tixExFileSelectBox:Cmd-FileList $w 0"]
    pack $data(w:file)  -padx 8 -pady 4 -side top -fill x
    pack $data(w:filelist) -padx 8 -pady 4 -side top -fill both -expand yes

    # The Directory Pane
    #
    set data(w:dir)   [tixComboBox $dpane.dir  	-command "tixExFileSelectBox:Cmd-DirCombo $w" 	-prunehistory true  	-options {  	    label.anchor w  	}]
    set data(w:dirlist) [tixDirList  $dpane.dirlist  	-command "tixExFileSelectBox:Cmd-DirList $w" 	-browsecmd "tixExFileSelectBox:Browse-DirList $w"]
    pack $data(w:dir)   -padx 8 -pady 4 -side top -fill x
    pack $data(w:dirlist) -padx 8 -pady 4 -side top -fill both -expand yes

    # The file types listbox
    #
    set data(w:types) [tixComboBox $lf.types 	-command "tixExFileSelectBox:Cmd-TypeCombo $w"  	-options {  	    label.anchor w  	}]

    pack $data(w:types)  -padx 12 -pady 4 -side bottom -fill x -anchor w
    pack $pane -side top -padx 4 -pady 4 -expand yes -fill both

    # Buttons to the right
    #
    set bf [frame $w.bf]
    set data(w:ok)     [button $bf.ok -text OK 	-underline 0 -command "tixExFileSelectBox:Ok $w"]
    set data(w:cancel) [button $bf.cancel -text Cancel 	-underline 0 -command "tixExFileSelectBox:Cancel $w"]
    set data(w:hidden) [checkbutton $bf.hidden -text "Show Hidden Files" 	-underline 0        	-variable [format %s(-showhidden) $w] -onvalue 1 -offvalue 0 	-command "tixExFileSelectBox:SetShowHidden $w"]

    pack $data(w:ok) $data(w:cancel) $data(w:hidden) 	-side top -fill x -padx 6 -pady 3

    pack $bf -side right -fill both -pady 6
    pack $lf -side left -expand yes -fill both

    tixDoWhenMapped $w "tixExFileSelectBox:Map $w"

    if {$data(-filetypes) == ""} {
	$data(w:types) config -state disabled
    }
}


#----------------------------------------------------------------------
# Configuration
#----------------------------------------------------------------------
proc tixExFileSelectBox:config-showhidden {w value} {
    upvar #0 $w data

    set data(-showhidden) $value
    tixExFileSelectBox:SetShowHidden $w
}

# Update both DirList and {file list and dir combo}
#
#
proc tixExFileSelectBox:config-directory {w value} {
    upvar #0 $w data

    if {![tixIsAbsPath $value]} {
	return $data(-directory)
    }

    set data(-directory) [tixFSAbsPath $value]
    tixSetSilent $data(w:dirlist) $data(-directory) 
    tixSetSilent $data(w:dir) $data(-directory) 
    tixWidgetDoWhenIdle tixExFileSelectBox:LoadFiles $w reload

    return $data(-directory) 
}

proc tixExFileSelectBox:config-filetypes {w value} {
    upvar #0 $w data

    $data(w:types) subwidget listbox delete 0 end

    foreach name [array names data] {
	if [string match type,* $name] {
	    catch {unset data($name)}
	}
    }

    if {$value == ""} {
	$data(w:types) config -state disabled
    } else {
	$data(w:types) config -state normal
    
	foreach type $value {
	    $data(w:types) insert end [lindex $type 1]
	    set data(type,[lindex $type 1]) [lindex $type 0]
	}
	tixSetSilent $data(w:types) ""
    }
}

#----------------------------------------------------------------------
# MISC Methods
#----------------------------------------------------------------------
proc tixExFileSelectBox:SetShowHidden {w} {
    upvar #0 $w data

    $data(w:dirlist) config -showhidden $data(-showhidden)

    tixWidgetDoWhenIdle tixExFileSelectBox:LoadFiles $w reload
}

# User activates the dir combobox
#
#
proc tixExFileSelectBox:Cmd-DirCombo {w args} {
    upvar #0 $w data

    set dir [tixEvent flag V]
    if {![tixIsAbsPath $dir]} {
	return
    }
    set dir [tixFSAbsPath $dir]

    if {![file isdirectory $dir]} {
	return
    }

    $data(w:dirlist) config -value $dir
    set data(-directory) $dir
}

# User activates the dir list
#
#
proc tixExFileSelectBox:Cmd-DirList {w args} {
    upvar #0 $w data

    set dir $data(-directory)
    catch {
	set dir [tixEvent flag V]
    }
    set dir [tixFSAbsPath $dir]

    tixSetSilent $data(w:dir) $dir
    set data(-directory) $dir

    tixWidgetDoWhenIdle tixExFileSelectBox:LoadFiles $w noreload
}

# User activates the dir list
#
#
proc tixExFileSelectBox:Browse-DirList {w args} {
    upvar #0 $w data

    set dir [tixEvent flag V]
    tixExFileSelectBox:Cmd-DirList $w $dir
}

proc tixExFileSelectBox:IsPattern {w string} {
    foreach char [split $string ""] {
	if {$char == "*" || $char == "?" || $char == "\{"  || $char == "\[" } {
	    return 1
	}
    }
    return 0
}

proc tixExFileSelectBox:Cmd-FileCombo {w value} {
    upvar #0 $w data

    if {[tixEvent type] == "<Return>"} {
	tixExFileSelectBox:Ok $w
    }
}

proc tixExFileSelectBox:Ok {w} {
    upvar #0 $w data

    set value [string trim [$data(w:file) subwidget entry get]]
    if {$value == ""} {
	set value $data(-pattern)
    }
    tixSetSilent $data(w:file) $value

    if [tixExFileSelectBox:IsPattern $w $value] {
	set data(-pattern) $value
	tixWidgetDoWhenIdle tixExFileSelectBox:LoadFiles $w reload
    } else {
	if [tixIsAbsPath $value] {
	    set intName [tixFileIntName $value]
	} else {
	    set intName [tixSubFolder [tixFileIntName $data(-directory)]  	    	[tixFileIntName $value]]
	}
	set data(-value) [tixNativeName $intName]
	tixExFileSelectBox:Invoke $w
    }
}

proc tixExFileSelectBox:Cancel {w} {
    upvar #0 $w data

    if {$data(-dialog) != ""} {
	eval $data(-dialog) popdown
    }
}

proc tixExFileSelectBox:Invoke {w} {
    upvar #0 $w data

    # Save some old history
    #
    $data(w:dir)  addhistory [$data(w:dir) cget -value]
    $data(w:file) addhistory $data(-pattern)
    $data(w:file) addhistory $data(-value)
    if {$data(-dialog) != ""} {
	eval $data(-dialog) popdown
    }
    if {$data(-command) != "" && !$data(-disablecallback)} {
	set bind(specs) "%V"
	set bind(%V) $data(-value)
	tixEvalCmdBinding $w $data(-command) bind $data(-value)
    }
}

proc tixExFileSelectBox:Cmd-FileList {w invoke args} {
    upvar #0 $w data

    set index [lindex [$data(w:filelist) subwidget listbox curselection] 0]
    if {$index == ""} {
	set index 0
    }

    set file [$data(w:filelist) subwidget listbox get $index]
    tixSetSilent $data(w:file) $file

    set data(-value) [tixNativeName [tixSubFolder  	[tixFileIntName $data(-directory)] [tixFileIntName $file]]]

    if {$invoke == 1} {
	tixExFileSelectBox:Invoke $w
    } else {
	if {$data(-browsecmd) != ""} {
	    tixEvalCmdBinding $w $data(-browsecmd) "" $data(-value)
	}
    }
}

proc tixExFileSelectBox:Cmd-TypeCombo {w args} {
    upvar #0 $w data

    set value [tixEvent flag V]

    if [info exists data(type,$value)] {
	set data(-pattern) $data(type,$value)
	tixSetSilent $data(w:file) $data(-pattern)
	tixWidgetDoWhenIdle tixExFileSelectBox:LoadFiles $w reload
    }
}

proc tixExFileSelectBox:LoadFiles {w flag} {
    upvar #0 $w data

    if {$flag != "reload" && $data(-directory) == $data(oldDir)} {
	return
    }

    if {![winfo ismapped [winfo toplevel $w]]} {
	tixDoWhenMapped [winfo toplevel $w]  	    "tixExFileSelectBox:LoadFiles $w $flag"
	return
    }

    set listbox [$data(w:filelist) subwidget listbox]
    $listbox delete 0 end

    set data(-value) ""

    tixBusy $w on [$data(w:dirlist) subwidget hlist]

    set intDir [tixFileIntName $data(-directory)]
    foreach name [tixListDir $intDir 0 1 0          $data(-showhidden) $data(-pattern)] {

	$listbox insert end [tixFileDisplayName [tixSubFolder $intDir $name]]
    }

    if {$data(oldDir) != $data(-directory)} {
	# Otherwise if the user has already selected a file and then presses
	# "show hidden", the selection won't be wiped out.
	tixSetSilent $data(w:file) $data(-pattern)
    }
    set data(oldDir) $data(-directory)

    tixWidgetDoWhenIdle tixBusy $w off [$data(w:dirlist) subwidget hlist]
}

#
# Called when thd listbox is first mapped
proc tixExFileSelectBox:Map {w} {
    if {![winfo exists $w]} {
	return
    }

    upvar #0 $w data

    set bind(specs) "%V"
    set bind(%V) $data(-value)
    tixEvalCmdBinding $w bind  	"tixExFileSelectBox:Cmd-DirList $w" $data(-directory)
}

#----------------------------------------------------------------------
# Public commands
#
#----------------------------------------------------------------------
proc tixExFileSelectBox:invoke {w} {
    tixExFileSelectBox:Invoke $w
}

proc tixExFileSelectBox:filter {w} {
    tixExFileSelectBox:LoadFiles $w reload
}


 # EFileDlg.tcl --
#
#	Implements the Extended File Selection Dialog widget.
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

tixWidgetClass tixExFileSelectDialog {
    -classname TixExFileSelectDialog
    -superclass tixDialogShell
    -method {}
    -flag   {
	-command
    }
    -configspec {
	{-command command Command ""}

	{-title title Title "Select A File"}
    }
}

proc tixExFileSelectDialog:ConstructWidget {w} {
    upvar #0 $w data

    tixChainMethod $w ConstructWidget
    set data(w:fsbox) [tixExFileSelectBox $w.fsbox -dialog $w  	-command $data(-command)]
    pack $data(w:fsbox) -expand yes -fill both
}

proc tixExFileSelectDialog:config-command {w value} {
    upvar #0 $w data

    $data(w:fsbox) config -command $value
}

proc tixExFileSelectDialog:SetBindings {w} {
    upvar #0 $w data

    tixChainMethod $w SetBindings

    bind $w <Alt-Key-f> "focus [$data(w:fsbox) subwidget file]"
    bind $w <Alt-Key-t> "focus [$data(w:fsbox) subwidget types]"
    bind $w <Alt-Key-d> "focus [$data(w:fsbox) subwidget dir]"
    bind $w <Alt-Key-o> "tkButtonInvoke [$data(w:fsbox) subwidget ok]"
    bind $w <Alt-Key-c> "tkButtonInvoke [$data(w:fsbox) subwidget cancel]"
    bind $w <Alt-Key-s> "tkButtonInvoke [$data(w:fsbox) subwidget hidden]"
}

 # Event.tcl --
#
#	Handles the event bindings of the -command and -browsecmd options
#	(and various of others such as -validatecmd).
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

#----------------------------------------------------------------------
# Evaluate high-level bindings (-command, -browsecmd, etc):
# with % subsitution or without (compatibility mode)
#
#
# BUG : if a -command is intercepted by a hook, the hook must use
#       the same record name as the issuer of the -command. For the time
#	being, you must use the name "bind" as the record name!!!!!
#
#----------------------------------------------------------------------
set _tix_event_flags ""
append _tix_event_flags " %%"
append _tix_event_flags " %#"
#append _tix_event_flags " %a"
append _tix_event_flags " %b"
append _tix_event_flags " %c"
append _tix_event_flags " %d"
append _tix_event_flags " %f"
append _tix_event_flags " %h"
append _tix_event_flags " %k"
append _tix_event_flags " %m"
append _tix_event_flags " %o"
append _tix_event_flags " %p"
append _tix_event_flags " %s"
append _tix_event_flags " %t"
append _tix_event_flags " %w"
append _tix_event_flags " %x"
append _tix_event_flags " %y"
append _tix_event_flags " %A"
append _tix_event_flags " %B"
append _tix_event_flags " %E"
append _tix_event_flags " %K"
append _tix_event_flags " %N"
append _tix_event_flags " %R"
#append _tix_event_flags " %S"
append _tix_event_flags " %T"
append _tix_event_flags " %W"
append _tix_event_flags " %X"
append _tix_event_flags " %Y"

proc tixBind {tag event action} {
    global _tix_event_flags

    append cmd "_tixRecordFlags $event $_tix_event_flags;"
    append cmd "$action; "
    append cmd "_tixDeleteFlags"

    bind $tag $event $cmd
}

# This is a "name stack" for storing the "bind" structures
#
# The bottom of the event stack is usually a raw event (generated by tixBind)
# but it may also be a programatically triggered (caused by tixEvalCmdBinding)
#
#

set tixEvent(nameStack)		""
set tixEvent(stackLevel)        0

proc tixPushEventStack {} {
    global tixEvent

    set lastEvent [lindex $tixEvent(nameStack) 0]
    incr tixEvent(stackLevel)
    set thisEvent _tix_event$tixEvent(stackLevel)

    set tixEvent(nameStack)  	[list $thisEvent $tixEvent(nameStack)]

    if {$lastEvent == ""} {
	upvar #0 $thisEvent this
	set this(type) <Application>
    } else {
	upvar #0 $lastEvent last
	upvar #0 $thisEvent this

	foreach name [array names last] {
	    set this($name) $last($name)
	}
    }

    return $thisEvent
}

proc tixPopEventStack {varName} {
    global tixEvent

    if {$varName != [lindex $tixEvent(nameStack) 0]} {
	error "unmatched tixPushEventStack and tixPopEventStack calls"
    }
    incr tixEvent(stackLevel) -1
    set tixEvent(nameStack) [lindex $tixEvent(nameStack) 1]
    global $varName
    unset $varName
}


# Events triggered by tixBind
#
proc _tixRecordFlags [concat event $_tix_event_flags] {
    global _tix_event_flags

    set thisName [tixPushEventStack]; upvar #0 $thisName this

    set this(type) $event
    foreach f $_tix_event_flags {
	set this($f) [set $f]
    }
}

proc _tixDeleteFlags {} {
    global tixEvent

    tixPopEventStack [lindex $tixEvent(nameStack) 0]
}

# programatically trigged events
#
proc tixEvalCmdBinding {w cmd {subst ""} args} {
    global tixPriv tixEvent tix

    set thisName [tixPushEventStack]; upvar #0 $thisName this

    if {$subst != ""} {
	upvar $subst bind

	if [info exists bind(specs)] {
	    foreach spec $bind(specs) {
		set this($spec) $bind($spec)
	    }
	}
	if [info exists bind(type)] {
	    set this(type) $bind(type)
	}
    }

    if [catch {
	if [tixGetBoolean -nocomplain $tix(-extracmdargs)] {
	    # Compatibility mode
	    #
	    set ret [uplevel #0 $cmd $args]
	} else {
	    set ret [uplevel $cmd]
	}
    } error] {
	if [catch {
	    tixCmdErrorHandler $error
	} error] {
	    # double fault: just print out 
	    tixBuiltInCmdErrorHandler $error
	}
	tixPopEventStack $thisName
	return ""
    } else {
	tixPopEventStack $thisName

	return $ret
    }
}

proc tixEvent {option args} {
    global tixPriv  tixEvent
    set varName [lindex $tixEvent(nameStack) 0]

    if {$varName == ""} {
	error "tixEvent called when no event is being processed"
    } else {
	upvar #0 $varName event
    }

    case $option {
	type {
	    return $event(type)
	}
	value {
	    if [info exists event(%V)] {
		return $event(%V)
	    } else {
		return ""
	    }
	}
	flag {
	    set f %[lindex $args 0]
	    if [info exists event($f)] {
		return $event($f)
	    }
	    error "The flag \"[lindex $args 0]\" does not exist"
	}
	match {
	    return [string match [lindex $args 0] $event(type)]
	}
	default {
	    error "unknown option \"$option\""
	}
    }
}

# tixBuiltInCmdErrorHandler --
#
#	Default method to report command handler errors. This procedure is
#	also called if double-fault happens (command handler causes error,
#	then tixCmdErrorHandler causes error).
#
proc tixBuiltInCmdErrorHandler {errorMsg} {
    global errorInfo
    if ![info exists errorInfo] {
	set errorInfo "???"
    }
    puts "Error:\n $errorMsg\n$errorInfo"
}

# tixCmdErrorHandler --
#
#	You can redefine this command to handle the errors that occur
#	in the command handlers. See the programmer's documentation
#	for details
#
if ![string compare [info command tixCmdErrorHandler] ""] {
    proc tixCmdErrorHandler {errorMsg} {
	tixBuiltInCmdErrorHandler $errorMsg
    }
}


 # FileBox.tcl --
#
#	Implements the File Selection Box widget.
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#


# ToDo
#   (1)	If user has entered an invalid directory, give an error dialog
#

tixWidgetClass tixFileSelectBox {
    -superclass tixPrimitive
    -classname  TixFileSelectBox
    -method {
	filter invoke
    }
    -flag {
	-browsecmd -command -dir -directory -disablecallback
	-grab -pattern -selection -value
    }
    -configspec {
	{-browsecmd browseCmd BrowseCmd ""}
	{-command command Command ""}
	{-directory directory Directory ""}
	{-disablecallback disableCallback DisableCallback 0 tixVerifyBoolean}
	{-grab grab Grab global}
	{-pattern pattern Pattern *}
	{-value value Value ""}
    }
    -alias {
	{-selection -value}
	{-dir -directory}
    }
    -forcecall {
	-value
    }
    -default {
	{.relief			raised}
	{*filelist*Listbox.takeFocus	true}
	{.borderWidth 			1}
	{*Label.anchor			w}
	{*Label.borderWidth		0}
	{*Label.font                   -Adobe-Helvetica-Bold-R-Normal--*-120-*}
	{*TixComboBox*scrollbar		auto}
	{*TixComboBox*Label.anchor	w}
	{*TixScrolledListBox.scrollbar	auto}
	{*Listbox.exportSelection	false}
	{*directory*Label.text  	"Directories:"}
	{*directory*Label.underline	0}
	{*file*Label.text		"Files:"}
	{*file*Label.underline		2}
	{*filter.label			"Filter:"}
	{*filter*label.underline	3}
	{*filter.labelSide		top}
	{*selection.label		"Selection:"}
	{*selection*label.underline	0}
	{*selection.labelSide		top}
    }
}


proc tixFileSelectBox:InitWidgetRec {w} {
    upvar #0 $w data
    global env

    tixChainMethod $w InitWidgetRec

    if {$data(-directory) == ""} {
	set data(-directory) [pwd]
    }
    if {$data(-pattern) == ""} {
	set data(-pattern) [tixFilePattern allFiles]
    }

    tixFileSelectBox:SetPat $w [tixFileIntName $data(-pattern)]
    tixFileSelectBox:SetDir $w [tixFileIntName $data(-directory)]

    set data(flag)      0
    set data(fakeDir)   0
}

#----------------------------------------------------------------------
#		Construct widget
#----------------------------------------------------------------------
proc tixFileSelectBox:ConstructWidget {w} {
    upvar #0 $w data

    tixChainMethod $w ConstructWidget

    set frame1 [tixFileSelectBox:CreateFrame1 $w]
    set frame2 [tixFileSelectBox:CreateFrame2 $w]
    set frame3 [tixFileSelectBox:CreateFrame3 $w]

    pack $frame1 -in $w -side top -fill x
    pack $frame3 -in $w -side bottom -fill x
    pack $frame2 -in $w -side top -fill both -expand yes
}

proc tixFileSelectBox:CreateFrame1 {w} {
    upvar #0 $w data

    frame $w.f1 -border 10
    tixComboBox $w.f1.filter -editable 1 	-command "$w filter" -anchor e  	-options {
	    slistbox.scrollbar auto
	    listbox.height 5
	    label.anchor w
	}
    set data(w:filter) $w.f1.filter

    pack $data(w:filter) -side top -expand yes -fill both
    return $w.f1
}

proc tixFileSelectBox:CreateFrame2 {w} {
    upvar #0 $w data

    tixPanedWindow $w.f2 -orientation horizontal
    #     THE LEFT FRAME
    #-----------------------
    set dir [$w.f2 add directory -size 120]
    $dir config -relief flat
    label $dir.lab
    set data(w:dirlist) [tixScrolledListBox $dir.dirlist 		       -scrollbar auto 		       -options {listbox.width 4 listbox.height 6}]

    pack $dir.lab -side top -fill x -padx 10
    pack $data(w:dirlist) -side bottom -expand yes -fill both -padx 10

    #     THE RIGHT FRAME
    #-----------------------
    set file [$w.f2 add file -size 160]
    $file config -relief flat
    label $file.lab
    set data(w:filelist) [tixScrolledListBox $file.filelist  		       -scrollbar auto 		       -options {listbox.width 4 listbox.height 6}]

    pack $file.lab -side top -fill x -padx 10
    pack $data(w:filelist) -side bottom -expand yes -fill both -padx 10

    return $w.f2
}

proc tixFileSelectBox:CreateFrame3 {w} {
    upvar #0 $w data

    frame $w.f3 -border 10
    tixComboBox $w.f3.selection -editable 1 	-command "tixFileSelectBox:SelInvoke $w"  	-anchor e  	-options {
	    slistbox.scrollbar auto
	    listbox.height 5
	    label.anchor w
	}

    set data(w:selection) $w.f3.selection

    pack $data(w:selection) -side top -fill both

    return $w.f3
}

proc tixFileSelectBox:SelInvoke {w args} {
    upvar #0 $w data

    set event [tixEvent type]

    if {$event != "<FocusOut>" && $event != "<Tab>"} {
	$w invoke
    }
}

proc tixFileSelectBox:SetValue {w value} {
    upvar #0 $w data

    set data(i-value) $value
    set data(-value)  [tixNativeName $value 0]
}

proc tixFileSelectBox:SetDir {w value} {
    upvar #0 $w data

    set data(i-directory) $value
    set data(-directory)  [tixNativeName $value]
}

proc tixFileSelectBox:SetPat {w value} {
    upvar #0 $w data

    set data(i-pattern) $value
    set data(-pattern)  [tixNativeName $value 0]
}


#----------------------------------------------------------------------
#                           BINDINGS
#----------------------------------------------------------------------

proc tixFileSelectBox:SetBindings {w} {
    upvar #0 $w data

    tixChainMethod $w SetBindings

    tixDoWhenMapped $w "tixFileSelectBox:FirstMapped $w"

    $data(w:dirlist) config  	-browsecmd "tixFileSelectBox:SelectDir $w"  	-command   "tixFileSelectBox:InvokeDir $w"

    $data(w:filelist) config  	-browsecmd "tixFileSelectBox:SelectFile $w"  	-command   "tixFileSelectBox:InvokeFile $w"
}

#----------------------------------------------------------------------
#                           CONFIG OPTIONS
#----------------------------------------------------------------------
proc tixFileSelectBox:config-directory {w value} {
    upvar #0 $w data

    if {$value == ""} {
	set value [pwd]
    }
    tixFileSelectBox:SetDir $w [tixFileIntName $value]
    tixFileSelectBox:SetFilter $w $data(i-directory) $data(i-pattern)
    $w filter

    return $data(-directory)
}

proc tixFileSelectBox:config-pattern {w value} {
    upvar #0 $w data

    if {$value == ""} {
	set value [tixFilePattern allFiles]
    }

    tixFileSelectBox:SetPat $w [tixFileIntName $value]
    tixFileSelectBox:SetFilter $w $data(i-directory) $data(i-pattern)

    # Returning a value means we have overridden the value and updated
    # the widget record ourselves.
    #
    return $data(-pattern)
}

proc tixFileSelectBox:config-value {w value} {
    upvar #0 $w data

    tixFileSelectBox:SetValue $w [tixFileIntName $value]
    tixSetSilent $data(w:selection) $value

    return $data(-value)
}

#----------------------------------------------------------------------
#                    PUBLIC METHODS
#----------------------------------------------------------------------
proc tixFileSelectBox:filter {w args} {
    upvar #0 $w data

    $data(w:filter) popdown
    tixFileSelectBox:InterpFilter $w
    tixFileSelectBox:LoadDir $w
}

proc tixFileSelectBox:invoke {w args} {
    upvar #0 $w data

    if {[$data(w:selection) cget -value] !=
	[$data(w:selection) cget -selection]} {
	    # this will in turn call "invoke" again ...
	    #
	    $data(w:selection) invoke
	    return
    }
    
    # record the filter
    #
    set filter [tixFileSelectBox:InterpFilter $w]
    $data(w:filter) addhistory $filter

    # record the selection
    #
    set userInput [string trim [$data(w:selection) cget -value]]
    tixFileSelectBox:SetValue $w  	[tixFileIntName $userInput $data(i-directory)]
    $data(w:selection) addhistory $data(-value)

    $data(w:filter) align
    $data(w:selection)  align

    if {$data(-command) != "" && !$data(-disablecallback)} {
	set bind(specs) "%V"
	set bind(%V) $data(-value)
	tixEvalCmdBinding $w $data(-command) bind $data(-value)
    }
}

#----------------------------------------------------------------------
#                    INTERNAL METHODS
#----------------------------------------------------------------------
# InterpFilter:
#	Interprets the value of the w:filter widget. 
#
# Side effects:
#	Changes the fields data(-directory) and data(-pattenn) 
#
proc tixFileSelectBox:InterpFilter {w {filter ""}} {
    upvar #0 $w data

    if {$filter == ""} {
	set filter [$data(w:filter) cget -selection]
	if {$filter == ""} {
	    set filter [$data(w:filter) cget -value]
	}
    }

    set i_filter [tixFileIntName $filter]

    if [file isdir $filter] {
	tixFileSelectBox:SetDir $w $i_filter
	tixFileSelectBox:SetPat $w [tixFilePattern allFiles]
    } else {
	set nDir [file dir $filter]
	if {$nDir == "" || $nDir == "."} {
	    tixFileSelectBox:SetDir $w [tixFileIntName $data(i-directory)]
	} else {
	    tixFileSelectBox:SetDir $w [tixFileIntName $nDir]
	}
	tixFileSelectBox:SetPat $w [tixFileIntName [file tail $filter]]
    }

    tixFileSelectBox:SetFilter $w $data(i-directory) $data(i-pattern)

    return $data(filter)
}

proc tixFileSelectBox:SetFilter {w dir pattern} {
    upvar #0 $w data

    set data(filter) [tixSubFolder $dir $pattern]
    tixSetSilent $data(w:filter) [tixNativeName $data(filter)]
}

proc tixFileSelectBox:LoadDirIntoLists {w} {
    upvar #0 $w data

    $data(w:dirlist)  subwidget listbox delete 0 end
    $data(w:filelist) subwidget listbox delete 0 end

    set dir $data(i-directory)

    # (1) List the directories
    #
    set isDrive 0
    catch {
	set nDir [tixNativeName $dir]
	if {[llength [file split $nDir]] == 1} {
	    set isDrive 1
	}
    }
    foreach name [tixListDir $dir 1 0 1 1] {
	if ![string compare ".." $name] {
	    if $isDrive {
		continue
	    }
	}
	$data(w:dirlist) subwidget listbox insert end $name
    }

    # (2) List the files
    #
    # %% UNIX'ISM:
    # If the pattern is "*" force glob to list the .* files.
    # However, since the user might not
    # be interested in them, shift the listbox so that the "normal" files
    # are seen first
    #
    # NOTE: if we pass $pat == "" but with $showHidden set to true,
    #       tixListDir will list "* .*" in Unix. See the comment on top of
    #	    the tixListDir code.
    #
    if {[string compare $data(i-pattern) *] == 0} {
	set pat ""
    } else {
	set pat $data(i-pattern)
    }

    set top 0
    foreach name [tixListDir $dir 0 1 0 0 $pat] {
	$data(w:filelist) subwidget listbox insert end $name
	if [string match .* $name] {
	    incr top
	}
    }

    $data(w:filelist) subwidget listbox yview $top
}

proc tixFileSelectBox:LoadDir {w} {
    upvar #0 $w data

    tixBusy $w on [$data(w:dirlist) subwidget listbox]

    tixFileSelectBox:LoadDirIntoLists $w
    tixFileSelectBox:MkDirMenu $w

    if {[$data(w:dirlist) subwidget listbox size] == 0} {
	# fail safe, just in case the user has inputed an errnoeuos
	# directory
	$data(w:dirlist) subwidget listbox insert 0 ".."
    }

    tixWidgetDoWhenIdle tixBusy $w off [$data(w:dirlist) subwidget listbox]
}

# %% unimplemented
#
proc tixFileSelectBox:MkDirMenu {w} {
    upvar #0 $w data
}

# User single clicks on the directory listbox
#
proc tixFileSelectBox:SelectDir {w} {
    upvar #0 $w data

    if {$data(fakeDir) > 0} {
	incr data(fakeDir) -1
	$data(w:dirlist) subwidget listbox select clear 0 end
	$data(w:dirlist) subwidget listbox activate -1
	return
    }

    if {$data(flag)} {
	return
    }
    set data(flag) 1

    set subdir [tixListboxGetCurrent [$data(w:dirlist) subwidget listbox]]
    if {$subdir == ""} {
	set subdir "."
    }

    tixFileSelectBox:SetFilter $w  	[tixFileIntName [tixSubFolder $data(i-directory) $subdir]]  	$data(i-pattern)
    set data(flag) 0
}

proc tixFileSelectBox:InvokeDir {w} {
    upvar #0 $w data

    set theDir [$data(w:dirlist) subwidget listbox get active]

    tixFileSelectBox:SetDir $w [tixFileIntName  	[tixSubFolder $data(i-directory) $theDir]]

    $data(w:dirlist) subwidget listbox select clear 0 end

    tixFileSelectBox:SetFilter $w $data(i-directory) $data(i-pattern)
    tixFileSelectBox:InterpFilter $w [tixNativeName $data(filter)]

    tixFileSelectBox:LoadDir $w

    if {![tixEvent match <Return>]} {
	incr data(fakeDir) 1
    }
}

proc tixFileSelectBox:SelectFile {w} {
    upvar #0 $w data

    if {$data(flag)} {
	return
    }
    set data(flag) 1

    # Reset the "Filter:" box to the current directory:
    #	
    $data(w:dirlist) subwidget listbox select clear 0 end
    tixFileSelectBox:SetFilter $w $data(i-directory) $data(i-pattern)

    # Now select the file
    #
    set selected [tixListboxGetCurrent [$data(w:filelist) subwidget listbox]]
    if {$selected != ""} {
	# Make sure that the selection is not empty!
	#
	tixFileSelectBox:SetValue $w  	    [tixFileIntName [tixSubFolder $data(i-directory) $selected]]
	tixSetSilent $data(w:selection) $data(-value)

	if {$data(-browsecmd) != ""} {
	    tixEvalCmdBinding $w $data(-browsecmd) "" $data(-value)
	}
    }
    set data(flag) 0
}

proc tixFileSelectBox:InvokeFile {w} {
    upvar #0 $w data

    set selected [tixListboxGetCurrent [$data(w:filelist) subwidget listbox]]
    if {$selected  != ""} {
	$w invoke
    }
}

# This is only called the first this fileBox is mapped -- load the directory
#
proc tixFileSelectBox:FirstMapped {w} {
    if {![winfo exists $w]} {
	return
    }

    upvar #0 $w data

    tixFileSelectBox:SetFilter $w $data(i-directory) $data(i-pattern)
    tixFileSelectBox:LoadDir $w
    $data(w:filter) align
}


#----------------------------------------------------------------------
#
#
#              C O N V E N I E N C E   R O U T I N E S 
#
#
#----------------------------------------------------------------------

# This is obsolete. Use the widget tixFileSelectDialog instead
#
#
proc tixMkFileDialog {w args} {
    set option(-okcmd)    ""
    set option(-helpcmd)  ""

    tixHandleOptions option {-okcmd -helpcmd} $args

    toplevel $w
    wm minsize $w 10 10

    tixStdDlgBtns $w.btns
    
    if {$option(-okcmd) != ""} {
	tixFileSelectBox $w.fsb -command "wm withdraw $w; $option(-okcmd)"
    } else {
	tixFileSelectBox $w.fsb -command "wm withdraw $w"
    }

    $w.btns button ok     config -command "$w.fsb invoke"
    $w.btns button apply  config -command "$w.fsb filter" -text Filter
    $w.btns button cancel config -command "wm withdraw $w"

    if {$option(-helpcmd) == ""} {
	$w.btns button help config -state disabled
    } else {
	$w.btns button help config -command $option(-helpcmd)
    }
    wm protocol $w WM_DELETE_WINDOW "wm withdraw $w"
    pack $w.btns  -side bottom -fill both
    pack $w.fsb   -fill both -expand yes

    return $w.fsb
}



 # tixFileCombobox --
#
#	A combobox widget for entering file names, directory names, file
#	patterns, etc.
#
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.

# tixFileComboBox displays and accepts the DOS pathnames only. It doesn't
# recognize UNC file names or Tix VPATHS.
#
tixWidgetClass tixFileComboBox {
    -classname TixFileComboBox
    -superclass tixPrimitive
    -method {
	invoke
    }
    -flag {
	-command -defaultfile -directory -text
    }
    -forcecall {
	-directory
    }
    -configspec {
	{-defaultfile defaultFile DefaultFile ""}
	{-directory directory Directory ""}
	{-command command Command ""}
	{-text text Text ""}
    }
    -default {
    }
}

proc tixFileComboBox:InitWidgetRec {w} {
    upvar #0 $w data

    tixChainMethod $w InitWidgetRec

    if ![string comp $data(-directory) ""] {
	set data(-directory) [tixFSPWD]
    }
}

proc tixFileComboBox:ConstructWidget {w} {
    upvar #0 $w data

    tixChainMethod $w ConstructWidget
    set data(w:combo) [tixComboBox $w.combo -editable true -dropdown true]
    pack $data(w:combo) -expand yes -fill both
}

proc tixFileComboBox:SetBindings {w} {
    upvar #0 $w data

    tixChainMethod $w SetBindings
    $data(w:combo) config -command "tixFileComboBox:OnComboCmd $w"
}

proc tixFileComboBox:OnComboCmd {w args} {
    upvar #0 $w data

    set text [string trim [tixEvent value]]

    set fInfo [tixFSNorm [tixFSVPath $data(-directory)]  	$text $data(-defaultfile) "" errorMsg]
    if [info exists errorMsg] {

    } else {
	tixSetSilent $data(w:combo) [lindex $fInfo 0]
	if [string compare $data(-command) ""] {
	    set bind(specs) {%V}
	    set bind(%V)    $fInfo
	    tixEvalCmdBinding $w $data(-command) bind $fInfo
	}
    }
}

proc tixFileComboBox:config-text {w val} {
    upvar #0 $w data

    tixSetSilent $data(w:combo) $val
}

proc tixFileComboBox:config-directory {w val} {
    upvar #0 $w data

    set data(-directory) [tixFSNormDir $val]
    return $data(-directory)
}

proc tixFileComboBox:invoke {w} {
    upvar #0 $w data

    $data(w:combo) invoke
}



 # FileCmpt.tcl --
#
#	File access portibility routines.
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#


# Internal file names
# (1) Idempotent: [tixFileIntName $intName] == $intName
# (2) Does not contain "~", "..", "."
# (3) All DOS type C:foo will be translated to absoulte path such as
#     /\C:\windows\foo
# (4) Does not contail trailing "/" or "\\" characters
#

proc tixFileResolveName {nativeName {defParent ""}} {
    if {$defParent != ""} {
	return [tixNativeName [tixFileIntName $nativeName [tixFileIntName $defParent]]]
    } else {
        return [tixNativeName [tixFileIntName $nativeName]]
    }
}

proc tixNSubFolder {parent sub} {
    return [tixNativeName [tixSubFolder  	[tixFileIntName $parent] [tixFileIntName $sub]]]
}

 # FileDlg.tcl --
#
#	Implements the File Selection Dialog widget.
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

tixWidgetClass tixFileSelectDialog {
    -classname TixFileSelectDialog
    -superclass tixStdDialogShell
    -method {
    }
    -flag {
	-command
    }
    -configspec {
	{-command command Command ""}

	{-title title Title "Select A File"}
    }
}

proc tixFileSelectDialog:ConstructTopFrame {w frame} {
    upvar #0 $w data

    tixChainMethod $w ConstructTopFrame $frame

    set data(w:fsbox) [tixFileSelectBox $frame.fsbox  	-command "tixFileSelectDialog:Invoke $w"]
    pack $data(w:fsbox) -expand yes -fill both
}

proc tixFileSelectDialog:SetBindings {w} {
    upvar #0 $w data

    tixChainMethod $w SetBindings

    $data(w:btns) subwidget ok     config -command "$data(w:fsbox) invoke"  	-underline 0
    $data(w:btns) subwidget apply  config -command "$data(w:fsbox) filter"  	-text Filter -underline 0
    $data(w:btns) subwidget cancel config -command "wm withdraw $w"  	-underline 0
    $data(w:btns) subwidget help config -underline 0


    bind $w <Alt-Key-l> "focus [$data(w:fsbox) subwidget filelist]"
    bind $w <Alt-Key-d> "focus [$data(w:fsbox) subwidget dirlist]"
    bind $w <Alt-Key-s> "focus [$data(w:fsbox) subwidget selection]"
    bind $w <Alt-Key-t> "focus [$data(w:fsbox) subwidget filter]"
    bind $w <Alt-Key-o> "tkButtonInvoke [$data(w:btns) subwidget ok]"
    bind $w <Alt-Key-f> "tkButtonInvoke [$data(w:btns) subwidget apply]"
    bind $w <Alt-Key-c> "tkButtonInvoke [$data(w:btns) subwidget cancel]"
    bind $w <Alt-Key-h> "tkButtonInvoke [$data(w:btns) subwidget help]"
}

proc tixFileSelectDialog:Invoke {w filename} {
    upvar #0 $w data

    wm withdraw $w

    if {$data(-command) != ""} {
	set bind(specs) "%V"
	set bind(%V) $filename
	tixEvalCmdBinding $w $data(-command) bind $filename
    }
}

 # FileEnt.tcl --
#
# 	TixFileEntry Widget: an entry box for entering filenames.
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

tixWidgetClass tixFileEntry {
    -classname TixFileEntry
    -superclass tixLabelWidget
    -method {
	invoke filedialog update
    }
    -flag {
	-activatecmd -command -dialogtype -disablecallback -disabledforeground
	-filebitmap -selectmode -state -validatecmd -value -variable
    }
    -forcecall {
	-variable
    }
    -static {
	-filebitmap
    }
    -configspec {
	{-activatecmd activateCmd ActivateCmd ""}
	{-command command Command ""}
	{-dialogtype dialogType DialogType ""}
	{-disablecallback disableCallback DisableCallback 0 tixVerifyBoolean}
	{-disabledforeground disabledForeground DisabledForeground #303030}
	{-filebitmap fileBitmap FileBitmap ""}
	{-selectmode selectMode SelectMode normal}
	{-state state State normal}
	{-validatecmd validateCmd ValidateCmd ""}
	{-value value Value ""}
	{-variable variable Variable ""}
    }
    -default {
	{*frame.borderWidth		2}
	{*frame.relief			sunken}
	{*Label.font         -Adobe-Helvetica-Bold-R-Normal--*-120-*-*-*-*-*-*}
	{*Button.highlightThickness	0}
	{*Entry.highlightThickness	0}
	{*Entry.borderWidth 		0}
	{*Entry.background 		#c3c3c3}
    }
}

proc tixFileEntry:InitWidgetRec {w} {
    upvar #0 $w data

    tixChainMethod $w InitWidgetRec
    set data(varInited)	  0

	if {$data(-filebitmap) == ""} {
	    set data(-filebitmap) [tix getbitmap openfile]
	}
}

proc tixFileEntry:ConstructFramedWidget {w frame} {
    upvar #0 $w data

    tixChainMethod $w ConstructFramedWidget $frame

    set data(w:entry)  [entry  $frame.entry]
    set data(w:button) [button $frame.button -bitmap $data(-filebitmap)  	-takefocus 0]
    set data(entryfg) [$data(w:entry) cget -fg]

    pack $data(w:button) -side right -fill both
    pack $data(w:entry)  -side left  -expand yes -fill both
}

proc tixFileEntry:SetBindings {w} {
    upvar #0 $w data

    tixChainMethod $w SetBindings

    $data(w:button) config -command "tixFileEntry:OpenFile $w"
    tixSetMegaWidget $data(w:entry) $w

    # If user press <return>, verify the value and call the -command
    #
    bind $data(w:entry) <Return> "tixFileEntry:invoke $w"
    bind $data(w:entry) <KeyPress> {
	if {[set [tixGetMegaWidget %W](-selectmode)] == "immediate"} {
	    tixFileEntry:invoke [tixGetMegaWidget %W]
	}
    }
    bind $data(w:entry) <FocusOut>  {
        if {"%d" == "NotifyNonlinear" || "%d" == "NotifyNonlinearVirtual"} {
	    tixFileEntry:invoke [tixGetMegaWidget %W]
        }
    }
    bind $w <FocusIn> "focus $data(w:entry)"
}

#----------------------------------------------------------------------
#                           CONFIG OPTIONS
#----------------------------------------------------------------------
proc tixFileEntry:config-state {w value} {
    upvar #0 $w data

    if {$value == "normal"} {
	$data(w:button) config -state $value
	$data(w:entry)  config -state $value -fg $data(entryfg)
	catch {
	    $data(w:label)  config -fg $data(entryfg)
	}
    } else {
	$data(w:button) config -state $value
	$data(w:entry)  config -state $value -fg $data(-disabledforeground)
	catch {
	    $data(w:label)  config -fg $data(-disabledforeground)
	}
    }

    return ""
}

proc tixFileEntry:config-value {w value} {
    tixFileEntry:SetValue $w $value
}

proc tixFileEntry:config-variable {w arg} {
    upvar #0 $w data

    if [tixVariable:ConfigVariable $w $arg] {
       # The value of data(-value) is changed if tixVariable:ConfigVariable 
       # returns true
       tixFileEntry:SetValue $w $data(-value)
    }
    catch {
	unset data(varInited)
    }
    set data(-variable) $arg
}

#----------------------------------------------------------------------
#                         User Commands
#----------------------------------------------------------------------
proc tixFileEntry:invoke {w} {
    upvar #0 $w data

    if {[catch {$data(w:entry) index sel.first}] == 0} {
	# THIS ENTRY OWNS SELECTION --> TURN IT OFF
	#
	$data(w:entry) select from end
	$data(w:entry) select to   end
    }

    tixFileEntry:SetValue $w [$data(w:entry) get]
}

proc tixFileEntry:filedialog {w args} {
    upvar #0 $w data

    if {$args == ""} {
	return [tix filedialog $data(-dialogtype)]
    } else {
	return [eval [tix filedialog $data(-dialogtype)] $args]
    }
}

proc tixFileEntry:update {w} {
    upvar #0 $w data

    if {"x[$data(w:entry) get]" != "x$data(-value)"} {
	tixFileEntry:invoke $w
    }
}
#----------------------------------------------------------------------
#                       Internal Commands
#----------------------------------------------------------------------
proc tixFileEntry:OpenFile {w} {
     upvar #0 $w data

     if {$data(-activatecmd) != ""} {
	 uplevel #0 $data(-activatecmd)
     }

     set filedlg [tix filedialog $data(-dialogtype)]


     $filedlg config -parent [winfo toplevel $w]  	 -command "tixFileEntry:FileDlgCallback $w"

     focus $data(w:entry)

     $filedlg popup
}

proc tixFileEntry:FileDlgCallback {w args} {
    set filename [tixEvent flag V]

    tixFileEntry:SetValue $w $filename
}

proc tixFileEntry:SetValue {w value} {
    upvar #0 $w data

    if {$data(-validatecmd) != ""} {
	set value [tixEvalCmdBinding $w $data(-validatecmd) "" $value]
    }

    if {$data(-state) == "normal"} {
	$data(w:entry) delete 0 end
	$data(w:entry) insert 0 $value
	$data(w:entry) xview end
    }

    set data(-value) $value

    tixVariable:UpdateVariable $w

    if {$data(-command) != "" && !$data(-disablecallback)} {
	if {![info exists data(varInited)]} {
	    set bind(specs) ""
	    tixEvalCmdBinding $w $data(-command) bind $value
	}
    }
}

proc tixFileEntry:Destructor {w} {
    upvar #0 $w data

    tixUnsetMegaWidget $data(w:entry)
    tixVariable:DeleteVariable $w

    # Chain this to the superclass
    #
    tixChainMethod $w Destructor
}

 # FileUtil.tcl ---
#
#
#	Utility functions for filename handling.
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

proc tixResolveDir {dir} {
    set dir [tixFile tildesubst $dir]
    set dir [tixFile trimslash $dir]
    
    if {$dir == "/"} {
	return $dir
    }

    if {[string index $dir 0] != "/"} {
	# Isn't an absolute path
	#
	set appPWD [pwd]
	catch {
	    cd $dir
	    set dir [pwd]
	}
	cd $appPWD
	return $dir
    }

    set names [split $dir "/"]

    # Get rid of all "."
    set n /
    foreach name [lrange $names 1 end] {
	if {[string compare "." $name]} {
	    lappend n $name
	}
    }
    if {$n == "/"} {
	return /
    }

    # Get rid of all ".."
    #
    set list [tixCompressDotDot $n 0]

    if {$list == "/"} {
	return /
    }

    # General case
    #
    set dir ""
    foreach sub [lrange $list 1 end] {
	append dir /$sub
    }
    return $dir
}

proc tixCompressDotDot {list i} {
    set done 0

    while {1} {
	if {$i >= [llength $list]} {
	    return $list
	}

	if {[lindex $list $i] != ".."} {
	    incr i
	    continue
	}

	# We encounter a ".."
	#
	if {$i == 0} {
	    # Can't handle this
	    #
	    return ""
	}
	if {$i == 1} {
	    set l [lindex $list 0]
	    set list [concat $l [lrange $list 2 end]]
	    continue
	}

	set l [lrange $list 0 [expr $i-2]]
	set list [concat $l [lrange $list [expr $i+1] end]]
	incr i -1
    }
}

 # FloatEnt.tcl --
#
#	An entry widget that can be attached on top of any widget to
#	provide dynamic editing. It is used to provide dynamic editing
#	for the tixGrid widget, among other things.
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

tixWidgetClass tixFloatEntry {
    -classname TixFloatEntry
    -superclass tixPrimitive
    -method {
	invoke post unpost
    }
    -flag {
	-command -value
    }
    -configspec {
	{-value value Value ""}
	{-command command Command ""}
    }
    -default {
	{.entry.highlightThickness	0}
    }
}

#----------------------------------------------------------------------
#
#	Initialization bindings
#
#----------------------------------------------------------------------

proc tixFloatEntry:InitWidgetRec {w} {
    upvar #0 $w data

    tixChainMethod $w InitWidgetRec
}

proc tixFloatEntry:ConstructWidget {w} {
    upvar #0 $w data

    tixChainMethod $w ConstructWidget
    set data(w:entry) [entry $w.entry]
    pack $data(w:entry) -expand yes -fill both
}

proc tixFloatEntry:SetBindings {w} {
    upvar #0 $w data

    tixChainMethod $w SetBindings
    tixBind $data(w:entry) <Return> "tixFloatEntry:invoke $w"
}

#----------------------------------------------------------------------
#
#	Class bindings
#
#----------------------------------------------------------------------

proc tixFloatEntryBind {} {
    tixBind TixFloatEntry <FocusIn>  {
      if {![tixStrEq [focus -displayof [set %W(w:entry)]] [set %W(w:entry)]]} {
	  focus [%W subwidget entry]
	  [set %W(w:entry)] selection from 0
	  [set %W(w:entry)] selection to end
	  [set %W(w:entry)] icursor end
      }
    }
}

#----------------------------------------------------------------------
#
#	Public methods
#
#----------------------------------------------------------------------
proc tixFloatEntry:post {w x y {width ""} {height ""}} {
    upvar #0 $w data

    if {$width == ""} {
	set width [winfo reqwidth $data(w:entry)]
    }
    if {$height == ""} {
	set height [winfo reqheight $data(w:entry)]
    }

    place $w -x $x -y $y -width $width -height $height -bordermode ignore
    raise $w
    focus $data(w:entry)
}

proc tixFloatEntry:unpost {w} {
    upvar #0 $w data

    place forget $w
}

proc tixFloatEntry:config-value {w val} {
    upvar #0 $w data

    $data(w:entry) delete 0 end
    $data(w:entry) insert 0 $val

    $data(w:entry) selection from 0
    $data(w:entry) selection to end
    $data(w:entry) icursor end
}
#----------------------------------------------------------------------
#
#	Private methods
#
#----------------------------------------------------------------------

proc tixFloatEntry:invoke {w} {
    upvar #0 $w data

    if ![tixStrEq $data(-command) ""] {
	set bind(specs) {%V}
	set bind(%V)    [$data(w:entry) get]

	tixEvalCmdBinding $w $data(-command) bind $bind(%V)
    }
}

 # Grid.tcl --
#
# 	This file defines the default bindings for Tix Grid widgets.
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#



#--------------------------------------------------------------------------
# tkPriv elements used in this file:
#
# afterId -		Token returned by "after" for autoscanning.
# fakeRelease -		Cancel the ButtonRelease-1 after the user double click
#--------------------------------------------------------------------------
#
proc tixGridBind {} {
    tixBind TixGrid <ButtonPress-1> {
	tixGrid:Button-1 %W %x %y
    }
    tixBind TixGrid <Shift-ButtonPress-1> {
	tixGrid:Shift-Button-1 %W %x %y
    }
    tixBind TixGrid <Control-ButtonPress-1> {
	tixGrid:Control-Button-1 %W %x %y
    }
    tixBind TixGrid <ButtonRelease-1> {
	tixGrid:ButtonRelease-1 %W %x %y
    }
    tixBind TixGrid <Double-ButtonPress-1> {
	tixGrid:Double-1 %W  %x %y
    }
    tixBind TixGrid <B1-Motion> {
	set tkPriv(x) %x 
	set tkPriv(y) %y
	set tkPriv(X) %X
	set tkPriv(Y) %Y

	tixGrid:B1-Motion %W %x %y
    }
    tixBind TixGrid <Control-B1-Motion> {
	set tkPriv(x) %x 
	set tkPriv(y) %y
	set tkPriv(X) %X
	set tkPriv(Y) %Y

	tixGrid:Control-B1-Motion %W %x %y
    }
    tixBind TixGrid <B1-Leave> {
	set tkPriv(x) %x 
	set tkPriv(y) %y
	set tkPriv(X) %X
	set tkPriv(Y) %Y

	tixGrid:B1-Leave %W
    }
    tixBind TixGrid <B1-Enter> {
	tixGrid:B1-Enter %W %x %y
    }
    tixBind TixGrid <Control-B1-Leave> {
	set tkPriv(x) %x 
	set tkPriv(y) %y
	set tkPriv(X) %X
	set tkPriv(Y) %Y

	tixGrid:Control-B1-Leave %W
    }
    tixBind TixGrid <Control-B1-Enter> {
	tixGrid:Control-B1-Enter %W %x %y
    }

    # Keyboard bindings
    #
    tixBind TixGrid <Up> {
	tixGrid:DirKey %W up
    }
    tixBind TixGrid <Down> {
	tixGrid:DirKey %W down
    }
    tixBind TixGrid <Left> {
	tixGrid:DirKey %W left
    }
    tixBind TixGrid <Right> {
	tixGrid:DirKey %W right
    }
    tixBind TixGrid <Prior> {
	%W yview scroll -1 pages
    }
    tixBind TixGrid <Next> {
	%W yview scroll 1 pages
    }
    tixBind TixGrid <Return> {
	tixGrid:Return %W 
    }
    tixBind TixGrid <space> {
	tixGrid:Space %W 
    }
}

#----------------------------------------------------------------------
#
#
#			 Mouse bindings
#
#
#----------------------------------------------------------------------

proc tixGrid:Button-1 {w x y} {
    if {[$w cget -state] == "disabled"} {
	return
    }
    tixGrid:SetFocus $w

    case [tixGrid:GetState $w] {
	{0} {
	    tixGrid:GoState 1 $w $x $y
       	}
    }
}

proc tixGrid:Shift-Button-1 {w x y} {
    if {[$w cget -state] == "disabled"} {
	return
    }
    tixGrid:SetFocus $w

    case [tixGrid:GetState $w] {
    }
}

proc tixGrid:Control-Button-1 {w x y} {
    if {[$w cget -state] == "disabled"} {
	return
    }
    tixGrid:SetFocus $w

    case [tixGrid:GetState $w] {
	{s0} {
	    tixGrid:GoState s1 $w $x $y
       	}
	{b0} {
	    tixGrid:GoState b1 $w $x $y
       	}
	{m0} {
	    tixGrid:GoState m1 $w $x $y
       	}
	{e0} {
	    tixGrid:GoState e10 $w $x $y
       	}
    }
}

proc tixGrid:ButtonRelease-1 {w x y} {
    case [tixGrid:GetState $w] {
	{2} {
	    tixGrid:GoState 5 $w $x $y
	}
	{4} {
	    tixGrid:GoState 3 $w $x $y
	}
    }
}

proc tixGrid:B1-Motion {w x y} {
    case [tixGrid:GetState $w] {
	{2 4} {
	    tixGrid:GoState 4 $w $x $y
	}
    }
}

proc tixGrid:Control-B1-Motion {w x y} {
    case [tixGrid:GetState $w] {
	{s2 s4} {
	    tixGrid:GoState s4 $w $x $y 
	}
	{b2 b4} {
	    tixGrid:GoState b4 $w $x $y 
	}
	{m2 m5} {
	    tixGrid:GoState m4 $w $x $y 
	}
    }
}

proc tixGrid:Double-1 {w x y} {
    case [tixGrid:GetState $w] {
	{s0} {
	    tixGrid:GoState s7 $w $x $y
	}
	{b0} {
	    tixGrid:GoState b7 $w $x $y
	}
    }
}

proc tixGrid:B1-Leave {w} {
    case [tixGrid:GetState $w] {
	{s2 s4} {
	    tixGrid:GoState s5 $w
	}
	{b2 b4} {
	    tixGrid:GoState b5 $w
	}
	{m2 m5} {
	    tixGrid:GoState m8 $w
	}
	{e2 e5} {
	    tixGrid:GoState e8 $w
	}
    }
}

proc tixGrid:B1-Enter {w x y} {
    case [tixGrid:GetState $w] {
	{s5 s6} {
	    tixGrid:GoState s4 $w $x $y
	}
	{b5 b6} {
	    tixGrid:GoState b4 $w $x $y
	}
	{m8 m9} {
	    tixGrid:GoState m4 $w $x $y
	}
	{e8 e9} {
	    tixGrid:GoState e4 $w $x $y
	}
    }
}

proc tixGrid:Control-B1-Leave {w} {
    case [tixGrid:GetState $w] {
	{s2 s4} {
	    tixGrid:GoState s5 $w
	}
	{b2 b4} {
	    tixGrid:GoState b5 $w
	}
	{m2 m5} {
	    tixGrid:GoState m8 $w
	}
    }
}

proc tixGrid:Control-B1-Enter {w x y} {
    case [tixGrid:GetState $w] {
	{s5 s6} {
	    tixGrid:GoState s4 $w $x $y
	}
	{b5 b6} {
	    tixGrid:GoState b4 $w $x $y
	}
	{m8 m9} {
	    tixGrid:GoState m4 $w $x $y
	}
    }
}

proc tixGrid:AutoScan {w} {
    case [tixGrid:GetState $w] {
	{s5 s6} {
	    tixGrid:GoState s6 $w
	}
	{b5 b6} {
	    tixGrid:GoState b6 $w
	}
	{m8 m9} {
	    tixGrid:GoState m9 $w
	}
	{e8 e9} {
	    tixGrid:GoState e9 $w
	}
    }
}

#----------------------------------------------------------------------
#
#
#			 Key bindings
#
#
#----------------------------------------------------------------------
proc tixGrid:DirKey {w key} {
    if {[$w cget -state] == "disabled"} {
	return
    }
    case [tixGrid:GetState $w] {
	{s0} {
	    tixGrid:GoState s8 $w $key
       	}
	{b0} {
	    tixGrid:GoState b8 $w $key
       	}
    }
}

proc tixGrid:Return {w} {
    if {[$w cget -state] == "disabled"} {
	return
    }
    case [tixGrid:GetState $w] {
	{s0} {
	    tixGrid:GoState s9 $w
       	}
	{b0} {
	    tixGrid:GoState b9 $w
       	}
    }
}

proc tixGrid:Space {w} {
    if {[$w cget -state] == "disabled"} {
	return
    }
    case [tixGrid:GetState $w] {
	{s0} {
	    tixGrid:GoState s10 $w
       	}
 	{b0} {
	    tixGrid:GoState b10 $w
       	}
   }
}

#----------------------------------------------------------------------
#
#			STATE MANIPULATION
#
#
#----------------------------------------------------------------------
proc tixGrid:GetState {w} {
    global $w:priv:state

    if {![info exists $w:priv:state]} {
	set $w:priv:state 0
    }
    return [set $w:priv:state]
}

proc tixGrid:SetState {w n} {
    global $w:priv:state

    set $w:priv:state $n
}

proc tixGrid:GoState {n w args} {

#   puts "going from [tixGrid:GetState $w] --> $n"

    tixGrid:SetState $w $n
    eval tixGrid:GoState-$n $w $args
}

#----------------------------------------------------------------------
#		   SELECTION ROUTINES
#----------------------------------------------------------------------
proc tixGrid:SelectSingle {w ent} {
    $w selection set [lindex $ent 0] [lindex $ent 1]
    tixGrid:CallBrowseCmd $w $ent
}

#----------------------------------------------------------------------
#	SINGLE SELECTION
#----------------------------------------------------------------------
proc tixGrid:GoState-0 {w} {
    set list $w:_list
    global $list

    if [info exists $list] {
	foreach cmd [set $list] {
	    uplevel #0 $cmd
	}
	if [info exists $list] {
	    unset $list
	}
    }
}

proc tixGrid:GoState-1 {w x y} {
    set ent [$w nearest $x $y]
    if {$ent != ""} {
	tixGrid:SetAnchor $w $ent
    }
    tixGrid:CheckEdit $w
    $w selection clear 0 0 max max

    if [string compare [$w cget -selectmode] single] {
	tixGrid:SelectSingle $w $ent
    }
    tixGrid:GoState 2 $w
}

proc tixGrid:GoState-2 {w} {
}

proc tixGrid:GoState-3 {w x y} {
    set ent [$w nearest $x $y]

    if {$ent != ""} {
	tixGrid:SelectSingle $w $ent
    }
    tixGrid:GoState 0 $w
}

proc tixGrid:GoState-5 {w x y} {
    set ent [$w nearest $x $y]

    if {$ent != ""} {
	tixGrid:SelectSingle $w $ent
	tixGrid:SetEdit $w $ent
    }
    tixGrid:GoState 0 $w
}


proc tixGrid:GoState-4 {w x y} {
    set ent [$w nearest $x $y]

    case [$w cget -selectmode] {
	single {
	    tixGrid:SetAnchor $w $ent
	}
	browse {
	    tixGrid:SetAnchor $w $ent
	    $w selection clear 0 0 max max
	    tixGrid:SelectSingle $w $ent
	}
	{multiple extended} {
	    set anchor [$w anchor get]
	    $w selection adjust [lindex $anchor 0] [lindex $anchor 1]  		[lindex $ent 0] [lindex $ent 1]
	}
    }
}

proc tixGrid:GoState-s5 {w} {
    tixGrid:StartScan $w
}

proc tixGrid:GoState-s6 {w} {
    global tkPriv

    tixGrid:DoScan $w
}

proc tixGrid:GoState-s7 {w x y} {
    set ent [$w nearest $x $y]

    if {$ent != ""} {
	$w selection clear
	$w selection set $ent
	tixGrid:CallCommand $w $ent
    }
    tixGrid:GoState s0 $w
}

proc tixGrid:GoState-s8 {w key} {
    set anchor [$w info anchor]

    if {$anchor == ""} {
	set anchor 0
    } else {
	set anchor [$w info $key $anchor]
    }

    $w anchor set $anchor
    $w see $anchor
    tixGrid:GoState s0 $w
}

proc tixGrid:GoState-s9 {w} {
    set anchor [$w info anchor]

    if {$anchor == ""} {
	set anchor 0
	$w anchor set $anchor
	$w see $anchor
    }

    if {[$w info anchor] != ""} {
	# ! may not have any elements
	#
	tixGrid:CallCommand $w [$w info anchor]
	$w selection clear 
	$w selection set $anchor
    }

    tixGrid:GoState s0 $w
}

proc tixGrid:GoState-s10 {w} {
    set anchor [$w info anchor]

    if {$anchor == ""} {
	set anchor 0
	$w anchor set $anchor
	$w see $anchor
    }

    if {[$w info anchor] != ""} {
	# ! may not have any elements
	#
	tixGrid:CallBrowseCmd $w [$w info anchor]
	$w selection clear 
	$w selection set $anchor
    }

    tixGrid:GoState s0 $w
}

#----------------------------------------------------------------------
#	BROWSE SELECTION
#----------------------------------------------------------------------
proc tixGrid:GoState-b0 {w} {
}

proc tixGrid:GoState-b1 {w x y} {
    set ent [$w nearest $x $y]
    if {$ent != ""} {
	$w anchor set $ent
	$w selection clear
	$w selection set $ent
	tixGrid:CallBrowseCmd $w $ent
    }
    tixGrid:GoState b2 $w
}

proc tixGrid:GoState-b2 {w} {
}

proc tixGrid:GoState-b3 {w} {
    set ent [$w info anchor]
    if {$ent != ""} {
	$w selection clear
	$w selection set $ent
	tixGrid:CallBrowseCmd $w $ent
    }
    tixGrid:GoState b0 $w
}

proc tixGrid:GoState-b4 {w x y} {
    set ent [$w nearest $x $y]
    if {$ent != ""} {
	$w anchor set $ent
	$w selection clear
	$w selection set $ent
	tixGrid:CallBrowseCmd $w $ent
    }
}

proc tixGrid:GoState-b5 {w} {
    tixGrid:StartScan $w
}

proc tixGrid:GoState-b6 {w} {
    global tkPriv

    tixGrid:DoScan $w
}

proc tixGrid:GoState-b7 {w x y} {
    set ent [$w nearest $x $y]

    if {$ent != ""} {
	$w selection clear
	$w selection set $ent
	tixGrid:CallCommand $w $ent
    }
    tixGrid:GoState b0 $w
}

proc tixGrid:GoState-b8 {w key} {
    set anchor [$w info anchor]

    if {$anchor == ""} {
	set anchor 0
    } else {
	set anchor [$w info $key $anchor]
    }

    $w anchor set $anchor
    $w selection clear
    $w selection set $anchor
    $w see $anchor

    tixGrid:CallBrowseCmd $w $anchor
    tixGrid:GoState b0 $w
}

proc tixGrid:GoState-b9 {w} {
    set anchor [$w info anchor]

    if {$anchor == ""} {
	set anchor 0
	$w anchor set $anchor
	$w see $anchor
    }

    if {[$w info anchor] != ""} {
	# ! may not have any elements
	#
	tixGrid:CallCommand $w [$w info anchor]
	$w selection clear 
	$w selection set $anchor
    }

    tixGrid:GoState b0 $w
}

proc tixGrid:GoState-b10 {w} {
    set anchor [$w info anchor]

    if {$anchor == ""} {
	set anchor 0
	$w anchor set $anchor
	$w see $anchor
    }

    if {[$w info anchor] != ""} {
	# ! may not have any elements
	#
	tixGrid:CallBrowseCmd $w [$w info anchor]
	$w selection clear 
	$w selection set $anchor
    }

    tixGrid:GoState b0 $w
}

#----------------------------------------------------------------------
#	MULTIPLE SELECTION
#----------------------------------------------------------------------
proc tixGrid:GoState-m0 {w} {
}

proc tixGrid:GoState-m1 {w x y} {
    set ent [$w nearest $x $y]
    if {$ent != ""} {
	$w anchor set $ent
	$w selection clear
	$w selection set $ent
	tixGrid:CallBrowseCmd $w $ent
    }
    tixGrid:GoState m2 $w
}

proc tixGrid:GoState-m2 {w} {
}

proc tixGrid:GoState-m3 {w} {
    set ent [$w info anchor]
    if {$ent != ""} {
	tixGrid:CallBrowseCmd $w $ent
    }
    tixGrid:GoState m0 $w
}

proc tixGrid:GoState-m4 {w x y} {
    set from [$w info anchor]
    set to   [$w nearest $x $y]
    if {$to != ""} {
	$w selection clear
	$w selection set $from $to
	tixGrid:CallBrowseCmd $w $to
    }
    tixGrid:GoState m5 $w
}

proc tixGrid:GoState-m5 {w} {
}

proc tixGrid:GoState-m6 {w x y} {
    set ent [$w nearest $x $y]
    if {$ent != ""} {
	tixGrid:CallBrowseCmd $w $ent
    }
    tixGrid:GoState m0 $w  
}

proc tixGrid:GoState-m7 {w x y} {
    set from [$w info anchor]
    set to   [$w nearest $x $y]
    if {$from == ""} {
	set from $to
	$w anchor set $from
    }
    if {$to != ""} {
	$w selection clear
	$w selection set $from $to
	tixGrid:CallBrowseCmd $w $to
    }
    tixGrid:GoState m5 $w
}


proc tixGrid:GoState-m8 {w} {
    tixGrid:StartScan $w
}

proc tixGrid:GoState-m9 {w} {
    tixGrid:DoScan $w
}

proc tixGrid:GoState-xm7 {w x y} {
    set ent [$w nearest $x $y]

    if {$ent != ""} {
	$w selection clear
	$w selection set $ent
	tixGrid:CallCommand $w $ent
    }
    tixGrid:GoState m0 $w
}

#----------------------------------------------------------------------
#	EXTENDED SELECTION
#----------------------------------------------------------------------
proc tixGrid:GoState-e0 {w} {
}

proc tixGrid:GoState-e1 {w x y} {
    set ent [$w nearest $x $y]
    if {$ent != ""} {
	$w anchor set $ent
	$w selection clear
	$w selection set $ent
	tixGrid:CallBrowseCmd $w $ent
    }
    tixGrid:GoState e2 $w
}

proc tixGrid:GoState-e2 {w} {
}

proc tixGrid:GoState-e3 {w} {
    set ent [$w info anchor]
    if {$ent != ""} {
	tixGrid:CallBrowseCmd $w $ent
    }
    tixGrid:GoState e0 $w
}

proc tixGrid:GoState-e4 {w x y} {
    set from [$w info anchor]
    set to   [$w nearest $x $y]
    if {$to != ""} {
	$w selection clear
	$w selection set $from $to
	tixGrid:CallBrowseCmd $w $to
    }
    tixGrid:GoState e5 $w
}

proc tixGrid:GoState-e5 {w} {
}

proc tixGrid:GoState-e6 {w x y} {
    set ent [$w nearest $x $y]
    if {$ent != ""} {
	tixGrid:CallBrowseCmd $w $ent
    }
    tixGrid:GoState e0 $w  
}

proc tixGrid:GoState-e7 {w x y} {
    set from [$w info anchor]
    set to   [$w nearest $x $y]
    if {$from == ""} {
	set from $to
	$w anchor set $from
    }
    if {$to != ""} {
	$w selection clear
	$w selection set $from $to
	tixGrid:CallBrowseCmd $w $to
    }
    tixGrid:GoState e5 $w
}


proc tixGrid:GoState-e8 {w} {
    tixGrid:StartScan $w
}

proc tixGrid:GoState-e9 {w} {
    tixGrid:DoScan $w
}

proc tixGrid:GoState-e10 {w x y} {
    set ent [$w nearest $x $y]
    if {$ent != ""} {
	if {[$w info anchor] == ""} {
	    $w anchor set $ent
	}
	if [$w selection includes $ent] {
	    $w selection clear $ent
	} else {
	    $w selection set $ent
	}
	tixGrid:CallBrowseCmd $w $ent
    }
    tixGrid:GoState e2 $w
}

proc tixGrid:GoState-xm7 {w x y} {
    set ent [$w nearest $x $y]

    if {$ent != ""} {
	$w selection clear
	$w selection set $ent
	tixGrid:CallCommand $w $ent
    }
    tixGrid:GoState e0 $w
}

#----------------------------------------------------------------------
#	HODGE PODGE
#----------------------------------------------------------------------

proc tixGrid:GoState-12 {w x y} {
    tkCancelRepeat
    tixGrid:GoState 5 $w $x $y 
}

proc tixGrid:GoState-13 {w ent oldEnt} {
    global tkPriv
    set tkPriv(tix,indicator) $ent
    set tkPriv(tix,oldEnt)    $oldEnt
    tixGrid:IndicatorCmd $w <Arm> $ent
}

proc tixGrid:GoState-14 {w x y} {
    global tkPriv

    if [tixGrid:InsideArmedIndicator $w $x $y] {
	$w anchor set $tkPriv(tix,indicator)
	$w select clear
	$w select set $tkPriv(tix,indicator)
	tixGrid:IndicatorCmd $w <Activate> $tkPriv(tix,indicator)
    } else {
	tixGrid:IndicatorCmd $w <Disarm>   $tkPriv(tix,indicator)
    }

    unset tkPriv(tix,indicator)
    tixGrid:GoState 0 $w
}

proc tixGrid:GoState-16 {w ent} {
    if {$ent == ""} {
	return
    }
    if {[$w cget -selectmode] != "single"} {
	tixGrid:Select $w $ent
	tixGrid:Browse $w $ent
    }
}

proc tixGrid:GoState-18 {w} {
    global tkPriv
    tkCancelRepeat
    tixGrid:GoState 6 $w $tkPriv(x) $tkPriv(y) 
}

proc tixGrid:GoState-20 {w x y} {
    global tkPriv

    if {![tixGrid:InsideArmedIndicator $w $x $y]} {
	tixGrid:GoState 21 $w $x $y
    } else {
	tixGrid:IndicatorCmd $w <Arm> $tkPriv(tix,indicator)
    }
}

proc tixGrid:GoState-21 {w x y} {
    global tkPriv

    if {[tixGrid:InsideArmedIndicator $w $x $y]} {
	tixGrid:GoState 20 $w $x $y
    } else {
	tixGrid:IndicatorCmd $w <Disarm> $tkPriv(tix,indicator)
    }
}

proc tixGrid:GoState-22 {w} {
    global tkPriv

    if {$tkPriv(tix,oldEnt) != ""} {
	$w anchor set $tkPriv(tix,oldEnt)
    } else {
	$w anchor clear
    }
    tixGrid:GoState 0 $w
}


#----------------------------------------------------------------------
#			callback actions
#----------------------------------------------------------------------
proc tixGrid:SetAnchor {w ent} {
    if [string compare $ent ""] {
	$w anchor set [lindex $ent 0] [lindex $ent 1]
#	$w see $ent
    }
}

proc tixGrid:Select {w ent} {
    $w selection clear
    $w select set $ent
}

proc tixGrid:StartScan {w} {
    global tkPriv
    set tkPriv(afterId) [after 50 tixGrid:AutoScan $w]
}

proc tixGrid:DoScan {w} {
    global tkPriv
    set x $tkPriv(x)
    set y $tkPriv(y)
    set X $tkPriv(X)
    set Y $tkPriv(Y)

    set out 0
    if {$y >= [winfo height $w]} {
	$w yview scroll 1 units
	set out 1
    }
    if {$y < 0} {
	$w yview scroll -1 units
	set out 1
    }
    if {$x >= [winfo width $w]} {
	$w xview scroll 2 units
	set out 1
    } 
    if {$x < 0} {
	$w xview scroll -2 units
	set out 1
    }

    if {$out} {
	set tkPriv(afterId) [after 50 tixGrid:AutoScan $w]
    }
}

proc tixGrid:CallBrowseCmd {w ent} {
    return

    set browsecmd [$w cget -browsecmd]
    if {$browsecmd != ""} {
	set bind(specs) {%V}
	set bind(%V)    $ent

	tixEvalCmdBinding $w $browsecmd bind $ent
    }
}

proc tixGrid:CallCommand {w ent} {
    set command [$w cget -command]
    if {$command != ""} {
	set bind(specs) {%V}
	set bind(%V)    $ent

	tixEvalCmdBinding $w $command bind $ent
    }
}

# tixGrid:EditCell --
#
#	This command is called when "$w edit set $x $y" is called. It causes
#	an SetEdit call when the grid's state is 0.
#
proc tixGrid:EditCell {w x y} {
    set list $w:_list
    global $list

    case [tixGrid:GetState $w] {
	{0} {
	    tixGrid:SetEdit $w [list $x $y]
       	}
	default {
	    lappend $list [list tixGrid:SetEdit $w [list $x $y]]
	}
    }
}

# tixGrid:EditApply --
#
#	This command is called when "$w edit apply $x $y" is called. It causes
#	an CheckEdit call when the grid's state is 0.
#
proc tixGrid:EditApply {w} {
    set list $w:_list
    global $list

    case [tixGrid:GetState $w] {
	{0} {
	    tixGrid:CheckEdit $w
       	}
	default {
	    lappend $list [list tixGrid:CheckEdit $w]
	}
    }
}

# tixGrid:CheckEdit --
#
#	This procedure is called when the user sets the focus on a cell.
#	If another cell is being edited, apply the changes of that cell.
#
proc tixGrid:CheckEdit {w} {
    set edit $w.tixpriv__edit
    if [winfo exists $edit] {
	#
	# If it -command is not empty, it is being used for another cell.
	# Invoke it so that the other cell can be updated.
	#
	if ![tixStrEq [$edit cget -command] ""] {
	    $edit invoke
	}
    }
}

# tixGrid:SetEdit --
#
#	Puts a floatentry on top of an editable entry.
#
proc tixGrid:SetEdit {w ent} {
    set edit $w.tixpriv__edit
    tixGrid:CheckEdit $w

    set editnotifycmd [$w cget -editnotifycmd]
    if [tixStrEq $editnotifycmd ""] {
	return
    }
    set px [lindex $ent 0]
    set py [lindex $ent 1]

    if ![uplevel #0 $editnotifycmd $px $py] {
	return
    }
    if [$w info exists $px $py] {
	if [catch {
	    set oldValue [$w entrycget $px $py -text]
	}] {
	    # The entry doesn't support -text option. Can't edit it.
	    #
	    # If the application wants to force editing of an entry, it could
	    # delete or replace the entry in the editnotifyCmd procedure.
	    #
	    return
	}
    } else {
	set oldValue ""
    }

    set bbox [$w info bbox [lindex $ent 0] [lindex $ent 1]]
    set x [lindex $bbox 0]
    set y [lindex $bbox 1]
    set W [lindex $bbox 2]
    set H [lindex $bbox 3]

    if ![winfo exists $edit] {
	tixFloatEntry $edit
    }

    $edit config -command "tixGrid:DoneEdit $w $ent"
    $edit post $x $y $W $H

    $edit config -value $oldValue
}

proc tixGrid:DoneEdit {w x y args} {
    set edit $w.tixpriv__edit
    $edit config -command ""
    $edit unpost

    set value [tixEvent value]
    if [$w info exists $x $y] {
	if [catch {
	    $w entryconfig $x $y -text $value
	}] {
	    return
	}
    } elseif ![tixStrEq $value ""] {	
	if [catch {
	    # This needs to be catch'ed because the default itemtype may
	    # not support the -text option
	    #
	    $w set $x $y -text $value
	}] {
	    return
	}
    } else {
	return
    }

    set editDoneCmd [$w cget -editdonecmd]
    if ![tixStrEq $editDoneCmd ""] {
	uplevel #0 $editDoneCmd $x $y
    }
}

proc tixGrid:SetFocus {w} {
    if [$w cget -takefocus] {
	if ![string match $w.* [focus -displayof $w]] {
	    focus $w
	}
    }
}

 # HList.tcl --
#
#	This file defines the default bindings for Tix Hierarchical Listbox
#	widgets.
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#



#--------------------------------------------------------------------------
# tkPriv elements used in this file:
#
# afterId -		Token returned by "after" for autoscanning.
# fakeRelease -		Cancel the ButtonRelease-1 after the user double click
#--------------------------------------------------------------------------
#
proc tixHListBind {} {
    tixBind TixHList <ButtonPress-1> {
	tixHList:Button-1 %W %x %y ""
    }
    tixBind TixHList <Shift-ButtonPress-1> {
	tixHList:Button-1 %W %x %y s
    }
    tixBind TixHList <Control-ButtonPress-1> {
	tixHList:Button-1 %W %x %y c
    }
    tixBind TixHList <ButtonRelease-1> {
	tixHList:ButtonRelease-1 %W %x %y
    }
    tixBind TixHList <Double-ButtonPress-1> {
	tixHList:Double-1 %W  %x %y
    }
    tixBind TixHList <B1-Motion> {
	set tkPriv(x) %x 
	set tkPriv(y) %y
	set tkPriv(X) %X
	set tkPriv(Y) %Y

	tixHList:B1-Motion %W %x %y
    }
    tixBind TixHList <B1-Leave> {
	set tkPriv(x) %x 
	set tkPriv(y) %y
	set tkPriv(X) %X
	set tkPriv(Y) %Y

	tixHList:B1-Leave %W
    }
    tixBind TixHList <B1-Enter> {
	tixHList:B1-Enter %W %x %y
    }

    # Keyboard bindings
    #
    tixBind TixHList <Up> {
	tixHList:UpDown %W prev ""
    }
    tixBind TixHList <Down> {
	tixHList:UpDown %W next ""
    }
    tixBind TixHList <Shift-Up> {
	tixHList:UpDown %W prev s
    }
    tixBind TixHList <Shift-Down> {
	tixHList:UpDown %W next s
    }
    tixBind TixHList <Left> {
	tixHList:LeftRight %W left
    }
    tixBind TixHList <Right> {
	tixHList:LeftRight %W right
    }
    tixBind TixHList <Prior> {
	%W yview scroll -1 pages
    }
    tixBind TixHList <Next> {
	%W yview scroll 1 pages
    }
    tixBind TixHList <Return> {
	tixHList:Keyboard-Activate %W 
    }
    tixBind TixHList <space> {
	tixHList:Keyboard-Browse %W 
    }
}

#----------------------------------------------------------------------
#
#
#			 Key bindings
#
#
#----------------------------------------------------------------------
proc tixHList:Keyboard-Activate {w} {
    if {[tixHList:GetState $w] != 0} {
	return
    }
    set ent [$w info anchor]

    if {$ent == ""} {
	return
    }

    if {[$w cget -selectmode] == "single"} {
	$w select clear
	$w select set $ent
    }

    set command [$w cget -command]
    if {$command != ""} {
	set bind(specs) {%V}
	set bind(%V)    $ent

	tixEvalCmdBinding $w $command bind $ent
    }
}

proc tixHList:Keyboard-Browse {w} {
    if {[tixHList:GetState $w] != 0} {
	return
    }
    set ent [$w info anchor]

    if {$ent == ""} {
	return
    }

    if {[$w cget -selectmode] == "single"} {
	$w select clear
	$w select set $ent
    }

    tixHList:Browse $w $ent
}

proc tixHList:LeftRight {w spec} {
    catch {
	uplevel #0 unset $w:priv:shiftanchor
    }
    if {[tixHList:GetState $w] != 0} {
	return
    }

    set anchor [$w info anchor]
    if {$anchor == ""} {
	set anchor [lindex [$w info children] 0]
    }
    if {$anchor == ""} {
	return
    }

    set ent $anchor
    while {1} {
	set e $ent
	if {$spec == "left"} {
	    set ent [$w info parent $e]

	    if {$ent == "" || [$w entrycget $ent -state] == "disabled"} {
		set ent [$w info prev $e]
	    }
	} else {
	    set ent [lindex [$w info children $e] 0]

	    if {$ent == "" || [$w entrycget $ent -state] == "disabled"} {
		set ent [$w info next $e]
	    }
	}

	if {$ent == ""} {
	    break
	}
 	if {[$w entrycget $ent -state] == "disabled"} {
	    continue
	}
 	if [$w info hidden $ent] {
	    continue
	}
	break
    }

    if {$ent == ""} {
       return
    }

    $w anchor set $ent
    $w see $ent

    if {[$w cget -selectmode] != "single"} {
	$w select clear
	$w selection set $ent

	tixHList:Browse $w $ent
    }
}

proc tixHList:UpDown {w spec mod} {
    if {[tixHList:GetState $w] != 0} {
	return
    }
    set anchor [$w info anchor]
    set done 0

    if {$anchor == ""} {
	set anchor [lindex [$w info children] 0]

	if {$anchor == ""} {
	    return
	}

	if {[$w entrycget $anchor -state] != "disabled"} {
	    # That's a good anchor
	    set done 1
	} else {
	    # We search for the first non-disabled entry (downward)
	    set spec next
	}
    }

    set ent $anchor
    # Find the prev/next non-disabled entry
    #
    while {!$done} {
	set ent [$w info $spec $ent]
	if {$ent == ""} {
	    break
	}
	if {[$w entrycget $ent -state] == "disabled"} {
	    continue
	}
	if [$w info hidden $ent] {
	    continue
	}
	break
    }

    if {$ent == ""} {
	return
    } else {
	$w see $ent
	$w anchor set $ent

	set selMode [$w cget -selectmode]
       if {$mod == "s" && ($selMode == "extended" || $selMode == "multiple")} {
	    global $w:priv:shiftanchor

	    if ![info exists $w:priv:shiftanchor] {
		set $w:priv:shiftanchor $anchor
	    }

	    $w selection clear
	    $w selection set $ent [set $w:priv:shiftanchor]
    
	    tixHList:Browse $w $ent
	} else {
	    catch {
		uplevel #0 unset $w:priv:shiftanchor
	    }

	    if {[$w cget -selectmode] != "single"} {
		$w select clear
		$w selection set $ent

		tixHList:Browse $w $ent
	    }
	}
    }
}

#----------------------------------------------------------------------
#
#
#			 Mouse bindings
#
#
#----------------------------------------------------------------------

proc tixHList:Button-1 {w x y mod} {
#    if {[$w cget -state] == "disabled"} {
#	return
#    }

    if [$w cget -takefocus] {
	focus $w
    }

    set selMode [$w cget -selectmode]

    case [tixHList:GetState $w] {
	{0} {
	    if {$mod == "s" && $selMode == "multiple"} {
		tixHList:GoState 28 $w $x $y
		return
	    }
	    if {$mod == "s" && $selMode == "extended"} {
		tixHList:GoState 28 $w $x $y
		return
	    }
	    if {$mod == "c" && $selMode == "extended"} {
		tixHList:GoState 33 $w $x $y
		return
	    }

	    tixHList:GoState 1 $w $x $y
	}
    }
}

proc tixHList:ButtonRelease-1 {w x y} {
    case [tixHList:GetState $w] {
	{5 16} {
	    tixHList:GoState 6 $w $x $y
	}
	{15} {
	    tixHList:GoState 17 $w $x $y
	}
	{10 11} {
	    tixHList:GoState 18 $w
	}
	{13 20} {
	    tixHList:GoState 14 $w $x $y
	}
	{21} {
	    tixHList:GoState 22 $w
	}
	{24} {
	    tixHList:GoState 25 $w
	}
	{26 28 33} {
	    tixHList:GoState 27 $w
	}
	{30} {
	    tixHList:GoState 32 $w
	}
    }
}

proc tixHList:Double-1 {w x y} {
    case [tixHList:GetState $w] {
	{0} {
	    tixHList:GoState 23 $w $x $y
	}
    }
}

proc tixHList:B1-Motion {w x y} {
    case [tixHList:GetState $w] {
	{1} {
	    tixHList:GoState 5 $w $x $y 
	}
	{5 16} {
	    tixHList:GoState 5 $w $x $y 
	}
	{13 20 21} {
	    tixHList:GoState 20 $w $x $y 
	}
	{24 26 28} {
	    tixHList:GoState 26 $w $x $y
	}
    }
}

proc tixHList:B1-Leave {w} {
    case [tixHList:GetState $w] {
	{5} {
	    tixHList:GoState 10 $w
	}
	{26} {
	    tixHList:GoState 29 $w
	}
    }
}

proc tixHList:B1-Enter {w x y} {
    case [tixHList:GetState $w] {
	{10 11} {
	    tixHList:GoState 12 $w $x $y
	}
	{29 30} {
	    tixHList:GoState 31 $w $x $y
	}
    }
}

proc tixHList:AutoScan {w} {
    case [tixHList:GetState $w] {
	{29 30} {
	    tixHList:GoState 30 $w
	}
    }
}

#----------------------------------------------------------------------
#
#			STATE MANIPULATION
#
#
#----------------------------------------------------------------------
proc tixHList:GetState {w} {
    global $w:priv:state

    if {![info exists $w:priv:state]} {
	set $w:priv:state 0
    }
    return [set $w:priv:state]
}

proc tixHList:SetState {w n} {
    global $w:priv:state

    set $w:priv:state $n
}

proc tixHList:GoState {n w args} {

#   puts "going from [tixHList:GetState $w] --> $n"

    tixHList:SetState $w $n
    eval tixHList:GoState-$n $w $args
}

#----------------------------------------------------------------------
#			States
#----------------------------------------------------------------------
proc tixHList:GoState-0 {w} {

}
proc tixHList:GoState-1 {w x y} {
    set oldEnt [$w info anchor]
    set ent [tixHList:SetAnchor $w $x $y 1]

    if {$ent == ""} {
	tixHList:GoState 0 $w
	return
    }

    set info [$w info item $x $y]
    if {[lindex $info 1] == "indicator"} {
	tixHList:GoState 13 $w $ent $oldEnt
    } else {
	if {[$w entrycget $ent -state] == "disabled"} {
	    tixHList:GoState 0 $w
	} else {
	    case [$w cget -selectmode] {
		{single browse} {
		    tixHList:GoState 16 $w $ent
		}
		default {
		    tixHList:GoState 24 $w $ent
		}
	    }
	}
    }
}

proc tixHList:GoState-5 {w x y} {
    set oldEnt [$w info anchor]

    set ent [tixHList:SetAnchor $w $x $y]

    if {$ent == "" || $oldEnt == $ent} {
	return
    }

    if {[$w cget -selectmode] != "single"} {
	tixHList:Select $w $ent
	tixHList:Browse $w $ent
    }
}

proc tixHList:GoState-6 {w x y} {
    set ent [tixHList:SetAnchor $w $x $y]

    if {$ent == ""} {
	tixHList:GoState 0 $w
	return
    }
    tixHList:Select $w $ent
    tixHList:Browse $w $ent

    tixHList:GoState 0 $w
}

proc tixHList:GoState-10 {w} {
    tixHList:StartScan $w
}

proc tixHList:GoState-11 {w} {
    global tkPriv

    tixHList:DoScan $w

    set oldEnt [$w info anchor]
    set ent [tixHList:SetAnchor $w $tkPriv(x) $tkPriv(y)]

    if {$ent == "" || $oldEnt == $ent} {
	return
    }

    if {[$w cget -selectmode] != "single"} {
	tixHList:Select $w $ent
	tixHList:Browse $w $ent
    }
}

proc tixHList:GoState-12 {w x y} {
    tkCancelRepeat
    tixHList:GoState 5 $w $x $y 
}

proc tixHList:GoState-13 {w ent oldEnt} {
    global tkPriv
    set tkPriv(tix,indicator) $ent
    set tkPriv(tix,oldEnt)    $oldEnt
    tixHList:CallIndicatorCmd $w <Arm> $ent
}

proc tixHList:GoState-14 {w x y} {
    global tkPriv

    if [tixHList:InsideArmedIndicator $w $x $y] {
	$w anchor set $tkPriv(tix,indicator)
	$w select clear
	$w select set $tkPriv(tix,indicator)
	tixHList:CallIndicatorCmd $w <Activate> $tkPriv(tix,indicator)
    } else {
	tixHList:CallIndicatorCmd $w <Disarm>   $tkPriv(tix,indicator)
    }

    unset tkPriv(tix,indicator)
    tixHList:GoState 0 $w
}

proc tixHList:GoState-16 {w ent} {
    if {$ent != "" && [$w cget -selectmode] != "single"} {
	tixHList:Select $w $ent
	tixHList:Browse $w $ent
    }
}

proc tixHList:GoState-18 {w} {
    global tkPriv
    tkCancelRepeat
    tixHList:GoState 6 $w $tkPriv(x) $tkPriv(y) 
}

proc tixHList:GoState-20 {w x y} {
    global tkPriv

    if {![tixHList:InsideArmedIndicator $w $x $y]} {
	tixHList:GoState 21 $w $x $y
    } else {
	tixHList:CallIndicatorCmd $w <Arm> $tkPriv(tix,indicator)
    }
}

proc tixHList:GoState-21 {w x y} {
    global tkPriv

    if {[tixHList:InsideArmedIndicator $w $x $y]} {
	tixHList:GoState 20 $w $x $y
    } else {
	tixHList:CallIndicatorCmd $w <Disarm> $tkPriv(tix,indicator)
    }
}

proc tixHList:GoState-22 {w} {
    global tkPriv

    if {$tkPriv(tix,oldEnt) != ""} {
	$w anchor set $tkPriv(tix,oldEnt)
    } else {
	$w anchor clear
    }
    tixHList:GoState 0 $w
}

proc tixHList:GoState-23 {w x y} {
    set ent [tixHList:GetNearest $w $y]

    if {$ent != ""} {
	set info [$w info item $x $y]

	if {[lindex $info 1] == "indicator"} {
	    tixHList:CallIndicatorCmd $w <Activate> $ent
	} else {
	    $w select set $ent
	    set command [$w cget -command]
	    if {$command != ""} {
		set bind(specs) {%V}
		set bind(%V)    $ent

		tixEvalCmdBinding $w $command bind $ent
	    }
	}
    }
    tixHList:GoState 0 $w
}

proc tixHList:GoState-24 {w ent} {
    if {$ent != ""} {
	tixHList:Select $w $ent
	tixHList:Browse $w $ent
    }
}

proc tixHList:GoState-25 {w} {
    set ent [$w info anchor]

    if {$ent != ""} {
	tixHList:Select $w $ent
	tixHList:Browse $w $ent
    }

    tixHList:GoState 0 $w
}


proc tixHList:GoState-26 {w x y} {
    set anchor [$w info anchor]
    if {$anchor == ""} {
	set first [lindex [$w info children ""] 0]
	if {$first != ""} {
	    $w anchor set $first
	    set anchor $first
	} else {
	    return
	}
    }

    set ent [tixHList:GetNearest $w $y 1]

    if {$ent != ""} {
	$w selection clear
	$w selection set $anchor $ent

	tixHList:Browse $w $ent
    }
}

proc tixHList:GoState-27 {w} {
    set ent [$w info anchor]

    if {$ent != ""} {
	tixHList:Browse $w $ent
    }

    tixHList:GoState 0 $w
}

proc tixHList:GoState-28 {w x y} {
    set anchor [$w info anchor]
    if {$anchor == ""} {
	set first [lindex [$w info children ""] 0]
	if {$first != ""} {
	    $w anchor set $first
	    set anchor $first
	} else {
	    return
	}
    }

    set ent [tixHList:GetNearest $w $y 1]
    if {$ent != ""} {
	$w selection clear
	$w selection set $anchor $ent

	tixHList:Browse $w $ent
    }
}

proc tixHList:GoState-29 {w} {
    tixHList:StartScan $w
}

proc tixHList:GoState-30 {w} {
    global tkPriv

    tixHList:DoScan $w

    set anchor [$w info anchor]
    if {$anchor == ""} {
	set first [lindex [$w info children ""] 0]
	if {$first != ""} {
	    $w anchor set $first
	    set anchor $first
	} else {
	    return
	}
    }

    set ent [tixHList:GetNearest $w $tkPriv(y) 1]
    if {$ent != ""} {
	$w selection clear
	$w selection set $anchor $ent

	tixHList:Browse $w $ent
    }
}

proc tixHList:GoState-31 {w x y} {
    tkCancelRepeat
    tixHList:GoState 26 $w $x $y 
}

proc tixHList:GoState-32 {w} {
    tkCancelRepeat
    tixHList:GoState 0 $w
}

proc tixHList:GoState-33 {w x y} {
    set ent [tixHList:GetNearest $w $y]
    if {$ent != ""} {
	$w anchor set $ent
	$w selection set $ent
	tixHList:Browse $w $ent
    }
}


#----------------------------------------------------------------------
#
#		Common actions
#
#----------------------------------------------------------------------
proc tixHList:GetNearest {w y {disableOK 0}} {
    set ent [$w nearest $y]

    if {$ent != ""} {
	if {!$disableOK && [$w entrycget $ent -state] == "disabled"} {
	    return ""
	}
    }

    return $ent
}

proc tixHList:SetAnchor {w x y {disableOK 0}} {
    set ent [tixHList:GetNearest $w $y $disableOK]

    if {$ent != ""} {
	if {[$w entrycget $ent -state] != "disabled"} {
	    $w anchor set $ent
	    $w see $ent
	    return $ent
	} elseif $disableOK {
	    return $ent
	}
    }

    return ""
}

proc tixHList:Select {w ent} {
    if {"x[$w info selection]" != "x$ent"} {
	$w selection clear
	$w select set $ent
    }
}

#----------------------------------------------------------------------
#
#		       Auto scan
#
#----------------------------------------------------------------------
proc tixHList:StartScan {w} {
    global tkPriv
    set tkPriv(afterId) [after 50 tixHList:AutoScan $w]
}

proc tixHList:DoScan {w} {
    global tkPriv
    set x $tkPriv(x)
    set y $tkPriv(y)
    set X $tkPriv(X)
    set Y $tkPriv(Y)

    if {$y >= [winfo height $w]} {
	$w yview scroll 1 units
    } elseif {$y < 0} {
	$w yview scroll -1 units
    } elseif {$x >= [winfo width $w]} {
	$w xview scroll 2 units
    } elseif {$x < 0} {
	$w xview scroll -2 units
    } else {
	return
    }

    set tkPriv(afterId) [after 50 tixHList:AutoScan $w]
}


#----------------------------------------------------------------------
#
#		Indicator handling
#
#----------------------------------------------------------------------

proc tixHList:CallIndicatorCmd {w event ent} {
    set cmd [$w cget -indicatorcmd]

    if {$cmd != ""} {
	set bind(type)  $event
	set bind(specs) {%V}
	set bind(%V)    $ent

	tixEvalCmdBinding $w $cmd bind $ent
    }
}

proc tixHList:InsideArmedIndicator {w x y} {
    global tkPriv

    set ent [tixHList:GetNearest $w $y 1]
    if {$ent == "" || $ent != $tkPriv(tix,indicator)} {
	return 0
    }

    set info [$w info item $x $y]
    if {[lindex $info 1] == "indicator"} {
	return 1
    } else {
	return 0
    }
}

proc tixHList:Browse {w ent} {
    set browsecmd [$w cget -browsecmd]
    if {$browsecmd != ""} {
	set bind(specs) {%V}
	set bind(%V)    $ent

	tixEvalCmdBinding $w $browsecmd bind $ent
    }
}



 # HListDD.tcl --
#
#	!!! PRE-ALPHA CODE, NOT USED, DON'T USE !!!
#
#	This file implements drag+drop for HList.
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

#
# events
#
#

proc tixHListSingle:DragTimer {w ent} {
    case [tixHListSingle:GetState $w] {
	{1} {
	    # fire up
	}
    }
}





#----------------------------------------------------------------------
#
#		    Drag + Drop Bindings
#
#----------------------------------------------------------------------

	     #----------------------------------------#
	     #	          Sending Actions	      #
	     #----------------------------------------#

#----------------------------------------------------------------------
#  tixHListSingle:Send:WaitDrag --
#
#	Sender wait for dragging action
#----------------------------------------------------------------------
proc tixHListSingle:Send:WaitDrag {w x y} {
    global tixPriv

    set ent [tixHListSingle:GetNearest $w $y]
    if {$ent != ""} {
	$w anchor set $ent
	$w select clear
	$w select set $ent
 
	set tixPriv(dd,$w:moved) 0
	set tixPriv(dd,$w:entry) $ent

#	set browsecmd [$w cget -browsecmd]
#	if {$browsecmd != "" && $ent != ""} {
#	    eval $browsecmd $ent
#	}
    }
}

proc tixHListSingle:Send:StartDrag {w x y} {
    global tixPriv
    set dd [tixGetDragDropContext $w]

    if {![info exists tixPriv(dd,$w:entry)]} {
	return
    }
    if {$tixPriv(dd,$w:entry) == ""} {
	return
    }

    if {$tixPriv(dd,$w:moved) == 0} {
	$w dragsite set $tixPriv(dd,$w:entry)
	set tixPriv(dd,$w:moved) 1
	$dd config -source $w -command "tixHListSingle:Send:Cmd $w"
	$dd startdrag $X $Y
    } else {
	$dd drag $X $Y
    }
}

proc tixHListSingle:Send:DoneDrag {w x y} {
    global tixPriv
    global moved

    if {![info exists tixPriv(dd,$w:entry)]} {
	return
    }
    if {$tixPriv(dd,$w:entry) == ""} {
	return
    }

    if {$tixPriv(dd,$w:moved) == 1} {
	set dd [tixGetDragDropContext $w]
	$dd drop $X $Y
    }
    $w dragsite clear
    catch {unset tixPriv(dd,$w:moved)}
    catch {unset tixPriv(dd,$w:entry)}
}

proc tixHListSingle:Send:Cmd {w option args} {
    set dragCmd [$w cget -dragcmd]
    if {$dragCmd != ""} {
	return [eval $dragCmd $option $args]
    }

    # Perform the default action
    #
    case "$option" {
	who {
	    return $w
	}
	types {
	    return {data text}
	}
	get {
	    global tixPriv
	    if {[lindex $args 0] == "text"} {
		if {$tixPriv(dd,$w:entry) != ""} {
		    return [$w entrycget $tixPriv(dd,$w:entry) -text]
		}
	    }
	    if {[lindex $args 0] == "data"} {
		if {$tixPriv(dd,$w:entry) != ""} {
		    return [$w entrycget $tixPriv(dd,$w:entry) -data]
		}
	    }
	}
    }
}

	     #----------------------------------------#
	     #	          Receiving Actions	      #
	     #----------------------------------------#
proc tixHListSingle:Rec:DragOver {w sender x y} {
    if {[$w cget -selectmode] != "dragdrop"} {
	return
    }

    set ent [tixHListSingle:GetNearest $w $y]
    if {$ent != ""} {
	$w dropsite set $ent
    } else {
	$w dropsite clear
    }
}

proc tixHListSingle:Rec:DragIn {w sender x y} {
    if {[$w cget -selectmode] != "dragdrop"} {
	return
    }
    set ent [tixHListSingle:GetNearest $w $y]
    if {$ent != ""} {
	$w dropsite set $ent
    } else {
	$w dropsite clear
    }
}

proc tixHListSingle:Rec:DragOut {w sender x y} {
    if {[$w cget -selectmode] != "dragdrop"} {
	return
    }
    $w dropsite clear
}

proc tixHListSingle:Rec:Drop {w sender x y} {
    if {[$w cget -selectmode] != "dragdrop"} {
	return
    }
    $w dropsite clear

    set ent [tixHListSingle:GetNearest $w $y]
    if {$ent != ""} {
	$w anchor set $ent
	$w select clear
	$w select set $ent
    }
 
    set dropCmd [$w cget -dropcmd]
    if {$dropCmd != ""} {
	eval $dropCmd $sender $x $y
	return
    }

#    set browsecmd [$w cget -browsecmd]
#    if {$browsecmd != "" && $ent != ""} {
#	eval $browsecmd [list $ent]
#    }
}

tixDropBind TixHListSingle <In>   "tixHListSingle:Rec:DragIn %W %S %x %y"
tixDropBind TixHListSingle <Over> "tixHListSingle:Rec:DragOver %W %S %x %y"
tixDropBind TixHListSingle <Out>  "tixHListSingle:Rec:DragOut %W %S %x %y"
tixDropBind TixHListSingle <Drop> "tixHListSingle:Rec:Drop %W %S %x %y"

 # IconView.tcl --
#
#	This file implements the Icon View widget: the "icon" view mode of
#	the MultiView widget. It implements:
#
#	(1) Creation of the icons in the canvas subwidget.
#	(2) Automatic arrangement of the objects
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

tixWidgetClass tixIconView {
    -classname TixIconView
    -superclass tixCObjView
    -method {
	add arrange
    }
    -flag {
	-autoarrange
    }
    -static {
    }
    -configspec {
	{-autoarrange autoArrange AutoArrange 0 tixVerifyBoolean}
    }
    -default {
	{.scrollbar			auto}
	{*borderWidth			1}
	{*canvas.background		#c3c3c3}
	{*canvas.highlightBackground	#d9d9d9}
	{*canvas.relief			sunken}
	{*canvas.takeFocus		1}
	{*Scrollbar.background		#d9d9d9}
	{*Scrollbar.relief		sunken}
	{*Scrollbar.troughColor		#c3c3c3}
	{*Scrollbar.takeFocus		0}
	{*Scrollbar.width		15}
    }
    -forcecall {
    }
}

proc tixIconView:ConstructWidget {w} {
    upvar #0 $w data

    tixChainMethod $w ConstructWidget
}

proc tixIconView:SetBindings {w} {
    upvar #0 $w data

    tixChainMethod $w SetBindings

    set c $data(w:canvas)

    bind $c <1>         "tixIconView:StartDrag $w %x %y"
    bind $c <B1-Motion> "tixIconView:Drag $w %x %y"
    bind $c <ButtonRelease-1> "tixIconView:EndDrag $w"
}

proc tixIconView:StartDrag {w x y} {
    upvar #0 $w data
    global lastX lastY

    set c $data(w:canvas)
    $c raise current

    set lastX [$c canvasx $x]
    set lastY [$c canvasy $y]
}


proc tixIconView:Drag {w x y} {
    upvar #0 $w data
    global lastX lastY

    set c $data(w:canvas)
    set x [$c canvasx $x]
    set y [$c canvasy $y]
    $c move current [expr $x-$lastX] [expr $y-$lastY]
    set lastX $x
    set lastY $y
}

proc tixIconView:EndDrag {w} {
    upvar #0 $w data

    tixCallMethod $w adjustscrollregion
}

#----------------------------------------------------------------------
#
#		option configs
#----------------------------------------------------------------------
proc tixIconView:add {w tag image text} {
    upvar #0 $w data

    set cmp [image create compound -window $data(w:canvas)]

    $cmp add image -image $image
    $cmp add line
    $cmp add text -text $text

    set id [$data(w:canvas) create image 0 0 -image $cmp -anchor nw]
    $data(w:canvas) addtag $tag withtag $id

    if {$data(-autoarrange)} {
	tixWidgetDoWhenIdle tixIconView:Arrange $w 1
    }
}

# Do it in an idle handler, so that Arrange is not called before the window
# is properly mapped.
#
proc tixIconView:arrange {w} {
    tixWidgetDoWhenIdle tixIconView:Arrange $w 1
}


proc tixIconView:PackOneRow {w row y maxH bd padX padY} {
    upvar #0 $w data

    set iX [expr $bd+$padX]
    foreach i $row {
	set box [$data(w:canvas) bbox $i]
	set W [expr [lindex $box 2]-[lindex $box 0]+1]
	set H [expr [lindex $box 3]-[lindex $box 1]+1]

	set iY [expr $y + $maxH - $H]
	$data(w:canvas) coords $i $iX $iY
	incr iX [expr $W+$padX]
    }
}

# virtual method
#
proc tixIconView:PlaceWindow {w} {
    upvar #0 $w data

    if {$data(-autoarrange)} {
	tixWidgetDoWhenIdle tixIconView:Arrange $w 0
    }

    tixChainMethod $w PlaceWindow
}

proc tixIconView:Arrange {w adjust} {
    upvar #0 $w data

    set padX 2
    set padY 2

    tixIconView:ArrangeGrid $w $padX $padY
    if {$adjust} {
	tixCallMethod $w adjustscrollregion
    }
}

# the items are not packed
#
proc tixIconView:ArrangeGrid {w padX padY} {
    upvar #0 $w data

    set maxW 0
    set maxH 0
    foreach item [$data(w:canvas) find all] {
	set box [$data(w:canvas) bbox $item]
	set itemW [expr [lindex $box 2]-[lindex $box 0]+1]
	set itemH [expr [lindex $box 3]-[lindex $box 1]+1]
	if {$maxW < $itemW} {
	    set maxW $itemW
	}
	if {$maxH < $itemH} {
	    set maxH $itemH
	}
    }
    if {$maxW == 0 || $maxH == 0} {
	return
    }

    set winW [tixWinWidth $data(w:canvas)]
    set bd [expr [$data(w:canvas) cget -bd]+ 	[$data(w:canvas) cget -highlightthickness]]
    set cols [expr $winW / ($maxW+$padX)]
    if {$cols < 1} {
	set cols 1
    }
    set y $bd

    set c 0
    set x $bd
    foreach item [$data(w:canvas) find all] {
	set box [$data(w:canvas) bbox $item]
	set itemW [expr [lindex $box 2]-[lindex $box 0]+1]
	set itemH [expr [lindex $box 3]-[lindex $box 1]+1]

	set iX [expr $x + $padX + ($maxW-$itemW)/2]
	set iY [expr $y + $padY + ($maxH-$itemH)  ]

	$data(w:canvas) coords $item $iX $iY
	incr c
	incr x [expr $maxW + $padY]
	if {$c == $cols} {
	    set c 0
	    incr y [expr $maxH + $padY]
	    set x $bd
	}
    }
}

# the items are packed
#
proc tixIconView:ArrangePack {w padX padY} {
    upvar #0 $w data

    set winW [tixWinWidth $data(w:canvas)]
    set bd [expr [$data(w:canvas) cget -bd]+ 	[$data(w:canvas) cget -highlightthickness]]
    set y [expr $bd + $padY]

    set maxH 0
    set usedW $padX
    set row ""
    foreach item [$data(w:canvas) find all] {
	set box [$data(w:canvas) bbox $item]
	set itemW [expr [lindex $box 2]-[lindex $box 0]+1]
	set itemH [expr [lindex $box 3]-[lindex $box 1]+1]

	if {[expr $usedW + $itemW] > $winW} {
	    if {$row == ""} {
		# only one item in this row
		#
		$data(w:canvas) coords $item [expr $bd + $padX] $y
		incr y [expr $itemH+$padY]
		continue
	    } else {
		# this item is not in this row. Arrange the previous items
		# first
		#
		tixIconView:PackOneRow $w $row $y $maxH $bd $padX $padY

		incr y $maxH
		set row ""
		set maxH 0
		set usedW $padX
	    }
	}
	lappend row $item
	if {$maxH < $itemH} {
	    set maxH $itemH
	}
	incr usedW [expr $padX+$itemW]
    }
    if {$row != ""} {
	tixIconView:PackOneRow $w $row $y $maxH $bd $padX $padY
    }
}

#----------------------------------------------------------------------
#
#		Widget commands
#----------------------------------------------------------------------

#----------------------------------------------------------------------
#
#		Private Methods
#----------------------------------------------------------------------


 # Init.tcl --
#
#	Initializes the Tix library and performes version checking to ensure
#	the Tcl, Tk and Tix script libraries loaded matches with the binary
#	of the respective packages.
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

if ![tixStrEq $tix_library ""] {
    global auto_path
    lappend auto_path $tix_library
}

if [catch {file join a a}] {
    proc tixFileJoin {args} {
	set p [join $args /]
	regsub -all {/+} $p / p
	return $p
    }
} else {
    proc tixFileJoin {args} {
	return [eval file join $args]
   }
}

proc __tixError {errorMsg} {
    error [concat $errorMsg         "Please check your TIX_LIBRARY environment variable and "         "your Tix installation."]
}

proc __tixInit {} {
    global tix tixPriv env tix_version tix_patchLevel tk_version tix_library
    global tcl_version

    if [info exists tix(initialized)] {
	return
    }
    if {[info command "@scope"] != ""} {
	set hasItcl 1
    } else {
	set hasItcl 0
    }

    # STEP 0: Version checking using the Tcl7.5 package mechanism. This is not
    #	      done if we are linked to Tcl 7.4.
    #
    if [string compare [info command package] ""] {
	if {![string comp [info command tixScriptVersion] ""] && 
		![auto_load tixScriptVersion]} {
	    __tixError [concat "Cannot determine version of Tix script "  		"library. Requires version $tix_version."]
	}

	if !$hasItcl {
	    set pkgVersion  $tix_version.$tcl_version
	} else {
	    # The extra .1 indicates that the Tix binary is specially
	    # compiled for Itcl. This is necessary for the "package
	    # require" command to load in the correct shared library
	    # file.
	    set pkgVersion  $tix_version.$tcl_version.1
	}

	package provide Tix $pkgVersion
	if [tixStrEq $tix_library ""] {
	    package provide Tixsam $pkgVersion
	}
    }

    # STEP 1: Version checking
    #
    #
    if {![string compare [info command tixScriptVersion] ""] && 
	    ![auto_load tixScriptVersion]} {
	__tixError [concat "Cannot determine version of Tix script library. " 	    "Requires version $tix_version."]

    } elseif [string compare [tixScriptVersion] $tix_version] {
	__tixError [concat "Tix script library version ([tixScriptVersion]) " 	    "does not match binary version ($tix_version)"]

    } elseif [string compare [tixScriptPatchLevel] $tix_patchLevel] {
	__tixError [concat "Tix script library patch-level " 	    "([tixScriptPatchLevel]) does not match binary patch-level " 	    "($tix_patchLevel)"]
    }

    if [info exists errorMsg] {
	error $errorMsg
    }

    # STEP 2: Initialize file compatibility modules
    #
    #
    if [info exists tixPriv(isWindows)] {
	tixInitFileCmpt:Win
    } elseif [info exists env(WINDOWS_EMU_DEBUG)] {
	tixInitFileCmpt:Win
	tixWinFileEmu
    } else {
	tixInitFileCmpt:Unix
    }

    # STEP 3: Initialize the Tix application context
    #
    #

    tixAppContext tix

    # STEP 4: Initialize the bindings for widgets that are implemented in C
    #
    #
    if [string compare [info command tixHList] ""] {
	tixHListBind
    }
    if [string compare [info command tixTList] ""] {
	tixTListBind
    }
    if [string compare [info command tixGrid]  ""] {
	tixGridBind
    }
    tixComboBoxBind
    tixControlBind
    tixFloatEntryBind
    tixLabelEntryBind
    tixScrolledGridBind
    tixScrolledListBoxBind

    # STEP 5: Some ITCL compatibility stuff
    #
    #
    if $hasItcl {
	rename update __update

	# We use $colon$colon as a hack here. The reason is, starting from
	# Tix 4.0.6/4.1b1, all the double colons in Tix classnames have
	# been replaced by a single colon by a sed script. This modification
	# makes it possible to use Tix with ITCL without having to modify
	# the ITCL core.  However, we don't want the real double colon
	# (which means the global scope in ITCL) to be replaced.  The
	# $colon$colon just by-passes the sed script.
	#
	proc update {args} {
	    set colon :
	    @scope $colon$colon eval __update $args
	}

	rename tkwait __tkwait

	proc tkwait {args} {
	    set colon :
	    @scope $colon$colon eval __tkwait $args
	}
    }

    rename __tixError ""
    rename __tixInit ""
}

 # LabEntry.tcl --
#
# 	TixLabelEntry Widget: an entry box with a label
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#


tixWidgetClass tixLabelEntry {
    -classname TixLabelEntry
    -superclass tixLabelWidget
    -method {
    }
    -flag {
	-disabledforeground -state
    }
    -forcecall {
	-state
    }
    -static {
    }
    -configspec {
	{-disabledforeground disabledForeground DisabledForeground #303030}
	{-state state State normal}
    }
    -default {
	{.borderWidth 			0}
	{*entry.relief			sunken}
	{*entry.width			7}
	{*label.anchor			e}
	{*label.borderWidth		0}
	{*Label.font                   -Adobe-Helvetica-Bold-R-Normal--*-120-*}
	{*Entry.background		#c3c3c3}
    }
}

proc tixLabelEntry:ConstructFramedWidget {w frame} {
    upvar #0 $w data

    tixChainMethod $w ConstructFramedWidget $frame

    set data(w:entry)  [entry $frame.entry]
    pack $data(w:entry) -side left -expand yes -fill both

    # This value is used to configure the disable/normal fg of the ebtry
    #
    set data(entryfg) [$data(w:entry) cget -fg]
    set data(labelfg) [$data(w:label) cget -fg]
}

proc tixLabelEntryBind {} {
  tixBind TixLabelEntry <FocusIn>  {
    if {![tixStrEq [focus -displayof [set %W(w:entry)]] [set %W(w:entry)]]} {
	focus [%W subwidget entry]
	[set %W(w:entry)] selection from 0
	[set %W(w:entry)] selection to end
	[set %W(w:entry)] icursor end
    }
  }
}


#----------------------------------------------------------------------
#                           CONFIG OPTIONS
#----------------------------------------------------------------------
proc tixLabelEntry:config-state {w value} {
    upvar #0 $w data

    if {$value == "normal"} {
	catch {
	    $data(w:label) config -fg $data(labelfg)
	}
	$data(w:entry) config -state $value -fg $data(entryfg)
    } else {
	catch {
	    $data(w:label) config -fg $data(-disabledforeground)
	}
	$data(w:entry) config -state $value -fg $data(-disabledforeground)
    }
}

 # LabFrame.tcl --
#
# 	TixLabelFrame Widget: a frame box with a label
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

tixWidgetClass tixLabelFrame {
    -classname TixLabelFrame
    -superclass tixLabelWidget
    -method {
	frame
    }
    -flag {}
    -static {}
    -configspec {
	{-labelside labelSide LabelSide acrosstop}
	{-padx padX Pad 2}
	{-pady padY Pad 2}
    }
    -alias {}
    -default {
	{*Label.font            -Adobe-Helvetica-Bold-R-Normal--*-120-*}
	{*Label.anchor          c}
	{.frame.borderWidth	2}
	{.frame.relief		groove}
	{.border.borderWidth	2}
	{.border.relief		groove}
	{.borderWidth 	 	2}
	{.padX 		 	2}
	{.padY 		 	2}
	{.anchor 	 	sw}
    }
}

#----------------------------------------------------------------------
# Public methods
#----------------------------------------------------------------------
proc tixLabelFrame:frame {w args} {

    return [eval tixCallMethod $w subwidget frame $args]
}

 # LabWidg.tcl --
#
#	TixLabelWidget: Virtual base class. Do not instantiate
#
# 	This widget class is the base class for all widgets that has a
# 	label. Most Tix compound widgets will have a label so that
# 	the app programmer doesn't need to add labels themselvel.
#
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

# LabelSide : top, left, right, bottom, none, acrosstop
#
# public widgets:
#	frame, label
#

tixWidgetClass tixLabelWidget {
    -superclass tixPrimitive
    -classname  TixLabelWidget
    -flag {
	-label -labelside -padx -pady
    }
    -static {-labelside}
    -configspec {
	{-label label Label ""}
	{-labelside labelSide LabelSide left}
	{-padx padX Pad 0}
	{-pady padY Pad 0}
    }
}

proc tixLabelWidget:ConstructWidget {w} {
    upvar #0 $w data

    tixChainMethod $w ConstructWidget

    if {$data(-labelside) != "acrosstop"} {
	set data(w:frame) [frame $w.frame]
    } else {
	set data(pw:border) [frame $w.border]
	set data(pw:pad)    [frame $w.border.pad]
	set data(w:frame)   [frame $w.border.frame]
    }

    if {$data(-labelside) != "none"} {
	set data(w:label) [label $w.label -text $data(-label)]
    }
    tixLabelWidget:Pack $w

    tixCallMethod $w ConstructFramedWidget $data(w:frame)
}

proc tixLabelWidget:ConstructFramedWidget {w frame} {
    # Do nothing
}

proc tixLabelWidget:Pack {w} {
    upvar #0 $w data

    if [catch {tixLabelWidget:Pack-$data(-labelside) $w}] {
	error "unknown -labelside option \"$data(-labelside)\""
    }
}

proc tixLabelWidget:Pack-acrosstop {w} {
    upvar #0 $w data

    set labHalfHeight [expr [winfo reqheight $data(w:label)] / 2]
    set padHeight [expr $labHalfHeight - [$data(pw:border) cget -bd]]
    if {$padHeight < 0} {
	set padHeight 0
    }

    tixForm $data(w:label) -top 0 -left 4 	-padx [expr $data(-padx) +4] -pady $data(-pady)
    tixForm $data(pw:border) -top $labHalfHeight -bottom -1  	-left 0 -right -1 -padx $data(-padx) -pady $data(-pady)
    tixForm $data(pw:pad) -left 0 -right -1  	-top 0 -bottom $padHeight
    tixForm $data(w:frame) -top $data(pw:pad) -bottom -1  	-left 0 -right -1
}

proc tixLabelWidget:Pack-top {w} {
    upvar #0 $w data

    pack $data(w:label) -side top  	-padx $data(-padx) -pady $data(-pady)  	-fill x
    pack $data(w:frame) -side top  	-padx $data(-padx) -pady $data(-pady)  	-expand yes -fill both
}

proc tixLabelWidget:Pack-bottom {w} {
    upvar #0 $w data

    pack $data(w:label) -side bottom  	-padx $data(-padx) -pady $data(-pady)  	-fill x
    pack $data(w:frame) -side bottom  	-padx $data(-padx) -pady $data(-pady)  	-expand yes -fill both
}

proc tixLabelWidget:Pack-left {w} {
    upvar #0 $w data

    pack $data(w:label) -side left  	-padx $data(-padx) -pady $data(-pady)  	-fill y
    pack $data(w:frame) -side left  	-padx $data(-padx) -pady $data(-pady)  	-expand yes -fill both
}

proc tixLabelWidget:Pack-right {w} {
    upvar #0 $w data

    pack $data(w:label) -side right  	-padx $data(-padx) -pady $data(-pady)  	-fill x
    pack $data(w:frame) -side right  	-padx $data(-padx) -pady $data(-pady)  	-expand yes -fill both
}

proc tixLabelWidget:Pack-none {w} {
    upvar #0 $w data

    pack $data(w:frame) 	-padx $data(-padx) -pady $data(-pady)  	-expand yes -fill both
}

#----------------------------------------------------------------------
#                           CONFIG OPTIONS
#----------------------------------------------------------------------
proc tixLabelWidget:config-label {w value} {
    upvar #0 $w data

    $data(w:label) config -text $value

    if {$data(-labelside) == "acrosstop"} {
	tixLabelWidget:Pack-acrosstop $w
    }
}

 # ListNBk.tcl --
#
#	"List NoteBook" widget. Acts similarly to the notebook but uses a
#	HList widget to represent the pages.
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

tixWidgetClass tixListNoteBook {
    -classname TixListNoteBook
    -superclass tixVStack
    -method {
    }
    -flag {
	-height -width
    }
    -configspec {
	{-width width Width 0}
	{-height height Height 0}
    }
    -forcecall {
	-dynamicgeometry -width -height
    }
    -default {
	{*Orientation		horizontal}
    }
}

proc tixListNoteBook:ConstructWidget {w} {
    upvar #0 $w data

    tixChainMethod $w ConstructWidget
    set data(w_pane) [tixPanedWindow $w.pane -panerelief flat]
    set p1 [$data(w_pane) add p1 -expand 0]
    set p2 [$data(w_pane) add p2 -expand 1]
    set data(w_p2) $p2
    set data(w:shlist) [tixScrolledHList $p1.shlist]
    set data(w:hlist) [$data(w:shlist) subwidget hlist]

    if [tixStrEq [$data(w_pane) cget -orientation] vertical] {
	pack $data(w:shlist) -expand yes -fill both -padx 2 -pady 3
    } else {
	pack $data(w:shlist) -expand yes -fill both -padx 3 -pady 2
    }

    $data(w:hlist) config  	-command   "tixListNoteBook:Choose $w" 	-browsecmd "tixListNoteBook:Choose $w" 	-selectmode single

    pack $data(w_pane) -expand yes -fill both
}

proc tixListNoteBook:add {w child args} {
    upvar #0 $w data

    if [string match *.* $child] {
	error "the name of the page cannot contain the \".\" character"
    }
    return [eval tixChainMethod $w add $child $args]
}

#----------------------------------------------------------------------
# Virtual Methods
#----------------------------------------------------------------------
proc tixListNoteBook:InitGeometryManager {w} {
    tixWidgetDoWhenIdle tixListNoteBook:InitialRaise $w 
}

proc tixListNoteBook:InitialRaise {w} {
    upvar #0 $w data

    if ![string comp $data(topchild) ""] {
	set top [lindex $data(windows) 0]
    } else {
	set top $data(topchild)
    }

    if ![tixStrEq $top ""] {
	tixCallMethod $w raise $top
    }
}

proc tixListNoteBook:CreateChildFrame {w child} {
    upvar #0 $w data

    set f [frame $data(w_p2).$child]

    return $f
}

proc tixListNoteBook:RaiseChildFrame {w child} {
    upvar #0 $w data

    if [string comp $data(topchild) $child] {
	if [string comp $data(topchild) ""] {
	    pack forget $data(w:$data(topchild))
	}
	pack $data(w:$child) -expand yes -fill both
    }
}

#
#----------------------------------------------------------------------
#

proc tixListNoteBook:config-dynamicgeometry {w value} {
    upvar #0 $w data

    $data(w_pane) config -dynamicgeometry $value
}

proc tixListNoteBook:config-width {w value} {
    upvar #0 $w data

    if {$value != 0} {
	$data(w_pane) config -width $value
    }
}

proc tixListNoteBook:config-height {w value} {
    upvar #0 $w data

    if {$value != 0} {
	$data(w_pane) config -height $value
    }
}

proc tixListNoteBook:raise {w child} {
    upvar #0 $w data

    $data(w:hlist) selection clear
    $data(w:hlist) selection set $child
    $data(w:hlist) anchor set $child

    tixChainMethod $w raise $child
}

proc tixListNoteBook:Choose {w args} {
    upvar #0 $w data
 
    set entry [tixEvent flag V]

    if {[lsearch $data(windows) $entry] != -1} {
	tixCallMethod $w raise $entry
    }
}

 # Meter.tcl --
#
#	Implements the tixMeter widget
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#


tixWidgetClass tixMeter {
    -classname TixMeter
    -superclass tixPrimitive
    -method {
    }
    -flag {
	-foreground -text -value
    }
    -configspec {
	{-fillcolor fillColor FillColor #8080ff}
	{-foreground foreground Foreground black}
	{-text text Text ""}
	{-value value Value 0}
    }
    -default {
	{.relief		sunken}
	{.borderWidth		2}
	{.width			150}
    }
}

proc tixMeter:InitWidgetRec {w} {
    upvar #0 $w data
    global env

    tixChainMethod $w InitWidgetRec
}

#----------------------------------------------------------------------
#		Construct widget
#----------------------------------------------------------------------
proc tixMeter:ConstructWidget {w} {
    upvar #0 $w data

    tixChainMethod $w ConstructWidget

    set data(w:canvas) [canvas $w.canvas]
    pack $data(w:canvas) -expand yes -fill both

    tixMeter:Update $w
}

proc tixMeter:SetBindings {w} {
    upvar #0 $w data

    tixChainMethod $w SetBindings
}

proc tixMeter:Update {w} {
    upvar #0 $w data

    # set the width of the canvas
    set W [expr $data(-width)- 	([$data(w:root) cget -bd]+[$data(w:root) cget -highlightthickness]*2)]
    $data(w:canvas) config -width $W

    if {$data(-text) == ""} {
	set text [format "%d%%" [expr int($data(-value)*100)]]
    } else {
	set text $data(-text)
    }

    # (Create/Modify) the text item.
    #
    if {![info exists data(text)]} {
	set data(text) [$data(w:canvas) create text 0 0 -text $text]
    } else {
	$data(w:canvas) itemconfig $data(text) -text $text
    }

    set bbox [$data(w:canvas) bbox $data(text)]

    set itemW [expr [lindex $bbox 2]-[lindex $bbox 0]]
    set itemH [expr [lindex $bbox 3]-[lindex $bbox 1]]


    $data(w:canvas) coord $data(text) [expr $W/2] [expr $itemH/2+4]

    set H [expr $itemH + 4]
    $data(w:canvas) config -height [expr $H]


    set rectW [expr int($W*$data(-value))]

    if {![info exists data(rect)]} {
	set data(rect) [$data(w:canvas) create rectangle 0 0 $rectW 1000]
    } else {
	$data(w:canvas) coord $data(rect) 0 0 $rectW 1000
    }

    $data(w:canvas) itemconfig $data(rect)  	-fill $data(-fillcolor) -outline $data(-fillcolor)

    $data(w:canvas) raise $data(text)
}

#----------------------------------------------------------------------
# Configuration
#----------------------------------------------------------------------
proc tixMeter:config-value {w value} {
    upvar #0 $w data

    set data(-value) $value
    tixMeter:Update $w
}

proc tixMeter:config-text {w value} {
    upvar #0 $w data

    set data(-text) $value
    tixMeter:Update $w
}


 # MultView.tcl --
#
#	Implements the multi-view widget
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#


tixWidgetClass tixMultiView {
    -classname TixMultiView
    -superclass tixPrimitive
    -method {
	add
    }
    -flag {
	-browsecmd -command -view
    }
    -forcecall {
	-view
    }
    -configspec {
	{-browsecmd browseCmd BrowseCmd ""}
	{-command command Command ""}
	{-view view View icon tixMultiView:VerifyView}
    }
    -alias {
    }

    -default {
    }
}

proc tixMultiView:InitWidgetRec {w} {
    upvar #0 $w data
    global env

    tixChainMethod $w InitWidgetRec
}

#----------------------------------------------------------------------
#		Construct widget
#----------------------------------------------------------------------
proc tixMultiView:ConstructWidget {w} {
    upvar #0 $w data

    tixChainMethod $w ConstructWidget

    set data(w:stlist) [tixScrolledTList $w.stlist]
    set data(w:sgrid)  [tixScrolledGrid $w.sgrid]
    set data(w:icon)   [tixIconView  $w.icon]

    set data(w:tlist) [$data(w:stlist) subwidget tlist]
    set data(w:grid)  [$data(w:sgrid) subwidget grid]

    $data(w:grid) config -formatcmd "tixMultiView:GridFormat $w"  	-leftmargin 0 -topmargin 1
}

proc tixMultiView:SetBindings {w} {
    upvar #0 $w data

    tixChainMethod $w SetBindings
}

proc tixMultiView:GetWid {w which} {
    upvar #0 $w data

    case $which {
	list {
	    return $data(w:stlist)
	}
	icon {
	    return $data(w:icon)
	}
	detail {
	    return $data(w:sgrid)
	}
    }
}
#----------------------------------------------------------------------
# Configuration
#----------------------------------------------------------------------
proc tixMultiView:config-view {w value} {
    upvar #0 $w data

    if {$data(-view) != ""} {
	pack forget [tixMultiView:GetWid $w $data(-view)]
    }

    pack [tixMultiView:GetWid $w $value] -expand yes -fill both
}
#----------------------------------------------------------------------
# Private methods
#----------------------------------------------------------------------
proc tixMultiView:GridFormat {w area x1 y1 x2 y2} {
    upvar #0 $w data

    case $area {
	main {
	}
	{x-margin y-margin s-margin} {
	    # cborder specifies consecutive 3d borders
	    #
	    $data(w:grid) format cborder $x1 $y1 $x2 $y2  		-fill 1 -relief raised -bd 2 -bg gray60  		-selectbackground gray80
	}
    }

}

#----------------------------------------------------------------------
# Public methods
#----------------------------------------------------------------------

# Return value is the index of "$name" in the grid subwidget
#
#
proc tixMultiView:add {w name args} {
    upvar #0 $w data

    set validOptions {-image -text}

    set opt(-image)  ""
    set opt(-text)   ""

    tixHandleOptions -nounknown opt $validOptions $args

    $data(w:icon) add $name $opt(-image) $opt(-text)
    $data(w:tlist) insert end -itemtype imagetext  	-image $opt(-image) -text $opt(-text)
    $data(w:grid) set 0 end -itemtype imagetext  	-image $opt(-image) -text $opt(-text)

    return max
}

#----------------------------------------------------------------------
# checker
#----------------------------------------------------------------------
proc tixMultiView:VerifyView {value} {
    case $value {
	{icon list detail} {
	    return $value
	}
    }
    error "bad view \"$value\", must be detail, icon or list"
}


 # NoteBook.tcl --
#
#	tixNoteBook: NoteBook type of window.
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

tixWidgetClass tixNoteBook {
    -classname TixNoteBook
    -superclass tixVStack
    -method {
    }
    -flag {
    }
    -configspec {
	{-takefocus takeFocus TakeFocus 0 tixVerifyBoolean} 
    }
    -default {
	{.Background		#d9d9d9}
	{.nbframe.tabPadX	8}
	{.nbframe.tabPadY	5}
	{.nbframe.borderWidth	2}
	{.nbframe.Background	#d9d9d9}
	{*nbframe.relief	raised}
	{*nbframe.font		-Adobe-Helvetica-Bold-R-Normal--*-120-*}
	{.nbframe.inactiveBackground	#c3c3c3}
    }
}

proc tixNoteBook:InitWidgetRec {w} {
    upvar #0 $w data

    tixChainMethod $w InitWidgetRec

    set data(pad-x1) 0
    set data(pad-x2) 0
    set data(pad-y1) 20
    set data(pad-y2) 0
}

proc tixNoteBook:ConstructWidget {w} {
    upvar #0 $w data

    tixChainMethod $w ConstructWidget
    
    set data(w:top) [tixNoteBookFrame $w.nbframe -slave 1 -takefocus 1]
    set data(w:nbframe) $data(w:top)

    bind $data(w:top) <ButtonPress-1> "tixNoteBook:MouseDown $w %x %y"
    bind $data(w:top) <ButtonRelease-1> "tixNoteBook:MouseUp $w %x %y"

    bind $data(w:top) <B1-Motion> "tixNoteBook:MouseDown $w %x %y"

    bind $data(w:top) <Left>  "tixNoteBook:FocusNext $w prev"
    bind $data(w:top) <Right> "tixNoteBook:FocusNext $w next"

    bind $data(w:top) <Return> "tixNoteBook:SetFocusByKey $w"
    bind $data(w:top) <space>  "tixNoteBook:SetFocusByKey $w"
}

#----------------------------------------------------------------------
# Public methods
#----------------------------------------------------------------------
proc tixNoteBook:add {w child args} {
    upvar #0 $w data

    set ret [eval tixChainMethod $w add $child $args]

    set new_args ""
    tixForEach {flag value} $args {
	if {$flag != "-createcmd" && $flag != "-raisecmd"} {
	    lappend new_args $flag
	    lappend new_args $value
	}
    }

    eval $data(w:top) add $child $new_args

    return $ret
}

proc tixNoteBook:raise {w child} {
    upvar #0 $w data

    tixChainMethod $w raise $child

    if {[$data(w:top) pagecget $child -state] == "normal"} {
	$data(w:top) activate $child
    }
}

proc tixNoteBook:delete {w child} {
    upvar #0 $w data

    tixChainMethod $w delete $child
    $data(w:top) delete $child
}

#----------------------------------------------------------------------
# Private methods
#----------------------------------------------------------------------
proc tixNoteBook:Resize {w} {
    upvar #0 $w data

    # We have to take care of the size of the tabs so that 
    #
    set rootReq [$data(w:top) geometryinfo]
    set tW [lindex $rootReq 0]
    set tH [lindex $rootReq 1]

    set data(pad-x1) 2 
    set data(pad-x2) 2
    set data(pad-y1) [expr $tH + $data(-ipadx) + 1]
    set data(pad-y2) 2
    set data(minW)   [expr $tW]
    set data(minH)   [expr $tH]

    # Now that we know data(pad-y1), we can chain the call
    #
    tixChainMethod $w Resize
}

proc tixNoteBook:MouseDown {w x y} {
    upvar #0 $w data

    focus $data(w:top)

    set name [$data(w:top) identify $x $y]
    $data(w:top) focus $name
    set data(w:down) $name
}

proc tixNoteBook:MouseUp {w x y} {
    upvar #0 $w data

    set name [$data(w:top) identify $x $y]

    if {$name != "" && $name == $data(w:down) && [$data(w:top) pagecget $name -state] == "normal" } {
        $data(w:top) activate $name
        tixCallMethod $w raise $name
    } else {
        $data(w:top) focus ""
    }
}


#----------------------------------------------------------------------
#
# Section for keyboard bindings
#
#----------------------------------------------------------------------

proc tixNoteBook:FocusNext {w dir} {
    upvar #0 $w data

    if {[$data(w:top) info focus] == ""} {
	set name [$data(w:top) info active]
	$data(w:top) focus $name

	if {$name != ""} {
	    return
	}
    } else {
	set name [$data(w:top) info focus$dir]
 	$data(w:top) focus $name
   }
}

proc tixNoteBook:SetFocusByKey {w} {
    upvar #0 $w data

    set name [$data(w:top) info focus]

    if {$name != "" && [$data(w:top) pagecget $name -state] == "normal"} {
	tixCallMethod $w raise $name
	$data(w:top) activate $name
    }
}

#----------------------------------------------------------------------
# Automatic bindings for alt keys
#----------------------------------------------------------------------
proc tixNoteBookFind {w char} {
    global tkPriv
    set char [string tolower $char]

    foreach child [winfo child $w] {
	if {![winfo ismapped $w]} {
	    continue
	}
	switch [winfo class $child] {
	    {Toplevel} {
		continue
	    }
	    TixNoteBook {
		set nbframe [$child subwidget nbframe]
		foreach page [$nbframe info pages] {
		    set char2 [string index [$nbframe pagecget $page -label]  			[$nbframe pagecget $page -underline]]
		    if {([string compare $char [string tolower $char2]] == 0)||
			($char == "")} {
			if {[$nbframe pagecget $page -state] != "disabled"} {
			    return "$child $page"
			}
		    }
		}
	    }
	}
	# Well, this notebook doesn't match with the key, but maybe
	# it contains a "subnotebook" that will match ..
	set match [tixNoteBookFind $child $char]
	if {$match != ""} {
	    return $match
	}
    }
    return ""
}

proc tixTraverseToNoteBook {w char} {
    if {$char == ""} {
	return 0
    }
    if {![winfo exists $w]} {
	return 0
    }
    set list [tixNoteBookFind [winfo toplevel $w] $char]
    if {$list != ""} {
	[lindex $list 0] raise [lindex $list 1]
	return 1
    }
    return 0
}

#----------------------------------------------------------------------
# Set default class bindings
#----------------------------------------------------------------------

bind all <Alt-KeyPress> "+tixTraverseToNoteBook %W %A"
bind all <Meta-KeyPress> "+tixTraverseToNoteBook %W %A"


 # OldUtil.tcl -
#
#	This is an undocumented file.
#	   Are these features used in Tix : NO.
#	   Should I use these features    : NO.
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

proc setenv {name args} {
    global env

    if {[llength $args] == 1} {
        return [set env($name) [lindex $args 0]]
    } else {
        if {[info exists env($ename)] == 0} {
            tkerror "Error in setenv: "
                    "environment variable \"$name\" does not exist"
        } else {
            return $env($name)
        }
    }
}
#----------------------------------------------------------------------
#
#
#           U T I L I T Y   F U N C T I O N S  F O R   T I X 
#
#
#----------------------------------------------------------------------

# RESET THE STRING IN THE ENTRY
proc tixSetEntry {entry string} {
    set oldstate [lindex [$entry config -state] 4]
    $entry config -state normal
    $entry delete 0 end
    $entry insert 0 $string
    $entry config -state $oldstate
}

# GET THE FIRST SELECTED ITEM IN A LIST
proc tixListGetSingle {lst} {
    set indices [$lst curselection]
    if {$indices != "" } {
	return [$lst get [lindex $indices 0]]
    } else {
	return ""
    }
}

#----------------------------------------------------------------------
# RECORD A DIALOG'S POSITION AND RESTORE IT THE NEXT TIME IT IS OPENED
#----------------------------------------------------------------------
proc tixDialogRestore {w {flag -geometry}} {
    global tixDPos

    if [info exists tixDPos($w)] {
	if ![winfo ismapped $w] {
	    wm geometry $w $tixDPos($w)
	    wm deiconify $w
	}
    } elseif {$flag == "-geometry"} {
	update
	set tixDPos($w) [winfo geometry $w]
    } else {
	update
	set tixDPos($w) +[winfo rootx $w]+[winfo rooty $w]
    }
}
#----------------------------------------------------------------------
# RECORD A DIALOG'S POSITION AND RESTORE IT THE NEXT TIME IT IS OPENED
#----------------------------------------------------------------------
proc tixDialogWithdraw {w {flag -geometry}} {
    global tixDPos

    if [winfo ismapped $w] {
	if {$flag == "-geometry"} {
	    set tixDPos($w) [winfo geometry $w]
	} else {
	    set tixDPos($w) +[winfo rootx $w]+[winfo rooty $w]
	}
	wm withdraw $w
    }
}
#----------------------------------------------------------------------
# RECORD A DIALOG'S POSITION AND RESTORE IT THE NEXT TIME IT IS OPENED
#----------------------------------------------------------------------
proc tixDialogDestroy {w {flag -geometry}} {
    global tixDPos

    if [winfo ismapped $w] {
	if {$flag == "-geometry"} {
	    set tixDPos($w) [winfo geometry $w]
	} else {
	    set tixDPos($w) +[winfo rootx $w]+[winfo rooty $w]
	}
    }
    destroy $w
}

# Obsolete
#
proc tixQueryAppResource {name class default} {

    set value [option get . $name $class]
    if {$value == ""} {
	return $default
    } else {
	return $value
    }    
}
proc tixCreateToplevel {w {type -mapped}} {
    upvar #0 $w data

    toplevel $w
    wm minsize $w 0 0
    if {$type == "-withdrawn"} {
	wm withdraw $w
    }

    bind $w <Destroy>    [bind Toplevel <Destroy>]
    bind $w <Map>        [bind Toplevel <Map>]
    bind $w <Unmap>      [bind Toplevel <Unmap>]
    bind $w <Visibility> [bind Toplevel <Visibility>]
    bind $w <Destroy>    "+_tixToplevelDestroy $w"
    bind $w <Map>        "+_tixToplevelMap $w"
    bind $w <Unmap>      "+_tixToplevelUnmap $w"
    bind $w <Visibility> "+_tixToplevelVisibility $w"
}

proc _tixToplevelDestroy {w} {
    upvar #0 $w data

    unset data
}

proc _tixToplevelUnmap {w} {
    upvar #0 $w data

    foreach dlg $data(dialogs) {
	set data($dlg,geom) [winfo geometry $dlg]
	wm withdraw $dlg
    }
}

proc _tixToplevelMap {w} {
    upvar #0 $w data

    foreach dlg $data(dialogs) {
	wm geometry $dlg $data($dlg,geom)
	wm deiconify $dlg
    }
}

proc _tixToplevelVisibility {w} {
    upvar #0 $w data

    foreach dlg $data(dialogs) {
	raise $dlg $w
    }
}

proc tixCreateDialogShell {w {type -mapped}} {
    toplevel $w
    set parent [winfo parent $w]
    upvar #0 $parent data

    wm minsize $w 0 0
    wm withdraw $w
    update
    mwm transfor $w [winfo parent $w]
    lappend data(dialogs) $w
    bind $w <Destroy> "_tixDialogDestroy $w"

    if {$type != "-withdrawn"} {
	wm deiconify $w
    }
}

proc _tixDialogDestroy {w} {
    set parent [winfo parent $w]
    upvar #0 $parent data

    catch {unset $data($w,geom)}
}


proc _tixInitMainWindow {w} {
    upvar #0 $w data

    set data(dialogs) ""

    bind $w <Destroy>    +[bind Toplevel <Destroy>]
    bind $w <Map>        +[bind Toplevel <Map>]
    bind $w <Unmap>      +[bind Toplevel <Unmap>]
    bind $w <Visibility> +[bind Toplevel <Visibility>]
    bind $w <Destroy>    "+_tixToplevelDestroy $w"
    bind $w <Map>        "+_tixToplevelMap $w"
    bind $w <Unmap>      "+_tixToplevelUnmap $w"
    bind $w <Visibility> "+_tixToplevelVisibility $w"
}

# The "mwm" command comes from tkmwm, a cousin package of Tix
# If this wish does not support mwm, the following line prevent code
# that uses "mwm" from breaking.
#
if {[info commands mwm] == ""} {
    proc mwm {args} {}
}

#----------------------------------------------------------------------
# Automatically initialization call
#----------------------------------------------------------------------

# This has been disabled

if 0 {
    _tixInitMainWindow .
}


 # OptMenu.tcl --
#
#	This file implements the TixOptionMenu widget.
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#


tixWidgetClass tixOptionMenu {
    -classname TixOptionMenu
    -superclass tixLabelWidget
    -method {
	add delete disable enable entrycget entryconfigure entries
    }
    -flag {
	-command -disablecallback -dynamicgeometry -value -variable
	-validatecmd -state
    }
    -forcecall {
	-variable -state
    }
    -configspec {
	{-command command Command ""}
	{-disablecallback disableCallback DisableCallback 0 tixVerifyBoolean}
	{-dynamicgeometry dynamicGeometry DynamicGeometry 0 tixVerifyBoolean}
	{-state state State normal}
	{-value value Value ""}
	{-validatecmd validateCmd ValidateCmd ""}
	{-variable variable Variable ""}
    }
    -default {
	{.highlightThickness			0}
	{.takeFocus				0}
	{.frame.menubutton.relief		raised}
	{.frame.menubutton.borderWidth		2}
	{.frame.menubutton.anchor		w}
	{.frame.menubutton.highlightThickness	2}
	{.frame.menubutton.takeFocus		1}
    }
}

proc tixOptionMenu:InitWidgetRec {w} {
    upvar #0 $w data

    tixChainMethod $w InitWidgetRec
 
    set data(nItems)	0
    set data(items)     ""
    set data(posted)	0
    set data(varInited)	0
    set data(maxWidth)  0
}

proc tixOptionMenu:ConstructFramedWidget {w frame} {
    upvar #0 $w data

    tixChainMethod $w ConstructFramedWidget $frame

    set data(w:menubutton) [menubutton $frame.menubutton -indicatoron 1]
    set data(w:menu)       [menu $frame.menubutton.menu -tearoff 0]
    pack $data(w:menubutton) -side left -expand yes -fill both

    $data(w:menubutton) config -menu $data(w:menu)

    bind $data(w:menubutton) <Up>   [bind Menubutton <space>]
    bind $data(w:menubutton) <Down> [bind Menubutton <space>]

    tixSetMegaWidget $data(w:menubutton) $w
}

proc tixOptionMenu:SetBindings {w} {
    upvar #0 $w data

    tixChainMethod $w SetBindings
}

#----------------------------------------------------------------------
# Private methods
#----------------------------------------------------------------------
proc tixOptionMenu:Invoke {w name} {
    upvar #0 $w data

    if {"$data(-state)" == "normal"} {
	tixOptionMenu:SetValue $w $name
    }
}

proc tixOptionMenu:SetValue {w value {noUpdate 0}} {
    upvar #0 $w data

    if {$data(-validatecmd) != ""} {
	set value [tixEvalCmdBinding $w $data(-validatecmd) "" $value]
    }

    set name $value

    if {$name == "" || [info exists data(varInited)]} {
	# variable may contain a bogus value
	if {![info exists data($name,index)]} {
	    set data(-value) ""
	    tixVariable:UpdateVariable $w
	    $data(w:menubutton) config -text ""
	    return
	}
    }

    if [info exists data($name,index)] {
       $data(w:menubutton) config -text $data($name,label)

       set data(-value) $value

       if {! $noUpdate} {
	   tixVariable:UpdateVariable $w
       }

       if {$data(-command) != "" && !$data(-disablecallback)} {
	   if {![info exists data(varInited)]} {
	       set bind(specs) ""
	       tixEvalCmdBinding $w $data(-command) bind $value
	   }
       }
    } else {
	error "item \"$value\" does not exist"
    }
}

proc tixOptionMenu:SetMaxWidth {w} {
    upvar #0 $w data

    foreach name $data(items) {
	set len [string length $data($name,label)]
	if {$data(maxWidth) < $len} {
	    set data(maxWidth) $len
	}
    }

    if {$data(maxWidth) > 0} {
	$data(w:menubutton) config -width $data(maxWidth)
    }
}

#----------------------------------------------------------------------
# Configuration
#----------------------------------------------------------------------
proc tixOptionMenu:config-state {w value} {
    upvar #0 $w data

    if ![info exists data(w:label)] {
	return
    }

    if {$value == "normal"} {
	catch {
	    $data(w:label) config -fg  		[$data(w:menubutton) cget -foreground]
	}
	$data(w:menubutton) config -state $value
    } else {
	catch {
	    $data(w:label) config -fg  		[$data(w:menubutton) cget -disabledforeground]
	}
	$data(w:menubutton) config -state $value
    }
}

proc tixOptionMenu:config-value {w value} {
    upvar #0 $w data

    tixOptionMenu:SetValue $w $value

    # This will tell the Intrinsics: "Please use this value"
    # because "value" might be altered by SetValues
    #
    return $data(-value)
}

proc tixOptionMenu:config-variable {w arg} {
    upvar #0 $w data

    if [tixVariable:ConfigVariable $w $arg] {
       # The value of data(-value) is changed if tixVariable:ConfigVariable 
       # returns true
       tixOptionMenu:SetValue $w $data(-value) 1
    }
    catch {
	unset data(varInited)
    }
    set data(-variable) $arg
}

#----------------------------------------------------------------------
# Public Methdos
#----------------------------------------------------------------------
proc tixOptionMenu:add {w type name args} {
    upvar #0 $w data

    if [info exists data($name,index)] {
	error "item $name already exists in the option menu $w"
    }

    case $type {
	"command" {
	    set validOptions {
		-command -label
	    }
	    set opt(-command)		""
	    set opt(-label)		$name

	    tixHandleOptions -nounknown opt $validOptions $args

	    if {$opt(-command)	!= ""} {
		error "option -command cannot be specified"
	    }

	    # Create a new item inside the menu
	    #
	    eval $data(w:menu) add command $args  		[list -label $opt(-label)  		-command "tixOptionMenu:Invoke $w \{$name\}"]
	    set index $data(nItems)

	    # Store info about this item
	    #
	    set data($index,name) $name
	    set data($name,type) cmd
	    set data($name,label) $opt(-label)
	    set data($name,index) $index

	    if {$index == 0} {
		$data(w:menubutton) config -text $data($name,label)
		tixOptionMenu:SetValue $w $name
	    }

	    incr data(nItems)
	    lappend data(items) $name

	    if $data(-dynamicgeometry) {
		tixOptionMenu:SetMaxWidth $w
	    }
	}
	"separator" {
	    $data(w:menu) add separator

	    set index $data(nItems)
	    # Store info about this item
	    #
	    set data($index,name) $name
	    set data($name,type) sep
	    set data($name,label) ""
	    set data($name,index) $index

	    incr data(nItems)
	    lappend data(items) $name
	}
	default {
	    error "only types \"separator\" and \"command\" are allowed"
	}
    }

    return ""
}

proc tixOptionMenu:delete {w item} {
    upvar #0 $w data

    if {![info exists data($item,index)]} {
	error "item $item does not exist in $w"
    }

    # Rehash the item list
    set newItems ""
    set oldIndex 0
    set newIndex 0
    foreach name $data(items) {
	if {$item == $name} {
	    unset data($name,label)
	    unset data($name,index)
	    unset data($name,type)
	    $data(w:menu) delete $oldIndex
	} else {
	    set data($name,index)    $newIndex
	    set data($newIndex,name) $name
	    incr newIndex
	    lappend newItems $name
	}
	incr oldIndex
    }
    incr oldIndex -1; unset data($oldIndex,name)
    set data(nItems) $newIndex
    set data(items) $newItems

    if {$data(-value) == $item} {
	set newVal ""
	foreach item $data(items) {
	    if {$data($item,type) == "cmd"} {
		set newVal $item
	    }
	}
	tixOptionMenu:SetValue $w $newVal
    }

    return ""
}


proc tixOptionMenu:disable {w item} {
    upvar #0 $w data

    if {![info exists data($item,index)]} {
	error "item $item does not exist in $w"
    } else {
	catch {$data(w:menu) entryconfig $data($item,index) -state disabled}
    }
}

proc tixOptionMenu:enable {w item} {
    upvar #0 $w data

    if {![info exists data($item,index)]} {
	error "item $item does not exist in $w"
    } else {
	catch {$data(w:menu) entryconfig $data($item,index) -state normal}
    }
}

proc tixOptionMenu:entryconfigure {w item args} {
    upvar #0 $w data

    if {![info exists data($item,index)]} {
	error "item $item does not exist in $w"
    } else {
	return [eval $data(w:menu) entryconfig $data($item,index) $args]
    }
}

proc tixOptionMenu:entrycget {w item arg} {
    upvar #0 $w data

    if {![info exists data($item,index)]} {
	error "item $item does not exist in $w"
    } else {
	return [$data(w:menu) entrycget $data($item,index) $arg]
    }
}

proc tixOptionMenu:entries {w} {
    upvar #0 $w data

    return $data(items)
}


proc tixOptionMenu:Destructor {w} {

    tixVariable:DeleteVariable $w

    # Chain this to the superclass
    #
    tixChainMethod $w Destructor
}

#----------------------------------------------------------------------
# Obsolete
# These have been replaced by new commands in Tk 4.0
#
proc tixOptionMenu:Post {w} {
    upvar #0 $w data

    set rootx [winfo rootx $data(w:frame)]
    set rooty [winfo rooty $data(w:frame)]

    # adjust for the border of the menu and frame
    #
    incr rootx [lindex [$data(w:menu)  config -border] 4]
    incr rooty [lindex [$data(w:frame) config -border] 4]
    incr rooty [lindex [$data(w:menu)  config -border] 4]

    set value $data(-value)
    set y [$data(w:menu) yposition $data($value,index)]

    $data(w:menu) post $rootx [expr $rooty - $y]
    $data(w:menu) activate $data($value,index)
    grab -global $data(w:menubutton)
    set data(posted) 1
}

 # PanedWin.tcl --
#
#	This file implements the TixPanedWindow widget
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#


tixWidgetClass tixPanedWindow {
    -classname TixPanedWindow
    -superclass tixPrimitive
    -method {
	add delete forget manage panecget paneconfigure panes setsize
    }
    -flag {
	-command -dynamicgeometry -handleactivebg -handlebg -orient
	-orientation -panebd -paneborderwidth -panerelief
	-separatoractivebg -separatorbg
    }
    -static {
	-orientation
    }
    -configspec {
	{-command command Command ""}
	{-dynamicgeometry dynamicGeometry DynamicGeometry 1 tixVerifyBoolean}
	{-handleactivebg handleActiveBg HandleActiveBg #ececec}
	{-handlebg handleBg Background #d9d9d9}
	{-orientation orientation Orientation vertical}
	{-paneborderwidth paneBorderWidth PaneBorderWidth 1}
	{-panerelief paneRelief PaneRelief raised}
	{-separatoractivebg separatorActiveBg SeparatorActiveBg red}
	{-separatorbg separatorBg Background #d9d9d9}
    }
    -alias {
	{-panebd -paneborderwidth}
	{-orient -orientation}
    }
}

#----------------------------------------------------------------------
# ClassInitialization:
#----------------------------------------------------------------------

proc tixPanedWindow:InitWidgetRec {w} {
    upvar #0 $w data

    tixChainMethod $w InitWidgetRec

    set data(items)       ""
    set data(nItems)      0
    set data(totalsize)   0
    set data(movePending) 0

    set data(repack)      0
    set data(counter)     0

    set data(maxReqW)     1
    set data(maxReqH)     1
}

proc tixPanedWindow:ConstructWidget {w} {
    upvar #0 $w data

    tixChainMethod $w ConstructWidget
    # Do nothing
}

proc tixPanedWindow:SetBindings {w} {
    upvar #0 $w data

    tixChainMethod $w SetBindings

    bind $w <Configure> [list tixPanedWindow:MasterGeomProc $w ""]
}

#----------------------------------------------------------------------
# ConfigOptions:
#----------------------------------------------------------------------
proc tixPanedWindow:config-handlebg {w arg} {
    upvar #0 $w data

    for {set i 1} {$i < $data(nItems)} {incr i} {
	$data(btn,$i) config -bg $arg
    }
}

#----------------------------------------------------------------------
# PublicMethods:
#----------------------------------------------------------------------


# method: add
#
#    Adds a new pane into the PanedWindow.
#
# options -size -max -min -allowresize
#
proc tixPanedWindow:add {w name args} {
    upvar #0 $w data

    if {[winfo exists $w.$name] && !$data($name,forgotten)} {
	error "Pane $name is already managed"
    }
    # Step 1: Parse the options to get the children's size options

    # The default values
    #
    if [info exists data($name,forgotten)] {
	set option(-size)        $data($name,size)
	set option(-min)         $data($name,min)
	set option(-max)         $data($name,max)
	set option(-allowresize) $data($name,allowresize)
	set option(-expand)      $data($name,expand)
    } else {
	set option(-size)        0
	set option(-min)         0
	set option(-max)         100000
	set option(-allowresize) 1
	set option(-expand)      0
    }

    set option(-before)      ""
    set option(-after)       ""
    set option(-at)          ""
    set validOpts {-after -allowresize -at -before -expand -max -min -size}

    tixHandleOptions option $validOpts $args

    set data($name,size)        $option(-size)
    set data($name,rsize)       $option(-size)
    set data($name,min)         $option(-min)
    set data($name,max)         $option(-max)
    set data($name,allowresize) $option(-allowresize)
    set data($name,expand)      $option(-expand)
    set data($name,forgotten)   0

    if {$data($name,expand) < 0} {
	set data($name,expand) 0
    }

    # Step 2: Add the frame and the separator (if necessary)
    #
    if {![winfo exist $w.$name]} {
	# need to check because the frame may have been "forget'ten"
	#
	frame $w.$name -bd $data(-paneborderwidth) -relief $data(-panerelief)
    }

    if {$option(-at) != ""} {
	set at [tixGetInt $option(-at)]
	if {$at < 0} {
	    set at 0
	}
    } elseif {$option(-after) != ""} {
	set index [lsearch -exact $data(items) $option(-after)]
	if {$index == -1} {
	    error "Pane $option(-after) doesn't exists"
	} else {
	    set at [incr index]
	}
    } elseif {$option(-before) != ""} {
	set index [lsearch -exact $data(items) $option(-before)]
	if {$index == -1} {
	    error "Pane $option(-before) doesn't exists"
	}
	set at $index
    } else {
	set at end
    }

    set data(items) [linsert $data(items) $at $name]    
    incr data(nItems)

    if {$data(nItems) > 1} {
	tixPanedWindow:AddSeparator $w
    }
    set data(w:$name) $w.$name

    # Step 3: Add the new frame. Adjust the window later (do when idle)
    #
    tixManageGeometry $w.$name "tixPanedWindow:ClientGeomProc $w"
    bind $w.$name <Configure>  	[list tixPanedWindow:ClientGeomProc $w "" $w.$name]

    tixPanedWindow:RepackWhenIdle $w

    return $w.$name
}

proc tixPanedWindow:manage {w name args} {
    upvar #0 $w data

    if {![winfo exists $w.$name]} {
	error "Pane $name does not exist"
    }
    if {!$data($name,forgotten)} {
	error "Pane $name is already managed"
    }
    tixMapWindow $data(w:$name)
    eval tixPanedWindow:add $w [list $name] $args
}

proc tixPanedWindow:forget {w name} {
    upvar #0 $w data

    if {![winfo exists $w.$name]} {
	error "Pane $name does not exist"
    }
    if $data($name,forgotten) {
	# It has already been forgotten
	#
	return
    }

    set items ""
    foreach item $data(items) {
	if {$item != $name} {
	    lappend items $item
	}
    }
    set data(items) $items
    incr data(nItems) -1

    set i $data(nItems)
    if {$i > 0} {
	destroy $data(btn,$i)
	destroy $data(sep,$i)
	unset data(btn,$i)
	unset data(sep,$i)
    }
    set data($name,forgotten) 1

    tixUnmapWindow $w.$name

    tixPanedWindow:RepackWhenIdle $w
}

proc tixPanedWindow:delete {w name} {
    upvar #0 $w data

    if {![winfo exists $w.$name]} {
	error "Pane $name does not exist"
    }


    if {!$data($name,forgotten)} {
	set items ""
	foreach item $data(items) {
	    if {$item != $name} {
		lappend items $item
	    }
	}
	set data(items) $items
	incr data(nItems) -1

	set i $data(nItems)
	if {$i > 0} {
	    destroy $data(btn,$i)
	    destroy $data(sep,$i)
	    unset data(btn,$i)
	    unset data(sep,$i)
	}
    }
    unset data($name,allowresize)
    unset data($name,expand)
    unset data($name,forgotten)
    unset data($name,max)
    unset data($name,min)
    unset data($name,rsize)
    unset data($name,size)
    unset data(w:$name)
    destroy $w.$name

    tixPanedWindow:RepackWhenIdle $w
}

proc tixPanedWindow:paneconfigure {w name args} {
    upvar #0 $w data

    if {![info exists data($name,size)]} {
	error "pane \"$name\" does not exist in $w"
    }

    set len [llength $args]

    if {$len == 0} {
	set value [$data(w:$name) configure]
	lappend value [list -allowresize "" "" "" $data($name,allowresize)]
	lappend value [list -expand "" "" "" $data($name,expand)]
	lappend value [list -max "" "" "" $data($name,max)]
	lappend value [list -min "" "" "" $data($name,min)]
	lappend value [list -size "" "" "" $data($name,size)]
	return $value
    }

    if {$len == 1} {
	case [lindex $args 0] {
	    -allowresize {
		return [list -allowresize "" "" "" $data($name,allowresize)]
	    }
	    -expand {
		return [list -expand "" "" "" $data($name,expand)]
	    }
	    -min {
		return [list -min "" "" "" $data($name,min)]
	    }
	    -max {
		return [list -max "" "" "" $data($name,max)]
	    }
	    -size {
		return [list -size "" "" "" $data($name,size)]
	    }
	    default {
		return [$data(w:$name) configure [lindex $args 0]]
	    }
	}
    }

    # By default handle each of the options
    #
    set option(-allowresize) $data($name,allowresize)
    set option(-expand)      $data($name,expand)
    set option(-min)         $data($name,min)
    set option(-max)         $data($name,max)
    set option(-size)        $data($name,size)

    tixHandleOptions -nounknown option {-allowresize -expand -max -min -size}  	$args

    #
    # the widget options
    set new_args ""
    tixForEach {flag value} $args {
	case $flag {
	    {-expand -min -max -allowresize -size} {

	    }
	    default {
		lappend new_args $flag
		lappend new_args $value
	    }
	}
    }

    if {[llength $new_args] >= 2} {
	eval $data(w:$name) configure $new_args
    }

    #
    # The add-on options
    set data($name,allowresize) $option(-allowresize)
    set data($name,expand)      $option(-expand)
    set data($name,max)         $option(-max)
    set data($name,min)         $option(-min)
    set data($name,rsize)       $option(-size)
    set data($name,size)        $option(-size)

    # 
    # Integrity check
    if {$data($name,expand) < 0} {
	set data($name,expand) 0
    }
    if {$data($name,size) < $data($name,min)} {
	set data($name,size) $data($name,min)
    }
    if {$data($name,size) > $data($name,max)} {
	set data($name,size) $data($name,max)
    }

    tixPanedWindow:RepackWhenIdle $w
    return ""
}

proc tixPanedWindow:panecget {w name option} {
    upvar #0 $w data

    if {![info exists data($name,size)]} {
	error "pane \"$name\" does not exist in $w"
    }

    case $option {
	{-min -max -allowresize -size} {
	    regsub \\\- $option "" option
	    return "$data($name,$option)"
	}
	default {
	    return [$data(w:$name) cget $option]
	}
    }
}

# return the name of all panes
proc tixPanedWindow:panes {w} {
    upvar #0 $w data

    return $data(items)
}

# set the size of a pane, specifying which direction it should
# grow/shrink
proc tixPanedWindow:setsize {w item size {direction next}} {
    upvar #0 $w data

    set posn [lsearch $data(items) $item]
    if {$posn == -1} {
	error "pane \"$item\" does not exist"
    }

    set diff [expr $size - $data($item,size)]
    if {$diff == 0} {
	return
    }

    if {$posn == 0 && $direction == "prev"} {
	set direction next
    }
    if {$posn == [expr $data(nItems)-1] && $direction == "next"} {
	set direction prev
    }

    set rx [winfo rootx $data(w:$item)]
    if {$direction == "prev"} {
	set rx [expr $rx - $diff]
    } else {
	set rx [expr $rx + [winfo width $data(w:$item)] + $diff]
	incr posn
    }

    # Set up the panedwin in a proper state
    #
    tixPanedWindow:BtnDown $w $posn 1
    tixPanedWindow:BtnMove $w $posn $rx 1
    tixPanedWindow:BtnUp $w $posn 1

    return $data(items)
}

#----------------------------------------------------------------------
# PrivateMethods:
#----------------------------------------------------------------------

proc tixPanedWindow:AddSeparator {w} {
    upvar #0 $w data

    set n [expr $data(nItems)-1]

    if {$data(-orientation) == "vertical"} {
	set data(sep,$n) [frame $w.sep$n -relief sunken  	    -bd 1 -height 2 -width 10000 -bg $data(-separatorbg)]
    } else {
	set data(sep,$n) [frame $w.sep$n -relief sunken  	    -bd 1 -width 2 -height 10000 -bg $data(-separatorbg)]
    }

    set data(btn,$n) [frame $w.btn$n -relief raised  	-bd 1 -width 9 -height 9  	-bg $data(-handlebg)]

    if {$data(-orientation) == "vertical"} {
	set cursor sb_v_double_arrow
    } else {
	set cursor sb_h_double_arrow
    }
    $data(sep,$n) config -cursor $cursor
    $data(btn,$n) config -cursor $cursor

    foreach wid "$data(btn,$n) $data(sep,$n)" {
	bind $wid  	    <ButtonPress-1>   "tixPanedWindow:BtnDown $w $n"
	bind $wid  	    <ButtonRelease-1> "tixPanedWindow:BtnUp   $w $n"
	bind $wid  	    <Any-Enter>       "tixPanedWindow:HighlightBtn $w $n"
	bind $wid  	    <Any-Leave>       "tixPanedWindow:DeHighlightBtn $w $n"
    }

    if {$data(-orientation) == "vertical"} {
	bind  $data(btn,$n) <B1-Motion>  	    "tixPanedWindow:BtnMove $w $n %Y"
    } else {
	bind  $data(btn,$n) <B1-Motion>  	    "tixPanedWindow:BtnMove $w $n %X"
    }

    if {$data(-orientation) == "vertical"} {
#	place $data(btn,$n) -relx 0.90 -y [expr "$data(totalsize)-5"]
#	place $data(sep,$n) -x 0 -y [expr "$data(totalsize)-1"] -relwidth 1
    } else {
#	place $data(btn,$n) -rely 0.90 -x [expr "$data(totalsize)-5"]
#	place $data(sep,$n) -y 0 -x [expr "$data(totalsize)-1"] -relheight 1
    }
}

proc tixPanedWindow:BtnDown {w item {fake 0}} {
    upvar #0 $w data

    if {$data(-orientation) == "vertical"} {
	set spec -height
    } else {
	set spec -width
    }

    if {!$fake} {
	for {set i 1} {$i < $data(nItems)} {incr i} {
	    $data(sep,$i) config -bg $data(-separatoractivebg) $spec 1
	}
	update idletasks
	$data(btn,$item) config -relief sunken
    }

    tixPanedWindow:GetMotionLimit $w $item $fake

    if {!$fake} {
	grab -global $data(btn,$item)
    }
    set data(movePending) 0
}

proc tixPanedWindow:Min2 {a b} {
    if {$a < $b} {
	return $a
    } else {
	return $b
    }
}

proc tixPanedWindow:GetMotionLimit {w item fake} {
    upvar #0 $w data

    set curBefore 0
    set minBefore 0
    set maxBefore 0

    for {set i 0} {$i < $item} {incr i} {
	set name [lindex $data(items) $i]
	incr curBefore $data($name,size)
	incr minBefore $data($name,min)
	incr maxBefore $data($name,max)
    }

    set curAfter 0
    set minAfter 0
    set maxAfter 0
    while {$i < $data(nItems)} {
	set name [lindex $data(items) $i]
	incr curAfter $data($name,size)
	incr minAfter $data($name,min)
	incr maxAfter $data($name,max)
	incr i
    }

    set beforeToGo [tixPanedWindow:Min2          [expr "$curBefore-$minBefore"] [expr "$maxAfter-$curAfter"]]

    set afterToGo [tixPanedWindow:Min2          [expr "$curAfter-$minAfter"] [expr "$maxBefore-$curBefore"]]

    set data(beforeLimit) [expr "$curBefore-$beforeToGo"]
    set data(afterLimit)  [expr "$curBefore+$afterToGo"]
    set data(curSize)     $curBefore

    if {!$fake} {
	tixPanedWindow:PlotHandles $w 1
    }
}

# Compress the motion so that update is quick even on slow machines
#
# rootp = root position (either rootx or rooty)
proc tixPanedWindow:BtnMove {w item rootp {fake 0}} {
    upvar #0 $w data

    set data(rootp) $rootp

    if {$fake} {
	tixPanedWindow:BtnMoveCompressed $w $item $fake
    } else {
	if {$data(movePending) == 0} {
	    after 2 tixPanedWindow:BtnMoveCompressed $w $item
	    set data(movePending) 1
	}
    } 
}

proc tixPanedWindow:BtnMoveCompressed {w item {fake 0}} {
    if {![winfo exists $w]} {
	return
    }

    upvar #0 $w data

    if {$data(-orientation) == "vertical"} {
	set p [expr $data(rootp)-[winfo rooty $w]]
    } else {
	set p [expr $data(rootp)-[winfo rootx $w]]
    }

    if {$p == $data(curSize)} {
	set data(movePending) 0
	return
    }

    if {$p < $data(beforeLimit)} {
	set p $data(beforeLimit)
    }
    if {$p >= $data(afterLimit)} {
	set p $data(afterLimit)
    }
    tixPanedWindow:CalculateChange $w $item $p $fake

    if {!$fake} {
	# Force the redraw to happen
	#
	update idletasks
    }
    set data(movePending) 0
}

# Calculate the change in response to mouse motions
#
proc tixPanedWindow:CalculateChange {w item p {fake 0}} {
    upvar #0 $w data

    if {$p < $data(curSize)} {
	tixPanedWindow:MoveBefore $w $item $p
    } elseif {$p > $data(curSize)} {
	tixPanedWindow:MoveAfter $w $item $p
    }

    if {!$fake} {
	tixPanedWindow:PlotHandles $w 1
    }
}

proc tixPanedWindow:MoveBefore {w item p} {
    upvar #0 $w data

    set n [expr "$data(curSize)-$p"]

    # Shrink the frames before
    #
    set from [expr $item-1]
    set to   0
    tixPanedWindow:Iterate $w $from $to tixPanedWindow:Shrink $n

    # Adjust the frames after
    #
    set from $item
    set to   [expr "$data(nItems)-1"]
    tixPanedWindow:Iterate $w $from $to tixPanedWindow:Grow $n

    set data(curSize) $p
}

proc tixPanedWindow:MoveAfter {w item p} {
    upvar #0 $w data

    set n    [expr "$p-$data(curSize)"]

    # Shrink the frames after
    #
    set from $item
    set to   [expr "$data(nItems)-1"]
    tixPanedWindow:Iterate $w $from $to tixPanedWindow:Shrink $n

    # Graw the frame before
    #
    set from [expr $item-1]
    set to   0
    tixPanedWindow:Iterate $w $from $to tixPanedWindow:Grow $n

    set data(curSize) $p
}

proc tixPanedWindow:CancleLines {w} {
    upvar #0 $w data

    if [info exists data(lines)] {
	foreach line $data(lines) {
	    set x1 [lindex $line 0]
	    set y1 [lindex $line 1]
	    set x2 [lindex $line 2]
	    set y2 [lindex $line 3]

	    tixTmpLine $x1 $y1 $x2 $y2 $w
	}

	catch {unset data(lines)}
    }
}

proc tixPanedWindow:PlotHandles {w transient} {
    upvar #0 $w data

    set totalsize 0
    set i 0

    if {$data(-orientation) == "vertical"} {
	set btnp [expr [winfo width $w]-13]
    } else {
	set h [winfo height $w]
	if {$h > 18} {
	    set btnp 9
	} else {
	    set btnp [expr $h-9]
	}
    }

    set firstpane [lindex $data(items) 0]
    set totalsize $data($firstpane,size)

    if {$transient} {
	tixPanedWindow:CancleLines $w
	set data(lines) ""
    }

    for {set i 1} {$i < $data(nItems)} {incr i} {
	if {! $transient} {
	    if {$data(-orientation) == "vertical"} {
		place $data(btn,$i) -x $btnp -y [expr "$totalsize-4"]
		place $data(sep,$i) -x 0 -y [expr "$totalsize-1"] -relwidth 1
	    } else {
		place $data(btn,$i) -y $btnp -x [expr "$totalsize-5"]
		place $data(sep,$i) -y 0 -x [expr "$totalsize-1"] -relheight 1
	    }
	} else {
	    if {$data(-orientation) == "vertical"} {
		set x1 [winfo rootx $w]
		set x2 [expr $x1 + [winfo width $w]]
		set y  [expr $totalsize-1+[winfo rooty $w]]

		tixTmpLine $x1 $y $x2 $y $w
		lappend data(lines) [list $x1 $y $x2 $y]
	    } else {
		set y1 [winfo rooty $w]
		set y2 [expr $y1 + [winfo height $w]]
		set x  [expr $totalsize-1+[winfo rootx $w]]

		tixTmpLine $x $y1 $x $y2 $w
		lappend data(lines) [list $x $y1 $x $y2]
	    }
	}

	set name [lindex $data(items) $i]
	incr totalsize $data($name,size)
    }
}

proc tixPanedWindow:BtnUp {w item {fake 0}} {
    upvar #0 $w data

    if {!$fake} {
	tixPanedWindow:CancleLines $w
    }

    tixPanedWindow:UpdateSizes $w

    if {!$fake} {
	$data(btn,$item) config -relief raised
	grab release $data(btn,$item)
    }
}


proc tixPanedWindow:HighlightBtn {w item} {
    upvar #0 $w data

    $data(btn,$item) config -background $data(-handleactivebg)
}

proc tixPanedWindow:DeHighlightBtn {w item} {
    upvar #0 $w data

    $data(btn,$item) config -background $data(-handlebg)
}

#----------------------------------------------------------------------
#
#
# Geometry management routines
#
#
#----------------------------------------------------------------------

# update the sizes of each pane according to the data($name,size) variables
#
proc tixPanedWindow:UpdateSizes {w} {
    upvar #0 $w data

    set data(totalsize) 0

    set mw [winfo width  $w]
    set mh [winfo height $w]

    for {set i 0} {$i < $data(nItems)} {incr i} {
	set name [lindex $data(items) $i]

	if {$data($name,size) > 0} {
	    if {$data(-orientation) == "vertical"} {
		tixMoveResizeWindow $w.$name 0 $data(totalsize)  		    $mw $data($name,size)
		tixMapWindow $w.$name
		raise $w.$name
	    } else {
		tixMoveResizeWindow $w.$name $data(totalsize) 0  		    $data($name,size) $mh
		tixMapWindow $w.$name
		raise $w.$name
	    }
	} else {
	    tixUnmapWindow $w.$name
	}
	incr data(totalsize) $data($name,size)
    }

    # Reset the color and width of the separator
    #
    if {$data(-orientation) == "vertical"} {
	set spec -height
    } else {
	set spec -width
    }

    for {set i 1} {$i < $data(nItems)} {incr i} {
	$data(sep,$i) config -bg $data(-separatorbg) $spec 2
	raise $data(sep,$i)
	raise $data(btn,$i)
    }


    # Invoke the callback command
    #
    if {$data(-command) != ""} {
	set sizes ""
	foreach item $data(items) {
	    lappend sizes $data($item,size)
	}
	set bind(specs) ""
	tixEvalCmdBinding $w $data(-command) bind [list $sizes]
    }
}

proc tixPanedWindow:GetNaturalSizes {w} {
    upvar #0 $w data

    set data(totalsize) 0
    set totalreq 0

    if {$data(-orientation) == "vertical"} {
	set majorspec height
	set minorspec width
    } else {
	set majorspec width
	set minorspec height
    }

    set minorsize 0
    foreach name $data(items) {
	if {[winfo manager $w.$name] != "tixGeometry"} {
	    error "Geometry management error: pane \"$w.$name\" cannot be managed by \"[winfo manager $w.$name]\"\nhint: delete the line \"[winfo manager $w.$name] $w.$name ...\" from your program"
	}

	# set the minor size
	#
	set req_minor [winfo req$minorspec $w.$name]

	if {$req_minor > $minorsize} {
	    set minorsize $req_minor
	}

	# Check the natural size against the max, min requirements.
	# Change the natural size if necessary
	#
	if {$data($name,size) <= 1} {
	    set data($name,size) [winfo req$majorspec $w.$name]
	}

	if {$data($name,size) > 1} {
	    # If we get zero maybe the widget was not initialized yet ...
	    #
	    # %% hazard : what if the window is really 1x1?
	    #
	    if {$data($name,size) < $data($name,min)} {
		set data($name,size) $data($name,min)
	    }
	    if {$data($name,size) > $data($name,max)} {
		set data($name,size) $data($name,max)
	    }
	}

	# kludge: because a frame always returns req size of {1,1} before
	# the packer processes it, we do the following to mark the
	# pane as "size unknown"
	#
#	if {$data($name,size) == 1 && ![winfo ismapped $w.$name]} {
#	    set data($name,size) 0
#	}

	# Add up the total size
	#
	incr data(totalsize) $data($name,size)

	# Find out the request size
	#
	if {$data($name,rsize) == 0} {
	    set rsize [winfo req$majorspec $w.$name]
	} else {
	    set rsize $data($name,rsize)
	}

	if {$rsize < $data($name,min)} {
	    set rsize $data($name,min)
	}
	if {$rsize > $data($name,max)} {
	    set rsize $data($name,max)
	}

	incr totalreq $rsize
    }

    if {$data(-orientation) == "vertical"} {
	return "$minorsize $totalreq"
    } else {
	return "$totalreq $minorsize"
    }
}

#--------------------------------------------------
# Handling resize
#--------------------------------------------------
proc tixPanedWindow:ClientGeomProc {w type client} {
    tixPanedWindow:RepackWhenIdle $w
}

#
# This monitor the sizes of the master window
#
proc tixPanedWindow:MasterGeomProc {w master} {
    tixPanedWindow:RepackWhenIdle $w
}

proc tixPanedWindow:RepackWhenIdle {w} {
    if {![winfo exist $w]} {
	return
    }
    upvar #0 $w data

    if {$data(repack) == 0} {
	tixWidgetDoWhenIdle tixPanedWindow:Repack $w
	set data(repack) 1
    }
}

#
# This monitor the sizes of the master window
#
proc tixPanedWindow:Repack {w} {
    upvar #0 $w data

    # Calculate the desired size of the master
    #
    set dim [tixPanedWindow:GetNaturalSizes $w]

    if {$data(-width) != 0} {
	set mreqw $data(-width)
    } else {
	set mreqw [lindex $dim 0]
    }

    if {$data(-height) != 0} {
	set mreqh $data(-height)
    } else {
	set mreqh [lindex $dim 1]
    }

    if !$data(-dynamicgeometry) {
	if {$mreqw < $data(maxReqW)} {
	    set mreqw $data(maxReqW)
	}
	if {$mreqh < $data(maxReqH)} {
	    set mreqh $data(maxReqH)
	}
	set data(maxReqW) $mreqw
	set data(maxReqH) $mreqh
    }
    if {$mreqw != [winfo reqwidth $w] || $mreqh != [winfo reqheight $w] } {
	if {![info exists data(counter)]} {
	    set data(counter) 0
	}
	if {$data(counter) < 50} {
	    incr data(counter)
	    tixGeometryRequest $w $mreqw $mreqh
	    tixWidgetDoWhenIdle tixPanedWindow:Repack $w
	    set data(repack) 1
	    return
	}
    }

    set data(counter) 0

    if {$data(nItems) == 0} {
	set data(repack) 0
	return
    }

    tixWidgetDoWhenIdle tixPanedWindow:DoRepack $w
}

proc tixPanedWindow:DoRepack {w} {
    upvar #0 $w data

    if {$data(-orientation) == "vertical"} {
	set newSize [winfo height $w]
    } else {
	set newSize [winfo width $w]
    }

    if {$newSize <= 1} {
	# Probably this window is too small to see anyway
	# %%Kludge: I don't know if this always work.
	#
	set data(repack) 0
	return
    }

    set totalExp 0
    foreach name $data(items) {
	set totalExp [expr $totalExp + $data($name,expand)]
    }

    if {$newSize > $data(totalsize)} {
	# Grow
	#
	set toGrow [expr "$newSize-$data(totalsize)"]

	set p [llength $data(items)]
	foreach name $data(items) {
	    set toGrow [tixPanedWindow:xGrow $w $name $toGrow $totalExp $p]
	    if {$toGrow > 0} {
		set totalExp [expr $totalExp-$data($name,expand)]
		incr p -1
	    } else {
		break
	    }
	}
    } else {
	# Shrink
	#
	set toShrink [expr "$data(totalsize)-$newSize"]

	set usedSize 0
	foreach name $data(items) {
	    set toShrink [tixPanedWindow:xShrink $w $name $toShrink  		$totalExp $newSize $usedSize]
	    if {$toShrink > 0} {
		set totalExp [expr $totalExp-$data($name,expand)]
		incr usedSize $data($name,size)
	    } else {
		break
	    }
	}
    }

    tixPanedWindow:UpdateSizes $w
    tixPanedWindow:PlotHandles $w 0

    set data(repack) 0
}

#--------------------------------------------------
# Shrink and grow items
#--------------------------------------------------
# 
#   toGrow: how much free area to grow into
#        p: == 1 if $name is the last in the list of items
# totalExp: used to calculate the amount of the free area that this
#	    window can grow into
#
proc tixPanedWindow:xGrow {w name toGrow totalExp p} {
    upvar #0 $w data

    if {$p == 1} {
	set canGrow $toGrow
    } else {
	if {$totalExp == 0} {
	    set canGrow 0
	} else {
	    set canGrow [expr int($toGrow * $data($name,expand) / $totalExp)]
	}
    }

    if {[expr $canGrow + $data($name,size)] > $data($name,max)} {
	set canGrow [expr $data($name,max) - $data($name,size)]
    }

    incr data($name,size) $canGrow
    incr toGrow -$canGrow

    return $toGrow
}

proc tixPanedWindow:xShrink {w name toShrink totalExp newSize usedSize} {
    upvar #0 $w data

    if {$totalExp == 0} {
	set canShrink 0
    } else {
	set canShrink [expr int($toShrink * $data($name,expand) / $totalExp)]
    }

    if {[expr $data($name,size) - $canShrink] < $data($name,min)} {
	set canShrink [expr $data($name,size) -$data($name,min)]
    }
    if {[expr $usedSize + $data($name,size) - $canShrink] > $newSize} {
	set data($name,size) [expr $newSize - $usedSize]
	return 0
    } else {
	incr data($name,size) -$canShrink
	incr toShrink -$canShrink

	return $toShrink
    }
}

#--------------------------------------------------
# Shrink and grow items
#--------------------------------------------------
proc tixPanedWindow:Shrink {w name n} {
    upvar #0 $w data

    set canShrink [expr "$data($name,size) - $data($name,min)"]

    if {$canShrink > $n} {
	incr data($name,size) -$n
	return 0
    } elseif {$canShrink > 0} {
	set data($name,size) $data($name,min)
	incr n -$canShrink
    }
    return $n
}

proc tixPanedWindow:Grow {w name n} {
    upvar #0 $w data

    set canGrow [expr "$data($name,max) - $data($name,size)"]

    if {$canGrow > $n} {
	incr data($name,size) $n
	return 0
    } elseif {$canGrow > 0} {
	set data($name,size) $data($name,max)
	incr n -$canGrow
    }

    return $n
}

proc tixPanedWindow:Iterate {w from to proc n} {
    upvar #0 $w data

    if {$from <= $to} {
	for {set i $from} {$i <= $to} {incr i} {
	    set n [$proc $w [lindex $data(items) $i] $n]
	    if {$n == 0} {
		break
	    }
	}
    } else {
	for {set i $from} {$i >= $to} {incr i -1} {
	    set n [$proc $w [lindex $data(items) $i] $n]
	    if {$n == 0} {
		break
	    }
	}
    }
}

 # PopMenu.tcl --
#
#	This file implements the TixPopupMenu widget
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

tixWidgetClass tixPopupMenu {
    -classname TixPopupMenu
    -superclass tixShell
    -method {
	bind post unbind
    }
    -flag {
	 -buttons -installcolormap -postcmd -spring -state -title
    }
    -configspec {
	{-buttons buttons Buttons {{3 {Any}}}}
	{-installcolormap installColormap InstallColormap false}
	{-postcmd postCmd PostCmd ""}
	{-spring spring Spring 1 tixVerifyBoolean}
	{-state state State normal}

	{-cursor corsor Cursur arrow}
    }
    -static {
	-buttons
    }
    -default  {
	{*Menu.tearOff			0}
    }
}

proc tixPopupMenu:InitWidgetRec {w} {
    upvar #0 $w data

    tixChainMethod $w InitWidgetRec

    set data(g:clients)   ""
}

proc tixPopupMenu:ConstructWidget {w} {
    upvar #0 $w data

    tixChainMethod $w ConstructWidget

    wm overrideredirect $w 1
    wm withdraw $w

    set data(w:menubutton) [menubutton $w.menubutton -text $data(-title)  			    -menu $w.menubutton.menu -anchor w]
    set data(w:menu) [menu $w.menubutton.menu]

    pack $data(w:menubutton) -expand yes -fill both
}

proc tixPopupMenu:SetBindings {w} {
    upvar #0 $w data

    tixChainMethod $w SetBindings

    foreach elm $data(-buttons) {
	set btn [lindex $elm 0]
	foreach mod [lindex $elm 1] {
	    tixBind TixPopupMenu:MB:$w <$mod-ButtonPress-$btn>  		"tixPopupMenu:Unpost $w"
	
	    tixBind TixPopupMenu:$w <$mod-ButtonPress-$btn>  		"tixPopupMenu:post $w %W %x %y"
	}

	tixBind TixPopupMenu:MB:$w <ButtonRelease-$btn>  	    "tixPopupMenu:BtnRelease $w %X %Y"

	tixBind TixPopupMenu:M:$w <Unmap>  	    "tixPopupMenu:Unmap $w"
	tixBind TixPopupMenu:$w <ButtonRelease-$btn>  	    "tixPopupMenu:BtnRelease $w %X %Y"

	tixAddBindTag $data(w:menubutton) TixPopupMenu:MB:$w
	tixAddBindTag $data(w:menu)       TixPopupMenu:M:$w
    }
}


#----------------------------------------------------------------------
# PrivateMethods:
#----------------------------------------------------------------------
proc tixPopupMenu:Unpost {w} {
    upvar #0 $w data

    catch {
	tkMenuUnpost ""
    }
#   tkMbButtonUp $data(w:menubutton)
}

proc tixPopupMenu:BtnRelease {w rootX rootY} {
    upvar #0 $w data

    set cW [winfo containing $rootX $rootY]

    if {$data(-spring)} {
	tixPopupMenu:Unpost $w
    }
}

proc tixPopupMenu:Unmap {w} {
    upvar #0 $w data
    wm withdraw $w
}

proc tixPopupMenu:Destructor {w} {
    upvar #0 $w data

    foreach client $data(g:clients) {
	if [winfo exists $client] {
	    tixDeleteBindTag $client TixPopupMenu:$w
	}
    }

    # delete the extra bindings
    #
    foreach tag [list TixPopupMenu:MB:$w TixPopupMenu:M:$w] {
	foreach e [bind $tag] {
	    bind $tag $e ""
	}
    }

    tixChainMethod $w Destructor
}

proc tixPopupMenu:config-title {w value} {
    upvar #0 $w data

    $data(w:menubutton) config -text $value
}

#----------------------------------------------------------------------
# PublicMethods:
#----------------------------------------------------------------------
proc tixPopupMenu:bind {w args} {
    upvar #0 $w data

    foreach client $args {
	if {[lsearch $data(g:clients) $client] == -1} {
	    lappend data(g:clients) $client
	    tixAppendBindTag $client TixPopupMenu:$w
	}
    }
}

proc tixPopupMenu:unbind {w args} {
    upvar #0 $w data

    foreach client $args {
	if [winfo exists $client] {
	    set index [lsearch $data(g:clients) $client]
	    if {$index != -1} {
		tixDeleteBindTag $client TixPopupMenu:$w
		set data(g:clients) [lreplace $data(g:clients) $index $index]
	    }
	}
    }
}

proc tixPopupMenu:post {w client x y} {
    upvar #0 $w data
    global tkPriv

    if {$data(-state)  == "disabled"} {
	return
    }

    set rootx [expr $x + [winfo rootx $client]]
    set rooty [expr $y + [winfo rooty $client]]

    if {$data(-postcmd) != ""} {
	set ret [tixEvalCmdBinding $w $data(-postcmd) "" $rootx $rooty]
	if ![tixGetBoolean $ret] {
	    return
	}
    }

    if [tixGetBoolean -nocomplain $data(-installcolormap)] {
	wm colormapwindows . "$w"
    }


    set menuWidth [winfo reqwidth $data(w:menu)]
    set width     [winfo reqwidth  $w]
    set height    [winfo reqheight $w]

    if {$width < $menuWidth} {
	set width $menuWidth
    }

    set wx $rootx
    set wy $rooty

    # trick: the following lines allow the popup menu
    # acquire a stable width and height when it is finally
    # put on the visible screen. Advoid flashing
    #
    wm geometry $w +10000+10000
    wm deiconify $w
    raise $w

    update
    wm geometry $w $width\x$height+$wx+$wy
    update

    tkMbEnter $data(w:menubutton)
    tkMbPost $tkPriv(inMenubutton) $rootx $rooty
}

 # Primitiv.tcl --
#
#	This is the primitive widget. It is just a frame with proper
#	inheritance wrapping. All new Tix widgets will be derived from
#	this widget
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#



# No superclass, so the superclass switch is not used
#
#
tixWidgetClass tixPrimitive {
    -virtual true
    -superclass {}
    -classname  TixPrimitive
    -method {
	cget configure subwidget subwidgets
    }
    -flag {
	-background -borderwidth -cursor
	-height -highlightbackground -highlightcolor -highlightthickness
	-options -relief -takefocus -width -bd -bg
    }
    -static {
	-options
    }
    -configspec {
	{-background background Background #d9d9d9} 
	{-borderwidth borderWidth BorderWidth 0} 
	{-cursor cursor Cursor ""} 
	{-height height Height 0}
	{-highlightbackground highlightBackground HighlightBackground #c3c3c3}
	{-highlightcolor highlightColor HighlightColor black}
	{-highlightthickness highlightThickness HighlightThickness 0} 
	{-options options Options ""}
	{-relief relief Relief flat}
	{-takefocus takeFocus TakeFocus 0 tixVerifyBoolean} 
	{-width width Width 0}
    }
    -alias {
	{-bd -borderwidth}
	{-bg -background}
    }
}

#----------------------------------------------------------------------
# ClassInitialization:
#----------------------------------------------------------------------

# not used
# Implemented in C
#
# Override: never
proc tixPrimitive:Constructor {w args} {

    upvar #0 $w data
    upvar #0 $data(className) classRec

    # Set up some minimal items in the class record.
    #
    set data(w:root)  $w
    set data(rootCmd) $w:root

    # We need to create the root widget in order to parse the options
    # database
    tixCallMethod $w CreateRootWidget

    # Parse the default options from the options database
    #
    tixPrimitive:ParseDefaultOptions $w

    # Parse the options supplied by the user
    #
    tixPrimitive:ParseUserOptions $w $args

    # Rename the widget command so that it can be use to access
    # the methods of this class

    tixPrimitive:MkWidgetCmd $w

    # Inistalize the Widget Record
    #
    tixCallMethod $w InitWidgetRec

    # Construct the compound widget
    #
    tixCallMethod $w ConstructWidget

    # Do the bindings
    #
    tixCallMethod $w SetBindings

    # Call the configuration methods for all "force call" options
    #
    foreach option $classRec(forceCall) {
	tixInt_ChangeOptions $w $option $data($option)
    }
}


# Create only the root widget. We need the root widget to query the option
# database.
#
# Override: seldom. (unless you want to use a toplevel as root widget)
# Chain   : never.

proc tixPrimitive:CreateRootWidget {w args} {
    upvar #0 $w data
    upvar #0 $data(className) classRec

    frame $w -class $data(ClassName)
}

proc tixPrimitive:ParseDefaultOptions {w} {
    upvar #0 $w data
    upvar #0 $data(className) classRec

    # SET UP THE INSTANCE RECORD ACCORDING TO DEFAULT VALUES IN
    # THE OPTIONS DATABASE
    #
    foreach option $classRec(options) {
	set spec [tixInt_GetOptionSpec $data(className) $option]

	if {[lindex $spec 0] == "="} {
	    continue
	}

	set o_name    [lindex $spec 1]
	set o_class   [lindex $spec 2]
	set o_default [lindex $spec 3]

	if {![catch "option get $w $o_name $o_class" db_default]} {
	    if {$db_default != ""} {
		set data($option) $db_default
	    } else {
		set data($option) $o_default
	    }
	} else {
	    set data($option) $o_default
	}
    }
}

proc tixPrimitive:ParseUserOptions {w arglist} {
    upvar #0 $w data
    upvar #0 $data(className) classRec

    # SET UP THE INSTANCE RECORD ACCORDING TO COMMAND ARGUMENTS FROM
    # THE USER OF THE TIX LIBRARY (i.e. Application programmer:)
    #
    tixForEach {option arg} $arglist {
	if {[lsearch $classRec(options) $option] != "-1"} {
	    set spec [tixInt_GetOptionSpec $data(className) $option]

	    if {[lindex $spec 0] != "="} {
		set data($option) $arg
	    } else {
		set realOption [lindex $spec 1]
		set data($realOption) $arg
	    }
	} else {
	    error "unknown option $option. Should be: [tixInt_ListOptions $w]"
	}
    }
}

#----------------------------------------------------------------------
# Initialize the widget record
# 
#
# Override: always
# Chain   : always, before
proc tixPrimitive:InitWidgetRec {w} {
    # default: do nothing
}

#----------------------------------------------------------------------
# SetBindings
# 
#
# Override: sometimes
# Chain   : sometimes, before
#
bind TixDestroyHandler <Destroy> {
    [tixGetMethod %W [set %W(className)] Destructor] %W
}

proc tixPrimitive:SetBindings {w} {
    upvar #0 $w data

    if {[winfo toplevel $w] == $w} {
	bindtags $w [concat TixDestroyHandler [bindtags $w]]
    } else {
	bind $data(w:root) <Destroy>  	    "[tixGetMethod $w $data(className) Destructor] $w"
    }
}

#----------------------------------------------------------------------
# PrivateMethod: ConstructWidget
# 
# Construct and set up the compound widget
#
# Override: sometimes
# Chain   : sometimes, before
#
proc tixPrimitive:ConstructWidget {w} {
    upvar #0 $w data

    $data(rootCmd) config  	-background  $data(-background)  	-borderwidth $data(-borderwidth)  	-cursor      $data(-cursor)  	-relief      $data(-relief)

    if {$data(-width) != 0} {
	$data(rootCmd) config -width $data(-width)
    }
    if {$data(-height) != 0} {
	$data(rootCmd) config -height $data(-height)
    }

    set rootname *[string range $w 1 end]

    tixForEach {spec value} $data(-options) {
	option add $rootname*$spec $value 100
    }
}

#----------------------------------------------------------------------
# PrivateMethod: MkWidgetCmd
# 
# Construct and set up the compound widget
#
# Override: sometimes
# Chain   : sometimes, before
#
proc tixPrimitive:MkWidgetCmd {w} {
    upvar #0 $w data

    rename $w $data(rootCmd)
    tixInt_MkInstanceCmd $w
}


#----------------------------------------------------------------------
# ConfigOptions:
#----------------------------------------------------------------------

#----------------------------------------------------------------------
# ConfigMethod: config
#
# Configure one option.
# 
# Override: always
# Chain   : automatic.
#
# Note the hack of [winfo width] in this procedure
#
# The hack is necessary because of the bad interaction between TK's geometry
# manager (the packer) and the frame widget. The packer determines the size
# of the root widget of the ComboBox (a frame widget) according to the
# requirement of the slaves inside the frame widget, NOT the -width
# option of the frame widget.
#
# However, everytime the frame widget is
# configured, it sends a geometry request to the packer according to its
# -width and -height options and the packer will temporarily resize
# the frame widget according to the requested size! The packer then realizes
# something is wrong and revert to the size determined by the slaves. This
# cause a flash on the screen.
#
foreach opt {-height -width -background -borderwidth -cursor
        -highlightbackground -highlightcolor -relief -takefocus -bd -bg} {

    set tixPrimOpt($opt) 1
}

proc tixPrimitive:config {w option value} {
    global tixPrimOpt
    upvar #0 $w data

    if [info exists tixPrimOpt($option)] {
	$data(rootCmd) config $option $value
    }
}

#----------------------------------------------------------------------
# PublicMethods:
#----------------------------------------------------------------------

#----------------------------------------------------------------------
# This method is used to implement the "subwidgets" widget command.
# Will be re-written in C. It can't be used as a public method because
# of the lame substring comparison routines used in tixClass.c
#
#
proc tixPrimitive:subwidgets {w type args} {
    upvar #0 $w data

    case $type {
	-class {
	    set name [lindex $args 0]
	    set args [lrange $args 1 end]
	    # access subwidgets of a particular class
	    #
	    # note: if $name=="Frame", will *not return the root widget as well
	    #
	    set sub ""
	    foreach des [tixDescendants $w] {
		if {[winfo class $des] == $name} {
		    lappend sub $des
		}
	    }

	    # Note: if the there is no subwidget of this class, does not
	    # cause any error.
	    #
	    if {$args == ""} {
		return $sub
	    } else {
		foreach des $sub {
		    eval $des $args
		}
		return ""
	    }
	}
	-group {
	    set name [lindex $args 0]
	    set args [lrange $args 1 end]
	    # access subwidgets of a particular group
	    #
	    if [info exists data(g:$name)] {
		if {$args == ""} {
		    set ret ""
		    foreach item $data(g:$name) {
			lappend ret $w.$item
		    }
		    return $ret
		} else {
		    foreach item $data(g:$name) {
			eval $w.$item $args
		    }
		    return ""
		}
	    } else {
		error "no such subwidget group $name"
	    }
	}
	-all {
	    set sub [tixDescendants $w]

	    if {$args == ""} {
		return $sub
	    } else {
		foreach des $sub {
		    eval $des $args
		}
		return ""
	    }
	}
	default {
	    error "unknown flag $type, should be -all, -class or -group"
	}
    }
}

#----------------------------------------------------------------------
# PublicMethod: subwidget
#
# Access a subwidget withe a particular name 
#
# Override: never
# Chain   : never
#
proc tixPrimitive:subwidget {w name args} {
    upvar #0 $w data

    if [info exists data(w:$name)] {
	if {$args == ""} {
	    return $data(w:$name)
	} else {
	    return [eval $data(w:$name) $args]
	}
    } else {
	error "no such subwidget $name"
    }
}


#----------------------------------------------------------------------
# PrivateMethods:
#----------------------------------------------------------------------

# delete the widget record and remove the command
#
proc tixPrimitive:Destructor {w} {
    upvar #0 $w data

    if {![info exists data(w:root)]} {
	return
    }

    if {[info commands $w] != ""} {
	# remove the command
	#
	rename $w ""
    }

    if {[info commands $data(rootCmd)] != ""} {
	# remove the command of the root widget
	#
	rename $data(rootCmd) ""
    }

    # delete the widget record
    #
    catch {unset data}
}

 # ResizeH.tcl --
#
#	tixResizeHandle: A general purpose "resizing handle"
#	widget. You can use it to resize pictures, widgets, etc. When
#	using it to resize a widget, you can use the "attachwidget"
#	command to attach it to a widget and it will handle all the
#	events for you.
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
#
#

tixWidgetClass tixResizeHandle {
    -classname TixResizeHandle
    -superclass tixVResize

    -method {
	attachwidget detachwidget hide show
    }
    -flag {
	-command -cursorfg -cursorbg -handlesize -hintcolor -hintwidth -x -y
    }
    -configspec {
	{-command command Command ""}
	{-cursorfg cursorFg CursorColor white}
	{-cursorbg cursorBg CursorColor red}
	{-handlesize handleSize HandleSize 6}
	{-hintcolor hintColor HintColor red}
	{-hintwidth hintWidth HintWidth 1}
	{-x x X 0}
	{-y y Y 0}
    }
}

proc tixResizeHandle:InitWidgetRec {w} {
    upvar #0 $w data

    tixChainMethod $w InitWidgetRec

    set data(shown)  0
    set data(widget) ""
}

proc tixResizeHandle:ConstructWidget {w} {
    upvar #0 $w data

    tixChainMethod $w ConstructWidget

    # Create the hints
    #
    set data(w_ht) $w:tix_priv_ht
    set data(w_hb) $w:tix_priv_hb
    set data(w_hl) $w:tix_priv_hl
    set data(w_hr) $w:tix_priv_hr

    frame $data(w_ht) -height $data(-hintwidth) -bg $data(-background)
    frame $data(w_hb) -height $data(-hintwidth) -bg $data(-background)
    frame $data(w_hl) -width  $data(-hintwidth) -bg $data(-background)
    frame $data(w_hr) -width  $data(-hintwidth) -bg $data(-background)

    # Create the corner resize handles
    #
    set data(w_r00) $w

#   Windows don't like this
#    $data(rootCmd) config #	-cursor "top_left_corner $data(-cursorbg) $data(-cursorfg)"

    $data(rootCmd) config -cursor top_left_corner

    set data(w_r01) $w:tix_priv_01
    set data(w_r10) $w:tix_priv_10
    set data(w_r11) $w:tix_priv_11

    frame $data(w_r01) -relief $data(-relief) -bd $data(-borderwidth)  	-cursor "bottom_left_corner" 	-bg $data(-background)
    frame $data(w_r10) -relief $data(-relief) -bd $data(-borderwidth)  	-cursor "top_right_corner" 	-bg $data(-background)
    frame $data(w_r11) -relief $data(-relief) -bd $data(-borderwidth)  	-cursor "bottom_right_corner" 	-bg $data(-background)

    # Create the border resize handles
    #
    set data(w_bt)  $w:tix_priv_bt
    set data(w_bb)  $w:tix_priv_bb
    set data(w_bl)  $w:tix_priv_bl
    set data(w_br)  $w:tix_priv_br

    frame $data(w_bt) -relief $data(-relief) -bd $data(-borderwidth)  	-cursor "top_side" 	-bg $data(-background)
    frame $data(w_bb) -relief $data(-relief) -bd $data(-borderwidth)  	-cursor "bottom_side" 	-bg $data(-background)
    frame $data(w_bl) -relief $data(-relief) -bd $data(-borderwidth)  	-cursor "left_side" 	-bg $data(-background)
    frame $data(w_br) -relief $data(-relief) -bd $data(-borderwidth)  	-cursor "right_side" 	-bg $data(-background)
}

proc tixResizeHandle:SetBindings {w} {
    upvar #0 $w data

    tixChainMethod $w SetBindings

    bind $data(w_r00)   <1>  	"tixResizeHandle:dragstart $w $data(w_r00)   1 %X %Y  {1  1 -1 -1}"
    bind $data(w_r01)   <1>  	"tixResizeHandle:dragstart $w $data(w_r01)   1 %X %Y  {1  0 -1  1}"
    bind $data(w_r10)   <1>  	"tixResizeHandle:dragstart $w $data(w_r10)   1 %X %Y  {0  1  1 -1}"
    bind $data(w_r11)   <1>  	"tixResizeHandle:dragstart $w $data(w_r11)   1 %X %Y  {0  0  1  1}"
    bind $data(w_bt)    <1>  	"tixResizeHandle:dragstart $w $data(w_bt)    1 %X %Y  {0  1  0 -1}"
    bind $data(w_bb)    <1>  	"tixResizeHandle:dragstart $w $data(w_bb)    1 %X %Y  {0  0  0  1}"
    bind $data(w_bl)    <1>  	"tixResizeHandle:dragstart $w $data(w_bl)    1 %X %Y  {1  0 -1  0}"
    bind $data(w_br)    <1>  	"tixResizeHandle:dragstart $w $data(w_br)    1 %X %Y  {0  0  1  0}"

    foreach win [list  		 $data(w_r00) 		 $data(w_r01) 		 $data(w_r10) 		 $data(w_r11) 		 $data(w_bt) 		 $data(w_bb) 		 $data(w_bl) 		 $data(w_br) 		 ] {
	bind $win <B1-Motion>       "tixVResize:drag    $w %X %Y"
	bind $win <ButtonRelease-1> "tixVResize:dragend $w $win 0 %X %Y"
	bind $win <Any-Escape>      "tixVResize:dragend $w $win 1  0  0"
    }
}

#----------------------------------------------------------------------
# 		Config Methods
#----------------------------------------------------------------------
proc tixResizeHandle:config-width {w value} {
    tixWidgetDoWhenIdle tixResizeHandle:ComposeWindow $w
}

proc tixResizeHandle:config-height {w value} {
    tixWidgetDoWhenIdle tixResizeHandle:ComposeWindow $w
}

proc tixResizeHandle:config-x {w value} {
    tixWidgetDoWhenIdle tixResizeHandle:ComposeWindow $w
}

proc tixResizeHandle:config-y {w value} {
    tixWidgetDoWhenIdle tixResizeHandle:ComposeWindow $w
}


#----------------------------------------------------------------------
# 		Public Methods
#----------------------------------------------------------------------
proc tixResizeHandle:dragstart {w win depress rootx rooty mrect} {
    upvar #0 $w data

    set wx $data(-x)
    set wy $data(-y)
    set ww $data(-width)
    set wh $data(-height)

    tixVResize:dragstart $w $win $depress $rootx $rooty  	[list $wx $wy $ww $wh] $mrect
}

# tixDeleteBindTag --
#
#	Delete the bindtag(s) in the args list from the bindtags of the widget
#
proc tixDeleteBindTag {w args} {
    if ![winfo exists $w] {
	return
    }
    set newtags ""

    foreach tag [bindtags $w] {
	if {[lsearch $args $tag] == -1} {
	    lappend newtags $tag
	}
    }
    bindtags $w $newtags
}

proc tixAddBindTag {w args} {
    bindtags $w [concat [bindtags $w] $args]
}

proc tixResizeHandle:attachwidget {w widget args} {
    upvar #0 $w data

    set opt(-move) 0
    tixHandleOptions opt {-move} $args

    if {$data(widget) != ""} {
	tixDeleteBindTag $data(widget) TixResizeHandleTag:$w
    }

    set data(widget) $widget

    if {$data(widget) != ""} {
	# Just in case TixResizeHandleTag was already there
	tixDeleteBindTag $data(widget) TixResizeHandleTag:$w
	tixAddBindTag $data(widget) TixResizeHandleTag:$w

	
	set data(-x)      [winfo x      $data(widget)]
	set data(-y)      [winfo y      $data(widget)]
	set data(-width)  [winfo width  $data(widget)]
	set data(-height) [winfo height $data(widget)]

	tixResizeHandle:show $w
	tixResizeHandle:ComposeWindow $w

	# Now set the bindings
	#
	if {$opt(-move)} {
	    bind TixResizeHandleTag:$w <1>  		"tixResizeHandle:Attach $w %X %Y"
	    bind TixResizeHandleTag:$w <B1-Motion>  		"tixResizeHandle:BMotion $w %X %Y"
	    bind TixResizeHandleTag:$w <Any-Escape>  		"tixResizeHandle:BRelease $w 1 %X %Y"
	    bind TixResizeHandleTag:$w <ButtonRelease-1> 		"tixResizeHandle:BRelease $w 0 %X %Y"
	} else {
	    # if "move" is false, then the widget won't be moved as a whole -- 
	    # ResizeHandle will only move its sides
	    bind TixResizeHandleTag:$w <1> 		 {;}
	    bind TixResizeHandleTag:$w <B1-Motion>	 {;}
	    bind TixResizeHandleTag:$w <Any-Escape>	 {;}
	    bind TixResizeHandleTag:$w <ButtonRelease-1> {;}
	}
    }
}

proc tixResizeHandle:detachwidget {w} {
    upvar #0 $w data

    if {$data(widget) != ""} {
	tixDeleteBindTag $data(widget) TixResizeHandleTag:$w
    }
    tixResizeHandle:hide $w
}

proc tixResizeHandle:show {w} {
    upvar #0 $w data

    set data(shown) 1

    raise $data(w_ht)
    raise $data(w_hb)
    raise $data(w_hl)
    raise $data(w_hr)

    raise $data(w_r00)
    raise $data(w_r01)
    raise $data(w_r10)
    raise $data(w_r11)

    raise $data(w_bt)
    raise $data(w_bb)
    raise $data(w_bl)
    raise $data(w_br)

#   tixCancleIdleTask tixResizeHandle:ComposeWindow $w
    tixResizeHandle:ComposeWindow $w
}


proc tixResizeHandle:hide {w} {
    upvar #0 $w data

    if {!$data(shown)} {
	return
    }

    set data(shown) 0

    place forget $data(w_r00)
    place forget $data(w_r01)
    place forget $data(w_r10)
    place forget $data(w_r11)

    place forget $data(w_bt)
    place forget $data(w_bb)
    place forget $data(w_bl)
    place forget $data(w_br)

    place forget $data(w_ht)
    place forget $data(w_hb)
    place forget $data(w_hl)
    place forget $data(w_hr)
}

proc tixResizeHandle:Destructor {w} {
    upvar #0 $w data

    if {$data(widget) != ""} {
	tixDeleteBindTag $data(widget) TixResizeHandleTag:$w
    }

    catch {destroy $data(w_r01)}
    catch {destroy $data(w_r10)}
    catch {destroy $data(w_r11)}

    catch {destroy $data(w_bt)}
    catch {destroy $data(w_bb)}
    catch {destroy $data(w_bl)}
    catch {destroy $data(w_br)}

    catch {destroy $data(w_ht)}
    catch {destroy $data(w_hb)}
    catch {destroy $data(w_hl)}
    catch {destroy $data(w_hr)}

    tixChainMethod $w Destructor
}

#----------------------------------------------------------------------
# 	  Private Methods Dealing With Attached Widgets
#----------------------------------------------------------------------
proc tixResizeHandle:Attach {w rx ry} {
    upvar #0 $w data

    tixResizeHandle:dragstart $w $data(widget) 0 $rx $ry {1 1 0 0}
}

proc tixResizeHandle:BMotion {w rx ry} {
    tixVResize:drag $w $rx $ry
}


proc tixResizeHandle:BRelease {w isAbort rx ry} {
    upvar #0 $w data

    tixVResize:dragend $w $data(widget) $isAbort $rx $ry
}

#----------------------------------------------------------------------
# 		Private Methods
#----------------------------------------------------------------------
proc tixResizeHandle:DrawTmpLines {w} {
    upvar #0 $w data

    set x1 $data(hf:x1)
    set y1 $data(hf:y1)
    set x2 $data(hf:x2)
    set y2 $data(hf:y2)

    tixTmpLine $x1 $y1 $x2 $y1 $w
    tixTmpLine $x1 $y2 $x2 $y2 $w
    tixTmpLine $x1 $y1 $x1 $y2 $w
    tixTmpLine $x2 $y1 $x2 $y2 $w
}

# Place the hint frame to indicate the changes
#
proc tixResizeHandle:SetHintFrame {w x1 y1 width height} {
    upvar #0 $w data

    # The four sides of the window
    #
    set x2 [expr "$x1+$width"]
    set y2 [expr "$y1+$height"]

    set rx [winfo rootx [winfo parent $w]]
    set ry [winfo rooty [winfo parent $w]]

    incr x1 $rx
    incr y1 $ry
    incr x2 $rx
    incr y2 $ry

    if {[info exists data(hf:x1)]} {
	tixResizeHandle:DrawTmpLines $w
    }

    set data(hf:x1) $x1
    set data(hf:y1) $y1
    set data(hf:x2) $x2
    set data(hf:y2) $y2

    tixResizeHandle:DrawTmpLines $w
}

proc tixResizeHandle:ShowHintFrame {w} {
    upvar #0 $w data

    place forget $data(w_ht)
    place forget $data(w_hb)
    place forget $data(w_hl)
    place forget $data(w_hr)

    update
}

proc tixResizeHandle:HideHintFrame {w} {
    upvar #0 $w data

    tixResizeHandle:DrawTmpLines $w
    unset data(hf:x1)
    unset data(hf:y1)
    unset data(hf:x2)
    unset data(hf:y2)
}

proc tixResizeHandle:UpdateSize {w x y width height} {
    upvar #0 $w data

    set data(-x)      $x
    set data(-y)      $y
    set data(-width)  $width
    set data(-height) $height

    tixResizeHandle:ComposeWindow $w

    if {$data(widget) != ""} {
	place $data(widget) -x $x -y $y -width $width -height $height
    }

    if {$data(-command) != ""} {
	eval $data(-command) $x $y $width $height
    }
}

proc tixResizeHandle:ComposeWindow {w} {
    upvar #0 $w data

    set px $data(-x)
    set py $data(-y)
    set pw $data(-width)
    set ph $data(-height)

    # Show the hint frames
    #
    set x1 $px
    set y1 $py
    set x2 [expr "$px+$pw"]
    set y2 [expr "$py+$ph"]

    place $data(w_ht) -x $x1 -y $y1 -width  $pw -bordermode outside
    place $data(w_hb) -x $x1 -y $y2 -width  $pw -bordermode outside
    place $data(w_hl) -x $x1 -y $y1 -height $ph -bordermode outside
    place $data(w_hr) -x $x2 -y $y1 -height $ph -bordermode outside

    # Set the four corner resize handles
    #
    set sz_2 [expr $data(-handlesize)/2]

    set x1 [expr "$px - $sz_2"]
    set y1 [expr "$py - $sz_2"]
    set x2 [expr "$px - $sz_2" + $pw]
    set y2 [expr "$py - $sz_2" + $ph]

    place $data(w_r00) -x $x1 -y $y1  	-width $data(-handlesize) -height $data(-handlesize)
    place $data(w_r01) -x $x1 -y $y2 	-width $data(-handlesize) -height $data(-handlesize)
    place $data(w_r10) -x $x2 -y $y1 	-width $data(-handlesize) -height $data(-handlesize)
    place $data(w_r11) -x $x2 -y $y2 	-width $data(-handlesize) -height $data(-handlesize)


    # Set the four border resize handles
    #
    set mx [expr "$px + $pw/2 - $sz_2"]
    set my [expr "$py + $ph/2 - $sz_2"]

    place $data(w_bt) -x $mx -y $y1  	-width $data(-handlesize) -height $data(-handlesize)
    place $data(w_bb) -x $mx -y $y2  	-width $data(-handlesize) -height $data(-handlesize)
    place $data(w_bl) -x $x1 -y $my  	-width $data(-handlesize) -height $data(-handlesize)
    place $data(w_br) -x $x2 -y $my  	-width $data(-handlesize) -height $data(-handlesize)
}

 # SGrid.tcl --
#
#	This file implements Scrolled Grid widgets
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

tixWidgetClass tixScrolledGrid {
    -classname TixScrolledGrid
    -superclass tixScrolledWidget
    -method {
    }
    -flag {
    }
    -configspec {
    }
    -default {
	{.scrollbar			auto}
	{*grid.borderWidth		1}
	{*grid.Background		#c3c3c3}
	{*grid.highlightBackground	#d9d9d9}
	{*grid.relief			sunken}
	{*grid.takeFocus		1}
	{*Scrollbar.background		#d9d9d9}
	{*Scrollbar.troughColor		#c3c3c3}
	{*Scrollbar.takeFocus		0}
	{*Scrollbar.relief		sunken}
	{*Scrollbar.width		15}
    }
}

proc tixScrolledGrid:ConstructWidget {w} {
    upvar #0 $w data

    tixChainMethod $w ConstructWidget

    set data(w:grid) [tixGrid $w.grid]

    set data(w:hsb)  	[scrollbar $w.hsb -orient horizontal -takefocus 0]
    set data(w:vsb)  	[scrollbar $w.vsb -orient vertical -takefocus 0]

    set data(pw:client) $data(w:grid)

    pack $data(w:grid) -expand yes -fill both -padx 0 -pady 0
}

proc tixScrolledGrid:SetBindings {w} {
    upvar #0 $w data

    tixChainMethod $w SetBindings

    $data(w:grid) config  	-xscrollcommand "$data(w:hsb) set" 	-yscrollcommand "$data(w:vsb) set" 	-sizecmd "tixScrolledWidget:Configure $w"  	-formatcmd "tixCallMethod $w FormatCmd"

    $data(w:hsb) config -command "$data(w:grid) xview"
    $data(w:vsb) config -command "$data(w:grid) yview"

    bindtags $data(w:grid)  	"$data(w:grid) TixSGrid TixGrid [winfo toplevel $data(w:grid)] all"    

    tixSetMegaWidget $data(w:grid) $w
}

#----------------------------------------------------------------------
#			RAW event bindings
#----------------------------------------------------------------------
proc tixScrolledGridBind {} {
    tixBind TixScrolledGrid <ButtonPress-1> {
	tixScrolledGrid:Button-1 [tixGetMegaWidget %W] %x %y
    }
    tixBind TixScrolledGrid <Shift-ButtonPress-1> {
	tixScrolledGrid:Shift-Button-1 %W %x %y
    }
    tixBind TixScrolledGrid <Control-ButtonPress-1> {
	tixScrolledGrid:Control-Button-1 %W %x %y
    }
    tixBind TixScrolledGrid <ButtonRelease-1> {
	tixScrolledGrid:ButtonRelease-1 %W %x %y
    }
    tixBind TixScrolledGrid <Double-ButtonPress-1> {
	tixScrolledGrid:Double-1 %W  %x %y
    }
    tixBind TixScrolledGrid <B1-Motion> {
	set tkPriv(x) %x 
	set tkPriv(y) %y
	set tkPriv(X) %X
	set tkPriv(Y) %Y

	tixScrolledGrid:B1-Motion %W %x %y
    }
    tixBind TixScrolledGrid <Control-B1-Motion> {
	set tkPriv(x) %x 
	set tkPriv(y) %y
	set tkPriv(X) %X
	set tkPriv(Y) %Y

	tixScrolledGrid:Control-B1-Motion %W %x %y
    }
    tixBind TixScrolledGrid <B1-Leave> {
	set tkPriv(x) %x 
	set tkPriv(y) %y
	set tkPriv(X) %X
	set tkPriv(Y) %Y

	tixScrolledGrid:B1-Leave %W
    }
    tixBind TixScrolledGrid <B1-Enter> {
	tixScrolledGrid:B1-Enter %W %x %y
    }
    tixBind TixScrolledGrid <Control-B1-Leave> {
	set tkPriv(x) %x 
	set tkPriv(y) %y
	set tkPriv(X) %X
	set tkPriv(Y) %Y

	tixScrolledGrid:Control-B1-Leave %W
    }
    tixBind TixScrolledGrid <Control-B1-Enter> {
	tixScrolledGrid:Control-B1-Enter %W %x %y
    }

    # Keyboard bindings
    #
    tixBind TixScrolledGrid <Up> {
	tixScrolledGrid:DirKey %W up
    }
    tixBind TixScrolledGrid <Down> {
	tixScrolledGrid:DirKey %W down
    }
    tixBind TixScrolledGrid <Left> {
	tixScrolledGrid:DirKey %W left
    }
    tixBind TixScrolledGrid <Right> {
	tixScrolledGrid:DirKey %W right
    }
    tixBind TixScrolledGrid <Prior> {
	%W yview scroll -1 pages
    }
    tixBind TixScrolledGrid <Next> {
	%W yview scroll 1 pages
    }
    tixBind TixScrolledGrid <Return> {
	tixScrolledGrid:Return %W 
    }
    tixBind TixScrolledGrid <space> {
	tixScrolledGrid:Space %W 
    }
}

#----------------------------------------------------------------------
#
#
#			 Mouse bindings
#
#
#----------------------------------------------------------------------
proc tixScrolledGrid:Button-1 {w x y} {
    if {[$w cget -state] == "disabled"} {
	return
    }
    if [$w cget -takefocus] {
	focus $w
    }
    case [tixScrolled:GetState $w] {
	{0} {
	    tixScrolledGrid:GoState s1 $w $x $y
       	}
	{b0} {
	    tixScrolledGrid:GoState b1 $w $x $y
       	}
	{m0} {
	    tixScrolledGrid:GoState m1 $w $x $y
       	}
	{e0} {
	    tixScrolledGrid:GoState e1 $w $x $y
       	}
    }
}



#----------------------------------------------------------------------
#
#		option configs
#----------------------------------------------------------------------

#----------------------------------------------------------------------
#
#		Widget commands
#----------------------------------------------------------------------


#----------------------------------------------------------------------
#
#		Private Methods
#----------------------------------------------------------------------

#----------------------------------------------------------------------
#		Virtual Methods
#----------------------------------------------------------------------
proc tixScrolledGrid:FormatCmd {w area x1 y1 x2 y2} {
    # do nothing
}

#----------------------------------------------------------------------
# virtual functions to query the client window's scroll requirement
#----------------------------------------------------------------------
proc tixScrolledGrid:GeometryInfo {w mW mH} {
    upvar #0 $w data


    if {$mW < 1} {
	set mW 1
    }
    if {$mH < 1} {
	set mH 1
    }

    return [$data(w:grid) geometryinfo $mW $mH]
}

 # SHList.tcl --
#
#	This file implements Scrolled HList widgets
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

tixWidgetClass tixScrolledHList {
    -classname TixScrolledHList
    -superclass tixScrolledWidget
    -method {
    }
    -flag {
	 -highlightbackground -highlightcolor -highlightthickness
    }
    -configspec {
	{-highlightbackground -highlightBackground HighlightBackground #d9d9d9}
	{-highlightcolor -highlightColor HighlightColor black}
	{-highlightthickness -highlightThickness HighlightThickness 2}
    }
    -default {
	{.scrollbar			auto}
	{*f1.borderWidth		1}
	{*hlist.Background		#c3c3c3}
	{*hlist.highlightBackground	#d9d9d9}
	{*hlist.relief			sunken}
	{*hlist.takeFocus		1}
	{*Scrollbar.background		#d9d9d9}
	{*Scrollbar.troughColor		#c3c3c3}
	{*Scrollbar.takeFocus		0}
	{*Scrollbar.relief		sunken}
	{*Scrollbar.width		15}
    }
    -forcecall {
	-highlightbackground -highlightcolor -highlightthickness
    }
}

proc tixScrolledHList:ConstructWidget {w} {
    upvar #0 $w data

    tixChainMethod $w ConstructWidget

    set data(pw:f1)  	[frame $w.f1 -takefocus 0]
    set data(w:hlist)  	[tixHList $w.f1.hlist -bd 0 -takefocus 1 -highlightthickness 0]

    pack $data(w:hlist) -in $data(pw:f1) -expand yes -fill both -padx 0 -pady 0

    set data(w:hsb)  	[scrollbar $w.hsb -orient horizontal -takefocus 0]
    set data(w:vsb)  	[scrollbar $w.vsb -orient vertical -takefocus 0]
    
    set data(pw:client) $data(pw:f1)
}

proc tixScrolledHList:SetBindings {w} {
    upvar #0 $w data

    tixChainMethod $w SetBindings

    $data(w:hlist) config  	-xscrollcommand "$data(w:hsb) set" 	-yscrollcommand "$data(w:vsb) set" 	-sizecmd "tixScrolledWidget:Configure $w"

    $data(w:hsb) config -command "$data(w:hlist) xview"
    $data(w:vsb) config -command "$data(w:hlist) yview"

}

#----------------------------------------------------------------------
#
#		option configs
#----------------------------------------------------------------------
proc tixScrolledHList:config-takefocus {w value} {
    upvar #0 $w data
  
    $data(w:hlist) config -takefocus $value
}	

proc tixScrolledHList:config-highlightbackground {w value} {
    upvar #0 $w data

    $data(pw:f1) config -highlightbackground $value
}

proc tixScrolledHList:config-highlightcolor {w value} {
    upvar #0 $w data

    $data(pw:f1) config -highlightcolor $value
}

proc tixScrolledHList:config-highlightthickness {w value} {
    upvar #0 $w data

    $data(pw:f1) config -highlightthickness $value
}


#----------------------------------------------------------------------
#
#		Widget commands
#----------------------------------------------------------------------

#----------------------------------------------------------------------
#
#		Private Methods
#----------------------------------------------------------------------
# virtual
#
proc tixScrolledHList:RepackHook {w} {
    upvar #0 $w data

if 0 {
    if [tixGetBoolean [$data(w:hlist) cget -header]] {
	set data(vsbPadY) [winfo height $data(w:hlist).tixsw:header]
    } else {
	set data(vsbPadY) 0
    }

    puts $data(vsbPadY)\ $data(w:hlist).tixsw:header
}
    tixChainMethod $w RepackHook
}
#----------------------------------------------------------------------
# virtual functions to query the client window's scroll requirement
#----------------------------------------------------------------------
proc tixScrolledHList:GeometryInfo {w mW mH} {
    upvar #0 $w data

    set extra [expr [$w.f1 cget -bd]+[$w.f1 cget -highlightthickness]]

    set mW [expr $mW - $extra*2]
    set mH [expr $mH - $extra*2]

    if {$mW < 1} {
	set mW 1
    }
    if {$mH < 1} {
	set mH 1
    }

    return [$data(w:hlist) geometryinfo $mW $mH]
}

 # SListBox.tcl --
#
#	This file implements Scrolled Listbox widgets
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#


# ToDo:
# -anchor (none)
#

tixWidgetClass tixScrolledListBox {
    -classname TixScrolledListBox
    -superclass tixScrolledWidget
    -method {
    }
    -flag {
	-anchor -browsecmd -command -state
    }
    -static {
	-anchor
    }
    -configspec {
	{-anchor anchor Anchor w}
	{-browsecmd browseCmd BrowseCmd ""}
	{-command command Command ""}
	{-state state State normal}
	{-takefocus takeFocus TakeFocus 1 tixVerifyBoolean}
    }
    -default {
	{.scrollbar			auto}
	{*borderWidth			1}
	{*listbox.highlightBackground	#d9d9d9}
	{*listbox.relief		sunken}
	{*listbox.background		#c3c3c3}
	{*listbox.takeFocus		1}
	{*Scrollbar.background		#d9d9d9}
	{*Scrollbar.troughColor		#c3c3c3}
	{*Scrollbar.takeFocus		0}
	{*Scrollbar.relief		sunken}
	{*Scrollbar.width		15}
    }
}

proc tixScrolledListBox:InitWidgetRec {w} {
    upvar #0 $w data

    tixChainMethod $w InitWidgetRec

    set data(x-first) 0
    set data(x-last)  1
    set data(y-first) 0
    set data(y-last)  1
}

proc tixScrolledListBox:ConstructWidget {w} {
    upvar #0 $w data

    tixChainMethod $w ConstructWidget

    set data(w:listbox)  	[listbox $w.listbox]
    set data(w:hsb)  	[scrollbar $w.hsb -orient horizontal]
    set data(w:vsb)  	[scrollbar $w.vsb -orient vertical ]

    set data(pw:client) $data(w:listbox)
}

proc tixScrolledListBox:SetBindings {w} {
    upvar #0 $w data

    tixChainMethod $w SetBindings

    $data(w:listbox) config  	-xscrollcommand "tixScrolledListBox:XView $w" 	-yscrollcommand "tixScrolledListBox:YView $w"

    $data(w:hsb) config -command "$data(w:listbox) xview"
    $data(w:vsb) config -command "$data(w:listbox) yview"

    bind $w <Configure> "+tixScrolledListBox:Configure $w"
    bind $w <FocusIn> "focus $data(w:listbox)"

    bindtags $data(w:listbox)      "$data(w:listbox) TixListboxState Listbox TixListbox [winfo toplevel $data(w:listbox)] all"
    tixSetMegaWidget $data(w:listbox) $w
}

proc tixScrolledListBoxBind {} {
    tixBind TixListboxState <1> {
	if {[set [tixGetMegaWidget %W](-state)] == "disabled"} {
	    break
	}
    }
    tixBind TixListbox      <1> {
	if [tixGetBoolean -nocomplain [%W cget -takefocus]] {
	    focus %W
	}
	tixScrolledListBox:Browse [tixGetMegaWidget %W]
    }

    tixBind TixListboxState <B1-Motion> {
	if {[set [tixGetMegaWidget %W](-state)] == "disabled"} {
	    break
	}
    }
    tixBind TixListbox      <B1-Motion> {
	tixScrolledListBox:Browse [tixGetMegaWidget %W]
    }

    tixBind TixListboxState <Up> {
	if {[set [tixGetMegaWidget %W](-state)] == "disabled"} {
	    break
	}
    }
    tixBind TixListbox      <Up> {
	tixScrolledListBox:KeyBrowse [tixGetMegaWidget %W]
    }

    tixBind TixListboxState <Down> {
	if {[set [tixGetMegaWidget %W](-state)] == "disabled"} {
	    break
	}
    }
    tixBind TixListbox      <Down> {
	tixScrolledListBox:KeyBrowse [tixGetMegaWidget %W]
    }

    tixBind TixListboxState <Return> {
	if {[set [tixGetMegaWidget %W](-state)] == "disabled"} {
	    break
	}
    }
    tixBind TixListbox      <Return> {
	tixScrolledListBox:KeyInvoke [tixGetMegaWidget %W]
    }


    tixBind TixListboxState <Double-1> {
	if {[set [tixGetMegaWidget %W](-state)] == "disabled"} {
	    break
	}
    }
    tixBind TixListbox      <Double-1> {
	tixScrolledListBox:Invoke [tixGetMegaWidget %W]
    }

    tixBind TixListboxState <ButtonRelease-1> {
	if {[set [tixGetMegaWidget %W](-state)] == "disabled"} {
	    break
	}
    }
    tixBind TixListbox      <ButtonRelease-1> {
	tixScrolledListBox:Browse [tixGetMegaWidget %W]
    }
}

proc tixScrolledListBox:Browse {w} {
    upvar #0 $w data

    if {$data(-browsecmd) != ""} {
	set bind(specs) {%V}
	set bind(%V) [$data(w:listbox) get  	    [$data(w:listbox) nearest [tixEvent flag y]]]
	tixEvalCmdBinding $w $data(-browsecmd) bind
    }
}

proc tixScrolledListBox:KeyBrowse {w} {
    upvar #0 $w data

    if {$data(-browsecmd) != ""} {
	set bind(specs) {%V}
	set bind(%V) [$data(w:listbox) get active]
	tixEvalCmdBinding $w $data(-browsecmd) bind
    }
}

# tixScrolledListBox:Invoke --
#
#	The user has invoked the listbox by pressing either the <Returh>
# key or double-clicking. Call the user-supplied -command function.
#
# For both -browsecmd and -command, it is the responsibility of the
# user-supplied function to determine the current selection of the listbox
# 
proc tixScrolledListBox:Invoke {w} {
    upvar #0 $w data

    if {$data(-command) != ""} {
	set bind(specs) {%V}
	set bind(%V) [$data(w:listbox) get  	    [$data(w:listbox) nearest [tixEvent flag y]]]
	tixEvalCmdBinding $w $data(-command) bind
    }
}

proc tixScrolledListBox:KeyInvoke {w} {
    upvar #0 $w data

    if {$data(-command) != ""} {
	set bind(specs) {%V}
	set bind(%V) [$data(w:listbox) get active]
	tixEvalCmdBinding $w $data(-command) bind
    }
}

#----------------------------------------------------------------------
#
#		option configs
#----------------------------------------------------------------------
proc tixScrolledListBox:config-takefocus {w value} {
    upvar #0 $w data
  
    $data(w:listbox) config -takefocus $value
}	


#----------------------------------------------------------------------
#
#		Widget commands
#----------------------------------------------------------------------


#----------------------------------------------------------------------
#
#		Private Methods
#----------------------------------------------------------------------
proc tixScrolledListBox:XView {w first last} {
    upvar #0 $w data

    set data(x-first) $first
    set data(x-last) $last

    $data(w:hsb) set $first $last
    tixWidgetDoWhenIdle tixScrolledWidget:Configure $w


}

proc tixScrolledListBox:YView {w first last} {
    upvar #0 $w data

    set data(y-first) $first
    set data(y-last) $last

    $data(w:vsb) set $first $last
    tixWidgetDoWhenIdle tixScrolledWidget:Configure $w

    # Somehow an update here must be used to advoid osscilation
    #
    update idletasks
}

#
#----------------------------------------------------------------------
# virtual functions to query the client window's scroll requirement
#----------------------------------------------------------------------
proc tixScrolledListBox:GeometryInfo {w mW mH} {
    upvar #0 $w data

    return [list  	[list $data(x-first) $data(x-last)] 	[list $data(y-first) $data(y-last)]]
}

proc tixScrolledListBox:Configure {w} {
    upvar #0 $w data

    tixWidgetDoWhenIdle tixScrolledListBox:TrickScrollbar $w

    if {$data(-anchor) == "e"} {
	$data(w:listbox) xview 100000
    }
}

# This procedure is necessary because listbox does not call x,y scroll command
# when its size is changed
#
proc tixScrolledListBox:TrickScrollbar {w} {
    upvar #0 $w data

    if [$data(w:listbox) select include 0] {
	set inc 1
    } else {
	set inc 0
    }

    $data(w:listbox) select set 0
    if {!$inc} {
	$data(w:listbox) select clear 0
    }
}

 # STList.tcl --
#
#	This file implements Scrolled TList widgets
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

tixWidgetClass tixScrolledTList {
    -classname TixScrolledTList
    -superclass tixScrolledWidget
    -method {
    }
    -flag {
    }
    -configspec {
    }
    -default {
	{.scrollbar			auto}
	{*borderWidth			1}
	{*tlist.background		#c3c3c3}
	{*tlist.highlightBackground	#d9d9d9}
	{*tlist.relief			sunken}
	{*tlist.takeFocus		1}
	{*Scrollbar.background		#d9d9d9}
	{*Scrollbar.troughColor		#c3c3c3}
	{*Scrollbar.takeFocus		0}
	{*Scrollbar.relief		sunken}
	{*Scrollbar.width		15}
    }
}

proc tixScrolledTList:ConstructWidget {w} {
    upvar #0 $w data

    tixChainMethod $w ConstructWidget

    set data(w:tlist)  	[tixTList $w.tlist]
    set data(w:hsb)  	[scrollbar $w.hsb -orient horizontal]
    set data(w:vsb)  	[scrollbar $w.vsb -orient vertical ]

    set data(pw:client) $data(w:tlist)
}

proc tixScrolledTList:SetBindings {w} {
    upvar #0 $w data

    tixChainMethod $w SetBindings

    $data(w:tlist) config  	-xscrollcommand "$data(w:hsb) set" 	-yscrollcommand "$data(w:vsb) set" 	-sizecmd "tixScrolledWidget:Configure $w"

    $data(w:hsb) config -command "$data(w:tlist) xview"
    $data(w:vsb) config -command "$data(w:tlist) yview"
}

#----------------------------------------------------------------------
#
#		option configs
#----------------------------------------------------------------------
proc tixScrolledTList:config-takefocus {w value} {
    upvar #0 $w data
  
    $data(w:tlist) config -takefocus $value
}	

#----------------------------------------------------------------------
#
#		Widget commands
#----------------------------------------------------------------------


#----------------------------------------------------------------------
#
#		Private Methods
#----------------------------------------------------------------------

#----------------------------------------------------------------------
# virtual functions to query the client window's scroll requirement
#----------------------------------------------------------------------
proc tixScrolledTList:GeometryInfo {w mW mH} {
    upvar #0 $w data

    return [$data(w:tlist) geometryinfo $mW $mH]
}

 # SText.tcl --
#
#	This file implements Scrolled Text widgets
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#



tixWidgetClass tixScrolledText {
    -classname TixScrolledText
    -superclass tixScrolledWidget
    -method {
    }
    -flag {
    }
    -static {
    }
    -configspec {
    }
    -default {
	{.scrollbar			both}
	{*borderWidth			1}
	{*text.background		#c3c3c3}
	{*text.highlightBackground	#d9d9d9}
	{*text.relief			sunken}
	{*text.takeFocus		1}
	{*Scrollbar.background		#d9d9d9}
	{*Scrollbar.relief		sunken}
	{*Scrollbar.troughColor		#c3c3c3}
	{*Scrollbar.takeFocus		0}
	{*Scrollbar.width		15}
    }
    -forcecall {
	-scrollbar
    }
}

proc tixScrolledText:ConstructWidget {w} {
    upvar #0 $w data

    tixChainMethod $w ConstructWidget

    set data(w:text)  	[text $w.text]
    set data(w:hsb)  	[scrollbar $w.hsb -orient horizontal]
    set data(w:vsb)  	[scrollbar $w.vsb -orient vertical]

    set data(pw:client) $data(w:text)
}

proc tixScrolledText:SetBindings {w} {
    upvar #0 $w data

    tixChainMethod $w SetBindings

    $data(w:text) config  	-xscrollcommand "tixScrolledText:XScroll $w" 	-yscrollcommand "tixScrolledText:YScroll $w"

    $data(w:hsb) config -command "$data(w:text) xview"
    $data(w:vsb) config -command "$data(w:text) yview"
}

#----------------------------------------------------------------------
#
#		option configs
#----------------------------------------------------------------------
proc tixScrolledText:config-takefocus {w value} {
    upvar #0 $w data
  
    $data(w:text) config -takefocus $value
}	

proc tixScrolledText:config-scrollbar {w value} {
    upvar #0 $w data
  
    if {[string match "auto*" $value]} {
	# There is a bug in TK that prevents the "auto" from operating
	# properly - sometimes you'd get "flashing" effect when
	# scrollbars keep apprearing and going away.
	set value "both"
    }
    set data(-scrollbar) $value

    tixChainMethod $w config-scrollbar $value

    return $value
}	

#----------------------------------------------------------------------
#
#		Widget commands
#----------------------------------------------------------------------


#----------------------------------------------------------------------
#
#		Private Methods
#----------------------------------------------------------------------

#----------------------------------------------------------------------
# virtual functions to query the client window's scroll requirement
#----------------------------------------------------------------------
proc tixScrolledText:GeometryInfo {w mW mH} {
    upvar #0 $w data

    return [list "$data(x,first) $data(x,last)" "$data(y,first) $data(y,last)"]
}

proc tixScrolledText:XScroll {w first last} {
    upvar #0 $w data

    set data(x,first) $first
    set data(x,last)  $last

    $data(w:hsb) set $first $last

    tixWidgetDoWhenIdle tixScrolledWidget:Configure $w
}

proc tixScrolledText:YScroll {w first last} {
    upvar #0 $w data

    set data(y,first) $first
    set data(y,last)  $last
    
    $data(w:vsb) set $first $last

    tixWidgetDoWhenIdle tixScrolledWidget:Configure $w
}

 # SWidget.tcl --
#
# 	tixScrolledWidget: virtual base class. Do not instantiate
#	This is the core class for all scrolled widgets.
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#


tixWidgetClass tixScrolledWidget {
    -virtual true
    -classname TixScrolledWidget
    -superclass tixPrimitive
    -method {
    }
    -flag {
	-scrollbar -scrollbarspace
    }
    -configspec {
	{-scrollbar scrollbar Scrollbar both}
	{-scrollbarspace scrollbarSpace ScrollbarSpace {both}}
    }
}

proc tixScrolledWidget:InitWidgetRec {w} {
    upvar #0 $w data

    tixChainMethod $w InitWidgetRec

    set data(x,first)   0
    set data(x,last)    0

    set data(y,first)   0
    set data(y,last)    0

    set data(lastSpec) ""
    set data(lastMW)   ""
    set data(lastMH)   ""
    set data(lastScbW) ""
    set data(lastScbH) ""

    set data(repack)	0
    set data(counter)   0

    set data(vsbPadY)   0
    set data(hsbPadX)   0
}

proc tixScrolledWidget:SetBindings {w} {
    upvar #0 $w data

    tixChainMethod $w SetBindings

    tixManageGeometry $data(pw:client) "tixScrolledWidget:ClientGeomProc $w"
    bind $data(pw:client) <Configure>  	[list tixScrolledWidget:ClientGeomProc $w "" $data(pw:client)]

    tixManageGeometry $data(w:hsb) "tixScrolledWidget:ClientGeomProc $w"
    bind $data(w:hsb) <Configure>  	[list tixScrolledWidget:ClientGeomProc $w "" $data(w:hsb)]

    tixManageGeometry $data(w:vsb) "tixScrolledWidget:ClientGeomProc $w"
    bind $data(w:vsb) <Configure>  	[list tixScrolledWidget:ClientGeomProc $w "" $data(w:vsb)]

    bind $w <Configure> "tixScrolledWidget:MasterGeomProc $w"

    tixWidgetDoWhenIdle tixScrolledWidget:Repack $w
    set data(repack) 1
}

proc tixScrolledWidget:config-scrollbar {w value} {
    upvar #0 $w data

    if {[lindex $value 0] == "auto"} {
	foreach xspec [lrange $value 1 end] {
	    case $xspec {
		{+x -x +y -y} {}
		default {
		    error "bad -scrollbar value \"$value\""
		}
	    }
	}
    } else {
	case $value in {
	    {none x y both} {}
	    default {
		error "bad -scrollbar value \"$value\""
	    }
	}
    }

    if {$data(repack) == 0} {
	set data(repack) 1
	tixWidgetDoWhenIdle tixScrolledWidget:Repack $w
    }
}	

proc tixScrolledWidget:config-scrollbarspace {w value} {
    upvar #0 $w data
  
    if {$data(repack) == 0} {
	set data(repack) 1
	tixWidgetDoWhenIdle tixScrolledWidget:Repack $w
    }
}	


#----------------------------------------------------------------------
#
#		 Scrollbar calculations
#
#----------------------------------------------------------------------
proc tixScrolledWidget:ClientGeomProc {w type client} {
    upvar #0 $w data

    if {$data(repack) == 0} {
	set data(repack) 1
	tixWidgetDoWhenIdle tixScrolledWidget:Repack $w
    }
}

proc tixScrolledWidget:MasterGeomProc {w} {
    upvar #0 $w data

    if {$data(repack) == 0} {
	set data(repack) 1
	tixWidgetDoWhenIdle tixScrolledWidget:Repack $w
    }
}

proc tixScrolledWidget:Configure {w} {
    if {![winfo exists $w]} {
	return
    }

    upvar #0 $w data

    if {$data(repack) == 0} {
	set data(repack) 1
	tixWidgetDoWhenIdle tixScrolledWidget:Repack $w
    }
}

proc tixScrolledWidget:ScrollCmd {w scrollbar axis first last} {
    upvar #0 $w data

    $scrollbar set $first $last
}

# Show or hide the scrollbars as required.
#
# spec: 00 = need none
# spec: 01 = need y
# spec: 10 = need x
# spec: 11 = need xy
#
proc tixScrolledWidget:Repack {w} {
    tixCallMethod $w RepackHook
}

proc tixScrolledWidget:RepackHook {w} {
    upvar #0 $w data

    if {![winfo exists $w]} {
	# This was generated by the <Destroy> event
	#
	return
    }

    set client $data(pw:client)

    # Calculate the size of the master
    #
    set mreqw [winfo reqwidth  $w]
    set mreqh [winfo reqheight $w]
    set creqw [winfo reqwidth  $client]
    set creqh [winfo reqheight $client]

    set scbW [winfo reqwidth  $w.vsb]
    set scbH [winfo reqheight $w.hsb]

    case $data(-scrollbarspace) {
	"x" {
	    incr creqh $scbH
	}
	"y" {
	    incr creqw $scbW
	}
	"both" {
	    incr creqw $scbW
	    incr creqh $scbH
	}
    }

    if {$data(-width) != 0} {
	set creqw $data(-width)
    }
    if {$data(-height) != 0} {
	set creqh $data(-height)
    }

    if {$mreqw != $creqw || $mreqh != $creqh } {
	if {![info exists data(counter)]} {
	    set data(counter) 0
	}
	if {$data(counter) < 50} {
	    incr data(counter)
	    tixGeometryRequest $w $creqw $creqh
	    tixWidgetDoWhenIdle tixScrolledWidget:Repack $w
	    set data(repack) 1
	    return
	}
    }

    set data(counter) 0
    set mw [winfo width  $w]
    set mh [winfo height $w]

    set cw [expr $mw - $scbW]
    set ch [expr $mh - $scbH]

    set scbx [expr $mw - $scbW]
    set scby [expr $mh - $scbH]

    # Check the validity of the sizes: if window was not mapped then
    # sizes will be below 1x1
    if {$cw < 1} {
	set cw 1
    }
    if {$ch < 1} {
	set ch 1
    }
    if {$scbx < 1} {
	set scbx 1
    }
    if {$scby < 1} {
	set scby 1
    }

    if {[lindex $data(-scrollbar) 0] == "auto"} {
	# Find out how we are going to pack the scrollbars
	#
	set spec [tixScrolledWidget:CheckScrollbars $w $scbW $scbH]

	foreach xspec [lrange $data(-scrollbar) 1 end] {
	    case $xspec {
		+x {
		    set spec [expr $spec | 10]
		}
		-x {
		    set spec [expr $spec & 01]
		}
		+y {
		    set spec [expr $spec | 01]
		}
		-y {
		    set spec [expr $spec & 10]
		}
	    }
	}
	if {$spec == 0} {
	    set spec 00
	}
	if {$spec == 1} {
	    set spec 01
	}
    } else {
	case $data(-scrollbar) in {
	    none {
		set spec 00
	    }
	    x {
		set spec 10
	    }
	    y {
		set spec 01
	    }
	    both {
		set spec 11
	    }
	}
    }


    if {$data(lastSpec)==$spec && $data(lastMW)==$mw && $data(lastMH)==$mh} {
	if {$data(lastScbW) == $scbW && $data(lastScbH) == $scbH} {
	    tixCallMethod $w PlaceWindow
	    set data(repack) 0
	    return
	}
    }

    set vsbH [expr $mh - $data(vsbPadY)]
    set hsbW [expr $mw - $data(hsbPadX)]

    if {$vsbH < 1} {
	set vsbH 1
    }
    if {$hsbW < 1} {
	set hsbW 1
    }

    case $spec in {
	"00" {
	    tixMoveResizeWindow $client 0 0 $mw $mh

	    tixMapWindow $client
    	    tixUnmapWindow $data(w:hsb)
	    tixUnmapWindow $data(w:vsb)
	}
	"01" {
	    tixMoveResizeWindow $client 0 0 $cw $mh
	    tixMoveResizeWindow $data(w:vsb) $scbx $data(vsbPadY) $scbW $vsbH

	    tixMapWindow $client
	    tixUnmapWindow $data(w:hsb)
	    tixMapWindow $data(w:vsb)
	}
	"10" {
	    tixMoveResizeWindow $client 0 0 $mw $ch
	    tixMoveResizeWindow $data(w:hsb) $data(hsbPadX) $scby $hsbW $scbH 

	    tixMapWindow $client
	    tixMapWindow $data(w:hsb)
	    tixUnmapWindow $data(w:vsb)
	}
	"11" {
	    set vsbH [expr $ch - $data(vsbPadY)]
	    set hsbW [expr $cw - $data(hsbPadX)]
	    if {$vsbH < 1} {
		set vsbH 1
	    }
	    if {$hsbW < 1} {
		set hsbW 1
	    }

	    tixMoveResizeWindow $client 0 0 $cw $ch
	    tixMoveResizeWindow $data(w:vsb) $scbx $data(vsbPadY) $scbW $vsbH
	    tixMoveResizeWindow $data(w:hsb) $data(hsbPadX) $scby $hsbW $scbH 

	    tixMapWindow $client
	    tixMapWindow $data(w:hsb)
	    tixMapWindow $data(w:vsb)
	}
    }

    set data(lastSpec) $spec
    set data(lastMW)   $mw
    set data(lastMH)   $mh
    set data(lastScbW) $scbW
    set data(lastScbH) $scbH

    tixCallMethod $w PlaceWindow
    set data(repack) 0
}

proc tixScrolledWidget:PlaceWindow {w} {
    # virtual base function
}

#
# Helper function
#
proc tixScrolledWidget:NeedScrollbar {w axis} {
    upvar #0 $w data

    if {$data($axis,first) > 0.0} {
	return 1
    }

    if {$data($axis,last) < 1.0} {
	return 1
    }
    
    return 0
}

# Return whether H and V needs scrollbars in a list of two booleans
#
#
proc tixScrolledWidget:CheckScrollbars {w scbW scbH} {
    upvar #0 $w data

    set mW [winfo width  $w]
    set mH [winfo height $w]

    set info [tixCallMethod $w GeometryInfo $mW $mH]

    if {$info != ""} {
	set xSpec [lindex $info 0]
	set ySpec [lindex $info 1]

	set data(x,first)   [lindex $xSpec 0]
	set data(x,last)    [lindex $xSpec 1]

	set data(y,first)   [lindex $ySpec 0]
	set data(y,last)    [lindex $ySpec 1]
    }

    set needX [tixScrolledWidget:NeedScrollbar $w x]
    set needY [tixScrolledWidget:NeedScrollbar $w y]

    if {[winfo ismapped $w]==0} {
	return "$needX$needY"
    }

    if {$needX && $needY} {
	return 11
    }

    if {$needX == 0 && $needY == 0} {
	return 00
    }

    if {$needX} {
	set mH [expr $mH - $scbH]
    }
    if {$needY} {
	set mW [expr $mW - $scbW]
    }

    set info [tixCallMethod $w GeometryInfo $mW $mH]
    if {$info != ""} {
	set xSpec [lindex $info 0]
	set ySpec [lindex $info 1]

	set data(x,first)   [lindex $xSpec 0]
	set data(x,last)    [lindex $xSpec 1]

	set data(y,first)   [lindex $ySpec 0]
	set data(y,last)    [lindex $ySpec 1]
    }

    set needX [tixScrolledWidget:NeedScrollbar $w x]
    set needY [tixScrolledWidget:NeedScrollbar $w y]

    return "$needX$needY"
}

#----------------------------------------------------------------------
# Following is a bunch of crap. Not needed in TK 4.0.
#----------------------------------------------------------------------

#----------------------------------------------------------------------
# Keyboard events -
#
#	Raw event handlers: redirect binding events to class methods
#
proc tixScrolledWidget:RawUpKey {w} {
    tixCallMethod $w HandleLineUp
}

proc tixScrolledWidget:RawDownKey {w} {
    tixCallMethod $w HandleLineDown
}

proc tixScrolledWidget:RawLeftKey {w} {
    tixCallMethod $w HandleLeftKey
}

proc tixScrolledWidget:RawRightKey {w} {
    tixCallMethod $w HandleRightKey
}

proc tixScrolledWidget:RawPriorKey {w} {
    tixCallMethod $w HandlePageUp
}

proc tixScrolledWidget:RawNextKey {w} {
    tixCallMethod $w HandlePageDown
}

# Virtual event handlers: subclasses can derive from these functions
#

proc tixScrolledWidget:HandleLineUp {w} {}

proc tixScrolledWidget:HandleLineDown {w} {}

proc tixScrolledWidget:HandlePageUp {w} {}

proc tixScrolledWidget:HandlePageDown {w} {}

proc tixScrolledWidget:HandleLeftKey {w} {}

proc tixScrolledWidget:HandleRightKey {w} {}

 # SWindow.tcl --
#
#	This file implements Scrolled Window widgets
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

#
#
# Example:
#	
#	tixScrolledWindow .w
#	set window [.w subwidget window]
#		# Now you can put a whole widget hierachy inside $window.
#		#
#	button $window.b
#	pack $window.b
#
# Author's note
#
# Note, the current implementation does not allow the child window
# to be outside of the parent window when the parent's size is larger
# than the child's size. This is fine for normal operations. However,
# it is not suitable for an MDI master window. Therefore, you will notice
# that the MDI master window is not a subclass of ScrolledWidget at all.
#
#

tixWidgetClass tixScrolledWindow {
    -classname TixScrolledWindow
    -superclass tixScrolledWidget
    -method {
    }
    -flag {
	-expandmode -shrink -xscrollincrement -yscrollincrement
    }
    -static {
    }
    -configspec {
	{-expandmode expandMode ExpandMode expand}
	{-shrink shrink Shrink ""}
	{-xscrollincrement xScrollIncrement ScrollIncrement ""}
	{-yscrollincrement yScrollIncrement ScrollIncrement ""}

	{-scrollbarspace scrollbarSpace ScrollbarSpace {both}}
    }
    -default {
	{.scrollbar			auto}
	{*window.borderWidth		1}
	{*f1.borderWidth		1}
	{*Scrollbar.borderWidth		1}
	{*Scrollbar.background		#d9d9d9}
	{*Scrollbar.relief		sunken}
	{*Scrollbar.troughColor		#c3c3c3}
	{*Scrollbar.takeFocus		0}
	{*Scrollbar.width		15}
    }
}

proc tixScrolledWindow:InitWidgetRec {w} {
    upvar #0 $w data

    tixChainMethod $w InitWidgetRec

    set data(dx) 0
    set data(dy) 0
}

proc tixScrolledWindow:ConstructWidget {w} {
    upvar #0 $w data

    tixChainMethod $w ConstructWidget

    set data(pw:f1)  	[frame $w.f1 -relief sunken]
    set data(pw:f2)  	[frame $w.f2 -bd 0]
    set data(w:window)  	[frame $w.f2.window -bd 0]
    pack $data(pw:f2) -in $data(pw:f1) -expand yes -fill both

    set data(w:hsb)  	[scrollbar $w.hsb -orient horizontal -takefocus 0]
    set data(w:vsb)  	[scrollbar $w.vsb -orient vertical -takefocus 0]
#   set data(w:pann)  #	[frame $w.pann -bd 2 -relief groove]
    
    $data(pw:f1) config -highlightthickness  	[$data(w:hsb) cget -highlightthickness]

    set data(pw:client) $data(pw:f1)
}

proc tixScrolledWindow:SetBindings {w} {
    upvar #0 $w data

    tixChainMethod $w SetBindings

    $data(w:hsb) config -command "tixScrolledWindow:ScrollBarCB $w x"
    $data(w:vsb) config -command "tixScrolledWindow:ScrollBarCB $w y"

    tixManageGeometry $data(w:window) "tixScrolledWindow:WindowGeomProc $w"
}

# This guy just keeps asking for a same size as the w:window 
#
proc tixScrolledWindow:WindowGeomProc {w args} {
    upvar #0 $w data

    set rw [winfo reqwidth  $data(w:window)]
    set rh [winfo reqheight $data(w:window)]

    if {$rw != [winfo reqwidth  $data(pw:f2)] ||
	$rh != [winfo reqheight $data(pw:f2)]} {
	tixGeometryRequest $data(pw:f2) $rw $rh
    }
}

proc tixScrolledWindow:Scroll {w axis total window first args} {
    upvar #0 $w data

    case [lindex $args 0] {
	"scroll" {
	    set amt  [lindex $args 1]
	    set unit [lindex $args 2]

	    case $unit {
		"units" {
		    set incr $axis\scrollincrement
		    if {$data(-$incr) != ""} {
			set by $data(-$incr)
		    } else {
			set by [expr $window / 16]
		    }
		    set first [expr $first + $amt * $by]
		}
		"pages" {
		    set first [expr $first + $amt * $window]
		}
	    }
	}
	"moveto" {
	    set to [lindex $args 1]
	    set first [expr int($to * $total)]
	}
    }

    if {[expr $first + $window] > $total} {
	set first [expr $total - $window]
    }
    if {$first < 0} {
	set first 0
    }

    return $first
}

proc tixScrolledWindow:ScrollBarCB {w axis args} {
    upvar #0 $w data

    set bd         [expr [$data(pw:f1) cget -bd] + [$data(pw:f1) cget -highlightthickness]]
    set fw [expr [winfo width  $data(pw:f1)] - 2*$bd]
    set fh [expr [winfo height $data(pw:f1)] - 2*$bd]
    set ww [winfo reqwidth  $data(w:window)]
    set wh [winfo reqheight $data(w:window)]

    if {$axis == "x"} {
	set data(dx)  	    [eval tixScrolledWindow:Scroll $w $axis $ww $fw $data(dx) $args]
    } else {
	set data(dy)  	    [eval tixScrolledWindow:Scroll $w $axis $wh $fh $data(dy) $args]
    }

    tixWidgetDoWhenIdle tixScrolledWindow:PlaceWindow $w
}

proc tixScrolledWindow:PlaceWindow {w} {
    upvar #0 $w data

    set bd         [expr [$data(pw:f1) cget -bd] + [$data(pw:f1) cget -highlightthickness]]
    set fw [expr [winfo width  $data(pw:f1)] - 2*$bd]
    set fh [expr [winfo height $data(pw:f1)] - 2*$bd]
    set ww [winfo reqwidth  $data(w:window)]
    set wh [winfo reqheight $data(w:window)]

    tixMapWindow $data(w:window)

    if {$data(-expandmode) == "expand"} {
	if {$ww < $fw} {
	    set ww $fw
	}
	if {$wh < $fh} {
	    set wh $fh
	}
    }
    if {$data(-shrink) == "x"} {
	if {$fw < $ww} {
	    set ww $fw
	}
    }

    tixMoveResizeWindow $data(w:window) -$data(dx) -$data(dy) $ww $wh

    set first [expr $data(dx).0 / $ww.0]
    set last  [expr $first + ($fw.0 / $ww.0)]
    $data(w:hsb) set $first $last

    set first [expr $data(dy).0 / $wh.0]
    set last  [expr $first + ($fh.0 / $wh.0)]
    $data(w:vsb) set $first $last
}

#----------------------------------------------------------------------
# virtual functions to query the client window's scroll requirement
#
# When this function is called, the scrolled window is going to be
# mapped, if it is still unmapped. Also, it is going to change its
# size. Therefore, it is a good time to check whether the w:window needs
# to be re-positioned due to the new parent window size.
#----------------------------------------------------------------------
proc tixScrolledWindow:GeometryInfo {w mW mH} {
    upvar #0 $w data

    set bd         [expr [$data(pw:f1) cget -bd] + [$data(pw:f1) cget -highlightthickness]]
    set fw [expr $mW -2*$bd]
    set fh [expr $mH -2*$bd]
    set ww [winfo reqwidth  $data(w:window)]
    set wh [winfo reqheight $data(w:window)]

    # Calculate the X info
    #
    if {$fw >= $ww} {
	if {$data(dx) > 0} {
	    set data(dx) 0
	}
	set xinfo [list 0.0 1.0]
    } else {
	set maxdx [expr $ww - $fw]
	if {$data(dx) > $maxdx} {
	    set data(dx) $maxdx
	}
	set first [expr $data(dx).0 / $ww.0]
	set last  [expr $first + ($fw.0 / $ww.0)]
	set xinfo [list $first $last]
    }
    # Calculate the Y info
    #
    if {$fh >= $wh} {
	if {$data(dy) > 0} {
	    set data(dy) 0
	}
	set yinfo [list 0.0 1.0]
    } else {
	set maxdy [expr $wh - $fh]
	if {$data(dy) > $maxdy} {
	    set data(dy) $maxdy
	}
	set first [expr $data(dy).0 / $wh.0]
	set last  [expr $first + ($fh.0 / $wh.0)]
	set yinfo [list $first $last]
    }

    return [list $xinfo $yinfo]
}

 # Select.tcl --
#
#	Implement the tixSelect widget.
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

tixWidgetClass tixSelect {
    -superclass tixLabelWidget
    -classname  TixSelect
    -method {
	add button invoke
    }
    -flag {
	-allowzero -buttontype -command -disablecallback -orientation
	-orient -padx -pady -radio -selectedbg -state -validatecmd
	-value -variable
    }
    -forcecall {
	-variable -state
    }
    -static {
	-allowzero -orientation -padx -pady -radio
    }
    -configspec {
	{-allowzero allowZero AllowZero 0 tixVerifyBoolean}
	{-buttontype buttonType ButtonType button}
	{-command command Command ""}
	{-disablecallback disableCallback DisableCallback 0 tixVerifyBoolean}
	{-orientation orientation Orientation horizontal}
	{-padx padx Pad 0}
	{-pady pady Pad 0}
	{-radio radio Radio 0 tixVerifyBoolean}
	{-selectedbg selectedBg SelectedBg gray}
	{-state state State normal}
	{-validatecmd validateCmd ValidateCmd ""}
	{-value value Value ""}
	{-variable variable Variable ""}
    }
    -alias {
	{-orient -orientation}
    }
    -default {
	{*frame.borderWidth			1}
	{*frame.relief				sunken}
	{*Button.borderWidth			2}
	{*Button.highlightThickness		0}
    }
}

proc tixSelect:InitWidgetRec {w} {
    upvar #0 $w data

    tixChainMethod $w InitWidgetRec
    set data(items)    ""
    set data(buttonbg) ""
    set data(varInited)	  0
}

#----------------------------------------------------------------------
#                           CONFIG OPTIONS
#----------------------------------------------------------------------
proc tixSelect:config-state {w arg} {
    upvar #0 $w data

    if {$arg == "disabled"} {
	foreach item $data(items) {
	    $data(w:$item) config -state disabled -relief raised  		-bg $data(buttonbg)
	}
	if ![info exists data(labelFg)] {
	    set data(labelFg) [$data(w:label) cget -foreground]
	    catch {
		$data(w:label) config -fg [tix option get disabled_fg]
	    }
	}
    } else {
	foreach item $data(items) {
	    if {[lsearch $data(-value) $item] != -1} {
		# This button is selected
		#
		$data(w:$item) config -relief sunken -bg $data(-selectedbg)  		    -state normal
	    } else {
		$data(w:$item) config -relief raised -bg $data(buttonbg)  		    -command "$w invoke $item" -state normal
	    }
	}
	if [info exists data(labelFg)] {
	    catch {
		$data(w:label) config -fg $data(labelFg)
	    }
	    unset data(labelFg)
	}
    }

    return ""
}

proc tixSelect:config-variable {w arg} {
    upvar #0 $w data

    set oldValue $data(-value)

    if [tixVariable:ConfigVariable $w $arg] {
	# The value of data(-value) is changed if tixVariable:ConfigVariable 
	# returns true
	set newValue $data(-value)
	set data(-value) $oldValue
	tixSelect:config-value $w $newValue
    }
    catch {
	unset data(varInited)
    }
    set data(-variable) $arg
}

proc tixSelect:config-value {w value} {
    upvar #0 $w data

    # sanity checking
    #
    foreach item $value {
	if {[lsearch $data(items) $item] == "-1"} {
	    error "subwidget \"$item\" does not exist"
	}
    }

    tixSelect:SetValue $w $value
}

#----------------------------------------------------------------------
#                     WIDGET COMMANDS
#----------------------------------------------------------------------
proc tixSelect:add {w name args} {
    upvar #0 $w data

    set data(w:$name) [eval $data(-buttontype) $data(w:frame).$name -command  	 [list "$w invoke $name"] -takefocus 0 $args]

    if {$data(-orientation) == "horizontal"} {
	pack $data(w:$name) -side left -expand yes -fill y 	    -padx $data(-padx) -pady $data(-pady)
    } else {
	pack $data(w:$name) -side top -expand yes  -fill x 	    -padx $data(-padx) -pady $data(-pady)
    }

    if {$data(-state) == "disabled"} {
	$data(w:$name) config -relief raised -state disabled
    }

    # find out the background of the buttons
    #
    if {$data(buttonbg) == ""} {
	set data(buttonbg) [lindex [$data(w:$name) config -background] 4]
	
    }

    lappend data(items) $name
}

# Obsolete command
#
proc tixSelect:button {w name args} {
    upvar #0 $w data

    if {$args != ""} {
	return [eval $data(w:$name) $args]
    } else {
	return $w.$name
    }
}

# This is called when a button is invoked
#
proc tixSelect:invoke {w button} {
    upvar #0 $w data

    if {$data(-state) != "normal"} {
	return
    }

    set newValue $data(-value)

    if {[lsearch $data(-value) $button] != -1} {
	# This button was selected
	#
    	if {[llength $data(-value)] > 1 || [tixGetBoolean $data(-allowzero)]} {

	    # Take the button from the selected list
	    #
	    set newValue ""
	    foreach item $data(-value) {
		if {$item != $button} {
		    lappend newValue $item
		}
	    }
	}
    } else {
	# This button was not selected
	#
	if [tixGetBoolean $data(-radio)] {
	    # The button become the sole item in the list
	    #
	    set newValue [list $button]
	} else {
	    # Add this button into the list
	    #
	    lappend newValue $button
	}
    }

    if {$newValue != $data(-value)} {
	tixSelect:SetValue $w $newValue
    }
}

#----------------------------------------------------------------------
#                Private functions
#----------------------------------------------------------------------
proc tixSelect:SetValue {w newValue {noUpdate 0}} {
    upvar #0 $w data

    set oldValue $data(-value)

    if {$data(-validatecmd) != ""} {
       set data(-value) [tixEvalCmdBinding $w $data(-validatecmd) "" $newValue]
    } else {
	if {[tixGetBoolean $data(-radio)] && [llength $newValue] > 1} {
	    error "cannot choose more than one items in a radio box"
	}

	if {![tixGetBoolean $data(-allowzero)] && [llength $newValue] == 0} {
	    error "empty selection not allowed"
	}

	set data(-value) $newValue
    }

    if {! $noUpdate} {
	tixVariable:UpdateVariable $w
    }

    # Reset all to be unselected
    #
    foreach item $data(items) {
	if {[lsearch $data(-value) $item] == -1} {
	    # Is unselected
	    #
	    if {[lsearch $oldValue $item] != -1} {
		# was selected
		# -> popup the button, call command
		#
		$data(w:$item) config -relief raised -bg $data(buttonbg)
		tixSelect:CallCommand $w $item 0
	    }
	} else {
	    # Is selected
	    #
	    if {[lsearch $oldValue $item] == -1} {
		# was unselected
		# -> push down the button, call command
		#
		$data(w:$item) config -relief sunken -bg $data(-selectedbg)
		tixSelect:CallCommand $w  $item 1
	    }
	}
    }
}

proc tixSelect:CallCommand {w name value} {
    upvar #0 $w data

    if {!$data(-disablecallback) && $data(-command) != ""} {
	if {![info exists data(varInited)]} {
	    set bind(specs) "name value"
	    set bind(name)  $name
	    set bind(value) $value
	    tixEvalCmdBinding $w $data(-command) bind $name $value
	}
    }
}

proc tixSelect:Destructor {w} {

    tixVariable:DeleteVariable $w

    # Chain this to the superclass
    #
    tixChainMethod $w Destructor
}

 # Shell.tcl --
#
#	This is the base class to all shell widget
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

#
# type : normal, transient, overrideredirect
#
tixWidgetClass tixShell {
    -superclass tixPrimitive
    -classname  TixShell
    -flag {
	-title
    }
    -configspec {
	{-title title Title ""}
    }
    -forcecall {
	-title
    }
}

#----------------------------------------------------------------------
# ClassInitialization:
#----------------------------------------------------------------------
proc tixShell:CreateRootWidget {w args} {
    upvar #0 $w data
    upvar #0 $data(className) classRec

    toplevel $w -class $data(ClassName)
    wm withdraw $w
}

proc tixShell:config-title {w value} {
    wm title $w $value
}

 # SimpDlg.tcl --
#
#	This file implements Simple Dialog widgets
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

tixWidgetClass tixSimpleDialog {
    -classname TixSimpleDialog
    -superclass tixDialogShell
    -method {}
    -flag   {
	-buttons -message -type
    }
    -configspec {
	{-buttons buttons Buttons ""}
	{-message message Message ""}
	{-type type Type info}
    }
}

proc tixSimpleDialog:ConstructWidget {w} {
    upvar #0 $w data

    tixChainMethod $w ConstructWidget

    frame $w.top

    label $w.top.icon -image [tix getimage $data(-type)]
    label $w.top.message -text $data(-message)

    pack $w.top.icon    -side left -padx 20 -pady 50 -anchor c
    pack $w.top.message -side left -padx 10 -pady 50 -anchor c

    frame $w.bot

    pack $w.bot -side bottom -fill x
    pack $w.top -side top -expand yes -fill both
}

 # StackWin.tcl --
#
#	Similar to NoteBook but uses a Select widget to represent the pages.
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

tixWidgetClass tixStackWindow {
    -classname TixStackWindow
    -superclass tixVStack
    -method {
    }
    -flag {
    }
    -configspec {
    }
}

proc tixStackWindow:ConstructWidget {w} {
    upvar #0 $w data

    tixChainMethod $w ConstructWidget

    set data(w:tabs) [tixSelect $w.tabs]

    # We can't use the packer because it will conflict with the
    # geometry management of the VStack widget.
    #
    tixManageGeometry $data(w:tabs) "tixVStack:ClientGeomProc $w"
}

proc tixStackWindow:add {w child args} {
    upvar #0 $w data

    set ret [eval tixChainMethod $w add $child $args]

    # Find out the -label option
    #
    tixForEach {flag value} $args {
	if {$flag == "-label"} {
	    set label $value
	}
    }

    $data(w:tabs) add $child -command "$w raise $child"  	-text $label

    return $ret
}

proc tixStackWindow:raise {w child} {
    upvar #0 $w data

    $data(w:tabs) config -value $child

    tixChainMethod $w raise $child
}

proc tixStackWindow:Resize {w} {
    upvar #0 $w data

    # We have to take care of the size of the tabs so that 
    #
    set tW [winfo reqwidth  $data(w:tabs)]
    set tH [winfo reqheight $data(w:tabs)]

    tixMoveResizeWindow $data(w:tabs) $data(-ipadx) $data(-ipady) $tW $tH
    tixMapWindow $data(w:tabs)

    set data(pad-y1) [expr $tH + $data(-ipadx)]
    set data(minW)   [expr $tW + 2 * $data(-ipadx)]
    set data(minH)   [expr $tH + 2 * $data(-ipady)]

    # Now that we know data(pad-y1), we can chain the call
    #
    tixChainMethod $w Resize
}

 # StatBar.tcl --
#
#	The StatusBar of an application.
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

tixWidgetClass tixStatusBar {
    -classname TixStatusBar
    -superclass tixPrimitive
    -method {
    }
    -flag {
	-fields
    }
    -static {
	-fields
    }
    -configspec {
	{-fields fields Fields ""}
    }
}

#--------------------------
# Create Widget
#--------------------------
proc tixStatusBar:ConstructWidget {w} {
    upvar #0 $w data

    tixChainMethod $w ConstructWidget

    foreach field $data(-fields) {
	set name  [lindex $field 0]
	set width [lindex $field 1]

	set data(w:width) [label $w.$name -width $width]
    }
}


#----------------------------------------------------------------------
#                         Public methods
#----------------------------------------------------------------------


#----------------------------------------------------------------------
#                         Internal commands
#----------------------------------------------------------------------

 # StdBBox.tcl --
#
#	Standard Button Box, used in standard dialog boxes
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#



tixWidgetClass tixStdButtonBox {
    -classname TixStdButtonBox
    -superclass tixButtonBox
    -flag {
	-applycmd -cancelcmd -helpcmd -okcmd
    }
    -configspec {
	{-applycmd applyCmd ApplyCmd ""}
	{-cancelcmd cancelCmd CancelCmd ""}
	{-helpcmd helpCmd HelpCmd ""}
	{-okcmd okCmd OkCmd ""}
    }
    -default {
	{.borderWidth 	1}
	{.relief 	raised}
	{.padX 		5}
	{.padY 		10}
	{*Button.anchor	c}
	{*Button.padX	5}
    }
}

proc tixStdButtonBox:ConstructWidget {w} {
    upvar #0 $w data

    tixChainMethod $w ConstructWidget

    $w add ok     -text OK     -under 0 -width 6 -command $data(-okcmd)
    $w add apply  -text Apply  -under 0 -width 6 -command $data(-applycmd)
    $w add cancel -text Cancel -under 0 -width 6 -command $data(-cancelcmd)
    $w add help   -text Help   -under 0 -width 6 -command $data(-helpcmd)
}

proc tixStdButtonBox:config {w flag value} {
    upvar #0 $w data

    case $flag {
	-okcmd {
	    $data(w:ok)     config -command $value
	}
	-applycmd {
	    $data(w:apply)  config -command $value
	}
	-cancelcmd {
	    $data(w:cancel) config -command $value
	}
	-helpcmd {
	    $data(w:help)   config -command $value
	}
	default {
	    tixChainMethod $w config $flag $value
	}
    }
}

 # StdShell.tcl --
#
#	Standard Dialog Shell.
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

tixWidgetClass tixStdDialogShell {
    -classname TixStdDialogShell
    -superclass tixDialogShell
    -method {}
    -flag   {
	-cached
    }
    -configspec {
	{-cached cached Cached ""}
    }
}

proc tixStdDialogShell:ConstructWidget {w} {
    upvar #0 $w data

    tixChainMethod $w ConstructWidget
    set data(w:btns)   [tixStdButtonBox $w.btns]
    set data(w_tframe) [frame $w.tframe]

    pack $data(w_tframe) -side top -expand yes -fill both
    pack $data(w:btns) -side bottom -fill both

    tixCallMethod $w ConstructTopFrame $data(w_tframe)
}


# Subclasses of StdDialogShell should override this method instead of
# ConstructWidget.
#
# Override : always
# chain    : before
proc tixStdDialogShell:ConstructTopFrame {w frame} {
    # Do nothing
}

 # TList.tcl --
#
#	This file defines the default bindings for Tix Tabular Listbox
#	widgets.
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#



#--------------------------------------------------------------------------
# tkPriv elements used in this file:
#
# afterId -		Token returned by "after" for autoscanning.
# fakeRelease -		Cancel the ButtonRelease-1 after the user double click
#--------------------------------------------------------------------------
#
proc tixTListBind {} {
    tixBind TixTList <ButtonPress-1> {
	tixTList:Button-1 %W %x %y
    }
    tixBind TixTList <Shift-ButtonPress-1> {
	tixTList:Shift-Button-1 %W %x %y
    }
    tixBind TixTList <Control-ButtonPress-1> {
	tixTList:Control-Button-1 %W %x %y
    }
    tixBind TixTList <ButtonRelease-1> {
	tixTList:ButtonRelease-1 %W %x %y
    }
    tixBind TixTList <Double-ButtonPress-1> {
	tixTList:Double-1 %W  %x %y
    }
    tixBind TixTList <B1-Motion> {
	set tkPriv(x) %x 
	set tkPriv(y) %y
	set tkPriv(X) %X
	set tkPriv(Y) %Y

	tixTList:B1-Motion %W %x %y
    }
    tixBind TixTList <Control-B1-Motion> {
	set tkPriv(x) %x 
	set tkPriv(y) %y
	set tkPriv(X) %X
	set tkPriv(Y) %Y

	tixTList:Control-B1-Motion %W %x %y
    }
    tixBind TixTList <B1-Leave> {
	set tkPriv(x) %x 
	set tkPriv(y) %y
	set tkPriv(X) %X
	set tkPriv(Y) %Y

	tixTList:B1-Leave %W
    }
    tixBind TixTList <B1-Enter> {
	tixTList:B1-Enter %W %x %y
    }
    tixBind TixTList <Control-B1-Leave> {
	set tkPriv(x) %x 
	set tkPriv(y) %y
	set tkPriv(X) %X
	set tkPriv(Y) %Y

	tixTList:Control-B1-Leave %W
    }
    tixBind TixTList <Control-B1-Enter> {
	tixTList:Control-B1-Enter %W %x %y
    }

    # Keyboard bindings
    #
    tixBind TixTList <Up> {
	tixTList:DirKey %W up
    }
    tixBind TixTList <Down> {
	tixTList:DirKey %W down
    }
    tixBind TixTList <Left> {
	tixTList:DirKey %W left
    }
    tixBind TixTList <Right> {
	tixTList:DirKey %W right
    }
    tixBind TixTList <Prior> {
	%W yview scroll -1 pages
    }
    tixBind TixTList <Next> {
	%W yview scroll 1 pages
    }
    tixBind TixTList <Return> {
	tixTList:Return %W 
    }
    tixBind TixTList <space> {
	tixTList:Space %W 
    }
}

#----------------------------------------------------------------------
#
#
#			 Mouse bindings
#
#
#----------------------------------------------------------------------

proc tixTList:Button-1 {w x y} {
    if {[$w cget -state] == "disabled"} {
	return
    }
    if [$w cget -takefocus] {
	focus $w
    }
    case [tixTList:GetState $w] {
	{s0} {
	    tixTList:GoState s1 $w $x $y
       	}
	{b0} {
	    tixTList:GoState b1 $w $x $y
       	}
	{m0} {
	    tixTList:GoState m1 $w $x $y
       	}
	{e0} {
	    tixTList:GoState e1 $w $x $y
       	}
    }
}

proc tixTList:Shift-Button-1 {w x y} {
    if {[$w cget -state] == "disabled"} {
	return
    }
    if [$w cget -takefocus] {
	focus $w
    }
    case [tixTList:GetState $w] {
	{s0} {
	    tixTList:GoState s1 $w $x $y
       	}
	{b0} {
	    tixTList:GoState b1 $w $x $y
       	}
	{m0} {
	    tixTList:GoState m7 $w $x $y
       	}
	{e0} {
	    tixTList:GoState e7 $w $x $y
       	}
    }
}

proc tixTList:Control-Button-1 {w x y} {
    if {[$w cget -state] == "disabled"} {
	return
    }
    if [$w cget -takefocus] {
	focus $w
    }
    case [tixTList:GetState $w] {
	{s0} {
	    tixTList:GoState s1 $w $x $y
       	}
	{b0} {
	    tixTList:GoState b1 $w $x $y
       	}
	{m0} {
	    tixTList:GoState m1 $w $x $y
       	}
	{e0} {
	    tixTList:GoState e10 $w $x $y
       	}
    }
}

proc tixTList:ButtonRelease-1 {w x y} {
    case [tixTList:GetState $w] {
	{s2 s4 s5 s6} {
	    tixTList:GoState s3 $w
	}
	{b2 b4 b5 b6} {
	    tixTList:GoState b3 $w
	}
	{m2} {
	    tixTList:GoState m3 $w
	}
	{m5} {
	    tixTList:GoState m6 $w $x $y
	}
	{m9} {
	    tixTList:GoState m0 $w
	}
	{e2} {
	    tixTList:GoState e3 $w
	}
	{e5} {
	    tixTList:GoState e6 $w $x $y
	}
	{e9} {
	    tixTList:GoState e0 $w
	}
    }
}

proc tixTList:B1-Motion {w x y} {
    case [tixTList:GetState $w] {
	{s2 s4} {
	    tixTList:GoState s4 $w $x $y 
	}
	{b2 b4} {
	    tixTList:GoState b4 $w $x $y 
	}
	{m2 m5} {
	    tixTList:GoState m4 $w $x $y 
	}
	{e2 e5} {
	    tixTList:GoState e4 $w $x $y 
	}
    }
}

proc tixTList:Control-B1-Motion {w x y} {
    case [tixTList:GetState $w] {
	{s2 s4} {
	    tixTList:GoState s4 $w $x $y 
	}
	{b2 b4} {
	    tixTList:GoState b4 $w $x $y 
	}
	{m2 m5} {
	    tixTList:GoState m4 $w $x $y 
	}
    }
}

proc tixTList:Double-1 {w x y} {
    case [tixTList:GetState $w] {
	{s0} {
	    tixTList:GoState s7 $w $x $y
	}
	{b0} {
	    tixTList:GoState b7 $w $x $y
	}
    }
}

proc tixTList:B1-Leave {w} {
    case [tixTList:GetState $w] {
	{s2 s4} {
	    tixTList:GoState s5 $w
	}
	{b2 b4} {
	    tixTList:GoState b5 $w
	}
	{m2 m5} {
	    tixTList:GoState m8 $w
	}
	{e2 e5} {
	    tixTList:GoState e8 $w
	}
    }
}

proc tixTList:B1-Enter {w x y} {
    case [tixTList:GetState $w] {
	{s5 s6} {
	    tixTList:GoState s4 $w $x $y
	}
	{b5 b6} {
	    tixTList:GoState b4 $w $x $y
	}
	{m8 m9} {
	    tixTList:GoState m4 $w $x $y
	}
	{e8 e9} {
	    tixTList:GoState e4 $w $x $y
	}
    }
}

proc tixTList:Control-B1-Leave {w} {
    case [tixTList:GetState $w] {
	{s2 s4} {
	    tixTList:GoState s5 $w
	}
	{b2 b4} {
	    tixTList:GoState b5 $w
	}
	{m2 m5} {
	    tixTList:GoState m8 $w
	}
    }
}

proc tixTList:Control-B1-Enter {w x y} {
    case [tixTList:GetState $w] {
	{s5 s6} {
	    tixTList:GoState s4 $w $x $y
	}
	{b5 b6} {
	    tixTList:GoState b4 $w $x $y
	}
	{m8 m9} {
	    tixTList:GoState m4 $w $x $y
	}
    }
}

proc tixTList:AutoScan {w} {
    case [tixTList:GetState $w] {
	{s5 s6} {
	    tixTList:GoState s6 $w
	}
	{b5 b6} {
	    tixTList:GoState b6 $w
	}
	{m8 m9} {
	    tixTList:GoState m9 $w
	}
	{e8 e9} {
	    tixTList:GoState e9 $w
	}
    }
}

#----------------------------------------------------------------------
#
#
#			 Key bindings
#
#
#----------------------------------------------------------------------
proc tixTList:DirKey {w key} {
    if {[$w cget -state] == "disabled"} {
	return
    }
    case [tixTList:GetState $w] {
	{s0} {
	    tixTList:GoState s8 $w $key
       	}
	{b0} {
	    tixTList:GoState b8 $w $key
       	}
    }
}

proc tixTList:Return {w} {
    if {[$w cget -state] == "disabled"} {
	return
    }
    case [tixTList:GetState $w] {
	{s0} {
	    tixTList:GoState s9 $w
       	}
	{b0} {
	    tixTList:GoState b9 $w
       	}
    }
}

proc tixTList:Space {w} {
    if {[$w cget -state] == "disabled"} {
	return
    }
    case [tixTList:GetState $w] {
	{s0} {
	    tixTList:GoState s10 $w
       	}
 	{b0} {
	    tixTList:GoState b10 $w
       	}
   }
}

#----------------------------------------------------------------------
#
#			STATE MANIPULATION
#
#
#----------------------------------------------------------------------
proc tixTList:GetState {w} {
    global $w:priv:state

    if {![info exists $w:priv:state]} {
	case [$w cget -selectmode] {
	    single {
		set $w:priv:state s0
	    }
	    browse {
		set $w:priv:state b0
	    }
	    multiple {
		set $w:priv:state m0
	    }
	    extended {
		set $w:priv:state e0
	    }
	    default {
		set $w:priv:state unknown
	    }
	}
    }
    return [set $w:priv:state]
}

proc tixTList:SetState {w n} {
    global $w:priv:state

    set $w:priv:state $n
}

proc tixTList:GoState {n w args} {

#   puts "going from [tixTList:GetState $w] --> $n"

    tixTList:SetState $w $n
    eval tixTList:GoState-$n $w $args
}

#----------------------------------------------------------------------
#			States
#----------------------------------------------------------------------

#----------------------------------------------------------------------
#	SINGLE SELECTION
#----------------------------------------------------------------------
proc tixTList:GoState-s0 {w} {
}

proc tixTList:GoState-s1 {w x y} {
    set ent [$w nearest $x $y]
    if {$ent != ""} {
	$w anchor set $ent
    }
    tixTList:GoState s2 $w
}

proc tixTList:GoState-s2 {w} {
}

proc tixTList:GoState-s3 {w} {
    set ent [$w info anchor]
    if {$ent != ""} {
	$w selection clear
	$w selection set $ent
	tixTList:CallBrowseCmd $w $ent
    }
    tixTList:GoState s0 $w
}

proc tixTList:GoState-s4 {w x y} {
    set ent [$w nearest $x $y]
    if {$ent != ""} {
	$w anchor set $ent
    }
}

proc tixTList:GoState-s5 {w} {
    tixTList:StartScan $w
}

proc tixTList:GoState-s6 {w} {
    global tkPriv

    tixTList:DoScan $w
}

proc tixTList:GoState-s7 {w x y} {
    set ent [$w nearest $x $y]

    if {$ent != ""} {
	$w selection clear
	$w selection set $ent
	tixTList:CallCommand $w $ent
    }
    tixTList:GoState s0 $w
}

proc tixTList:GoState-s8 {w key} {
    set anchor [$w info anchor]

    if {$anchor == ""} {
	set anchor 0
    } else {
	set anchor [$w info $key $anchor]
    }

    $w anchor set $anchor
    $w see $anchor
    tixTList:GoState s0 $w
}

proc tixTList:GoState-s9 {w} {
    set anchor [$w info anchor]

    if {$anchor == ""} {
	set anchor 0
	$w anchor set $anchor
	$w see $anchor
    }

    if {[$w info anchor] != ""} {
	# ! may not have any elements
	#
	tixTList:CallCommand $w [$w info anchor]
	$w selection clear 
	$w selection set $anchor
    }

    tixTList:GoState s0 $w
}

proc tixTList:GoState-s10 {w} {
    set anchor [$w info anchor]

    if {$anchor == ""} {
	set anchor 0
	$w anchor set $anchor
	$w see $anchor
    }

    if {[$w info anchor] != ""} {
	# ! may not have any elements
	#
	tixTList:CallBrowseCmd $w [$w info anchor]
	$w selection clear 
	$w selection set $anchor
    }

    tixTList:GoState s0 $w
}

#----------------------------------------------------------------------
#	BROWSE SELECTION
#----------------------------------------------------------------------
proc tixTList:GoState-b0 {w} {
}

proc tixTList:GoState-b1 {w x y} {
    set ent [$w nearest $x $y]
    if {$ent != ""} {
	$w anchor set $ent
	$w selection clear
	$w selection set $ent
	tixTList:CallBrowseCmd $w $ent
    }
    tixTList:GoState b2 $w
}

proc tixTList:GoState-b2 {w} {
}

proc tixTList:GoState-b3 {w} {
    set ent [$w info anchor]
    if {$ent != ""} {
	$w selection clear
	$w selection set $ent
	tixTList:CallBrowseCmd $w $ent
    }
    tixTList:GoState b0 $w
}

proc tixTList:GoState-b4 {w x y} {
    set ent [$w nearest $x $y]
    if {$ent != ""} {
	$w anchor set $ent
	$w selection clear
	$w selection set $ent
	tixTList:CallBrowseCmd $w $ent
    }
}

proc tixTList:GoState-b5 {w} {
    tixTList:StartScan $w
}

proc tixTList:GoState-b6 {w} {
    global tkPriv

    tixTList:DoScan $w
}

proc tixTList:GoState-b7 {w x y} {
    set ent [$w nearest $x $y]

    if {$ent != ""} {
	$w selection clear
	$w selection set $ent
	tixTList:CallCommand $w $ent
    }
    tixTList:GoState b0 $w
}

proc tixTList:GoState-b8 {w key} {
    set anchor [$w info anchor]

    if {$anchor == ""} {
	set anchor 0
    } else {
	set anchor [$w info $key $anchor]
    }

    $w anchor set $anchor
    $w selection clear
    $w selection set $anchor
    $w see $anchor

    tixTList:CallBrowseCmd $w $anchor
    tixTList:GoState b0 $w
}

proc tixTList:GoState-b9 {w} {
    set anchor [$w info anchor]

    if {$anchor == ""} {
	set anchor 0
	$w anchor set $anchor
	$w see $anchor
    }

    if {[$w info anchor] != ""} {
	# ! may not have any elements
	#
	tixTList:CallCommand $w [$w info anchor]
	$w selection clear 
	$w selection set $anchor
    }

    tixTList:GoState b0 $w
}

proc tixTList:GoState-b10 {w} {
    set anchor [$w info anchor]

    if {$anchor == ""} {
	set anchor 0
	$w anchor set $anchor
	$w see $anchor
    }

    if {[$w info anchor] != ""} {
	# ! may not have any elements
	#
	tixTList:CallBrowseCmd $w [$w info anchor]
	$w selection clear 
	$w selection set $anchor
    }

    tixTList:GoState b0 $w
}

#----------------------------------------------------------------------
#	MULTIPLE SELECTION
#----------------------------------------------------------------------
proc tixTList:GoState-m0 {w} {
}

proc tixTList:GoState-m1 {w x y} {
    set ent [$w nearest $x $y]
    if {$ent != ""} {
	$w anchor set $ent
	$w selection clear
	$w selection set $ent
	tixTList:CallBrowseCmd $w $ent
    }
    tixTList:GoState m2 $w
}

proc tixTList:GoState-m2 {w} {
}

proc tixTList:GoState-m3 {w} {
    set ent [$w info anchor]
    if {$ent != ""} {
	tixTList:CallBrowseCmd $w $ent
    }
    tixTList:GoState m0 $w
}

proc tixTList:GoState-m4 {w x y} {
    set from [$w info anchor]
    set to   [$w nearest $x $y]
    if {$to != ""} {
	$w selection clear
	$w selection set $from $to
	tixTList:CallBrowseCmd $w $to
    }
    tixTList:GoState m5 $w
}

proc tixTList:GoState-m5 {w} {
}

proc tixTList:GoState-m6 {w x y} {
    set ent [$w nearest $x $y]
    if {$ent != ""} {
	tixTList:CallBrowseCmd $w $ent
    }
    tixTList:GoState m0 $w  
}

proc tixTList:GoState-m7 {w x y} {
    set from [$w info anchor]
    set to   [$w nearest $x $y]
    if {$from == ""} {
	set from $to
	$w anchor set $from
    }
    if {$to != ""} {
	$w selection clear
	$w selection set $from $to
	tixTList:CallBrowseCmd $w $to
    }
    tixTList:GoState m5 $w
}


proc tixTList:GoState-m8 {w} {
    tixTList:StartScan $w
}

proc tixTList:GoState-m9 {w} {
    tixTList:DoScan $w
}

proc tixTList:GoState-xm7 {w x y} {
    set ent [$w nearest $x $y]

    if {$ent != ""} {
	$w selection clear
	$w selection set $ent
	tixTList:CallCommand $w $ent
    }
    tixTList:GoState m0 $w
}

#----------------------------------------------------------------------
#	EXTENDED SELECTION
#----------------------------------------------------------------------
proc tixTList:GoState-e0 {w} {
}

proc tixTList:GoState-e1 {w x y} {
    set ent [$w nearest $x $y]
    if {$ent != ""} {
	$w anchor set $ent
	$w selection clear
	$w selection set $ent
	tixTList:CallBrowseCmd $w $ent
    }
    tixTList:GoState e2 $w
}

proc tixTList:GoState-e2 {w} {
}

proc tixTList:GoState-e3 {w} {
    set ent [$w info anchor]
    if {$ent != ""} {
	tixTList:CallBrowseCmd $w $ent
    }
    tixTList:GoState e0 $w
}

proc tixTList:GoState-e4 {w x y} {
    set from [$w info anchor]
    set to   [$w nearest $x $y]
    if {$to != ""} {
	$w selection clear
	$w selection set $from $to
	tixTList:CallBrowseCmd $w $to
    }
    tixTList:GoState e5 $w
}

proc tixTList:GoState-e5 {w} {
}

proc tixTList:GoState-e6 {w x y} {
    set ent [$w nearest $x $y]
    if {$ent != ""} {
	tixTList:CallBrowseCmd $w $ent
    }
    tixTList:GoState e0 $w  
}

proc tixTList:GoState-e7 {w x y} {
    set from [$w info anchor]
    set to   [$w nearest $x $y]
    if {$from == ""} {
	set from $to
	$w anchor set $from
    }
    if {$to != ""} {
	$w selection clear
	$w selection set $from $to
	tixTList:CallBrowseCmd $w $to
    }
    tixTList:GoState e5 $w
}


proc tixTList:GoState-e8 {w} {
    tixTList:StartScan $w
}

proc tixTList:GoState-e9 {w} {
    tixTList:DoScan $w
}

proc tixTList:GoState-e10 {w x y} {
    set ent [$w nearest $x $y]
    if {$ent != ""} {
	if {[$w info anchor] == ""} {
	    $w anchor set $ent
	}
	if [$w selection includes $ent] {
	    $w selection clear $ent
	} else {
	    $w selection set $ent
	}
	tixTList:CallBrowseCmd $w $ent
    }
    tixTList:GoState e2 $w
}

proc tixTList:GoState-xm7 {w x y} {
    set ent [$w nearest $x $y]

    if {$ent != ""} {
	$w selection clear
	$w selection set $ent
	tixTList:CallCommand $w $ent
    }
    tixTList:GoState e0 $w
}

#----------------------------------------------------------------------
#	HODGE PODGE
#----------------------------------------------------------------------

proc tixTList:GoState-12 {w x y} {
    tkCancelRepeat
    tixTList:GoState 5 $w $x $y 
}

proc tixTList:GoState-13 {w ent oldEnt} {
    global tkPriv
    set tkPriv(tix,indicator) $ent
    set tkPriv(tix,oldEnt)    $oldEnt
    tixTList:IndicatorCmd $w <Arm> $ent
}

proc tixTList:GoState-14 {w x y} {
    global tkPriv

    if [tixTList:InsideArmedIndicator $w $x $y] {
	$w anchor set $tkPriv(tix,indicator)
	$w select clear
	$w select set $tkPriv(tix,indicator)
	tixTList:IndicatorCmd $w <Activate> $tkPriv(tix,indicator)
    } else {
	tixTList:IndicatorCmd $w <Disarm>   $tkPriv(tix,indicator)
    }

    unset tkPriv(tix,indicator)
    tixTList:GoState 0 $w
}

proc tixTList:GoState-16 {w ent} {
    if {$ent == ""} {
	return
    }
    if {[$w cget -selectmode] != "single"} {
	tixTList:Select $w $ent
	tixTList:Browse $w $ent
    }
}

proc tixTList:GoState-18 {w} {
    global tkPriv
    tkCancelRepeat
    tixTList:GoState 6 $w $tkPriv(x) $tkPriv(y) 
}

proc tixTList:GoState-20 {w x y} {
    global tkPriv

    if {![tixTList:InsideArmedIndicator $w $x $y]} {
	tixTList:GoState 21 $w $x $y
    } else {
	tixTList:IndicatorCmd $w <Arm> $tkPriv(tix,indicator)
    }
}

proc tixTList:GoState-21 {w x y} {
    global tkPriv

    if {[tixTList:InsideArmedIndicator $w $x $y]} {
	tixTList:GoState 20 $w $x $y
    } else {
	tixTList:IndicatorCmd $w <Disarm> $tkPriv(tix,indicator)
    }
}

proc tixTList:GoState-22 {w} {
    global tkPriv

    if {$tkPriv(tix,oldEnt) != ""} {
	$w anchor set $tkPriv(tix,oldEnt)
    } else {
	$w anchor clear
    }
    tixTList:GoState 0 $w
}


#----------------------------------------------------------------------
#			callback actions
#----------------------------------------------------------------------
proc tixTList:SetAnchor {w x y} {
    set ent [$w nearest $x $y]
    if {$ent != "" && [$w entrycget $ent -state] != "disabled"} {
	$w anchor set $ent
	$w see $ent
	return $ent
    }

    return ""
}

proc tixTList:Select {w ent} {
    $w selection clear
    $w select set $ent
}

proc tixTList:StartScan {w} {
    global tkPriv
    set tkPriv(afterId) [after 50 tixTList:AutoScan $w]
}

proc tixTList:DoScan {w} {
    global tkPriv
    set x $tkPriv(x)
    set y $tkPriv(y)
    set X $tkPriv(X)
    set Y $tkPriv(Y)

    set out 0
    if {$y >= [winfo height $w]} {
	$w yview scroll 1 units
	set out 1
    }
    if {$y < 0} {
	$w yview scroll -1 units
	set out 1
    }
    if {$x >= [winfo width $w]} {
	$w xview scroll 2 units
	set out 1
    } 
    if {$x < 0} {
	$w xview scroll -2 units
	set out 1
    }

    if {$out} {
	set tkPriv(afterId) [after 50 tixTList:AutoScan $w]
    }
}

proc tixTList:CallBrowseCmd {w ent} {
    set browsecmd [$w cget -browsecmd]
    if {$browsecmd != ""} {
	set bind(specs) {%V}
	set bind(%V)    $ent

	tixEvalCmdBinding $w $browsecmd bind $ent
    }
}

proc tixTList:CallCommand {w ent} {
    set command [$w cget -command]
    if {$command != ""} {
	set bind(specs) {%V}
	set bind(%V)    $ent

	tixEvalCmdBinding $w $command bind $ent
    }
}

 # Tix.tcl --
#
#	This file implements the Tix application context class
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

if 0 {
proc tix {} {
    # dummy proc. make sure the entry "tix" is in the tclIndex file
    #
}
}

tixClass tixAppContext {
    -superclass {}
    -classname  TixAppContext
    -method {
	cget configure addbitmapdir filedialog getbitmap getimage
	option platform resetoptions setbitmap
    }
    -flag {
	-binding -debug -extracmdargs -filedialog -fontset -grabmode
	-haspixmap -libdir -scheme -schemepriority -percentsubst
    }
    -readonly {
	-haspixmap
    }
    -configspec {
	{-binding    		TK}
	{-debug      		false}
	{-extracmdargs 		1}
	{-filedialog    	""}
	{-fontset    		TK}
	{-grabmode 		global}
	{-haspixmap 		0}
	{-libdir     		""}
	{-percentsubst		0}
	{-scheme     		TK}
	{-schemepriority     	21}
    }
    -alias {
    }
}

proc tixAppContext:Constructor {w} {
    upvar #0 $w data
    global tix_priv env argv0 tixPriv
    global tix_library tixOption tcl_platform

    if {[info exists tcl_platform] && $tcl_platform(platform) == "windows"} {
	regsub -all "/" $tix_library \\ tix_library
    }

    if [info exists data(initialized)] {
	error "tixAppContext has already be initialized"
    } else {
	set data(initialized) 1
    }

    if [tixStrEq $tix_library ""] {
	set data(et) 1
    } else {
	set data(et) 0
    }

    set data(isStartUp) 1
    # Thses options were set when tixwish started up
    #
    set data(-binding)		$tix_priv(-binding)
    set data(-debug)		$tix_priv(-debug)
    set data(-fontset)		$tix_priv(-fontset)
    set data(-scheme)		$tix_priv(-scheme)
    set data(-schemepriority)	$tix_priv(-schemepriority)

    if ![info exists tix_priv(isSafe)] {
	set data(-libdir)	[tixFSAbsPath $tix_library]
    }
    set tixOption(prioLevel) $tix_priv(-schemepriority)

    # Enable/Disable Intrinsics debugging
    #
    if {$data(-debug)} {
	set tix_priv(debug) 1
    } else {
	set tix_priv(debug) 0
    }

    if ![info exists tix_priv(isSafe)] {
	tixAppContext:config-fontset $w $data(-fontset)
	tixAppContext:config-scheme  $w $data(-scheme)
    }

    tixAppContext:BitmapInit $w
    tixAppContext:FileDialogInit $w

    # Force the "." window to accept the new Tix options
    #
    foreach spec [. configure] {
	if {[llength $spec] > 2} {
	    set flag  [lindex $spec 0]
	    set name  [lindex $spec 1]
	    set class [lindex $spec 2]
	    set value [option get . $name $class]
	    catch {. config $flag $value}
	}
    }
    # Clean up any error message generated by the above loop
    catch {uplevel #0 set errorInfo \"\"}

    set data(isStartUp) 0

    # Hack: if env(TIX_DEBUG_INTERACTIVE) is set, then
    # an interactive prompt is always printed
    #
    if {[info exists env(TIX_DEBUG_INTERACTIVE)] &&
	![info exists tix_priv(slaveInterp)]} {

	# For widget programming, it is more convient to have the error
	# message printed on the terminal. For some extensive usage of
	# bindings, suce as in the case of tixBalloon, the default
	# therror just doesn't work.
	#
	proc tkerror {err} {
	    global errorInfo
	    puts $err
	    puts $errorInfo
	}
    }

    #
    # Hack
    #
    if [info exists env(TIX_DEBUG_GEOMETRY)] {
	global tcl_interactive
	if {$tcl_interactive == 0} {
	    wm geometry . $env(TIX_DEBUG_GEOMETRY)
	}
    }
}

#----------------------------------------------------------------------
#  Configurations
#
#----------------------------------------------------------------------
proc tixAppContext:resetoptions {w scheme fontset {schemePrio ""}} {
    upvar #0 $w data

    if {! $data(et)} {
	global tixOption
	option clear

	if {$schemePrio != ""} {
	    set tixOption(prioLevel) $schemePrio
	}
	tixAppContext:config-scheme  $w $scheme
	tixAppContext:config-fontset $w $fontset
    }
}

proc tixAppContext:config-fontset {w value} {
    upvar #0 $w data
    global tix_priv tixOption

    set data(-fontset) $value

    #-----------------------------------
    # Initialization of options database
    #-----------------------------------
    # Load the fontset
    #
    if {!$data(et)} {
        set prefDir [tixFileJoin $data(-libdir) pref]
        set fontSetFile [tixFileJoin $prefDir $data(-fontset).fsc]
	if [file exists $fontSetFile] {
	    source $fontSetFile
	    tixPref:InitFontSet:$data(-fontset)
	    tixAppContext:CheckFontSets $w
	    tixPref:SetFontSet:$data(-fontset)
	} else {
	    tixAppContext:StartupError  		"\aError: cannot use fontset \"$data(-fontset)\""
	    tixAppContext:StartupError  		"       Using default fontset "
	    tixSetDefaultFontset
	    tixAppContext:CheckFontSets $w
	}
    } else {
	if [catch {
	    tixPref:InitFontSet:$data(-fontset)
	    tixAppContext:CheckFontSets $w
	    tixPref:SetFontSet:$data(-fontset)
	}] {
	    # User chose non-existent fontset
	    #
	    tixAppContext:StartupError  		"\aError: cannot use fontset \"$data(-fontset)\""
	    tixAppContext:StartupError  		"       Using default fontset "
	    tixSetDefaultFontset
	    tixAppContext:CheckFontSets $w
	}
    }

    # Compatibility stuff: the obsolete name courier_font has been changed to
    # fixed_font
    set tixOption(courier_font) $tixOption(fixed_font)
}

proc tixAppContext:config-scheme {w value} {
    upvar #0 $w data
    global tix_priv

    set data(-scheme) $value

    # Load the color scheme
    #
    if {!$data(et)} {
	set schemeName [tixFileJoin [tixFileJoin $data(-libdir) pref]  	    $data(-scheme).csc]
	if [file exists $schemeName] {
	    source $schemeName
	    if {[winfo depth .] >= 8} {
		tixPref:SetScheme-Color:$data(-scheme)
	    } else {
		tixPref:SetScheme-Mono:$data(-scheme)
	    }
	} else {
	    tixAppContext:StartupError  		"\aError: cannot use color scheme \"$data(-scheme)\""
	    tixAppContext:StartupError  		"       Using default color scheme"
	    if {[winfo depth .] >= 8} {
		tixSetDefaultScheme-Color
	    } else {
		tixSetDefaultScheme-Mono
	    }
	}
    } else {
	if [catch {
	    if {[winfo depth .] >= 8} {
		tixPref:SetScheme-Color:$data(-scheme)
	    } else {
		tixPref:SetScheme-Mono:$data(-scheme)
	    }
	}] {
	    # User chose non-existent color scheme
	    #
	    tixAppContext:StartupError  		"\aError: cannot use color scheme \"$data(-scheme)\""
	    tixAppContext:StartupError  		"       Using default color scheme"
	    if {[winfo depth .] >= 8} {
		tixSetDefaultScheme-Color
	    } else {
		tixSetDefaultScheme-Mono
	    }
	}
    }
}

#----------------------------------------------------------------------
#  Private methods
#
#----------------------------------------------------------------------
proc tixAppContext:BitmapInit {w} {
    upvar #0 $w data

    # See whether we have pixmap extension
    #
    set data(-haspixmap) true

    # Dynamically set the bitmap directory
    #
    if {! $data(et)} {
	set data(bitmapdirs) [list [tixFileJoin $data(-libdir) bitmaps]]
    } else {
	set data(bitmapdirs) ""
    }
}

proc tixAppContext:FileDialogInit {w} {
    upvar #0 $w data

    if {$data(-filedialog) == ""} {
	set data(-filedialog) [option get . fileDialog FileDialog]
    }
    if {$data(-filedialog) == ""} {
	set data(-filedialog) tixFileSelectDialog
    }
}

#----------------------------------------------------------------------
# If a font in the fontset is not available, use a default fontset.
#
proc tixAppContext:CheckFontSets  {w} {
    upvar #0 $w data
    global tixOption tcl_platform tcl_version

    if {$tcl_version >= "8.0" && $tcl_platform(platform) == "windows"} {
	# fonts will never fail ..
	return
    }

    set default_font "fixed"
    set options {font bold_font menu_font italic_font fixed_font}

    if [winfo exists .tix-xxx-test] {
	destroy .tix-xxx-test
    }
    set lab [label .tix-xxx-test]
    foreach opt $options {
	if [catch {$lab config -font $tixOption($opt)}] {
	    tixAppContext:StartupError  		"\aError: cannot use font \"$tixOption($opt)\" as \"$opt\""
	    puts  stderr  		"       using \"$default_font\" instead"

	    set tixOption($opt) $default_font
	}
    }
    destroy $lab
}

#----------------------------------------------------------------------
# 	Public methods
#----------------------------------------------------------------------
proc tixAppContext:addbitmapdir {w bmpdir} {
    upvar #0 $w data

    if {[lsearch $data(bitmapdirs) $bmpdir] == "-1"} {
	lappend data(bitmapdirs) $bmpdir 
    }
}

proc tixAppContext:getimage {w name} {
    upvar #0 $w data
    global tixPriv tix_priv

    if {[info exists data(img:$name)]} {
	return $data(img:$name)
    }

    if ![info exists tix_priv(isSafe)] {
	foreach dir $data(bitmapdirs) {
	    if [file exists [tixFileJoin $dir $name.xpm]] {
		if {![catch {
		    set data(img:$name)  			[image create pixmap -file [tixFileJoin $dir $name.xpm]]
		}]} {
		    break
		}
	    }
	    if [file exists [tixFileJoin $dir $name.gif]] {
		global TRANSPARENT_GIF_COLOR
		if {![catch {
		    set data(img:$name)  			[image create photo -file [tixFileJoin $dir $name.gif]]
		}]} {
		    break
		}
	    }
	    if [file exists [tixFileJoin $dir $name.ppm]] {
		if {![catch {
		    set data(img:$name)  			[image create photo -file [tixFileJoin $dir $name.ppm]]
		}]} {
		    break
		}
	    }
	    if [file exists [tixFileJoin $dir $name.xbm]] {
		if {![catch {
		    set data(img:$name)  			[image create bitmap -file [tixFileJoin $dir $name.xbm]]
		}]} {
		    break
		}
	    }
	    if [file exists [tixFileJoin $dir $name]] {
		if {![catch {
		    set data(img:$name)  			[image create bitmap -file [tixFileJoin $dir $name]]
		}]} {
		    break
		}
	    }
	}
    }

    if {![info exists data(img:$name)]} {
	catch {
	    # This is for compiled-in images
	    set data(img:$name) [image create pixmap -id $name]
	} err
	if [string match internal* $err] {
	    error $err
	}
    }

    if {[info exists data(img:$name)]} {
	return $data(img:$name)
    } else {
	error "image file \"$name\" cannot be found"
    }
}


proc tixAppContext:getbitmap {w bitmapname} {
    upvar #0 $w data
    global tix_priv

    if {[info exists data(bmp:$bitmapname)]} {
	return $data(bmp:$bitmapname)
    } else {
	set ext [file extension $bitmapname]
	if {$ext == ""} {
	    set ext .xbm
	}

	# This is the fallback value. If we can't find the bitmap in
	# the bitmap directories, then use the name of the bitmap
	# as the default value.
	#
	set data(bmp:$bitmapname) $bitmapname

	if [info exists tix_priv(isSafe)] {
	    return $data(bmp:$bitmapname)
	}

	foreach dir $data(bitmapdirs) {
	    case $ext {
		.xbm {
		    if [file exists [tixFileJoin $dir $bitmapname.xbm]] {
			set data(bmp:$bitmapname)  			    @[tixFileJoin $dir $bitmapname.xbm]
			break
		    }
		    if [file exists [tixFileJoin $dir $bitmapname]] {
			set data(bmp:$bitmapname) @[tixFileJoin $dir $bitmapname]
			break
		    }
		}
		default {
		    if [file exists [tixFileJoin $dir $bitmapname]] {
			set data(bmp:$bitmapname) @[tixFileJoin $dir $bitmapname]
			break
		    }
		}
	    }
	}

	return $data(bmp:$bitmapname)
    }
}

proc tixAppContext:filedialog {w {type tixFileSelectDialog}} {
    upvar #0 $w data

    if {$type == ""} {
	set type $data(-filedialog)
    }
    if {![info exists data(filedialog,$type)]} {
	set data(filedialog,$type) ""
    }

    if {$data(filedialog,$type) == "" || ![winfo exists $data(filedialog,$type)]} {
	set data(filedialog,$type) [$type .tixapp_filedialog_$type]
    }

    return $data(filedialog,$type)
}

proc tixAppContext:option {w action option {value ""}} {
    upvar #0 $w data
    global tixOption

    if {$action == "get"} {
	return $tixOption($option)
    }
}

proc tixAppContext:platform {w} {
    upvar #0 $w data
    global tixPriv

    if [info exists tixPriv(isWindows)] {
	return windows
    } else {
	return unix
    }
}

proc tixAppContext:StartupError {msg} {
    catch {
	puts stderr $msg
    }
}

if [tixStrEq [info command toplevel] ""] {
    proc toplevel {args} {
	return eval frame $args
    }
}

 # Tree.tcl --
#
#	This file implements the TixTree widget.
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#


tixWidgetClass tixTree {
    -classname TixTree
    -superclass tixVTree
    -method {
	autosetmode close getmode open setmode
    }
    -flag {
	-browsecmd -command -opencmd -closecmd
    }
    -configspec {
	{-browsecmd browseCmd BrowseCmd ""}
	{-command command Command ""}
	{-closecmd closeCmd CloseCmd ""}
	{-opencmd openCmd OpenCmd ""}
    }
    -default {
	{.scrollbar			auto}
	{*Scrollbar.background          #d9d9d9}
	{*Scrollbar.relief              sunken}
	{*Scrollbar.takeFocus           0}
	{*Scrollbar.troughColor         #c3c3c3}
	{*Scrollbar.width               15}
	{*borderWidth                   1}
	{*hlist.background              #c3c3c3}
	{*hlist.drawBranch              1}
	{*hlist.height                  10}
	{*hlist.highlightBackground      #d9d9d9}
	{*hlist.indicator               1}
	{*hlist.indent                  20}
	{*hlist.itemType                imagetext}
	{*hlist.padX                    3}
	{*hlist.padY                    0}
	{*hlist.relief                  sunken}
	{*hlist.takeFocus               1}
	{*hlist.wideSelection           0}
	{*hlist.width                   20}
    }
}

proc tixTree:InitWidgetRec {w} {
    upvar #0 $w data

    tixChainMethod $w InitWidgetRec
}

proc tixTree:ConstructWidget {w} {
    upvar #0 $w data

    tixChainMethod $w ConstructWidget
}

proc tixTree:SetBindings {w} {
    upvar #0 $w data

    tixChainMethod $w SetBindings
}

#----------------------------------------------------------------------
#
#			Widget commands
#
#----------------------------------------------------------------------
proc tixTree:autosetmode {w} {
    tixTree:SetModes $w ""
}

proc tixTree:close {w ent} {
    upvar #0 $w data

    set type [tixVTree:GetType $w $ent]
    if {$type == "close"} {
	tixCallMethod $w Activate $ent $type
    }
}

proc tixTree:open {w ent} {
    upvar #0 $w data

    set type [tixVTree:GetType $w $ent]
    if {$type == "open"} {
	tixCallMethod $w Activate $ent $type
    }
}

proc tixTree:getmode {w ent} {
    tixVTree:GetType $w $ent
}

proc tixTree:setmode {w ent mode} {
    tixVTree:SetMode $w $ent $mode
}
#----------------------------------------------------------------------
#
#			Private Methods
#
#----------------------------------------------------------------------
proc tixTree:SetModes {w ent} {
    upvar #0 $w data
   
    set mode none

    if {$ent == ""} {
	set children [$data(w:hlist) info children]
    } else {
	set children [$data(w:hlist) info children $ent]
    }
 
    if {$children != ""} {
	set mode close

	foreach c $children {
	    if [$data(w:hlist) info hidden $c] {
		set mode open
	    }
	    tixTree:SetModes $w $c
	}
    }
    
    if {$ent != ""} {
	tixVTree:SetMode $w $ent $mode
    }
}
#----------------------------------------------------------------------
#
#			Virtual Methods
#
#----------------------------------------------------------------------
proc tixTree:OpenCmd {w ent} {
    upvar #0 $w data

    if {$data(-opencmd) != ""} {
	tixTree:CallSwitchCmd $w $data(-opencmd) $ent
    } else {
	tixChainMethod $w OpenCmd $ent

    }
}

proc tixTree:CloseCmd {w ent} {
    upvar #0 $w data

    if {$data(-closecmd) != ""} {
	tixTree:CallSwitchCmd $w $data(-closecmd) $ent
    } else {
	tixChainMethod $w CloseCmd $ent
    }
}

# Call the opencmd or closecmd, depending on the mode ($cmd argument)
#
proc tixTree:CallSwitchCmd {w cmd ent} {
    upvar #0 $w data

    set bind(specs) {%V}
    set bind(%V)    $ent

    tixEvalCmdBinding $w $cmd bind $ent
}

proc tixTree:Command {w B} {
    upvar #0 $w data
    upvar $B bind

    tixChainMethod $w Command $B

    set ent [tixEvent flag V]
    if {$data(-command) != ""} {
	tixEvalCmdBinding $w $data(-command) bind $ent
    }
}

proc tixTree:BrowseCmd {w B} {
    upvar #0 $w data

    set ent [tixEvent flag V]
    if {$data(-browsecmd) != ""} {
	tixEvalCmdBinding $w $data(-browsecmd) "" $ent
    }
}

 # UnixFile.tcl --
#
#	Unix file access portibility routines.
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

proc tixInitFileCmpt:Unix {} {

# tixFSSplit --
# 
# Splits a directory into its hierarchical components
#
# "hlist-type hierachical path"		<- "vpath"
# "name"
# "directory name"			<- "path"
#
proc tixFSSplit {dir} {
    if [string compare [tixFSPathType $dir] "absolute"] {
	error "$dir must be an absolute path"
    }

    set path ""
    set p ""
    foreach d [tixFileSplit $dir] {
	set p [tixFSJoin $p $d]
	lappend path [list $p $d $p]
    }
    return $path
}

# returns true if $dir is an valid path (always true in Unix)
#
proc tixFSValid {dir} {
    return 1
}

# Directory separator
#
proc tixFSSep {} {
    return "/"
}

# tixFSIntName
#
#	Returns the "virtual path" of a filename
#
proc tixFSIntName {dir} {
    if [string compare [tixFSPathType $dir] "absolute"] {
	error "$dir must be an absolute path"
    }

    return $dir
}

proc tixFSResolveName {p} {
    return $p
}


# These subcommands of "file" only exist in Tcl 7.5+. We define the following
# wrappers so that the code also works under Tcl 7.4
#
global tcl_version
if ![string compare $tcl_version 7.4] {

    proc tixFSPathType {dir} {
	if ![string compare [string index $dir 0] /] {
	    return "absolute"
	}
	if ![string compare [string index $dir 0] ~] {
	    return "absolute"
	}
	return "relative"
    }

    proc tixFSJoin {dir sub} {
	set joined $dir/$sub

	regsub -all {[/]+} $joined / joined
	return $joined
    }

} else {
    proc tixFSPathType {dir} {
	return [file pathtype $dir]
    }

    proc tixFSJoin {dir sub} {
	return [file join $dir $sub]
    }
}

# dir:		Make a listing of this directory
# showSubDir:	Want to list the subdirectories?
# showFile:	Want to list the non-directory files in this directory?
# showPrevDir:	Want to list ".." as well?
# showHidden:	Want to list the hidden files?
#
# return value:	a list of files and/or subdirectories
#
proc tixFSListDir {dir showSubDir showFile showPrevDir showHidden {pattern ""}} {
    set appPWD [pwd]

    if [catch {cd $dir} err] {
	# The user has entered an invalid directory
	# %% todo: prompt error, go back to last succeed directory
	cd $appPWD
	return ""
    }

    if {$pattern == ""} {
	if $showHidden {
	    set pattern "* .*"
	} else {
	    set pattern *
	}
    } elseif {$pattern == "*"} {
	if $showHidden {
	    set pattern "* .*"
	}
    }

    set list ""
    foreach pat $pattern {
	if [catch {set names [lsort [glob -nocomplain $pat]]} err] {
	    # Cannot read directory
	    # %% todo: show directory permission denied
	    continue
	}

	catch {
	    # We are catch'ing, just in case the "file" command
	    # returns unexpected errors
	    #
	    foreach fname $names {
		if {![string compare . $fname]} {
		    continue
		}
		if [file isdirectory $fname] {
		    if {![string compare ".." $fname] && !$showPrevDir} {
			continue
		    }
		    if $showSubDir {
			lappend list [file tail $fname]
		    }
		} else {
		    if $showFile {
			lappend list [file tail $fname]
		    }
		}
	    }
	}
    }

    cd $appPWD

    if {[llength $pattern] > 1} {
	# get rid of duplicated names
	#
	set list1 ""
	set oldfile ""
	foreach name [lsort $list] {
	    if {$name == $oldfile} {
		continue
	    }
	    lappend list1 $name
	    set oldfile $name
	}
	return [_tixFSMakeList $dir $list1]
    } else {
	return [_tixFSMakeList $dir $list]
    }
}

# _tixFSMakeList -
#
#	Internal procedure. Used only by tixFSListDir
proc _tixFSMakeList {dir list} {
    set l ""
    foreach file $list {
	set path [tixFSJoin $dir $file]
	lappend l [list $path $file $path]
    }

    return $l
}

# Directory separator
#
proc tixDirSep {} {
    return "/"
}


# tixFSInfo --
#
#	Returns information about the file system of this OS
#
# hasdrives: Boolean
#	Does this file system support seperate disk drives?
#
proc tixFSInfo {args} {
    case [lindex $args 0] {
	hasdrives {
	    return 0
	}
    }
}

#----------------------------------------------------------------------
# Obsolete
#----------------------------------------------------------------------

# nativeName:	native filename used in this OS, comes from the user or
#		application programmer
# defParent:	if the filename is not an absolute path, treat it as a
#		subfolder of $defParent
proc tixFileIntName {nativeName {defParent ""}} {
    if {![tixIsAbsPath $nativeName]} {
	if {$defParent != ""} {
	    set path [tixSubFolder $defParent $nativeName]
	} else {
	    set path $nativeName
	}
    } else {
	set path $nativeName
    }

    set intName ""
    set path [tixFile trimslash [tixFile tildesubst $path]]
    foreach name [tixFileSplit $path] {
	set intName [tixSubFolder $intName $name]
    }
    return $intName
}

proc tixNativeName {name {mustBeAbs ""}} {
    return $name
}

proc tixFileDisplayName {intName} {
    if {$intName == "/"} {
	return "/"
    } else {
	return [file tail $intName]
    }
}


proc tixFileSplit {intName} {

    set l ""
    foreach n [split $intName /] {
	if {$n == ""} {
	    continue
	}
	if {$n == "."} {
	    continue
	}

	lappend l $n
    }
    

    while 1 {
	set idx [lsearch $l ".."]
	if {$idx == -1} {
	    break;
	}
	set l [lreplace $l [expr $idx -1] $idx]
    }


    if {[string index $intName 0] == "/"} {
	return [concat "/" $l]
    } else {
	return $l
    }
}

proc tixSubFolder {parent sub} {
    if {$parent == ""} {
	return $sub
    }
    if {$parent == "/"} {
	return /$sub
    } else {
	return $parent/$sub
    }
}

# dir:		Make a listing of this directory
# showSubDir:	Want to list the subdirectories?
# showFile:	Want to list the non-directory files in this directory?
# showPrevDir:	Want to list ".." as well?
# showHidden:	Want to list the hidden files?
#
# return value:	a list of files and/or subdirectories
#
proc tixListDir {dir showSubDir showFile showPrevDir showHidden {pattern ""}} { 

    set appPWD [pwd]

    if [catch {cd $dir} err] {
	# The user has entered an invalid directory
	# %% todo: prompt error, go back to last succeed directory
	cd $appPWD
	return ""
    }

    if {$pattern == ""} {
	if $showHidden {
	    set pattern "* .*"
	} else {
	    set pattern *
	}
    } elseif {$pattern == "*"} {
	if $showHidden {
	    set pattern "* .*"
	}
    }

    set list ""
    foreach pat $pattern {
	if [catch {set names [lsort [glob -nocomplain $pat]]} err] {
	    # Cannot read directory
	    # %% todo: show directory permission denied
	    continue
	}

	catch {
	    # We are catch'ing, just in case the "file" command
	    # returns unexpected errors
	    #
	    foreach fname $names {
		if {![string compare . $fname]} {
		    continue
		}
		if [file isdirectory $fname] {
		    if {![string compare ".." $fname] && !$showPrevDir} {
			continue
		    }
		    if $showSubDir {
			lappend list [file tail $fname]
		    }
		} else {
		    if $showFile {
			lappend list [file tail $fname]
		    }
		}
	    }
	}
    }

    cd $appPWD

    if {[llength $pattern] > 1} {
	set list1 ""
	set oldfile ""
	foreach name [lsort $list] {
	    if {$name == $oldfile} {
		continue
	    }
	    lappend list1 $name
	    set oldfile $name
	}
	return $list1
    } else {
	return $list
    }
}

# returns the "root directory" of this operating system
#
proc tixRootDir {} {
    return "/"
}

proc tixIsAbsPath {nativeName} {
    set c [string index $nativeName 0]
    if {$c == "~" || $c == "/"} {
	return 1
    } else {
	return 0
    }
}

proc tixVerifyFile {file} {
    return [tixFileIntName $file]
}

proc tixFilePattern {args} {
    if {[lsearch $args allFiles] != -1} {
	return *
    }
    return *
}
}






 # Util.tcl --
#
#	The Tix utility commands. Some of these commands are
#	replacement of or extensions to the existing TK
#	commands. Occasionaly, you have to use the commands inside
#	this file instead of thestandard TK commands to make your
#	applicatiion work better with Tix. Please read the
#	documentations (programmer's guide, man pages) for information
#	about these utility commands.
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#


#
# kludge: should be able to handle all kinds of flags
#         now only handles "-flag value" pairs.
#
proc tixHandleArgv {p_argv p_options validFlags} {
    upvar $p_options opt
    upvar $p_argv    argv

    set old_argv $argv
    set argv ""

    tixForEach {flag value} $old_argv {
	if {[lsearch $validFlags $flag] != "-1"} {
	    # The caller will handle this option exclusively
	    # It won't be added back to the original arglist
	    #
	    eval $opt($flag,action) $value
	} else {
	    # The caller does not handle this option
	    #
	    lappend argv $flag
	    lappend argv $value
	}
    }
}

#-----------------------------------------------------------------------
# tixDisableAll -
#
# 	Disable all members in a sub widget tree
#
proc tixDisableAll {w} {
    foreach x [tixDescendants $w] {
	catch {$x config -state disabled}
    }
}

#----------------------------------------------------------------------
# tixEnableAll -
#
# 	enable all members in a sub widget tree
#
proc tixEnableAll {w} {
    foreach x [tixDescendants $w] {
	catch {$x config -state normal}
    }
}

#----------------------------------------------------------------------
# tixDescendants -
#
#	Return a list of all the member of a widget subtree, including
# the tree's root widget.
#
proc tixDescendants {parent} {
    set des ""
    lappend des $parent

    foreach w [winfo children $parent] {
	foreach x [tixDescendants $w] {
	    lappend des $x
	}
    }
    return $des
}


#----------------------------------------------------------------------
# tixForEach -
#
#	 Extension of foreach, can handle more than one names
#
#
proc tixForEach {names list body} {
    set len [llength $list]
    set i 0

    while {$i < $len} {
	foreach name $names {
	    uplevel 1 [list set $name [lindex $list $i]]
	    incr i
	}

	if {$i > $len} {
	    error "incorrect number of items in the list \{$list\}"
	}

	uplevel 1 $body
    }
}

#----------------------------------------------------------------------
# tixTopLevel -
#
#	Create a toplevel widget and unmap it immediately. This will ensure
# that this toplevel widgets will not be popped up prematurely when you
# create Tix widgets inside it.
#
#	"tixTopLevel" also provide options for you to specify the appearance
# and behavior of this toplevel.
#
#
#
proc tixTopLevel {w args} {
    set opt (-geometry) ""
    set opt (-minsize)  ""
    set opt (-maxsize)  ""
    set opt (-width)    ""
    set opt (-height)   ""

    eval toplevel $w $args
    wm withdraw $w
}

# This is a big kludge
#
#	Substitutes all [...] and $.. in the string in $args
#
proc tixInt_Expand {args} {
    return $args
}

# Print out all the config options of a widget
#
proc tixPConfig {w} {
    foreach opt [lsort [$w config]] {
	puts $opt
    }
}

proc tixAppendBindTag {w tag} {
    bindtags $w [concat [bindtags $w] $tag]
}

proc tixAddBindTag {w tag} {
    bindtags $w [concat $tag [bindtags $w] ]
}

proc tixSubwidgetRef {sub} {
    global tixSRef

    return $tixSRef($sub)
}

proc tixSubwidgetRetCreate {sub ref} {
    global tixSRef

    set tixSRef($sub) $ref
}

proc tixSubwidgetRetDelete {sub} {
    global tixSRef

    catch {unset tixSRef($sub)}
}

proc tixListboxGetCurrent {listbox} {
    return [tixEvent flag V]
}


# tixSetMegaWidget --
#
#	Associate a subwidget with its mega widget "owner". This is mainly
#	used when we add a new bindtag to a subwidget and we need to find out
#	the name of the mega widget inside the binding.
#
proc tixSetMegaWidget {w mega {type any}} {
    global tixMega

    set tixMega($type,$w) $mega
}

proc tixGetMegaWidget {w {type any}} {
    global tixMega

    return $tixMega($type,$w)
}

proc tixUnsetMegaWidget {w} {
    global tixMega

    if [info exists tixMega($w)] {
	unset tixMega($w)
    }
}

# tixBusy : display busy cursors on a window
#
#
# Should flush the event queue (but not do any idle tasks) before blocking
# the target window (I am not sure if it is aready doing so )
#
# ToDo: should take some additional windows to raise
#
proc tixBusy {w flag {focuswin ""}} {

    if {[info command tixInputOnly] == ""} {
	return
    }

    global tixBusy
    set toplevel [winfo toplevel $w]

    if {![info exists tixBusy(cursor)]} {
	set tixBusy(cursor) watch
#	set tixBusy(cursor) "[tix getbitmap hourglass]  #	    [string range [tix getbitmap hourglass.mask] 1 end] # 	    black white"
    }

    if {$toplevel == "."} {
	set inputonly0 .__tix__busy0
	set inputonly1 .__tix__busy1
	set inputonly2 .__tix__busy2
	set inputonly3 .__tix__busy3
    } else {
	set inputonly0 $toplevel.__tix__busy0
	set inputonly1 $toplevel.__tix__busy1
	set inputonly2 $toplevel.__tix__busy2
	set inputonly3 $toplevel.__tix__busy3
    }

    if {![winfo exists $inputonly0]} {
	for {set i 0} {$i < 4} {incr i} {
	    tixInputOnly [set inputonly$i] -cursor $tixBusy(cursor)
	}
    }

    case $flag {
	on {
	    if {$focuswin != "" && [winfo id $focuswin] != 0} {
		if [info exists tixBusy($focuswin,oldcursor)] {
		    return
		}
		set tixBusy($focuswin,oldcursor) [$focuswin cget -cursor]
		$focuswin config -cursor $tixBusy(cursor)

		set x1 [expr [winfo rootx $focuswin]-[winfo rootx $toplevel]]
		set y1 [expr [winfo rooty $focuswin]-[winfo rooty $toplevel]]

		set W  [winfo width $focuswin]
		set H  [winfo height $focuswin]
		set x2 [expr $x1 + $W]
		set y2 [expr $y1 + $H]


		if {$y1 > 0} {
		    tixMoveResizeWindow $inputonly0 0   0   10000 $y1
		}
		if {$x1 > 0} {
		    tixMoveResizeWindow $inputonly1 0   0   $x1   10000
		}
		tixMoveResizeWindow $inputonly2 0   $y2 10000 10000
		tixMoveResizeWindow $inputonly3 $x2 0   10000 10000

		for {set i 0} {$i < 4} {incr i} {
		    tixMapWindow [set inputonly$i] 
		    tixRaiseWindow [set inputonly$i]
		}
		tixFlushX $w
	    } else {
		tixMoveResizeWindow $inputonly0 0 0 10000 10000
		tixMapWindow $inputonly0
		tixRaiseWindow $inputonly0
	    }
	}
	off {
	    tixUnmapWindow $inputonly0
	    tixUnmapWindow $inputonly1
	    tixUnmapWindow $inputonly2
	    tixUnmapWindow $inputonly3

	    if {$focuswin != "" && [winfo id $focuswin] != 0} {
		if [info exists tixBusy($focuswin,oldcursor)] {
		    $focuswin config -cursor $tixBusy($focuswin,oldcursor)
		    if [info exists tixBusy($focuswin,oldcursor)] {
			unset tixBusy($focuswin,oldcursor)
		    }
		}
	    }
	}
    }
   
}

proc tixOptionName {w} {
    return [string range $w 1 [expr [string length $w]-1]]
}

proc tixSetSilent {chooser value} {
    $chooser config -disablecallback true
    $chooser config -value $value
    $chooser config -disablecallback false
}

proc tixSetChooser {chooser value} {

    puts "obsolete command tixSetChooser, call tixSetSilent instead"

    $chooser config -disablecallback true
    $chooser config -value $value
    $chooser config -disablecallback false
}

# This command is useful if you want to ingore the arguments
# passed by the -command or -browsecmd options of the Tix widgets. E.g
#
# tixFileSelectDialog .c -command "puts foo; tixBreak"
#
#
proc tixBreak {args} {}

#----------------------------------------------------------------------
# tixDestroy -- deletes a Tix class object (not widget classes)
#----------------------------------------------------------------------
proc tixDestroy {w} {
    upvar #0 $w data
	
    set destructor ""
    if [info exists data(className)] {
	catch {
	    set destructor [tixGetMethod $w $data(className) Destructor]
	}
    }
    if {$destructor != ""} {
	$destructor $w
    }
    catch {
	rename $w ""
    }
    catch {
	unset data
    }
    return ""
}

proc tixPushGrab {args} {
    global tix_priv

    if {![info exists tix_priv(grab-list)]} {
	set tix_priv(grab-list)    ""
	set tix_priv(grab-mode)    ""
	set tix_priv(grab-nopush) ""
    }

    case [llength $args] {
	1 {
	    set opt ""
	    set w [lindex $args 0]
	}
	2 {
	    set opt [lindex $args 0]
	    set w [lindex $args 1]
	}
	default {
	    error "wrong #of arguments: tixPushGrab ?-global? window"
	}
    }

    # Not everyone will call tixPushGrab. If someone else has a grab already
    # save that one as well, so that we can restore that later
    #
    set last [lindex $tix_priv(grab-list) end]
    set current [grab current $w]

    if {$current != "" && $current != $last} {
	# Someone called "grab" directly
	#
	lappend tix_priv(grab-list)    $current
	lappend tix_priv(grab-mode)    [grab status $current]
	lappend tix_priv(grab-nopush) 1
    }

    # Now push myself into the stack
    #
    lappend tix_priv(grab-list)    $w
    lappend tix_priv(grab-mode)    $opt
    lappend tix_priv(grab-nopush) 0

    if {$opt == "-global"} {
	grab -global $w
    } else {
	grab $w
    }
}

proc tixPopGrab {} {
    global tix_priv

    if {![info exists tix_priv(grab-list)]} {
	set tix_priv(grab-list)   ""
	set tix_priv(grab-mode)   ""
	set tix_priv(grab-nopush) ""
    }

    set len [llength $tix_priv(grab-list)]
    if {$len <= 0} {
	error "no window is grabbed by tixGrab"
    }

    set w [lindex $tix_priv(grab-list) end]
    grab release $w

    if {$len > 1} {
	set tix_priv(grab-list)    	    [lrange $tix_priv(grab-list) 0 [expr $len-2]]
	set tix_priv(grab-mode)    	    [lrange $tix_priv(grab-mode) 0 [expr $len-2]]
	set tix_priv(grab-nopush)  	    [lrange $tix_priv(grab-nopush) 0 [expr $len-2]]

	set w  [lindex $tix_priv(grab-list) end]
	set m  [lindex $tix_priv(grab-list) end]
	set np [lindex $tix_priv(grab-nopush) end]

	if {$np == 1} {
	    # We have a grab set by "grab"
	    #
	    set len [llength $tix_priv(grab-list)]

	    if {$len > 1} {
		set tix_priv(grab-list)    		    [lrange $tix_priv(grab-list) 0 [expr $len-2]]
		set tix_priv(grab-mode)    		    [lrange $tix_priv(grab-mode) 0 [expr $len-2]]
		set tix_priv(grab-nopush)  		    [lrange $tix_priv(grab-nopush) 0 [expr $len-2]]
	    } else {
		set tix_priv(grab-list)   ""
		set tix_priv(grab-mode)   ""
		set tix_priv(grab-nopush) ""
	    }
	}

	if {$m == "-global"} {
	    grab -global $w
	} else {
	    grab $w
	}
    } else {
  	set tix_priv(grab-list)   ""
	set tix_priv(grab-mode)   ""
	set tix_priv(grab-nopush) ""
    }
}

proc tixWithinWindow {wid rootX rootY} {
    set rx1 [winfo rootx $wid]
    set ry1 [winfo rooty $wid]
    set rw  [winfo width  $wid]
    set rh  [winfo height $wid]
    set rx2 [expr $rx1+$rw]
    set ry2 [expr $ry1+$rh]

    if {$rootX >= $rx1 && $rootX < $rx2 && $rootY >= $ry1 && $rootY < $ry2} {
	return 1
    } else {
	return 0
    }
}

proc tixWinWidth {w} {
    set W [winfo width $w]
    set bd [expr [$w cget -bd] + [$w cget -highlightthickness]]

    return [expr $W - 2*$bd]
}

proc tixWinHeight {w} {
    set H [winfo height $w]
    set bd [expr [$w cget -bd] + [$w cget -highlightthickness]]

    return [expr $H - 2*$bd]
}

# junk?
#
proc tixWinCmd {w} {
    return [winfo command $w]
}

 # VResize.tcl --
#
#	tixVResize:
#	Virtual base class for all classes that provide resize capability,
#	such as the resize handle and the MDI client window.
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

tixWidgetClass tixVResize {
    -virtual true
    -classname TixVResize
    -superclass tixPrimitive
    -method {
	drag dragend dragstart
    }
    -flag {
	-gridded -gridx -gridy -minwidth -minheight
    }
    -configspec {
 	{-gridded gridded Gridded false}
	{-gridx gridX Grid 10}
	{-gridy gridY Grid 10}
	{-minwidth minWidth MinWidth 0}
	{-minheight minHeight MinHeight 0}
   }
}


proc tixVResize:InitWidgetRec {w} {
    upvar #0 $w data

    tixChainMethod $w InitWidgetRec

    set data(movePending) 0
    set data(aborted) 0
    set data(depress) 0
}

#----------------------------------------------------------------------
#                    Public methods
#----------------------------------------------------------------------
# Start dragging a window
#
proc tixVResize:dragstart {w win depress rootx rooty wrect mrect} {
    upvar #0 $w data

    set data(rootx) $rootx
    set data(rooty) $rooty

    set data(mx) [lindex $mrect 0]
    set data(my) [lindex $mrect 1]
    set data(mw) [lindex $mrect 2]
    set data(mh) [lindex $mrect 3]

    set data(fx) [lindex $wrect 0]
    set data(fy) [lindex $wrect 1]
    set data(fw) [lindex $wrect 2]
    set data(fh) [lindex $wrect 3]

    set data(old_x) [lindex $wrect 0]
    set data(old_y) [lindex $wrect 1]
    set data(old_w) [lindex $wrect 2]
    set data(old_h) [lindex $wrect 3]

    if {$data(mw) < 0} {
	set data(maxx)  [expr "$data(fx) + $data(old_w) - $data(-minwidth)"]
    } else {
	set data(maxx) 32000
    }
    if {$data(mh) < 0} {
	set data(maxy)  [expr "$data(fy) + $data(old_h) - $data(-minheight)"]
    } else {
	set data(maxy) 32000
    }

    set data(aborted) 0

    tixCallMethod $w ShowHintFrame
    tixCallMethod $w SetHintFrame $data(fx) $data(fy) $data(fw) $data(fh)

    # Grab so that all button events are captured
    #
    grab $win
    focus $win

    set data(depress) $depress
    if {$depress} {
	set data(oldRelief) [$win cget -relief]
	$win config -relief sunken
    }
}


proc tixVResize:drag {w rootx rooty} {
    upvar #0 $w data

    if {$data(aborted) == 0} {
	set data(newrootx) $rootx
	set data(newrooty) $rooty

	if {$data(movePending) == 0} {
	    set data(movePending) 1
	    after 2 tixVResize:DragCompressed $w
	}
    }
}

proc tixVResize:dragend {w win isAbort rootx rooty} {
    upvar #0 $w data

    if {$data(aborted)} {
	if {$isAbort == 0} {
	    grab release $win
	}
	return
    }

    # Just in case some draggings are not applied.
    #
    update

    tixCallMethod $w HideHintFrame

    if {$isAbort} {
	set data(aborted) 1
    } else {
	# Apply the changes
	#
	tixCallMethod $w UpdateSize $data(fx) $data(fy) $data(fw) $data(fh)

	# Release the grab
	#
	grab release $win
    }

    if {$data(depress)} {
	$win config -relief $data(oldRelief)
    }
}

#----------------------------------------------------------------------
#                    Internal methods
#----------------------------------------------------------------------

proc tixVResize:DragCompressed {w} {
    if {![winfo exists $w]} {
	return
    }

    upvar #0 $w data

    if {$data(aborted) == 1 || $data(movePending) == 0} {
	return
    }

    set dx [expr "$data(newrootx) - $data(rootx)"]
    set dy [expr "$data(newrooty) - $data(rooty)"]

    set data(fx) [expr "$data(old_x) + ($dx * $data(mx))"]
    set data(fy) [expr "$data(old_y) + ($dy * $data(my))"]
    set data(fw) [expr "$data(old_w) + ($dx * $data(mw))"]
    set data(fh) [expr "$data(old_h) + ($dy * $data(mh))"]

    if {$data(fw) < $data(-minwidth)} {
	set data(fw) $data(-minwidth)
    }
    if {$data(fh) < $data(-minheight)} {
	set data(fh) $data(-minheight)
    }

    if {$data(fx) > $data(maxx)} {
	set data(fx) $data(maxx)
    }
    if {$data(fy) > $data(maxy)} {
	set data(fy) $data(maxy)
    }

    # If we need grid, set x,y,w,h to fit the grid
    #
    # *note* grid overrides minwidth and maxwidth ...
    #
    if {$data(-gridded)} {
	set data(fx) [expr "round($data(fx).0/$data(-gridx)) * $data(-gridx)"]
	set data(fy) [expr "round($data(fy).0/$data(-gridy)) * $data(-gridy)"]

	set fx2  [expr $data(fx) + $data(fw) - 2]
	set fy2  [expr $data(fy) + $data(fh) - 2]

	set fx2 [expr "round($fx2.0/$data(-gridx)) * $data(-gridx)"]
	set fy2 [expr "round($fy2.0/$data(-gridy)) * $data(-gridy)"]

	set data(fw) [expr $fx2 - $data(fx) + 1]
	set data(fh) [expr $fy2 - $data(fy) + 1]
    }

    tixCallMethod $w SetHintFrame $data(fx) $data(fy) $data(fw) $data(fh)
 
    update idletasks

    set data(movePending) 0
}

 # VStack.tcl --
#
#	Virtual base class, do not instantiate!  This is the core
#	class for all NoteBook style widgets. Stack maintains a list
#	of windows. It provides methods to create, delete windows as
#	well as stepping through them.
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
#


tixWidgetClass tixVStack {
    -virtual true
    -classname TixVStack
    -superclass tixPrimitive
    -method {
	add delete pageconfigure pagecget pages raise raised
    }
    -flag {
	-dynamicgeometry -ipadx -ipady
    }
    -configspec {
	{-dynamicgeometry dynamicGeometry DynamicGeometry 0 tixVerifyBoolean}
	{-ipadx ipadX Pad 0}
	{-ipady ipadY Pad 0}
    }
}

proc tixVStack:InitWidgetRec {w} {
    upvar #0 $w data

    tixChainMethod $w InitWidgetRec

    set data(pad-x1) 0
    set data(pad-x2) 0
    set data(pad-y1) 0
    set data(pad-y2) 0

    set data(windows)  ""
    set data(nWindows) 0
    set data(topchild) ""

    set data(minW)   1
    set data(minH)   1

    set data(w:top)  $w
    set data(counter) 0
    set data(repack) 0
}

proc tixVStack:SetBindings {w} {
    upvar #0 $w data

    tixChainMethod $w SetBindings
    tixCallMethod $w InitGeometryManager
}

#----------------------------------------------------------------------
# Public methods
#----------------------------------------------------------------------
proc tixVStack:add {w child args} {
    upvar #0 $w data

    set validOptions {-createcmd -raisecmd}

    set opt(-createcmd)  ""
    set opt(-raisecmd)   ""

    tixHandleOptions -nounknown opt $validOptions $args

    set data($child,raisecmd)  $opt(-raisecmd)
    set data($child,createcmd) $opt(-createcmd)

    set data(w:$child) [tixCallMethod $w CreateChildFrame $child]

    lappend data(windows) $child
    incr data(nWindows) 1

    return $data(w:$child) 
}

proc tixVStack:delete {w child} {
    upvar #0 $w data

    if [info exists data($child,createcmd)] {
	if [winfo exists $data(w:$child)] {
	    bind $data(w:$child) <Destroy> {;}
	    destroy $data(w:$child)
	}
	catch {unset data($child,createcmd)}
	catch {unset data($child,raisecmd)}
	catch {unset data(w:$child)}

	set index [lsearch $data(windows) $child]
	if {$index >= 0} {
	    set data(windows) [lreplace $data(windows) $index $index]
	    incr data(nWindows) -1
	}

	if ![string comp $data(topchild) $child] {
	    set data(topchild) ""
	    foreach page $data(windows) {
		if [string comp $page $child] {
		    $w raise $page
		    set data(topchild) $page
		    break
		}
	    }
	}
    } else {
	error "page $child does not exist"
    }
}

proc tixVStack:pagecget {w child option} {
    upvar #0 $w data

    if {![info exists data($child,createcmd)]} {
	error "page \"$child\" does not exist in $w"
    }

    case $option {
	-createcmd {
	    return "$data($child,createcmd)"
	}
	-raisecmd {
	    return "$data($child,raisecmd)"
	}
	default {
	    if {$data(w:top) != $w} {
		return [$data(w:top) pagecget $child $option]
	    } else {
		error "unknown option \"$option\""
	    }
	}
    }
}

proc tixVStack:pageconfigure {w child args} {
    upvar #0 $w data

    if {![info exists data($child,createcmd)]} {
	error "page \"$child\" does not exist in $w"
    }

    set len [llength $args]

    if {$len == 0} {
	set value [$data(w:top) pageconfigure $child]
	lappend value [list -createcmd "" "" "" $data($child,createcmd)]
	lappend value [list -raisecmd "" "" "" $data($child,raisecmd)]
	return $value
    }

    if {$len == 1} {
	case [lindex $args 0] {
	    -createcmd {
		return [list -createcmd "" "" "" $data($child,createcmd)]
	    }
	    -raisecmd {
		return [list -raisecmd "" "" "" $data($child,raisecmd)]
	    }
	    default {
		return [$data(w:top) pageconfigure $child [lindex $args 0]]
	    }
	}
    }

    # By default handle each of the options
    #
    set opt(-createcmd)  $data($child,createcmd)
    set opt(-raisecmd)   $data($child,raisecmd)

    tixHandleOptions -nounknown opt {-createcmd -raisecmd} $args

    #
    # the widget options
    set new_args ""
    tixForEach {flag value} $args {
	if {$flag != "-createcmd" && $flag != "-raisecmd"} {
	    lappend new_args $flag
	    lappend new_args $value
	}
    }

    if {[llength $new_args] >= 2} {
	eval $data(w:top) pageconfig $child $new_args
    }

    #
    # The add-on options
    set data($child,raisecmd)  $opt(-raisecmd)
    set data($child,createcmd) $opt(-createcmd)

    return ""
}

proc tixVStack:pages {w} {
    upvar #0 $w data

    return $data(windows)
}

proc tixVStack:raise {w child} {
    upvar #0 $w data

    if {![info exists data($child,createcmd)]} {
	error "page $child does not exist"
    }

    if {[info exists data($child,createcmd)] && $data($child,createcmd) !=""} {
	uplevel #0 $data($child,createcmd)
	set data($child,createcmd) ""
    }

    tixCallMethod $w RaiseChildFrame $child

    set oldTopChild $data(topchild)
    set data(topchild) $child

    if [string comp $oldTopChild $child] {
	if [string comp $child,raisecmd ""] {
 	    uplevel #0 $data($child,raisecmd)
	}
    }
}

proc tixVStack:raised {w} {
    upvar #0 $w data
 
    return $data(topchild)
}

#----------------------------------------------------------------------
# Virtual Methods
#----------------------------------------------------------------------
proc tixVStack:InitGeometryManager {w} {
    upvar #0 $w data

    bind $w <Configure> "tixVStack:MasterGeomProc $w"
    bind $data(w:top) <Destroy> "+tixVStack:DestroyTop $w"

    if {$data(repack) == 0} {
	set data(repack) 1
	tixWidgetDoWhenIdle tixCallMethod $w Resize
    }
}

proc tixVStack:CreateChildFrame {w child} {
    upvar #0 $w data

    set f [frame $data(w:top).$child]

    tixManageGeometry $f "tixVStack:ClientGeomProc $w"
    bind $f <Configure> "tixVStack:ClientGeomProc $w -configure $f"
    bind $f <Destroy>   "$w delete $child"

    return $f
}

proc tixVStack:RaiseChildFrame {w child} {
    upvar #0 $w data

    # Hide the original visible window
    if {[string comp $data(topchild) ""] &&
	[string comp $data(topchild) $child]} {
	tixUnmapWindow $data(w:$data(topchild))
    }

    set myW [winfo width  $w]
    set myH [winfo height $w]

    set cW [expr $myW - $data(pad-x1) - $data(pad-x2) - 2*$data(-ipadx)]
    set cH [expr $myH - $data(pad-y1) - $data(pad-y2) - 2*$data(-ipady)]
    set cX [expr $data(pad-x1) + $data(-ipadx)]
    set cY [expr $data(pad-y1) + $data(-ipady)]

    if {$cW > 0 && $cH > 0} {
	tixMoveResizeWindow $data(w:$child) $cX $cY $cW $cH
	tixMapWindow $data(w:$child)
	raise $data(w:$child)
    }
}



#----------------------------------------------------------------------
#
#	    G E O M E T R Y   M A N A G E M E N T
#
#----------------------------------------------------------------------
proc tixVStack:DestroyTop {w} {
    catch {
	destroy $w
    }
}

proc tixVStack:MasterGeomProc {w args} {
    if {![winfo exists $w]} {
	return
    }

    upvar #0 $w data

    if {$data(repack) == 0} {
	set data(repack) 1
	tixWidgetDoWhenIdle tixCallMethod $w Resize
    }
}

proc tixVStack:ClientGeomProc {w flag client} {
    if {![winfo exists $w]} {
	return
    }
    upvar #0 $w data

    if {$data(repack) == 0} {
	set data(repack) 1
	tixWidgetDoWhenIdle tixCallMethod $w Resize
    }

    if {$flag == "-lostslave"} {
	error "Geometry Management Error:  Another geometry manager has taken control of $client. This error is usually caused because a widget has been created in the wrong frame: it should have been created inside $client instead of $w"
    }
}

proc tixVStack:Resize {w} {
    if {![winfo exists $w]} {
	return
    }

    upvar #0 $w data

    if {$data(nWindows) == 0} {
	set data(repack) 0
	return
    }

    if {$data(-width) == 0 || $data(-height) == 0} {
	if {!$data(-dynamicgeometry)} {
	    # Calculate my required width and height
	    #
	    set maxW 1
	    set maxH 1

	    foreach child $data(windows) {
		set cW [winfo reqwidth  $data(w:$child)]
		set cH [winfo reqheight $data(w:$child)]

		if {$maxW < $cW} {
		    set maxW $cW
		}
		if {$maxH < $cH} {
		    set maxH $cH
		}
	    }
	    set reqW $maxW
	    set reqH $maxH
	} else {
	    if [string comp $data(topchild) ""] {
		set reqW [winfo reqwidth  $data(w:$data(topchild))]
		set reqH [winfo reqheight $data(w:$data(topchild))]
	    } else {
		set reqW 1
		set reqH 1
	    }
	}

	incr reqW [expr $data(pad-x1) + $data(pad-x2) + 2*$data(-ipadx)]
	incr reqH [expr $data(pad-y1) + $data(pad-y2) + 2*$data(-ipady)]

	if {$reqW < $data(minW)} {
	    set reqW $data(minW)
	}
	if {$reqH < $data(minH)} {
	    set reqH $data(minH)
	}
    }
    # These take higher precedence
    #
    if {$data(-width)  != 0} {
	set reqW $data(-width)
    }
    if {$data(-height) != 0} {
	set reqH $data(-height)
    }

    if {[winfo reqwidth $w] != $reqW || [winfo reqheight $w] != $reqH} {
	if {![info exists data(counter)]} {
	    set data(counter) 0
	}
        if {$data(counter) < 50} {
            incr data(counter)
	    tixGeometryRequest $w $reqW $reqH
	    tixWidgetDoWhenIdle tixCallMethod $w Resize
	    set data(repack) 1
	    return
	}
    }
    set data(counter) 0

    if [string comp $data(w:top) $w] {
	tixMoveResizeWindow $data(w:top) 0 0 [winfo width $w] [winfo height $w]
	tixMapWindow $data(w:top)
    }

    if ![string comp $data(topchild) ""] {
	set top [lindex $data(windows) 0]
    } else {
	set top $data(topchild)
    }

    if [string comp $top ""] {
	tixCallMethod $w raise $top
    }

    set data(repack) 0
}

 # VTree.tcl --
#
#	Virtual base class for Tree widgets.
#
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

tixWidgetClass tixVTree {
    -virtual true
    -classname TixVTree
    -superclass tixScrolledHList
    -method {
    }
    -flag {
	-ignoreinvoke
    }
    -configspec {
	{-ignoreinvoke ignoreInvoke IgnoreInvoke false tixVerifyBoolean}
    }
    -default {
    }
}

proc tixVTree:InitWidgetRec {w} {
    upvar #0 $w data

    tixChainMethod $w InitWidgetRec
}

proc tixVTree:ConstructWidget {w} {
    upvar #0 $w data

    tixChainMethod $w ConstructWidget

    set data(indStyle) [tixDisplayStyle image -refwindow $data(w:hlist)  	-padx 0 -pady 0]
}

proc tixVTree:SetBindings {w} {
    upvar #0 $w data

    tixChainMethod $w SetBindings

    $data(w:hlist) config  	-indicatorcmd "tixVTree:IndicatorCmd $w"  	-browsecmd "tixVTree:BrowseCmdHook $w" 	-command "tixVTree:CommandHook $w"
}

proc tixVTree:IndicatorCmd {w args} {
    upvar #0 $w data

    uplevel #0 set TRANSPARENT_GIF_COLOR [$data(w:hlist) cget -bg]
    set event [tixEvent type]
    set ent   [tixEvent flag V]

    set type [tixVTree:GetType $w $ent]
    set plus	 [tix getimage plus] 
    set plusarm	 [tix getimage plusarm] 
    set minus	 [tix getimage minus] 
    set minusarm [tix getimage minusarm] 

    case $event {
	<Arm> {
	    if {$type == "open"} {
		$data(w:hlist) indicator config $ent -image $plusarm
	    } else {
		$data(w:hlist) indicator config $ent -image $minusarm
	    }
	}
	<Disarm> {
	    if {$type == "open"} {
		$data(w:hlist) indicator config $ent -image $plus
	    } else {
		$data(w:hlist) indicator config $ent -image $minus
	    }
	}
	<Activate> {
	    upvar bind bind
	    tixCallMethod $w Activate $ent $type
	    set bind(%V) $ent
	    tixVTree:BrowseCmdHook $w
	}
    }
}

proc tixVTree:GetType {w ent} {
    upvar #0 $w data

    uplevel #0 set TRANSPARENT_GIF_COLOR [$data(w:hlist) cget -bg]
    if ![$data(w:hlist) indicator exists $ent] {
	return none
    }

    set img [$data(w:hlist) indicator cget $ent -image]

    if {$img == [tix getimage plus]} {
	return open
    }
    if {$img == [tix getimage plusarm]} {
	return open
    }
    return close
}

proc tixVTree:Activate {w ent type} {
    upvar #0 $w data

    uplevel #0 set TRANSPARENT_GIF_COLOR [$data(w:hlist) cget -bg]

    set plus	 [tix getimage plus] 
    set minus	 [tix getimage minus] 

    if {$type == "open"} {
	tixCallMethod $w OpenCmd $ent
	$data(w:hlist) indicator config $ent -image $minus
    } else {
	tixCallMethod $w CloseCmd $ent
	$data(w:hlist) indicator config $ent -image $plus
    }
}

proc tixVTree:CommandHook {w args} {
    upvar #0 $w data
    upvar bind bind

    tixCallMethod $w Command bind
}

proc tixVTree:BrowseCmdHook {w args} {
    upvar #0 $w data
    upvar bind bind

    tixCallMethod $w BrowseCmd bind
}

proc tixVTree:SetMode {w ent mode} {
    upvar #0 $w data

    uplevel #0 set TRANSPARENT_GIF_COLOR [$data(w:hlist) cget -bg]

    case $mode {
	open {
	    $data(w:hlist) indicator create $ent -itemtype image  		-image [tix getimage plus]  -style $data(indStyle)
	}
	close {
	    $data(w:hlist) indicator create $ent -itemtype image  		-image [tix getimage minus] -style $data(indStyle)
	}
	none {
	    if [$data(w:hlist) indicator exist $ent] {
		$data(w:hlist) indicator delete $ent 
	    }
	}
    }
}

#----------------------------------------------------------------------
#
#			Virtual Methods
#
#----------------------------------------------------------------------
proc tixVTree:OpenCmd {w ent} {
    upvar #0 $w data

    # The default action
    foreach kid [$data(w:hlist) info children $ent] {
	$data(w:hlist) show entry $kid
    }
}

proc tixVTree:CloseCmd {w ent} {
    upvar #0 $w data

    # The default action
    foreach kid [$data(w:hlist) info children $ent] {
	$data(w:hlist) hide entry $kid
    }
}

proc tixVTree:Command {w B} {
    upvar #0 $w data
    upvar $B bind

    if {$data(-ignoreinvoke)} {
	return
    }
    set ent [tixEvent flag V]
    if [$data(w:hlist) indicator exist $ent] {
	tixVTree:Activate $w $ent [tixVTree:GetType $w $ent]
    }
}

proc tixVTree:BrowseCmd {w B} {
}
#----------------------------------------------------------------------
#
#			Widget commands
#
#----------------------------------------------------------------------

 # Variable.tcl --
#
#	Routines in this file are used to set up and operate variables
#	for classes that support the -variable option
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#



# tixVariable:ConfigVariable --
#
# 	Set up the -variable option for the object $w
#
# Side effects:
#
#	data(-variable) is changed to the name of the global variable
#	if the global variable exists, data(-value) takes the value of this
#	variable.
#	if the global variable does not exist, it is created with the
#	current data(-value)
#
# Return value:
#
#	true is data(-value) is changed, indicating that data(-command)
#	should be invoked.
#
proc tixVariable:ConfigVariable {w arg} {
    upvar #0 $w data

    set changed 0

    if {$data(-variable) != ""} {
	uplevel #0  	    [list trace vdelete $data(-variable) w "tixVariable:TraceProc $w"]
    }

    if {$arg != ""} {
	if [uplevel #0 info exists [list $arg]] {
	    # This global variable exists, we use its value
	    #
	    set data(-value) [uplevel #0 set [list $arg]]
	    set changed 1
	} else {
	    # This global variable does not exist; let's set it 
	    #
	    uplevel #0 [list set $arg $data(-value)]
	}
	uplevel #0  	    [list trace variable $arg w "tixVariable:TraceProc $w"]
    }

    return $changed
}

proc tixVariable:UpdateVariable {w} {
    upvar #0 $w data

    if {$data(-variable) != ""} {
	uplevel #0  	    [list trace vdelete  $data(-variable) w "tixVariable:TraceProc $w"]
	uplevel #0  	    [list set $data(-variable) $data(-value)]
	uplevel #0  	    [list trace variable $data(-variable) w "tixVariable:TraceProc $w"]

	# just in case someone has another trace and restricted my change
	#
	set data(-value) [uplevel #0 set [list $data(-variable)]]
    }
}

proc tixVariable:TraceProc {w name1 name2 op} {
    upvar #0 $w data
    set varname $data(-variable)

    if [catch {$w config -value [uplevel #0 [list set $varname]]} err] {
	uplevel #0 [list set $varname [list [$w cget -value]]]
	error $err
    }
    return
}

proc tixVariable:DeleteVariable {w} {
    upvar #0 $w data

    # Must delete the trace command of the -variable
    #
    if {$data(-variable) != ""} {
	uplevel #0  	    [list trace vdelete $data(-variable) w "tixVariable:TraceProc $w"]
    }
}

 # Verify.tcl --
#
#	Config option verification routines.
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

proc tixVerifyBoolean {val} {
    return [tixGetBoolean $val]
}

proc tixVerifyDirectory {val} {
    if ![file isdir $val] {
	error "\"$val\" is not a directory"
    }
    return $val
}


 # Version.tcl --
#
#	This file is automatically generated by the Tix version control tool
#
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

proc tixScriptVersion {} {
    return 4.1
}
proc tixScriptPatchLevel {} {
    return 4.1.0
}

 # WInfo.tcl --
#
#	This file implements the command tixWInfo, which return various
#	information about a Tix widget.
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

proc tixWInfo {option w} {
    upvar #0 $w data

    case $option {
	tix {
	    # Is this a Tix widget?
	    #
	    return [info exists data(className)]
	}
	compound {
	    # Is this a compound widget?
	    #	Currently this is the same as "tixWinfo tix" because only
	    # Tix compilant compound widgets are supported
	    return [info exists data(className)]
	}
	class {
	    if {[info exists data(className)]} {
		return $data(className)
	    } else {
		return ""
	    }
	}
    }
}

 # WinFile.tcl --
#
#	MS Window file access portibility routines.
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

proc tixInitFileCmpt:Win {} {
    global tixPriv tcl_platform

    if {$tcl_platform(osVersion) >= 4.0} {
	set tixPriv(isWin95) 1
    } else {
	set tixPriv(isWin95) 0
    }
    if $tixPriv(isWin95) {
	set tixPriv(WinPrefix) xx\\xx
    } else {
	set tixPriv(WinPrefix) xx
    }

#----------------------------------------------------------------------
#
#		MS Windows
#
#----------------------------------------------------------------------

# splits a Windows directory into its hierarchical components
#
proc tixFSSplit {vpath} {
    global tixPriv

    set path ""
    if $tixPriv(isWin95) {
	if ![string compare $vpath xx] {
	    lappend path [list xx     "Desktop"     "C:\\Windows\\Desktop" ]
	    return $path
	}
	if ![string compare $vpath xx\\xx] {
	    lappend path [list xx     "Desktop"     "C:\\Windows\\Desktop" ]
	    lappend path [list xx\\xx "My Computer" "C:\\"]
	    return $path
	}

	set prefix "xx\\xx"
	if ![regsub {^xx\\xx\\} $vpath "" dir] {
	    if [regsub {^xx\\} $vpath "" dir] {
		lappend path [list xx     "Desktop"     "C:\\Windows\\Desktop" ]
		set v "xx"
		set p "C:\\Windows\\Desktop"
		foreach d [split $dir \\] {
		    append v \\$d
		    append p \\$d
		    lappend path [list $v $d $p]
		}
		return $path
	    }
	}
	regsub {:$} $dir :/ dir
	lappend path [list xx     "Desktop"     "C:\\Windows\\Desktop" ]
	lappend path [list xx\\xx "My Computer" "C:\\"]
    } else {
	if ![string compare $vpath xx] {
	    lappend path [list xx     "My Computer" "C:\\"]
	    return $path
	}
	lappend path [list xx     "My Computer" "C:\\"]

	set prefix xx
	regsub {^xx\\} $vpath "" dir
	regsub {:$} $dir :/ dir
    }

    if ![string compare $dir ""] {
	return $path
    }
    if [string compare [file pathtype $dir] "absolute"] {
	error "$dir must be an absolute path"
    }

    set dirs [file split $dir]
    set p ""
    foreach d $dirs {
	set p [file join $p $d]
	regsub -all / $p \\ p
	set vpath $prefix\\$p
	regsub {[\\]$} $vpath "" vpath
	regsub {:/$} $d ":" d
	lappend path [list $vpath $d $p]
    }

    return $path
}

# returns true if $dir is an valid path (not equal to "")
#
proc tixFSValid {dir} {
    return [expr ![string compare $dir ""]]
}

# tixFSIntName
#
#	Returns the "virtual path" of a filename
#
proc tixFSIntName {dir} {
    global tixPriv

    if ![string compare $dir ""] {
	if $tixPriv(isWin95) {
	    return "xx\\xx"
	} else {
	    return xx
	}
    }
        
    if [string compare [file pathtype $dir] "absolute"] {
	error "$dir must be an absolute path"
    }

    if $tixPriv(isWin95) {
        set vpath "xx\\xx\\$dir"
    } else {
        set vpath "xx\\$dir"
    }
    regsub {:/$} $vpath ":" vpath
    regsub {[\\]$} $vpath "" vpath
    return $vpath
}

proc tixFSIntJoin {dir sub} {
    set vpath $dir\\$sub
    regsub -all {\\\\} $vpath \\ vpath
    regsub {:/$} $vpath : vpath
    regsub {[\\]$} $vpath "" vpath
    return $vpath
}

proc tixFSJoin {dir sub} {
    set p [file join $dir $sub]
    regsub -all / $p \\ p
    return $p
}

proc tixFSResolveName {p} {
    regsub -all / $p \\ p
    if [regexp {:([^\\]|$)} $p] {
	regsub : $p :\\ p
    }
    return $p
}

# dir:		Make a listing of this directory
# showSubDir:	Want to list the subdirectories?
# showFile:	Want to list the non-directory files in this directory?
# showPrevDir:	Want to list ".." as well?
# showHidden:	Want to list the hidden files? (%% is ignored)
#
# return value:	a list of files and/or subdirectories
#
proc tixFSListDir {vpath showSubDir showFile showPrevDir showHidden {pattern ""}} {
    global tixPriv
    set appPWD [pwd]
    set list ""

    if $tixPriv(isWin95) {
	if ![string compare $vpath xx] {
	    set dir C:\\Windows\\Desktop
	    if {$showSubDir} {
		lappend list xx:
	    }
	} elseif ![string compare $vpath xx\\xx] {
	    if {$showSubDir} {
		return [tixFSGetDrives]
	    } else {
		return ""
	    }
	} else {
	    if ![regsub {^xx\\xx\\} $vpath "" dir] {
		regsub {^xx\\} $vpath C:\\Windows\\Desktop\\ dir
	    }
	    regsub {:$} $dir :\\ dir
	}
    } else {
	if ![string compare $vpath xx] {
	    if {$showSubDir} {
		return [tixFSGetDrives]
	    } else {
		return ""
	    }
	}

	regsub {^xx\\} $vpath "" dir
	regsub {:$} $dir :\\ dir
    }

    if [catch {cd $dir} err] {
	# The user has entered an invalid directory
	# %% todo: prompt error, go back to last succeed directory
	cd $appPWD
	return ""
    }

    if {$pattern == ""} {
	set pattern "*"
    }

    if [catch {set names [lsort [eval glob -nocomplain $pattern]]} err] {
	# Cannot read directory
	# %% todo: show directory permission denied
	cd $appPWD
	return ""
    }

    catch {
	# We are catch'ing, just in case the "file" command returns unexpected
	# errors
	#
	foreach fname $names {
	    if {![string compare . $fname]} {
		continue
	    }
	    if {![string compare ".." $fname]} {
		continue
	    }
	    if [file isdirectory $fname] {
		if $showSubDir {
		    lappend list [file tail $fname]
		}
	    } else {
		if $showFile {
		    lappend list [file tail $fname]
		}
	    }
	}
    }
    cd $appPWD

    if {$showSubDir && $showPrevDir && $dir != "/"} {
	return [tixFSMakeList $vpath $dir [lsort [concat .. $list]]]
    } else {
	return [tixFSMakeList $vpath $dir $list]
    }
}

proc tixFSMakeList {vpath dir list} {
    global tixPriv

    if $tixPriv(isWin95) {
	set prefix xx\\xx
    } else {
	set prefix xx
    }
    set l ""
    foreach file $list {
	if ![string compare $file xx:] {
	     lappend l [list xx\\xx "My Computer" "C:\\"]
	} else {
	    set path [tixFSJoin $dir $file]
	    lappend l [list $vpath\\$file $file $path]
	}
    }

    return $l
}

proc tixFSSep {} {
    return "\\"
}

proc tixFSGetDrives {} {
    global tixPriv

    if [info exists tixPriv(drives)] {
	return $tixPriv(drives)
    } else {
	set drives [list A: B:]
	foreach d {c d e f g h i j k l m n o p q r s t u v w x y z} {
	    if [file exists $d:\\] {
		lappend drives [string toupper $d:]
	    }
	}

	set tixPriv(drives) ""
	foreach d $drives {
	     lappend tixPriv(drives) [list $tixPriv(WinPrefix)\\$d $d $d\\]
	}
    }
    return $tixPriv(drives)
}

#----------------------------------------------------------------------
#
#		OBSOLETE
#
#----------------------------------------------------------------------



# Directory separator
#
proc tixDirSep {} {
    return "\\"
}

# returns the "root directory" of this operating system
#
# out:	intName
proc tixRootDir {} {
    return "/"
}

# is an absoulte path only if it starts with a baclskash
# or starts with "<drive letter>:"
#
# in: nativeName
#
proc tixIsAbsPath {nativeName} {
    set c [string index $nativeName 0]
    if {$c == "\\"} {
	return 1
    }

    if {[string compare [string toupper $c] A] < 0} {
	return 0
    }
    if {[string compare [string toupper $c] Z] > 0} {
	return 0
    }
    if {[string index $nativeName 1] != ":"} {
	return 0
    }
    return 1
}

# returns <drive>:
#
proc tixWinGetFileDrive {nativeName} {
    set c [string index $nativeName 0]
    if {$c == "\\"} {
	return [string toupper [string range [pwd] 0 1]]
    }

    if {[string compare [string toupper $c] A] < 0} {
	return [string toupper [string range [pwd] 0 1]]
    }
    if {[string compare [string toupper $c] Z] > 0} {
	return [string toupper [string range [pwd] 0 1]]
    }
    if {[string index $nativeName 1] != ":"} {
	return [string toupper [string range [pwd] 0 1]]
    }
    return [string toupper [string range $nativeName 0 1]]
}

# returns the absolute pathname of the file 
# (not including the drive letter or the first backslash)
#
# [tixWinGetFileDrive]\\[tixWinGetFilePath] gives the complete
# drive and pathname
#
proc tixWinGetFilePath {nativeName} {
    set c [string index $nativeName 0]
    if {$c == "\\"} {
	return ""
    }

    if {[string compare [string toupper $c] A] < 0} {
	return [tixWinGetPathFromDrive $nativeName]
    }
    if {[string compare [string toupper $c] Z] > 0} {
	return [tixWinGetPathFromDrive $nativeName]
    }
    if {[string index $nativeName 1] != ":"} {
	return [tixWinGetPathFromDrive $nativeName]
    }
    if {[string index $nativeName 2] != "\\"} {
        regexp {[A-z]:} $nativeName drive
	regsub {[A-z]:} $nativeName "" path
	return [tixWinGetPathFromDrive $path $drive]
    }

    regsub {[A-z]:[\\]} $nativeName "" path
    return $path
}

proc tixWinCurrentDrive {} {
    return [string range [pwd] 0 1]
}

proc tixWinGetPathFromDrive {path {drive ""}} {
    if {$drive == ""} {
        set drive [tixWinCurrentDrive]
    }

    #
    # %% currently TCL (7.5b3) does not tell what the current path
    #    on a particular drive is

    return $path
}

#
#
# nativeName:	native filename used in this OS, comes from the user or
#		application programmer
# defParent:	(intName) if the filename is not an absolute path,
#		treat it as a subfolder of $defParent
#		(must be an intName, must be absolute)
proc tixFileIntName {nativeName {defParent ""}} {
    if {![tixIsAbsPath $nativeName]} {
        if {$defParent != ""} {
	    if {[string index $defParent 0] != "/"} {
	        error "Tix toolkit error: \"$defParent\" is not an absolute internal file name"
	    }
	    set path [tixSubFolder $defParent $nativeName]
	} else {
	    set path $nativeName
	}
    } else {
	set path /[tixWinGetFileDrive $nativeName]\\[tixWinGetFilePath $nativeName]
    }

    set intName ""
    foreach name [tixFileSplit $path] {
	set intName [tixSubFolder $intName $name]
    }

    return $intName
}

# in:	internal name
# out:	native name
proc tixNativeName {intName {mustBeAbs 1}} {
    if {[string index $intName 0] != "/"} {
        if {$mustBeAbs} {
            error "Tix internal error: \"$intName\" is not an intName"
	} else {
	    return $intName
	}
    }
    if {$intName == "/"} {
        return C:\\
    }
    regsub {/[\\]} $intName "" nativeName
    if {[string length $nativeName] == 2} {
        return $nativeName\\
    } else {
        return $nativeName
    }
}

# how a filename should be displayed
# 
# e.g. /\C: becomes C:\\
#      /\   becomes "My Computer"
#      /\C:\\Windows is Windows
proc tixFileDisplayName {intName} {
    if {[string index $intName 0] != "/"} {
        error "Tix internal error: \"$intName\" is not an intName"
    }

    if {$intName == "/"} {
        return "My Computer"
    }

    regsub {/[\\]} $intName "" nativeName

    if {[string length $nativeName] == 2} {
        return [string toupper $nativeName\\]
    } else {
        return [file tail $nativeName]
    }
}

# in:	internal name
# out:	a list of paths
proc tixFileSplit {intName} {

    set l ""
    foreach n [split $intName /\\] {
	if {$n == ""} {
	    continue
	}
	if {$n == "."} {
	    continue
	}

	lappend l $n
    }
    

    while 1 {
	set idx [lsearch $l ".."]
	if {$idx == -1} {
	    break;
	}
	set l [lreplace $l [expr $idx -1] $idx]
    }


    if {[string index $intName 0] == "/"} {
	return [concat "/" $l]
    } else {
	return $l
    }
}

# parent, sub:	intName
#
proc tixSubFolder {parent sub} {
    if {$parent == ""} {
	return $sub
    }
    return $parent\\$sub
}

proc tixWinGetDrives {} {
    global tixPriv

    if [info exists tixPriv(drives)] {
	return $tixPriv(drives)
    } else {
	set tixPriv(drives) {A: B:}
        foreach d {c e d f g h i j k l m n o p q r s t u v w x y z} {
	    if [file exists $d:] {
		lappend tixPriv(drives) [string toupper $d:]
	    }
        }
    }
    return $tixPriv(drives)
}

# dir:		Make a listing of this directory
# showSubDir:	Want to list the subdirectories?
# showFile:	Want to list the non-directory files in this directory?
# showPrevDir:	Want to list ".." as well?
# showHidden:	Want to list the hidden files? (%% is ignored)
#
# return value:	a list of files and/or subdirectories
#
proc tixListDir {dir showSubDir showFile showPrevDir showHidden {pattern ""}} { 
    set appPWD [pwd]

    if {$dir == "/"} {
	if {$showSubDir} {
	    return [tixWinGetDrives]
        } else {
	    return ""
	}
    }

    if [catch {cd [tixNativeName $dir]} err] {
	# The user has entered an invalid directory
	# %% todo: prompt error, go back to last succeed directory
	cd $appPWD
	return ""
    }

    if {$pattern == ""} {
	set pattern "*"
    }

    if [catch {set names [lsort [eval glob -nocomplain $pattern]]} err] {
	# Cannot read directory
	# %% todo: show directory permission denied
	cd $appPWD
	return ""
    }

    set list ""
    catch {
	# We are catch'ing, just in case the "file" command returns unexpected
	# errors
	#
 	foreach fname $names {
	    if {![string compare . $fname]} {
		continue
	    }
 	    if {![string compare ".." $fname]} {
	        continue
	    }
	    if [file isdirectory $fname] {
		if $showSubDir {
		    lappend list [file tail $fname]
		}
	    } else {
		if $showFile {
		    lappend list [file tail $fname]
		}
	    }
	}
    }
    cd $appPWD

    if {$showSubDir && $showPrevDir && $dir != "/"} {
	return [lsort [concat .. $list]]
    } else {
        return $list
    }
}

proc tixVerifyFile {file} {
    return [tixFileIntName $file]
}

proc tixFilePattern {args} {
    if {[lsearch $args allFiles] != -1} {
	return *
    }
    return *
}

}

# tixWinFileEmu --
#
#	Emulates a MS Windows file system environemnt inside Unix
#
proc tixWinFileEmu {} {
    cd /mnt/c
    rename pwd __pwd
    rename cd  __cd
    proc EmuConvert {path} {
	if [regsub ^/mnt/c/ $path c:/ path] {
	    return $path
	}
	if [regsub ^/mnt/d/ $path d:/ path] {
	    return $path
	}
	if [regsub ^/mnt/c\$ $path c:/ path] {
	    return $path
	}
	if [regsub ^/mnt/d\$ $path d:/ path] {
	    return $path
	}
	return c:/windows
    }

    proc pwd {} {
	return [EmuConvert [__pwd]]
    }
    proc glob {args} {

    }
}

 # tixAssert --
#
#	Debugging routine. Evaluates the test script in the context of the
#	caller. The test script is responsible for generating the error.
#	
proc tixAssert {script} {
    uplevel $script
}

proc tixAssertNorm {path} {
    if ![tixFSIsNorm $path] {
	error "\"$path\" is not a normalized path"
    }
}

proc tixAssertVPath {vpath} {
    if ![tixFSIsVPath $vpath] {
	error "\"$vpath\" is not a VPATH"
    }
}

# tixFSAbsPath --
#
#	Converts $path into an normalized absolute path
#
proc tixFSAbsPath {path} {
    return [lindex [tixFSNorm [tixFSVPWD] $path] 0]
}

# tixFSVPWD --
#
#	Returns the VPATH of the current directory.
#
proc tixFSVPWD {} {
    return [tixFSVPath [tixFSPWD]]
}

if {![info exists tcl_platform] || $tcl_platform(platform) == "unix"} {

# tixFSPWD --
#
#	Return the current directory
#
proc tixFSPWD {} {
    return [pwd]
}

# tixFSDisplayName --
#
#	Returns the name of a normalized path which is usually displayed by
#	the OS
#
proc tixFSDisplayName {normpath} {
    tixAssert {
	tixAssertNorm $normpath
    }
    return $normpath
}

proc tixFSIsAbsPath {path} {
    return [tixStrEq [string index $path 0] /]
}

# tixFSIsNorm_os --
#
#	Returns true iff this pathname is normalized, in the OS native name
#	format
#
proc tixFSIsNorm_os {path} {
    return [tixFSIsNorm $path]
}

proc tixFSIsNorm {path} {
    if [tixStrEq $path /] {
	return 1
    }

    # relative path
    #
    if ![regexp {^/} $path] {
	return 0
    }

    if [regexp {/[.]$} $path] {
	return 0
    }
    if [regexp {/[.][.]$} $path] {
	return 0
    }
    if [regexp {/[.]/} $path] {
	return 0
    }
    if [regexp {/[.][.]/} $path] {
	return 0
    }
    if [tixStrEq $path .] {
	return 0
    }
    if [tixStrEq $path ..] {
	return 0
    }

    # Tilde
    #
    if [regexp {^~} $path] {
	return 0
    }

    # Double slashes
    #
    if [regexp {//} $path] {
	return 0
    }

    # Trailing slashes
    #
    if [regexp {/$} $path] {
	return 0
    }

    return 1
}

# tixFSIsValid --
#
#	Checks whether a native pathname contains invalid characters.
#
proc tixFSIsValid {path} {
    return 1
}

proc tixFSIsVPath {vpath} {
    return [tixFSIsNorm $vpath]
}

# tixFSVPath --
#
#	Converts a native pathname to its VPATH
#
proc tixFSVPath {path} {
    tixAssert {
	tixAssertNorm $path
    }
    return $path
}

# tixFSPath --
#
#	Converts a vpath to a native pathname
proc tixFSPath {vpath} {
    tixAssert {
	tixAssertVPath $vpath
    }
    return $vpath
}

# tixFSTildeSubst -- [Unix only]
#
#	Substitutes any leading tilde characters if possible. No error is
#	generated if the user doesn't exist.
#
proc tixFSTildeSubst {text} {
    if [tixStrEq [string index $text 0] ~] {
	# The following will report if the user doesn't exist
	if [catch {
	    file isdir $text
	}] {
	    return ./$text
	}
	return [tixFile tilde $text]
    } else {
	return $text
    }
}

# tixFSNorm --
#
#	Interprets the user's input and return file information about this
#	input.
#
# Arguments:
#	See documentation (docs/Files.txt)
#
proc tixFSNorm {context text {defFile ""} {flagsVar ""} {errorMsgVar ""}} {
    tixAssert {
	tixAssertVPath $context
    }

    if ![tixStrEq $errorMsgVar ""] {
	upvar $errorMsgVar errorMsg
    }
    if ![tixStrEq $flagsVar ""] {
	upvar $flagsVar flags
    }

    set hasDirSuffix [regexp {/$} $text]
    set text [tixFSTildeSubst $text]
    set text [_tixJoin $context $text]

    if {$hasDirSuffix || [file isdir $text]} {
	set dir $text
	set tail $defFile
    } else {
	set dir [file dirname $text]
	set tail [file tail $text]
    }

    set norm $dir/$tail
    regsub -all /+ $norm / norm
    if ![tixStrEq $norm /] {
	regsub {/$} $norm "" norm
    }

    if ![info exists flag(noPattern)] {
	set isPat 0
	foreach char [split $tail ""] {
	    if {$char == "*" || $char == "?"} {
		set isPat 1
		break
	    }
	}
	if {$isPat} {
	    return [list $norm $dir "" $tail]
	}
    }

    return [list $norm $dir $tail ""]
}

# _tixJoin -- [Internal]
# 
#	Joins two native pathnames.
#
proc _tixJoin {p1 p2} {
    if [tixStrEq [string index $p2 0] /] {
	return [_tixNormalize $p2]
    } else {
	return [_tixNormalize $p1/$p2]
    }
}

# tixFSNormDir --
#
#	Normalizes an absolute path.
#
proc tixFSNormDir {dir} {
    set dir [tixFile tilde $dir]
    if ![tixStrEq [string index $dir 0] /] {
	error "\"$dir\" must be an absolute pathname"
    }
    if ![file isdir $dir] {
	error "\"$dir\" is not a directory"
    }
    return [_tixNormalize $dir]
}

# _tixNormalize --
#
#	Normalizes an absolute pathname.
#
# 	$dir must be an absolute pathname
#
proc _tixNormalize {path} {
    tixAssert {
	if ![tixStrEq [string index $path 0] /] {
	    error "\"$path\" must be an absolute pathname"
	}
    }

    # Don't be fooled: $path doesn't need to be a directory. The following
    # code just makes it easy to get rid of trailing . and ..
    #
    set path $path/
    regsub -all /+ $path / path
    while 1 {
	if ![regsub {/\./} $path "/" path] break
    }
    while 1 {
	if ![regsub {/\.$} $path "" path] break
    }

    while 1 {
	if ![regsub {/[^/]+/\.\./} $path "/" path] break
	while 1 {
	    if ![regsub {^/\.\./} $path "/" path] break
	}
    }
    while 1 {
	if ![regsub {^/\.\./} $path "/" path] break
    }

    regsub {/$} $path "" path
    if [tixStrEq $path ""] {
	return /
    } else {
	return $path
    }
}

# tixFSCreateDirs
#
#
# 
proc tixFSCreateDirs {path} {
    tixAssert {
	error "Procedure tixFSCreateDirs not implemented on all platforms"
    }
    if [tixStrEq $path /] {
	return 1
    }
    if [file exists $path] {
	return 1
    }
    if ![tixFSCreateDirs [file dirname $path]] {
	return 0
    }
    if [catch {exec mkdir $path}] {
	return 0
    }
    return 1
}

} else {

#-Win--------------------------------------------------------------------

# (Win) tixFSPWD --
#
#	Return the current directory
#
proc tixFSPWD {} {
    set p [pwd]
    regsub -all / $p \\ p
    return $p
}
# Win
#
proc tixFSIsNorm {path} {

    # Drive root directory
    #
    if [regexp {^[A-z]:$} $path] {
	return 1
    }

    # If it is not a drive root directory, it must
    # have a leading [drive letter:]\\[non empty string]
    if ![regexp {^[A-z]:\\.} $path] {
	return 0
    }

    # relative path
    #
    if [regexp {\\[.]$} $path] {
	return 0
    }
    if [regexp {\\[.][.]$} $path] {
	return 0
    }
    if [regexp {\\[.]\\} $path] {
	return 0
    }
    if [regexp {\\[.][.]\\} $path] {
	return 0
    }
    if [tixStrEq $path .] {
	return 0
    }
    if [tixStrEq $path ..] {
	return 0
    }

    # Double slashes
    #
    if [regexp {\\\\} $path] {
	return 0
    }

    # Trailing slashes
    #
    if [regexp {[\\]$} $path] {
	return 0
    }

    return 1
}

# (Win) tixFSNorm --
#
#	Interprets the user's input and return file information about this
#	input.
#
# Arguments:
#	See documentation (docs/Files.txt)
#
proc tixFSNorm {context text {defFile ""} {flagsVar ""} {errorMsgVar ""}} {
    tixAssert {
	tixAssertVPath $context
    }

    if ![tixStrEq $errorMsgVar ""] {
	upvar $errorMsgVar errorMsg
    }
    if ![tixStrEq $flagsVar ""] {
	upvar $flagsVar flags
    }

    set isDir [regexp {[\\]$} $text]
    set text [_tixJoin $context $text]
    set path [tixFSPath $text]

    if {$isDir || [file isdir $path]} {
	set vpath $text
	set tail $defFile
    } else {
	set list [split $text \\]
	set tail [lindex $list end]
	set len [string length $tail]
	set vpath [string range $text 0 [expr [string len $text]-$len-1]]
	regsub {[\\]$} $vpath "" vpath
    }

    set path [tixFSPath $vpath]

    if ![info exists flag(noPattern)] {
	set isPat 0
	foreach char [split $tail ""] {
	    if {$char == "*" || $char == "?"} {
		set isPat 1
		break
	    }
	}
	if {$isPat} {
	    return [list $path $vpath "" $tail]
	}
    }

    return [list $path $vpath $tail ""]
}

# Win
#
# _tixJoin -- [internal]
#
#	Joins a pathname to a VPATH
#
proc _tixJoin {vp1 p2} {
    if [tixFSIsAbsPath $p2] {
	return [tixFSVPath [_tixNormalize $p2]]
    } else {
	return [tixFSVPath [_tixNormalize [tixFSPath $vp1]\\$p2]]
    }
}

# (Win) tixFSIsAbsPath
#
#	The Tcl "file pathtype" is buggy. E.g. C:\.\..\. is absolute, but
#	"file pathtype" thinks that it isn't
#

proc tixFSIsAbsPath {path} {
    return [regexp {^[A-z]:\\} $path]
}

# (Win) tixFSIsNorm_os
#
#	Returns true iff this pathname is normalized, in the OS native name
#	format
#
proc tixFSIsNorm_os {path} {
    if [regexp {^[A-z]:[\\]$} $path] {
	return 1
    }
    if [regexp {^[A-z]:$} $path] {
	return 0
    }

    return [tixFSIsNorm $path]

}

# Win
#
# _tixNormalize --
#
#	Normalizes an absolute pathname.
#
# 	$dir must be an absolute native pathname
#
proc _tixNormalize {abpath} {
    tixAssert {
	if ![tixFSIsAbsPath $abpath] {
	    error "\"$abpath\" must be an absolute pathname"
	}
    }

    if ![regexp {^[A-z]:} $abpath drive] {
	tixPanic "\"$abpath\" does not contain a drive letter"
    }
    set drive [string toupper $drive]

    regsub {^[A-z]:} $abpath "" path

    # Don't be fooled: $path doesn't need to be a directory. The following
    # code "set path $path\\" just makes it easy to get rid of trailing
    # . and ..
    #
    set path $path\\
    regsub -all {[\\]+} $path \\ path
    while 1 {
	if ![regsub {\\[.]\\} $path "\\" path] break
    }
    while 1 {
	if ![regsub {\\[.]$} $path "" path] break
    }

    while 1 {
	if ![regsub {\\[^\\]+\\[.][.]\\} $path "\\" path] break
	while 1 {
	    if ![regsub {^\\[.][.]\\} $path "\\" path] break
	}
    }
    while 1 {
	if ![regsub {^\\[.][.]\\} $path "\\" path] break
    }

    regsub {[\\]+$} $path "" path
    return $drive$path
}

# Win
#
# tixFSNormDir --
#
#	Normalizes a directory
#
proc tixFSNormDir {dir} {
    if ![tixFSIsAbsPath $dir] {
	error "\"$dir\" must be an absolute pathname"
    }
    if ![file isdir $dir] {
	error "\"$dir\" is not a directory"
    }
    return [_tixNormalize $dir]
}


proc tixPanic {message} {
    error $message
}

# tixFSIsValid --
#
#	Checks whether a native pathname contains invalid characters.
#
proc tixFSIsValid {path} {
    return 1
}

# Win
#
#
proc tixFSIsVPath {vpath} {
    global tixPriv
    if $tixPriv(isWin95) {
	return [string match {xx\\xx\\[A-z]:*} $vpath]
    } else {
	return [string match {xx\\[A-z]:*} $vpath]
    }
}

# Win
#
# tixFSVPath --
#
#	Converts a normalized native pathname to its VPATH
#
proc tixFSVPath {path} {
    global tixPriv

    tixAssert {
	tixAssertNorm $path
    }
    return $tixPriv(WinPrefix)\\$path
}

# tixFSPath --
#
#	Converts a vpath to a native pathname
proc tixFSPath {vpath} {
    global tixPriv
    tixAssert {
	tixAssertVPath $vpath
    }
    if $tixPriv(isWin95) {
	set path [string range $vpath 6 end]
    } else {
	set path [string range $vpath 3 end]
    }
    regsub {:$} $path :\\ path

    return $path
}

# tixFSDisplayName --
#
#	Returns the name of a normalized path which is usually displayed by
#	the OS
#
proc tixFSDisplayName {normpath} {
    tixAssert {
	tixAssertNorm $normpath
    }

    if [regexp {^[A-z]:$} $normpath] {
	return $normpath\\
    } else {
	return $normpath
    }
}


tixInitFileCmpt:Win 

}

             |           "  2  B  R  b  r            ҆          "  2  B  R  b  r            ҇          "  2  B  R  b  r            ҈          "  2  B  R  b  r            ҉          "  2  B  R  b  r            Ҋ          "  2  B  R  b  r            ҋ          "  2  B  R  b  r            Ҍ          "  2  B  R  b  r            ҍ          "  2  B  R  b  r            Ҏ          "  2  B  R  b  r            ҏ          "  2  B  R  b  r            Ґ          "  2  B  R  b  r            ґ          "  2  B  R  b  r            Ғ          "  2  B  R  b  r            ғ          "  2  B  R  b  r            Ҕ          "  2  B  R  b  r            ҕ          "  2  B  R  b  r            Җ          "  2  B  R  b  r            җ          "  2  B  R  b  r            Ҙ          "  2  B  R  b  r                                                                                                               Ѕ                $        
   G           v    	           {     h>     =                 GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3  GCC: (GNU) 2.7.2.3           01.01             01.01             01.01             01.01             01.01             01.01             01.01             01.01             01.01             01.01             01.01             01.01             01.01             01.01             01.01             01.01             01.01             01.01             01.01             01.01             01.01             01.01             01.01             01.01             01.01             01.01             01.01             01.01             01.01             01.01             01.01             01.01             01.01             01.01             01.01             01.01             01.01             01.01             01.01             01.01             01.01             01.01             01.01             01.01             01.01             01.01             01.01    .symtab .strtab .shstrtab .hash .dynsym .dynstr .rel.data .rel.got .rel.plt .init .plt .text .fini .rodata .data .ctors .dtors .got .dynamic .bss .comment .note                                                          l
               !                              )          $   $  G                 1   	      h>  h>  <              ;   	      ({  ({                 D   	      {  {  	              M         Ѕ  Ѕ  ,                  S                             X         ̙  ̙  @+                ^                             d         , , _                 l         4 $ A	                r         v f                   y         v f                            v f \                          |  l x                         | l                                l                              Dp                                s                                 ,x I             	               ?                                                                $            h>            ({            {            Ѕ                        ̙       	           
     ,           4           v           v           v            |           |                                                                                          ̙        	                       	 &         	 <   v       I         	 T   v       b   v                             	                ̙        	 o   ̙       	    v                  	 T   4          v                              	    4           [    	    8  j    	    t  p    	          	   $  =   	 "       	 ,  d  2    	 =        	 I    U   	 S        	 ^        	 n  ܵ      	 }       	   ,  s   	   @      	   p      	   l     	   0     	   H      	                       	   4        | 4         |    	         	   4        | 4              	 -        	 8    _    	 D  4      O    G    	 X  |      b                      	 n                      	 y              8        	   4        d  V    	         	   8  )    	   } 4       H  Y    	   4                            	   4       6          #   	   H}         7      2  $7       C  B7       T  X7       d  7       u  7         7         7         7         8         (8         ,8         L8         d8         8         8         8       %  x9       6  9       C  9       O  :       `  :       n  :       {  :          ;         4;         ;         H<         \<         p<         <         <       	  <         =       (  <=       8  V=       H  p=       X  =       h  =       w  =         >          >         `>         |>               	   ?                            	                       	         	                       	         	      k    	 6     _    	 F  `  6    	 Y    ,    	 h              8        	 t        	               d        	                       	   ?                             	   ?              	     V    	     "   	         	   d}                    p        	       	                      	 (  ?      0   A    	 ?       	 N                     	 Z  @      s  ,A @           	        	        	        	    <   	    \    	 )   9    	 G  H 5    	 b       	 {  D I   	    z    	    =   	    3    	   D        D        D                    L       	   D      	  TE     &	  L d    	 :	       	 Q	   a    	 l	  t     	 	   -   	 	   \    	 	   9    	 	   5    	 	  8 f    	 	      	 
   z    	 
  ,      	    3    	   XH        \H        lH      5
              ,!       	 B
  |H      N
  + k    	 Y
  H      d
  + D    	 s
  0* ?    	 }
  @)     	 
  $ :    	 
  , %    	 
  % r    	 
  H       
  $$ 1    	 
  X$ W    	 
  $ ?    	 
  H        # O    	 
  ,% L    	   x% *    	 +  8~ 4     6  + h    	 D  & `    	 U  l~ 4     b  x&     	 r  ,,     	   * N    	   ,     	   -     	               .       	   H        I        . }    	   .     	   0     	 1  0     	 G  t/ .   	 [  . G    	 l  L1 9    	   1 5    	   1     	   T2 I   	   3 z    	   4 =   	   L        L        M                    \5       	   M        $M      )  M      @  \5 O    	 U  6 D   	 m  8 N    	   09     	   7     	   5 }    	   L9 9    	   9 5    	   ; 1    	   H; t    	 ,  ; 5    	 @  ; G    	 [  N      n   : 3    	   T:     	   9 ]    	   ,6 D    	   p6 @    	   N        : =    	               =       	   N        O $    	 
  P T    	   N      *  =     	 2  N       @  B h    	 L  dC    	 \  ? \    	 i  >     	 w  ?     	   P@    	   DC     	   O        PT     	   F /    	   `E     	   lP     	   L d    	   $F >    	    dF c    	 
  ,G V   	   F 2    	 0  $M    	 D   _     	 T  I    	 e  K     	 t  J 2    	   J     	   tK u    	   O _    	   ~ 4       ~ 4       PU     	   ]     	   0V v    	 $  V     	 :  @W i    	 P  W     	 `  TX     	 p  pX     	   X 4    	   X G    	   Y 3    	   @Y    	   ^ d    	               _       	   O        O        a K   	   b    	   |f Y    	    f 
   	 .  g f   	 >              p       	 J  p     	 W  ||     	 a      	 o  $     	 z  T 1   	   O       Q        4R        TS        S `       TT `       W    	   s    	   q    	    D    	   ~ 2    	 1  , 7    	 :  d     	    !    	 0  }    	 C              H       	   U      O  H     	 \       	 f   5    	 t  ̖     	        	   PV        $ F    	       	        	       	   P     	   ܈ Z    	 
      	    8 w   	 8   4     A  h ]   	 I  ȍ     	 R      	 j                     	 s  ԥ     	 ~  0 ^   	       	    j   	   |     	   < !   	   ` p    	   М /    	     /    	        	    =    	   ȡ =    	 ,   k    	 >   ^    	 M  t /    	 d      	         	 s  < 4     |  TV                           	   XV        x[         H '    	   P ^   	    .    	     O    	       	   [       	  X    	       	 $   2    	 /   X    	 <  ` `    	 I       	 Y      	 d  `     	 v  8 [   	    W   	    q    	   ` y    	    y   	       	   T     	       	   ^         1   	   4 U    	 	   U   	   l    	 1       	 I  t    	 Z  @    	   ̶ [    	 t  p h   	    8   	   ع S   	        	   , 4   	   ` p    	   x c    	    m    	   8     	    )    	 *   ,   	 :  @ 2    	 M   |    	 X  ,^      b  D     	 v  0    	   <^                    4       	   4 d    	    e    	    i    	                      	   @^        `         b             	    n   	 0  Xb      ;  D    	 C       	 P       	 ^   w   	 n  t     	 ~                     	   hb         D    	 0  b                    0       	   b          o   	   l     	 0  <c        t     	   |     	        	   h     	               x       	   Lc        p        H      .  L      7  t      ?   '   	 O                     	 Z                     	   Pc       h `     e  ; r    	   6     	 z  6 /    	   l8 .    	    O    	   2 4   	   8<    	   Pi              	        	   |    	   $ 2    	   X X    	       	    {    	          	        	 )  ! Q    	 4  @"    	 ?  4*     	 M  * w    	 W  -    	 g  ! Q    	 r  T0 @   	 ~  1 @   	   k        ?    	   D |    	   W l    	   H; A    	   W S    	   dW ?    	 :  [ \    	   0+    	   `[ 4    	   [ 3    	   4H Y    	   xE     	 $  H,    	 I  X     	 5  @V X    	 J  V -    	 \  F     	 q  U -    	 ~  Y     	   Y     	   Z D    	   Y L    	   ; 5    	   7 Z   	   = g   	   H I   	 t  L ,   	   ,?     	   I     	   J    	 -   P Q   	 :  TS    	 I  V ;    	 b  V ;    	   X     	   \Z     	               [       	   <\     	   k         <] i    	   ]     	   X^    	   _     	   ` p    	   pl        l       !  \a u   	 0  l      ;              c       	   l       F  d s    	 T  d     	 d  De x   	 t  f     	   `g X    	   g     	 0  Tm                    <h       	   dm        <h z    	   h )    	   h `    	   Di     	   $n         \m Y    	   m     	 !  xn    	 1  p v    	 A  p \    	 P  p     	 ^  n      i              dq       	   n      u  \o <       dq     	   $u [    	   u +    	   Hs    	   t T    	   u 3    	               u       	   o        r        T     	    +    	   w    	   H 
   	    @    	        	    E    	   h     	   P M   	    ]    	   l (   	   ( 5    	   ,     	    +    	 t  |    	   `     	       	         	                       	   s       Xx @        x      '   p %    	   ؓ     	    .    	    O    	   x    	 >   8 6    	 N    J    	   x       ]   L    	 k   X 2    	 v    X    	         	    0     	         	        	     a    	     o   	     !   	    p     	         	 !   5   	 !  0     	   z      !  $ 5    	    5    	        	   \ J    	 1!       	 A!       	   ԕ b    	 S!  į    	 I  p w    	 ^!   >    	 t   #   	 h!  p    	 s!       	 ~!   .    	 !       	 !  `     	        	 !  М     	 !  @    	 !        	 !      	 !  | H    	 !                     	 "                     	 "              x       	 "                     	 ("  z R    1"   1    :"  +     C"  ) W    L"   W    U"  : W    ^"  c W    g"       p"   W    y"  oI <0    "  y 	    "  l     "  I     "  '     "  : =    "  = /    "  m .    "  R P
    "        "   t    "       "        "   9%    #       #  $ ;    #  ' +    "#  S |    ,#  kY     6#  *o 8    @#       J#  P w    T#  ǳ     ^#       h#        r#       |#   R    #  u7 :>    #  u     #       #  9     #  Ѯ &    #   1    #  (     #   [    #  - 
    #  ,     #   $    #  	     #  	 #    $  @	 j    $  V	     $  *	 (    &$  >	 2    0$  K
     :$  -
     D$  <
     N$  X
 ?	    X$  
b
     b$  n
 '    l$  
     v$  M
 j    $  
 x    $  /
     $  
     $  
     $  
     $  s
     $  Z
 H    $  22 /    $  Fa 0    $  vq 4    $   K,    $       $   ]%    %  7 a    %   K	    %        %   y    *%       4%  * =6    >%  gK J+    H%      	 T%             a%    V    	 t%    y   	 %  R V    	 %  X     	 %   $   	 %             %             %   U    	 %             %             &  tP S    	 &             &&        	 5&             K&   h    	 c&    V    	 r&    p    	 &       	 &       	 &             &  Q     	 &  l     	 &        	 &             '    	   	  '      	 ,'             3'             E'  x ;    	 Z'             n'  : =    	 ~'  & ^   	 '             '             '    >    	 '  ܛ  G   	 '        	 '             '  ?      '             '     t    	 (      	 (             6(             C(  d(     	 _(  h .   	 t(   F    	 (   0    	 (             (             (       	 (             (             (             (             )       	 ")   |      +)             :)             M)    /    	 a)         	 t)   k    	 )  |j _    	 )             )             )  p Y    	 )             )        	 )    d    	 )             )        *             *   O    	 '*             5*             B*  < }    	 `*             r*             ~*        	 *             *  d &    	 *             *    1    	 *    D    	 *        	 *       	 +  4V      %+    x    	 ;+      	 P+             \+             i+        	 r+  $  `    	 +       	 +  R t   	 +  H     	 +       	 +             +  P	     	 +  ܚ ^    	 ,             ,             ,    `    	 0,       	 D,             Z,             g,             v,   ] :    	 ,  ܹ     	 ,   a :    	 ,  ,r    	 ,             ,  ( F    	 ,  0' 2   	 ,  i     	 -  l  =    	 -   '    	 %-  DN D     8-             M-  E Y    	 g-             r-    `    	 -             -  7      -   @      -             -             -   2    	 -        	 -  0      	 -             -    o    	 .       	 (.             <.   I    	 O.             a.             k.        	 }.  _    	 .  u    	 .             .             .  Ѕ        .             .  ,  >    	 .  L D     .              /  `? c    	 /   -    	 5/   )    	 H/             Z/  l     	 k/  x W    	 }/             /             /             /             /        	 /             /             /             /    *    	 0             0             00  d  K   	 >0             Q0             d0             q0             y0      	 0        	 0  X  .   	 0             0             0             0             0   E    	 0  @ ;    	 1    M    	 ,1   9    	 <1  p* T    	 Q1  p	    	 \1  8= {    	 u1  L  g    	 1    9    	 1    w    	 1  7      1   5    	 1  Li    	 1  7      1  8      	 1    ]   	 2             2             #2             32             @2             M2    )    	 _2  d  r    	 r2             2             2  d  (    	 2  t  %   	 2             2             2  j    	 2  d{    	 2             3             3             (3             03             I3             ]3             s3    v    	 3  y    	 3             3  8    	 3             3             3             3             3        	 3              4       	 4             4    e    	 (4             84  H D     J4  D  '    	 _4  `  k    	 t4  \      	 4             4        	 4        	 4             4  0O a    	 4  < O    	 5        	  5        	 25  ,!      	 D5  8     	 P5       	 f5             w5    h    	 5   \   	 5  | /    	 5   E    	 5  7      5             5             5             6  lx     	 6             6             -6  G Y    	 D6  D  d    	 W6  |      c6             n6  H      6   m :    	 6             6             6  z     	 6       	 6             6             6  7      7        	 7    '    	 +7    t    	 B7  O      W7             a7    -    	 {7   b    	 7  (      	 7             7             7       	 7  ,     	 7    v    	 8             8             8             "8        	 48    u    	 B8        
 H8  
    	 _8             k8             |8    I   	 8   d    	 8  $      	 8             8             8             8  : I    	 8             8  \     	 9             9             %9             79    *    	 J9             `9      	 p9             9             9       	 9        	 9   Y    	 9  x     	 9  G C    	 9  L!    	 	:   k    	  :  = 4    	 ,:        	 I:             U:   :    	 c:  X  5    	 y:  p      	 :  о    	 :             :        	 :  D      	 :             :             :       	 :        	 ;             !;             5;  D ?   	 L;  8 E    	 ];  н      	 p;  |      w;             ;  v      ;  P      ;       	 ;             ;    e    	 ;             ;  [ r    	 ;             <             <             <             ,<   D    	 ?<             H<  p  t   	 \<  ; 4    	 w<  T     	 <    '    	 <      	 <             <             <    (    	 <  P      	 <             <  8  X    	 =             =    2    	 &=             5=             D=             W=  c :    	 g=             p=  z     	 |=             =  P    	 =             =             =             =             =      	 =  XF e    	 =  lD D     >             +>      	 <>  << |    	 T>    *    	 p>             |>    i    	 >             >   N   	 >        	 >  < P    	 >  x      	 >   I    	 >             ?             ?  L     	 ?  $      	 -?             7?             A?  0 :    	 Q?  l  *    	 f?  Q     	 y?             ~?   a   	 ?               initfini.c gcc2_compiled. crtstuff.c __do_global_ctors_aux __CTOR_END__ init_dummy force_to_data __DTOR_END__ __do_global_dtors_aux __DTOR_LIST__ fini_dummy __CTOR_LIST__ tixClass.c TIX_EMPTY_STRING GetClassByName ClassTableDeleteProc CreateClassByName CreateClassRecord ParseClassOptions InitClass FreeParseOptions SetupMethod SetupSpec SetupAlias InitHashEntries SetupAttribute SetupDefault FreeClassRecord FreeSpec ParseInstanceOptions InitSpec CopySpec InitAlias tixCmds.c inited.48 idleTable EventProc IdleHandler inited.51 mapEventTable MapEventProc ScaleColor NameOfColor results.60 IsOption string.85 tixCompat.c tixError.c tixGeometry.c geoType GeoReqProc GeoLostSlaveProc FreeClientStruct clientTable StructureProc inited.56 tixInit.c commands configSpecs ParseToolkitOptions tixOption globalInitialized.50 maximize_bits.51 act_fold_bits.52 act_fold_xpm.53 balarrow_bits.54 cbxarrow_bits.55 ck_def_bits.56 ck_off_bits.57 ck_on_bits.58 cross_bits.59 decr_bits.60 drop_bits.61 file_bits.62 file_xpm.63 folder_bits.64 folder_foo_xpm.65 harddisk_bits.66 hourglas_bits.67 incr_bits.68 info_xpm.69 minimize_bits.70 minus_bits.71 minus_xpm.72 minusarm_bits.73 minusarm_xpm.74 network_bits.75 no_entry_xpm.76 openfile_bits.77 openfold_bits.78 openfolder_xpm.79 plus_bits.80 plus_xpm.81 plusarm_bits.82 plusarm_xpm.83 resize1_bits.84 resize2_bits.85 restore_bits.86 srcfile_bits.87 srcfile_xpm.88 system_bits.89 textfile_bits.90 textfile_xpm.91 tick_bits.92 warning_xpm.93 Tix_Init_Internal initScript tixItcl.c tixList.c SetNext tixMethod.c Tix_CallMethodByContext MethodTableDeleteProc Tix_SaveContext Tix_RestoreContext Tix_SetContext tixOption.c FormatConfigInfo tixScroll.c tixSmpLs.c simpleListInfo tixUtils.c _format ErrorProc DeleteHashTableProc ReliefParseProc ReliefPrintProc command tixWidget.c ParseOptions tixDItem.c diTypes DItemParseProc DItemPrintProc tixDiITxt.c imageTextItemConfigSpecs imageTextStyleConfigSpecs Tix_ImageTextItemCreate Tix_ImageTextItemConfigure Tix_ImageTextItemCalculateSize Tix_ImageTextItemComponent Tix_ImageTextItemDisplay Tix_ImageTextItemFree Tix_ImageTextItemStyleChanged Tix_ImageTextItemLostStyle Tix_ImageTextStyleCreate Tix_ImageTextStyleConfigure Tix_ImageTextStyleFree Tix_ImageTextStyleSetTemplate ImageProc body.58 bg_flags fg_flags tixDiImg.c imageItemConfigSpecs imageStyleConfigSpecs Tix_ImageItemCreate Tix_ImageItemConfigure Tix_ImageItemCalculateSize Tix_ImageItemComponent Tix_ImageItemDisplay Tix_ImageItemFree Tix_ImageItemStyleChanged Tix_ImageItemLostStyle Tix_ImageStyleCreate Tix_ImageStyleConfigure Tix_ImageStyleFree Tix_ImageStyleSetTemplate tixDiStyle.c tableInited ListDelete counter.50 InitHashTables FindStyle GetDItemStyle StyleConfigure RefWindowStructureProc DeleteStyle subCmdInfo.53 StyleCGetCmd StyleConfigCmd StyleDeleteCmd cmdInfo.54 StyleCmd StyleDestroy StyleCmdDeletedProc styleTable ListDeleteAll FindDefaultStyle defaultTable SetDefaultStyle DefWindowStructureProc ListAdd DItemStyleParseProc DItemStylePrintProc tixDiText.c textItemConfigSpecs textStyleConfigSpecs Tix_TextItemCreate Tix_TextItemConfigure Tix_TextItemCalculateSize Tix_TextItemComponent Tix_TextItemDisplay Tix_TextItemFree Tix_TextItemStyleChanged Tix_TextItemLostStyle Tix_TextStyleCreate Tix_TextStyleConfigure Tix_TextStyleFree Tix_TextStyleSetTemplate body.56 tixDiWin.c mapWinListInfo windowItemConfigSpecs windowStyleConfigSpecs Tix_WindowItemCreate Tix_WindowItemConfigure Tix_WindowItemCalculateSize Tix_WindowItemComponent Tix_WindowItemDisplay Tix_WindowItemFree Tix_WindowItemStyleChanged Tix_WindowItemLostStyle Tix_WindowStyleCreate Tix_WindowStyleConfigure Tix_WindowStyleFree Tix_WindowStyleSetTemplate windowItemGeomType SubWindowRequestProc SubWindowLostSlaveProc SubWindowStructureProc ManageWindow UnmanageWindow body.62 Tix_WindowItemUnmap tixForm.c formType TixFm_ReqProc TixFm_LostSlaveProc initialized ReqSize subCmdInfo.42 TixFm_Check TixFm_SetClient TixFm_Forget TixFm_SetGrid TixFm_Slaves TixFm_Spring TixFm_CheckArgv cmdInfo.43 GetMasterInfo ArrangeWhenIdle TestAndArrange CheckIntergrity PinnClient UnmapClient MapClient ArrangeGeometry CancelArrangeWhenIdle CalculateMasterSize PlaceAllClients PinnSide_AttNone PinnClientSide PinnSide_AttPercent PinnSide_AttOpposite PinnSide_AttParallel MasterStructureProc masterInfoHashTable formInfoHashTable PlaceSide_AttNone PlaceClientSide PlaceSide_AttAbsolute PlaceSide_AttOpposite PlaceSide_AttParallel PlaceSimpleCase AllocSpringLink FreeSpringLink FreeSpringList AddRightSprings AddLeftSprings PlaceWithSpring PlaceClient tixFormMisc.c sideNames.48 padNames.49 AttachInfo ConfigureAttachment ConfigurePadding ConfigureFill ConfigureSpring tixImgCmp.c ImgCmpCreate ImgCmpGet ImgCmpDisplay ImgCmpFree ImgCmpDelete lineConfigSpecs bitmapConfigSpecs imageConfigSpecs spaceConfigSpecs textConfigSpecs ImgCmpCmdDeletedProc ImgCmpCmd ImgCmpConfigureMaster CmpEventProc ChangeImageWhenIdle FreeLine FreeItem tixImgXpm.c ImgXpmCreate ImgXpmGet ImgXpmDisplay ImgXpmFree ImgXpmDelete xpmTableInited ImgXpmCmdDeletedProc ImgXpmCmd ImgXpmConfigureMaster ImgXpmGetData ImgXpmConfigureInstance ImgXpmGetDataFromId ImgXpmGetDataFromFile ImgXpmGetDataFromString xpmTable GetType GetColor ImgXpmGetPixmapFromData tixMwm.c GetMwmInfo SetMwmDecorations IsMwmRunning MwmProtocol SetMwmTransientFor MwmDecor QueryMwmHints RemapWindow RemapWindowWhenIdle AddMwmProtocol ActivateMwmProtocol DeactivateMwmProtocol DeleteMwmProtocol GetMwmProtocol ResetProtocolsWhenIdle ResetProtocols mwmTable inited.72 tixGrid.c entryConfigSpecs Tix_GrDItemSizeChanged WidgetEventProc WidgetCmdDeletedProc WidgetCommand WidgetConfigure subCmdInfo.52 Tix_GrSetSite Tix_GrBdType Tix_GrCGet Tix_GrConfig Tix_GrDelete Tix_GrEntryCget Tix_GrEdit Tix_GrEntryConfig Tix_GrGeometryInfo Tix_GrInfo Tix_GrIndex Tix_GrMove Tix_GrNearest Tix_GrSet Tix_GrUnset Tix_GrView cmdInfo.53 WidgetDestroy Tix_GrFreeRenderBlock RecalScrollRegion WidgetComputeGeometry Tix_GrResetRenderBlocks UpdateScrollBars Tix_GrAllocateRenderBlock WidgetDisplay Tix_GrComputeSelection Tix_GrDisplayMainBody Tix_GrDrawBackground Tix_GrDrawCells Tix_GrDrawSites Tix_GrFindCreateElem ConfigElement Tix_GrPropagateSize Tix_GrFindElem TranslateFromTo GetScrollFractions Tix_GrBBox areaNames Tix_GrCallFormatCmd Tix_GrComputeSubSelection defaultEntry.136 tixGrData.c InitRowCol FindRowCol RowColMaxSize tixGrFmt.c borderConfigSpecs gridConfigSpecs subCmdInfo.48 Tix_GrFormatBorder Tix_GrFormatGrid cmdInfo.49 GetInfo GetBlockPosn GetRenderPosn Tix_GrFillCells Tix_GrSaveColor tixGrRC.c Tix_GrRCSize tixGrSel.c Tix_GrSelModify Tix_GrSelIncludes Intersect Include Tix_GrMergeSelection Tix_GrAdjustSelection tixGrSort.c sortInterp sortMode sortIncreasing sortCode sortCmd SortCompareProc tixGrUtl.c tixHList.c DItemSizeChangedProc SubWindowEventProc AllocElement subCmdInfo.50 Tix_HLAdd Tix_HLAddChild Tix_HLSetSite Tix_HLCGet Tix_HLConfig Tix_HLDelete Tix_HLEntryCget Tix_HLEntryConfig Tix_HLGeometryInfo Tix_HLHide Tix_HLInfo Tix_HLNearest Tix_HLSee Tix_HLSelection Tix_HLShow Tix_HLXView Tix_HLYView cmdInfo.51 NewElement DeleteNode RedrawWhenIdle DeleteOffsprings DeleteSiblings Tix_HLBBox FindNextEntry FindPrevEntry CurSelection FindElementAtPosition Tix_HLSeeElement HL_SelectionClearAll HL_SelectionClear SelectionModifyRange SelectionAdd XScrollByPages XScrollByUnits YScrollByPages YScrollByUnits CancelRedrawWhenIdle FreeElement ComputeElementGeometry AppendList ComputeOneElementGeometry ComputeBranchPosition DrawElements DrawOneElement SelectionNotifyAncestors HL_SelectionClearNotifyAncestors UpdateOneScrollBar CheckScrollBar tixHLCol.c Tix_HLGetColumn Tix_HLItemCGet Tix_HLItemConfig Tix_HLItemCreate Tix_HLItemDelete Tix_HLItemExists subCmdInfo.66 Tix_HLColWidth cmdInfo.67 tixHLInd.c Tix_HLIndCGet Tix_HLIndConfig Tix_HLIndCreate Tix_HLIndDelete Tix_HLIndExists Tix_HLIndSize tixHLHdr.c headerConfigSpecs AllocHeader FreeWindowItem FreeHeader Tix_HLGetHeader subCmdInfo.64 Tix_HLHdrCGet Tix_HLHdrConfig Tix_HLHdrCreate Tix_HLHdrDelete Tix_HLHdrExist Tix_HLHdrSize cmdInfo.65 tixInputO.c inputOnlyAtts Tix_MakeInputOnlyWindowExist tixNBFrame.c tabConfigSpecs AddTab DeleteTab ComputeGeometry FindTab TabConfigure GetTabPoints DrawTab FocusTab tixTList.c entListInfo Tix_TLDItemSizeChanged MakeGeomRequest ResizeWhenIdle Tix_TLSetSite Tix_TLCGet Tix_TLConfig Tix_TLDelete Tix_TLEntryCget Tix_TLEntryConfig Tix_TLGeometryInfo Tix_TLIndex Tix_TLInfo Tix_TLInsert Tix_TLNearest Tix_TLSee Tix_TLSelection Tix_TLView CancelResizeWhenIdle Tix_TLGetFromTo Tix_TLDeleteRange ResizeRows ResizeNow RedrawRows AddElement AllocEntry FreeEntry Tix_TranslateIndex Tix_TLSpecialEntryInfo Tix_TLGetNeighbor Tix_TLGetAt Tix_TLGetNearest Realloc tixUnixDraw.c tixUnixXpm.c tixUnixWm.c tixUnixSam.c script_0 script_1 script_2 script_3 script_4 script_5 script_6 script_7 script_8 script_9 script_10 script_11 script_12 script_13 script_14 script_15 script_16 script_17 script_18 script_19 script_20 script_21 script_22 script_23 script_24 script_25 script_26 script_27 script_28 script_29 script_30 script_31 script_32 script_33 script_34 script_35 script_36 script_37 script_38 script_39 script_40 script_41 script_42 script_43 script_44 script_45 script_46 script_47 script_48 script_49 script_50 script_51 script_52 script_53 script_54 script_55 script_56 script_57 script_58 script_59 script_60 script_61 script_62 script_63 script_64 script_65 script_66 script_67 script_68 script_69 script_70 script_71 script_72 script_73 script_74 script_75 script_76 script_77 script_78 script_79 script_80 LoadScripts Tk_GetPixmap Tix_QueryOneOption Tix_CreateInstanceCmd TixFm_Unlink TixGridDataCreateEntry TixGridDataGetIndex Tk_ImageChanged Tcl_Merge TixpXpmFreeTmpBuffer strcpy Tk_UnmapWindow TixFm_AddToMaster XLowerWindow Tix_TmpLineCmd Tcl_TranslateFileName TixpXpmFreeInstanceData Tix_GetContext TixGetHashTable TixGridDataConfigRowColSize Tixsam_SafeInit Tk_NameOfFont TixFm_FreeMasterInfo Tix_HLComputeHeaderGeometry Tix_GetMethodCmd Tk_InternAtom Tix_DoWhenMappedCmd Tix_GridCmd printf __strtod_internal TixpSubRegDrawBitmap Tcl_BackgroundError Tix_HLResizeNow Tix_HLItemInfo XCopyPlane Tk_GetScrollInfo tixStrDup Tix_ClassCmd Tix_CreateSubWindow XSync tixConfigRelief Tk_ConfigureValue Tix_Exit TixGridDataGetRowColSize Tk_CreateGenericHandler Tk_GetOption Tix_SetDefaultStyleTemplate TixpXpmRealizePixmap Tix_FreeArgumentList Tix_GrFreeElem Tcl_SetAssocData Tcl_PushCallFrame Tix_GetChars Tk_Fill3DPolygon XSetClipRectangles Tcl_AddErrorInfo Tcl_EventuallyFree TixDItemGetAnchor _DYNAMIC Tk_DeleteImage Tk_Fill3DRectangle Tix_DrawAnchorLines TixSaveInterpState TixGridDataFindEntry Tix_HLFreeHeaders XDestroyImage __ctype_b Tix_GrDoWhenIdle getenv Tix_CallConfigMethod Tix_GetDItemType Tk_FreeFont _etext Tk_NameOfImage Tix_ConfigureValue2 Tk_FreeBitmap XRaiseWindow Tix_UnmapInvisibleWindowItems __strtol_internal Tcl_Release Tix_SimpleListInit qsort Tix_DItemComponent Tk_UnderlineTextLayout Tix_LinkListNext Tix_CreateCommands Tix_LinkListDeleteRange Tix_HandleOptionsCmd tixPixmapImageType Tix_GetMethodFullName Tix_WidgetConfigure2 _IO_stderr_ Tcl_Preserve Tix_Init Tix_MapWindowCmd Tix_GrAddChangedRect TixFm_GetFormInfo Tix_HLMarkElementDirty Tix_InstanceCmd XRootWindow Tix_GrFreeSortItems TixMwmProtocolHandler Tk_RedrawImage malloc Tix_UnmapWindowCmd TixpSubRegDrawImage Tk_CreateEventHandler XCreateImage Tcl_DoOneEvent Tix_HLItem TixpDrawAnchorLines Tix_HLColumn Tix_InputOnlyCmd Tcl_PkgRequire Tix_GrCancelDoWhenIdle TixGetDefaultDItemStyle Tix_HLCreateHeaders TixLoadLibrary Tix_AddDItemType tix_WindowItemType Tk_ComputeTextLayout TixFm_FindClientPtrByName XQueryTree Tix_FlushXCmd XFreeGC tixRowUid tixConfigItemType XCopyArea ___brk_addr TixpInitPixmapInstance Tix_FindMethod Tix_LinkListInit Tk_FontId Tix_LinkListFindAndDelete Tix_ChainMethodCmd Tk_MaintainGeometry TixGrDataFirstCell Tcl_AppendElement __environ Tix_ChangeOptions TixFm_Info Tix_NoteBookFrameCmd Tk_MainWindow XPutPixel _init Tcl_GetAssocData Tix_SafeInit tix_TextItemType Tk_UnmaintainGeometry TixFm_ForgetOneClient TixGridDataDeleteSearchedEntry Tix_DItemConfigure Tk_DrawTextLayout Tix_DefinePixmap Tix_GrGetCellText Tk_GetImage strrchr Tcl_PopCallFrame Tcl_SetResult Tix_LinkListInsert Tcl_GetBoolean Tcl_GetCommandName Tcl_NextHashEntry Tix_SimpleListAppend Tk_3DBorderGC Tk_DeleteEventHandler Tix_GetIntCmd Tk_GetColorByValue Tk_Draw3DRectangle Tk_GetPixels fprintf Tix_HListCmd Tix_SuperClass Tix_SetScrollBarView Tk_NameOfColor Tk_CreateImageType Tk_ConfigureWidget Tcl_UnsetVar2 TixGrDataNextCell TixpSubRegDisplayText TixItclSetGlobalNameSp Tix_DItemCreate TixDItemStyleChanged Tix_GrSort Tix_WindowItemListRemove Tix_LinkListAppend TixComputeTextGeometry TixpXpmDisplay tixNormalUid Tix_DItemDisplay TixFm_Configure tixDisabledUid Tix_GlobalVarEval Tix_DoWhenIdleCmd XFree Tcl_SplitList Tcl_DStringFree Tk_GetBitmap Tcl_UnsetVar Tix_SetRcFileName Tix_InitScrollInfo XGetWindowProperty Tcl_InitHashTable Tix_TrueCmd Tix_FindConfigSpecByName read Tk_DrawFocusHighlight Tix_HLDrawHeader AddNewText Tk_SetBackgroundFromBorder Tcl_GlobalEval Tcl_SetVar strncmp Tcl_DStringAppendElement Tcl_DeleteHashTable TkWmProtocolEventProc TixDisplayText AddNewBitmap strncpy Tix_HLComputeGeometry XChangeProperty strcasecmp Tcl_DStringAppend Tcl_GetCommandInfo TixInitSam realloc Tix_StringSubCmd panic Tix_LinkListFind Tcl_ResetResult tix_ImageItemType Tix_SimpleListDelete Tix_FindPublicMethod Tix_GrFreeUnusedColors Tcl_GetDouble TixRestoreInterpState Tix_SimpleListIteratorInit Tcl_DeleteHashEntry TixFm_StructureProc Tix_ConfigureInfo2 TixItclRestoreGlobalNameSp Tix_CallMethodCmd TixDItemStyleFree Tix_FileCmd TixpXpmAllocTmpBuffer Tk_GetRootCoords Tix_StrEqCmd TixGridDataMoveRange TixpSubRegFillRectangle TixGrDataFirstRow tixColumnUid Tcl_GetVar Tk_CreateWindowFromPath Tk_FreeTextLayout AddNewLine Tk_MapWindow Tk_SizeOfBitmap Tix_HLElementTopOffset Tix_RaiseWindowCmd __bss_start Tk_GetFont tixConfigItemStyle Tix_HLHeader Tk_ConfigureInfo Tcl_AppendResult AddNewImage TixGridDataSetFree Tcl_CreateNamespace Tcl_DStringSetLength tixCellUid Tix_QueryAllOptions Tix_SimpleListStart Tix_GetScrollFractions tixCompoundImageType XDrawLine Tix_SimpleListDeleteRange Tix_DItemDrawBackground Tix_LinkListDelete Tcl_DeleteCommand Tk_MakeWindowExist TixpDrawTmpLine TixGridDataDeleteEntry Tix_GetRenderBuffer strcmp Tk_GetUid Tcl_GetInt Tix_GetBooleanCmd Tix_ArgcError _fini Tix_MultiConfigureInfo XDrawPoints Tk_Draw3DPolygon Tix_ChangeOneOption Tix_GrFormat Tix_ExistMethod sprintf Tcl_FirstHashEntry atexit Tix_HLResizeWhenIdle Tk_FreePixmap Tix_HandleSubCmds Tk_DestroyWindow Tk_NameToWindow Tcl_CreateCommand Tix_SimpleListFind Tk_CreateErrorHandler Tix_SplitConfig Tk_SizeOfImage Tk_IdToWindow Tix_ManageGeometryCmd Tix_LinkListIteratorInit TixpXpmSetPixel TixpSetWindowParent Tix_HLElementLeftOffset Tix_ItemStyleCmd TixpStartSubRegionDraw Tix_FormCmd Tix_UnknownPublicMethodError Tcl_GetVar2 Tix_GrSetSize Tix_ValueMissingError Tix_EvalArgv Tix_GrGetElementPosn XFlush Tix_ParentWindow Tix_DItemCalculateSize XCreateWindow Tk_DefineBitmap TixGetColorDItemGC Tix_GeometryRequestCmd Tcl_DoWhenIdle Tcl_CallWhenDeleted TixGridDataDeleteRange TixGrDataNextRow Tix_Get3DBorderCmd _edata Tk_FreeColor _GLOBAL_OFFSET_TABLE_ _end Tix_GrGetSortItems XDrawRectangle Tix_UninitializedClassCmd Tcl_Eval Tix_HLAllocColumn XSetClipOrigin Tk_Free3DBorder exit Tk_ManageGeometry TixGridDataSetInit __fxstat Tix_CreateWidgetCmd Tix_HLCancelResizeWhenIdle TixGridDataGetGridSize Tix_SimpleListNext Tix_MwmCmd Tk_3DBorderColor Tk_FreeOptions Tix_FalseCmd Tix_MoveResizeWindowCmd Tk_SetClass Tix_GetVar Tcl_SetVar2 Tix_LinkListStart Tcl_PosixError XFillRectangle Tcl_CancelIdleCall Tix_HLIndicator Tk_GetGC AddNewSpace open TixFm_UnlinkFromMaster Tk_MoveResizeWindow Tcl_DStringInit Tk_FreeImage Tk_GeometryRequest Tix_GrScrollPage Tix_HLFindElement tix_ImageTextItemType Tk_DeleteErrorHandler Tix_GrConfigSize Tix_SetWindowItemSerial Tix_SimpleListFindAndDelete Tk_GetColor Tix_GetConfigSpecFullName XPutImage TixGridDataUpdateSort Tix_LoadTclLibrary Tixsam_Init Tix_CallMethod TixpEndSubRegionDraw Tcl_VarEval close Tix_UpdateScrollBar Tix_DItemFree XCreateGC Tk_FreeGC Tix_GrSelection Tix_SimpleListInsert TixFm_DeleteMaster free Tix_TListCmd __gmon_start__ 