public Object InternalUpdate(Object data, string identifier) { Object ret = null; switch (identifier) { case "Id": ret = m_szID; m_szID = (string)data; break; case "Size": ret = m_rectBounds.Size; m_rectBounds.Width = ((Size)data).Width; m_rectBounds.Height = ((Size)data).Height; break; case "Location": ret = m_rectBounds.Location; m_rectBounds.X = ((Point)data).X; m_rectBounds.Y = ((Point)data).Y; break; case "Enabled": ret = m_bEnabled; m_bEnabled = (bool)data; break; case "Visibility": ret = m_visibility; m_visibility = (VISIBLITY_TYPE)data; break; case "Tooltip": ret = m_szTooltip; m_szTooltip = (string)data; break; default: break; } return ret; }
/// <summary> /// Basic Initializer. /// </summary> public Control() { m_visibility = VISIBLITY_TYPE.Visible; m_bEnabled = true; m_bDraggable = true; m_bResizable = true; m_bDragging = false; m_rectBounds = new Rectangle(); m_parent = null; m_szTooltip = ""; m_szDefaultID = "WIDC_CONTROL"; m_bShowCaption = false; m_bOffset = true; m_bPasting = false; }
public Control(ControlProperty resource) : this() { m_rectBounds = new Rectangle(resource.m_rectBounds.Left + ResManager.Instance.DefaultWindowLocation.X, resource.m_rectBounds.Top + ResManager.Instance.DefaultWindowLocation.Y, resource.m_rectBounds.Width, resource.m_rectBounds.Height); m_szID = resource.m_szID; m_bEnabled = (resource.m_bDisabled == 0); m_szTooltip = resource.m_szTooltip; m_szCaption = resource.m_szTitle; m_bShowCaption = resource.m_style.HasFlag(WindowStyle.WBS_CAPTION); m_visibility = VISIBLITY_TYPE.Visible; m_type = (CONTROL_TYPE)System.Enum.Parse(typeof(CONTROL_TYPE), resource.m_szType); /* if (resource.visible == 0) m_visibility = VISIBLITY_TYPE.Visible; else m_visibility = VISIBLITY_TYPE.Hidden; */ }