My Project
interface.h
Go to the documentation of this file.
1 
12 #pragma once
13 
14 using std::vector;
15 
24 {
25 public:
30 
36  BaseInterfaceCtrl(HWND hWnd, HINSTANCE hInst);
37 
42 
52  virtual HWND create(int X = 0, int Y = 0, int HEIGHT = 0, int WIDTH = 0, WCHAR* TEXT = NULL) = 0;
53 
57  virtual void remove() = 0;
58 
59 protected:
60  static HWND hWnd;
61  static HINSTANCE hInst;
62 };
63 
78 {
79 public:
84 
90  InterfaceCtrlInit(HWND hWnd, HINSTANCE hInst) : BaseInterfaceCtrl(hWnd, hInst) {};
91 
93  virtual HWND create(int X = 0, int Y = 0, int HEIGHT = 0, int WIDTH = 0, WCHAR* TEXT = NULL) override { return NULL; };
94 
96  virtual void remove() override {};
97 };
98 
104 };
105 
110 typedef struct InterfaceCtrl
111 {
112  enum InterfaceCtrlType type;
113  int id;
115 };
116 
117 #include "button.h"
118 #include "combobox.h"
119 #include "editfield.h"
120 
121 class Button;
122 class Combobox;
123 class Editfield;
124 
139 {
140 public:
144  BaseInterface();
149  ~BaseInterface();
150 
156  Button* button(int ID);
157 
163  Combobox* combobox(int ID);
164 
170  Editfield* editfield(int ID);
171 
175  void remove(int ID);
176 
177 private:
178  vector<InterfaceCtrl*> interfaceCtrlList;
179 };
180 
181 COLORREF colorDialog();
static HINSTANCE hInst
Definition: interface.h:61
Each element (button, editfield etc) has own structure.
Definition: interface.h:23
Button.
Definition: interface.h:101
int id
Unique ID of element.
Definition: interface.h:113
Button interface class.
InterfaceCtrlInit(HWND hWnd, HINSTANCE hInst)
Definition: interface.h:90
Main interface class. Provides access to create/remove/update elements.
Definition: interface.h:138
virtual HWND create(int X=0, int Y=0, int HEIGHT=0, int WIDTH=0, WCHAR *TEXT=NULL)=0
COLORREF colorDialog()
Definition: interface.cpp:103
Combobox.
Definition: interface.h:103
Combobox interface class Provide interface for creating/removing/updating combobox.
Definition: combobox.h:24
Editfield interface class Provide interface for creating/removing editfield.
Definition: editfield.h:24
Edit field.
Definition: interface.h:102
InterfaceCtrlType
List of interface elements types.
Definition: interface.h:100
virtual HWND create(int X=0, int Y=0, int HEIGHT=0, int WIDTH=0, WCHAR *TEXT=NULL) override
Definition: interface.h:93
BaseInterfaceCtrl * _BaseInterfaceCtrl
Pointer to object of Ctrl.
Definition: interface.h:114
Combobox interface class.
Button interface class Provide interface for creating/removing button.
Definition: button.h:24
static HWND hWnd
Definition: interface.h:60