///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Loads the widget /// </summary> /// /// <param name="configFileFilename">Filename of the config file. /// The config file must contain a Slider2d section with the needed information.</param> /// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public Slider2d(string configFileFilename) { m_DraggableWidget = true; m_LoadedConfigFile = Global.ResourcePath + configFileFilename; // Parse the config file ConfigFile configFile = new ConfigFile(m_LoadedConfigFile, "Slider2d"); // Find the folder that contains the config file string configFileFolder = m_LoadedConfigFile.Substring(0, m_LoadedConfigFile.LastIndexOfAny(new char[] { '/', '\\' }) + 1); // Loop over all properties for (int i = 0; i < configFile.Properties.Count; ++i) { if (configFile.Properties[i] == "separatehoverimage") { m_SeparateHoverImage = configFile.ReadBool(i); } else if (configFile.Properties[i] == "tracknormalimage") { configFile.ReadTexture(i, configFileFolder, m_TextureTrackNormal); } else if (configFile.Properties[i] == "trackhoverimage") { configFile.ReadTexture(i, configFileFolder, m_TextureTrackHover); } else if (configFile.Properties[i] == "thumbnormalimage") { configFile.ReadTexture(i, configFileFolder, m_TextureThumbNormal); } else if (configFile.Properties[i] == "thumbhoverimage") { configFile.ReadTexture(i, configFileFolder, m_TextureThumbHover); } else { Internal.Output("TGUI warning: Unrecognized property '" + configFile.Properties[i] + "' in section Slider2d in " + m_LoadedConfigFile + "."); } } // Make sure the required textures were loaded if ((m_TextureTrackNormal.texture != null) && (m_TextureThumbNormal.texture != null)) { // Set the size of the slider m_Size = new Vector2f(m_TextureTrackNormal.Size.X, m_TextureTrackNormal.Size.Y); } else { throw new Exception("Not all needed images were loaded for the slider. Is the Slider2d section in " + m_LoadedConfigFile + " complete?"); } // Check if optional textures were loaded if ((m_TextureTrackHover.texture != null) && (m_TextureThumbHover.texture != null)) { m_WidgetPhase |= (byte)WidgetPhase.Hover; } }
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Loads the widget /// </summary> /// /// <param name="configFileFilename">Filename of the config file. /// The config file must contain a SpinButton section with the needed information.</param> /// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public SpinButton(string configFileFilename) { m_LoadedConfigFile = Global.ResourcePath + configFileFilename; // Parse the config file ConfigFile configFile = new ConfigFile(m_LoadedConfigFile, "SpinButton"); // Find the folder that contains the config file string configFileFolder = m_LoadedConfigFile.Substring(0, m_LoadedConfigFile.LastIndexOfAny(new char[] { '/', '\\' }) + 1); // Loop over all properties for (int i = 0; i < configFile.Properties.Count; ++i) { if (configFile.Properties[i] == "separatehoverimage") { m_SeparateHoverImage = configFile.ReadBool(i); } else if (configFile.Properties[i] == "arrowupnormalimage") { configFile.ReadTexture(i, configFileFolder, m_TextureArrowUpNormal); } else if (configFile.Properties[i] == "arrowuphoverimage") { configFile.ReadTexture(i, configFileFolder, m_TextureArrowUpHover); } else if (configFile.Properties[i] == "arrowdownnormalimage") { configFile.ReadTexture(i, configFileFolder, m_TextureArrowDownNormal); } else if (configFile.Properties[i] == "arrowdownhoverimage") { configFile.ReadTexture(i, configFileFolder, m_TextureArrowDownHover); } else { Internal.Output("TGUI warning: Unrecognized property '" + configFile.Properties[i] + "' in section SpinButton in " + m_LoadedConfigFile + "."); } } // Make sure the required textures were loaded if ((m_TextureArrowUpNormal.texture != null) && (m_TextureArrowDownNormal.texture != null)) { m_Size = new Vector2f(m_TextureArrowUpNormal.Size.X, m_TextureArrowUpNormal.Size.Y + m_TextureArrowDownNormal.Size.Y); } else { throw new Exception("Not all needed images were loaded for the spin button. Is the SpinButton section in " + m_LoadedConfigFile + " complete?"); } // Check if optional textures were loaded if ((m_TextureArrowUpHover.texture != null) && (m_TextureArrowDownHover.texture != null)) { m_WidgetPhase |= (byte)WidgetPhase.Hover; } }
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Loads the widget /// </summary> /// /// <param name="configFileFilename">Filename of the config file. /// The config file must contain a ComboBox section with the needed information.</param> /// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public ComboBox(string configFileFilename) { m_DraggableWidget = true; m_ListBox.Visible = false; m_ListBox.Size = new Vector2f(50, 24); m_ListBox.ItemHeight = 24; m_ListBox.ItemSelectedCallback += NewItemSelectedCallbackFunction; m_ListBox.UnfocusedCallback += ListBoxUnfocusedCallbackFunction; m_LoadedConfigFile = Global.ResourcePath + configFileFilename; // Parse the config file ConfigFile configFile = new ConfigFile (m_LoadedConfigFile, "ComboBox"); // Find the folder that contains the config file string configFileFolder = configFileFilename.Substring(0, configFileFilename.LastIndexOfAny(new char[] {'/', '\\'}) + 1); // Loop over all properties for (int i = 0; i < configFile.Properties.Count; ++i) { if (configFile.Properties[i] == "separatehoverimage") m_SeparateHoverImage = configFile.ReadBool(i); else if (configFile.Properties[i] == "backgroundcolor") BackgroundColor = configFile.ReadColor(i); else if (configFile.Properties[i] == "textcolor") TextColor = configFile.ReadColor(i); else if (configFile.Properties[i] == "selectedbackgroundcolor") SelectedBackgroundColor = configFile.ReadColor(i); else if (configFile.Properties[i] == "selectedtextcolor") SelectedTextColor = configFile.ReadColor(i); else if (configFile.Properties[i] == "bordercolor") BorderColor = configFile.ReadColor(i); else if (configFile.Properties[i] == "arrowupnormalimage") configFile.ReadTexture(i, configFileFolder, m_TextureArrowUpNormal); else if (configFile.Properties[i] == "arrowuphoverimage") configFile.ReadTexture(i, configFileFolder, m_TextureArrowUpHover); else if (configFile.Properties[i] == "arrowdownnormalimage") configFile.ReadTexture(i, configFileFolder, m_TextureArrowDownNormal); else if (configFile.Properties[i] == "arrowdownhoverimage") configFile.ReadTexture(i, configFileFolder, m_TextureArrowDownHover); else if (configFile.Properties[i] == "borders") { Borders borders; if (Internal.ExtractBorders(configFile.Values [i], out borders)) Borders = borders; } else if (configFile.Properties[i] == "scrollbar") { if ((configFile.Values[i].Length < 3) || (configFile.Values[i][0] != '"') || (configFile.Values[i][configFile.Values[i].Length-1] != '"')) throw new Exception("Failed to parse value for Scrollbar in section ChatBox in " + m_LoadedConfigFile + "."); // load the scrollbar m_ListBox.SetScrollbar (configFileFolder + (configFile.Values[i]).Substring(1, configFile.Values[i].Length - 2)); } else Internal.Output("TGUI warning: Unrecognized property '" + configFile.Properties[i] + "' in section ComboBox in " + m_LoadedConfigFile + "."); } // Make sure the required textures were loaded if ((m_TextureArrowUpNormal.texture == null) || (m_TextureArrowDownNormal.texture == null)) throw new Exception("Not all needed images were loaded for the combo box. Is the ComboBox section in " + m_LoadedConfigFile + " complete?"); // Check if optional textures were loaded if ((m_TextureArrowUpHover.texture != null) && (m_TextureArrowDownHover.texture != null)) { m_WidgetPhase |= (byte)WidgetPhase.Hover; } }
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Loads the widget /// </summary> /// /// <param name="configFileFilename">Filename of the config file. /// The config file must contain a EditBox section with the needed information.</param> /// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public EditBox(string configFileFilename) { m_AnimatedWidget = true; m_DraggableWidget = true; m_AllowFocus = true; m_LoadedConfigFile = Global.ResourcePath + configFileFilename; // Parse the config file ConfigFile configFile = new ConfigFile (m_LoadedConfigFile, "EditBox"); // Find the folder that contains the config file string configFileFolder = m_LoadedConfigFile.Substring(0, m_LoadedConfigFile.LastIndexOfAny(new char[] {'/', '\\'}) + 1); // Loop over all properties for (int i = 0; i < configFile.Properties.Count; ++i) { if (configFile.Properties[i] == "separatehoverimage") m_SeparateHoverImage = configFile.ReadBool(i); else if (configFile.Properties[i] == "textcolor") { Color color = configFile.ReadColor(i); m_TextBeforeSelection.Color = color; m_TextAfterSelection.Color = color; } else if (configFile.Properties[i] == "selectedtextcolor") m_TextSelection.Color = configFile.ReadColor(i); else if (configFile.Properties[i] == "selectedtextbackgroundcolor") m_SelectedTextBackground.FillColor = configFile.ReadColor(i); else if (configFile.Properties[i] == "selectionpointcolor") m_SelectionPoint.FillColor = configFile.ReadColor(i); else if (configFile.Properties[i] == "selectionpointwidth") SelectionPointWidth = Convert.ToUInt32(configFile.Values [i]); else if (configFile.Properties[i] == "borders") { Borders borders; if (Internal.ExtractBorders(configFile.Values [i], out borders)) Borders = borders; } else if (configFile.Properties[i] == "normalimage") { configFile.ReadTexture (i, configFileFolder, m_TextureNormal_M); m_SplitImage = false; } else if (configFile.Properties[i] == "hoverimage") configFile.ReadTexture(i, configFileFolder, m_TextureHover_M); else if (configFile.Properties[i] == "focusedimage") configFile.ReadTexture (i, configFileFolder, m_TextureFocused_M); else if (configFile.Properties[i] == "normalimage_l") configFile.ReadTexture (i, configFileFolder, m_TextureNormal_L); else if (configFile.Properties[i] == "normalimage_m") { configFile.ReadTexture(i, configFileFolder, m_TextureNormal_M); m_SplitImage = true; } else if (configFile.Properties[i] == "normalimage_r") configFile.ReadTexture(i, configFileFolder, m_TextureNormal_R); else if (configFile.Properties[i] == "hoverimage_l") configFile.ReadTexture(i, configFileFolder, m_TextureHover_L); else if (configFile.Properties[i] == "hoverimage_m") configFile.ReadTexture (i, configFileFolder, m_TextureHover_M); else if (configFile.Properties[i] == "hoverimage_r") configFile.ReadTexture (i, configFileFolder, m_TextureHover_R); else if (configFile.Properties[i] == "focusedimage_l") configFile.ReadTexture (i, configFileFolder, m_TextureFocused_L); else if (configFile.Properties[i] == "focusedimage_m") configFile.ReadTexture(i, configFileFolder, m_TextureFocused_M); else if (configFile.Properties[i] == "focusedimage_r") configFile.ReadTexture(i, configFileFolder, m_TextureFocused_R); else Internal.Output("TGUI warning: Unrecognized property '" + configFile.Properties[i] + "' in section EditBox in " + m_LoadedConfigFile + "."); } // Check if the image is split if (m_SplitImage) { // Make sure the required textures were loaded if ((m_TextureNormal_L.texture != null) && (m_TextureNormal_M.texture != null) && (m_TextureNormal_R.texture != null)) { Size = new Vector2f(m_TextureNormal_L.Size.X + m_TextureNormal_M.Size.X + m_TextureNormal_R.Size.X, m_TextureNormal_M.Size.Y); m_TextureNormal_M.texture.texture.Repeated = true; } else { throw new Exception("Not all needed images were loaded for the edit box. Is the EditBox section in " + m_LoadedConfigFile + " complete?"); } // Check if optional textures were loaded if ((m_TextureFocused_L.texture != null) && (m_TextureFocused_M.texture != null) && (m_TextureFocused_R.texture != null)) { m_WidgetPhase |= (byte)WidgetPhase.Focused; m_TextureFocused_M.texture.texture.Repeated = true; } if ((m_TextureHover_L.texture != null) && (m_TextureHover_M.texture != null) && (m_TextureHover_R.texture != null)) { m_WidgetPhase |= (byte)WidgetPhase.Hover; m_TextureHover_M.texture.texture.Repeated = true; } } else // The image isn't split { // Make sure the required texture was loaded if (m_TextureNormal_M.texture != null) { Size = new Vector2f(m_TextureNormal_M.Size.X, m_TextureNormal_M.Size.Y); } else throw new Exception("NormalImage property wasn't loaded. Is the EditBox section in " + m_LoadedConfigFile + " complete?"); // Check if optional textures were loaded if (m_TextureFocused_M.texture != null) { m_WidgetPhase |= (byte)WidgetPhase.Focused; } if (m_TextureHover_M.texture != null) { m_WidgetPhase |= (byte)WidgetPhase.Hover; } } // Auto-size the text TextSize = 0; }
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Loads the child window /// </summary> /// /// <param name="configFileFilename">Filename of the config file. /// The config file must contain a ChildWindow section with the needed information.</param> /// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// protected void InternalLoad(string configFileFilename) { m_LoadedConfigFile = Global.ResourcePath + configFileFilename; // Parse the config file ConfigFile configFile = new ConfigFile (m_LoadedConfigFile, "ChildWindow"); // Find the folder that contains the config file string configFileFolder = m_LoadedConfigFile.Substring(0, m_LoadedConfigFile.LastIndexOfAny(new char[] {'/', '\\'}) + 1); // Loop over all properties for (int i = 0; i < configFile.Properties.Count; ++i) { if (configFile.Properties[i] == "backgroundcolor") m_BackgroundColor = configFile.ReadColor(i); else if (configFile.Properties[i] == "titlecolor") m_TitleText.Color = configFile.ReadColor(i); else if (configFile.Properties[i] == "bordercolor") m_BorderColor = configFile.ReadColor(i); else if (configFile.Properties[i] == "titlebarimage") { configFile.ReadTexture (i, configFileFolder, m_TextureTitleBar_M); m_SplitImage = false; } else if (configFile.Properties[i] == "titlebarimage_l") configFile.ReadTexture (i, configFileFolder, m_TextureTitleBar_L); else if (configFile.Properties[i] == "titlebarimage_m") { configFile.ReadTexture (i, configFileFolder, m_TextureTitleBar_M); m_SplitImage = true; } else if (configFile.Properties[i] == "titlebarimage_r") configFile.ReadTexture (i, configFileFolder, m_TextureTitleBar_R); else if (configFile.Properties[i] == "closebuttonseparatehoverimage") m_CloseButton.m_SeparateHoverImage = configFile.ReadBool(i); else if (configFile.Properties[i] == "closebuttonnormalimage") configFile.ReadTexture(i, configFileFolder, m_CloseButton.m_TextureNormal_M); else if (configFile.Properties[i] == "closebuttonhoverimage") configFile.ReadTexture(i, configFileFolder, m_CloseButton.m_TextureHover_M); else if (configFile.Properties[i] == "closebuttondownimage") configFile.ReadTexture (i, configFileFolder, m_CloseButton.m_TextureDown_M); else if (configFile.Properties[i] == "borders") { Borders borders; if (Internal.ExtractBorders (configFile.Values [i], out borders)) Borders = borders; } else if (configFile.Properties[i] == "distancetoside") DistanceToSide = Convert.ToUInt32(configFile.Values [i]); else Internal.Output("TGUI warning: Unrecognized property '" + configFile.Properties[i] + "' in section ChildWindow in " + m_LoadedConfigFile + "."); } // Initialize the close button if it was loaded if (m_CloseButton.m_TextureNormal_M.texture != null) { // Check if optional textures were loaded if (m_CloseButton.m_TextureHover_M.texture != null) { m_CloseButton.m_WidgetPhase |= (byte)WidgetPhase.Hover; } if (m_CloseButton.m_TextureDown_M.texture != null) { m_CloseButton.m_WidgetPhase |= (byte)WidgetPhase.MouseDown; } m_CloseButton.m_Size = new Vector2f(m_CloseButton.m_TextureNormal_M.Size.X, m_CloseButton.m_TextureNormal_M.Size.Y); } else // Close button wan't loaded throw new Exception("Missing a CloseButtonNormalImage property in section ChildWindow in " + m_LoadedConfigFile + "."); // Check if the image is split if (m_SplitImage) { // Make sure the required textures was loaded if ((m_TextureTitleBar_L.texture != null) && (m_TextureTitleBar_M.texture != null) && (m_TextureTitleBar_R.texture != null)) { m_TitleBarHeight = m_TextureTitleBar_M.Size.Y; float width = m_TextureTitleBar_L.Size.X + m_TextureTitleBar_M.Size.X + m_TextureTitleBar_R.Size.X; Size = new Vector2f(width, width * 3.0f / 4.0f); m_TextureTitleBar_M.texture.texture.Repeated = true; } else throw new Exception("TGUI error: Not all needed images were loaded for the child window. Is the ChildWindow section in " + m_LoadedConfigFile + " complete?"); } else // The image isn't split { // Make sure the required texture was loaded if ((m_TextureTitleBar_M.texture != null)) { m_TitleBarHeight = m_TextureTitleBar_M.Size.Y; Size = new Vector2f(m_TextureTitleBar_M.Size.X, m_TextureTitleBar_M.Size.X * 3.0f / 4.0f); } else throw new Exception("Not all needed images were loaded for the child window. Is the ChildWindow section in " + m_LoadedConfigFile + " complete?"); // Set the size of the title text m_TitleText.CharacterSize = (uint)(m_TitleBarHeight * 8.0 / 10.0); } }
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Loads the widget /// </summary> /// /// <param name="configFileFilename">Filename of the config file. /// The config file must contain a Slider2d section with the needed information.</param> /// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public Slider2d(string configFileFilename) { m_DraggableWidget = true; m_LoadedConfigFile = Global.ResourcePath + configFileFilename; // Parse the config file ConfigFile configFile = new ConfigFile (m_LoadedConfigFile, "Slider2d"); // Find the folder that contains the config file string configFileFolder = m_LoadedConfigFile.Substring(0, m_LoadedConfigFile.LastIndexOfAny(new char[] {'/', '\\'}) + 1); // Loop over all properties for (int i = 0; i < configFile.Properties.Count; ++i) { if (configFile.Properties[i] == "separatehoverimage") m_SeparateHoverImage = configFile.ReadBool(i); else if (configFile.Properties[i] == "tracknormalimage") configFile.ReadTexture (i, configFileFolder, m_TextureTrackNormal); else if (configFile.Properties[i] == "trackhoverimage") configFile.ReadTexture(i, configFileFolder, m_TextureTrackHover); else if (configFile.Properties[i] == "thumbnormalimage") configFile.ReadTexture(i, configFileFolder, m_TextureThumbNormal); else if (configFile.Properties[i] == "thumbhoverimage") configFile.ReadTexture(i, configFileFolder, m_TextureThumbHover); else Internal.Output("TGUI warning: Unrecognized property '" + configFile.Properties[i] + "' in section Slider2d in " + m_LoadedConfigFile + "."); } // Make sure the required textures were loaded if ((m_TextureTrackNormal.texture != null) && (m_TextureThumbNormal.texture != null)) { // Set the size of the slider m_Size = new Vector2f(m_TextureTrackNormal.Size.X, m_TextureTrackNormal.Size.Y); } else { throw new Exception("Not all needed images were loaded for the slider. Is the Slider2d section in " + m_LoadedConfigFile + " complete?"); } // Check if optional textures were loaded if ((m_TextureTrackHover.texture != null) && (m_TextureThumbHover.texture != null)) { m_WidgetPhase |= (byte)WidgetPhase.Hover; } }
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Loads the widget /// </summary> /// /// <param name="configFileFilename">Filename of the config file. /// The config file must contain a Scrollbar section with the needed information.</param> /// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public Scrollbar(string configFileFilename) { m_DraggableWidget = true; m_LoadedConfigFile = Global.ResourcePath + configFileFilename; // Parse the config file ConfigFile configFile = new ConfigFile (m_LoadedConfigFile, "Scrollbar"); // Find the folder that contains the config file string configFileFolder = m_LoadedConfigFile.Substring(0, m_LoadedConfigFile.LastIndexOfAny(new char[] {'/', '\\'}) + 1); // Loop over all properties for (int i = 0; i < configFile.Properties.Count; ++i) { if (configFile.Properties[i] == "separatehoverimage") m_SeparateHoverImage = configFile.ReadBool(i); else if (configFile.Properties[i] == "verticalscroll") { m_VerticalScroll = configFile.ReadBool(i); m_VerticalImage = m_VerticalScroll; } else if (configFile.Properties[i] == "tracknormalimage") { configFile.ReadTexture (i, configFileFolder, m_TextureTrackNormal_M); m_SplitImage = false; } else if (configFile.Properties[i] == "trackhoverimage") configFile.ReadTexture(i, configFileFolder, m_TextureTrackHover_M); else if (configFile.Properties[i] == "thumbnormalimage") configFile.ReadTexture(i, configFileFolder, m_TextureThumbNormal); else if (configFile.Properties[i] == "thumbhoverimage") configFile.ReadTexture(i, configFileFolder, m_TextureThumbHover); else if (configFile.Properties[i] == "arrowupnormalimage") configFile.ReadTexture(i, configFileFolder, m_TextureArrowUpNormal); else if (configFile.Properties[i] == "arrowuphoverimage") configFile.ReadTexture(i, configFileFolder, m_TextureArrowUpHover); else if (configFile.Properties[i] == "arrowdownnormalimage") configFile.ReadTexture(i, configFileFolder, m_TextureArrowDownNormal); else if (configFile.Properties[i] == "arrowdownhoverimage") configFile.ReadTexture(i, configFileFolder, m_TextureArrowDownHover); else if (configFile.Properties[i] == "tracknormalimage_l") configFile.ReadTexture (i, configFileFolder, m_TextureTrackNormal_L); else if (configFile.Properties[i] == "tracknormalimage_m") { configFile.ReadTexture(i, configFileFolder, m_TextureTrackNormal_M); m_SplitImage = true; } else if (configFile.Properties[i] == "tracknormalimage_r") configFile.ReadTexture(i, configFileFolder, m_TextureTrackNormal_R); else if (configFile.Properties[i] == "trackhoverimage_l") configFile.ReadTexture(i, configFileFolder, m_TextureTrackHover_L); else if (configFile.Properties[i] == "trackhoverimage_m") configFile.ReadTexture (i, configFileFolder, m_TextureTrackHover_M); else if (configFile.Properties[i] == "trackhoverimage_r") configFile.ReadTexture (i, configFileFolder, m_TextureTrackHover_R); else Internal.Output("TGUI warning: Unrecognized property '" + configFile.Properties[i] + "' in section Scrollbar in " + m_LoadedConfigFile + "."); } // Check if the image is split if (m_SplitImage) { throw new Exception("SplitImage is not yet supported yet in Scrollbar."); /* // Make sure the required textures were loaded if ((m_TextureTrackNormal_L.texture != null) && (m_TextureTrackNormal_M.texture != null) && (m_TextureTrackNormal_R.texture != null) && (m_TextureThumbNormal.texture != null) && (m_TextureArrowUpNormal.texture != null) && (m_TextureArrowDownNormal.texture != null)) { // Set the size of the scrollbar if (m_VerticalImage) Size = new Vector2f((m_TextureTrackNormal_M.Size.X), (float)(m_TextureTrackNormal_L.Size.Y + m_TextureTrackNormal_M.Size.Y + m_TextureTrackNormal_R.Size.Y)); else Size = new Vector2f((m_TextureTrackNormal_L.Size.X + m_TextureTrackNormal_M.Size.X + m_TextureTrackNormal_R.Size.X), (float)(m_TextureTrackNormal_M.Size.Y)); // Set the thumb size m_ThumbSize = new Vector2f(m_TextureThumbNormal.Size.X, m_TextureThumbNormal.Size.Y); } else throw new Exception("Not all needed images were loaded for the scrollbar. Is the Scrollbar section in " + m_LoadedConfigFile + " complete?"); // Check if optional textures were loaded if ((m_TextureTrackHover_L.texture != null) && (m_TextureTrackHover_M.texture != null) && (m_TextureTrackHover_R.texture != null) && (m_TextureThumbHover.texture != null) && (m_TextureArrowUpHover.texture != null) && (m_TextureArrowDownHover.texture != null)) { m_WidgetPhase |= (byte)WidgetPhase.Hover; } */ } else // The image isn't split { // Make sure the required textures were loaded if ((m_TextureTrackNormal_M.texture != null) && (m_TextureThumbNormal.texture != null) && (m_TextureArrowUpNormal.texture != null) && (m_TextureArrowDownNormal.texture != null)) { // Set the size of the scrollbar Size = new Vector2f(m_TextureTrackNormal_M.Size.X, m_TextureTrackNormal_M.Size.Y); } else throw new Exception("TGUI error: Not all needed images were loaded for the scrollbar. Is the Scrollbar section in " + m_LoadedConfigFile + " complete?"); // Check if optional textures were loaded if ((m_TextureTrackHover_M.texture != null) && (m_TextureThumbHover.texture != null) && (m_TextureArrowUpHover.texture != null) && (m_TextureArrowDownHover.texture != null)) { m_WidgetPhase |= (byte)WidgetPhase.Hover; } } }
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Loads the widget /// </summary> /// /// <param name="configFileFilename">Filename of the config file. /// The config file must contain a ComboBox section with the needed information.</param> /// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public ComboBox(string configFileFilename) { m_DraggableWidget = true; m_ListBox.Visible = false; m_ListBox.Size = new Vector2f(50, 24); m_ListBox.ItemHeight = 24; m_ListBox.ItemSelectedCallback += NewItemSelectedCallbackFunction; m_ListBox.UnfocusedCallback += ListBoxUnfocusedCallbackFunction; m_LoadedConfigFile = Global.ResourcePath + configFileFilename; // Parse the config file ConfigFile configFile = new ConfigFile(m_LoadedConfigFile, "ComboBox"); // Find the folder that contains the config file string configFileFolder = configFileFilename.Substring(0, configFileFilename.LastIndexOfAny(new char[] { '/', '\\' }) + 1); // Loop over all properties for (int i = 0; i < configFile.Properties.Count; ++i) { if (configFile.Properties[i] == "separatehoverimage") { m_SeparateHoverImage = configFile.ReadBool(i); } else if (configFile.Properties[i] == "backgroundcolor") { BackgroundColor = configFile.ReadColor(i); } else if (configFile.Properties[i] == "textcolor") { TextColor = configFile.ReadColor(i); } else if (configFile.Properties[i] == "selectedbackgroundcolor") { SelectedBackgroundColor = configFile.ReadColor(i); } else if (configFile.Properties[i] == "selectedtextcolor") { SelectedTextColor = configFile.ReadColor(i); } else if (configFile.Properties[i] == "bordercolor") { BorderColor = configFile.ReadColor(i); } else if (configFile.Properties[i] == "arrowupnormalimage") { configFile.ReadTexture(i, configFileFolder, m_TextureArrowUpNormal); } else if (configFile.Properties[i] == "arrowuphoverimage") { configFile.ReadTexture(i, configFileFolder, m_TextureArrowUpHover); } else if (configFile.Properties[i] == "arrowdownnormalimage") { configFile.ReadTexture(i, configFileFolder, m_TextureArrowDownNormal); } else if (configFile.Properties[i] == "arrowdownhoverimage") { configFile.ReadTexture(i, configFileFolder, m_TextureArrowDownHover); } else if (configFile.Properties[i] == "borders") { Borders borders; if (Internal.ExtractBorders(configFile.Values [i], out borders)) { Borders = borders; } } else if (configFile.Properties[i] == "scrollbar") { if ((configFile.Values[i].Length < 3) || (configFile.Values[i][0] != '"') || (configFile.Values[i][configFile.Values[i].Length - 1] != '"')) { throw new Exception("Failed to parse value for Scrollbar in section ChatBox in " + m_LoadedConfigFile + "."); } // load the scrollbar m_ListBox.SetScrollbar(configFileFolder + (configFile.Values[i]).Substring(1, configFile.Values[i].Length - 2)); } else { Internal.Output("TGUI warning: Unrecognized property '" + configFile.Properties[i] + "' in section ComboBox in " + m_LoadedConfigFile + "."); } } // Make sure the required textures were loaded if ((m_TextureArrowUpNormal.texture == null) || (m_TextureArrowDownNormal.texture == null)) { throw new Exception("Not all needed images were loaded for the combo box. Is the ComboBox section in " + m_LoadedConfigFile + " complete?"); } // Check if optional textures were loaded if ((m_TextureArrowUpHover.texture != null) && (m_TextureArrowDownHover.texture != null)) { m_WidgetPhase |= (byte)WidgetPhase.Hover; } }
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Loads the widget /// </summary> /// /// <param name="configFileFilename">Filename of the config file. /// The config file must contain a Tab section with the needed information.</param> /// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public Tab(string configFileFilename) { m_LoadedConfigFile = Global.ResourcePath + configFileFilename; // Parse the config file ConfigFile configFile = new ConfigFile (m_LoadedConfigFile, "Tab"); // Find the folder that contains the config file string configFileFolder = m_LoadedConfigFile.Substring(0, m_LoadedConfigFile.LastIndexOfAny(new char[] {'/', '\\'}) + 1); // Loop over all properties for (int i = 0; i < configFile.Properties.Count; ++i) { if (configFile.Properties[i] == "separateselectedimage") m_SeparateSelectedImage = configFile.ReadBool(i); else if (configFile.Properties[i] == "textcolor") m_TextColor = configFile.ReadColor(i); else if (configFile.Properties[i] == "selectedtextcolor") m_SelectedTextColor = configFile.ReadColor(i); else if (configFile.Properties[i] == "distancetoside") DistanceToSide = Convert.ToUInt32(configFile.Values [i]); else if (configFile.Properties[i] == "normalimage") { configFile.ReadTexture (i, configFileFolder, m_TextureNormal_M); m_SplitImage = false; } else if (configFile.Properties[i] == "selectedimage") configFile.ReadTexture (i, configFileFolder, m_TextureSelected_M); else if (configFile.Properties[i] == "normalimage_l") configFile.ReadTexture (i, configFileFolder, m_TextureNormal_L); else if (configFile.Properties[i] == "normalimage_m") { configFile.ReadTexture(i, configFileFolder, m_TextureNormal_M); m_SplitImage = true; } else if (configFile.Properties[i] == "normalimage_r") configFile.ReadTexture(i, configFileFolder, m_TextureNormal_R); else if (configFile.Properties[i] == "selectedimage_l") configFile.ReadTexture (i, configFileFolder, m_TextureSelected_L); else if (configFile.Properties[i] == "selectedimage_m") configFile.ReadTexture(i, configFileFolder, m_TextureSelected_M); else if (configFile.Properties[i] == "selectedimage_r") configFile.ReadTexture(i, configFileFolder, m_TextureSelected_R); else Internal.Output("TGUI warning: Unrecognized property '" + configFile.Properties[i] + "' in section Tab in " + m_LoadedConfigFile + "."); } // Check if the image is split if (m_SplitImage) { // Make sure the required textures were loaded if ((m_TextureNormal_L.texture != null) && (m_TextureNormal_M.texture != null) && (m_TextureNormal_R.texture != null)) { m_TabHeight = (uint)m_TextureNormal_M.Size.Y; m_TextureNormal_M.texture.texture.Repeated = true; } else throw new Exception("Not all needed images were loaded for the tab. Is the Tab section in " + m_LoadedConfigFile + " complete?"); // Check if optional textures were loaded if ((m_TextureSelected_L.texture != null) && (m_TextureSelected_M.texture != null) && (m_TextureSelected_R.texture != null)) { m_WidgetPhase |= (byte)WidgetPhase.Selected; m_TextureSelected_M.texture.texture.Repeated = true; } } else // The image isn't split { // Make sure the required texture was loaded if (m_TextureNormal_M.texture != null) { m_TabHeight = (uint)m_TextureNormal_M.Size.Y; } else throw new Exception("NormalImage wasn't loaded. Is the Tab section in " + m_LoadedConfigFile + " complete?"); // Check if optional textures were loaded if (m_TextureSelected_M.texture != null) { m_WidgetPhase |= (byte)WidgetPhase.Selected; } } // Recalculate the text size when auto sizing if (m_TextSize == 0) TextSize = 0; }
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Loads the widget /// </summary> /// /// <param name="configFileFilename">Filename of the config file. /// The config file must contain a Tab section with the needed information.</param> /// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public Tab(string configFileFilename) { m_LoadedConfigFile = Global.ResourcePath + configFileFilename; // Parse the config file ConfigFile configFile = new ConfigFile(m_LoadedConfigFile, "Tab"); // Find the folder that contains the config file string configFileFolder = m_LoadedConfigFile.Substring(0, m_LoadedConfigFile.LastIndexOfAny(new char[] { '/', '\\' }) + 1); // Loop over all properties for (int i = 0; i < configFile.Properties.Count; ++i) { if (configFile.Properties[i] == "separateselectedimage") { m_SeparateSelectedImage = configFile.ReadBool(i); } else if (configFile.Properties[i] == "textcolor") { m_TextColor = configFile.ReadColor(i); } else if (configFile.Properties[i] == "selectedtextcolor") { m_SelectedTextColor = configFile.ReadColor(i); } else if (configFile.Properties[i] == "distancetoside") { DistanceToSide = Convert.ToUInt32(configFile.Values [i]); } else if (configFile.Properties[i] == "normalimage") { configFile.ReadTexture(i, configFileFolder, m_TextureNormal_M); m_SplitImage = false; } else if (configFile.Properties[i] == "selectedimage") { configFile.ReadTexture(i, configFileFolder, m_TextureSelected_M); } else if (configFile.Properties[i] == "normalimage_l") { configFile.ReadTexture(i, configFileFolder, m_TextureNormal_L); } else if (configFile.Properties[i] == "normalimage_m") { configFile.ReadTexture(i, configFileFolder, m_TextureNormal_M); m_SplitImage = true; } else if (configFile.Properties[i] == "normalimage_r") { configFile.ReadTexture(i, configFileFolder, m_TextureNormal_R); } else if (configFile.Properties[i] == "selectedimage_l") { configFile.ReadTexture(i, configFileFolder, m_TextureSelected_L); } else if (configFile.Properties[i] == "selectedimage_m") { configFile.ReadTexture(i, configFileFolder, m_TextureSelected_M); } else if (configFile.Properties[i] == "selectedimage_r") { configFile.ReadTexture(i, configFileFolder, m_TextureSelected_R); } else { Internal.Output("TGUI warning: Unrecognized property '" + configFile.Properties[i] + "' in section Tab in " + m_LoadedConfigFile + "."); } } // Check if the image is split if (m_SplitImage) { // Make sure the required textures were loaded if ((m_TextureNormal_L.texture != null) && (m_TextureNormal_M.texture != null) && (m_TextureNormal_R.texture != null)) { m_TabHeight = (uint)m_TextureNormal_M.Size.Y; m_TextureNormal_M.texture.texture.Repeated = true; } else { throw new Exception("Not all needed images were loaded for the tab. Is the Tab section in " + m_LoadedConfigFile + " complete?"); } // Check if optional textures were loaded if ((m_TextureSelected_L.texture != null) && (m_TextureSelected_M.texture != null) && (m_TextureSelected_R.texture != null)) { m_WidgetPhase |= (byte)WidgetPhase.Selected; m_TextureSelected_M.texture.texture.Repeated = true; } } else // The image isn't split { // Make sure the required texture was loaded if (m_TextureNormal_M.texture != null) { m_TabHeight = (uint)m_TextureNormal_M.Size.Y; } else { throw new Exception("NormalImage wasn't loaded. Is the Tab section in " + m_LoadedConfigFile + " complete?"); } // Check if optional textures were loaded if (m_TextureSelected_M.texture != null) { m_WidgetPhase |= (byte)WidgetPhase.Selected; } } // Recalculate the text size when auto sizing if (m_TextSize == 0) { TextSize = 0; } }
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Loads the widget /// </summary> /// /// <param name="configFileFilename">Filename of the config file. /// The config file must contain a Button section with the needed information.</param> /// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public Button(string configFileFilename) { m_LoadedConfigFile = Global.ResourcePath + configFileFilename; // Parse the config file ConfigFile configFile = new ConfigFile(m_LoadedConfigFile, "Button"); // Find the folder that contains the config file string configFileFolder = m_LoadedConfigFile.Substring(0, m_LoadedConfigFile.LastIndexOfAny(new char[] { '/', '\\' }) + 1); // Loop over all properties for (int i = 0; i < configFile.Properties.Count; ++i) { if (configFile.Properties[i] == "separatehoverimage") { m_SeparateHoverImage = configFile.ReadBool(i); } else if (configFile.Properties[i] == "textcolor") { m_Text.Color = configFile.ReadColor(i); } else if (configFile.Properties[i] == "normalimage") { configFile.ReadTexture(i, configFileFolder, m_TextureNormal_M); m_SplitImage = false; } else if (configFile.Properties[i] == "hoverimage") { configFile.ReadTexture(i, configFileFolder, m_TextureHover_M); } else if (configFile.Properties[i] == "downimage") { configFile.ReadTexture(i, configFileFolder, m_TextureDown_M); } else if (configFile.Properties[i] == "focusedimage") { configFile.ReadTexture(i, configFileFolder, m_TextureFocused_M); } else if (configFile.Properties[i] == "normalimage_l") { configFile.ReadTexture(i, configFileFolder, m_TextureNormal_L); } else if (configFile.Properties[i] == "normalimage_m") { configFile.ReadTexture(i, configFileFolder, m_TextureNormal_M); m_SplitImage = true; } else if (configFile.Properties[i] == "normalimage_r") { configFile.ReadTexture(i, configFileFolder, m_TextureNormal_R); } else if (configFile.Properties[i] == "hoverimage_l") { configFile.ReadTexture(i, configFileFolder, m_TextureHover_L); } else if (configFile.Properties[i] == "hoverimage_m") { configFile.ReadTexture(i, configFileFolder, m_TextureHover_M); } else if (configFile.Properties[i] == "hoverimage_r") { configFile.ReadTexture(i, configFileFolder, m_TextureHover_R); } else if (configFile.Properties[i] == "downimage_l") { configFile.ReadTexture(i, configFileFolder, m_TextureDown_L); } else if (configFile.Properties[i] == "downimage_m") { configFile.ReadTexture(i, configFileFolder, m_TextureDown_M); } else if (configFile.Properties[i] == "downimage_r") { configFile.ReadTexture(i, configFileFolder, m_TextureDown_R); } else if (configFile.Properties[i] == "focusedimage_l") { configFile.ReadTexture(i, configFileFolder, m_TextureFocused_L); } else if (configFile.Properties[i] == "focusedimage_m") { configFile.ReadTexture(i, configFileFolder, m_TextureFocused_M); } else if (configFile.Properties[i] == "focusedimage_r") { configFile.ReadTexture(i, configFileFolder, m_TextureFocused_R); } else { Internal.Output("TGUI warning: Unrecognized property '" + configFile.Properties[i] + "' in section Button in " + m_LoadedConfigFile + "."); } } // Check if the image is split if (m_SplitImage) { // Make sure the required textures were loaded if ((m_TextureNormal_L.texture != null) && (m_TextureNormal_M.texture != null) && (m_TextureNormal_R.texture != null)) { Size = new Vector2f(m_TextureNormal_L.Size.X + m_TextureNormal_M.Size.X + m_TextureNormal_R.Size.X, m_TextureNormal_M.Size.Y); m_TextureNormal_M.texture.texture.Repeated = true; } else { throw new Exception("Not all needed images were loaded for the button. Is the Button section in " + m_LoadedConfigFile + " complete?"); } // Check if optional textures were loaded if ((m_TextureFocused_L.texture != null) && (m_TextureFocused_M.texture != null) && (m_TextureFocused_R.texture != null)) { m_AllowFocus = true; m_WidgetPhase |= (byte)WidgetPhase.Focused; m_TextureFocused_M.texture.texture.Repeated = true; } if ((m_TextureHover_L.texture != null) && (m_TextureHover_M.texture != null) && (m_TextureHover_R.texture != null)) { m_WidgetPhase |= (byte)WidgetPhase.Hover; m_TextureHover_M.texture.texture.Repeated = true; } if ((m_TextureDown_L.texture != null) && (m_TextureDown_M.texture != null) && (m_TextureDown_R.texture != null)) { m_WidgetPhase |= (byte)WidgetPhase.MouseDown; m_TextureDown_M.texture.texture.Repeated = true; } } else // The image isn't split { // Make sure the required texture was loaded if (m_TextureNormal_M.texture != null) { Size = new Vector2f(m_TextureNormal_M.Size.X, m_TextureNormal_M.Size.Y); } else { throw new Exception("NormalImage property wasn't loaded. Is the Button section in " + m_LoadedConfigFile + " complete?"); } // Check if optional textures were loaded if (m_TextureFocused_M.texture != null) { m_AllowFocus = true; m_WidgetPhase |= (byte)WidgetPhase.Focused; } if (m_TextureHover_M.texture != null) { m_WidgetPhase |= (byte)WidgetPhase.Hover; } if (m_TextureDown_M.texture != null) { m_WidgetPhase |= (byte)WidgetPhase.MouseDown; } } }
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Loads the widget /// </summary> /// /// <param name="configFileFilename">Filename of the config file. /// The config file must contain a Button section with the needed information.</param> /// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public Button(string configFileFilename) { m_LoadedConfigFile = Global.ResourcePath + configFileFilename; // Parse the config file ConfigFile configFile = new ConfigFile (m_LoadedConfigFile, "Button"); // Find the folder that contains the config file string configFileFolder = m_LoadedConfigFile.Substring(0, m_LoadedConfigFile.LastIndexOfAny(new char[] {'/', '\\'}) + 1); // Loop over all properties for (int i = 0; i < configFile.Properties.Count; ++i) { if (configFile.Properties[i] == "separatehoverimage") m_SeparateHoverImage = configFile.ReadBool(i); else if (configFile.Properties[i] == "textcolor") m_Text.Color = configFile.ReadColor(i); else if (configFile.Properties[i] == "normalimage") { configFile.ReadTexture (i, configFileFolder, m_TextureNormal_M); m_SplitImage = false; } else if (configFile.Properties[i] == "hoverimage") configFile.ReadTexture(i, configFileFolder, m_TextureHover_M); else if (configFile.Properties[i] == "downimage") configFile.ReadTexture (i, configFileFolder, m_TextureDown_M); else if (configFile.Properties[i] == "focusedimage") configFile.ReadTexture (i, configFileFolder, m_TextureFocused_M); else if (configFile.Properties[i] == "normalimage_l") configFile.ReadTexture (i, configFileFolder, m_TextureNormal_L); else if (configFile.Properties[i] == "normalimage_m") { configFile.ReadTexture(i, configFileFolder, m_TextureNormal_M); m_SplitImage = true; } else if (configFile.Properties[i] == "normalimage_r") configFile.ReadTexture(i, configFileFolder, m_TextureNormal_R); else if (configFile.Properties[i] == "hoverimage_l") configFile.ReadTexture(i, configFileFolder, m_TextureHover_L); else if (configFile.Properties[i] == "hoverimage_m") configFile.ReadTexture (i, configFileFolder, m_TextureHover_M); else if (configFile.Properties[i] == "hoverimage_r") configFile.ReadTexture (i, configFileFolder, m_TextureHover_R); else if (configFile.Properties[i] == "downimage_l") configFile.ReadTexture(i, configFileFolder, m_TextureDown_L); else if (configFile.Properties[i] == "downimage_m") configFile.ReadTexture(i, configFileFolder, m_TextureDown_M); else if (configFile.Properties[i] == "downimage_r") configFile.ReadTexture(i, configFileFolder, m_TextureDown_R); else if (configFile.Properties[i] == "focusedimage_l") configFile.ReadTexture (i, configFileFolder, m_TextureFocused_L); else if (configFile.Properties[i] == "focusedimage_m") configFile.ReadTexture(i, configFileFolder, m_TextureFocused_M); else if (configFile.Properties[i] == "focusedimage_r") configFile.ReadTexture(i, configFileFolder, m_TextureFocused_R); else Internal.Output("TGUI warning: Unrecognized property '" + configFile.Properties[i] + "' in section Button in " + m_LoadedConfigFile + "."); } // Check if the image is split if (m_SplitImage) { // Make sure the required textures were loaded if ((m_TextureNormal_L.texture != null) && (m_TextureNormal_M.texture != null) && (m_TextureNormal_R.texture != null)) { Size = new Vector2f(m_TextureNormal_L.Size.X + m_TextureNormal_M.Size.X + m_TextureNormal_R.Size.X, m_TextureNormal_M.Size.Y); m_TextureNormal_M.texture.texture.Repeated = true; } else { throw new Exception("Not all needed images were loaded for the button. Is the Button section in " + m_LoadedConfigFile + " complete?"); } // Check if optional textures were loaded if ((m_TextureFocused_L.texture != null) && (m_TextureFocused_M.texture != null) && (m_TextureFocused_R.texture != null)) { m_AllowFocus = true; m_WidgetPhase |= (byte)WidgetPhase.Focused; m_TextureFocused_M.texture.texture.Repeated = true; } if ((m_TextureHover_L.texture != null) && (m_TextureHover_M.texture != null) && (m_TextureHover_R.texture != null)) { m_WidgetPhase |= (byte)WidgetPhase.Hover; m_TextureHover_M.texture.texture.Repeated = true; } if ((m_TextureDown_L.texture != null) && (m_TextureDown_M.texture != null) && (m_TextureDown_R.texture != null)) { m_WidgetPhase |= (byte)WidgetPhase.MouseDown; m_TextureDown_M.texture.texture.Repeated = true; } } else // The image isn't split { // Make sure the required texture was loaded if (m_TextureNormal_M.texture != null) { Size = new Vector2f(m_TextureNormal_M.Size.X, m_TextureNormal_M.Size.Y); } else throw new Exception("NormalImage property wasn't loaded. Is the Button section in " + m_LoadedConfigFile + " complete?"); // Check if optional textures were loaded if (m_TextureFocused_M.texture != null) { m_AllowFocus = true; m_WidgetPhase |= (byte)WidgetPhase.Focused; } if (m_TextureHover_M.texture != null) { m_WidgetPhase |= (byte)WidgetPhase.Hover; } if (m_TextureDown_M.texture != null) { m_WidgetPhase |= (byte)WidgetPhase.MouseDown; } } }
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Loads the widget /// </summary> /// /// <param name="configFileFilename">Filename of the config file. /// The config file must contain a SpinButton section with the needed information.</param> /// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public SpinButton(string configFileFilename) { m_LoadedConfigFile = Global.ResourcePath + configFileFilename; // Parse the config file ConfigFile configFile = new ConfigFile (m_LoadedConfigFile, "SpinButton"); // Find the folder that contains the config file string configFileFolder = m_LoadedConfigFile.Substring(0, m_LoadedConfigFile.LastIndexOfAny(new char[] {'/', '\\'}) + 1); // Loop over all properties for (int i = 0; i < configFile.Properties.Count; ++i) { if (configFile.Properties[i] == "separatehoverimage") m_SeparateHoverImage = configFile.ReadBool(i); else if (configFile.Properties[i] == "arrowupnormalimage") configFile.ReadTexture(i, configFileFolder, m_TextureArrowUpNormal); else if (configFile.Properties[i] == "arrowuphoverimage") configFile.ReadTexture(i, configFileFolder, m_TextureArrowUpHover); else if (configFile.Properties[i] == "arrowdownnormalimage") configFile.ReadTexture(i, configFileFolder, m_TextureArrowDownNormal); else if (configFile.Properties[i] == "arrowdownhoverimage") configFile.ReadTexture(i, configFileFolder, m_TextureArrowDownHover); else Internal.Output("TGUI warning: Unrecognized property '" + configFile.Properties[i] + "' in section SpinButton in " + m_LoadedConfigFile + "."); } // Make sure the required textures were loaded if ((m_TextureArrowUpNormal.texture != null) && (m_TextureArrowDownNormal.texture != null)) { m_Size = new Vector2f(m_TextureArrowUpNormal.Size.X, m_TextureArrowUpNormal.Size.Y + m_TextureArrowDownNormal.Size.Y); } else { throw new Exception("Not all needed images were loaded for the spin button. Is the SpinButton section in " + m_LoadedConfigFile + " complete?"); } // Check if optional textures were loaded if ((m_TextureArrowUpHover.texture != null) && (m_TextureArrowDownHover.texture != null)) { m_WidgetPhase |= (byte)WidgetPhase.Hover; } }