Пример #1
0
        /// <summary>
        /// Set tool tip for button
        /// </summary>
        protected virtual void SupperTip()
        {
            //Set Supper Tip Clear Button
            if (ViewMode == CommonData.Mode.View)
            {
                args.Title.Text = "F4";
            }
            else
            {
                args.Title.Text = "F5";
            }
            sTooltip.Setup(args);
            btnClear.SuperTip = sTooltip;

            //Set Supper Tip SaveAndNext Button
            sTooltip = new SuperToolTip();
            args     = new SuperToolTipSetupArgs();
            if (ViewMode == CommonData.Mode.View)
            {
                args.Title.Text = "→";
            }
            else
            {
                args.Title.Text = "F12";
            }
            sTooltip.Setup(args);
            btnSaveAndNext.SuperTip = sTooltip;
        }
Пример #2
0
        private void ToolTipController_BeforeShow(object sender, ToolTipControllerShowEventArgs e)
        {
            ToolTipController   controller  = sender as ToolTipController;
            AppointmentViewInfo aptViewInfo = controller.ActiveObject as AppointmentViewInfo;

            if (aptViewInfo == null)
            {
                return;
            }

            if (toolTipController.ToolTipType == ToolTipType.SuperTip)
            {
                var selectedObject = e.SelectedObject as TimeLineAppointmentViewInfo;
                var appointment    = selectedObject.Appointment;

                SuperToolTip          SuperTip = new SuperToolTip();
                SuperToolTipSetupArgs args     = new SuperToolTipSetupArgs();
                var font = new Font("Tahoma", 10);
                args.Title.Text          = appointment.Start.ToString("g") + " - " + appointment.End.ToString("g");
                args.Title.Font          = font;
                args.Contents.Text       = aptViewInfo.DisplayText + Environment.NewLine + aptViewInfo.Description + Environment.NewLine + "Кол-во:" + appointment.CustomFields["PassengersCount"]?.ToString();
                args.Contents.Font       = font;
                args.Contents.Image      = Properties.Resources.info_32x32;
                args.ShowFooterSeparator = true;
                args.Footer.Font         = font;
                args.Footer.Text         = appointment.CustomFields["TripTypeName"]?.ToString();
                SuperTip.Setup(args);
                e.SuperTip = SuperTip;
            }
        }
        private void toolTipController1_BeforeShow(object sender, ToolTipControllerShowEventArgs e)
        {
            ToolTipController   controller  = sender as ToolTipController;
            AppointmentViewInfo aptViewInfo = controller.ActiveObject as AppointmentViewInfo;

            if (aptViewInfo == null)
            {
                return;
            }

            if (toolTipController1.ToolTipType == ToolTipType.Standard)
            {
                e.IconType = ToolTipIconType.Information;
                e.ToolTip  = aptViewInfo.Description;
            }

            if (toolTipController1.ToolTipType == ToolTipType.SuperTip)
            {
                SuperToolTip          SuperTip = new SuperToolTip();
                SuperToolTipSetupArgs args     = new SuperToolTipSetupArgs();
                args.Title.Text    = "Info";
                args.Title.Font    = new Font("Times New Roman", 14);
                args.Contents.Text = aptViewInfo.Description;
                //args.Contents.Image = resImage;
                args.ShowFooterSeparator = true;
                args.Footer.Font         = new Font("Comic Sans MS", 8);
                args.Footer.Text         = "SuperTip";
                SuperTip.Setup(args);
                e.SuperTip = SuperTip;
            }
        }
