comp.lang.ada
 help / color / mirror / Atom feed
* Ada 9X Windows Question
@ 1993-06-08  1:13 enterpoop.mit.edu!eru.mt.luth.se!kth.se!sunic!mcsun!uknet!pipex!bnr.co.uk
  0 siblings, 0 replies; only message in thread
From: enterpoop.mit.edu!eru.mt.luth.se!kth.se!sunic!mcsun!uknet!pipex!bnr.co.uk @ 1993-06-08  1:13 UTC (permalink / raw)


A general question on standards and portability concerning
object-oriented programming in Ada 9X for Microsoft Windows.  I am
trying to guess as to a standard mapping from the event-callback
mechanism of MS-Windows to the tagged type semantics of Ada 9X. 
Looking at the big picture, it is obvious that the C++ and Borland
Pascal mappings are a kluge, and follow no apparent standards
(particularly Borland - no surprise).  To demonstrate the variety,
here is a Windows button example in 3 different OOLs.

--------------------------------  Borland Pascal 7.0 ObjectWindows 
type TStepWindow = object(TWindow)
   ...
   procedure WMLButtonDown(var Msg: TMessage); 
     virtual wm_First + wm_LButtonDown;   { strange semantics }
end;
-----------------------------------  Borland C++ 3.0 ObjectWindows 
class TMyWindow : public TWindow
{
public:
   ...
   virtual void WMLButtonDown(RTMessage Msg) = 
     [ WM_FIRST + WM_LBUTTONDOWN ];       // even stranger
};
------------------------------  Microsoft C++ 7.0 Foundation Class
class CMainWnd : public CFrameWnd
{
   ...
public:
   afx_msg void OnLButtonDown( UINT nFlags, CPoint point );
   DECLARE_MESSAGE_MAP();                 // a macro mapping
};

BEGIN_MESSAGE_MAP( CMainWnd, CFrameWnd )
   ON_WM_LBUTTONDOWN()
END_MESSAGE_MAP()
----------------------------------------

Looking at the manuals for the compilers, it's hard to get an
understanding of what parts of the syntax are part of the OOL and
what is hacked on. In comparison, by using case statements at least
you knew the code was portable.

My question is: Will the best Ada 9X approach be to use pragmas and
access procedures as described in Support for Programming Paradigms
(Section 3.2) of the Ada 9X Mapping Rationale; or go with a universal
GUI interface (as yet  undefined), code generator, and library that
cuts across OS's and languages?   And if the former, what would an
example of the calling convention look like, and how would tagged
types fit in the scheme?

I think this is an important issue because of the large fraction of
code involved in a typical application's GUI.  Setting up a standard
early will be just as important for the Windows programmer as the
language user.



J.  Pukite
pukite@vz.cis.umn.edu

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1993-06-08  1:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1993-06-08  1:13 Ada 9X Windows Question enterpoop.mit.edu!eru.mt.luth.se!kth.se!sunic!mcsun!uknet!pipex!bnr.co.uk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox