internal static void setValue(IntPtr thisPtr, int x, int y) { if (_setValueFunc == null) { _setValueFunc = (_setValue)Marshal.GetDelegateForFunctionPointer(Torque3D.DllLoadUtils.GetProcAddress(Torque3D.Torque3DLibHandle, "fn_GuiBitmapCtrl_setValue"), typeof(_setValue)); } _setValueFunc(thisPtr, x, y); }
internal static void setValue(IntPtr thisPtr, [MarshalAs(UnmanagedType.LPWStr)] string value) { if (_setValueFunc == null) { _setValueFunc = (_setValue)Marshal.GetDelegateForFunctionPointer(Torque3D.DllLoadUtils.GetProcAddress(Torque3D.Torque3DLibHandle, "fn_GuiControl_setValue"), typeof(_setValue)); } _setValueFunc(thisPtr, value); }
internal static void setValue(IntPtr thisPtr, int argc, string[] argv) { if (_setValueFunc == null) { _setValueFunc = (_setValue)Marshal.GetDelegateForFunctionPointer(Torque3D.DllLoadUtils.GetProcAddress(Torque3D.Torque3DLibHandle, "fn_GuiFilterCtrl_setValue"), typeof(_setValue)); } _setValueFunc(thisPtr, argc, argv); }
internal static void setValue(IntPtr thisPtr, float pos, bool doCallback) { if (_setValueFunc == null) { _setValueFunc = (_setValue)Marshal.GetDelegateForFunctionPointer(Torque3D.DllLoadUtils.GetProcAddress(Torque3D.Torque3DLibHandle, "fn_GuiSliderCtrl_setValue"), typeof(_setValue)); } _setValueFunc(thisPtr, pos, doCallback); }
/// <summary> /// We dont know the address yet. Set the delegate first time a property is set. /// </summary> /// <param name="valueMethod"></param> /// <param name="value"></param> private void SetUnknown(_setValue valueMethod, object value) { //Address is not set use, selected range if (_fromRow == -1) { SetToSelectedRange(); } SetDelegate(); _changePropMethod(valueMethod, value); }
/// <summary> /// Set a single cell /// </summary> /// <param name="valueMethod"></param> /// <param name="value"></param> private void SetSingle(_setValue valueMethod, object value) { valueMethod(value, _fromRow, _fromCol); }
/// <summary> /// Set a range /// </summary> /// <param name="valueMethod"></param> /// <param name="value"></param> private void SetRange(_setValue valueMethod, object value) { SetValueAddress(this, valueMethod, value); }
/// <summary> /// Set a multirange (A1:A2,C1:C2) /// </summary> /// <param name="valueMethod"></param> /// <param name="value"></param> private void SetMultiRange(_setValue valueMethod, object value) { SetValueAddress(this, valueMethod, value); foreach (var address in Addresses) { SetValueAddress(address, valueMethod, value); } }
/// <summary> /// Set the property for an address /// </summary> /// <param name="address"></param> /// <param name="valueMethod"></param> /// <param name="value"></param> private static void SetValueAddress(ExcelAddress address, _setValue valueMethod, object value) { for (int col = address.Start.Column; col <= address.End.Column; col++) { for (int row = address.Start.Row; row <= address.End.Row; row++) { valueMethod(value, row, col); } } }