1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-26 11:38:02 +02:00

Got rid of Action<T>/Func<T>

This commit is contained in:
Brian Fiete 2020-05-08 07:10:35 -07:00
parent 44bd9c698f
commit b52db47d55
37 changed files with 94 additions and 88 deletions

View file

@ -53,7 +53,7 @@ namespace Beefy.theme.dark
public FontAlign mLabelAlign = FontAlign.Centered;
public FrameKind mFrameKind = .OnWindow;
public Event<Action<Menu>> mPopulateMenuAction ~ _.Dispose();
public Event<delegate void(Menu)> mPopulateMenuAction ~ _.Dispose();
public CBMenuWidget mCurMenuWidget;
bool mJustClosed;
public uint32 mBkgColor;

View file

@ -842,8 +842,8 @@ namespace Beefy.theme.dark
public SortType mSortType = SortType() ~ { mSortType.mColumn = -1; };
public Insets mInsets ~ delete _;
public Event<Action<DragEvent>> mOnDragUpdate ~ _.Dispose();
public Event<Action<DragEvent>> mOnDragEnd ~ _.Dispose();
public Event<delegate void(DragEvent)> mOnDragUpdate ~ _.Dispose();
public Event<delegate void(DragEvent)> mOnDragEnd ~ _.Dispose();
public this()
{

View file

@ -14,7 +14,7 @@ namespace Beefy.theme.dark
public bool mAllowEdit = true;
public Object mValue;
public List<Widget> mMoveWidgets;
public Action<DarkSmartEdit> mValueChangedAction;
public delegate void(DarkSmartEdit) mValueChangedAction;
bool mCancelingEdit;
float mMouseDownX;

View file

@ -397,7 +397,7 @@ namespace Beefy.theme.dark
return tabCount;
}
public override void WithTabs(Action<TabbedView.TabButton> func)
public override void WithTabs(delegate void(TabbedView.TabButton) func)
{
for (var tab in mTabs)
func(tab);

View file

@ -111,7 +111,7 @@ namespace Beefy.utils
Clear();
}
public void WithActions(Action<UndoAction> func)
public void WithActions(delegate void(UndoAction) func)
{
for (var action in mUndoList)
func(action);

View file

@ -376,7 +376,7 @@ namespace Beefy.widgets
}
protected void SerializeTimeline<T>(StructuredData data, TimelineData<T> timelineData, String name,
String[] componentNames, Action<StructuredData, T>[] writeActions, T theDefault) where T : IEquatable<T>
String[] componentNames, Delegate[] writeActions, T theDefault) where T : IEquatable<T>
{
/*if ((timelineData.mEntries != null) && (timelineData.mEntries.Count > 0))
{
@ -433,7 +433,7 @@ namespace Beefy.widgets
data.Add("ResId", resIdStr);
}
SerializeTimeline(data, mTimelineAnchor, "Anchor",
/*SerializeTimeline(data, mTimelineAnchor, "Anchor",
scope String[] { "X", "Y" },
scope Action<StructuredData, CompositionPos>[] { scope => CompositionPos.WriteX, scope => CompositionPos.WriteY },
CompositionPos(0, 0));
@ -451,7 +451,7 @@ namespace Beefy.widgets
SerializeTimeline(data, mTimelineRot, "Rotation",
scope String[] { "Angle" },
null,
0.0f);
0.0f);*/
}
public void RebuildChildIndices()

View file