Пример #4
0
        /// <summary>
        /// Authorization for form
        /// </summary>
        //protected virtual void SetAuthorityControlOnlyThis()
        //{
        //    //Set authorization for Print
        //    ST_StockTransactionMasterDto currentDto = (ST_StockTransactionMasterDto)this.CurrentDto;
        //    if (currentDto != null)
        //    {
        //        //Set authorization for Print
        //        if (this.IsWarehouseAuthority(currentDto.WarehouseCode, CommonData.OperId.Print) == CommonData.IsAuthority.Deny)
        //        {
        //            this.btnPrintSheet.Enabled = false;
        //        }
        //        //Set authorization for Cancel
        //        if (this.IsWarehouseAuthority(currentDto.WarehouseCode, CommonData.OperId.Cancel) == CommonData.IsAuthority.Deny)
        //        {
        //            this.btnCancel.Enabled = false;
        //        }

        //        //Set authorization for ViewPrice
        //        if (this.IsWarehouseAuthority(currentDto.WarehouseCode, CommonData.OperId.ViewPrice) == CommonData.IsAuthority.Deny)
        //        {
        //            this.ctrlDetail.ShowUnitPrice = false;
        //            this.ctrlDetail.ShowAmount = false;

        //            this.ctrlDetail1.ShowUnitPrice = false;
        //            this.ctrlDetail1.ShowAmount = false;
        //        }
        //    }
        //}



        #endregion

        /// <summary>
        /// Set tool tip for button
        /// </summary>
        private void SupperTip()
        {
            SuperToolTip          sTooltip;
            SuperToolTipSetupArgs args;

            //Set Supper Tip PrintDeliverySheet Button
            sTooltip        = new SuperToolTip();
            args            = new SuperToolTipSetupArgs();
            args.Title.Text = "F10";
            sTooltip.Setup(args);
            btnPrintSheet.SuperTip = sTooltip;

            //Set Supper Tip Inventory Button
            sTooltip        = new SuperToolTip();
            args            = new SuperToolTipSetupArgs();
            args.Title.Text = "Ctr + F";
            sTooltip.Setup(args);
            btnInventory.SuperTip = sTooltip;

            //Set Supper Tip Cancel Button
            sTooltip        = new SuperToolTip();
            args            = new SuperToolTipSetupArgs();
            args.Title.Text = "F7";
            sTooltip.Setup(args);
            btnCancel.SuperTip = sTooltip;
        }
        void DefaultController_GetActiveObjectInfo(object sender, ToolTipControllerGetActiveObjectInfoEventArgs e)
        {
            NavBarControl navBar = e.SelectedControl as NavBarControl;

            if (navBar != null)
            {
                NavBarHitInfo hi = navBar.CalcHitInfo(e.ControlMousePosition);

                if (hi.InLink)
                {
                    SuperToolTip          superTip = new SuperToolTip();
                    SuperToolTipSetupArgs args     = new SuperToolTipSetupArgs();
                    args.Title.Text = hi.Link.Caption;
                    superTip.Setup(args);
                    e.Info.SuperTip = superTip;
                }
                else
                if (hi.InGroup)
                {
                    SuperToolTip superTip = GetSuperTipByGroup(hi.Group);
                    {
                        if (e.Info == null)
                        {
                            e.Info = new ToolTipControlInfo(e.SelectedControl, "");
                        }
                        e.Info.ToolTipType = ToolTipType.SuperTip;
                        e.Info.SuperTip    = superTip;
                    }
                }
            }
        }
Пример #6
0
        private void MainFormLoad(object sender, EventArgs e)
        {
            // https://www.devexpress.com/Support/Center/Question/Details/Q504181
            // https://documentation.devexpress.com/#WindowsForms/CustomDocument4874
            // https://documentation.devexpress.com/#WindowsForms/CustomDocument15721

            // Access the controller that manages tooltips for all controls:
            ToolTipController defaultTooltipController = DevExpress.Utils.ToolTipController.DefaultController;

            // Create and customize a SuperToolTip:
            SuperToolTip          sTooltip = new SuperToolTip();
            SuperToolTipSetupArgs args     = new SuperToolTipSetupArgs();

            args.Title.Text          = "Header";
            args.Contents.Text       = "This tooltip contains a hyperlink. Visit the <href=http://help.devexpress.com>DevExpress Knowledge Center</href> to learn more.";
            args.ShowFooterSeparator = true;
            args.Footer.Text         = "Footer";
            sTooltip.Setup(args);
            // Enable HTML Text Formatting for the created SuperToolTip:
            sTooltip.AllowHtmlText = DefaultBoolean.True;
            //..or enable this feature for all tooltips:
            //defaultTooltipController.AllowHtmlText = true;

            // Respond to clicking hyperlinks in tooltips:
            defaultTooltipController.HyperlinkClick += defaultTooltipController_HyperlinkClick;

            // Assign a SuperToolTip to the button:
            memoEdit1.SuperTip = sTooltip;
        }
