home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / pascal / 8380 < prev    next >
Encoding:
Internet Message Format  |  1993-01-21  |  5.1 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!srvr1.engin.umich.edu!batcomputer!ghost.dsi.unimi.it!insa-lyon.fr!pc110-02.insa-lyon.fr!ppollet
  2. From: ppollet@cismibm.univ-lyon1.fr (Patrick POLLET)
  3. Newsgroups: comp.lang.pascal
  4. Subject: Re: TurboVision Question (w/ example)
  5. Date: Thu, 21 Jan 1993 08:02:52 GMT
  6. Organization: INSA  CENTRE INFORMATIQUE DU 1er CYCLE
  7. Lines: 109
  8. Message-ID: <ppollet.167.727603372@cismibm.univ-lyon1.fr>
  9. References: <18JAN93.11828326.0055@music.mus.polymtl.ca> <1jgimu$q5@agate.berkeley.edu> <ppollet.156.727460280@cismibm.univ-lyon1.fr> <1993Jan20.183755.19926@ncsu.edu>
  10. NNTP-Posting-Host: pc110-02.insa-lyon.fr
  11.  
  12. In article <1993Jan20.183755.19926@ncsu.edu> samodena@csemail.cropsci.ncsu.edu (S. A. Modena) writes:
  13. >From: samodena@csemail.cropsci.ncsu.edu (S. A. Modena)
  14. >Subject: Re: TurboVision Question (w/ example)
  15. >Date: Wed, 20 Jan 1993 18:37:55 GMT
  16.  
  17. >In article <ppollet.156.727460280@cismibm.univ-lyon1.fr> ppollet@cismibm.univ-lyon1.fr (Patrick POLLET) writes:
  18.  
  19. >Concerning this part of what Patrick says:
  20.  
  21. >>              MyDialog^.SetData(Params);
  22. >>              Desktop^.ExecView(MyDialog);
  23. >>              .......
  24. >>            end     
  25. >>
  26. >>    CAUTION : Since you are executing the Dialog by ExecView, The 
  27. >>application is "put in the background" until the dialog is closed!
  28. >>So there is no way for the appliaction to update the content of the 
  29. >>paramtext while the dialog is ON SCREEN ....It could be done by the
  30. >>dialog itself in its method HandleEvent, provided it "knows" the 
  31.      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  32. >>identifiers of the variables that hold the actual data... 
  33.  
  34.  
  35. >Unfortunately, this is misleadingly incorrect.....Patrick has read
  36. >the TV book and misinterpretted it.  :^)
  37.  
  38. [ Stuff deleted ]
  39.  
  40. .......
  41.  
  42. >For example, in one of my applications, I pop a dialog box to look at
  43. >a dataset (a TSortedCollection of records).  One of the buttons in the
  44. >dialog box is labelled "Master": it pops a master list dialog of fill-in
  45. >values suitable for insertion into my dataset.  So I click on the
  46. >"Master" button, an overlapping dialog box pops and my first dialog
  47. >box (now partially visible) "freezes."  I double click on a item in a listbox
  48. >and it is MESSAGEs the selection to the overlapped database dialog, which 
  49. >creates a
  50. >new record with it, inserts it into the TSortedCollection, redraws the
  51. >list box to show the newly inserted record, updates and redraws a
  52. >a record count static text....all this visible action in a "suspended,"
  53. >non-modal dialog box in "background."
  54.  
  55. >This is known as "event-driven" programming.  Objects talk to each other!
  56.  
  57. >A different route to take for background processes, is to hook onto
  58. >TApplication.Idle and feed broadcast messages to the DeskTop which
  59. >will route them to all inserted views (not just the modal view) for
  60. >processing and responsive actions.
  61.  
  62.  
  63. >Steve
  64.  
  65.     That's exactly what I said... ( by the Dialog itself in its 
  66.      method handleEvent() !!!!!!
  67.  
  68.     In your two examples you had to program response to events in the 
  69. ON SCREEN dialogs for it to react  to focused events:
  70.      -when you clicks on the button MASTER, of the First Dialog .  
  71.      -when you double click on an item of the overlapping Dialog.   
  72.  
  73.    And also you had to adapt the handleevent() methods in the 
  74. other dialogs when they received notification that something has changed 
  75. elsewhere.
  76.  
  77.    Whether it is a broadcast or a focused event makes no difference.
  78.  
  79.    It is the ON SCREEN dialog that detect any modification to some 
  80.    Data and requests all others to update.... 
  81.  
  82.    Even if you do it at the application Idle level, you still have to
  83.    program something like:
  84.  
  85.       If the NewValue of some data has changed 
  86.            send an updating event to Desktop to forward it 
  87.            Update the New value  
  88.  
  89.       This is not really clean programming since the DATA must be global
  90.    and in two occurences (one for the Oldvalue and one for the NewValue...)
  91.    So objects do talk to each others but also uses some global data 
  92.    in common....
  93.  
  94.   In real OOP languages (Frame languages such as Shirka,KL-1,Yafool..) 
  95. objects uses REFLEX-methods  that sense any modification of their 
  96. environnement  and reacts   WITHOUT the need for the object responsible of 
  97. the modification to  signal in some way that something has happened.
  98.   But TP is not a real OOP language by an hybrid language.
  99.  
  100.       OOP do give some real powerful tools to programmer, but one 
  101. should keep in mind the BASIC concepts of modular programming:
  102.     -the minimal amount of global data
  103.     -the mimimal interdependance of modules (whether objects or simple
  104.        procedures) to each other.
  105.     -no object should have a direct reference to another one 
  106.  
  107.      
  108.  
  109.     
  110. ppollet@cismibm.univ-lyon1.fr (Patrick POLLET)
  111. --------------------------------------------------------
  112. Dr Patrick L.Pollet
  113. Institut National des Sciences Appliquees
  114. Centre Informatique du 1er Cycle  Bat 110
  115. 20 Avenue A.Einstein
  116. 69621 Villeurbanne Cedex France
  117. --------------------------------------------------------
  118. Phone: 72 43 83 80 -   la premiere erreur c'est
  119. Fax  : 72 43 85 33 -   de se lever le matin  ... GASTON
  120. -------------------------------------------------------
  121.