Recently learned the development of BREW, the current scope of their own feeling:
There is no convenient reusable code
and the appropriate window mechanism, each project to restart
All this idea, preliminary talk, a start ~ ~
Keywords: BREW, reusable , C + +, window management, event delivery
Example Engineering: STOCKFA.SAP
-------Brewwin.h begin-------//#include typedef unsigned int UINT; Inline void* operator new (UINT size) {return MALLOC (size);} inline void operator delete (void * ptr) {free (PTR);} inl INE void* operator new[] (UINT size) {return MALLOC (size);} inline void operator delete[] (void * ptr) {free (ptr
); Class CWindow {virtual FinalConstruct ();//Initialize Virtual FinalRelease ()//Finally release Virtual Enable (Boolean Benab
Le);//Current display valid, otherwise release data and resources virtual redraw ();
Virtual Boolean OnEvent (aeeevent evt, UInt16 wParam, UInt32 dwparam);
Class Cwndmanage {//admin window Add (CWindow * pwnd);
Remove (CWindow * pwnd);
RemoveAll ();
Movetotop (CWindow * pwnd);
Gettopwnd (CWindow * * ppwnd);
Performance window Show (CWindow * pwnd, uint16 ncmd); Event Handling Boolean OnEvent (aeeevent evt, UInt16 wParam, UInt32 dwparam);/forward event to current window//base function}//array template cl
Ass CArray {t* m_at;
int m_nsize; BOOL Add (t& T)//... Note allocating memory with the BREW Environment's}//-------Brewwin.h End-------////-------Specific project file class Stocktrade:public CWindow {//Save field variables for recovery//virtual function implementation Class Stockfaapp:public Cwndmanage {//adapting to brew's functions, assigning and releasing//...
Slightly//Call Cwndmanage basic function implementation//Other characteristic data variable}
First come to guillotine, welcome criticism advice, greatly appreciated.
Has highlighted