Main Page Class Hierarchy Compound List File List Compound Members File Members

# menu.h

Go to the documentation of this file.

    00001
    00002
    00003 //
    00004 //      MENU.H                                          (c)     YoY'00                                          WEB: www.aestesis.org
    00005 //
    00008 #ifndef                                                 _MENU_H_
    00009 #define                                                 _MENU_H_
    00012 #include                                                <stdio.h>
    00013 #include                                                "types.h"
    00014 #include                                                "surface.h"
    00017
    00018 //      If you use directly the variables in the class API, it's at your own risks. Prefer the methods...
    00019
    00022
    00023 #define                                                 guidITEM                                                (Aitem::CI.guid)
    00024 #define                                                 guidMENU                                                (Amenu::CI.guid)
    00025
    00028
    00029 class Aitem : public Anode
    00030 {
    00031 public:
    00032
    00033         enum
    00034         {
    00035                 stateCOLLAPSED                  = Anode::stateLAST,
    00036                 stateSELECTED                   = stateCOLLAPSED<<1,
    00037                 stateCHECKED                    = stateSELECTED<<1,
    00038                 stateMULTI                              = stateCHECKED<<1,
    00039                 stateLAST                               = stateMULTI<<1
    00040         };
    00041
    00042         ALIBOBJ
    00043
    00044         ADLL                                            Aitem                                                   (Aitem *i);
    00045
    00046         ADLL                                            Aitem                                                   (char *name);
    00047         ADLL                                            Aitem                                                   (char *name, Anode *father, Anode *o, int data=0);
    00048         ADLL                                            Aitem                                                   (char *name, Anode *father, int data, Anode *o=NULL);
    00049
    00050         ADLL                                            Aitem                                                   (char *name, char *help);
    00051         ADLL                                            Aitem                                                   (char *name, char *help, Anode *father, Anode *o, int data=0);
    00052         ADLL                                            Aitem                                                   (char *name, char *help, Anode *father, int data, Anode *o=NULL);
    00053
    00054         ADLL virtual                            ~Aitem                                                  ();
    00055
    00056         ADLL void                                       copyAll                                                 (Aitem *e);
    00057         ADLL void                                       sort                                                    ();
    00058
    00059         Anode                                           *object;
    00060         int                                                     data;
    00061         char                                            *help;
    00062 };
    00063
    00066
    00067 class Amenu : public Aobject
    00068 {
    00069         ALIBOBJ
    00070
    00071         enum
    00072         {
    00073                                                                 menuUNKNOWN,
    00074                                                                 menuNORMAL,
    00075                                                                 menuCONTEXT,
    00076                                                                 menuSUBCONTEXT
    00077         };
    00078
    00079         ADLL                                            Amenu                                                   (char *name, Aobject *father, Aitem *item, Aobject *toNotify=NULL, int type=menuUNKNOWN);
    00080         ADLL virtual                            ~Amenu                                                  ();
    00081
    00082         ADLL virtual bool                       notify                                                  (Anode *o, int event, dword p=0);
    00083         ADLL virtual bool                       mouse                                                   (int x, int y, int state, int event);
    00084         ADLL virtual void                       paint                                                   (Abitmap *b);
    00085         ADLL virtual void                       pulse                                                   ();
    00086
    00087         // private
    00088
    00089         Aitem                                           *items;
    00090         Aitem                                           *firstDrawn;
    00091         Aitem                                           *current;
    00092         Anode                                           *toNotify;
    00093         int                                                     mx,my,dy;
    00094         Amenu                                           *sub;
    00095         int                                                     type;
    00096
    00097         void                                            NCcalculate                                             ();
    00098 };
    00099
    00102 #endif                                                  //_LIST_H_