src/window.h
branchcpp_gui
changeset 6261 5fd6b1cfa424
parent 6260 740c702f6871
child 6263 19dab6a68886
equal deleted inserted replaced
6260:740c702f6871 6261:5fd6b1cfa424
   493 
   493 
   494 struct BaseWindow : public CompositeWidget {
   494 struct BaseWindow : public CompositeWidget {
   495 public:
   495 public:
   496 	static WindowList s_list;
   496 	static WindowList s_list;
   497 
   497 
       
   498 	ZeroInitBegin m_zero_init_area; ///< following members get cleared by constructor
       
   499 
   498 	WindowFlags flags4;
   500 	WindowFlags flags4;
   499 	WindowClass window_class;
   501 	WindowClass window_class;
   500 	WindowNumber window_number;
   502 	WindowNumber window_number;
   501 
   503 
   502 	int left, top;
   504 	int left, top;
   518 
   520 
   519 	WindowMessage message;
   521 	WindowMessage message;
   520 	BaseWindow *parent;
   522 	BaseWindow *parent;
   521 	byte custom[WINDOW_CUSTOM_SIZE];
   523 	byte custom[WINDOW_CUSTOM_SIZE];
   522 
   524 
   523 	BaseWindow(const WindowDesc *desc, WindowNumber num = 0);
   525 	ZeroInitEnd m_zero_init_end; ///< end of zero initialization area
       
   526 
       
   527 	BaseWindow(const WindowDesc *desc, WindowNumber num = 0)
       
   528 		: m_zero_init_area(m_zero_init_end)
       
   529 	{
       
   530 		Create(desc, num);
       
   531 	}
       
   532 
   524 	virtual bool Create(const WindowDesc *desc, WindowNumber num = 0);
   533 	virtual bool Create(const WindowDesc *desc, WindowNumber num = 0);
   525 
   534 
   526 	static BaseWindow* Allocate(int x, int y, int width, int height, WindowProc *proc, WindowClass cls, const OldWidget *widget);
   535 	static BaseWindow* Allocate(int x, int y, int width, int height, WindowProc *proc, WindowClass cls, const OldWidget *widget);
   527 	static BaseWindow* Allocate(const WindowDesc *desc, int window_number = 0);
   536 	static BaseWindow* Allocate(const WindowDesc *desc, int window_number = 0);
   528 	static BaseWindow* AllocateFront(const WindowDesc *desc, int window_number = 0);
   537 	static BaseWindow* AllocateFront(const WindowDesc *desc, int window_number = 0);
   529 
       
   530 	void ZeroInit()
       
   531 	{
       
   532 		memset(&flags4, 0, sizeof(*this) - cpp_offsetof(BaseWindow, flags4));
       
   533 	}
       
   534 
   538 
   535 	BaseWindow* FindChild() const;
   539 	BaseWindow* FindChild() const;
   536 	void SetDirty() const;
   540 	void SetDirty() const;
   537 	void CDECL SetWidgetsDisabledState(bool disab_stat, int widgets, ...);
   541 	void CDECL SetWidgetsDisabledState(bool disab_stat, int widgets, ...);
   538 	void CDECL SetWidgetsHiddenState(bool hidden_stat, int widgets, ...);
   542 	void CDECL SetWidgetsHiddenState(bool hidden_stat, int widgets, ...);