home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1995 August / NEBULA.bin / SourceCode / Palettes / ConnectDemo / EDBConnectInspector.m < prev    next >
Encoding:
Text File  |  1993-04-18  |  15.8 KB  |  689 lines

  1.  
  2. #import "EDBConnectInspector.h"
  3. #import "EDBConnector.h"
  4. #import "ConnectBrowserCell.h"
  5. #import "MColCell.h"
  6. #import "EDBOutlet.h"
  7. #import <assert.h>
  8.  
  9. #define    NOLDEBUG
  10.  
  11. static    EDBConnectInspector        *onlyInspector = nil;
  12.  
  13. static int    sortFunction(id *ob1,id *ob2)
  14. {
  15.     int        ret = strcmp([*ob1 outletName],[*ob2 outletName]);
  16.  
  17.     if (!ret)
  18.         ret = [*ob1 sequence]-[*ob2 sequence];
  19.     return ret;
  20. }
  21.  
  22. @implementation EDBConnectInspector
  23.  
  24. + obtainEDBConnectInspector
  25. {
  26.     if (onlyInspector != nil)
  27.         return onlyInspector;
  28.     return (onlyInspector=[[[self class] alloc] init]);
  29. }
  30.  
  31. - init
  32. {
  33.     char            buf [MAXPATHLEN + 1];
  34.     NXBundle        *bundle;
  35.     NXSize            size,size1;
  36.     NXSplitView        *splitView;
  37.     NXRect            splitFrame;
  38.     NXImage            *image;
  39.     MColCell        *mcell;
  40.  
  41. #ifdef LDEBUG
  42.     fprintf(stderr,"%s init\n",[self name]);
  43. #endif
  44.  
  45.     if (onlyInspector && [self class]==[EDBConnectInspector class])
  46.     {
  47.         [super free];
  48.         return onlyInspector;
  49.     }
  50.  
  51.     if (![super init])
  52.         return nil;
  53.  
  54.     bundle = [NXBundle bundleForClass:[self class]];
  55.     [bundle getPath:buf
  56.             forResource:"EDBConnectInspector"
  57.             ofType:"nib"];
  58.     if (![NXApp loadNibFile:buf owner:self withNames:NO fromZone:[self zone]])
  59.     {
  60.         [super free];
  61.         return nil;
  62.     }
  63.  
  64.     [[window contentView] getBounds:&splitFrame];
  65.     splitView = [[NXSplitView alloc] initFrame:&splitFrame];
  66.     [splitView setDelegate:self];
  67.     [upperBox removeFromSuperview];
  68.     [lowerBox removeFromSuperview];
  69.     [splitView addSubview:upperBox];
  70.     [splitView addSubview:lowerBox];
  71.     [[window contentView] addSubview:splitView];
  72.     [splitView display];
  73.     [lowerBox getBounds:&splitFrame];
  74.     minHeight = splitFrame.size.height;
  75.  
  76.     connections = [[ExtList alloc] init];
  77.  
  78.     mcell = [[MColCell alloc] init];
  79.     [mcell addColWithOffset:0];
  80.     [mcell addColWithOffset:150];
  81.     [connectMatrix setPrototype:mcell];
  82.     [connectMatrix getCellSize:&size];
  83.     size.width = 300;
  84.     [connectMatrix setCellSize:&size];
  85.     [connectMatrix addCol];
  86.     [connectMatrix setMode:NX_RADIOMODE];
  87.     [connectMatrix setEmptySelectionEnabled:YES];
  88.  
  89.     [outletBrowser setDoubleAction:@selector(doubleClickOutlet:)];
  90.     [outletBrowser setCellClass:[ConnectBrowserCell class]];
  91.  
  92.     [actionMatrix setTarget:self];
  93.     [actionMatrix setAction:@selector(clickAction:)];
  94.     [actionMatrix setCellClass:[TextFieldCell class]];
  95.     [actionMatrix getCellSize:&size];
  96.     [actionScrollView getContentSize:&size1];
  97.     size.width = size1.width;
  98.     [actionMatrix setCellSize:&size];
  99.     [actionMatrix addCol];
  100.     [actionMatrix sizeToCells];
  101.     [[actionMatrix cellAt:0:0] setSelectable:YES];
  102.     [[actionMatrix cellAt:0:0] setEditable:YES];
  103.  
  104.     bundle = [NXBundle bundleForClass:[self class]];
  105.     [bundle getPath:buf
  106.             forResource:"EDBdimple_nib"
  107.             ofType:"tiff"];
  108.     image = [[NXImage alloc] initFromFile:buf];
  109.     [image setName:"EDBdimple_nib"];
  110.     [bundle getPath:buf
  111.             forResource:"EDBdimpleH_nib"
  112.             ofType:"tiff"];
  113.     image = [[NXImage alloc] initFromFile:buf];
  114.     [image setName:"EDBdimpleH_nib"];
  115.  
  116.     outletCount = 0;
  117.     outlets = NULL;
  118.  
  119.     refreshOnRevert = YES;
  120.  
  121.     onlyInspector = self;
  122.     return self;
  123. }
  124.  
  125. - free
  126. {
  127.     [connections free];
  128.     [outlets free];
  129.     if (self == onlyInspector)
  130.         onlyInspector = nil;
  131.     return [super free];
  132. }
  133.  
  134. - revert:sender
  135. {
  136. #ifdef LDEBUG
  137.     fprintf(stderr,"%s revert:\n",[self name]);
  138. #endif
  139.  
  140.     if (!refreshOnRevert)
  141.     {
  142.         refreshOnRevert = YES;
  143.         return [super revert:sender];
  144.     }
  145.  
  146.     outlets = [object getOutlets];
  147.     outletCount = [outlets count];
  148.     [self getConnections:connections];
  149.     [self displayConnections:connections];
  150.     [outletBrowser loadColumnZero];
  151.     [self selectOutlet];
  152.  
  153.     return [super revert:sender];
  154. }
  155.  
  156. - ok:sender
  157. {
  158.     NXAtom        outletName = NXUniqueString([[[outletBrowser matrixInColumn:0]
  159.                                             selectedCell] stringValue]);
  160.     int            count = [connections count];
  161.     int            ind;
  162.     id            connector;
  163.     int            outletNr;
  164.     id            matrix = [outletBrowser matrixInColumn:0];
  165.  
  166. #ifdef LDEBUG
  167.     fprintf(stderr,"%s ok\n",[self name]);
  168. #endif
  169.  
  170.     if (![NXApp isConnecting])
  171.         return self;
  172.  
  173.     outletNr = [[outletBrowser matrixInColumn:0] selectedRow];
  174.     ind = [connectMatrix selectedRow];
  175.     if (ind>=0 && ind<count)        // remove Connection
  176.     {
  177.         connector = [connections objectAt:ind];
  178.         [[NXApp activeDocument] removeConnector:connector];
  179.         [connections removeObjectAt:ind];
  180.         if ([[outlets objectAt:outletNr] multiUse])
  181.             [self removeSequenceNumberOf:connector];
  182.         [connector free];
  183.         [self displayConnections:connections];
  184.         if (![[outlets objectAt:outletNr] multiUse] &&
  185.             ![[outlets objectAt:outletNr] isTarget])
  186.         {
  187.             matrix = [outletBrowser matrixInColumn:0];
  188.             [self outletAt:[matrix selectedCell] inMatrix:matrix
  189.                 setConnected:NO andDisplay:YES];
  190.         }
  191.         [connectMatrix selectCellAt:-1:-1];
  192.         [okButton setTitle:"Connect"];
  193.     }
  194.     else                        // add Connection
  195.     {
  196.         connector = [self createConnectorForOutlet:outletName withNr:outletNr
  197.             andSel:([[outlets objectAt:outletNr] isTarget]) ?
  198.                 [[actionMatrix cellAt:0:0] stringValue] : NULL];
  199. #ifdef LDEBUG
  200.     fprintf(stderr,"%s createConnector: source=%lx (%s),dest=%lx (%s),"
  201.         "outlet=%s,sel=%s\n",[self name],(u_long)[NXApp connectSource],
  202.         [[NXApp connectSource] name],(u_long)[NXApp connectDestination],
  203.         [[NXApp connectDestination] name],outletName,[connector selName]);
  204. #endif
  205.         ind = [connections insertOrdered:connector usingFunc:
  206.             (SortFunc *)sortFunction];
  207.         [[NXApp activeDocument] addConnector:connector];
  208.         [self displayConnections:connections];
  209.         if (![[outlets objectAt:outletNr] multiUse] &&
  210.             ![[outlets objectAt:outletNr] isTarget])
  211.             [self outletAt:[matrix selectedCell] inMatrix:matrix
  212.                 setConnected:YES andDisplay:YES];
  213.         [connectMatrix selectCellAt:ind:0];
  214.         [okButton setTitle:"Disonnect"];
  215.     }
  216.  
  217.     return self;
  218. }
  219.  
  220. - createConnectorForOutlet:(NXAtom)outletName withNr:(int)outletNr
  221.     andSel:(const char *)sel
  222. {
  223.     id        connector;
  224.  
  225.     connector = [[EDBConnector alloc] initWithSource:
  226.         [NXApp connectSource] andDestination:[NXApp connectDestination]
  227.         forOutlet:outletName andSel:sel];
  228.     if ([[outlets objectAt:outletNr] multiUse])
  229.         [self setSequenceNumberFor:connector];
  230.  
  231.     return connector;
  232. }
  233.  
  234. - (BOOL)wantsButtons
  235. {
  236. #ifdef LDEBUG
  237.     fprintf(stderr,"%s wantsButtons\n",[self name]);
  238. #endif
  239.  
  240.     return YES;
  241. }
  242.  
  243. - outletAt:cell inMatrix:matrix setConnected:(BOOL)flag andDisplay:(BOOL)disp
  244. {
  245.     if (flag)
  246.     {
  247.         [cell setBranchImage:[NXImage findImageNamed:"EDBdimple_nib"]];
  248.         [cell setBranchImageH:[NXImage findImageNamed:"EDBdimpleH_nib"]];
  249.     }
  250.     else
  251.     {
  252.         [cell setBranchImage:nil];
  253.         [cell setBranchImageH:nil];
  254.     }
  255.  
  256.     if (disp)
  257.         [matrix drawCell:cell];
  258.  
  259.     return self;
  260. }
  261.  
  262. - setSequenceNumberFor:connector
  263. {
  264.     NXAtom    outletName = [connector outletName];
  265.     int        ind;
  266.     int        count = [connections count];
  267.     int        maxNum;
  268.  
  269.     for (ind=maxNum=0; ind<count; ind++)
  270.     {
  271.         if (outletName==[[connections objectAt:ind] outletName] &&
  272.             [[connections objectAt:ind] sequence]>maxNum)
  273.             maxNum = [[connections objectAt:ind] sequence];
  274.     }
  275.  
  276.     [connector setSequence:maxNum+1];
  277.     return self;
  278. }
  279.  
  280. - removeSequenceNumberOf:connector
  281. {
  282.     NXAtom    outletName = [connector outletName];
  283.     int        ind;
  284.     int        count = [connections count];
  285.     int        seqNum = [connector sequence];
  286.     int        k;
  287.  
  288.     for (ind=0; ind<count; ind++)
  289.     {
  290.         if (outletName==[[connections objectAt:ind] outletName] &&
  291.             (k=[[connections objectAt:ind] sequence])>seqNum)
  292.             [[connections objectAt:ind] setSequence:k-1];
  293.     }
  294.  
  295.     return self;
  296. }
  297.  
  298. - clickAction:sender
  299. {
  300. #ifdef LDEBUG
  301.     fprintf(stderr,"%s clickAction:\n",[self name]);
  302. #endif
  303.  
  304.     [okButton performClick:self];
  305.     return self;
  306. }
  307.  
  308. - clickConnection:sender
  309. {
  310.     int        count = [connections count];
  311.     int        ind = [sender selectedRow];
  312.     int        outletInd;
  313.  
  314. #ifdef LDEBUG
  315.     fprintf(stderr,"%s clickConnection:\n",[self name]);
  316. #endif
  317.  
  318.     assert(ind<count);
  319.  
  320.     [NXApp displayConnectionBetween:[[connections objectAt:ind] source] and:
  321.         [[connections objectAt:ind] destination]];
  322.     refreshOnRevert = NO;
  323.     outletInd = [self indexOfOutlet:[[connections objectAt:ind] outletName]];
  324.     [[outletBrowser matrixInColumn:0] selectCellAt:outletInd:0];
  325.     [self fillTargetMatrixForConnection:[connections objectAt:ind]
  326.         andOutlet:outletInd];
  327.     [okButton setEnabled:YES];
  328.     [okButton setTitle:"Disconnect"];
  329.  
  330.     return self;
  331. }
  332.  
  333. - fillTargetMatrixForConnection:connection andOutlet:(int)outletInd
  334. {
  335.     if (outletInd>=0 && outletInd<outletCount &&
  336.         [[outlets objectAt:outletInd] isTarget])
  337.     {
  338.         [[actionMatrix cellAt:0:0] setStringValue:[connection selName]];
  339.         [actionMatrix setEnabled:YES];
  340.         [actionMatrix selectCellAt:0:0];
  341.     }
  342.     else
  343.     {
  344.         [[actionMatrix cellAt:0:0] setStringValueNoCopy:""];
  345.         [actionMatrix setEnabled:NO];
  346.     }
  347.  
  348.     return self;
  349. }
  350.  
  351. - clickOutlet:sender
  352. {
  353.     NXAtom        outletName = NXUniqueString([[[sender matrixInColumn:0]
  354.                                             selectedCell] stringValue]);
  355.     int            count = [connections count];
  356.     int            ind;
  357.     int            outletNr;
  358.  
  359. #ifdef LDEBUG
  360.     fprintf(stderr,"%s clickOutlet:\n",[self name]);
  361. #endif
  362.  
  363.     outletNr = [[sender matrixInColumn:0] selectedRow];
  364.     for (ind=0; ind<count &&
  365.         [[connections objectAt:ind] outletName]!=outletName; ind++);
  366.     if (![[outlets objectAt:outletNr] multiUse] && ind<count)
  367.     {
  368.         [NXApp displayConnectionBetween:[[connections objectAt:ind] source]
  369.             and:[[connections objectAt:ind] destination]];
  370.         refreshOnRevert = NO;
  371.         [okButton setTitle:"Disconnect"];
  372.         [okButton setEnabled:YES];
  373.         [connectMatrix selectCellAt:ind:0];
  374.         [self fillTargetMatrixForConnection:[connections objectAt:ind]
  375.             andOutlet:outletNr];
  376.     }
  377.     else
  378.     {
  379.         [okButton setTitle:"Connect"];
  380.         [okButton setEnabled:[NXApp isConnecting]];
  381.         [connectMatrix selectCellAt:-1:-1];
  382.         [self fillTargetMatrixForConnection:nil andOutlet:outletNr];
  383.     }
  384.  
  385.     return self;
  386. }
  387.  
  388. - doubleClickOutlet:sender
  389. {
  390. #ifdef LDEBUG
  391.     fprintf(stderr,"%s doubleClickOutlet:\n",[self name]);
  392. #endif
  393.  
  394.     [okButton performClick:self];
  395.     return self;
  396. }
  397.  
  398. - getConnections:list
  399. {
  400. #ifdef LDEBUG
  401.     fprintf(stderr,"%s getConnections:\n",[self name]);
  402. #endif
  403.  
  404.     [[NXApp activeDocument] listConnectors:list forSource:object];
  405.     [list sortUsingFunc:(SortFunc *)sortFunction];
  406.  
  407.     return self;
  408. }
  409.  
  410. - displayConnections:list
  411. {
  412.     int            count = [list count];
  413.     int            rows,cols;
  414.     char        name    [256];
  415.     const char    *p;
  416.     int            outletInd;
  417.  
  418. #ifdef LDEBUG
  419.     fprintf(stderr,"%s displayConnections\n",[self name]);
  420. #endif
  421.  
  422.     [connectMatrix getNumRows:&rows numCols:&cols];
  423.     for (rows--; rows>=0; rows--)
  424.         [connectMatrix removeRowAt:rows andFree:YES];
  425.  
  426.     for (rows=0; rows<count; rows++)
  427.     {
  428.         [connectMatrix addRow];
  429.         outletInd = [self indexOfOutlet:[[list objectAt:rows] outletName]];
  430.         if (outletInd>=0 && [[outlets objectAt:outletInd] multiUse])
  431.         {
  432.             sprintf(name,"%s-%03d",
  433.                 [[outlets objectAt:outletInd] outletName],
  434.                 [[list objectAt:rows] sequence]);
  435.             [[connectMatrix cellAt:rows:0] setStringValue:name
  436.                 at:0 copy:YES];
  437.         }
  438.         else
  439.             [[connectMatrix cellAt:rows:0] setStringValue:
  440.                 [[list objectAt:rows] outletName] at:0 copy:NO];
  441.         [[NXApp activeDocument] getNameIn:name
  442.             for:[[list objectAt:rows] destination]];
  443.         if (name[0] == '\0')
  444.         {
  445.             p = [[[list objectAt:rows] destination] name];
  446.             if (p == NULL)
  447.                 p = "First Responder";
  448.             [[connectMatrix cellAt:rows:0] setStringValue:p at:1 copy:YES];
  449.         }
  450.         else
  451.             [[connectMatrix cellAt:rows:0] setStringValue:name at:1 copy:YES];
  452.     }
  453.  
  454.     [connectMatrix sizeToCells];
  455.     [connectScrollView display];
  456.  
  457.     return self;
  458. }
  459.  
  460. - selectOutlet
  461. {
  462.     int            count = [connections count];
  463.     int            ind;
  464.     id            dest = [NXApp connectDestination];
  465.     int            outletNr;
  466.  
  467.     [revertButton setEnabled:NO];
  468.  
  469.     if ([NXApp isConnecting])
  470.     {
  471.         [okButton setEnabled:YES];
  472.         for (ind=0; ind<count &&
  473.             [[connections objectAt:ind] destination]!=dest; ind++);
  474.         if (ind < count)            // Connection line for existing Connection
  475.         {
  476.             outletNr = [self indexOfOutlet:[[connections objectAt:ind]
  477.                 outletName]];
  478.             [[outletBrowser matrixInColumn:0] selectCellAt:outletNr:0];
  479.             [connectMatrix selectCellAt:ind:0];
  480.             [okButton setTitle:"Disconnect"];
  481.             [self fillTargetMatrixForConnection:[connections objectAt:ind]
  482.                 andOutlet:outletNr];
  483.         }
  484.         else                        // Select next free outlet
  485.         {
  486.             outletNr = [self indexOfFirstFreeOutlet];
  487.             [[outletBrowser matrixInColumn:0] selectCellAt:outletNr:0];
  488.             [connectMatrix selectCellAt:-1:-1];
  489.             [okButton setTitle:"Connect"];
  490.             [self fillTargetMatrixForConnection:nil andOutlet:outletNr];
  491.         }
  492.     }
  493.     else
  494.     {
  495.         [okButton setEnabled:NO];
  496.         [okButton setTitle:"Connect"];
  497.         [self fillTargetMatrixForConnection:nil andOutlet:-1];
  498.     }
  499.  
  500.     return self;
  501. }
  502.  
  503. - (int)indexOfOutlet:(NXAtom)name
  504. {
  505.     int                ind;
  506.  
  507. #ifdef LDEBUG
  508.     fprintf(stderr,"%s indexOfOutlet:%s\n",[self name],name);
  509. #endif
  510.  
  511.     for (ind=0; ind<outletCount; ind++)
  512.     {
  513.         if ([[outlets objectAt:ind] outletName] == name)
  514.             return ind;
  515.     }
  516.  
  517.     return -1;
  518. }
  519.  
  520. - (int)indexOfFirstFreeOutlet
  521. {
  522.     int                ind;
  523.     int                indConns;
  524.     int                countConns = [connections count];
  525.  
  526. #ifdef LDEBUG
  527.     fprintf(stderr,"%s indexOfFirstFreeOutlet\n",[self name]);
  528. #endif
  529.  
  530.     for (ind=0; ind<outletCount; ind++)
  531.     {
  532.         if ([[outlets objectAt:ind] multiUse])
  533.             return ind;
  534.         for (indConns=0; indConns<countConns &&
  535.             [[connections objectAt:indConns] outletName]!=
  536.             [[outlets objectAt:ind] outletName]; indConns++);
  537.         if (indConns >= countConns)
  538.             return ind;
  539.     }
  540.  
  541.     return -1;
  542. }
  543.  
  544. - (BOOL)outletIsConnected:(int)ind
  545. {
  546.     int                indConns;
  547.     int                countConns = [connections count];
  548.  
  549. #ifdef LDEBUG
  550.     fprintf(stderr,"%s outletIsConnected\n",[self name]);
  551. #endif
  552.  
  553.     if ([[outlets objectAt:ind] multiUse])
  554.         return NO;
  555.  
  556.     for (indConns=0; indConns<countConns &&
  557.         [[connections objectAt:indConns] outletName]!=
  558.         [[outlets objectAt:ind] outletName]; indConns++);
  559.     if (indConns >= countConns)
  560.         return NO;
  561.  
  562.     return YES;
  563. }
  564.  
  565. - outletAddedToObject:sender
  566. {
  567.     if (object != sender)
  568.         return self;
  569.  
  570.     [self revert:self];
  571.     return self;
  572. }
  573.  
  574. - outlet:(NXAtom)name removedFromObject:sender
  575. {
  576.     List    *conns;
  577.     int        count,
  578.             ind;
  579.     id        connector;
  580.  
  581.     if (object != sender)
  582.         return self;
  583.  
  584.     conns = [[List alloc] initCount:[connections count]];
  585.     [[NXApp activeDocument] listConnectors:conns forSource:object];
  586.     count = [conns count];
  587.     for (ind=0; ind<count; ind++)
  588.     {
  589.         connector = [conns objectAt:ind];
  590.         if ([connector outletName] == name)
  591.         {
  592.             [[NXApp activeDocument] removeConnector:connector];
  593.             [connector free];
  594.         }
  595.     }
  596.  
  597.     [self revert:self];
  598.     [conns free];
  599.     return self;
  600. }
  601.  
  602. - outletOfObject:sender renamedFrom:(NXAtom)from to:(NXAtom)to
  603. {
  604.     List    *conns;
  605.     int        count,
  606.             ind;
  607.     id        connector;
  608.  
  609.     if (object != sender)
  610.         return self;
  611.  
  612.     conns = [[List alloc] initCount:[connections count]];
  613.     [[NXApp activeDocument] listConnectors:conns forSource:object];
  614.     count = [conns count];
  615.     for (ind=0; ind<count; ind++)
  616.     {
  617.         connector = [conns objectAt:ind];
  618.         if ([connector outletName] == from)
  619.             [connector setOutletName:to];
  620.     }
  621.  
  622.     [self revert:self];
  623.     [conns free];
  624.     return self;
  625. }
  626.  
  627. - (int)browser:sender fillMatrix:matrix inColumn:(int)column
  628. {
  629.     int                indOuts;
  630.     int                countConns = [connections count];
  631.     int                indConns;
  632.  
  633. #ifdef LDEBUG
  634.     fprintf(stderr,"%s browser:fillMatrix:inColumn:%d\n",[self name],column);
  635. #endif
  636.  
  637.     for (indOuts=0; indOuts<outletCount; indOuts++)
  638.     {
  639.         [matrix addRow];
  640.         [[matrix cellAt:indOuts:0] setStringValueNoCopy:
  641.             [[outlets objectAt:indOuts] outletName]];
  642.         [[matrix cellAt:indOuts:0] setLoaded:YES];
  643.         [[matrix cellAt:indOuts:0] setLeaf:YES];
  644.         if ([[outlets objectAt:indOuts] isTarget])
  645.         {
  646.             [[matrix cellAt:indOuts:0] setBranchImage:
  647.                 [NXImage findImageNamed:"NXmenuArrow"]];
  648.             [[matrix cellAt:indOuts:0] setBranchImageH:
  649.                 [NXImage findImageNamed:"NXmenuArrowH"]];
  650.         }
  651.         for (indConns=0; indConns<countConns &&
  652.             [[connections objectAt:indConns] outletName]!=
  653.                 [[outlets objectAt:indOuts] outletName];
  654.             indConns++);
  655.         if (![[outlets objectAt:indOuts] multiUse] && indConns<countConns)
  656.         {
  657.             if (![[outlets objectAt:indOuts] isTarget])
  658.                 [self outletAt:[matrix cellAt:indOuts:0] inMatrix:matrix
  659.                     setConnected:YES andDisplay:NO];
  660.             else
  661.             {
  662.                 [[actionMatrix cellAt:0:0] setStringValue:
  663.                     [[connections objectAt:indConns] selName]];
  664.                 [actionMatrix selectTextAt:0:0];
  665.             }
  666.         }
  667.     }
  668.  
  669.     [matrix sizeToCells];
  670.     return outletCount;
  671. }
  672.  
  673. - splitView:sender getMinY:(NXCoord *)minY maxY:(NXCoord *)maxY
  674.   ofSubviewAt:(int)offset
  675. {
  676.    NXRect    rect;
  677.    
  678.     offset = 0; 
  679.     [sender getBounds:&rect];
  680.     *minY = minHeight;
  681.     *maxY = rect.size.height - minHeight;
  682.     if (*maxY < minHeight)
  683.         *maxY = minHeight;
  684.  
  685.     return self;
  686. }
  687.  
  688. @end
  689.