home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / wxos2233.zip / wxOS2-2_3_3.zip / wxWindows-2.3.3 / contrib / samples / fl / fl_demo2 / fl_demo2.h < prev    next >
C/C++ Source or Header  |  2001-07-24  |  4KB  |  161 lines

  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name:        No names yet.
  3. // Purpose:     Contrib. demo
  4. // Author:      Aleksandras Gluchovas
  5. // Modified by:
  6. // Created:     04/11/98
  7. // RCS-ID:      $Id: fl_demo2.h,v 1.1 2001/07/24 15:27:11 JS Exp $
  8. // Copyright:   (c) Aleksandras Gluchovas
  9. // Licence:       wxWindows license
  10. /////////////////////////////////////////////////////////////////////////////
  11.  
  12. #ifndef __FLDEMO_G__
  13. #define __FLDEMO_G__
  14.  
  15. // ID for the menu commands
  16.  
  17. #define MINIMAL_QUIT     1
  18. #define MINIMAL_ABOUT 102
  19.  
  20. #define ID_LOAD      103
  21. #define ID_STORE     104
  22. #define ID_AUTOSAVE  105
  23. //#define ID_SETTINGS  106
  24. #define ID_REMOVE    107
  25. #define ID_REMOVEALL 108
  26. #define ID_RECREATE  109
  27. #define ID_ACTIVATE  110
  28. #define ID_FIRST     111
  29. #define ID_SECOND    112
  30. #define ID_THIRD     113
  31.  
  32. #define ID_SAY_ITSOK 114
  33. #define ID_BTN_YES   115
  34. #define ID_BTN_NO    116
  35. #define ID_BTN_ESC   117
  36.  
  37. #define MAX_LAYOUTS   3
  38.  
  39. #define FIRST_LAYOUT  0
  40. #define SECOND_LAYOUT 1
  41. #define THIRD_LAYOUT  2
  42.  
  43. class wxFrameLayout;
  44. class wxObjectStorage;
  45.  
  46. // FOR NOW::
  47. typedef wxPanel MyTestPanel;
  48.  
  49. // Define a new application type
  50.  
  51. class MyApp: public wxApp
  52. public:
  53.     bool OnInit(void);
  54. };
  55.  
  56. // Define a new frame type
  57.  
  58. class MyFrame: public wxFrame
  59. protected:
  60.     
  61.     wxFrameLayout* mLayouts[MAX_LAYOUTS];
  62.     
  63.     wxFrameLayout* mpNestedLayout;
  64.     wxFrameLayout* mpAboutBoxLayout;
  65.     
  66.     int            mActiveLayoutNo;   
  67.     bool           mAutoSave;
  68.     bool           mSavedAlready;
  69.     
  70.     // container windows:
  71.     
  72.     wxTextCtrl*    mpClntWindow;
  73.     wxPanel*       mpInternalFrm;
  74.     
  75.     wxImageList    mImageList;
  76.     
  77.     wxFrame       mAboutBox;
  78.     
  79.     // helpers for control-creation
  80.     
  81.     wxTextCtrl* CreateTxtCtrl ( const wxString& txt = "wxTextCtrl", wxWindow* parent = NULL  );
  82.     wxTreeCtrl* CreateTreeCtrl( const wxString& label = "TreeCtrl" );
  83.     wxChoice*   CreateChoice  ( const wxString& txt = "Choice1" );
  84.     wxButton*   CreateButton  ( const wxString& label = "wxButton", wxWindow* pParent = NULL, long id = ID_SAY_ITSOK );
  85.     
  86.     // helpers for layout-creation
  87.     
  88.     void AddSearchToolbars( wxFrameLayout& layout, wxWindow* pParent );
  89.     wxWindow* CreateDevLayout( wxFrameLayout& layout, wxWindow* pParent );
  90.     
  91.     void DropInSomeBars( int layoutNo );
  92.     void CreateLayout( int layoutNo );
  93.     void RemoveLayout( int layoutNo );
  94.     
  95.     void InitAboutBox();
  96.     
  97.     void ActivateLayout( int layoutNo );
  98.     
  99. public: /* public */
  100.     
  101.     MyFrame( wxFrame *frame, char *title, int x, int y, int w, int h);
  102.     
  103.     ~MyFrame();
  104.     
  105.     void SyncMenuBarItems();
  106.     
  107.     // event handlers
  108.     
  109.     bool OnClose(void);
  110.     
  111.     void OnLoad( wxCommandEvent& event );
  112.     void OnStore( wxCommandEvent& event );
  113.     void OnAutoSave( wxCommandEvent& event );
  114.     void OnQuit(wxCommandEvent& event);
  115.     void OnAbout(wxCommandEvent& event);
  116.     //void OnSettings( wxCommandEvent& event );
  117.     void OnRemove( wxCommandEvent& event );
  118.     void OnRemoveAll( wxCommandEvent& event );
  119.     void OnRecreate( wxCommandEvent& event );
  120.     void OnFirst( wxCommandEvent& event );
  121.     void OnSecond( wxCommandEvent& event );
  122.     void OnThird( wxCommandEvent& event );
  123.     
  124.     void OnSayItsOk( wxCommandEvent& event );
  125.     void OnBtnYes( wxCommandEvent& event );
  126.     void OnBtnNo( wxCommandEvent& event );
  127.     void OnBtnEsc( wxCommandEvent& event );
  128.     
  129.     void OnChar( wxKeyEvent& event );
  130.     
  131.     DECLARE_EVENT_TABLE()   
  132. };
  133.  
  134. // Define a new button type, StartButton95 (Just for fun)
  135.  
  136. class StartButton95 : public wxPanel
  137. {
  138.     DECLARE_DYNAMIC_CLASS( StartButton95 )
  139.         
  140.     bool m_bPressed;
  141.     wxBitmap m_PBmp;
  142.     wxBitmap m_DBmp;
  143.     
  144. public:
  145.     StartButton95(void) : m_bPressed(FALSE) {}
  146.     
  147.     StartButton95(wxWindow* parent) 
  148.         : m_bPressed(FALSE) { wxPanel::Create(parent,-1); }
  149.     
  150.     void OnMouseDown( wxMouseEvent& event );
  151.     void OnMouseUp( wxMouseEvent& event );
  152.     void OnPaint( wxPaintEvent& event );
  153.     
  154.     DECLARE_EVENT_TABLE();
  155. };
  156.  
  157. #endif
  158.  
  159.