home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 10 / ioProg_10.iso / soft / optima / samples.z / form1.bak < prev    next >
Encoding:
Text File  |  1996-05-06  |  33.8 KB  |  1,655 lines

  1. Save Format v1.3
  2. @begin Form "Form1"
  3.  Exported 0;
  4.  
  5.  @begin Object "WModelessDialog"
  6.   WSCaption 1;
  7.   WSClipSiblings 1;
  8.   WSSizeable 1;
  9.   WSDlgBorder 1;
  10.   WSSysMenu 1;
  11.   WSSystemMenu 1;
  12.   WSMinimizeBox 1;
  13.   WSGroup 1;
  14.   WSResizeBorder 1;
  15.   WSExAcceptDropFile 1;
  16.   WSExAcceptFiles 1;
  17.   WSExWindowEdge 1;
  18.   WSVisible 1;
  19.   FormPositionType "Centered";
  20.   Font "8.MS Sans Serif";
  21.   Text "Tiles Game";
  22.   @begin Event "Close"
  23.    GencodeSrcLine 312;
  24.    FunctionName "Form1::Form1_Close";
  25.   @end;
  26.   @begin Event "Create"
  27.    GencodeSrcLine 322;
  28.    FunctionName "Form1::Form1_Create";
  29.   @end;
  30.   @begin Event "Destroy"
  31.    GencodeSrcLine 364;
  32.    FunctionName "Form1::Form1_Destroy";
  33.   @end;
  34.   @begin Event "EraseBackground"
  35.    GencodeSrcLine 369;
  36.    FunctionName "Form1::Form1_EraseBackground";
  37.   @end;
  38.   @begin Event "Paint"
  39.    GencodeSrcLine 381;
  40.    FunctionName "Form1::Form1_Paint";
  41.   @end;
  42.   @begin UserFunction "Continue()"
  43.    GencodeSrcLine 393;
  44.    FunctionName "Form1::Continue()";
  45.   @end;
  46.   @begin UserFunction "GetPosition()"
  47.    GencodeSrcLine 403;
  48.    FunctionName "Form1::GetPosition()";
  49.   @end;
  50.   @begin UserFunction "StartMove()"
  51.    GencodeSrcLine 418;
  52.    FunctionName "Form1::StartMove()";
  53.   @end;
  54.   @begin UserFunction "Place()"
  55.    GencodeSrcLine 437;
  56.    FunctionName "Form1::Place()";
  57.   @end;
  58.   @begin UserFunction "IsFinished()"
  59.    GencodeSrcLine 472;
  60.    FunctionName "Form1::IsFinished()";
  61.   @end;
  62.   @begin UserFunction "MakeBoard()"
  63.    GencodeSrcLine 483;
  64.    FunctionName "Form1::MakeBoard()";
  65.   @end;
  66.   @begin UserFunction "OverBox()"
  67.    GencodeSrcLine 534;
  68.    FunctionName "Form1::OverBox()";
  69.   @end;
  70.   @begin UserFunction "Prototype for OverBox()"
  71.    GencodeSrcLine 155;
  72.    FunctionName "Form1::Prototype for OverBox()";
  73.   @end;
  74.   @begin UserFunction "IsValidMove()"
  75.    GencodeSrcLine 549;
  76.    FunctionName "Form1::IsValidMove()";
  77.   @end;
  78.   @begin UserFunction "Prototype for IsValidMove()"
  79.    GencodeSrcLine 157;
  80.    FunctionName "Form1::Prototype for IsValidMove()";
  81.   @end;
  82.   @begin UserFunction "Feedback()"
  83.    GencodeSrcLine 593;
  84.    FunctionName "Form1::Feedback()";
  85.   @end;
  86.   @begin UserFunction "Prototype for Feedback()"
  87.    GencodeSrcLine 159;
  88.    FunctionName "Form1::Prototype for Feedback()";
  89.   @end;
  90.   @begin UserFunction "Prototype for Continue()"
  91.    GencodeSrcLine 161;
  92.    FunctionName "Form1::Prototype for Continue()";
  93.   @end;
  94.   @begin UserFunction "Prototype for GetPosition()"
  95.    GencodeSrcLine 163;
  96.    FunctionName "Form1::Prototype for GetPosition()";
  97.   @end;
  98.   @begin UserFunction "Prototype for StartMove()"
  99.    GencodeSrcLine 165;
  100.    FunctionName "Form1::Prototype for StartMove()";
  101.   @end;
  102.   @begin UserFunction "Prototype for Place()"
  103.    GencodeSrcLine 167;
  104.    FunctionName "Form1::Prototype for Place()";
  105.   @end;
  106.   @begin UserFunction "Prototype for IsFinished()"
  107.    GencodeSrcLine 169;
  108.    FunctionName "Form1::Prototype for IsFinished()";
  109.   @end;
  110.   @begin UserFunction "Prototype for MakeBoard()"
  111.    GencodeSrcLine 171;
  112.    FunctionName "Form1::Prototype for MakeBoard()";
  113.   @end;
  114.   ResID 103;
  115.   DesignName Form1;
  116.   TabIndex 0;
  117.   DesignRect 83,103,263,210;
  118.  @end;
  119.  
  120.  @begin Menu
  121.   ItemCount 4;
  122.   DesignName "menu_1";
  123.   IsDefault 1;
  124.   ResID 101;
  125.   DesignRect 0,0,14,14;
  126.   @begin Popup
  127.    Name "File";
  128.    Caption "&File";
  129.    NegotiatePosition None;
  130.    @begin Item
  131.     Name "New";
  132.     Caption "New &Game";
  133.     ResID 1003;
  134.     NegotiatePosition None;
  135.     @begin Event "Click"
  136.      GencodeSrcLine 621;
  137.      FunctionName "Form1::menu_1_New_Click";
  138.     @end;
  139.    @end;
  140.    @begin Item
  141.     Name "Exit";
  142.     Caption "E&xit";
  143.     ResID 1004;
  144.     NegotiatePosition None;
  145.     @begin Event "Click"
  146.      GencodeSrcLine 613;
  147.      FunctionName "Form1::menu_1_Exit_Click";
  148.     @end;
  149.    @end;
  150.   @end;
  151.   @begin Popup
  152.    Name "item_1";
  153.    Caption "&Help";
  154.    NegotiatePosition None;
  155.    @begin Item
  156.     Name "item_4";
  157.     Caption "A&bout";
  158.     ResID 1002;
  159.     NegotiatePosition None;
  160.     @begin Event "Click"
  161.      GencodeSrcLine 633;
  162.      FunctionName "Form1::menu_1_item_4_Click";
  163.     @end;
  164.    @end;
  165.   @end;
  166.  @end;
  167.  
  168.  @begin Object "WPictureBox"
  169.   WSSIcon 1;
  170.   WSSNotify 1;
  171.   WCCSTop 1;
  172.   WCCSNoMoveY 1;
  173.   WCCSBottom 1;
  174.   WSClipSiblings 1;
  175.   WSChild 1;
  176.   WSVisible 1;
  177.   DragSourceTag "*";
  178.   DragTargetTag "*";
  179.   @begin Event "Create"
  180.    GencodeSrcLine 641;
  181.    FunctionName "Form1::pictb_1_Create";
  182.   @end;
  183.   @begin Event "DragContinue"
  184.    GencodeSrcLine 651;
  185.    FunctionName "Form1::pictb_1_DragContinue";
  186.   @end;
  187.   @begin Event "DragEnd"
  188.    GencodeSrcLine 665;
  189.    FunctionName "Form1::pictb_1_DragEnd";
  190.   @end;
  191.   @begin Event "DragFeedback"
  192.    GencodeSrcLine 672;
  193.    FunctionName "Form1::pictb_1_DragFeedback";
  194.   @end;
  195.   @begin Event "DragStart"
  196.    GencodeSrcLine 681;
  197.    FunctionName "Form1::pictb_1_DragStart";
  198.   @end;
  199.   ResID 102;
  200.   DesignName pictb_1;
  201.   TabIndex 1;
  202.   DesignRect 47,74,33,31;
  203.   @begin ComponentData "pictb_1"
  204.    Picture "<no picture>";
  205.   @end;
  206.  @end;
  207.  
  208.  @begin Object "WPictureBox"
  209.   WSSIcon 1;
  210.   WSSNotify 1;
  211.   WCCSTop 1;
  212.   WCCSNoMoveY 1;
  213.   WCCSBottom 1;
  214.   WSClipSiblings 1;
  215.   WSChild 1;
  216.   WSVisible 1;
  217.   BackColor "WColorBackground";
  218.   @begin Event "Create"
  219.    GencodeSrcLine 689;
  220.    FunctionName "Form1::pictb_2_Create";
  221.   @end;
  222.   @begin Event "DragContinue"
  223.    GencodeSrcLine 696;
  224.    FunctionName "Form1::pictb_2_DragContinue";
  225.   @end;
  226.   @begin Event "DragEnd"
  227.    GencodeSrcLine 705;
  228.    FunctionName "Form1::pictb_2_DragEnd";
  229.   @end;
  230.   @begin Event "DragFeedback"
  231.    GencodeSrcLine 712;
  232.    FunctionName "Form1::pictb_2_DragFeedback";
  233.   @end;
  234.   @begin Event "DragStart"
  235.    GencodeSrcLine 720;
  236.    FunctionName "Form1::pictb_2_DragStart";
  237.   @end;
  238.   ResID 103;
  239.   DesignName pictb_2;
  240.   TabIndex 2;
  241.   DesignRect 80,74,33,31;
  242.   @begin ComponentData "pictb_2"
  243.    Picture "<no picture>";
  244.   @end;
  245.  @end;
  246.  
  247.  @begin Object "WPictureBox"
  248.   WSSIcon 1;
  249.   WSSNotify 1;
  250.   WCCSTop 1;
  251.   WCCSNoMoveY 1;
  252.   WCCSBottom 1;
  253.   WSClipSiblings 1;
  254.   WSChild 1;
  255.   WSVisible 1;
  256.   BackColor "WColorActiveCaption";
  257.   @begin Event "Create"
  258.    GencodeSrcLine 727;
  259.    FunctionName "Form1::pictb_3_Create";
  260.   @end;
  261.   @begin Event "DragContinue"
  262.    GencodeSrcLine 734;
  263.    FunctionName "Form1::pictb_3_DragContinue";
  264.   @end;
  265.   @begin Event "DragEnd"
  266.    GencodeSrcLine 742;
  267.    FunctionName "Form1::pictb_3_DragEnd";
  268.   @end;
  269.   @begin Event "DragFeedback"
  270.    GencodeSrcLine 749;
  271.    FunctionName "Form1::pictb_3_DragFeedback";
  272.   @end;
  273.   @begin Event "DragStart"
  274.    GencodeSrcLine 758;
  275.    FunctionName "Form1::pictb_3_DragStart";
  276.   @end;
  277.   ResID 104;
  278.   DesignName pictb_3;
  279.   TabIndex 3;
  280.   DesignRect 113,74,33,31;
  281.  @end;
  282.  
  283.  @begin Object "WPictureBox"
  284.   WSSIcon 1;
  285.   WSSNotify 1;
  286.   WCCSTop 1;
  287.   WCCSNoMoveY 1;
  288.   WCCSBottom 1;
  289.   WSClipSiblings 1;
  290.   WSChild 1;
  291.   WSVisible 1;
  292.   BackColor "WColorBrightRed";
  293.   @begin Event "Create"
  294.    GencodeSrcLine 765;
  295.    FunctionName "Form1::pictb_4_Create";
  296.   @end;
  297.   @begin Event "DragContinue"
  298.    GencodeSrcLine 772;
  299.    FunctionName "Form1::pictb_4_DragContinue";
  300.   @end;
  301.   @begin Event "DragEnd"
  302.    GencodeSrcLine 780;
  303.    FunctionName "Form1::pictb_4_DragEnd";
  304.   @end;
  305.   @begin Event "DragFeedback"
  306.    GencodeSrcLine 787;
  307.    FunctionName "Form1::pictb_4_DragFeedback";
  308.   @end;
  309.   @begin Event "DragStart"
  310.    GencodeSrcLine 796;
  311.    FunctionName "Form1::pictb_4_DragStart";
  312.   @end;
  313.   ResID 105;
  314.   DesignName pictb_4;
  315.   TabIndex 4;
  316.   DesignRect 47,104,33,31;
  317.  @end;
  318.  
  319.  @begin Object "WPictureBox"
  320.   WSSIcon 1;
  321.   WSSNotify 1;
  322.   WCCSTop 1;
  323.   WCCSNoMoveY 1;
  324.   WCCSBottom 1;
  325.   WSClipSiblings 1;
  326.   WSChild 1;
  327.   WSVisible 1;
  328.   BackColor "WColorGreen";
  329.   @begin Event "Create"
  330.    GencodeSrcLine 804;
  331.    FunctionName "Form1::pictb_5_Create";
  332.   @end;
  333.   @begin Event "DragContinue"
  334.    GencodeSrcLine 810;
  335.    FunctionName "Form1::pictb_5_DragContinue";
  336.   @end;
  337.   @begin Event "DragEnd"
  338.    GencodeSrcLine 818;
  339.    FunctionName "Form1::pictb_5_DragEnd";
  340.   @end;
  341.   @begin Event "DragFeedback"
  342.    GencodeSrcLine 825;
  343.    FunctionName "Form1::pictb_5_DragFeedback";
  344.   @end;
  345.   @begin Event "DragStart"
  346.    GencodeSrcLine 834;
  347.    FunctionName "Form1::pictb_5_DragStart";
  348.   @end;
  349.   ResID 106;
  350.   DesignName pictb_5;
  351.   TabIndex 5;
  352.   DesignRect 80,104,33,31;
  353.  @end;
  354.  
  355.  @begin Object "WPictureBox"
  356.   WSSIcon 1;
  357.   WSSNotify 1;
  358.   WCCSTop 1;
  359.   WCCSNoMoveY 1;
  360.   WCCSBottom 1;
  361.   WSClipSiblings 1;
  362.   WSChild 1;
  363.   WSVisible 1;
  364.   BackColor "WColorCaptionText";
  365.   @begin Event "Create"
  366.    GencodeSrcLine 842;
  367.    FunctionName "Form1::pictb_6_Create";
  368.   @end;
  369.   @begin Event "DragContinue"
  370.    GencodeSrcLine 848;
  371.    FunctionName "Form1::pictb_6_DragContinue";
  372.   @end;
  373.   @begin Event "DragEnd"
  374.    GencodeSrcLine 856;
  375.    FunctionName "Form1::pictb_6_DragEnd";
  376.   @end;
  377.   @begin Event "DragFeedback"
  378.    GencodeSrcLine 863;
  379.    FunctionName "Form1::pictb_6_DragFeedback";
  380.   @end;
  381.   @begin Event "DragStart"
  382.    GencodeSrcLine 872;
  383.    FunctionName "Form1::pictb_6_DragStart";
  384.   @end;
  385.   ResID 107;
  386.   DesignName pictb_6;
  387.   TabIndex 6;
  388.   DesignRect 113,104,33,31;
  389.  @end;
  390.  
  391.  @begin Object "WPictureBox"
  392.   WSSIcon 1;
  393.   WSSNotify 1;
  394.   WCCSTop 1;
  395.   WCCSNoMoveY 1;
  396.   WCCSBottom 1;
  397.   WSClipSiblings 1;
  398.   WSChild 1;
  399.   WSVisible 1;
  400.   BackColor "WColorRed";
  401.   @begin Event "Create"
  402.    GencodeSrcLine 880;
  403.    FunctionName "Form1::pictb_7_Create";
  404.   @end;
  405.   @begin Event "DragContinue"
  406.    GencodeSrcLine 886;
  407.    FunctionName "Form1::pictb_7_DragContinue";
  408.   @end;
  409.   @begin Event "DragEnd"
  410.    GencodeSrcLine 894;
  411.    FunctionName "Form1::pictb_7_DragEnd";
  412.   @end;
  413.   @begin Event "DragFeedback"
  414.    GencodeSrcLine 901;
  415.    FunctionName "Form1::pictb_7_DragFeedback";
  416.   @end;
  417.   @begin Event "DragStart"
  418.    GencodeSrcLine 910;
  419.    FunctionName "Form1::pictb_7_DragStart";
  420.   @end;
  421.   ResID 108;
  422.   DesignName pictb_7;
  423.   TabIndex 7;
  424.   DesignRect 47,135,33,31;
  425.  @end;
  426.  
  427.  @begin Object "WPictureBox"
  428.   WSSIcon 1;
  429.   WSSNotify 1;
  430.   WCCSTop 1;
  431.   WCCSNoMoveY 1;
  432.   WCCSBottom 1;
  433.   WSClipSiblings 1;
  434.   WSChild 1;
  435.   WSVisible 1;
  436.   BackColor "WColorPink";
  437.   @begin Event "Create"
  438.    GencodeSrcLine 918;
  439.    FunctionName "Form1::pictb_8_Create";
  440.   @end;
  441.   @begin Event "DragContinue"
  442.    GencodeSrcLine 924;
  443.    FunctionName "Form1::pictb_8_DragContinue";
  444.   @end;
  445.   @begin Event "DragEnd"
  446.    GencodeSrcLine 932;
  447.    FunctionName "Form1::pictb_8_DragEnd";
  448.   @end;
  449.   @begin Event "DragFeedback"
  450.    GencodeSrcLine 939;
  451.    FunctionName "Form1::pictb_8_DragFeedback";
  452.   @end;
  453.   @begin Event "DragStart"
  454.    GencodeSrcLine 948;
  455.    FunctionName "Form1::pictb_8_DragStart";
  456.   @end;
  457.   ResID 109;
  458.   DesignName pictb_8;
  459.   TabIndex 8;
  460.   DesignRect 80,135,33,31;
  461.  @end;
  462.  
  463.  @begin Object "WPictureBox"
  464.   WSSIcon 1;
  465.   WSSNotify 1;
  466.   WCCSTop 1;
  467.   WCCSNoMoveY 1;
  468.   WCCSBottom 1;
  469.   WSClipSiblings 1;
  470.   WSChild 1;
  471.   WSVisible 1;
  472.   BackColor "WColorBrightGreen";
  473.   DragSourceTag "*";
  474.   DragTargetTag "*";
  475.   @begin Event "Create"
  476.    GencodeSrcLine 956;
  477.    FunctionName "Form1::pictb_9_Create";
  478.   @end;
  479.   @begin Event "DragContinue"
  480.    GencodeSrcLine 962;
  481.    FunctionName "Form1::pictb_9_DragContinue";
  482.   @end;
  483.   @begin Event "DragEnd"
  484.    GencodeSrcLine 970;
  485.    FunctionName "Form1::pictb_9_DragEnd";
  486.   @end;
  487.   @begin Event "DragFeedback"
  488.    GencodeSrcLine 977;
  489.    FunctionName "Form1::pictb_9_DragFeedback";
  490.   @end;
  491.   @begin Event "DragStart"
  492.    GencodeSrcLine 986;
  493.    FunctionName "Form1::pictb_9_DragStart";
  494.   @end;
  495.   ResID 110;
  496.   DesignName pictb_9;
  497.   TabIndex 9;
  498.   DesignRect 113,135,33,31;
  499.   @begin ComponentData "pictb_9"
  500.    Picture "<no picture>";
  501.   @end;
  502.  @end;
  503.  
  504.  @begin Object "WPictureBox"
  505.   WSSIcon 1;
  506.   WSSNotify 1;
  507.   WCCSTop 1;
  508.   WCCSNoMoveY 1;
  509.   WCCSBottom 1;
  510.   WSClipSiblings 1;
  511.   WSChild 1;
  512.   WSVisible 1;
  513.   BackColor "WColorBackground";
  514.   ResID 111;
  515.   DesignName pictb_10;
  516.   TabIndex 10;
  517.   DesignRect 165,98,48,44;
  518.  @end;
  519.  
  520.  @begin Object "WLabel"
  521.   WSSCenter 1;
  522.   WSSNotify 1;
  523.   WSSSunken 1;
  524.   WCCSTop 1;
  525.   WSClipSiblings 1;
  526.   WSChild 1;
  527.   WSExStaticEdge 1;
  528.   WSVisible 1;
  529.   Text "  The object of this puzzle is to arrange the tiles, to create the picture on the right.  This program demonstrates Drag and Drop events and Member Function creation.  Refer to DragStart(), DragContinue(), and DragEnd() for drag and drop techniques.";
  530.   ResID 112;
  531.   DesignName label_1;
  532.   TabIndex 11;
  533.   DesignRect 16,15,213,39;
  534.  @end;
  535.  
  536.  @begin HPPPrefixBlock
  537. @begin-code HPPPrefix
  538.  
  539. #include "wres.h"
  540. #include <stdlib.h>
  541. #include <time.h>
  542. WRect   _board;
  543. WRect   _r[ 9 ];
  544. WPoint  _positions[ 9 ];
  545. WPictureBox * _missing;
  546. WBitmap bitmap[ 10 ];
  547. int     _tile[ 9 ];
  548. int     _width;
  549. int     _height;
  550. int     _start;
  551. int     _blank;
  552.  
  553. @end-code;
  554.   GencodeSrcLine 10;
  555.  @end;
  556.  
  557.  @begin CPPPrefixBlock
  558. @begin-code CPPPrefix
  559.  
  560. // Code added here will be included at the top of the .CPP file
  561.  
  562. @end-code;
  563.   GencodeSrcLine 10;
  564.  @end;
  565.  
  566.  @begin ClassContentsBlock
  567. @begin-code ClassContents
  568.  
  569.     public:
  570.         // add your public instance data here
  571.     private:
  572.         // add your private instance data here
  573.     protected:
  574.         // add your protected instance data here
  575.  
  576.     public:
  577.     void Continue( WEventData * event );
  578.     public:
  579.     int GetPosition( WPoint pt );
  580.     public:
  581.     void StartMove( int index, WEventData * event );
  582.     public:
  583.     void Place( WPictureBox * pBox, WEventData * event );
  584.     public:
  585.     WBool IsValidMove( int index, int blank );
  586.     public:
  587.     WBool IsFinished();
  588.     public:
  589.     WBool MakeBoard();
  590.  
  591. @end-code;
  592.   GencodeSrcLine 134;
  593.  @end;
  594.  
  595. @begin-code GeneratedClassContents
  596.  
  597.  
  598. @end-code;
  599.  
  600. @begin-code Code "Form1::Continue()"
  601.  
  602. void Form1::Continue( WEventData * event )
  603. {
  604.     WDragEventData * dragEv = (WDragEventData *) event;
  605.     if( dragEv->draginfo->kbState == WMK_NONE ){
  606.         event->returns = WDRAG_DROP;
  607.     } else {
  608.         event->returns = WDRAG_CONTINUE_DRAG;
  609.     }
  610.     return;
  611. }
  612.  
  613. @end-code;
  614.  
  615. @begin-code Code "Form1::GetPosition()"
  616.  
  617. int Form1::GetPosition( WPoint pt )
  618. {
  619.     int i;
  620.     for( i = 0; i < 9; i++ ){
  621.         if( pt.x > _positions[ i ].x 
  622.             && pt.x < _positions[ i ].x + _width
  623.             && pt.y > _positions[ i ].y
  624.             && pt.y < _positions[ i ].y + _height ){
  625.                 return i;
  626.         }
  627.     }
  628.     
  629.     return -1;
  630.  
  631. }
  632.  
  633. @end-code;
  634.  
  635. @begin-code Code "Form1::StartMove()"
  636.  
  637. void Form1::StartMove( int index, WEventData * event )
  638. {
  639.     WPoint      pt;
  640.     WRect       rect;
  641.     WInt        pos;
  642.     
  643.     WDragEventData * d_ev;
  644.     d_ev = (WDragEventData *) event;
  645.     rect = GetClientRectangle( TRUE );
  646.     event->returns = WDRAG_DEFAULT_START;
  647.     pt.x = d_ev->currentPoint.x - rect.x;
  648.     pt.y = d_ev->currentPoint.y - rect.y;
  649.     pos = GetPosition( pt );
  650.     if( pos != _blank ) {
  651.         _start = pos;
  652.     }
  653.     
  654.     return;
  655. }
  656.  
  657. @end-code;
  658.  
  659. @begin-code Code "Form1::Place()"
  660.  
  661. void Form1::Place( WPictureBox * pBox, WEventData * event )
  662. {
  663.     WRect       fr; //form_rect
  664.     WRect       set;
  665.     WDragEventData * dragEv = (WDragEventData *) event;
  666.     WPoint      point;
  667.     int         pos;
  668.     int         temp;
  669.     
  670.     fr = GetClientRectangle( TRUE );
  671.     
  672.     point.x = dragEv->currentPoint.x - fr.x;
  673.     point.y = dragEv->currentPoint.y - fr.y;
  674.     
  675.     pos = GetPosition( point );
  676.     
  677.     if( pos == _blank && IsValidMove( _start, _blank ) ){
  678.         set.Create( _positions[ _blank ].x,
  679.             _positions[ _blank ].y, _width, _height );
  680.         temp = _tile[ _blank ];
  681.         _tile[ _blank ] = _tile[ _start ];
  682.         _tile[ _start ] = temp;
  683.         _blank = _start;        
  684.         pBox->SetRectangle( set );
  685.         if( IsFinished() ){
  686.             _missing->SetRectangle( WRect( _positions[ _blank ].x,
  687.                 _positions[ _blank ].y, _width, _height ) );
  688.             _missing->SetVisible( TRUE );
  689.             WMessageBox::Info( this, "Yes!",
  690.                 "You have finished.  Well Done!" );
  691.             _blank = -1;
  692.         }
  693.     }
  694.     return;
  695. }
  696.  
  697. @end-code;
  698.  
  699. @begin-code Code "Form1::IsFinished()"
  700.  
  701. WBool Form1::IsFinished()
  702. {
  703.     WBool rtn = TRUE;
  704.     int i;
  705.     for( i = 0; i < 9; i++ ){
  706.         if( _tile[ i ] != i ){
  707.             rtn = FALSE;
  708.         }
  709.     }
  710.     return rtn;
  711. }
  712.  
  713. @end-code;
  714.  
  715. @begin-code Code "Form1::MakeBoard()"
  716.  
  717. WBool Form1::MakeBoard()
  718. {
  719.     int             i;
  720.     WPictureBox *   pBox[ 9 ];
  721.     int             move_tile;
  722.     int             temp;
  723.  
  724.             
  725.     _blank = 0;
  726.     _start = -1;
  727.     
  728.     // Setting Random positions of tiles
  729.     srand( time( NULL ) );
  730.     for( i = 0; i < 9; i++ ){
  731.         _tile[ i ] = i;
  732.     }
  733.     for( i = 0; i < 50; ){
  734.         move_tile = (int) rand() % 9;
  735.         if( IsValidMove( move_tile, _blank ) ){
  736.             i++;
  737.             temp = _tile[ _blank ];
  738.             _tile[ _blank ] = _tile[ move_tile ];
  739.             _tile[ move_tile ] = temp;
  740.             _blank = move_tile;
  741.         }
  742.     }
  743.     pBox[ 0 ] = pictb_1;
  744.     pBox[ 1 ] = pictb_2;
  745.     pBox[ 2 ] = pictb_3;
  746.     pBox[ 3 ] = pictb_4;
  747.     pBox[ 4 ] = pictb_5;
  748.     pBox[ 5 ] = pictb_6;
  749.     pBox[ 6 ] = pictb_7;
  750.     pBox[ 7 ] = pictb_8;
  751.     pBox[ 8 ] = pictb_9;
  752.     for( i = 0; i < 9; i++ ){
  753.         pBox[ i ]->SetRectangle( WRect( _r[ i ].x, 
  754.                 _r[ i ].y, _width, _height ) );
  755.     }
  756.     
  757.     for( i = 0; i < 9; i++ ){
  758.         pBox[ i ]->SetBitmap( (const WBitmap) bitmap[ _tile[ i ] ] );
  759.     }
  760.     pictb_10->SetBitmap( (const WBitmap) bitmap[ 9 ] );
  761.     pBox[ _blank ]->SetRectangle( WRect( 0, 0, 0, 0 ) );
  762.     pBox[ _blank ]->SetVisible( FALSE );
  763.     _missing = pBox[ _blank ];
  764.     
  765.     return TRUE;
  766.  
  767. }
  768.  
  769. @end-code;
  770.  
  771. @begin-code Code "Form1::OverBox()"
  772.  
  773. int Form1::OverBox( WPoint pos )
  774. {
  775.     int r;
  776.     WRect rect;
  777.     WPoint pt;
  778. //    rect = GetClientRectangle( TRUE );
  779.     pt.x = pos.x;
  780.     pt.y = pos.y;
  781.     for( r = 0; r < 9; r++ ){
  782.         if( _r->Contains( pt ) ){
  783.             break;
  784.         }
  785.     }
  786.     return r;
  787. }
  788.  
  789. @end-code;
  790.  
  791. @begin-code Code "Form1::Prototype for OverBox()"
  792.  
  793.     public:
  794.         int OverBox( WPoint pos );
  795.  
  796. @end-code;
  797.  
  798. @begin-code Code "Form1::IsValidMove()"
  799.  
  800. WBool Form1::IsValidMove( int index, int blank )
  801. {
  802.     WBool   rtn = FALSE;
  803.     switch( index ){
  804.         case 0:
  805.             if( blank == 1 || blank == 3 )
  806.                 rtn = TRUE;
  807.             break;
  808.         case 1:
  809.             if( blank == 0 || blank == 2 || blank == 4 )
  810.                 rtn = TRUE;
  811.             break;
  812.         case 2:
  813.             if( blank == 1 || blank == 5 )
  814.                 rtn = TRUE;
  815.             break;
  816.         case 3:
  817.             if( blank == 0 || blank == 4 || blank == 6 )
  818.                 rtn = TRUE;
  819.             break;
  820.         case 4:
  821.             if( blank == 1 || blank == 3 || blank == 5 || blank == 7 )
  822.                 rtn = TRUE;
  823.             break;
  824.         case 5:
  825.             if( blank == 2 || blank == 4 || blank == 8 )
  826.                 rtn = TRUE;
  827.             break;
  828.         case 6:   
  829.             if( blank == 3 || blank == 7 )
  830.                 rtn = TRUE;
  831.             break; 
  832.         case 7:
  833.             if( blank == 6 || blank == 4 || blank == 8 )
  834.                 rtn = TRUE;
  835.             break;
  836.         case 8:
  837.             if( blank == 7 || blank == 5 )
  838.                 rtn = TRUE;
  839.             break;
  840.     }
  841.     return rtn;
  842.  
  843. }
  844.  
  845. @end-code;
  846.  
  847. @begin-code Code "Form1::Prototype for IsValidMove()"
  848.  
  849.     public:
  850.         WBool IsValidMove( int index, int blank );
  851.  
  852. @end-code;
  853.  
  854. @begin-code Code "Form1::Feedback()"
  855.  
  856. WBool Form1::Feedback( WDragEventData * d_Ev )
  857. {
  858.     WPoint pt;
  859.     WRect rect = GetClientRectangle( TRUE );
  860.     int position;
  861.  
  862.     pt = d_Ev->currentPoint;
  863.     pt.x = pt.x - rect.x;
  864.     pt.y = pt.y - rect.y;
  865.     position = GetPosition( pt );
  866.     
  867.     if( IsValidMove( _start, position ) && position == _blank ){    
  868.         d_Ev->currentOp = WDROPEFFECT_COPY;
  869.     } else {
  870.         d_Ev->currentOp = WDROPEFFECT_NONE;
  871.     }
  872.     
  873.     d_Ev->returns = WDRAG_DEFAULT_FEEDBACK;
  874.     return TRUE;
  875. }
  876.  
  877. @end-code;
  878.  
  879. @begin-code Code "Form1::Prototype for Feedback()"
  880.  
  881.     public:
  882.         WBool Feedback( WDragEventData * d_Ev );
  883.  
  884. @end-code;
  885.  
  886. @begin-code Code "Form1::Prototype for Continue()"
  887.  
  888. // Placeholder for Prototype for Continue
  889. //     you should move the prototype here from the Class Contents section
  890.  
  891. @end-code;
  892.  
  893. @begin-code Code "Form1::Prototype for GetPosition()"
  894.  
  895. // Placeholder for Prototype for GetPosition
  896. //     you should move the prototype here from the Class Contents section
  897.  
  898. @end-code;
  899.  
  900. @begin-code Code "Form1::Prototype for StartMove()"
  901.  
  902. // Placeholder for Prototype for StartMove
  903. //     you should move the prototype here from the Class Contents section
  904.  
  905. @end-code;
  906.  
  907. @begin-code Code "Form1::Prototype for Place()"
  908.  
  909. // Placeholder for Prototype for Place
  910. //     you should move the prototype here from the Class Contents section
  911.  
  912. @end-code;
  913.  
  914. @begin-code Code "Form1::Prototype for IsFinished()"
  915.  
  916. // Placeholder for Prototype for IsFinished
  917. //     you should move the prototype here from the Class Contents section
  918.  
  919. @end-code;
  920.  
  921. @begin-code Code "Form1::Prototype for MakeBoard()"
  922.  
  923. // Placeholder for Prototype for MakeBoard
  924. //     you should move the prototype here from the Class Contents section
  925.  
  926. @end-code;
  927.  
  928. @begin-code Code "Form1::Form1_Close"
  929.  
  930. WBool Form1::Form1_Close( WObject *source, WEventData *event )
  931. {
  932.     extern WForm *__MainForm;
  933.  
  934.     Destroy();
  935.     if( (WForm*) this == __MainForm ) {
  936.         WAppObject.Quit();
  937.     }
  938.     return( TRUE );
  939. }
  940.  
  941. @end-code;
  942.  
  943. @begin-code Code "Form1::Form1_Create"
  944.  
  945. WBool Form1::Form1_Create( WObject *source, WCreateEventData *event )
  946. {
  947.     int i;
  948.     
  949.  
  950.     _r[ 0 ] = pictb_1->GetRectangle();
  951.     _r[ 1 ] = pictb_2->GetRectangle();
  952.     _r[ 2 ] = pictb_3->GetRectangle();
  953.     _r[ 3 ] = pictb_4->GetRectangle();
  954.     _r[ 4 ] = pictb_5->GetRectangle();
  955.     _r[ 5 ] = pictb_6->GetRectangle();
  956.     _r[ 6 ] = pictb_7->GetRectangle();
  957.     _r[ 7 ] = pictb_8->GetRectangle();
  958.     _r[ 8 ] = pictb_9->GetRectangle();
  959.  
  960.     bitmap[ 0 ].Create( BITMAP01 );
  961.     bitmap[ 1 ].Create( BITMAP02 );
  962.     bitmap[ 2 ].Create( BITMAP03 );
  963.     bitmap[ 3 ].Create( BITMAP04 );
  964.     bitmap[ 4 ].Create( BITMAP05 );
  965.     bitmap[ 5 ].Create( BITMAP06 );
  966.     bitmap[ 6 ].Create( BITMAP07 );
  967.     bitmap[ 7 ].Create( BITMAP08 );
  968.     bitmap[ 8 ].Create( BITMAP09 );
  969.     bitmap[ 9 ].Create( BITMAP10 );
  970.  
  971.  
  972.     _board.Create( _r[ 0 ].x - 1, _r[ 0 ].y - 1, 
  973.                 _r[ 8 ].x + _r[ 8 ].w - _r[ 0 ].x + 2,
  974.                 _r[ 8 ].y + _r[ 8 ].h - _r[ 0 ].y + 2 );
  975.  
  976.     for( i = 0; i < 9; i++ ){
  977.         _positions[ i ].x = _r[ i ].x;
  978.         _positions[ i ].y = _r[ i ].y;
  979.     }
  980.     _width = _r[ 0 ].w;
  981.     _height = _r[ 0 ].h;
  982.  
  983.  
  984.     MakeBoard();
  985.     return( FALSE ); // previously:// return( TRUE );
  986. }
  987.  
  988. @end-code;
  989.  
  990. @begin-code Code "Form1::Form1_Destroy"
  991.  
  992. WBool Form1::Form1_Destroy( WObject *source, WEventData *event )
  993. {
  994.  
  995.     return( FALSE ); // previously:// return( TRUE );
  996. }
  997.  
  998. @end-code;
  999.  
  1000. @begin-code Code "Form1::Form1_EraseBackground"
  1001.  
  1002. WBool Form1::Form1_EraseBackground(
  1003.     WObject           *source,
  1004.     WPaintEventData        *event )
  1005. {
  1006.     WPaintEventData * paint;
  1007.     WBrush            brush;
  1008.     brush.Create( WBBlackBrush );
  1009.     paint = (WPaintEventData *) event;
  1010.     paint->canvas->FillRectangle( _board, &brush );
  1011.     
  1012.     return FALSE;
  1013. }
  1014.  
  1015. @end-code;
  1016.  
  1017. @begin-code Code "Form1::Form1_Paint"
  1018.  
  1019. WBool Form1::Form1_Paint(
  1020.     WObject           *source,
  1021.     WPaintEventData        *event )
  1022. {
  1023.     WPaintEventData * paint;
  1024.     WBrush            brush;
  1025.     brush.Create( WBBlackBrush );
  1026.     paint = (WPaintEventData *) event;
  1027.     paint->canvas->FillRectangle( _board, &brush );
  1028.  
  1029.     return FALSE;
  1030. }
  1031.  
  1032. @end-code;
  1033.  
  1034. @begin-code Code "Form1::menu_1_Exit_Click"
  1035.  
  1036. WBool Form1::menu_1_Exit_Click(
  1037.     WObject           *source,
  1038.     WEventData        *event )
  1039. {
  1040.     WAppObject.Quit();
  1041.     
  1042.     return TRUE;
  1043. }
  1044.  
  1045. @end-code;
  1046.  
  1047. @begin-code Code "Form1::menu_1_New_Click"
  1048.  
  1049. WBool Form1::menu_1_New_Click(
  1050.     WObject           *source,
  1051.     WEventData        *event )
  1052. {
  1053.     _missing->SetRectangle( WRect( _positions[ _blank ].x,
  1054.         _positions[ _blank ].y, _width, _height ) );
  1055.     _missing->SetVisible( TRUE );
  1056.  
  1057.     MakeBoard();
  1058.     
  1059.     return TRUE;
  1060. }
  1061.  
  1062. @end-code;
  1063.  
  1064. @begin-code Code "Form1::menu_1_item_4_Click"
  1065.  
  1066. WBool Form1::menu_1_item_4_Click(
  1067.     WObject           *source,
  1068.     WEventData        *event )
  1069. {
  1070.     WMessageBox::Info( this, "About", "Puzzle Game\n\nOptima ++, 1996" );
  1071.     
  1072.     return TRUE;
  1073. }
  1074.  
  1075. @end-code;
  1076.  
  1077. @begin-code Code "Form1::pictb_1_Create"
  1078.  
  1079. WBool Form1::pictb_1_Create(
  1080.     WObject           *source,
  1081.     WCreateEventData        *event )
  1082. {
  1083. //    WBool           result;
  1084. //    WBitmap         bitmap;
  1085. //    result = bitmap.Create( BITMAP01 );
  1086. //    result = pictb_1->SetBitmap( (const WBitmap) bitmap );
  1087.     return TRUE;
  1088. }
  1089.  
  1090. @end-code;
  1091.  
  1092. @begin-code Code "Form1::pictb_1_DragContinue"
  1093.  
  1094. WBool Form1::pictb_1_DragContinue(
  1095.     WObject           *source,
  1096.     WDragEventData        *event )
  1097. {
  1098. //    WDragEventData * dragEv = (WDragEventData *) event;
  1099. //    if( dragEv->draginfo->kbState == WMK_NONE ){
  1100. //        event->returns = WDRAG_DROP;
  1101. //    } else {
  1102. //        event->returns = WDRAG_CONTINUE_DRAG;
  1103. //    }
  1104.     Continue( event );
  1105.     
  1106.     return TRUE;
  1107. }
  1108.  
  1109. @end-code;
  1110.  
  1111. @begin-code Code "Form1::pictb_1_DragEnd"
  1112.  
  1113. WBool Form1::pictb_1_DragEnd(
  1114.     WObject           *source,
  1115.     WDragEventData        *event )
  1116. {
  1117.     Place( pictb_1, event );
  1118.     return TRUE;
  1119. }
  1120.  
  1121. @end-code;
  1122.  
  1123. @begin-code Code "Form1::pictb_1_DragFeedback"
  1124.  
  1125. WBool Form1::pictb_1_DragFeedback(
  1126.     WObject           *source,
  1127.     WDragEventData        *event )
  1128. {
  1129.     WDragEventData * d_Ev = (WDragEventData *) event;
  1130.     Feedback( d_Ev );
  1131.     
  1132.     return FALSE;
  1133. }
  1134.  
  1135. @end-code;
  1136.  
  1137. @begin-code Code "Form1::pictb_1_DragStart"
  1138.  
  1139. WBool Form1::pictb_1_DragStart(
  1140.     WObject           *source,
  1141.     WDragEventData        *event )
  1142. {
  1143.     StartMove( 0, event );
  1144.     
  1145.     return TRUE;
  1146. }
  1147.  
  1148. @end-code;
  1149.  
  1150. @begin-code Code "Form1::pictb_2_Create"
  1151.  
  1152. WBool Form1::pictb_2_Create(
  1153.     WObject           *source,
  1154.     WCreateEventData        *event )
  1155. {
  1156.     
  1157.     return TRUE;
  1158. }
  1159.  
  1160. @end-code;
  1161.  
  1162. @begin-code Code "Form1::pictb_2_DragContinue"
  1163.  
  1164. WBool Form1::pictb_2_DragContinue(
  1165.     WObject           *source,
  1166.     WDragEventData        *event )
  1167. {
  1168.     Continue( event );
  1169.     WDragEventData * drag_Ev = (WDragEventData *) event;
  1170.     drag_Ev->currentOp = WDROPEFFECT_COPY;        
  1171.     return TRUE;
  1172. }
  1173.  
  1174. @end-code;
  1175.  
  1176. @begin-code Code "Form1::pictb_2_DragEnd"
  1177.  
  1178. WBool Form1::pictb_2_DragEnd(
  1179.     WObject           *source,
  1180.     WDragEventData        *event )
  1181. {
  1182.     Place( pictb_2, event );
  1183.     return TRUE;
  1184. }
  1185.  
  1186. @end-code;
  1187.  
  1188. @begin-code Code "Form1::pictb_2_DragFeedback"
  1189.  
  1190. WBool Form1::pictb_2_DragFeedback(
  1191.     WObject           *source,
  1192.     WDragEventData        *event )
  1193. {
  1194.     WDragEventData * d_Ev = (WDragEventData *) event;
  1195.     Feedback( d_Ev );
  1196.     return FALSE;
  1197. }
  1198.  
  1199. @end-code;
  1200.  
  1201. @begin-code Code "Form1::pictb_2_DragStart"
  1202.  
  1203. WBool Form1::pictb_2_DragStart(
  1204.     WObject           *source,
  1205.     WDragEventData        *event )
  1206. {
  1207.     StartMove( 1, event );
  1208.     return TRUE;
  1209. }
  1210.  
  1211. @end-code;
  1212.  
  1213. @begin-code Code "Form1::pictb_3_Create"
  1214.  
  1215. WBool Form1::pictb_3_Create(
  1216.     WObject           *source,
  1217.     WCreateEventData        *event )
  1218. {
  1219.     
  1220.     return TRUE;
  1221. }
  1222.  
  1223. @end-code;
  1224.  
  1225. @begin-code Code "Form1::pictb_3_DragContinue"
  1226.  
  1227. WBool Form1::pictb_3_DragContinue(
  1228.     WObject           *source,
  1229.     WDragEventData        *event )
  1230. {
  1231.     Continue( event );
  1232.     
  1233.     return TRUE;
  1234. }
  1235.  
  1236. @end-code;
  1237.  
  1238. @begin-code Code "Form1::pictb_3_DragEnd"
  1239.  
  1240. WBool Form1::pictb_3_DragEnd(
  1241.     WObject           *source,
  1242.     WDragEventData        *event )
  1243. {
  1244.     Place( pictb_3, event );
  1245.     return TRUE;
  1246. }
  1247.  
  1248. @end-code;
  1249.  
  1250. @begin-code Code "Form1::pictb_3_DragFeedback"
  1251.  
  1252. WBool Form1::pictb_3_DragFeedback(
  1253.     WObject           *source,
  1254.     WDragEventData        *event )
  1255. {
  1256.     WDragEventData * d_Ev = (WDragEventData *) event;
  1257.     Feedback( d_Ev );
  1258.     
  1259.     return FALSE;
  1260. }
  1261.  
  1262. @end-code;
  1263.  
  1264. @begin-code Code "Form1::pictb_3_DragStart"
  1265.  
  1266. WBool Form1::pictb_3_DragStart(
  1267.     WObject           *source,
  1268.     WDragEventData        *event )
  1269. {
  1270.     StartMove( 2, event );
  1271.     return TRUE;
  1272. }
  1273.  
  1274. @end-code;
  1275.  
  1276. @begin-code Code "Form1::pictb_4_Create"
  1277.  
  1278. WBool Form1::pictb_4_Create(
  1279.     WObject           *source,
  1280.     WCreateEventData        *event )
  1281. {
  1282.     
  1283.     return TRUE;
  1284. }
  1285.  
  1286. @end-code;
  1287.  
  1288. @begin-code Code "Form1::pictb_4_DragContinue"
  1289.  
  1290. WBool Form1::pictb_4_DragContinue(
  1291.     WObject           *source,
  1292.     WDragEventData        *event )
  1293. {
  1294.     Continue( event );
  1295.     
  1296.     return TRUE;
  1297. }
  1298.  
  1299. @end-code;
  1300.  
  1301. @begin-code Code "Form1::pictb_4_DragEnd"
  1302.  
  1303. WBool Form1::pictb_4_DragEnd(
  1304.     WObject           *source,
  1305.     WDragEventData        *event )
  1306. {
  1307.     Place( pictb_4, event );
  1308.     return TRUE;
  1309. }
  1310.  
  1311. @end-code;
  1312.  
  1313. @begin-code Code "Form1::pictb_4_DragFeedback"
  1314.  
  1315. WBool Form1::pictb_4_DragFeedback(
  1316.     WObject           *source,
  1317.     WDragEventData        *event )
  1318. {
  1319.     WDragEventData * d_Ev = (WDragEventData *) event;
  1320.     Feedback( d_Ev );
  1321.     
  1322.     return FALSE;
  1323. }
  1324.  
  1325. @end-code;
  1326.  
  1327. @begin-code Code "Form1::pictb_4_DragStart"
  1328.  
  1329. WBool Form1::pictb_4_DragStart(
  1330.     WObject           *source,
  1331.     WDragEventData        *event )
  1332. {
  1333.     StartMove( 3, event );
  1334.     
  1335.     return TRUE;
  1336. }
  1337.  
  1338. @end-code;
  1339.  
  1340. @begin-code Code "Form1::pictb_5_Create"
  1341.  
  1342. WBool Form1::pictb_5_Create(
  1343.     WObject           *source,
  1344.     WCreateEventData        *event )
  1345. {
  1346.     return TRUE;
  1347. }
  1348.  
  1349. @end-code;
  1350.  
  1351. @begin-code Code "Form1::pictb_5_DragContinue"
  1352.  
  1353. WBool Form1::pictb_5_DragContinue(
  1354.     WObject           *source,
  1355.     WDragEventData        *event )
  1356. {
  1357.     Continue( event );
  1358.     
  1359.     return TRUE;
  1360. }
  1361.  
  1362. @end-code;
  1363.  
  1364. @begin-code Code "Form1::pictb_5_DragEnd"
  1365.  
  1366. WBool Form1::pictb_5_DragEnd(
  1367.     WObject           *source,
  1368.     WDragEventData        *event )
  1369. {
  1370.     Place( pictb_5, event );    
  1371.     return TRUE;
  1372. }
  1373.  
  1374. @end-code;
  1375.  
  1376. @begin-code Code "Form1::pictb_5_DragFeedback"
  1377.  
  1378. WBool Form1::pictb_5_DragFeedback(
  1379.     WObject           *source,
  1380.     WDragEventData        *event )
  1381. {
  1382.     WDragEventData * d_Ev = (WDragEventData *) event;
  1383.     Feedback( d_Ev );
  1384.     
  1385.     return FALSE;
  1386. }
  1387.  
  1388. @end-code;
  1389.  
  1390. @begin-code Code "Form1::pictb_5_DragStart"
  1391.  
  1392. WBool Form1::pictb_5_DragStart(
  1393.     WObject           *source,
  1394.     WDragEventData        *event )
  1395. {
  1396.     StartMove( 4, event );
  1397.     
  1398.     return TRUE;
  1399. }
  1400.  
  1401. @end-code;
  1402.  
  1403. @begin-code Code "Form1::pictb_6_Create"
  1404.  
  1405. WBool Form1::pictb_6_Create(
  1406.     WObject           *source,
  1407.     WCreateEventData        *event )
  1408. {
  1409.     return TRUE;
  1410. }
  1411.  
  1412. @end-code;
  1413.  
  1414. @begin-code Code "Form1::pictb_6_DragContinue"
  1415.  
  1416. WBool Form1::pictb_6_DragContinue(
  1417.     WObject           *source,
  1418.     WDragEventData        *event )
  1419. {
  1420.     Continue( event );
  1421.     
  1422.     return TRUE;
  1423. }
  1424.  
  1425. @end-code;
  1426.  
  1427. @begin-code Code "Form1::pictb_6_DragEnd"
  1428.  
  1429. WBool Form1::pictb_6_DragEnd(
  1430.     WObject           *source,
  1431.     WDragEventData        *event )
  1432. {
  1433.     Place( pictb_6, event );    
  1434.     return TRUE;
  1435. }
  1436.  
  1437. @end-code;
  1438.  
  1439. @begin-code Code "Form1::pictb_6_DragFeedback"
  1440.  
  1441. WBool Form1::pictb_6_DragFeedback(
  1442.     WObject           *source,
  1443.     WDragEventData        *event )
  1444. {
  1445.     WDragEventData * d_Ev = (WDragEventData *) event;
  1446.     Feedback( d_Ev );
  1447.     
  1448.     return FALSE;
  1449. }
  1450.  
  1451. @end-code;
  1452.  
  1453. @begin-code Code "Form1::pictb_6_DragStart"
  1454.  
  1455. WBool Form1::pictb_6_DragStart(
  1456.     WObject           *source,
  1457.     WDragEventData        *event )
  1458. {
  1459.     StartMove( 5, event );
  1460.     
  1461.     return TRUE;
  1462. }
  1463.  
  1464. @end-code;
  1465.  
  1466. @begin-code Code "Form1::pictb_7_Create"
  1467.  
  1468. WBool Form1::pictb_7_Create(
  1469.     WObject           *source,
  1470.     WCreateEventData        *event )
  1471. {
  1472.     return TRUE;
  1473. }
  1474.  
  1475. @end-code;
  1476.  
  1477. @begin-code Code "Form1::pictb_7_DragContinue"
  1478.  
  1479. WBool Form1::pictb_7_DragContinue(
  1480.     WObject           *source,
  1481.     WDragEventData        *event )
  1482. {
  1483.     Continue( event );
  1484.     
  1485.     return TRUE;
  1486. }
  1487.  
  1488. @end-code;
  1489.  
  1490. @begin-code Code "Form1::pictb_7_DragEnd"
  1491.  
  1492. WBool Form1::pictb_7_DragEnd(
  1493.     WObject           *source,
  1494.     WDragEventData        *event )
  1495. {
  1496.     Place( pictb_7, event );
  1497.     return TRUE;
  1498. }
  1499.  
  1500. @end-code;
  1501.  
  1502. @begin-code Code "Form1::pictb_7_DragFeedback"
  1503.  
  1504. WBool Form1::pictb_7_DragFeedback(
  1505.     WObject           *source,
  1506.     WDragEventData        *event )
  1507. {
  1508.     WDragEventData * d_Ev = (WDragEventData *) event;
  1509.     Feedback( d_Ev );
  1510.     
  1511.     return FALSE;
  1512. }
  1513.  
  1514. @end-code;
  1515.  
  1516. @begin-code Code "Form1::pictb_7_DragStart"
  1517.  
  1518. WBool Form1::pictb_7_DragStart(
  1519.     WObject           *source,
  1520.     WDragEventData        *event )
  1521. {
  1522.     StartMove( 6, event );
  1523.     
  1524.     return TRUE;
  1525. }
  1526.  
  1527. @end-code;
  1528.  
  1529. @begin-code Code "Form1::pictb_8_Create"
  1530.  
  1531. WBool Form1::pictb_8_Create(
  1532.     WObject           *source,
  1533.     WCreateEventData        *event )
  1534. {
  1535.     return TRUE;
  1536. }
  1537.  
  1538. @end-code;
  1539.  
  1540. @begin-code Code "Form1::pictb_8_DragContinue"
  1541.  
  1542. WBool Form1::pictb_8_DragContinue(
  1543.     WObject           *source,
  1544.     WDragEventData        *event )
  1545. {
  1546.     Continue( event );
  1547.     
  1548.     return TRUE;
  1549. }
  1550.  
  1551. @end-code;
  1552.  
  1553. @begin-code Code "Form1::pictb_8_DragEnd"
  1554.  
  1555. WBool Form1::pictb_8_DragEnd(
  1556.     WObject           *source,
  1557.     WDragEventData        *event )
  1558. {
  1559.     Place( pictb_8, event );
  1560.     return TRUE;
  1561. }
  1562.  
  1563. @end-code;
  1564.  
  1565. @begin-code Code "Form1::pictb_8_DragFeedback"
  1566.  
  1567. WBool Form1::pictb_8_DragFeedback(
  1568.     WObject           *source,
  1569.     WDragEventData        *event )
  1570. {
  1571.     WDragEventData * d_Ev = (WDragEventData *) event;
  1572.     Feedback( d_Ev );
  1573.     
  1574.     return FALSE;
  1575. }
  1576.  
  1577. @end-code;
  1578.  
  1579. @begin-code Code "Form1::pictb_8_DragStart"
  1580.  
  1581. WBool Form1::pictb_8_DragStart(
  1582.     WObject           *source,
  1583.     WDragEventData        *event )
  1584. {
  1585.     StartMove( 7, event );
  1586.     
  1587.     return TRUE;
  1588. }
  1589.  
  1590. @end-code;
  1591.  
  1592. @begin-code Code "Form1::pictb_9_Create"
  1593.  
  1594. WBool Form1::pictb_9_Create(
  1595.     WObject           *source,
  1596.     WCreateEventData        *event )
  1597. {
  1598.     return TRUE;
  1599. }
  1600.  
  1601. @end-code;
  1602.  
  1603. @begin-code Code "Form1::pictb_9_DragContinue"
  1604.  
  1605. WBool Form1::pictb_9_DragContinue(
  1606.     WObject           *source,
  1607.     WDragEventData        *event )
  1608. {
  1609.     Continue( event );
  1610.     
  1611.     return TRUE;
  1612. }
  1613.  
  1614. @end-code;
  1615.  
  1616. @begin-code Code "Form1::pictb_9_DragEnd"
  1617.  
  1618. WBool Form1::pictb_9_DragEnd(
  1619.     WObject           *source,
  1620.     WDragEventData        *event )
  1621. {
  1622.     Place( pictb_9, event );
  1623.     return TRUE;
  1624. }
  1625.  
  1626. @end-code;
  1627.  
  1628. @begin-code Code "Form1::pictb_9_DragFeedback"
  1629.  
  1630. WBool Form1::pictb_9_DragFeedback(
  1631.     WObject           *source,
  1632.     WDragEventData        *event )
  1633. {
  1634.     WDragEventData * d_Ev = (WDragEventData *) event;
  1635.     Feedback( d_Ev );
  1636.     
  1637.     return FALSE;
  1638. }
  1639.  
  1640. @end-code;
  1641.  
  1642. @begin-code Code "Form1::pictb_9_DragStart"
  1643.  
  1644. WBool Form1::pictb_9_DragStart(
  1645.     WObject           *source,
  1646.     WDragEventData        *event )
  1647. {
  1648.     StartMove( 8, event );
  1649.     
  1650.     return TRUE;
  1651. }
  1652.  
  1653. @end-code;
  1654. @end;
  1655.