Beispiel #1
0
        public override void InitDialogSettings()
        {
            srcCS = "//Dialog Background settings" + CRLF;
            srcVB = "'Dialog Background settings" + CRLF;

            DlgMgr.UdfBackcolorsEnabled = checkUdfBackcolorsEnabled.Checked;
            srcCS += "DlgMgr.UdfBackcolorsEnabled = " + DlgMgr.UdfBackcolorsEnabled.ToString().ToLower() + ";" + CRLF;
            srcVB += "DlgMgr.UdfBackcolorsEnabled = " + DlgMgr.UdfBackcolorsEnabled.ToString() + CRLF;

            if (!DlgMgr.UdfBackcolorsEnabled)
            {
                return;
            }

            //main
            if (colorSelect1.UseSystemDefault)
            {
                DlgMgr.ResetBackColor(XMessageBoxBackground.DlgWindow);
                srcCS += "DlgMgr.ResetBackColor(XMessageBoxBackground." +
                         XMessageBoxBackground.DlgWindow.ToString() + ");" + CRLF;
                srcVB += "DlgMgr.ResetBackColor(XMessageBoxBackground." +
                         XMessageBoxBackground.DlgWindow.ToString() + ")" + CRLF;
            }
            else if (colorSelect1.BackgroundMode == 0) //solid color or hatch
            {
                if (SelectedBrushMain == XMessageBoxHatchStyle.HatchStyleNone)
                {
                    DlgMgr.LoadBackColorFromSolidColor(XMessageBoxBackground.DlgWindow, BackgroundColorMain);

                    srcCS += "DlgMgr.LoadBackColorFromSolidColor(XMessageBoxBackground." +
                             XMessageBoxBackground.DlgWindow.ToString() + "," + CSNxt +
                             ColorToStr(BackgroundColorMain) + ");" + CRLF;

                    srcVB += "DlgMgr.LoadBackColorFromSolidColor(XMessageBoxBackground." +
                             XMessageBoxBackground.DlgWindow.ToString() + "," + VBNxt +
                             ColorToStr(BackgroundColorMain) + ")" + CRLF;
                }
                else
                {
                    DlgMgr.LoadBackcolorFromHatchBrush(XMessageBoxBackground.DlgWindow,
                                                       SelectedBrushMain, BackgroundColorMain);

                    srcCS += "DlgMgr.LoadBackcolorFromHatchBrush(XMessageBoxBackground." +
                             XMessageBoxBackground.DlgWindow.ToString() + "," + CSNxt +
                             "XMessageBoxHatchStyle." + SelectedBrushMain.ToString() + "," + CSNxt +
                             ColorToStr(BackgroundColorMain) + ");" + CRLF;

                    srcVB += "DlgMgr.LoadBackcolorFromHatchBrush(XMessageBoxBackground." +
                             XMessageBoxBackground.DlgWindow.ToString() + "," + VBNxt +
                             "XMessageBoxHatchStyle." + SelectedBrushMain.ToString() + "," + VBNxt +
                             ColorToStr(BackgroundColorMain) + ")" + CRLF;
                }
            }
            else  //bitmap file
            {
                DlgMgr.LoadBackcolorFromBitmapFile(XMessageBoxBackground.DlgWindow, SelectedBitmapFileMain);

                srcCS += "DlgMgr.LoadBackcolorFromBitmapFile(XMessageBoxBackground." +
                         XMessageBoxBackground.DlgWindow.ToString() + "," + CSNxt +
                         "\"" + FilenameToStr(SelectedBitmapFileMain) + "\");" + CRLF;

                srcVB += "DlgMgr.LoadBackcolorFromBitmapFile(XMessageBoxBackground." +
                         XMessageBoxBackground.DlgWindow.ToString() + "," + VBNxt +
                         "\"" + SelectedBitmapFileMain + "\")" + CRLF;
            }

            //toolbar
            if (colorSelect2.UseSystemDefault)
            {
                DlgMgr.ResetBackColor(XMessageBoxBackground.ToolBarWindow);

                srcCS += "DlgMgr.ResetBackColor(XMessageBoxBackground." +
                         XMessageBoxBackground.ToolBarWindow.ToString() + ");" + CRLF;

                srcVB += "DlgMgr.ResetBackColor(XMessageBoxBackground." +
                         XMessageBoxBackground.ToolBarWindow.ToString() + ")" + CRLF;
            }
            else if (colorSelect2.BackgroundMode == 0) //solid color or hatch
            {
                if (SelectedBrushToolbar == XMessageBoxHatchStyle.HatchStyleNone)
                {
                    DlgMgr.LoadBackColorFromSolidColor(XMessageBoxBackground.ToolBarWindow,
                                                       BackgroundColorToolbar);

                    srcCS += "DlgMgr.LoadBackColorFromSolidColor(XMessageBoxBackground." +
                             XMessageBoxBackground.ToolBarWindow.ToString() + "," + CSNxt +
                             ColorToStr(BackgroundColorToolbar) + ");" + CRLF;

                    srcVB += "DlgMgr.LoadBackColorFromSolidColor(XMessageBoxBackground." +
                             XMessageBoxBackground.ToolBarWindow.ToString() + "," + VBNxt +
                             ColorToStr(BackgroundColorToolbar) + ")" + CRLF;
                }
                else
                {
                    DlgMgr.LoadBackcolorFromHatchBrush(XMessageBoxBackground.ToolBarWindow,
                                                       SelectedBrushToolbar, BackgroundColorToolbar);

                    srcCS += "DlgMgr.LoadBackcolorFromHatchBrush(XMessageBoxBackground." +
                             XMessageBoxBackground.ToolBarWindow.ToString() + "," + CSNxt +
                             "XMessageBoxHatchStyle." + SelectedBrushToolbar.ToString() + "," + CSNxt +
                             ColorToStr(BackgroundColorToolbar) + ");" + CRLF;

                    srcVB += "DlgMgr.LoadBackcolorFromHatchBrush(XMessageBoxBackground." +
                             XMessageBoxBackground.ToolBarWindow.ToString() + "," + VBNxt +
                             "XMessageBoxHatchStyle." + SelectedBrushToolbar.ToString() + "," + VBNxt +
                             ColorToStr(BackgroundColorToolbar) + ")" + CRLF;
                }
            }
            else  //bitmap file
            {
                DlgMgr.LoadBackcolorFromBitmapFile(XMessageBoxBackground.ToolBarWindow, SelectedBitmapFileToolbar);

                srcCS += "DlgMgr.LoadBackcolorFromBitmapFile(XMessageBoxBackground." +
                         XMessageBoxBackground.ToolBarWindow.ToString() + "," + CSNxt +
                         "\"" + FilenameToStr(SelectedBitmapFileToolbar) + "\");" + CRLF;

                srcVB += "DlgMgr.LoadBackcolorFromBitmapFile(XMessageBoxBackground." +
                         XMessageBoxBackground.ToolBarWindow.ToString() + "," + VBNxt +
                         "\"" + SelectedBitmapFileToolbar + "\")" + CRLF;
            }
        }