Esempio n. 1
0
 protected MouseListener(Subscribe subscribe)
     : base(subscribe)
 {
     m_PreviousPosition = new Point(-1, -1);
     m_DoubleDown = new ButtonSet();
     m_SingleDown = new ButtonSet();
 }
 public static DialogResult Show(string caption, string message, ButtonSet buttons, Bitmap icon)
 {
     using (var messageBox = new uxCustomMessageForm(caption, message, buttons, icon))
     {
         return messageBox.ShowDialog();
     }
 }
 private void SetButtons(ButtonSet buttons)
 {
     switch (buttons)
     {
         case ButtonSet.Ok:
             this.uxBtnOk.Location = new System.Drawing.Point(250, 110);
             this.uxBtnOk.Visible = true;
             break;
         case ButtonSet.OkCancel:
             this.uxBtnOk.Location = new System.Drawing.Point(125, 110);
             this.uxBtnOk.Visible = true;
             this.uxBtnCancel.Location = new System.Drawing.Point(250, 110);
             this.uxBtnCancel.Visible = true;
             break;
         case ButtonSet.YesNo:
             this.uxBtnYes.Location = new System.Drawing.Point(125, 110);
             this.uxBtnYes.Visible = true;
             this.uxBtnNo.Location = new System.Drawing.Point(250, 110);
             this.uxBtnNo.Visible = true;
             break;
         case ButtonSet.YesNoCancel:
             this.uxBtnYes.Location = new System.Drawing.Point(12, 110);
             this.uxBtnYes.Visible = true;
             this.uxBtnNo.Location = new System.Drawing.Point(138, 110);
             this.uxBtnNo.Visible = true;
             this.uxBtnCancel.Location = new System.Drawing.Point(264, 110);
             this.uxBtnCancel.Visible = true;
             break;
     }
 }
Esempio n. 4
0
 internal void Init(Gtk.Window parent,
 Widget waitingWidget,
 ButtonSet buttonSet,
 string title,
 string statement,
 string secondaryStatement)
 {
     this.Title = title;
       this.HasSeparator = false;
       this.Resizable = false;
       this.Modal = true;
       if(parent != null)
        this.TransientFor = parent;
       this.buttonSet = buttonSet;
       VBox contentVBox = new VBox();
       this.VBox.Add(contentVBox);
       HBox h = new HBox();
       contentVBox.PackStart(h, true, true, 0);
       h.BorderWidth = 10;
       h.Spacing = 10;
       if (waitingWidget != null)
       {
        h.PackStart(waitingWidget, false, false, 0);
       }
       VBox v = new VBox();
       v.Spacing = 10;
       Label l = new Label();
       l.LineWrap = true;
       l.UseMarkup = true;
       l.Selectable = false;
       l.CanFocus = false;
       l.Xalign = 0; l.Yalign = 0;
       l.Markup = "<span weight=\"bold\" size=\"larger\">" + GLib.Markup.EscapeText(statement) + "</span>";
       v.PackStart(l);
       l = new Label(secondaryStatement);
       l.LineWrap = true;
       l.Selectable = false;
       l.CanFocus = false;
       l.Xalign = 0; l.Yalign = 0;
       v.PackStart(l, true, true, 8);
       h.PackEnd(v);
       progressBar = new ProgressBar();
       contentVBox.PackStart(progressBar, true, false, 8);
       progressBar.ActivityBlocks = 20;
       progressBar.Orientation = ProgressBarOrientation.LeftToRight;
       progressBar.PulseStep = 0.05;
       contentVBox.ShowAll();
       this.Realized += new EventHandler(OnRealizeWidget);
       switch(buttonSet)
       {
        case ButtonSet.Cancel:
     this.AddButton(Stock.Cancel, ResponseType.Cancel);
     break;
        case ButtonSet.None:
        default:
     break;
       }
       bHideCalled = false;
 }
Esempio n. 5
0
 public iFolderMsgDialog( Gtk.Window parent,
 DialogType type,
 ButtonSet buttonSet,
 string title,
 string statement,
 string secondaryStatement)
     : base()
 {
     Init(parent, type, buttonSet, title, statement, secondaryStatement, null);
 }
