예제 #1
0
        private void toolTipController1_BeforeShow(object sender, DevExpress.Utils.ToolTipControllerShowEventArgs e)
        {
            // Get the ToolTipController.
            ToolTipController controller = sender as ToolTipController;

            // Check, if it's an appointment or not.
            // If it's not an appointment, then exit.
            AppointmentViewInfo aptViewInfo = controller.ActiveObject as AppointmentViewInfo;

            if (aptViewInfo == null)
            {
                return;
            }

            // Set a custom icon for a tooltip.
            e.IconType = ToolTipIconType.Information;

            // Set a custom title for a tooltip.
            e.Title = aptViewInfo.Appointment.Description;

            // Set a custom text for a tooltip.
            e.ToolTip = aptViewInfo.Appointment.Subject + " (" + aptViewInfo.Appointment.Location + ")"
                        + Environment.NewLine +
                        aptViewInfo.Appointment.Start.ToShortTimeString() + " - " + aptViewInfo.Appointment.End.ToShortTimeString();
        }
        private void toolTipController1_BeforeShow(object sender, DevExpress.Utils.ToolTipControllerShowEventArgs e)
        {
            if (toolTipController1.ActiveObject is AppointmentViewInfo)
            {
                Appointment apt = ((AppointmentViewInfo)toolTipController1.ActiveObject).Appointment;

                e.ToolTipType = ToolTipType.SuperTip;

                SuperToolTip     stt       = new SuperToolTip();
                ToolTipTitleItem ttiTitle  = new ToolTipTitleItem();
                ToolTipItem      ttiBody   = new ToolTipItem();
                ToolTipItem      ttiFooter = new ToolTipItem();

                ttiTitle.Text = "Appointment";

                ttiBody.Text = string.Format("Subject: {0} \nDescription: {1}\nPrice: {2}",
                                             apt.Subject, apt.Description, apt.CustomFields["cfPrice"]);

                ttiBody.Image = SystemIcons.Information.ToBitmap();

                ttiFooter.AllowHtmlText        = DefaultBoolean.True;
                ttiFooter.Text                 = "<b>www.devexpress.com</b>";
                ttiFooter.Appearance.BackColor = Color.Red;
                ttiFooter.Appearance.ForeColor = Color.Blue;
                ttiFooter.LeftIndent           = 30;

                stt.Items.Add(ttiTitle);
                stt.Items.AddSeparator();
                stt.Items.Add(ttiBody);
                stt.Items.AddSeparator();
                stt.Items.Add(ttiFooter);

                e.SuperTip = stt;
            }

            if (toolTipController1.ActiveObject is ResourceHeader)
            {
                Resource res = ((ResourceHeader)toolTipController1.ActiveObject).Resource;

                e.ToolTipType = ToolTipType.Standard;
                e.Rounded     = true;

                e.Title   = "Resource";
                e.ToolTip = res.Caption;
            }

            if (toolTipController1.ActiveObject is DayHeader || toolTipController1.ActiveObject is TimeScaleHeader)
            {
                TimeInterval interval = ((SchedulerHeader)toolTipController1.ActiveObject).Interval;

                e.ToolTipType = ToolTipType.Standard;
                e.IconType    = ToolTipIconType.Exclamation;
                e.ShowBeak    = true;
                e.Title       = "TimeInterval";
                e.ToolTip     = interval.ToString();
            }
        }
예제 #3
0
 public ToolTipBeforeShow_EventArgs(
     DevExpress.Utils.ToolTipControllerShowEventArgs ttControllerEventArgs,
     DevExpress.XtraGrid.Views.Grid.GridView gridView,
     GridColumn column,
     int rowHandle)
 {
     _ttControllerEventArgs = ttControllerEventArgs;
     _column    = column;
     _rowHandle = rowHandle;
     _gridView  = gridView;
 }
예제 #4
0
        private void toolTipController_BeforeShow(object sender, DevExpress.Utils.ToolTipControllerShowEventArgs e)
        {
            ToolTipController controller = sender as ToolTipController;


            AppointmentViewInfo aptViewInfo = controller.ActiveObject as AppointmentViewInfo;

            if (aptViewInfo == null)
            {
                return;
            }

            e.Title   = aptViewInfo.Appointment.Subject;
            e.ToolTip = string.Format("{0}", aptViewInfo.Appointment.Description);
        }
