home *** CD-ROM | disk | FTP | other *** search
- //----------------------------------------------------------------------------
- // Menus.hpp - dcc32 generated hdr (DO NOT EDIT) rev: -2
- // From: Menus.pas
- //----------------------------------------------------------------------------
- #ifndef MenusHPP
- #define MenusHPP
- //----------------------------------------------------------------------------
- #ifndef MessagesHPP
- #include <Messages.hpp>
- #endif
-
- #ifndef ClassesHPP
- #include <Classes.hpp>
- #endif
-
- #ifndef SysUtilsHPP
- #include <SysUtils.hpp>
- #endif
-
- #ifndef WindowsHPP
- #include <Windows.hpp>
- #endif
-
- #ifndef SystemHPP
- #include <System.hpp>
- #endif
-
- namespace Menus
- {
- //-- type declarations -------------------------------------------------------
- class __declspec(delphiclass) EMenuError;
- class __declspec(pascalimplementation) EMenuError : public Sysutils::Exception
- {
- typedef EMenuError ThisClass;
- typedef Sysutils::Exception inherited;
-
- public:
- /* !! Exception.Create */ __fastcall EMenuError(const System::AnsiString Msg) : Sysutils::Exception(
- Msg) { }
- /* !! Exception.CreateFmt */ __fastcall EMenuError(const System::AnsiString Msg, const TVarRec *Args
- , const System::Integer Args_Size) : Sysutils::Exception(Msg, Args, Args_Size) { }
- /* !! Exception.CreateRes */ __fastcall EMenuError(System::Integer Ident) : Sysutils::Exception(Ident
- ) { }
- /* !! Exception.CreateResFmt */ __fastcall EMenuError(System::Integer Ident, const TVarRec *Args, const
- System::Integer Args_Size) : Sysutils::Exception(Ident, Args, Args_Size) { }
- /* !! Exception.CreateHelp */ __fastcall EMenuError(const System::AnsiString Msg, System::Integer AHelpContext
- ) : Sysutils::Exception(Msg, AHelpContext) { }
- /* !! Exception.CreateFmtHelp */ __fastcall EMenuError(const System::AnsiString Msg, const TVarRec
- *Args, const System::Integer Args_Size, System::Integer AHelpContext) : Sysutils::Exception(Msg, Args
- , Args_Size, AHelpContext) { }
- /* !! Exception.CreateResHelp */ __fastcall EMenuError(System::Integer Ident, System::Integer AHelpContext
- ) : Sysutils::Exception(Ident, AHelpContext) { }
- /* !! Exception.CreateResFmtHelp */ __fastcall EMenuError(System::Integer Ident, const TVarRec *Args
- , const System::Integer Args_Size, System::Integer AHelpContext) : Sysutils::Exception(Ident, Args
- , Args_Size, AHelpContext) { }
-
- public:
- /* !! TObject.Destroy */ __fastcall virtual ~EMenuError(void) { }
-
- };
-
- enum TMenuBreak { mbNone, mbBreak, mbBarBreak };
-
- typedef System::Word TShortCut;
-
- typedef void __fastcall (__closure *TMenuChangeEvent)(System::TObject *Sender, System::Boolean Rebuild
- );
-
- class __declspec(delphiclass) TMenuItem;
- class __declspec(delphiclass) TMenu;
- enum TFindItemKind { fkCommand, fkHandle, fkShortCut };
-
- class __declspec(pascalimplementation) TMenu : public Classes::TComponent
- {
- typedef TMenu ThisClass;
- typedef Classes::TComponent inherited;
-
- private:
- TMenuItem *FItems;
- System::Integer FWindowHandle;
- System::AnsiString FMenuImage;
- virtual void __fastcall MenuChanged(System::TObject *Sender, System::Boolean Rebuild);
- void __fastcall SetWindowHandle(System::Integer Value);
- System::Boolean __fastcall UpdateImage(void);
-
- protected:
- virtual void __fastcall GetChildren(Classes::TGetChildProc Proc);
- virtual System::Integer __fastcall GetHandle(void);
- virtual void __fastcall SetChildOrder(Classes::TComponent *Child, System::Integer Order);
-
- public:
- __fastcall virtual TMenu(Classes::TComponent *AOwner);
- __fastcall virtual ~TMenu(void);
- System::Boolean __fastcall DispatchCommand(System::Word ACommand);
- System::Boolean __fastcall DispatchPopup(System::Integer AHandle);
- TMenuItem *__fastcall FindItem(System::Integer Value, TFindItemKind Kind);
- Classes::THelpContext __fastcall GetHelpContext(System::Word Value, System::Boolean ByCommand);
- System::Boolean __fastcall IsShortCut(Messages::TWMKey &Message);
- __property System::Integer Handle = {read=GetHandle, nodefault};
- __property System::Integer WindowHandle = {read=FWindowHandle, write=SetWindowHandle, nodefault};
-
- __published:
- __property TMenuItem * Items = {read=FItems, nodefault};
- };
-
- class __declspec(pascalimplementation) TMenuItem : public Classes::TComponent
- {
- typedef TMenuItem ThisClass;
- typedef Classes::TComponent inherited;
-
- private:
- System::AnsiString FCaption;
- System::Integer FHandle;
- System::Boolean FChecked;
- System::Boolean FEnabled;
- System::Boolean FDefault;
- System::Boolean FRadioItem;
- System::Boolean FVisible;
- System::Byte FGroupIndex;
- TMenuBreak FBreak;
- System::Word FCommand;
- Classes::THelpContext FHelpContext;
- System::AnsiString FHint;
- Classes::TList *FItems;
- TShortCut FShortCut;
- TMenuItem *FParent;
- TMenuItem *FMerged;
- TMenu *FMenu;
- TMenuChangeEvent FOnChange;
- Classes::TNotifyEvent FOnClick;
- void __fastcall AppendTo(System::Integer Menu);
- void __fastcall ClearHandles(void);
- void __fastcall ReadShortCutText(Classes::TReader *Reader);
- void __fastcall MergeWith(TMenuItem *Menu);
- void __fastcall RebuildHandle(void);
- void __fastcall PopulateMenu(void);
- void __fastcall SubItemChanged(System::TObject *Sender, System::Boolean Rebuild);
- void __fastcall WriteShortCutText(Classes::TWriter *Writer);
- void __fastcall VerifyGroupIndex(System::Integer Position, System::Byte Value);
-
- protected:
- virtual void __fastcall DefineProperties(Classes::TFiler *Filer);
- System::Integer __fastcall GetHandle(void);
- System::Integer __fastcall GetCount(void);
- virtual void __fastcall GetChildren(Classes::TGetChildProc Proc);
- TMenuItem *__fastcall GetItem(System::Integer Index);
- System::Integer __fastcall GetMenuIndex(void);
- virtual Classes::TComponent *__fastcall GetParentComponent(void);
- virtual void __fastcall MenuChanged(System::Boolean Rebuild);
- virtual System::Boolean __fastcall HasParent(void);
- void __fastcall SetBreak(TMenuBreak Value);
- void __fastcall SetCaption(const System::AnsiString Value);
- void __fastcall SetChecked(System::Boolean Value);
- virtual void __fastcall SetChildOrder(Classes::TComponent *Child, System::Integer Order);
- void __fastcall SetDefault(System::Boolean Value);
- void __fastcall SetEnabled(System::Boolean Value);
- void __fastcall SetGroupIndex(System::Byte Value);
- void __fastcall SetMenuIndex(System::Integer Value);
- virtual void __fastcall SetParentComponent(Classes::TComponent *Value);
- void __fastcall SetRadioItem(System::Boolean Value);
- void __fastcall SetShortCut(TShortCut Value);
- void __fastcall SetVisible(System::Boolean Value);
-
- public:
- __fastcall virtual TMenuItem(Classes::TComponent *AOwner);
- __fastcall virtual ~TMenuItem(void);
- void __fastcall Insert(System::Integer Index, TMenuItem *Item);
- void __fastcall Delete(System::Integer Index);
- virtual void __fastcall Click(void);
- System::Integer __fastcall IndexOf(TMenuItem *Item);
- void __fastcall Add(TMenuItem *Item);
- void __fastcall Remove(TMenuItem *Item);
- __property System::Word Command = {read=FCommand, nodefault};
- __property System::Integer Handle = {read=GetHandle, nodefault};
- __property System::Integer Count = {read=GetCount, nodefault};
- __property TMenuItem * Items[System::Integer Index] = {read=GetItem/*, default*/};
- __property System::Integer MenuIndex = {read=GetMenuIndex, write=SetMenuIndex, nodefault};
- __property TMenuItem * Parent = {read=FParent, nodefault};
-
- __published:
- __property TMenuBreak Break = {read=FBreak, write=SetBreak, default=0};
- __property System::AnsiString Caption = {read=FCaption, write=SetCaption, nodefault};
- __property System::Boolean Checked = {read=FChecked, write=SetChecked, default=0};
- __property System::Boolean Default = {read=FDefault, write=SetDefault, default=0};
- __property System::Boolean Enabled = {read=FEnabled, write=SetEnabled, default=1};
- __property System::Byte GroupIndex = {read=FGroupIndex, write=SetGroupIndex, default=0};
- __property Classes::THelpContext HelpContext = {read=FHelpContext, write=FHelpContext, default=0};
- __property System::AnsiString Hint = {read=FHint, write=FHint, nodefault};
- __property System::Boolean RadioItem = {read=FRadioItem, write=SetRadioItem, default=0};
- __property TShortCut ShortCut = {read=FShortCut, write=SetShortCut, nodefault};
- __property System::Boolean Visible = {read=FVisible, write=SetVisible, default=1};
- __property Classes::TNotifyEvent OnClick = {read=FOnClick, write=FOnClick};
- };
-
- class __declspec(delphiclass) TMainMenu;
- class __declspec(pascalimplementation) TMainMenu : public TMenu
- {
- typedef TMainMenu ThisClass;
- typedef TMenu inherited;
-
- private:
- TMenuItem *MergedMenu;
- System::Integer FOle2Menu;
- System::Boolean FAutoMerge;
- System::Byte FReserved;
- void __fastcall ItemChanged(void);
- virtual void __fastcall MenuChanged(System::TObject *Sender, System::Boolean Rebuild);
- void __fastcall SetAutoMerge(System::Boolean Value);
-
- protected:
- virtual System::Integer __fastcall GetHandle(void);
-
- public:
- void __fastcall Merge(TMainMenu *Menu);
- void __fastcall Unmerge(TMainMenu *Menu);
- void __fastcall PopulateOle2Menu(System::Integer SharedMenu, const Integer *Groups, const System::Integer
- Groups_Size, Longint *Widths, const System::Integer Widths_Size);
- void __fastcall GetOle2AcceleratorTable(System::Integer &AccelTable, System::Integer &AccelCount, const
- Integer *Groups, const System::Integer Groups_Size);
- void __fastcall SetOle2MenuHandle(System::Integer Handle);
-
- __published:
- __property System::Boolean AutoMerge = {read=FAutoMerge, write=SetAutoMerge, default=0};
- public:
- /* !! TMenu.Create */ __fastcall virtual TMainMenu(Classes::TComponent *AOwner) : Menus::TMenu(AOwner
- ) { }
- /* !! TMenu.Destroy */ __fastcall virtual ~TMainMenu(void) { }
-
- };
-
- enum TPopupAlignment { paLeft, paRight, paCenter };
-
- class __declspec(delphiclass) TPopupMenu;
- class __declspec(pascalimplementation) TPopupMenu : public TMenu
- {
- typedef TPopupMenu ThisClass;
- typedef TMenu inherited;
-
- private:
- TPopupAlignment FAlignment;
- System::Boolean FAutoPopup;
- Classes::TComponent *FPopupComponent;
- Classes::TNotifyEvent FOnPopup;
- void __fastcall DoPopup(System::TObject *Item);
- Classes::THelpContext __fastcall GetHelpContext(void);
- void __fastcall SetHelpContext(Classes::THelpContext Value);
-
- public:
- __fastcall virtual TPopupMenu(Classes::TComponent *AOwner);
- __fastcall virtual ~TPopupMenu(void);
- virtual void __fastcall Popup(System::Integer X, System::Integer Y);
- __property Classes::TComponent * PopupComponent = {read=FPopupComponent, write=FPopupComponent, nodefault
- };
-
- __published:
- __property TPopupAlignment Alignment = {read=FAlignment, write=FAlignment, default=0};
- __property System::Boolean AutoPopup = {read=FAutoPopup, write=FAutoPopup, default=1};
- __property Classes::THelpContext HelpContext = {read=GetHelpContext, write=SetHelpContext, default=0
- };
- __property Classes::TNotifyEvent OnPopup = {read=FOnPopup, write=FOnPopup};
- };
-
- //-- var, const, procedure ---------------------------------------------------
- #define scShift System::Smallint(8192)
- #define scCtrl System::Smallint(16384)
- #define scAlt System::Integer(32768)
- #define scNone System::Byte(0)
- extern TShortCut __fastcall ShortCut(System::Word Key, Classes::TShiftState Shift);
- extern void __fastcall ShortCutToKey(TShortCut ShortCut, System::Word &Key, Classes::TShiftState *Shift
- );
- extern System::AnsiString __fastcall ShortCutToText(TShortCut ShortCut);
- extern TShortCut __fastcall TextToShortCut( System::AnsiString Text);
- extern TMainMenu *__fastcall NewMenu(Classes::TComponent *Owner, const System::AnsiString AName, const
- TMenuItem *Items, const System::Integer Items_Size);
- extern TPopupMenu *__fastcall NewPopupMenu(Classes::TComponent *Owner, const System::AnsiString AName
- , TPopupAlignment Alignment, System::Boolean AutoPopup, const TMenuItem *Items, const System::Integer
- Items_Size);
- extern TMenuItem *__fastcall NewSubMenu(const System::AnsiString ACaption, System::Word hCtx, const System::AnsiString
- AName, const TMenuItem *Items, const System::Integer Items_Size);
- extern TMenuItem *__fastcall NewItem(const System::AnsiString ACaption, TShortCut AShortCut, System::Boolean
- AChecked, System::Boolean AEnabled, Classes::TNotifyEvent AOnClick, System::Word hCtx, const System::AnsiString
- AName);
- extern TMenuItem *__fastcall NewLine(void);
-
- } /* namespace Menus */
- #if !defined(NO_IMPLICIT_NAMESPACE_USE)
- using namespace Menus;
- #endif
- //-- end unit ----------------------------------------------------------------
- #endif // Menus
-