Пример #7
0
        private void LoginInfoUpdate()
        {
            //********************
            //* Declara variáveis
            //********************
            SuperToolTip          oUserLogin = new SuperToolTip();
            SuperToolTipSetupArgs oArgs      = new SuperToolTipSetupArgs();
            string LoginData = string.Empty;

            //***********
            //* Logotipo
            //***********
            oArgs.Title.Image      = UserLogin.LoginInfo.Posto_Logotipo;
            oArgs.Title.ImageAlign = ToolTipImageAlignment.Default;

            //*****************
            //* Dados do posto
            //*****************
            if (UserLogin.LoginInfo.Posto_Nome.Trim() != string.Empty)
            {
                LoginData += "<b>Posto:</b> " + UserLogin.LoginInfo.Posto_Nome;
            }
            if (UserLogin.LoginInfo.Posto_Nome.Trim() != string.Empty && UserLogin.LoginInfo.Posto_Descricao.Trim() != string.Empty)
            {
                LoginData += " (" + UserLogin.LoginInfo.Posto_Descricao + ")\r\n";
            }
            else
            if (LoginData != string.Empty)
            {
                LoginData += "\r\n";
            }

            //*******************
            //* Dados do usuário
            //*******************
            if (UserLogin.LoginInfo.Usuario_Nome.Trim() != string.Empty)
            {
                LoginData += "<b>Usuário:</b> " + UserLogin.LoginInfo.Usuario_Nome;
            }
            if (UserLogin.LoginInfo.Usuario_Nome.Trim() != string.Empty && UserLogin.LoginInfo.Usuario_DescGrupo.Trim() != string.Empty)
            {
                LoginData += " (" + UserLogin.LoginInfo.Usuario_DescGrupo + ")\r\n";
            }
            else
            if (LoginData != string.Empty)
            {
                LoginData += "<b>Usuário:</b> " + UserLogin.LoginInfo.Usuario_ID + "\r\n";
            }

            oArgs.Contents.Text = LoginData;
            oUserLogin.Setup(oArgs);
            oUserLogin.AllowHtmlText = DefaultBoolean.True;
            bbiUser.SuperTip         = oUserLogin;
        }
Пример #8
0
        public void SuperTipExcel(String titulo, String contenido, String piePagina)
        {
            SuperToolTip          sTooltip = new SuperToolTip();
            SuperToolTipSetupArgs args     = new SuperToolTipSetupArgs();

            args.Title.Text    = titulo;
            args.Contents.Text = contenido;
            args.Footer.Text   = piePagina;

            sTooltip.Setup(args);
            BtnExcel.SuperTip = sTooltip;
        }
Пример #9
0
        private void initializeButton(BarButtonItem barButtonItem, ApplicationIcon icon, string caption, Action clickAction, string toolTipText)
        {
            barButtonItem.Caption     = caption;
            barButtonItem.ImageIndex  = ApplicationIcons.IconIndex(icon);
            barButtonItem.PaintStyle  = BarItemPaintStyle.CaptionGlyph;
            barButtonItem.ButtonStyle = BarButtonStyle.Check;
            barButtonItem.ItemClick  += (o, e) => clickAction();
            var toolTip = new SuperToolTip();

            toolTip.Setup(new SuperToolTipSetupArgs {
                Contents = { Text = toolTipText }
            });
            barButtonItem.SuperTip = toolTip;
        }
