uiextend.h

Go to the documentation of this file.
00001 /**********************************************************************
00002  *<
00003     FILE: UIExtend.h
00004 
00005     DESCRIPTION: MaxScript user interface extensions
00006 
00007     CREATED BY: Ravi Karra, 1998
00008 
00009     HISTORY:
00010 
00011  *> Copyright (c) 1994, All Rights Reserved.
00012  **********************************************************************/
00013 
00014 #pragma once
00015 
00016 #include "..\kernel\value.h"
00017 // forward declarations
00018 class RCMenu;
00019 class HashTable;
00020 
00021 #define MF_SUBMENU_START    (MF_SEPARATOR+10)
00022 #define MF_SUBMENU_END      (MF_SEPARATOR+11)
00023 
00024 visible_class_debug_ok (MenuItem)
00025 
00026 class MenuItem : public Value
00027 {   
00028 public:
00029     Value   *name, *caption, *flt_fn;
00030     Value   **keyparms;
00031     RCMenu  *menu;
00032     HMENU   hmenu;
00033     UINT    hmenu_index;
00034 
00035     int     keyparm_count;
00036     UINT    flags;
00037     
00038             MenuItem (RCMenu *m, Value* n, Value* c, Value  **keyparms, int keyparm_count, UINT f=0);
00039             MenuItem () {menu= NULL; name=caption=NULL; keyparms=NULL; flags=keyparm_count=hmenu_index=0; hmenu = NULL;} 
00040             ~MenuItem ();
00041 
00042     ScripterExport void setup_params();
00043     void    collect() { delete this; }
00044     void    gc_trace();
00045     ScripterExport void sprin1(CharStream* s);
00046 
00047     virtual Value*  get_property(Value** arg_list, int count);
00048     virtual Value*  set_property(Value** arg_list, int count);
00049 };
00050 
00051 
00052 class MSRightClickMenu : public RightClickMenu
00053 {
00054 public:
00055     RCMenu  *menu;
00056     void    Init(RightClickMenuManager* manager, HWND hWnd, IPoint2 m);
00057     void    Selected(UINT id);
00058     Value*  call_filt_fn(Value* fn);
00059 };
00060 
00061 
00062 visible_class_debug_ok (RCMenu)
00063 
00064 class RCMenu : public Value
00065 {
00066 public:
00067     Value*      name;                       // menu name
00068     HashTable*  local_scope;                // local name space 
00069     MenuItem**  items;                      // menu item array
00070     int         item_count;                 //   "    "  count
00071     Value**     locals;                     // local var array  
00072     Value**     local_inits;                //   "    "    "  init vals 
00073     int         local_count;                //   "    "  count  
00074     HashTable*  handlers;                   // handler tables   
00075     short       flags;                      // menu flags
00076     BOOL        init_values;                // whether to init ctrl/local values on (re)open 
00077     BOOL        end_rcmenu_mode;            // signals end of rcmenu mode
00078     MSRightClickMenu msmenu;                // right-click menu
00079     // command mode locals...
00080     Value*      result;                     // rcmenu result
00081     MSPlugin*   plugin;                     // current plugin under manip if non-NULL
00082 
00083                 RCMenu(short iflags);
00084     void        init(Value* name, int local_count, Value** inits, HashTable* local_scope, MenuItem** iitems, int iitem_count, HashTable* handlers);
00085                ~RCMenu();
00086 
00087 #   define is_RCMenu(o) ((o)->tag == class_tag(RCMenu))  // LAM - defect 307069
00088                 classof_methods (RCMenu, Value);
00089     void        collect() { delete this; }
00090     void        gc_trace();
00091     ScripterExport void sprin1(CharStream* s);
00092 
00093     Value*      get_event_handler(Value* name, Value* event);
00094     BOOL        call_event_handler(Value* name, Value* event, Value** arg_list, int count);
00095     
00096 
00097     virtual Value*  get_property(Value** arg_list, int count);
00098     virtual Value*  set_property(Value** arg_list, int count);
00099 
00100     // added 3/21/05. Used by debugger to dump locals and externals to standard out
00101     void        dump_local_vars_and_externals(int indentLevel);
00102 };
00103 
00104 // LAM - 9/10/01
00105 
00106 // The following classes have been added
00107 // in 3ds max 4.2.  If your plugin utilizes this new
00108 // mechanism, be sure that your clients are aware that they
00109 // must run your plugin with 3ds max version 4.2 or higher.
00110 
00111 class MSSelectFilterCallback : public SelectFilterCallback
00112 {
00113 
00114 public:
00115     MSSelectFilterCallback() 
00116         {
00117         selectFilter_call_back_on = FALSE;
00118         in_selectfilter_callback = FALSE;
00119 
00120         }
00121     MCHAR dname[128];
00122     MCHAR* GetName() {return dname;};
00123     BOOL IsFiltered(SClass_ID isid, Class_ID icid, INode *node);
00124     Value* selectFilters_fns;
00125     BOOL selectFilter_call_back_on;
00126     BOOL in_selectfilter_callback;
00127 
00128 };
00129 
00130 class MSDisplayFilterCallback : public DisplayFilterCallback
00131 {
00132 
00133 public:
00134     MSDisplayFilterCallback() 
00135         {
00136         displayFilter_call_back_on = FALSE;
00137         in_displayfilter_callback = FALSE;
00138 
00139         }
00140     MCHAR dname[128];
00141     MCHAR* GetName() {return dname;};
00142     
00143     BOOL IsVisible(SClass_ID isid, Class_ID icid, INode *node);
00144     Value* displayFilters_fns;
00145     BOOL displayFilter_call_back_on;
00146     BOOL in_displayfilter_callback;
00147 };
00148 
00149 // End of 3ds max 4.2 Extension
00150