Esempio n. 6
0
 public iFolderWaitDialog(Window parent,
 Widget waitingWidget,
 ButtonSet buttonSet,
 string title,
 string statement,
 string secondaryStatement)
     : base()
 {
     Init(parent, waitingWidget, buttonSet, title, statement, secondaryStatement);
 }
        public uxCustomMessageForm(string caption, string message, ButtonSet buttons, Bitmap icon)
        {
            InitializeComponent();

            this.Text = caption;
            this.uxTbxMessage.Text = message;
            this.uxPbxIcon.Image = icon;

            SetButtons(buttons);
        }
Esempio n. 8
0
 internal void Init(Gtk.Window parent,
 Widget waitingWidget,
 ButtonSet buttonSet,
 string title,
 string statement,
 string secondaryStatement)
 {
     this.Title = title;
       this.HasSeparator = false;
       this.Resizable = false;
       this.Modal = true;
       if(parent != null)
        this.TransientFor = parent;
       this.buttonSet = buttonSet;
       HBox h = new HBox();
       h.BorderWidth = 10;
       h.Spacing = 10;
       if (waitingWidget != null)
       {
        h.PackStart(waitingWidget, false, false, 0);
       }
       VBox v = new VBox();
       v.Spacing = 10;
       Label l = new Label();
       l.LineWrap = true;
       l.UseMarkup = true;
       l.Selectable = false;
       l.CanFocus = false;
       l.Xalign = 0; l.Yalign = 0;
       l.Markup = "<span weight=\"bold\" size=\"larger\">" + statement + "</span>";
       v.PackStart(l);
       l = new Label(secondaryStatement);
       l.LineWrap = true;
       l.Selectable = false;
       l.CanFocus = false;
       l.Xalign = 0; l.Yalign = 0;
       v.PackStart(l, true, true, 8);
       h.PackEnd(v);
       h.ShowAll();
       this.VBox.Add(h);
       switch(buttonSet)
       {
        case ButtonSet.Cancel:
     this.AddButton(Stock.Cancel, ResponseType.Cancel);
     break;
        case ButtonSet.None:
        default:
     break;
       }
 }
Esempio n. 9
0
 internal void Init(Gtk.Window parent,
 DialogType type,
 ButtonSet buttonSet,
 string title,
 string statement,
 string secondaryStatement,
 string details)
 {
     this.Title = title;
       this.HasSeparator = false;
       this.Resizable = false;
       this.Modal = true;
       if(parent != null)
        this.TransientFor = parent;
       HBox h = new HBox();
       h.BorderWidth = 10;
       h.Spacing = 10;
       dialogImage = new Image();
       switch(type)
       {
        case DialogType.Error:
     dialogImage.SetFromStock(Gtk.Stock.DialogError, IconSize.Dialog);
     break;
        case DialogType.Question:
     dialogImage.SetFromStock(Gtk.Stock.DialogQuestion, IconSize.Dialog);
     break;
        case DialogType.Warning:
     dialogImage.SetFromStock(Gtk.Stock.DialogWarning, IconSize.Dialog);
     break;
        default:
        case DialogType.Info:
     dialogImage.SetFromStock(Gtk.Stock.DialogInfo, IconSize.Dialog);
     break;
       }
       dialogImage.SetAlignment(0.5F, 0);
       h.PackStart(dialogImage, false, false, 0);
       VBox v = new VBox();
       v.Spacing = 10;
       Label l = new Label();
       l.LineWrap = true;
       l.UseMarkup = true;
       l.Selectable = false;
       l.CanFocus = false;
       l.Xalign = 0; l.Yalign = 0;
       l.Markup = "<span weight=\"bold\" size=\"larger\">" + GLib.Markup.EscapeText(statement) + "</span>";
       v.PackStart(l);
       l = new Label(secondaryStatement);
       l.LineWrap = true;
       l.Selectable = false;
       l.CanFocus = false;
       l.Xalign = 0; l.Yalign = 0;
       v.PackStart(l, true, true, 8);
       if (details != null)
       {
        detailsExpander = new Expander(Util.GS("_Details"));
        v.PackStart(detailsExpander, false, false, 0);
        TextView textView = new TextView();
        textView.Editable = false;
        textView.WrapMode = WrapMode.Char;
        TextBuffer textBuffer = textView.Buffer;
        textBuffer.Text = details;
        showDetailsScrolledWindow = new ScrolledWindow();
        detailsExpander.Add(showDetailsScrolledWindow);
        showDetailsScrolledWindow.AddWithViewport(textView);
        showDetailsScrolledWindow.Visible = false;
       }
       extraWidgetVBox = new VBox(false, 0);
       v.PackStart(extraWidgetVBox, false, false, 0);
       extraWidgetVBox.NoShowAll = true;
       extraWidget = null;
       h.PackEnd(v);
       h.ShowAll();
       this.VBox.Add(h);
       Widget defaultButton;
       switch(buttonSet)
       {
        default:
        case ButtonSet.Ok:
     defaultButton = this.AddButton(Stock.Ok, ResponseType.Ok);
     break;
        case ButtonSet.OkCancel:
     this.AddButton(Stock.Cancel, ResponseType.Cancel);
     defaultButton = this.AddButton(Stock.Ok, ResponseType.Ok);
     break;
        case ButtonSet.YesNo:
     this.AddButton(Stock.No, ResponseType.No);
     defaultButton = this.AddButton(Stock.Yes, ResponseType.Yes);
     break;
       }
       defaultButton.CanDefault = true;
       defaultButton.GrabFocus();
 }
