P
Peted
Hi
i am trying to make a small mdoification to and exisiting dll control,
in its source code.
Im trying to expose one of its internal properties so the user can set
it in the ide at designtime, but the property consists of enumerated
constants used in bit operations, and when the values are exposed they
show up as integers instead of the text contstants listed
EG
//Initial value
private int dwFlags = Gdi.PFD_DRAW_TO_WINDOW |
Gdi.PFD_SUPPORT_OPENGL | Gdi.PFD_DOUBLEBUFFER;
// I expose the property to the ide user here
#region DWFlags
/// <summary>
/// sets the OpenGL control's Flag properties.
/// </summary>
[Category("OpenGL Properties"), Description("Flag
properties.")]
public String DWFlags {
get {
return dwFlags);
}
set {
dwFlags = value);
}
}
#endregion DWFlags
When you see it in the ide the DWFlags value shows as 37, but i want
it to show as
PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
in the control field.
I also want the user to be able to enter the flags as the above text,
even adding more flags to also be used in this bit operation and have
it translated or sent to the control in form that it can be used.
the flags are used in the following opengl structure
Gdi.PIXELFORMATDESCRIPTOR pfd = new Gdi.PIXELFORMATDESCRIPTOR();// The
pixel format descriptor
pfd.nSize = (short) Marshal.SizeOf(pfd);
// Size of the pixel format descriptor
pfd.nVersion = 1;
// Version number (always 1)
--------------->>>> i want to replace this line bellow
pfd.dwFlags =Gdi.PFD_DRAW_TO_WINDOW |
Gdi.PFD_SUPPORT_OPENGL | Gdi.PFD_DOUBLEBUFFER;
----------------------------->>>> with pfd.dwFlags = dwFlags;
pfd.iPixelType = (byte) Gdi.PFD_TYPE_RGBA;
etc etc etc etc
You can see the flags are enumerated constants from opengl
Can anyone help please on how i can pass these flag data beckwards and
forwards to the control and have the user edit it, and still have it
come back and be usuable in the structure
thanks for any help
Peted
i am trying to make a small mdoification to and exisiting dll control,
in its source code.
Im trying to expose one of its internal properties so the user can set
it in the ide at designtime, but the property consists of enumerated
constants used in bit operations, and when the values are exposed they
show up as integers instead of the text contstants listed
EG
//Initial value
private int dwFlags = Gdi.PFD_DRAW_TO_WINDOW |
Gdi.PFD_SUPPORT_OPENGL | Gdi.PFD_DOUBLEBUFFER;
// I expose the property to the ide user here
#region DWFlags
/// <summary>
/// sets the OpenGL control's Flag properties.
/// </summary>
[Category("OpenGL Properties"), Description("Flag
properties.")]
public String DWFlags {
get {
return dwFlags);
}
set {
dwFlags = value);
}
}
#endregion DWFlags
When you see it in the ide the DWFlags value shows as 37, but i want
it to show as
PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
in the control field.
I also want the user to be able to enter the flags as the above text,
even adding more flags to also be used in this bit operation and have
it translated or sent to the control in form that it can be used.
the flags are used in the following opengl structure
Gdi.PIXELFORMATDESCRIPTOR pfd = new Gdi.PIXELFORMATDESCRIPTOR();// The
pixel format descriptor
pfd.nSize = (short) Marshal.SizeOf(pfd);
// Size of the pixel format descriptor
pfd.nVersion = 1;
// Version number (always 1)
--------------->>>> i want to replace this line bellow
pfd.dwFlags =Gdi.PFD_DRAW_TO_WINDOW |
Gdi.PFD_SUPPORT_OPENGL | Gdi.PFD_DOUBLEBUFFER;
----------------------------->>>> with pfd.dwFlags = dwFlags;
pfd.iPixelType = (byte) Gdi.PFD_TYPE_RGBA;
etc etc etc etc
You can see the flags are enumerated constants from opengl
Can anyone help please on how i can pass these flag data beckwards and
forwards to the control and have the user edit it, and still have it
come back and be usuable in the structure
thanks for any help
Peted