示例#1
0
        public void InitializeFooter()
        {
            if (IsAccountLevel) {
                bsiContactLevel.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
                this.bar1.BarAppearance.Normal.BackColor = System.Drawing.Color.FromArgb(220, 201, 241);//purple
            } else {
                bsiAccountLevel.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
                this.bar1.BarAppearance.Normal.BackColor = System.Drawing.SystemColors.Info;//yellow
            }

            //if (IsCustomerOwnershipOnly) {
            //    bsiOwnership.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
            //}

            /**
             * https://brightvision.jira.com/browse/PLATFORM-1374
             * extend truth table validation for showing green public icon.
             */

            if (!string.IsNullOrEmpty(QuestionText)) {
                bsiQuestionText.Caption = QuestionText;
                if(bsiQuestionText.SuperTip == null)
                    bsiQuestionText.SuperTip = new DevExpress.Utils.SuperToolTip();
                var tipArgs = new DevExpress.Utils.SuperToolTipSetupArgs();
                tipArgs.AllowHtmlText = DevExpress.Utils.DefaultBoolean.True;
                tipArgs.Title.Text = QuestionText;
                bsiQuestionText.SuperTip.Setup(tipArgs);
            }
            if ((IsCustomerOwned && IsBrightvisionOwned) ||
                (!IsCustomerOwned && IsBrightvisionOwned))
                bsiOwnership.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
            else if ((IsCustomerOwned && !IsBrightvisionOwned) ||
                (!IsCustomerOwned && !IsBrightvisionOwned))
                bsiOwnership.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;

            SetLanguageIcon(LanguageCode);

            SetHelpText(HelpText);
        }
示例#2
0
        public void SetSourceTooltip(string contactPerson, string salesUser, string lastModifiedDate)
        {
            if (string.IsNullOrEmpty(contactPerson)) return;
            if (string.IsNullOrEmpty(salesUser)) return;
            if (string.IsNullOrEmpty(lastModifiedDate)) return;

            if (bsiSource.SuperTip == null)
                bsiSource.SuperTip = new DevExpress.Utils.SuperToolTip();
            var tipArgs = new DevExpress.Utils.SuperToolTipSetupArgs();
            tipArgs.AllowHtmlText = DevExpress.Utils.DefaultBoolean.True;
            tipArgs.Title.Text = "Source Information";
            tipArgs.Contents.Text = string.Format("Source: {0}\nLast modified: {1}\nLast modified date: {2}",contactPerson,salesUser,lastModifiedDate);
            bsiSource.SuperTip.Setup(tipArgs);
        }
示例#3
0
 public void SetHelpText(string value)
 {
     if (!string.IsNullOrEmpty(value)) {
         if (bsiHelp.SuperTip == null)
             bsiHelp.SuperTip = new DevExpress.Utils.SuperToolTip();
         var tipArgs = new DevExpress.Utils.SuperToolTipSetupArgs();
         tipArgs.AllowHtmlText = DevExpress.Utils.DefaultBoolean.True;
         tipArgs.Title.Text = "Question Help";
         tipArgs.Contents.Text = value.Trim();
         bsiHelp.SuperTip.Setup(tipArgs);
     } else {
         bsiHelp.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
     }
 }
