Rise
The Vieneo Province
DialogBase.h
Go to the documentation of this file.
1 #pragma once
2 
3 enum Dialogs
4 {
13 
15 };
16 
17 #include <WinSock2.h>
18 #include <WS2tcpip.h>
19 #include <Windows.h>
20 #include <DXUT.h>
21 #include "../gui.h"
22 
23 class HMI;
24 class Logger;
25 
27 {
28 protected:
29  static void CheckMoved(short t);
30 
31  virtual void TabClick(short clicked_tab);
32 
33 private:
34  static void ClickEditableField(short t, int field);
35 
36 public:
37  //Public vars (Cheap copy paste from SDialog struct
38 
40  static HMI *gui;
41  static Logger* logger;
42 
43  //hard-coded
44  short fields;
46  short fieldwidth[MAX_FIELDS]; // pixel weight
47  short fieldtype[MAX_FIELDS]; // 1 icon, 2 var width text, 3 fixed width text, 4 multilinechat
48  short fieldcontent[MAX_FIELDS]; // icon# or strings#
49  short actions, action[MAX_ACTION]; // action[] is the icon and L_ACTION_MARK+[] mouseover language
50  short tabusedefaultlang[MAX_TAB]; // 0 is a user editable one...
52  D3DXVECTOR3 windowdefaultlocation; //,defaulticonlocation
53  short icon; RECT iconsource;
55  short dockedto;
56  bool usesHUD;
57 
58  // user-configurable
59  D3DXVECTOR3 windowlocation; // upper left corner
60  short width, height; // size
61  // data specific (does not restore)
62  short tabs, activetab;
63  WCHAR tabstr[MAX_TAB][MAX_TAB_CHARS]; // if [0]==0 then it changes to unnamed
64  short sortfield;
65  char sortdirection; // unused and uninitialized if sortfield == -1
66 
67  // temporary or loaded from other files
68  D3DXVECTOR3 windowseeklocation; // upper left corner
69  short text;
70  long layer; // focus level
71  bool enabled, active;
72  short linedsp;
73  int linetot, linecursel, lineact, linetop; // linecursel can be -1 for none
75  short actionsvisible; // unused if actions is 0
76  short actionoffset;
78  float actionslider;
80 
81  char msgbarcolor; // 0 = normal, 1 = green, 2 = amber, 3 = red
83  // CHATCHANNEL msgbarchannel; // for D_COMMUNICATION it is the channel name, owner, number
84  unsigned short clipboardrecord;
86  // unsigned char msgbartype; // 0 is just a message, 1 is a channel invite
87 
88  short tabflash[MAX_TAB];
89  short tabwidth[MAX_TAB], tabx[MAX_TAB];
90  WCHAR tabeffectivestr[MAX_TAB][MAX_TAB_CHARS];
91 
97 
98  CDXUTDialog HUD; // dialog for sample specific controls
99 
100 // static CDXUTDialogResourceManager g_DialogResourceManager; // manager for shared resources of dialogs
101  short dialogid;
102 
103  bool minimized = false;
104 
105  static short draworder[D_ENUMERATION];
106 
107  DialogBase(short id);
108 
109  virtual void Update();
110  virtual void Draw(D3DXVECTOR3* tracked);
111  virtual void UpdateMenu(short tab);
112  virtual void DoubleClickLine() {}
113 
114  static void Initialize(HMI* gui);
115  static void DrawAllActiveDialogs(float fElapsedTime);
116  static void UpdateAllActiveDialogs(float fElapsedTime);
117 
118  static void IconClick(short icon_id);
119  static void CheckDialogMouse();
120  static bool DraggingItem(short t, short s);
121  static void BringToFront(short t);
122  static void SortDialogs();
123  static void OnDeviceReset();
124  //static void AdjustDialogsForResolution(bool vpinit);
125  static bool OnEnter();
126  static void UpdateScrollBar(short t);
127  static short CheckWidth(short dialogid);
128  static short CheckHeight(short t);
129  static void InitializeDialog(short t);
130 
131  virtual void DragDropItem(short s);
132  virtual void ClearEdit();
133  virtual void ActiveTab();
134  virtual void OnCreateDevice();
135 
136  virtual void ActionIconClick(long icon_id);
137  virtual void Close(bool minimize);
138 
139  void PopUpDialog();
140 };
static void CheckMoved(short t)
static void InitializeDialog(short t)
Definition: DialogBase.cpp:82
bool minimized
Definition: DialogBase.h:103
static void ClickEditableField(short t, int field)
Definition: DialogBase.cpp:267
float actionslider
Definition: DialogBase.h:78
virtual void ActionIconClick(long icon_id)
short tabx[MAX_TAB]
Definition: DialogBase.h:89
virtual void UpdateMenu(short tab)
static bool DraggingItem(short t, short s)
short actions
Definition: DialogBase.h:49
long editfield
Definition: DialogBase.h:79
static void SortDialogs()
RECT iconsource
Definition: DialogBase.h:53
Dialogs
Definition: DialogBase.h:3
Definition: Logger.h:9
short linedsp
Definition: DialogBase.h:72
WCHAR tabeffectivestr[MAX_TAB][MAX_TAB_CHARS]
Definition: DialogBase.h:90
D3DXVECTOR3 windowlocation
Definition: DialogBase.h:59
virtual void OnCreateDevice()
short fieldeffectivewidth[MAX_FIELDS]
Definition: DialogBase.h:93
long edittab
Definition: DialogBase.h:79
short scrollbartop
Definition: DialogBase.h:74
bool actionenabled[MAX_ACTION]
Definition: DialogBase.h:77
static void Initialize(HMI *gui)
Definition: DialogBase.cpp:114
long layer
Definition: DialogBase.h:70
short fieldcontent[MAX_FIELDS]
Definition: DialogBase.h:48
short scrollbarheight
Definition: DialogBase.h:74
short dialogid
Definition: DialogBase.h:101
virtual void Close(bool minimize)
short tabs
Definition: DialogBase.h:62
bool usesHUD
Definition: DialogBase.h:56
static void BringToFront(short t)
short actionoffset
Definition: DialogBase.h:76
bool enabled
Definition: DialogBase.h:71
static bool OnEnter()
short defaultwidth
Definition: DialogBase.h:51
int linecursel
Definition: DialogBase.h:73
bool showfields
Definition: DialogBase.h:45
short actionsvisible
Definition: DialogBase.h:75
short activetab
Definition: DialogBase.h:62
void PopUpDialog()
WCHAR fieldline[MAX_LINES][MAX_FIELDS][HELP_SIZE]
Definition: DialogBase.h:94
short text
Definition: DialogBase.h:69
char sortdirection
Definition: DialogBase.h:65
WCHAR fieldeffectiveline[MAX_LINES][MAX_FIELDS][HELP_SIZE]
Definition: DialogBase.h:95
static void CheckDialogMouse()
Definition: DialogBase.cpp:293
static DialogBase * dialogs[D_ENUMERATION]
Definition: DialogBase.h:39
short fieldwidth[MAX_FIELDS]
Definition: DialogBase.h:46
bool actiontoggle[MAX_ACTION]
Definition: DialogBase.h:77
static void OnDeviceReset()
WCHAR msgbartext[HELP_SIZE]
Definition: DialogBase.h:82
short dockedto
Definition: DialogBase.h:55
static short CheckHeight(short t)
short tabusedefaultlang[MAX_TAB]
Definition: DialogBase.h:50
char msgbarcolor
Definition: DialogBase.h:81
static Logger * logger
Definition: DialogBase.h:41
bool allowclose
Definition: DialogBase.h:45
#define MAX_FIELDS
Definition: gui.h:18
short defaultheight
Definition: DialogBase.h:51
WCHAR fieldeffectivetitle[MAX_FIELDS][HELP_SIZE]
Definition: DialogBase.h:92
short width
Definition: DialogBase.h:60
int lineact
Definition: DialogBase.h:73
static void IconClick(short icon_id)
Definition: DialogBase.cpp:192
static short CheckWidth(short dialogid)
int linetop
Definition: DialogBase.h:73
short action[MAX_ACTION]
Definition: DialogBase.h:49
WCHAR tabstr[MAX_TAB][MAX_TAB_CHARS]
Definition: DialogBase.h:63
bool fieldsortable[MAX_FIELDS]
Definition: DialogBase.h:96
virtual void TabClick(short clicked_tab)
Definition: DialogBase.cpp:731
bool allowscroll
Definition: DialogBase.h:45
short fieldx[MAX_FIELDS]
Definition: DialogBase.h:93
virtual void DragDropItem(short s)
virtual void Update()
unsigned short clipboardrecord
Definition: DialogBase.h:84
bool active
Definition: DialogBase.h:71
short tabflash[MAX_TAB]
Definition: DialogBase.h:88
CDXUTDialog HUD
Definition: DialogBase.h:98
short icon
Definition: DialogBase.h:53
static HMI * gui
Definition: DialogBase.h:40
char clipboardsourcetab
Definition: DialogBase.h:85
Definition: gui.h:696
bool allowresize
Definition: DialogBase.h:45
virtual void ClearEdit()
long editline
Definition: DialogBase.h:79
short sortfield
Definition: DialogBase.h:64
static void UpdateScrollBar(short t)
short height
Definition: DialogBase.h:60
DialogBase(short id)
Definition: DialogBase.cpp:17
short tabwidth[MAX_TAB]
Definition: DialogBase.h:89
#define HELP_SIZE
Definition: gui.h:17
#define MAX_ACTION
Definition: gui.h:19
static void UpdateAllActiveDialogs(float fElapsedTime)
Definition: DialogBase.cpp:121
D3DXVECTOR3 windowdefaultlocation
Definition: DialogBase.h:52
bool normalinterlace
Definition: DialogBase.h:54
bool allowmove
Definition: DialogBase.h:45
virtual void DoubleClickLine()
Definition: DialogBase.h:112
static short draworder[D_ENUMERATION]
Definition: DialogBase.h:105
virtual void ActiveTab()
static void DrawAllActiveDialogs(float fElapsedTime)
Definition: DialogBase.cpp:742
int linetot
Definition: DialogBase.h:73
short fieldtype[MAX_FIELDS]
Definition: DialogBase.h:47
D3DXVECTOR3 windowseeklocation
Definition: DialogBase.h:68
short fields
Definition: DialogBase.h:44
#define MAX_LINES
Definition: gui.h:20
virtual void Draw(D3DXVECTOR3 *tracked)