Main Page Namespace List Class Hierarchy Compound List File List Namespace Members Compound Members File Members Related Pages

# Window.h

Go to the documentation of this file.

    00001
    00002
    00003
    00004 #ifndef _WINDOW_H
    00005 #define _WINDOW_H
    00006
    00007 #include <windows.h>
    00008 #include "Types.h"
    00009 #include <vector>
    00010
    00011 #include "Control.h"
    00012 #include "Menu.h"
    00013 #include "Icon.h"
    00014 #include "Cursor.h"
    00015 #include "CommonDlg.h"
    00016
    00017 namespace wkgl {
    00018
    00024 #define DO_NOTHING_ON_CLOSE 0
    00025
    00030 #define EXIT_ON_CLOSE       1
    00031
    00040 #define DESTROY_ON_CLOSE    2
    00041
    00046 #define HIDE_ON_CLOSE       3
    00047
    00093 class Window : public Control, public CallBack
    00094 {
    00095   private:
    00096     static int  app_inc;          //The incriment to append to app name
    00097
    00098   protected:
    00099     BOOL        looping;
    00100     HBRUSH      bgbrush;
    00101     Icon        *wicon;
    00102     Icon        *sicon;
    00103     String    *title;
    00104     UINT        style;
    00105     UINT        exstyle;
    00106     Menu*     menu_bar;
    00107     std::vector <Control*> controls;
    00108
    00112     HWND  curfocus;
    00113
    00117     SFLAG     close_operation;
    00118
    00119   public:
    00123     Window();
    00124
    00128     Window( const char* title );
    00129
    00133     ~Window();
    00134
    00138     WPARAM beginMessageLoop();
    00139
    00143     virtual void setSmallIcon( Icon* ico );
    00144
    00148     virtual void setWindowIcon( Icon* ico );
    00149
    00153     virtual Icon* getSmallIcon();
    00154
    00158     virtual Icon* getWindowIcon();
    00159
    00163     virtual char* getTitle();
    00164
    00168     virtual void setTitle( const char* s );
    00169
    00173     virtual void setDefaultCloseOperation( SFLAG operation );
    00174
    00178     virtual short getDefaultCloseOperation();
    00179
    00183     virtual BOOL isHiding();
    00184
    00188     virtual BOOL show();
    00189
    00193     virtual BOOL hide();
    00194
    00198     virtual BOOL toFront();
    00199
    00203     virtual BOOL toBack();
    00204
    00208     virtual BOOL activate();
    00209
    00215     virtual BOOL create( Control* parent );
    00216
    00220     virtual void add( Control *con );
    00221
    00225     virtual void setMenuBar( Menu *menu );
    00226
    00230     virtual BOOL destroyWindow();
    00231
    00235     static void quitApp( int exitcode = 0 );
    00236
    00245     virtual BOOL callBack(Component* com, UINT message,
    00246                           WPARAM wParam, LPARAM lParam);
    00247
    00248   private:
    00249     void mnsettodefault();
    00250 };
    00251 }
    00252 #endif