From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,95dad6602b955ce1 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!g43g2000cwa.googlegroups.com!not-for-mail From: "Lucretia" Newsgroups: comp.lang.ada Subject: Re: Problem with "limited with" in a *real* application Date: 15 Oct 2005 06:48:19 -0700 Organization: http://groups.google.com Message-ID: <1129384099.251293.261930@g43g2000cwa.googlegroups.com> References: <1129043820.987947.200870@z14g2000cwz.googlegroups.com> <1129136767.955381.143030@g47g2000cwa.googlegroups.com> <1129215004.069760.84050@g49g2000cwa.googlegroups.com> <1129220290.938615.36390@o13g2000cwo.googlegroups.com> <1129302185.489627.266900@g47g2000cwa.googlegroups.com> NNTP-Posting-Host: 194.74.199.42 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1129384104 13335 127.0.0.1 (15 Oct 2005 13:48:24 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 15 Oct 2005 13:48:24 +0000 (UTC) User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1),gzip(gfe),gzip(gfe) X-HTTP-Via: 1.0 Symantec_Web_Security (3.0.1.74), 1.0 C2100-0050414028 (NetCache NetApp/5.5R5) Complaints-To: groups-abuse@google.com Injection-Info: g43g2000cwa.googlegroups.com; posting-host=194.74.199.42; posting-account=G-J9fgwAAADgpzBiEyy5tO4f8MX5fbpw Xref: g2news1.google.com comp.lang.ada:5700 Date: 2005-10-15T06:48:19-07:00 List-Id: Here, the second parameter of New_Panel probably should be class-wide. A Ok. subprogram with two specific different tagged types as parameters is almost always wrong. (Dmitry will tell you why in excrutating details if you want to know. :-) Yeah, why not ;-D Doesn't hurt to know. Presuming that this is an operation on the root window type, you should be able to just call this (a Button will have inherited it). Set_Validator (Self.Button, Self.Validator); Well, Button_Type is derived from Control_Type which in turn is derived from Window_Type. (or, in C++-like notation in Ada 200Y:) Self.Button.Set_Validator (Self.Validator); The latter notation avoids the need for use-clauses. I didn't know that. I don't see any need for the conversions to Sizer_Type here. If Self.Sizer is derived from Sizer_Type, then Add is inherited. Use that one without a conversion. (That way, if it becomes necessary to override it in the future, you'll use the overriding version for the type.) If it is actually Sizer_Type, you don't need it. Add is defined in wx.Core.Sizer and the sizer I am using here is derived from Sizer_Type (it's of Box_Sizer_Type), but by removing the view conversions, the program doesn't compile for some reason. The only problem is figuring out where the routine ("Add" in this case) is declared, because you can't see inherited declarations. There are a number of solutions to that: 1) Have a use_clause for every package that declares a type that you use. (I hate this one myself.) I'm using this at the moment. 2) Use dot notation to specify that the routine comes from the package where the type is declared; 3) or use the prefixed view call notation introduced by Ada 200Y: Self.Sizer.Add (Self.Scroll_Bar, 1, Sizer_Expand or Sizer_Border_All, Hmmm, maybe 3 would be a good one? Thanks, Luke.