home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / CFGED1B.ZIP / CFGEDSRC.ZIP / CFGED.CC < prev    next >
C/C++ Source or Header  |  1992-08-09  |  3KB  |  87 lines

  1. // this might look like 'C', but it's really  -*-c++-*-
  2. /* cfged.cc
  3.  *
  4.  * Implementation of class MyWindow and main function for CFGED
  5.  *
  6.  * Language        : C++
  7.  * Operating System: OS/2 V2.0 and higher
  8.  * Compiler        : GNU GCC V2.1 and higher
  9.  *
  10.  *
  11.  * $Id: cfged.cc,v 1.3 1992/08/09 21:55:19 gruen Exp $
  12.  * $Log: cfged.cc,v $
  13. // Revision 1.3  1992/08/09  21:55:19  gruen
  14. // beta release 1.0 of cfged. Changed the architecture: now using a dialog
  15. // box as main window. As an result the accelerators now work. As goodie
  16. // there is a new special-browser for HELP and last but not least the
  17. // warning at the end of the program occures only if there not saved
  18. // changes to the configuration.
  19. //
  20. // Revision 1.2  1992/07/21  00:36:52  gruen
  21. // changed main function
  22. //
  23. // Revision 1.1  1992/07/17  00:23:27  gruen
  24. // Initial revision
  25. //
  26.  *
  27.  * Copyright (c) 1992 Lutz Grueneberg
  28.  *
  29.  * This library is free software; you can redistribute it and/or modify
  30.  * it under the terms of the GNU Library General Public License as
  31.  * published by the Free Software Foundation; either version 2 of the
  32.  * License, or (at your option) any later version.  This library is
  33.  * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
  34.  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  35.  * A PARTICULAR PURPOSE.  See the GNU Library General Public License for
  36.  * more details. You should have received a copy of the GNU Library
  37.  * General Public License along with this library; if not, write to the
  38.  * Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  39.  */
  40. #define INCL_WIN
  41. #include <os2.h>
  42. #include <Regx.h>
  43. #include <Strng.h>
  44. #include <pmviews/session.h>
  45. #include <pmviews/window.h>
  46. #include <pmviews/dialog.h>
  47. #include <pmviews/controls.h>
  48.  
  49. #include "pmctool.h"
  50. #include "cfged.h"
  51. #include "maindlg.h"
  52. #include "cfgfile.h"
  53. #include "lbmain.h"
  54. #include "about.h"
  55.  
  56. MainBrowserDlg    *pMainBrowser;
  57.  
  58.  
  59. int     main (int       argc,
  60.               char *    argv[])
  61. {
  62.   Session  *ms = new Session;
  63.  
  64.   pMainBrowser = new MainBrowserDlg( HWND_DESKTOP, MAIN_BROWSER);
  65.   pMainBrowser->load();
  66.   // This stuff will be hidden in further Versions of PMviews
  67.   // load the menu
  68.   HWND hwndMenu = WinLoadMenu( pMainBrowser->queryHwnd(), 
  69.                    NULLHANDLE, IDM_MAIN);
  70.   WinPostMsg( pMainBrowser->queryHwnd(), 
  71.           WM_UPDATEFRAME, NULL, NULL);
  72.   // load the icon
  73.   HPOINTER hptr = WinLoadPointer( HWND_DESKTOP, NULLHANDLE, IDP_MAIN);
  74.   WinPostMsg( pMainBrowser->queryHwnd(), WM_SETICON, hptr, NULL);
  75.   // load the accelerator table for the dialog
  76.   HACCEL haccel = WinLoadAccelTable( ms->queryAnchorBlock(),
  77.                      NULLHANDLE, IDA_MAIN);
  78.   WinSetAccelTable( ms->queryAnchorBlock(), 
  79.             haccel, pMainBrowser->queryHwnd());
  80.   // end of special stuff
  81.   ms->run();
  82.   WinDestroyWindow( pMainBrowser->queryHwnd());
  83.   //pSW->destroy();
  84.   delete ms;
  85. }
  86.  
  87.