home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 April / Chip_1997-04_cd.bin / prezent / cb / data.z / APP.H < prev    next >
C/C++ Source or Header  |  1997-01-16  |  9KB  |  223 lines

  1. //----------------------------------------------------------------------------
  2. // App.hpp - dcc32 generated hdr (DO NOT EDIT) rev: 0
  3. // From: App.pas
  4. //----------------------------------------------------------------------------
  5. #ifndef AppHPP
  6. #define AppHPP
  7. //----------------------------------------------------------------------------
  8. #include <ComCtrls.hpp>
  9. #include <ExtCtrls.hpp>
  10. #include <Buttons.hpp>
  11. #include <StdCtrls.hpp>
  12. #include <ToolIntf.hpp>
  13. #include <Dialogs.hpp>
  14. #include <Forms.hpp>
  15. #include <Controls.hpp>
  16. #include <Graphics.hpp>
  17. #include <Classes.hpp>
  18. #include <Messages.hpp>
  19. #include <Windows.hpp>
  20. #include <SysUtils.hpp>
  21. #include <System.hpp>
  22. #include <FileCtrl.hpp>
  23. //-- type declarations -------------------------------------------------------
  24. enum TMoveDirection { mdPrevious, mdNext, mdNoMove };
  25.  
  26. class __declspec(delphiclass) TAppExpert;
  27. class TAppExpert : public TForm
  28. {
  29.     typedef TForm inherited;
  30. __published:
  31.     TPaintBox* Sample;        // SamplePaint
  32.     TButton* CancelBtn;       //
  33.     TButton* PrevButton;      // NextPrevClick
  34.     TButton* NextButton;      // NextPrevClick
  35.     TPageControl* PageControl;//
  36.     TTabSheet* Menus;         //
  37.     TLabel* Label1;           //
  38.     TLabel* Label2;           //
  39.     TLabel* Label3;           //
  40.     TLabel* Label4;           //
  41.     TLabel* Label5;           //
  42.     TCheckBox* cbFileMenu;    // MenuClicked
  43.     TCheckBox* cbEditMenu;    // MenuClicked
  44.     TCheckBox* cbWindowMenu;  // MenuClicked
  45.     TCheckBox* cbHelpMenu;    // MenuClicked
  46.     TTabSheet* Extensions;    //
  47.     TLabel* Label6;           //
  48.     TPanel* Panel1;           //
  49.     THeader* ExtHeader;       // HeaderSized
  50.     TListBox* ExtListBox;     // DrawExtension
  51.     TButton* AddButton;       //
  52.     TButton* EditButton;      // EditClick
  53.     TButton* DeleteButton;    // DeleteClicked
  54.     TButton* UpButton;        // MoveClick
  55.     TButton* DownButton;      // MoveClick
  56.     TTabSheet* Speedbtns;     //
  57.  
  58.     TLabel* Label7;
  59.     TPaintBox* Speedbar;      // SppedMouseDown, SpeedbarPaint
  60.     TLabel* Label8;           //
  61.     TLabel* Label9;           //
  62.     TListBox* MenuList;       // MenuListClick
  63.     TListBox* MenuItemList;   // DrawMenuItem
  64.     TButton* Button1;         // InsertClick
  65.     TButton* Button2;         // RemoveClick
  66.     TButton* Button3;         // SpaceClick
  67.     TTabSheet* AppInfo;       //
  68.     TLabel* Label13;          //
  69.     TLabel* Label10;          //
  70.     TLabel* Label15;          //
  71.     TGroupBox* GroupBox1;     //
  72.     TCheckBox* cbMDIApp;      //
  73.     TCheckBox* cbStatusLine;  //
  74.     TCheckBox* cbHints;       //
  75.     TEdit* AppPath;           //
  76.     TButton* PathBrowse;      // BrowseClick
  77.     TEdit* AppName;           //
  78.  
  79.     void __fastcall HeaderSized(TObject* Sender,
  80.                                     Integer ASection,
  81.                                     Integer AWidth);
  82.     void __fastcall FormCreate(TObject* Sender);
  83.     void __fastcall NextPrevClick(TObject* Sender);
  84.     void __fastcall DrawExtension(TWinControl* Control,
  85.                                       Integer Index,
  86.                                       const TRect &Rect,
  87.                                       TOwnerDrawState State);
  88.     void __fastcall AddClick(TObject* Sender);
  89.     void __fastcall EditClick(TObject* Sender);
  90.     void __fastcall DeleteClick(TObject* Sender);
  91.     void __fastcall MoveClick(TObject* Sender);
  92.     void __fastcall SpeedbarPaint(TObject* Sender);
  93.     void __fastcall FormDestroy(TObject* Sender);
  94.     void __fastcall MenuListClick(TObject* Sender);
  95.     void __fastcall DrawMenuItem(TWinControl* Control,
  96.                                      Integer Index,
  97.                                      const TRect &Rect,
  98.                                      TOwnerDrawState State);
  99.     void __fastcall InsertClick(TObject* Sender);
  100.     void __fastcall SpaceClick(TObject* Sender);
  101.     void __fastcall SpeedMouseDown(TObject* Sender,
  102.                                        TMouseButton Button,
  103.                                        TShiftState Shift,
  104.                                        Integer X, Integer Y);
  105.     void __fastcall RemoveClick(TObject* Sender);
  106.     void __fastcall BrowseClick(TObject* Sender);
  107.     void __fastcall SamplePaint(TObject* Sender);
  108.     void __fastcall MenuClicked(TObject* Sender);
  109.  
  110. private:
  111.     TList* SpeedList;
  112.     TList* ButtonList;
  113.     int FSpeedIndex;
  114.     Graphics::TBitmap* SpeedPointer;
  115.     Graphics::TBitmap* Offscreen;
  116.     Graphics::TBitmap* SampleBmp;
  117.     void __fastcall RefreshButtons(void);
  118.     int __fastcall NextPage(TMoveDirection Direction);
  119.     TRect __fastcall SpeedButtonRect(int Index);
  120.     int __fastcall SpeedButtonAtPos(const tagPOINT &Pos);
  121.     int __fastcall GetSpeedButtonCount(void);
  122.     int __fastcall GetSpeedButtonID(int Value);
  123.     bool __fastcall ValidateInfo(void);
  124.  
  125. public:
  126.     bool __fastcall HasMenus(void);
  127.     __property int SpeedButtonCount = {read=GetSpeedButtonCount, nodefault};
  128.     __property int SpeedButtonID[int Value] = {read=GetSpeedButtonID};
  129.     __fastcall virtual TAppExpert(TComponent* AOwner);
  130.     __fastcall TAppExpert(TComponent* AOwner, int Dummy) : TForm(AOwner, Dummy) { }
  131.     __fastcall virtual ~TAppExpert(void) { }
  132.     __fastcall TAppExpert(HWND ParentWindow) : TForm(ParentWindow) { }
  133. };
  134.  
  135. //-- var, const, procedure ---------------------------------------------------
  136. extern TAppExpert* AppExpert;
  137. extern void __fastcall ApplicationExpert(TIToolServices* ToolServices);
  138. //-- end unit ----------------------------------------------------------------
  139.  
  140. void __fastcall ApplicationExpert(TIToolServices* ToolServices);
  141.  
  142. //  page numbers
  143. extern int pgMenus;
  144. extern int pgExtensions;
  145. extern int pgSpeedbar;
  146. extern int pgAppInfo;
  147.  
  148. extern int FirstPage;
  149. extern int LastPage;
  150.  
  151. extern TPoint *DefaultButtonSize;
  152. extern int    DefaultButtonSpace;
  153. extern int    MenuItemCount;
  154.  
  155. enum TMainItems { mmFile, mmEdit, mmWindow, mmHelp };
  156.  
  157. extern int  MenuItemCounts[4];
  158. extern int  MenuItemOffsets[4];
  159. extern char *SampleBitmaps[4];
  160.  
  161. /////////////////////////////////////////// TButtonImage ////////
  162. // TButtonImage - draws the image of a TSpeedButton
  163. class TButtonImage: public TObject {
  164.   private:
  165.     long FBitmapID;
  166.     Graphics::TBitmap *bmFBitmap;
  167.     int FNumGlyphs;
  168.     void __fastcall SetBitmapID(long Value);
  169.   public:
  170.     __fastcall TButtonImage(void);
  171.     __fastcall ~TButtonImage(void);
  172.     void __fastcall Draw(TCanvas *Canvas, int X, int Y);
  173.     __property long BitmapID = {read=FBitmapID, write=SetBitmapID};
  174.     __property int NumGlyphs = {read=FNumGlyphs, write=FNumGlyphs};
  175. };
  176.  
  177. // Code generation support
  178. enum TCodeSnipet {csProgram, csMainIntf, csHdr1, csHdr2, csMainImpl,
  179.                   csFormCreateProc, csShowHelpProc, csFileNewProc,
  180.                   csFileOpenProc, csFileSaveProc, csFileSaveAsProc,
  181.                   csFilePrintProc, csFilePrintSetupProc,
  182.                   csFileExitProc, csEditUndoProc, csEditCutProc,
  183.                   csEditCopyProc, csEditPasteProc, csWindowTileProc,
  184.                   csWindowCascadeProc, csWindowArrangeProc,
  185.                   csHelpContentsProc, csHelpSearchProc,
  186.                   csHelpHowToUseProc, csHelpAboutProc, csForm,
  187.                   csFormMenu, csCreateMethod, csFormMDI, csHints,
  188.                   csMenuObject, csFileMenuObject, csEditMenuObject,
  189.                   csWindowMenuObject, csHelpMenuObject,
  190.                   csOpenDialogObject,csSaveDialogObject,
  191.                   csPrintDialogObject,csPrintSetupDialogObject,
  192.                   csStatusLineObject, csSpeedbarObject,
  193.                   csSpeedButtonObject, csLastObject};
  194.  
  195. extern int     SourceBufferSize;
  196. //extern char    *cCodeSnipets[csLastObject-1];
  197. extern THandle *hCodeResource;
  198. extern char    *cSourceBuffer;
  199. extern char    *cResourceBuffer;
  200.  
  201. // Function prototypes
  202. void __fastcall InitCodeGeneration(void);
  203. void __fastcall DoneCodeGeneration(void);
  204. void __fastcall BinToHex(unsigned char *Binary, unsigned char *Text, int Count);
  205. void __fastcall WriteBinaryAsText(TStream *Input, TStream *Output) ;
  206. void _fastcall FmtWrite(TStream *Stream, char *Fmt,
  207.                         const TVarRec *Args, const int Args_Size);
  208. void __fastcall WriteSnipet(TStream *Stream, TCodeSnipet Snipet) ;
  209. void __fastcall WriteIdent(TStream *Stream, long ResID, const String VarType) ;
  210. void __fastcall WriteMenuItems(TStream *Stream, TMainItems MenuIndex) ;
  211. void __fastcall WriteMethodDecl(TStream *Stream, long ResID);
  212. void __fastcall WriteMethodHeader(TStream *Stream, long ResID) ;
  213. void __fastcall WriteMenuMethodDecls(TStream *Stream, TMainItems MenuIndex) ;
  214. void __fastcall WriteMenuMethods(TStream *Stream, TMainItems MenuIndex);
  215. void __fastcall WriteGlyphData(TStream *Stream, long BitmapID);
  216. TFileName* __fastcall GenerateProjectSource(TAppExpert *AppExpert);
  217. void __fastcall GenerateHdrSourceFile(TAppExpert *AppExpert);
  218. void __fastcall GenerateMainSourceFile(TAppExpert *AppExpert);
  219. void __fastcall GenerateMainFormFile(TAppExpert *AppExpert);
  220. bool __fastcall EditFilterInfo(String *Filter);
  221. void __fastcall RemoveItems(TList &List, TMainItems MenuIndex);
  222. #endif    // App
  223.