Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
scriptconsoletabbase.c
Go to the documentation of this file.
2 {
3  protected int m_Id;
4  protected bool m_IsSelected;
5  protected Widget m_ParentRoot;
6  protected Widget m_Root;
7  protected Widget m_Button;
8  protected ScriptConsole m_ScriptConsole;
9  protected ScriptConsoleTabBase m_Parent;//for subtabs
10  protected PluginConfigDebugProfile m_ConfigDebugProfile;
11  protected PluginConfigDebugProfileFixed m_ConfigDebugProfileFixed;
12 
13  void ScriptConsoleTabBase(Widget root, ScriptConsole console, Widget button, ScriptConsoleTabBase parent = null)
14  {
15  m_Button = button;
16  m_ScriptConsole = console;
17  m_Root = root;
18  if (parent)
19  m_ParentRoot = parent.GetRoot();
20  else
21  m_ParentRoot = console.layoutRoot;
23  m_ConfigDebugProfileFixed = PluginConfigDebugProfileFixed.Cast(GetPlugin(PluginConfigDebugProfileFixed));
24  }
25 
26  void Init(int id)
27  {
28  m_Id = id;
29  }
30 
31  int GetID()
32  {
33  return m_Id;
34  }
35 
36  Widget GetRoot()
37  {
38  return m_Root;
39  }
40 
41  bool IsSelected()
42  {
43  return m_IsSelected;
44  }
45 
46  void Select(bool select, ScriptConsoleTabBase selectedHandler)
47  {
48  m_IsSelected = select;
49  if (m_Root)
50  {
51  Show(select, selectedHandler);
52  ButtonWidget btn = ButtonWidget.Cast(m_Button);
53  if (btn)
54  btn.SetState(select);
55  }
56  if (select)
57  OnSelected();
58  }
59 
60  void OnSelected();
61 
62  void Show(bool show, ScriptConsoleTabBase selectedHandler)
63  {
64  m_Root.Show(show);
65  m_Root.Enable(show);
66  }
67 
68  Widget GetButton()
69  {
70  return m_Button;
71  }
72 
73  void Update(float timeslice);
74 
75  bool OnChange(Widget w, int x, int y, bool finished);
76  bool OnClick(Widget w, int x, int y, int button);
77  bool OnItemSelected(Widget w, int x, int y, int row, int column, int oldRow, int oldColumn);
78  bool OnKeyDown(Widget w, int x, int y, int key);
79  bool OnDoubleClick(Widget w, int x, int y, int button);
80  void OnRPCEx(int rpc_type, ParamsReadContext ctx);
81  bool OnMouseButtonDown(Widget w, int x, int y, int button);
82  bool OnKeyPress(Widget w, int x, int y, int key);
83 
84  protected void AddItemToClipboard(TextListboxWidget text_listbox_widget)
85  {
86  int selected_row_index = text_listbox_widget.GetSelectedRow();
87  if (selected_row_index != -1)
88  {
89  string item_name;
90  text_listbox_widget.GetItemText(selected_row_index, 0, item_name);
91  GetGame().CopyToClipboard(item_name);
92  }
93  }
94 }
GetGame
proto native CGame GetGame()
PluginConfigDebugProfile
Definition: pluginconfigdebugprofilefixed.c:1
y
Icon y
GetPlugin
PluginBase GetPlugin(typename plugin_type)
Definition: pluginmanager.c:316
Serializer
Serialization general interface. Serializer API works with:
Definition: serializer.c:55
m_IsSelected
bool m_IsSelected
Definition: bioslobbyservice.c:63
m_Id
class GetServerModListResult m_Id
GetServersResultRow the output structure of the GetServers operation that represents one game server.
x
Icon x
m_ConfigDebugProfile
PluginConfigDebugProfile m_ConfigDebugProfile
Definition: pluginitemdiagnostic.c:58
Widget
Definition: enwidgets.c:189
ScriptConsoleTabBase
Definition: scriptconsoletabbase.c:1
m_Root
protected Widget m_Root
Definition: sizetochild.c:91