Пример #10
0
        /// <summary>
        /// init tooltip
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void toolTipController_BeforeShow(object sender, ToolTipControllerShowEventArgs e)
        {
            ToolTipController   controller  = sender as ToolTipController;
            AppointmentViewInfo aptViewInfo = controller.ActiveObject as AppointmentViewInfo;

            if (aptViewInfo == null)
            {
                return;
            }
            toolTipController.ToolTipType = ToolTipType.SuperTip;

            if (toolTipController.ToolTipType == ToolTipType.SuperTip)
            {
                SuperToolTip          SuperTip = new SuperToolTip();
                SuperToolTipSetupArgs args     = new SuperToolTipSetupArgs();
                args.Contents.Text       = aptViewInfo.Description;
                args.ShowFooterSeparator = true;
                args.Footer.Text         = aptViewInfo.Appointment.Start.ToShortTimeString() + " ~ " + aptViewInfo.Appointment.End.ToShortTimeString();//"SuperTip";
                SuperTip.Setup(args);
                e.SuperTip = SuperTip;
            }
        }
        private void OnListViewItemHover(object sender, ItemHoverEventArgs e)
        {
            toolTipController.HideHint();
            var slideMaster = e.Item?.Tag as SlideMaster;

            if (String.IsNullOrEmpty(slideMaster?.ToolTipHeader) || String.IsNullOrEmpty(slideMaster.ToolTipBody))
            {
                return;
            }

            var toolTipParameters = new ToolTipControllerShowEventArgs();
            var superTip          = new SuperToolTip();
            var toolTipSetupArgs  = new SuperToolTipSetupArgs();

            toolTipSetupArgs.AllowHtmlText = DefaultBoolean.True;
            toolTipSetupArgs.Title.Text    = String.Format("<b>{0}</b>", slideMaster.ToolTipHeader);
            toolTipSetupArgs.Title.Font    = new Font("Arial", 10);
            toolTipSetupArgs.Contents.Font = new Font("Arial", 9);
            toolTipSetupArgs.Contents.Text = String.Format("<color=gray>{0}</color>", slideMaster.ToolTipBody);
            superTip.Setup(toolTipSetupArgs);
            toolTipParameters.SuperTip = superTip;

            toolTipController.ShowHint(toolTipParameters, MousePosition);
        }
