home *** CD-ROM | disk | FTP | other *** search
/ Compressed Image File Formats / CompressedImageFileFormatsJohnMiano.iso / pc / Library / BCBViewer / Main.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-02-09  |  4.6 KB  |  138 lines

  1. //----------------------------------------------------------------------------
  2. #ifndef MainH
  3. #define MainH
  4. //
  5. // Copyright (c) 1998 Colosseum Builders, Inc.
  6. // All rights reserved.
  7. //
  8. // Colosseum Builders, Inc. makes no warranty, expressed or implied
  9. // with regards to this software. It is provided as is.
  10. //
  11. // Permission to use, redistribute, and copy this file is granted
  12. // without a fee so long as as the following conditions are adhered to:
  13. //
  14. // o The user assumes all risk for using this software. The authors of this
  15. //   software shall be liable for no damages of any kind.
  16. //
  17. // o If the source code is distributed then this copyright notice must
  18. //   remain unaltered and any modification must be noted.
  19. //
  20. // o If this code is shipped in binary format the accompanying documentation
  21. //   should state that "this software is based, in part, on the work of
  22. //   Colosseum Builders, Inc."
  23. //
  24.  
  25. //
  26. //  Title:  Sample Image Viewer/Format Conversion Application
  27. //
  28. //  Author:  John M. Miano miano@colosseumbuilders.com
  29. //
  30. //----------------------------------------------------------------------------
  31. #include "ChildWin.h"
  32. #include <ComCtrls.hpp>
  33. #include <ExtCtrls.hpp>
  34. #include <Messages.hpp>
  35. #include <Buttons.hpp>
  36. #include <Dialogs.hpp>
  37. #include <StdCtrls.hpp>
  38. #include <Menus.hpp>
  39. #include <Controls.hpp>
  40. #include <Forms.hpp>
  41. #include <Graphics.hpp>
  42. #include <Classes.hpp>
  43. #include <SysUtils.hpp>
  44. #include <Windows.hpp>
  45. #include <System.hpp>
  46. #include <ToolWin.hpp>
  47. #include <ExtDlgs.hpp>
  48.  
  49. #include "jpegenco.h"
  50. #include "bmpencod.h"
  51. #include "pngencod.h"
  52. //----------------------------------------------------------------------------
  53. class TMainForm : public TForm
  54. {
  55. __published:
  56.     TMainMenu *MainMenu1;
  57.     TMenuItem *File1;
  58.     TMenuItem *FileOpenItem;
  59.     TMenuItem *FileCloseItem;
  60.     TMenuItem *Window1;
  61.     TMenuItem *Help1;
  62.     TMenuItem *N1;
  63.     TMenuItem *FileExitItem;
  64.     TMenuItem *WindowCascadeItem;
  65.     TMenuItem *WindowTileItem;
  66.     TMenuItem *WindowArrangeItem;
  67.     TMenuItem *HelpAboutItem;
  68.     TOpenDialog *OpenDialog;
  69.     TMenuItem *FileSaveAsItem;
  70.     TMenuItem *Edit1;
  71.     TMenuItem *CopyItem;
  72.     TMenuItem *PasteItem;
  73.     TMenuItem *WindowMinimizeItem;
  74.     TStatusBar *StatusBar;
  75.     TProgressBar *ProgressBar;
  76.   TSpeedButton *OpenBtn;
  77.   TSpeedButton *SaveBtn;
  78.   TSpeedButton *CopyBtn;
  79.   TSpeedButton *PasteBtn;
  80.   TSpeedButton *ExitBtn;
  81.   TPanel *Panel;
  82.   TMenuItem *Options1;
  83.   TMenuItem *ShowProgressive1;
  84.   TMenuItem *N2;
  85.   TMenuItem *GammaItem;
  86.   TMenuItem *GrayscaleItem;
  87.   TMenuItem *JPEGOptionsItem;
  88.   TSaveDialog *SaveDialog;
  89.   TMenuItem *PNGOptions1;
  90.     void __fastcall FormCreate(TObject *Sender);
  91.     void __fastcall FileNewItemClick(TObject *Sender);
  92.     void __fastcall WindowCascadeItemClick(TObject *Sender);
  93.     void __fastcall UpdateMenuItems(TObject *Sender);
  94.     void __fastcall WindowTileItemClick(TObject *Sender);
  95.     void __fastcall WindowArrangeItemClick(TObject *Sender);
  96.     void __fastcall FileCloseItemClick(TObject *Sender);
  97.     void __fastcall FileOpenItemClick(TObject *Sender);
  98.     void __fastcall FileExitItemClick(TObject *Sender);
  99.     void __fastcall FileSaveItemClick(TObject *Sender);
  100.     void __fastcall FileSaveAsItemClick(TObject *Sender);
  101.     void __fastcall CutItemClick(TObject *Sender);
  102.     void __fastcall CopyItemClick(TObject *Sender);
  103.     void __fastcall PasteItemClick(TObject *Sender);
  104.     void __fastcall WindowMinimizeItemClick(TObject *Sender);
  105.     void __fastcall FormDestroy(TObject *Sender);
  106.  
  107.     void __fastcall HelpAboutItemClick(TObject *Sender);
  108.   void __fastcall Options1Click(TObject *Sender);
  109.   void __fastcall ShowProgressive1Click(TObject *Sender);
  110.   void __fastcall GammaItemClick(TObject *Sender);
  111.   void __fastcall GrayscaleItemClick(TObject *Sender);
  112.   void __fastcall JPEGOptionsItemClick(TObject *Sender);
  113.   void __fastcall PNGOptions1Click(TObject *Sender);
  114.   
  115.   
  116. private:
  117.   bool show_progressive ;
  118.   JpegEncoder jpeg_encoder ;
  119.   PngEncoder png_encoder ;
  120.   BmpEncoder bmp_encoder ;
  121.     void __fastcall CreateMDIChild(const String Name);
  122.     void __fastcall ShowHint(TObject *Sender);
  123.   void __fastcall WMDropFiles (TMessage &msg) ;
  124. BEGIN_MESSAGE_MAP
  125. MESSAGE_HANDLER(WM_DROPFILES,TMessage,WMDropFiles)
  126. END_MESSAGE_MAP(TForm)
  127. public:
  128.   void ShowProgressBar () ;
  129.     virtual __fastcall TMainForm(TComponent *Owner);
  130.   __property bool ShowProgressive = { read=show_progressive,
  131.                                          write=show_progressive } ;
  132. };
  133. //----------------------------------------------------------------------------
  134. extern TMainForm *MainForm;
  135. extern TMDIChild *__fastcall MDIChildCreate(void);
  136. //----------------------------------------------------------------------------
  137. #endif
  138.