home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 10 / ioProg_10.iso / soft / optima / hpp.z / MENUEDIT.HPP < prev    next >
Encoding:
C/C++ Source or Header  |  1996-03-12  |  3.3 KB  |  135 lines

  1. /*
  2.     MENUEDIT.HPP
  3. */
  4.  
  5. #ifndef _MENUEDIT_HPP_INCLUDED
  6. #define _MENUEDIT_HPP_INCLUDED
  7.  
  8. #include "propdlg.hpp"
  9.  
  10. class DTWMenu;
  11. class DTWMenuObject;
  12.  
  13. #define MENEGOTIATE_TABLE_SIZE sizeof( MENegotiateTable ) / sizeof( MENegotiate )
  14.     
  15.  
  16. class METADEF MenuEdit : public MTPropertyDialog {
  17.     public:
  18.         MenuEdit();
  19.     ~MenuEdit();
  20.  
  21.     WBool AskApplyChanges() { return TRUE; }
  22.     WBool Create( WWindow *prt, DTObject *obj, WBool c );
  23.  
  24.     WBool IsModified() { return TRUE; }
  25.     WBool Refresh() { return TRUE; }
  26.     WBool Validate( WString & ) { return TRUE; }
  27.     WBool Apply() { return TRUE; }
  28.  
  29.     /* Event Handlers */
  30.  
  31.     // Events in case the dialog is closed unexpectedly.
  32.     // If this dialog is ever moved into the property sheets
  33.     // these callbacks will be unnecessary.
  34.     WBool CloseEventHandler( WModelessDialog *, WEventData * );
  35.     WBool HandleOKButton( WWindow *, WEventData * );
  36.     WBool HandleCancelButton( WWindow *, WEventData * );
  37.  
  38.     // Menu hiliting
  39.     WBool HiliteMenuItems( WObject *, WEventData * );
  40.  
  41.     // Buttons and moving data around
  42.  
  43.     WBool RefreshFields( WObject *, WEventData * );
  44.     WBool EnableButtons( WObject *, WEventData * );
  45.  
  46.     WBool AddCallback( WObject *, WEventData * );
  47.     WBool ChangeCallback( WObject *, WEventData * );
  48.     WBool AddChildCallback( WObject *, WEventData * );
  49.     WBool ClearCallback( WObject *, WEventData * );
  50.  
  51.     WBool SetSeparator( WObject *, WEventData * );
  52.  
  53.     WBool ShiftLeft( WObject *, WEventData * );
  54.     WBool ShiftRight( WObject *, WEventData * );
  55.     WBool ShiftUp( WObject *, WEventData * );
  56.     WBool ShiftDown( WObject *, WEventData * );
  57.  
  58.     WBool SeeEvent( WObject *, WEventData * );
  59.  
  60.     // Menu functions
  61.  
  62.     WBool EraseAll( WObject *, WEventData * );
  63.     WBool Exit( WObject *, WEventData * );
  64.     WBool DeleteItem( WObject *, WEventData * );
  65.  
  66.     void  Changed();
  67.  
  68.     private:
  69.  
  70.     // Private functions
  71.  
  72.     WBool initTreeView( DTWMenuObject *head, WTreeViewItemHandle parent );
  73.     void addDefaultItem();
  74.     void setEventHandlers();
  75.     void setMenuFunctions();
  76.  
  77.     void setDataFromFields( DTWMenuObject *data );
  78.     void setFieldsFromData( DTWMenuObject *data );
  79.     void resetFields();
  80.     void enableFields( WBool enable );
  81.     WInt GetObjectWithName( WString & name,
  82.                    DTWMenuObject * head,
  83.                    DTWMenuObject * & found ) const;
  84.  
  85.     WTreeViewItemHandle itemFromScreenPos( WPoint &pt );
  86.  
  87.     WTreeViewItemHandle copyTree( WTreeViewItemHandle head,
  88.                       WTreeViewItemHandle parent,
  89.                       WTreeViewItemHandle insertAfter );
  90.  
  91.     // Window controls
  92.  
  93.     WTreeView *    _editWindow;
  94.  
  95.     WTextBox *    _captionEdit;
  96.     WTextBox *    _nameEdit;
  97.  
  98.     WHotKey *    _acceleratorEdit;
  99.  
  100.     WCheckBox *    _checkedBox;
  101.     WCheckBox *    _defaultBox;
  102.     WCheckBox *    _disabledBox;
  103.     WCheckBox *    _separatorBox;
  104.  
  105.     WComboBox *    _negotiatePosition;
  106.  
  107.     WPictureButton *    _bttnLeft;
  108.     WPictureButton *    _bttnRight;
  109.     WPictureButton *    _bttnUp;
  110.     WPictureButton *    _bttnDown;
  111.  
  112.     WCommandButton *    _bttnEvent;
  113.     WCommandButton *    _bttnChange;
  114.     WCommandButton *    _bttnAdd;
  115.     WCommandButton *    _bttnAddChild;
  116.     WCommandButton *    _bttnClear;
  117.     WCommandButton *    _bttnEraseAll;
  118.     WCommandButton *    _bttnDelete;
  119.  
  120.     WCommandButton *    _bttnClose;
  121.  
  122.     // Other window components
  123.  
  124.     WPopupMenu *        _editMenu;
  125.  
  126.     // Private variables
  127.  
  128.     DTWMenu *        _dtmenu;
  129.  
  130.     WBool            _usingOldName;
  131.     DTWMenuObject *        _oldData;
  132. };
  133.  
  134. #endif
  135.