Example #1
0
        // ###############################################################################
        // ### C O N S T R U C T I O N   A N D   I N I T I A L I Z A T I O N
        // ###############################################################################

        #region Construction

        /// <summary> The initializing constructor. </summary>
        /// <param name="toplevelShell"> The toplevel shell that owns the underlaying transient popup shell of this dialog. <see cref="XtApplicationShell"/> </param>
        /// <param name="toplevelShell"> The shell caption. <see cref="System.String"/> </param>
        public XtDialog(XtApplicationShell toplevelShell, string caption)
        {
            if (toplevelShell == null)
            {
                throw new ArgumentNullException("toplevelShell");
            }

            _toplevelShell = toplevelShell;

            if (!string.IsNullOrEmpty(caption))
            {
                Arg[] shellArgs = { new Arg(XtNames.XtNtitle, X11.X11Utils.StringToSByteArray(caption + "\0")) };
                _shell = Xtlib.XtCreatePopupShell(SHELL_RESOURCE_NAME,
                                                  Xtlib.XawTransientShellWidgetClass(), toplevelShell.Shell,
                                                  shellArgs, (XCardinal)1);
            }
            else
            {
                _shell = Xtlib.XtCreatePopupShell(SHELL_RESOURCE_NAME,
                                                  Xtlib.XawTransientShellWidgetClass(), toplevelShell.Shell,
                                                  Arg.Zero, 0);
            }

            _toplevelShell.AssociatedShells.Add(this);
        }