示例#4
0
        public void SetQuestionRequired(bool isvalid, bool isrequired)
        {
            if (bsiRequired.SuperTip == null)
                bsiRequired.SuperTip = new DevExpress.Utils.SuperToolTip();

            var tipArgs = new DevExpress.Utils.SuperToolTipSetupArgs();
            tipArgs.AllowHtmlText = DevExpress.Utils.DefaultBoolean.True;
            if (!isvalid && isrequired) {
                bsiRequired.Glyph = global::BrightVision.DQControl.Properties.Resources.required;
                tipArgs.Title.Text = "Required Question";
                tipArgs.Contents.Text = "The question is required to be answered.";
                bsiRequired.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
                bsiRequired.SuperTip.Setup(tipArgs);
            } else if(isvalid && isrequired) {
                bsiRequired.Glyph = global::BrightVision.DQControl.Properties.Resources.completed;
                tipArgs.Title.Text = "Done";
                tipArgs.Contents.Text = "The question has done answered.";
                bsiRequired.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
                bsiRequired.SuperTip.Setup(tipArgs);
            } else if (!isrequired) {
                bsiRequired.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
            }
        }
 private void TpCtlr_GetActiveObjectInfo(object sender, DevExpress.Utils.ToolTipControllerGetActiveObjectInfoEventArgs e)
 {
     if (e.SelectedControl != this.gridControl1)
     {
         return;
     }
     DevExpress.XtraGrid.Views.Grid.GridView view
         = this.gridControl1.GetViewAt(e.ControlMousePosition)
           as DevExpress.XtraGrid.Views.Grid.GridView;
     if (view == null)
     {
         return;
     }
     DevExpress.Utils.ToolTipControlInfo info = null;
     DevExpress.XtraGrid.Views.Grid.ViewInfo.GridHitInfo hi = view.CalcHitInfo(e.ControlMousePosition);
     //if( hi.HitTest == DevExpress.XtraGrid.Views.Grid.ViewInfo.GridHitTest.RowIndicator )
     if (hi.HitTest == DevExpress.XtraGrid.Views.Grid.ViewInfo.GridHitTest.RowCell)
     {
         if (hi.RowHandle == -2147483646)
         {
             return;
         }
         object o    = hi.HitTest.ToString( ) + hi.RowHandle.ToString( );
         string text = "Row " + hi.RowHandle.ToString( );
         DevExpress.Utils.SuperToolTip stt = new DevExpress.Utils.SuperToolTip( );
         stt.AllowHtmlText        = DevExpress.Utils.DefaultBoolean.Default;
         stt.FixedTooltipWidth    = false;
         stt.MaxWidth             = 400;
         stt.DistanceBetweenItems = 10;
         DevExpress.Utils.SuperToolTipSetupArgs args = new DevExpress.Utils.SuperToolTipSetupArgs( );
         args.AllowHtmlText       = DevExpress.Utils.DefaultBoolean.Default;
         args.ShowFooterSeparator = true;
         {
             //var pnCellValue = view.GetRowCellValue( hi.RowHandle, MetadataItemFQN.OBJECT_FIELDNAME );
             //var ptypeCellValue = view.GetRowCellValue( hi.RowHandle, MetadataItemFQN.PARENT_TYPE_FIELDNAME );
             //var fqnCellValue = view.GetRowCellValue( hi.RowHandle, MetadataItemFQN.NAMEFULLQUALIFIED_FIELDNAME );
             //var nCellValue = view.GetRowCellValue( hi.RowHandle, MetadataItemFQN.FIELD_FIELDNAME );
             //var typeCellValue = view.GetRowCellValue( hi.RowHandle, MetadataItemFQN.TYPE_FIELDNAME );
             //
             //args.Title.Text = typeCellValue?.ToString( ) + ": " + nCellValue?.ToString( );
             //args.Contents.ImageOptions.Alignment = DevExpress.Utils.ToolTipImageAlignment.Default;
             //args.Contents.Text = fqnCellValue?.ToString( );
             //args.Footer.Text = ptypeCellValue?.ToString( ) + ": " + pnCellValue?.ToString( );
             //if( typeCellValue.ToString( ) == "Field" )
             //{
             //   //args.Title.ImageOptions.Image = fld_noaction_gray_img16x16;
             //   //args.Contents.ImageOptions.Image = fld_noaction_gray_img64x64;
             //   //args.Footer.ImageOptions.Image = tbl_noaction_red_img16x16;
             //}
             //else if( typeCellValue.ToString( ) == "Table" )
             //{
             //   //args.Title.ImageOptions.Image = tbl_noaction_red_img16x16;
             //   //args.Contents.ImageOptions.Image = tbl_noaction_red_img64x64;
             //   //args.Footer.ImageOptions.Image = sch_noaction_red_img16x16;
             //}
             //else if( typeCellValue.ToString( ) == "View" )
             //{
             //   //args.Title.ImageOptions.Image = vw_noaction_red_img16x16;
             //   //args.Contents.ImageOptions.Image = vw_noaction_red_img64x64;
             //   //args.Footer.ImageOptions.Image = sch_noaction_red_img16x16;
             //}
             //else if( typeCellValue.ToString( ) == "ForeignKey" )
             //{
             //   //args.Title.ImageOptions.Image = fk_noaction_gray_img16x16;
             //   //args.Contents.ImageOptions.Image = fk_noaction_gray_img64x64;
             //   //args.Footer.ImageOptions.Image = tbl_noaction_red_img16x16;
             //}
             //else if( typeCellValue.ToString( ) == "Procedure" )
             //{
             //   //args.Title.ImageOptions.Image = proc_noaction_blue_img16x16;
             //   //args.Contents.ImageOptions.Image = proc_noaction_blue_img64x64;
             //   //args.Footer.ImageOptions.Image = sch_noaction_red_img16x16;
             //}
             //else if( typeCellValue.ToString( ) == "Synonym" )
             //{
             //   //args.Title.ImageOptions.Image = syn_noaction_yellow_img16x16;
             //   //args.Contents.ImageOptions.Image = syn_noaction_yellow_img64x64;
             //   //args.Footer.ImageOptions.Image = sch_noaction_red_img16x16;
             //}
             //else if( typeCellValue.ToString( ) == "Schema" )
             //{
             //   //args.Title.ImageOptions.Image = sch_noaction_red_img16x16;
             //   //args.Contents.ImageOptions.Image = sch_noaction_red_img64x64;
             //   //args.Footer.ImageOptions.Image = db_noaction_red_img16x16;
             //}
             //else if( typeCellValue.ToString( ) == "Database" )
             //{
             //   //args.Title.ImageOptions.Image = db_noaction_red_img16x16;
             //   //args.Contents.ImageOptions.Image = db_noaction_red_img64x64;
             //   //args.Footer.ImageOptions.Image = db_noaction_red_img16x16;
             //}
         }
         stt.Setup(args);
         info             = new DevExpress.Utils.ToolTipControlInfo(o, text);
         info.ToolTipType = DevExpress.Utils.ToolTipType.SuperTip;
         info.SuperTip    = stt;
     }
     if (info != null)
     {
         e.Info = info;
     }
 }