home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / pgehdl.zip / test.cpp < prev    next >
C/C++ Source or Header  |  1996-02-27  |  27KB  |  728 lines

  1. /*******************************************************************************
  2. * FILE NAME: test.cpp                                                          *
  3. *                                                                              *
  4. * DESCRIPTION:                                                                 *
  5. *   Class implementation of the class:                                         *
  6. *     test                                                                     *
  7. * ---------------------------------------------------------------------------- *
  8. * Warning: This file was generated by the VisualAge C++ Visual Builder.        *
  9. * Modifications to this source file will be lost when the part is regenerated. *
  10. *******************************************************************************/
  11. #ifndef _IFRAME_
  12. #include <iframe.hpp>
  13. #endif
  14.  
  15. #ifndef _ICANVAS_
  16. #include <icanvas.hpp>
  17. #endif
  18.  
  19. #ifndef _INOTEBK_
  20. #include <inotebk.hpp>
  21. #endif
  22.  
  23. #ifndef _IPOINT_
  24. #include <ipoint.hpp>
  25. #endif
  26.  
  27. #ifndef _IRECT_
  28. #include <irect.hpp>
  29. #endif
  30.  
  31. #ifndef _IVBNBKPG_
  32. #include <ivbnbkpg.hpp>
  33. #endif
  34.  
  35. #ifndef _IENTRYFD_
  36. #include <ientryfd.hpp>
  37. #endif
  38.  
  39. #ifndef _IPUSHBUT_
  40. #include <ipushbut.hpp>
  41. #endif
  42.  
  43. #ifndef _ISTATTXT_
  44. #include <istattxt.hpp>
  45. #endif
  46.  
  47. #ifndef _APAGEHANDLER_
  48. #include "PgHndler.hpp"
  49. #endif
  50.  
  51. #ifndef _INOTIFEV_
  52. #include <inotifev.hpp>
  53. #endif
  54.  
  55. #ifndef _IOBSERVR_
  56. #include <iobservr.hpp>
  57. #endif
  58.  
  59. #ifndef _ISTDNTFY_
  60. #include <istdntfy.hpp>
  61. #endif
  62.  
  63. #ifndef _TEST_
  64. #include "test.hpp"
  65. #endif
  66.  
  67. #ifndef _IVBDEFS_
  68. #include <ivbdefs.h>
  69. #endif
  70.  
  71. #ifndef _ITRACE_
  72. #include <itrace.hpp>
  73. #endif
  74.  
  75.  
  76. //*****************************************************************************
  77. // Class definition for testConn0
  78. //*****************************************************************************
  79. class testConn0 : public IObserver, public IStandardNotifier {
  80. public:
  81.    virtual  ~testConn0(){};
  82.  
  83.    //---------------------------------------------------------------------------
  84.    // public member functions
  85.    //---------------------------------------------------------------------------
  86.    void initialize(IPushButton * aSource, APageHandler * aTarget)
  87.       {source = aSource; target = aTarget; enableNotification(); };
  88.    testConn0 & setNotebk(INotebook * aSelf) {iNotebk = aSelf; return *this;};
  89.  
  90. protected:
  91.    //---------------------------------------------------------------------------
  92.    // protected member functions
  93.    //---------------------------------------------------------------------------
  94.    virtual IObserver & dispatchNotificationEvent(const INotificationEvent & anEvent)
  95.       {
  96.       if (anEvent.notificationId() == IPushButton::buttonClickId)
  97.          {
  98.          IFUNCTRACE_DEVELOP();
  99.          ITRACE_DEVELOP(" firing connection : PushButton1(buttonClickEvent) to APageHandler1(startHandleFor))");
  100.          try {target->handleFor(iNotebk);}
  101.          catch (IException& exc) {};
  102.          }
  103.       return(*this);
  104.       };
  105.  
  106. private:
  107.    //---------------------------------------------------------------------------
  108.    // private member data
  109.    //---------------------------------------------------------------------------
  110.    IPushButton * source;
  111.    APageHandler * target;
  112.    INotebook * iNotebk;
  113.  
  114.  
  115. };   //testConn0
  116.  
  117.  
  118. //*****************************************************************************
  119. // Class definition for testConn2
  120. //*****************************************************************************
  121. class testConn2 : public IObserver, public IStandardNotifier {
  122. public:
  123.    virtual  ~testConn2(){};
  124.  
  125.    //---------------------------------------------------------------------------
  126.    // public member functions
  127.    //---------------------------------------------------------------------------
  128.    void initialize(IPushButton * aSource, APageHandler * aTarget)
  129.       {source = aSource; target = aTarget; enableNotification(); };
  130.    testConn2 & setNotebk(INotebook * aSelf) {iNotebk = aSelf; return *this;};
  131.  
  132. protected:
  133.    //---------------------------------------------------------------------------
  134.    // protected member functions
  135.    //---------------------------------------------------------------------------
  136.    virtual IObserver & dispatchNotificationEvent(const INotificationEvent & anEvent)
  137.       {
  138.       if (anEvent.notificationId() == IPushButton::buttonClickId)
  139.          {
  140.          IFUNCTRACE_DEVELOP();
  141.          ITRACE_DEVELOP(" firing connection : PushButton2(buttonClickEvent) to APageHandler1(stopHandleFor))");
  142.          try {target->stopHandleFor(iNotebk);}
  143.          catch (IException& exc) {};
  144.          }
  145.       return(*this);
  146.       };
  147.  
  148. private:
  149.    //---------------------------------------------------------------------------
  150.    // private member data
  151.    //---------------------------------------------------------------------------
  152.    IPushButton * source;
  153.    APageHandler * target;
  154.    INotebook * iNotebk;
  155.  
  156.  
  157. };   //testConn2
  158.  
  159.  
  160. //*****************************************************************************
  161. // Class definition for testConn4
  162. //*****************************************************************************
  163. class testConn4 : public IObserver, public IStandardNotifier {
  164. public:
  165.    virtual  ~testConn4(){};
  166.  
  167.    //---------------------------------------------------------------------------
  168.    // public member functions
  169.    //---------------------------------------------------------------------------
  170.    void initialize(APageHandler * aSource, IEntryField * aTarget)
  171.       {source = aSource; target = aTarget; enableNotification(); };
  172.    testConn4 & setNewValue(APageHandler * aSelf) {iNewValue = aSelf; return *this;};
  173.  
  174. protected:
  175.    //---------------------------------------------------------------------------
  176.    // protected member functions
  177.    //---------------------------------------------------------------------------
  178.    virtual IObserver & dispatchNotificationEvent(const INotificationEvent & anEvent)
  179.       {
  180.       if (anEvent.notificationId() == APageHandler::page3SelectedEventId)
  181.          {
  182.          IFUNCTRACE_DEVELOP();
  183.          ITRACE_DEVELOP(" firing connection : APageHandler1(page3SelectedEvent) to EntryField3(valueAsInt))");
  184.          try {target->VBSETTEXTFROMVALUE(iNewValue->currentPageNumber());}
  185.          catch (IException& exc) {};
  186.          }
  187.       return(*this);
  188.       };
  189.  
  190. private:
  191.    //---------------------------------------------------------------------------
  192.    // private member data
  193.    //---------------------------------------------------------------------------
  194.    APageHandler * source;
  195.    IEntryField * target;
  196.    APageHandler * iNewValue;
  197.  
  198.  
  199. };   //testConn4
  200.  
  201.  
  202. //*****************************************************************************
  203. // Class definition for testConn6
  204. //*****************************************************************************
  205. class testConn6 : public IObserver, public IStandardNotifier {
  206. public:
  207.    virtual  ~testConn6(){};
  208.  
  209.    //---------------------------------------------------------------------------
  210.    // public member functions
  211.    //---------------------------------------------------------------------------
  212.    void initialize(APageHandler * aSource, IEntryField * aTarget)
  213.       {source = aSource; target = aTarget; enableNotification(); };
  214.    testConn6 & setNewValue(APageHandler * aSelf) {iNewValue = aSelf; return *this;};
  215.  
  216. protected:
  217.    //---------------------------------------------------------------------------
  218.    // protected member functions
  219.    //---------------------------------------------------------------------------
  220.    virtual IObserver & dispatchNotificationEvent(const INotificationEvent & anEvent)
  221.       {
  222.       if (anEvent.notificationId() == APageHandler::page1SelectedEventId)
  223.          {
  224.          IFUNCTRACE_DEVELOP();
  225.          ITRACE_DEVELOP(" firing connection : APageHandler1(page1SelectedEvent) to EntryField4(valueAsInt))");
  226.          try {target->VBSETTEXTFROMVALUE(iNewValue->currentPageNumber());}
  227.          catch (IException& exc) {};
  228.          }
  229.       return(*this);
  230.       };
  231.  
  232. private:
  233.    //---------------------------------------------------------------------------
  234.    // private member data
  235.    //---------------------------------------------------------------------------
  236.    APageHandler * source;
  237.    IEntryField * target;
  238.    APageHandler * iNewValue;
  239.  
  240.  
  241. };   //testConn6
  242.  
  243.  
  244. //*****************************************************************************
  245. // Class definition for testConn8
  246. //*****************************************************************************
  247. class testConn8 : public IObserver, public IStandardNotifier {
  248. public:
  249.    virtual  ~testConn8(){};
  250.  
  251.    //---------------------------------------------------------------------------
  252.    // public member functions
  253.    //---------------------------------------------------------------------------
  254.    void initialize(APageHandler * aSource, IEntryField * aTarget)
  255.       {source = aSource; target = aTarget; enableNotification(); };
  256.    testConn8 & setNewValue(APageHandler * aSelf) {iNewValue = aSelf; return *this;};
  257.  
  258. protected:
  259.    //---------------------------------------------------------------------------
  260.    // protected member functions
  261.    //---------------------------------------------------------------------------
  262.    virtual IObserver & dispatchNotificationEvent(const INotificationEvent & anEvent)
  263.       {
  264.       if (anEvent.notificationId() == APageHandler::page2SelectedEventId)
  265.          {
  266.          IFUNCTRACE_DEVELOP();
  267.          ITRACE_DEVELOP(" firing connection : APageHandler1(page2SelectedEvent) to EntryField5(valueAsInt))");
  268.          try {target->VBSETTEXTFROMVALUE(iNewValue->currentPageNumber());}
  269.          catch (IException& exc) {};
  270.          }
  271.       return(*this);
  272.       };
  273.  
  274. private:
  275.    //---------------------------------------------------------------------------
  276.    // private member data
  277.    //---------------------------------------------------------------------------
  278.    APageHandler * source;
  279.    IEntryField * target;
  280.    APageHandler * iNewValue;
  281.  
  282.  
  283. };   //testConn8
  284.  
  285.  
  286. //*****************************************************************************
  287. // Class definition for testConn10
  288. //*****************************************************************************
  289. class testConn10 : public IObserver {
  290. public:
  291.    virtual  ~testConn10(){};
  292.  
  293.    //---------------------------------------------------------------------------
  294.    // public member functions
  295.    //---------------------------------------------------------------------------
  296.    void initialize(APageHandler * aSource, IEntryField * aTarget)
  297.       {source = aSource; target = aTarget; aligning = false; };
  298.    void setSource()
  299.       {
  300.       if (aligning==false) {
  301.          IFUNCTRACE_DEVELOP();
  302.          ITRACE_DEVELOP(" firing connection : APageHandler1(currentPageNumber) to EntryField1(valueAsInt))");
  303.          ITRACE_DEVELOP(" setting source from target ");
  304.          aligning = true;
  305.          try {source->setCurrentPageNumber(target->VBINTVALUEFROMTEXT());}
  306.          catch (IException& exc) {};
  307.          aligning = false;
  308.          }
  309.       };
  310.    void setTarget()
  311.       {
  312.       if (aligning==false) {
  313.          IFUNCTRACE_DEVELOP();
  314.          ITRACE_DEVELOP(" firing connection : APageHandler1(currentPageNumber) to EntryField1(valueAsInt))");
  315.          ITRACE_DEVELOP(" setting target from source ");
  316.          aligning = true;
  317.          try {target->VBSETTEXTFROMVALUE(source->currentPageNumber());}
  318.          catch (IException& exc) {};
  319.          aligning = false;
  320.          }
  321.       };
  322.  
  323. protected:
  324.    //---------------------------------------------------------------------------
  325.    // protected member functions
  326.    //---------------------------------------------------------------------------
  327.    virtual IObserver & dispatchNotificationEvent(const INotificationEvent & anEvent)
  328.       {
  329.       if (anEvent.notificationId() == VBINITIALIZEID) setTarget();
  330.       if ((anEvent.notificationId() == APageHandler::currentPageNumberId) && (source == &anEvent.notifier()))
  331.          setTarget();  /* set target to source value */
  332.       else
  333.       if ((anEvent.notificationId() == IEntryField::textId) && (target == &anEvent.notifier()))
  334.          setSource();  /* set source to target value */
  335.       return(*this);
  336.       };
  337.  
  338. private:
  339.    //---------------------------------------------------------------------------
  340.    // private member data
  341.    //---------------------------------------------------------------------------
  342.    APageHandler * source;
  343.    IEntryField * target;
  344.    Boolean aligning;
  345.  
  346.  
  347. };   //testConn10
  348.  
  349.  
  350. //*****************************************************************************
  351. // Class definition for testConn11
  352. //*****************************************************************************
  353. class testConn11 : public IObserver {
  354. public:
  355.    virtual  ~testConn11(){};
  356.  
  357.    //---------------------------------------------------------------------------
  358.    // public member functions
  359.    //---------------------------------------------------------------------------
  360.    void initialize(APageHandler * aSource, IEntryField * aTarget)
  361.       {source = aSource; target = aTarget; aligning = false; };
  362.    void setSource()
  363.       {
  364.       if (aligning==false) {
  365.          IFUNCTRACE_DEVELOP();
  366.          ITRACE_DEVELOP(" firing connection : APageHandler1(previousPageNumber) to EntryField2(valueAsInt))");
  367.          ITRACE_DEVELOP(" setting source from target ");
  368.          aligning = true;
  369.          try {source->setPreviousPageNumber(target->VBINTVALUEFROMTEXT());}
  370.          catch (IException& exc) {};
  371.          aligning = false;
  372.          }
  373.       };
  374.    void setTarget()
  375.       {
  376.       if (aligning==false) {
  377.          IFUNCTRACE_DEVELOP();
  378.          ITRACE_DEVELOP(" firing connection : APageHandler1(previousPageNumber) to EntryField2(valueAsInt))");
  379.          ITRACE_DEVELOP(" setting target from source ");
  380.          aligning = true;
  381.          try {target->VBSETTEXTFROMVALUE(source->previousPageNumber());}
  382.          catch (IException& exc) {};
  383.          aligning = false;
  384.          }
  385.       };
  386.  
  387. protected:
  388.    //---------------------------------------------------------------------------
  389.    // protected member functions
  390.    //---------------------------------------------------------------------------
  391.    virtual IObserver & dispatchNotificationEvent(const INotificationEvent & anEvent)
  392.       {
  393.       if (anEvent.notificationId() == VBINITIALIZEID) setTarget();
  394.       if ((anEvent.notificationId() == APageHandler::previousPageNumberId) && (source == &anEvent.notifier()))
  395.          setTarget();  /* set target to source value */
  396.       else
  397.       if ((anEvent.notificationId() == IEntryField::textId) && (target == &anEvent.notifier()))
  398.          setSource();  /* set source to target value */
  399.       return(*this);
  400.       };
  401.  
  402. private:
  403.    //---------------------------------------------------------------------------
  404.    // private member data
  405.    //---------------------------------------------------------------------------
  406.    APageHandler * source;
  407.    IEntryField * target;
  408.    Boolean aligning;
  409.  
  410.  
  411. };   //testConn11
  412.  
  413.  
  414. //*****************************************************************************
  415. // Class definition for testConn12
  416. //*****************************************************************************
  417. class testConn12 : public IObserver, public IStandardNotifier {
  418. public:
  419.    virtual  ~testConn12(){};
  420.  
  421.    //---------------------------------------------------------------------------
  422.    // public member functions
  423.    //---------------------------------------------------------------------------
  424.    void initialize(APageHandler * aSource, IEntryField * aTarget)
  425.       {source = aSource; target = aTarget; enableNotification(); };
  426.  
  427. protected:
  428.    //---------------------------------------------------------------------------
  429.    // protected member functions
  430.    //---------------------------------------------------------------------------
  431.    virtual IObserver & dispatchNotificationEvent(const INotificationEvent & anEvent)
  432.       {
  433.       if (anEvent.notificationId() == APageHandler::anyPageSelectedEventId)
  434.          {
  435.          IFUNCTRACE_DEVELOP();
  436.          ITRACE_DEVELOP(" firing connection : APageHandler1(anyPageSelectedEvent) to EntryField6(customLogic, \"set ef to the selected page number\"))");
  437.          try {codeSnippet(&anEvent);}
  438.          catch (IException& exc) {};
  439.          }
  440.       return(*this);
  441.       };
  442.  
  443. private:
  444.    //---------------------------------------------------------------------------
  445.    // private member functions
  446.    //---------------------------------------------------------------------------
  447.    void codeSnippet(const INotificationEvent* event)
  448.       {
  449.       // get page number from IEventData object.
  450.       // event->eventData returns en IEventData object.
  451.  
  452.       target->VBSETTEXTFROMVALUE(event->eventData().asLong());
  453.       };
  454.  
  455.    //---------------------------------------------------------------------------
  456.    // private member data
  457.    //---------------------------------------------------------------------------
  458.    APageHandler * source;
  459.    IEntryField * target;
  460.  
  461.  
  462. };   //testConn12
  463.  
  464.  
  465. #pragma export (test::readyId)
  466. const INotificationId test::readyId = "test::readyId";
  467.  
  468. #pragma export (test::partWindowId)
  469. unsigned long test::partWindowId = 0;
  470.  
  471. //------------------------------------------------------------------------------
  472. // test :: defaultFramingSpec
  473. //------------------------------------------------------------------------------
  474. #pragma export (test::defaultFramingSpec())
  475. const IRectangle test::defaultFramingSpec()
  476. {
  477.    return(IRectangle(IPoint(30, IWindow::desktopWindow()->size().height() - -2 - 416),ISize(545, 416)));
  478. }
  479.  
  480.  
  481. //------------------------------------------------------------------------------
  482. // test :: defaultTitle
  483. //------------------------------------------------------------------------------
  484. #pragma export (test::defaultTitle())
  485. IString test::defaultTitle()
  486. {
  487.    return("IPageHandler example");
  488. }
  489.  
  490.  
  491. //------------------------------------------------------------------------------
  492. // test :: test
  493. //------------------------------------------------------------------------------
  494. #pragma export (test::test(unsigned long, IWindow*, IWindow*, const IRectangle&, const IFrameWindow::Style&, const char*))
  495. test::test(
  496.       unsigned long id, 
  497.       IWindow* parent, 
  498.       IWindow* owner, 
  499.       const IRectangle& rect, 
  500.       const IFrameWindow::Style& style, 
  501.       const char* title)
  502.    : IFrameWindow((partWindowId) ? partWindowId : id, parent, owner, rect, style, title)
  503. {
  504.    partWindowId = (partWindowId) ? partWindowId : id;
  505.    iCanvas = new ICanvas(
  506.       IC_FRAME_CLIENT_ID, 
  507.       this, 
  508.       this, 
  509.       IRectangle());
  510.    iNotebook1 = new INotebook(
  511.       partWindowId+WNDOFFSET_test_Notebook1, 
  512.       iCanvas, 
  513.       iCanvas, 
  514.       IRectangle(IPoint(18,136),ISize(438, 220)));
  515.    iCanvas2 = new ICanvas(
  516.       partWindowId+WNDOFFSET_test_Canvas2, 
  517.       iNotebook1, 
  518.       iNotebook1, 
  519.       IRectangle());
  520.    iEntryField4 = new IEntryField(
  521.       partWindowId+WNDOFFSET_test_EntryField4, 
  522.       iCanvas2, 
  523.       iCanvas2, 
  524.       IRectangle(IPoint(54,93),ISize(200, 25)));
  525.    iVBNotebookPage = new IVBNotebookPage(iNotebook1, INotebook::PageSettings::majorTab | INotebook::PageSettings::autoPageSize, iCanvas2);
  526.    iCanvas1 = new ICanvas(
  527.       partWindowId+WNDOFFSET_test_Canvas1, 
  528.       iNotebook1, 
  529.       iNotebook1, 
  530.       IRectangle());
  531.    iEntryField5 = new IEntryField(
  532.       partWindowId+WNDOFFSET_test_EntryField5, 
  533.       iCanvas1, 
  534.       iCanvas1, 
  535.       IRectangle(IPoint(54,97),ISize(237, 26)));
  536.    iVBNotebookPage1 = new IVBNotebookPage(iNotebook1, INotebook::PageSettings::majorTab | INotebook::PageSettings::autoPageSize, iCanvas1);
  537.    iCanvas3 = new ICanvas(
  538.       partWindowId+WNDOFFSET_test_Canvas3, 
  539.       iNotebook1, 
  540.       iNotebook1, 
  541.       IRectangle());
  542.    iEntryField3 = new IEntryField(
  543.       partWindowId+WNDOFFSET_test_EntryField3, 
  544.       iCanvas3, 
  545.       iCanvas3, 
  546.       IRectangle(IPoint(65,111),ISize(235, 25)));
  547.    iVBNotebookPage2 = new IVBNotebookPage(iNotebook1, INotebook::PageSettings::majorTab | INotebook::PageSettings::autoPageSize, iCanvas3);
  548.    iEntryField1 = new IEntryField(
  549.       partWindowId+WNDOFFSET_test_EntryField1, 
  550.       iCanvas, 
  551.       iCanvas, 
  552.       IRectangle(IPoint(19,74),ISize(161, 26)));
  553.    iPushButton1 = new IPushButton(
  554.       partWindowId+WNDOFFSET_test_PushButton1, 
  555.       iCanvas, 
  556.       iCanvas, 
  557.       IRectangle(IPoint(85,25),ISize(124, 34)));
  558.    iPushButton2 = new IPushButton(
  559.       partWindowId+WNDOFFSET_test_PushButton2, 
  560.       iCanvas, 
  561.       iCanvas, 
  562.       IRectangle(IPoint(268,24),ISize(121, 34)));
  563.    iEntryField2 = new IEntryField(
  564.       partWindowId+WNDOFFSET_test_EntryField2, 
  565.       iCanvas, 
  566.       iCanvas, 
  567.       IRectangle(IPoint(205,71),ISize(148, 27)));
  568.    iStaticText1 = new IStaticText(
  569.       partWindowId+WNDOFFSET_test_StaticText1, 
  570.       iCanvas, 
  571.       iCanvas, 
  572.       IRectangle(IPoint(19,102),ISize(158, 25)));
  573.    iStaticText2 = new IStaticText(
  574.       partWindowId+WNDOFFSET_test_StaticText2, 
  575.       iCanvas, 
  576.       iCanvas, 
  577.       IRectangle(IPoint(205,102),ISize(138, 25)));
  578.    iEntryField6 = new IEntryField(
  579.       partWindowId+WNDOFFSET_test_EntryField6, 
  580.       iCanvas, 
  581.       iCanvas, 
  582.       IRectangle(IPoint(392,72),ISize(129, 24)));
  583.    iAPageHandler1 = new APageHandler();
  584.  
  585.    conn0 = new testConn0();
  586.    conn2 = new testConn2();
  587.    conn4 = new testConn4();
  588.    conn6 = new testConn6();
  589.    conn8 = new testConn8();
  590.    conn10 = new testConn10();
  591.    conn11 = new testConn11();
  592.    conn12 = new testConn12();
  593.  
  594.    this->setFocus();
  595.    this->setClient(iCanvas);
  596.    iNotebook1->setMinorTabSize(ISize(0, 0));
  597.    iVBNotebookPage->setTabText("Tab1");
  598.    iCanvas2->setMinimumSize(ISize(100, 100));
  599.    iVBNotebookPage1->setTabText("Tab2");
  600.    iCanvas1->setMinimumSize(ISize(100, 100));
  601.    iVBNotebookPage2->setTabText("Tab3");
  602.    iCanvas3->setMinimumSize(ISize(100, 100));
  603.    iPushButton1->setText("start handle");
  604.    iPushButton2->setText("stop handle");
  605.    iStaticText1->setText("current pg number");
  606.    iStaticText2->setText("previous page #");
  607. }     //end constructor
  608.  
  609.  
  610. //------------------------------------------------------------------------------
  611. // test :: ~test
  612. //------------------------------------------------------------------------------
  613. #pragma export (test::~test())
  614. test::~test()
  615. {
  616.    conn0->stopHandlingNotificationsFor(*iPushButton1);
  617.    conn2->stopHandlingNotificationsFor(*iPushButton2);
  618.    conn4->stopHandlingNotificationsFor(*iAPageHandler1);
  619.    conn6->stopHandlingNotificationsFor(*iAPageHandler1);
  620.    conn8->stopHandlingNotificationsFor(*iAPageHandler1);
  621.    conn10->stopHandlingNotificationsFor(*iAPageHandler1);
  622.    conn10->stopHandlingNotificationsFor(*iEntryField1);
  623.    conn11->stopHandlingNotificationsFor(*iAPageHandler1);
  624.    conn11->stopHandlingNotificationsFor(*iEntryField2);
  625.    conn12->stopHandlingNotificationsFor(*iAPageHandler1);
  626.  
  627.    delete conn0;
  628.    delete conn2;
  629.    delete conn4;
  630.    delete conn6;
  631.    delete conn8;
  632.    delete conn10;
  633.    delete conn11;
  634.    delete conn12;
  635.  
  636.  
  637.    delete iCanvas;
  638.    delete iNotebook1;
  639.    delete iVBNotebookPage;
  640.    delete iCanvas2;
  641.    delete iEntryField4;
  642.    delete iVBNotebookPage1;
  643.    delete iCanvas1;
  644.    delete iEntryField5;
  645.    delete iVBNotebookPage2;
  646.    delete iCanvas3;
  647.    delete iEntryField3;
  648.    delete iEntryField1;
  649.    delete iPushButton1;
  650.    delete iPushButton2;
  651.    delete iEntryField2;
  652.    delete iStaticText1;
  653.    delete iStaticText2;
  654.    delete iEntryField6;
  655.    delete iAPageHandler1;
  656. }
  657.  
  658. //------------------------------------------------------------------------------
  659. // test :: initializePart
  660. //------------------------------------------------------------------------------
  661. #pragma export (test::initializePart())
  662. test & test::initializePart()
  663. {
  664.    makeConnections();
  665.    notifyObservers(INotificationEvent(readyId, *this));
  666.    return *this;
  667. }
  668.  
  669.  
  670. //------------------------------------------------------------------------------
  671. // test :: makeConnections
  672. //------------------------------------------------------------------------------
  673. #pragma export (test::makeConnections())
  674. Boolean test::makeConnections()
  675. {
  676.    this->enableNotification();
  677.    iCanvas->enableNotification();
  678.    iNotebook1->enableNotification();
  679.    iVBNotebookPage->enableNotification();
  680.    iCanvas2->enableNotification();
  681.    iEntryField4->enableNotification();
  682.    iVBNotebookPage1->enableNotification();
  683.    iCanvas1->enableNotification();
  684.    iEntryField5->enableNotification();
  685.    iVBNotebookPage2->enableNotification();
  686.    iCanvas3->enableNotification();
  687.    iEntryField3->enableNotification();
  688.    iEntryField1->enableNotification();
  689.    iPushButton1->enableNotification();
  690.    iPushButton2->enableNotification();
  691.    iEntryField2->enableNotification();
  692.    iStaticText1->enableNotification();
  693.    iStaticText2->enableNotification();
  694.    iEntryField6->enableNotification();
  695.    iAPageHandler1->enableNotification();
  696.  
  697.    conn0->initialize(iPushButton1, iAPageHandler1);
  698.    conn0->handleNotificationsFor(*iPushButton1);
  699.    conn0->setNotebk(iNotebook1);
  700.    conn2->initialize(iPushButton2, iAPageHandler1);
  701.    conn2->handleNotificationsFor(*iPushButton2);
  702.    conn2->setNotebk(iNotebook1);
  703.    conn4->initialize(iAPageHandler1, iEntryField3);
  704.    conn4->handleNotificationsFor(*iAPageHandler1);
  705.    conn4->setNewValue(iAPageHandler1);
  706.    conn6->initialize(iAPageHandler1, iEntryField4);
  707.    conn6->handleNotificationsFor(*iAPageHandler1);
  708.    conn6->setNewValue(iAPageHandler1);
  709.    conn8->initialize(iAPageHandler1, iEntryField5);
  710.    conn8->handleNotificationsFor(*iAPageHandler1);
  711.    conn8->setNewValue(iAPageHandler1);
  712.    conn10->initialize(iAPageHandler1, iEntryField1);
  713.    conn10->handleNotificationsFor(*iAPageHandler1);
  714.    conn10->handleNotificationsFor(*iEntryField1);
  715.    conn11->initialize(iAPageHandler1, iEntryField2);
  716.    conn11->handleNotificationsFor(*iAPageHandler1);
  717.    conn11->handleNotificationsFor(*iEntryField2);
  718.    conn12->initialize(iAPageHandler1, iEntryField6);
  719.    conn12->handleNotificationsFor(*iAPageHandler1);
  720.  
  721.    conn10->setTarget();
  722.    conn11->setTarget();
  723.    return true;
  724. }
  725.  
  726.  
  727.  
  728.