@ -213,7 +213,7 @@ namespace Beefy.widgets
return parentFrame;
}
public void WithAllDockedWidgets(Action<DockedWidget> func)
public void WithAllDockedWidgets(delegate void(DockedWidget) func)
{
for (var dockedWidget in mDockedWidgets)
{

View file

@ -137,7 +137,7 @@ namespace Beefy.widgets
}
}
public void WithItems(Action<ListViewItem> func)
public void WithItems(delegate void(ListViewItem) func)
{
if (mChildItems != null)
{
@ -149,7 +149,7 @@ namespace Beefy.widgets
}
}
public void WithSelectedItems(Action<ListViewItem> func, bool skipSelectedChildrenOnSelectedItems = false, bool skipClosed = false)
public void WithSelectedItems(delegate void(ListViewItem) func, bool skipSelectedChildrenOnSelectedItems = false, bool skipClosed = false)
{
bool selfSelected = Selected;
if (selfSelected)
@ -684,7 +684,7 @@ namespace Beefy.widgets
protected ListViewItem mRoot;
public bool mListSizeDirty;
public float mHeaderHeight;
public Event<Action<ListViewItem>> mOnFocusChanged ~ _.Dispose();
public Event<delegate void(ListViewItem)> mOnFocusChanged ~ _.Dispose();
public float mBottomInset = 8;
public bool mAllowMultiSelect = true;
public Event<delegate void(ListViewItem item, float x, float y, int32 btnNum, int32 btnCount)> mOnItemMouseDown ~ _.Dispose();

View file

@ -110,7 +110,7 @@ namespace Beefy.widgets
public float mMaxContainerWidth = Int32.MaxValue;
public Insets mPopupInsets = new Insets() ~ delete _;
public bool mHasClosed;
public Event<Action<int>> mOnSelectionChanged ~ _.Dispose();
public Event<delegate void(int)> mOnSelectionChanged ~ _.Dispose();
public bool mWasInitialized;
public this(Menu menu)

View file

@ -14,7 +14,7 @@ namespace Beefy.widgets
{
public Scrollbar mScrollbar;
public DragHelper mDraggableHelper ~ delete _;
public Event<Action<float, float>> mOnDrag ~ _.Dispose();
public Event<delegate void(float, float)> mOnDrag ~ _.Dispose();
public this()
{

View file

@ -346,7 +346,7 @@ namespace Beefy.widgets
int32 mRefCount = 1;
public Event<OpenNewWindowDelegate> mOpenNewWindowDelegate ~ _.Dispose();
public Event<Action<TabbedView>> mTabbedViewClosed ~ _.Dispose();
public Event<delegate void(TabbedView)> mTabbedViewClosed ~ _.Dispose();
public SharedData Ref()
{
@ -363,7 +363,7 @@ namespace Beefy.widgets
public delegate void OpenNewWindowDelegate(TabbedView tabbedView, WidgetWindow newWindow);
public Action<Menu> mPopulateMenuEvent;
public delegate void(Menu) mPopulateMenuEvent;
public float mTabHeight;
public float mTabAreaWidth;
public bool mNeedResizeTabs;
@ -417,7 +417,7 @@ namespace Beefy.widgets
return mTabs.Count;
}
public virtual void WithTabs(Action<TabbedView.TabButton> func)
public virtual void WithTabs(delegate void(TabbedView.TabButton) func)
{
for (var tab in mTabs)
func(tab);

View file

@ -80,7 +80,7 @@ namespace Beefy.widgets
public Event<RemovedFromParentHandler> mOnRemovedFromParent ~ _.Dispose();
public Event<AddedToParentHandler> mOnAddedToParent ~ _.Dispose();
public Event<KeyDownHandler> mOnKeyDown ~ _.Dispose();
public Event<Action<Widget>> mOnDeleted ~ _.Dispose();
public Event<delegate void(Widget)> mOnDeleted ~ _.Dispose();
public Matrix Transform
{

View file

@ -29,7 +29,7 @@ namespace Beefy.widgets
public Event<MouseWheelHandler> mOnMouseWheel ~ _.Dispose();
public Event<MenuItemSelectedHandler> mOnMenuItemSelected ~ _.Dispose();
public Event<KeyDownHandler> mOnWindowKeyDown ~ _.Dispose();
public Event<Func<int32, int32, HitTestResult>> mOnHitTest ~ _.Dispose();
public Event<delegate HitTestResult(int32, int32)> mOnHitTest ~ _.Dispose();
public static Event<MouseLeftWindowHandler> sOnMouseLeftWindow ~ _.Dispose();
public static Event<WindowLostFocusHandler> sOnWindowLostFocus ~ _.Dispose();