Esempio n. 10
0
 /// <summary>
 /// Get a specific state out of the controller.
 /// If any controller has the required state true is returned
 /// </summary>
 public bool State(ButtonSet set, ButtonState state)
 {
     switch (set)
     {
         case ButtonSet.Up:
             return Up(state);
         case ButtonSet.Down:
             return Down(state);
         case ButtonSet.Left:
             return Left(state);
         case ButtonSet.Right:
             return Right(state);
         case ButtonSet.A:
             return A(state);
         case ButtonSet.B:
             return B(state);
         case ButtonSet.X:
             return X(state);
         case ButtonSet.Y:
             return Y(state);
         case ButtonSet.ExclusiveA:
             return ExclusiveA(state);
         case ButtonSet.ExclusiveB:
             return ExclusiveB(state);
         case ButtonSet.ExclusiveX:
             return ExclusiveX(state);
         case ButtonSet.ExclusiveY:
             return ExclusiveY(state);
         case ButtonSet.LeftShoulder:
             return LeftShoulder(state);
         case ButtonSet.RightShoulder:
             return RightShoulder(state);
         case ButtonSet.Start:
             return Start(state);
         case ButtonSet.Back:
             return Back(state);
         case ButtonSet.LeftTrigger:
             return LeftTrigger(state);
         case ButtonSet.RightTrigger:
             return RightTrigger(state);
         case ButtonSet.AnyButton:
             return AnyButton(state);
         case ButtonSet.AnyInput:
             return AnyInput(state);
     }
     return false;
 }
Esempio n. 11
0
 /// <summary>
 /// Returns true if any button in the set is released
 /// </summary>
 public bool Released(ButtonSet set)
 {
     return State(set, ButtonState.Released);
 }
Esempio n. 12
0
 /// <summary>
 /// Returns true if any button in the set is pressed
 /// </summary>
 public bool Pressed(ButtonSet set)
 {
     return State(set, ButtonState.Pressed);
 }
Esempio n. 13
0
 /// <summary>
 /// Returns true if any button in the set is held
 /// </summary>
 public bool Held(ButtonSet set)
 {
     return State(set, ButtonState.Held);
 }
Esempio n. 14
0
 /// <summary>
 /// Returns true if any button in the set is down
 /// </summary>
 public bool Continuous(ButtonSet set)
 {
     return State(set, ButtonState.Continuous);
 }
Esempio n. 15
0
        /// <summary>
        /// Get a specific state out of the multi controller.
        /// If any controller has the required state true is returned
        /// </summary>
        public bool State(ButtonSet button, ButtonState state)
        {
            foreach (var c in m_controllers)
                if (c.State(button, state))
                    return true;

            return false;
        }