home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ool.zip / OOL / samples / sample1 / sample1.h < prev    next >
Text File  |  1996-11-05  |  2KB  |  61 lines

  1. /* sample1 i a simple text-editor which uses the sytem-multiline-entryfield */
  2. /* to edit the text.                                                        */
  3. /* sample1 shows you how to                                                 */
  4. /* - create multithraeded programms                                         */
  5. /* - use menubars                                                           */
  6. /* - use the xfile-class                                                    */
  7. /* - accept drag-events                                                     */
  8. /* - use the system defined filedialog                                      */
  9.  
  10. #include "resource.h"      //include definitionf for resources
  11.  
  12. #define MY_MLE     300     //id for the mle-control
  13.  
  14. #include "xheaders.h"       //include default header-file
  15.  
  16. #include XApplication_i    //include headers
  17. #include XFrameWindow_i
  18. #include XResourceLibrary_i
  19. #include XMenuBar_i
  20. #include XMultiLineEdit_i
  21. #include XRect_i
  22. #include XResource_i
  23. #include XControlEvent_i
  24. #include XThread_i
  25. #include XString_i
  26.  
  27.  
  28. /* the derived framewindow */
  29. class MyAppWindow: public XFrameWindow
  30. {
  31.       friend class MyMLE;
  32.       friend class SearchDialog;
  33.    public:
  34.       MyAppWindow( XResourceLibrary * res, XResource * r );
  35.       ~MyAppWindow();
  36.       BOOL DoCommand( LONG );                //overridden
  37.       BOOL QueryForClose ( void );           //overriden
  38.       BOOL LoadFile( char*);
  39.       BOOL SaveFile(void);
  40.    private:
  41.       XMenuBar * menu;
  42.       XMultiLineEdit * mle;
  43.       BOOL saved;
  44.       BOOL loaded;
  45.       XString path;
  46.       SearchDialog * dlg;
  47.       BOOL loading;
  48. };
  49.  
  50.  
  51. class MyThread: public XThread
  52. {
  53.    public:
  54.       void Init( void );                    //overridden
  55.       MyThread ( char * iniFile = NULL);
  56.       XResourceLibrary * resLib;
  57.    private:
  58.       XString iniFile;
  59.       MyAppWindow * appWindow;
  60. };
  61.