[Original] on brew on the Construction of small window mechanism

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.