Re: naming conventions

[email protected] (Robert Roebling)
Newsgroups gmane.comp.lib.wxwindows.wxnet
Message-ID <[email protected]>
> > and the again in wxWindow (from which they will
> > mostly be used):
> > 
> > class public Window
> > {
> >     private const int wxALIGN_RIGHT = wx.Orientation.AlignRight;
> >     ...
> > }
> 
> So this would get used as:
> 
>    new wx.Window(null, -1, pos, size, wx.Window.wxALIGN_RIGHT | ...)
> 
> All of these options are so verbose.

Well, if you use

using wx;

then the wx suffix is no longer needed and if you use
the constant in (the constructor of) a window class
then the Window won't be needed. Or am I wrong about
this? wxALIGN_RIGHT is used for sizers and these are
used in windows like this:

using wx;

public class MyWindow: Window
{
    public MyWindow(...)
       : base(...)
    {
        Sizer sizer = new Sizer();
        sizer.Add( ..., wxALIGN_RIGHT );
          
        SetSizer( sizer );
    }
}

since MyWindow would inherit the Window.wxALIGN_RIGHT
flag and would not need any further suffix or namespace
qualifier.

  Robert

-- 
Robert Roebling, MD <[email protected]>


-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.