예제 #5
0
        private void toolTipController1_BeforeShow(object sender, DevExpress.Utils.ToolTipControllerShowEventArgs e)
        {
            if (e.SelectedObject is DevExpress.XtraScheduler.Appointment)
            {
                DevExpress.XtraScheduler.Appointment appointment =
                    (DevExpress.XtraScheduler.Appointment)e.SelectedObject;

                if (appointment != null)
                {
                    DataRowView rowView = (DataRowView)appointment.GetRow(schedulerControl1.Storage);

                    if (rowView != null)
                    {
                        e.Title   = rowView["strServiceCode"].ToString() + " " + rowView["strMemberName"].ToString();
                        e.ToolTip = "Tel No: " + rowView["strMobileNo"].ToString() + " \n Remark: " + rowView["strRemarks"].ToString();
                    }
                }
            }
        }
예제 #6
0
        private void toolTipController1_BeforeShow(object sender, DevExpress.Utils.ToolTipControllerShowEventArgs e)
        {
            try
            {
                if (toolTipController1.ActiveObject is AppointmentViewInfo)
                {
                    Appointment apt  = ((AppointmentViewInfo)toolTipController1.ActiveObject).Appointment;
                    Assignment  ass  = apt.GetSourceObject(schedulerStorage1) as Assignment;
                    IBooking    book = ass.Booking;

                    string op = "";
                    if (book.Operator != null)
                    {
                        op = book.Operator.Descrizione;
                    }

                    float acconto = 0;
                    float saldo   = 0;
                    float totale  = 0;

                    if (book.Confirmed)
                    {
                        acconto = book.Payment.Accont;
                        saldo   = book.Payment.RestOfPayment;
                        totale  = book.Payment.Total;
                    }


                    e.ToolTipType = ToolTipType.SuperTip;

                    SuperToolTip     stt        = new SuperToolTip();
                    ToolTipTitleItem ttiTitle   = new ToolTipTitleItem();
                    ToolTipItem      ttiBody    = new ToolTipItem();
                    ToolTipItem      ttiFooter  = new ToolTipItem();
                    ToolTipItem      ttiFooter1 = new ToolTipItem();

                    ttiTitle.Text = "Dati prenotazione";

                    ttiBody.AllowHtmlText = DefaultBoolean.True;
                    ttiBody.Text          = string.Format("<b>Data:</b> {0} \n<b>Oggetto:</b> {1} \n<b>Tipo prenotazione:</b> {2}\n<b>Operatore:</b> {3}\n<b>Note:</b> {4} \n",
                                                          book.Date.ToShortDateString(), book.Notes, book.BookingType.Descrizione, op, book.Notes1);
                    ttiBody.Image = SelectImage(ass);

                    ttiFooter.Text          = "Pagamento";
                    ttiFooter.AllowHtmlText = DefaultBoolean.True;
                    ttiFooter.Image         = Properties.Resources.wallet_16;


                    ttiFooter.Text = string.Format("<b>Acconto:</b> {0} \n<b>Saldo versato (da versare):</b> {1}({2})\n<b>Totale:</b> {3}",
                                                   acconto.ToString("c2"), saldo.ToString("c2"), (totale - acconto).ToString("c2"), totale.ToString("c2"));
                    //ttiFooter.Appearance.BackColor = Color.Red;
                    ttiFooter.Appearance.ForeColor = Color.FromArgb(0x66, 0x99, 0xFF);


                    ttiFooter1.Text          = "Assegnazione camera";
                    ttiFooter1.AllowHtmlText = DefaultBoolean.True;
                    ttiFooter1.Image         = Properties.Resources.label_16;


                    ttiFooter1.Text = string.Format("<b>Chek in:</b> {0} \n<b>Check out:</b> {1}\n<b>Letti:</b> {2}\n<b>Note:</b> {3}",
                                                    ass.StartDate.ToShortDateString(), ass.EndDate.ToShortDateString(), ass.BedType.Descrizione, ass.Notes);
                    //ttiFooter.Appearance.BackColor = Color.Red;
                    ttiFooter1.Appearance.ForeColor = Color.FromArgb(0x66, 0x99, 0x66);

                    stt.Items.Add(ttiTitle);
                    stt.Items.AddSeparator();
                    stt.Items.Add(ttiBody);
                    stt.Items.AddSeparator();
                    stt.Items.Add(ttiFooter);
                    stt.Items.AddSeparator();
                    stt.Items.Add(ttiFooter1);

                    e.SuperTip = stt;
                }
            }
            catch (Exception)
            {
            }
        }