public override void Initialize() { base.Initialize (); Widget.SetButtonType (NSButtonType.PushOnPushOff); lastState = Widget.State = NSCellStateValue.Off; ((MacButton)Widget).ActivatedInternal += (obj) => NotifyToggle(); }
partial void ChangeNewEmptyDoc(NSObject sender) { NSCellStateValue state = checkBox.State; Console.WriteLine("Checkbox changed: {0}", (state == NSCellStateValue.Off ? "off" : "on")); PreferenceController.PreferenceEmptyDoc = state == NSCellStateValue.On ? true : false; }
public override void Initialize() { base.Initialize(); Widget.SetButtonType(NSButtonType.PushOnPushOff); lastState = Widget.State = NSCellStateValue.Off; ((MacButton)Widget).ActivatedInternal += (obj) => NotifyToggle(); }
internal void NotifyToggle() { if (lastState != Widget.State) { lastState = Widget.State; ApplicationContext.InvokeUserCode(EventSink.OnToggled); } }
private void SetAvailability(NSCellStateValue state, string fan, DateTime day) { DeleteAvailability(fan, day); if (state != NSCellStateValue.Off) { var availability = new FilmFanAvailability(fan, StartTime(day), EndTime(day)); ScreeningsPlan.Availabilities.Add(availability); } }
private void AssignDepthBufferEnabled(bool depth) { Tiled2Unity.Settings.DepthBufferEnabled = depth; NSCellStateValue state = depth ? NSCellStateValue.On : NSCellStateValue.Off; this.CheckButtonDepthBufferEnabled.State = state; NSUserDefaults.StandardUserDefaults.SetBool(depth, ViewController.LastDepthBufferEnabled); }
private void AssignPreferConvexPolygons(bool convex) { Tiled2Unity.Settings.PreferConvexPolygons = convex; NSCellStateValue state = convex ? NSCellStateValue.On : NSCellStateValue.Off; this.CheckButtonPreferConvexPolygons.State = state; NSUserDefaults.StandardUserDefaults.SetBool(convex, ViewController.LastPreferConvexPolygons); }
public override void Initialize() { var mb = new MacButton(EventSink, ApplicationContext); lastState = mb.State = NSCellStateValue.On; mb.ActivatedInternal += HandleActivatedInternal; ViewObject = mb; Widget.SetButtonType(NSButtonType.Radio); Widget.Title = String.Empty; }
public override NSObject GetObjectValue(object dataItem) { if (Widget.Binding != null) { NSCellStateValue state = NSCellStateValue.Off; var val = Widget.Binding.GetValue(dataItem); state = val != null ? val.Value ? NSCellStateValue.On : NSCellStateValue.Off : NSCellStateValue.Mixed; return(new NSNumber((int)state)); } return(new NSNumber((int)NSCellStateValue.Off)); }
void CheckStateChanged() { if (!realAllowMixed && Widget.State != NSCellStateValue.Mixed) { Widget.AllowsMixedState = false; } if (currentState != Widget.State) { currentState = Widget.State; ApplicationContext.InvokeUserCode(EventSink.OnToggled); } }
internal void NotifyToggle() { if (lastState != Widget.State) { switch (((Button)Frontend).Style) { case ButtonStyle.Borderless: case ButtonStyle.Flat: Widget.ShowsBorderOnlyWhileMouseInside = !Active; break; } lastState = Widget.State; ApplicationContext.InvokeUserCode(EventSink.OnToggled); } }
public static CheckBoxState ToXwtState(this NSCellStateValue state) { switch (state) { case NSCellStateValue.Mixed: return(CheckBoxState.Mixed); case NSCellStateValue.On: return(CheckBoxState.On); case NSCellStateValue.Off: return(CheckBoxState.Off); default: throw new ArgumentOutOfRangeException(); } }
internal void NotifyToggle() { if (lastState != Widget.State) { switch (((Button)Frontend).Style) { case ButtonStyle.Borderless: case ButtonStyle.Flat: Messaging.void_objc_msgSend_bool(Widget.Handle, selSetShowsBorderOnlyWhileMouseInside.Handle, !Active); break; } lastState = Widget.State; ApplicationContext.InvokeUserCode(delegate { EventSink.OnToggled(); }); } }
internal void NotifyToggle () { if (lastState != Widget.State) { switch (((Button)Frontend).Style) { case ButtonStyle.Borderless: case ButtonStyle.Flat: #if MONOMAC Messaging.void_objc_msgSend_bool (Widget.Handle, selSetShowsBorderOnlyWhileMouseInside.Handle, !Active); #else Widget.ShowsBorderOnlyWhileMouseInside = !Active; #endif break; } lastState = Widget.State; ApplicationContext.InvokeUserCode (delegate { EventSink.OnToggled (); }); } }
public override NSObject GetObjectValue(object dataItem) { if (Widget.Binding != null) { NSCellStateValue state = NSCellStateValue.Off; var val = Widget.Binding.GetValue(dataItem); if (val is bool?) { var boolVal = (bool?)val; state = boolVal != null ? boolVal.Value ? NSCellStateValue.On : NSCellStateValue.Off : NSCellStateValue.Mixed; } else if (val is bool) { var boolVal = (bool)val; state = boolVal ? NSCellStateValue.On : NSCellStateValue.Off; } return(new NSNumber((int)state)); } return(new NSNumber((int)NSCellStateValue.Off)); }
public void SetCheckStateAtIndex(int index, NSCellStateValue state) { TagsList [index].CheckState = state; }
private bool ToBoolean(NSCellStateValue s) => s == NSCellStateValue.On;