/* * OpenClonk, http://www.openclonk.org * * Copyright (c) 2005-2009, RedWolf Design GmbH, http://www.clonk.de/ * Copyright (c) 2009-2016, The OpenClonk Team and contributors * * Distributed under the terms of the ISC license; see accompanying file * "COPYING" for details. * * "Clonk" is a registered trademark of Matthes Bender, used with permission. * See accompanying file "TRADEMARK" for details. * * To redistribute this file separately, substitute the full license texts * for the above references. */ // Custom game options and configuration dialog #ifndef INC_C4GameOptions #define INC_C4GameOptions #include "gui/C4Gui.h" // options dialog: created as listbox inside another dialog // used to configure some standard runtime options, as well as custom game options class C4GameOptionsList : public C4GUI::ListBox, private C4ApplicationSec1Timer { public: enum { IconLabelSpacing = 2 }; // space between an icon and its text private: class Option : public C4GUI::Control { protected: typedef C4GUI::Control BaseClass; class C4GameOptionsList *pForDlg; // primary subcomponent: forward focus to this element C4GUI::Control *pPrimarySubcomponent; virtual bool IsFocused(C4GUI::Control *pCtrl) { // also forward own focus to primary control return BaseClass::IsFocused(pCtrl) || (HasFocus() && pPrimarySubcomponent == pCtrl); } public: Option(class C4GameOptionsList *pForDlg); // ctor - adds to list void InitOption(C4GameOptionsList *pForDlg); // add to list and do initial update virtual void Update() {}; // update data Option *GetNext() { return static_cast