示例#1
0
        public IntPtr MarshalManagedToNative(object managedObj)
        {
            if (managedObj == null)
            {
                return(IntPtr.Zero);
            }

            IupHandle ih = managedObj as IupHandle;

            if (ih == null)
            {
                throw new ArgumentException("managedObj", "Can only marshal type of Tecgraf.IupHandle");
            }

            return(IupHandle.GetCHandle(ih));
        }
示例#2
0
        private static IntPtr[] PtrArrayOf(params IupHandle[] h)
        {
            if (h == null)
            {
                return(null);
            }

            IntPtr[] res = new IntPtr[h.Length + 1];  //one extra element for zero termination
            int      c   = 0;

            foreach (IupHandle ih in h)
            {
                if (ih != null)
                {
                    res[c++] = IupHandle.GetCHandle(ih);
                }
                else
                {
                    res[c++] = IntPtr.Zero;
                }
            }
            res[c] = IntPtr.Zero; //zero terminate array
            return(res);
        }
示例#3
0
 public static IupHandle Submenu(string title, IupHandle child)
 {
     return(IupHandle.Create(NativeIUP.IupSubmenu(title, IupHandle.GetCHandle(child))));
 }
示例#4
0
 public static IupHandle ElementPropertiesDialog(IupHandle element)
 {
     return(IupHandle.Create(NativeIUP.IupElementPropertiesDialog(IupHandle.GetCHandle(element))));
 }
示例#5
0
 public IupHandle Append(IupHandle child)
 {
     return(new IupHandle(NativeIUP.IupAppend(Handle, IupHandle.GetCHandle(child))));
 }
示例#6
0
 public static IntPtr TreeGetUserId(IupHandle ih_tree, int id)
 {
     return(NativeIUP.IupTreeGetUserId(IupHandle.GetCHandle(ih_tree), id));
 }
示例#7
0
 public static void TreeSetAttributeHandle(IupHandle ih, string name, int id, IupHandle ih_named)
 {
     NativeIUP.IupTreeSetAttributeHandle(IupHandle.GetCHandle(ih), name, id, IupHandle.GetCHandle(ih_named));
 }
示例#8
0
 public static void TextConvertLinColToPos(IupHandle ih, int lin, int col, out int pos)
 {
     NativeIUP.IupTextConvertLinColToPos(IupHandle.GetCHandle(ih), lin, col, out pos);
 }
示例#9
0
 public static int ConvertXYToPos(IupHandle ih, int x, int y)
 {
     return(NativeIUP.IupConvertXYToPos(IupHandle.GetCHandle(ih), x, y));
 }
示例#10
0
 public static void SetLanguagePack(IupHandle ih)
 {
     NativeIUP.IupSetLanguagePack(IupHandle.GetCHandle(ih));
 }
示例#11
0
 public static IupHandle Radio(IupHandle child)
 {
     return(IupHandle.Create(NativeIUP.IupRadio(IupHandle.GetCHandle(child))));
 }
示例#12
0
 /// <summary>
 /// Moves an interface element from one position in the hierarchy tree to another.
 /// Both new_parent and child must be mapped or unmapped at the same time.
 /// If ref_child is Ihandle.Zero, then it will append the child to the new_parent.
 /// If ref_child is NOT Ihandle.Zero then it will insert child before ref_child inside the new_parent.
 /// </summary>
 /// <returns>Result.Error on error, otherwise Result.NoError</returns>
 public Result Reparent(IupHandle new_parent, IupHandle ref_child)
 {
     return((Result)NativeIUP.IupReparent(Handle, IupHandle.GetCHandle(new_parent), IupHandle.GetCHandle(ref_child)));
 }
示例#13
0
 public void SetAttributeHandle(string name, IupHandle ih_named)
 {
     NativeIUP.IupSetAttributeHandle(Handle, name, IupHandle.GetCHandle(ih_named));
 }
示例#14
0
 public IupHandle GetNextChild(IupHandle child)
 {
     return(new IupHandle(NativeIUP.IupGetNextChild(Handle, IupHandle.GetCHandle(child))));
 }
示例#15
0
 public int GetChildPos(IupHandle child)
 {
     return(NativeIUP.IupGetChildPos(Handle, IupHandle.GetCHandle(child)));
 }
示例#16
0
 public IupHandle Insert(IupHandle ref_child, IupHandle child)
 {
     return(new IupHandle(NativeIUP.IupInsert(Handle, IupHandle.GetCHandle(ref_child), IupHandle.GetCHandle(child))));
 }
示例#17
0
 public static IupHandle Dialog(IupHandle child)
 {
     return(IupHandle.Create(NativeIUP.IupDialog(IupHandle.GetCHandle(child))));
 }
示例#18
0
 public static IupHandle Split(IupHandle child1, IupHandle child2)
 {
     return(IupHandle.Create(NativeIUP.IupSplit(IupHandle.GetCHandle(child1), IupHandle.GetCHandle(child2))));
 }
示例#19
0
 public static bool SaveImageAsText(IupHandle ih, string filename, SaveImageFormat format, string name)
 {
     return(NativeIUP.IupSaveImageAsText(IupHandle.GetCHandle(ih), filename, format.ToString().ToUpper(), name) != 0);
 }
示例#20
0
 public static IupHandle ScrollBox(IupHandle child)
 {
     return(IupHandle.Create(NativeIUP.IupScrollBox(IupHandle.GetCHandle(child))));
 }
示例#21
0
 public static void TextConvertPosToLinCol(IupHandle ih, int pos, out int lin, out int col)
 {
     NativeIUP.IupTextConvertPosToLinCol(IupHandle.GetCHandle(ih), pos, out lin, out col);
 }
示例#22
0
 public static IupHandle Expander(IupHandle child)
 {
     return(IupHandle.Create(NativeIUP.IupExpander(IupHandle.GetCHandle(child))));
 }
示例#23
0
 public static bool TreeSetUserId(IupHandle ih_tree, int id, IntPtr userid)
 {
     return(NativeIUP.IupTreeSetUserId(IupHandle.GetCHandle(ih_tree), id, userid) != 0);
 }
示例#24
0
 public static IupHandle DetachBox(IupHandle child)
 {
     return(IupHandle.Create(NativeIUP.IupDetachBox(IupHandle.GetCHandle(child))));
 }
示例#25
0
 public static int TreeGetId(IupHandle ih_tree, IntPtr userid)
 {
     return(NativeIUP.IupTreeGetId(IupHandle.GetCHandle(ih_tree), userid));
 }
示例#26
0
 public static void Palette(IupHandle ih, int index, float r, float g, float b)
 {
     NativeIUPGL.IupGLPalette(IupHandle.GetCHandle(ih), index, r, g, b);
 }
示例#27
0
 public static IupHandle LayoutDialog(IupHandle dialog)
 {
     return(IupHandle.Create(NativeIUP.IupLayoutDialog(IupHandle.GetCHandle(dialog))));
 }
示例#28
0
 public static IupHandle Frame(IupHandle child)
 {
     return(IupHandle.Create(NativeIUP.IupFrame(IupHandle.GetCHandle(child))));
 }
示例#29
0
 public static IupHandle BackgroundBox(IupHandle child)
 {
     return(IupHandle.Create(NativeIUP.IupBackgroundBox(IupHandle.GetCHandle(child))));
 }
示例#30
0
 public static void UseFont(IupHandle ih, int first, int count, int list_base)
 {
     NativeIUPGL.IupGLUseFont(IupHandle.GetCHandle(ih), first, count, list_base);
 }