Пример #12
0
        protected override void OnViewControlsCreated()
        {
            base.OnViewControlsCreated();

            ListView   listView   = View as ListView;
            DetailView detailView = View as DetailView;

            if (listView != null)
            {
                IObjectSpace os = Application.CreateObjectSpace();
                listView.CollectionSource.CriteriaApplied += (o, e) =>
                {
                    // Предварительная загрузка расписаний докторов
                    var collectionSB = (CollectionSourceBase)o;
                    if (collectionSB.Criteria != null)
                    {
                        var events = new List <DoctorEvent>(os.GetObjects <DoctorEvent>(collectionSB.Criteria[FILTERKEY]));
                        eventsDict = events.ToDictionary(de => de.Oid, de => de);
                    }
                };

                SchedulerListEditor listEditor = ((ListView)View).Editor as SchedulerListEditor;
                if (listEditor != null)
                {
                    SchedulerControl scheduler = listEditor.SchedulerControl;
                    if (scheduler != null)
                    {
                        // Кастомизация надписи в расписании доктора
                        scheduler.InitAppointmentDisplayText += (o, e) =>
                        {
                            Guid guid = (Guid)e.Appointment.Id;
                            if (eventsDict.ContainsKey(guid))
                            {
                                var doctorEvent = eventsDict[guid];
                                e.Text = doctorEvent != null && doctorEvent.Pacient != null ? doctorEvent.Pacient.FullName : string.Empty;
                            }
                        };

                        #region Кастомизация Тултипа расписания доктора

                        // https://documentation.devexpress.com/WindowsForms/118551/Controls-and-Libraries/Scheduler/Visual-Elements/Scheduler-Control/Appointment-Flyout
                        scheduler.OptionsView.ToolTipVisibility = ToolTipVisibility.Always;
                        scheduler.OptionsCustomization.AllowDisplayAppointmentFlyout = false;
                        scheduler.ToolTipController             = new ToolTipController();
                        scheduler.ToolTipController.ToolTipType = ToolTipType.SuperTip;
                        scheduler.ToolTipController.BeforeShow += (o, e) =>
                        {
                            var toolTipController           = (ToolTipController)o;
                            AppointmentViewInfo aptViewInfo = null;
                            try
                            {
                                aptViewInfo = (AppointmentViewInfo)toolTipController.ActiveObject;
                            }
                            catch
                            {
                                return;
                            }

                            if (aptViewInfo == null)
                            {
                                return;
                            }

                            Guid guid = (Guid)aptViewInfo.Appointment.Id;
                            if (!eventsDict.ContainsKey(guid))
                            {
                                // В словаре нет ключа т.к. расписание было только что создано
                                var events = new List <DoctorEvent>(ObjectSpace.GetObjects <DoctorEvent>(listView.CollectionSource.Criteria[FILTERKEY]));
                                eventsDict = events.ToDictionary(de => de.Oid, de => de);
                            }
                            DoctorEvent doctorEvent = eventsDict[guid];
                            // Вид талона (метка)
                            AppointmentLabel label = scheduler.Storage.Appointments.Labels.GetById(doctorEvent.Label);
                            StringBuilder    sb    = new StringBuilder();
                            sb.AppendLine(string.Format("Время: с {0:HH:mm} по {1:HH:mm}", doctorEvent.StartOn, doctorEvent.EndOn));
                            sb.AppendLine(string.Format("Пациент: {0}", doctorEvent.Pacient != null ? doctorEvent.Pacient.FullName : null));
                            sb.AppendLine(string.Format("Кем создано: {0}", doctorEvent.CreatedBy != null ? doctorEvent.CreatedBy.FullName : null));
                            sb.AppendLine(string.Format("Кто записал: {0}", doctorEvent.EditedBy != null ? doctorEvent.EditedBy.FullName : null));
                            sb.AppendLine(string.Format("Вид талона: {0}", label.DisplayName));
                            if (doctorEvent.Pacient != null)
                            {
                                sb.AppendLine(string.Format("Источник записи: {0}", CaptionHelper.GetDisplayText(doctorEvent.SourceType)));
                            }

                            SuperToolTip          SuperTip = new SuperToolTip();
                            SuperToolTipSetupArgs args     = new SuperToolTipSetupArgs();
                            args.Contents.Text = sb.ToString();
                            args.Contents.Font = new Font("Times New Roman", 11);
                            SuperTip.Setup(args);
                            e.SuperTip = SuperTip;
                        };

                        #endregion

                        // Кастомизация коллекции меток
                        var storage = scheduler.Storage;
                        IAppointmentLabelStorage labelStorage = storage.Appointments.Labels;
                        FillLabelStorage(labelStorage);

                        #region Кастомизация всплывающего меню на расписании врача
                        DoctorEvent recordedEvent = null;
                        VisitCase   visitCase     = null;

                        // Всплывающее меню на расписании врача
                        scheduler.PopupMenuShowing += (o, e) =>
                        {
                            Pacient pacient = listView.Tag as Pacient;
                            AppointmentBaseCollection appoinments = (o as SchedulerControl).SelectedAppointments;
                            Appointment appoinment = appoinments.Count == 1 ? appoinments[0] : null;
                            if (appoinment == null)
                            {
                                return;
                            }

                            Guid        key    = (Guid)appoinment.Id;
                            DoctorEvent dEvent = appoinment != null && eventsDict.ContainsKey(key) ? eventsDict[key] : null;

                            if (e.Menu.Id != DevExpress.XtraScheduler.SchedulerMenuItemId.AppointmentMenu)
                            {
                                return;
                            }
                            if (pacient != null && dEvent.Pacient == null & recordedEvent == null && dEvent.StartOn > DateTime.Now)
                            {
                                e.Menu.Items.Insert(0, new SchedulerMenuItem("Записать пациента", (o_, e_) =>
                                {
                                    IObjectSpace dEventObjectSpace = XPObjectSpace.FindObjectSpaceByObject(dEvent);
                                    dEvent.Pacient = dEventObjectSpace.GetObject(pacient);
                                    dEventObjectSpace.CommitChanges();
                                    // Обновление списочного представления
                                    listView.CollectionSource.Reload();
                                    // Расписание на которое записан пациент
                                    recordedEvent = dEvent;
                                    // Создание посещения для пациента
                                    visitCase = VisitCase.CreateVisitCase(dEventObjectSpace,
                                                                          dEventObjectSpace.GetObject(pacient),
                                                                          dEvent.AssignedTo, dEvent.StartOn);
                                    dEventObjectSpace.CommitChanges();
                                }));
                            }
                            else if (dEvent != null && dEvent.Pacient != null)
                            {
                                e.Menu.Items.Insert(0, new SchedulerMenuItem("Отменить запись", (o_, e_) =>
                                {
                                    IObjectSpace dEventObjectSpace = XPObjectSpace.FindObjectSpaceByObject(dEvent);
                                    dEvent.Pacient = null;
                                    dEventObjectSpace.CommitChanges();
                                    // Обновление списочного представления
                                    listView.CollectionSource.Reload();
                                    // Отмена записи пациента на выбранное расписание
                                    if (recordedEvent != null && recordedEvent.Oid == dEvent.Oid)
                                    {
                                        recordedEvent = null;
                                    }
                                    if (visitCase != null)
                                    {
                                        dEventObjectSpace.Delete(visitCase);
                                        dEventObjectSpace.CommitChanges();
                                    }
                                }));
                            }
                        };

                        #endregion

                        // Кастомизация цвета фона расписания:
                        // Если выбранный пациент уже записан, то цвет расписания окрашивается в светло-розовый.
                        // Если в расписании записан другой пациент, то цвет расписания окрашивается в морковный.
                        scheduler.AppointmentViewInfoCustomizing += (o_, e_) =>
                        {
                            Pacient pacient = listView.Tag as Pacient;
                            if (pacient != null)
                            {
                                Guid guid = (Guid)e_.ViewInfo.Appointment.Id;
                                if (eventsDict.ContainsKey(guid) && eventsDict[guid].Pacient != null)
                                {
                                    e_.ViewInfo.Appearance.BackColor = eventsDict[guid].Pacient.Oid == pacient.Oid ?
                                                                       Color.FromArgb(255, 192, 192) : Color.FromArgb(255, 128, 0);
                                }
                            }
                        };
                    }
                }
            }
            else if (detailView != null)
            {
                // Кастомизация коллекции меток
                foreach (SchedulerLabelPropertyEditor pe in ((DetailView)View).GetItems <SchedulerLabelPropertyEditor>())
                {
                    if (pe.Control != null)
                    {
                        ISchedulerStorage        storage      = ((AppointmentLabelEdit)pe.Control).Storage;
                        IAppointmentLabelStorage labelStorage = storage.Appointments.Labels;
                        FillLabelStorage(labelStorage);
                    }
                }
            }
        }
Пример #13
0
		private void slidesListView_ItemHover(object sender, ItemHoverEventArgs e)
		{
			toolTipController.HideHint();
			var slideMaster = e.Item?.Tag as SlideMaster;
			if (String.IsNullOrEmpty(slideMaster?.ToolTipHeader) || String.IsNullOrEmpty(slideMaster.ToolTipBody)) return;

			var toolTipParameters = new ToolTipControllerShowEventArgs();
			var superTip = new SuperToolTip();
			var toolTipSetupArgs = new SuperToolTipSetupArgs();
			toolTipSetupArgs.AllowHtmlText = DefaultBoolean.True;
			toolTipSetupArgs.Title.Text = String.Format("<b>{0}</b>", slideMaster.ToolTipHeader);
			toolTipSetupArgs.Title.Font = new Font("Arial", 10);
			toolTipSetupArgs.Contents.Font = new Font("Arial", 9);
			toolTipSetupArgs.Contents.Text = String.Format("<color=gray>{0}</color>", slideMaster.ToolTipBody);
			superTip.Setup(toolTipSetupArgs);
			toolTipParameters.SuperTip = superTip;

			toolTipController.ShowHint(toolTipParameters, MousePosition);
		}