/**************************************************************************

    This file is part of notepad95, a text editor for fvwm95.
    Copyright (C) 1997, Harald Radke.                   

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

**************************************************************************/

#include <stdlib.h> 
#include <stdio.h>

#include <xclass/OXClient.h>
#include <xclass/OXWindow.h>
#include <xclass/OXFrame.h>
#include <xclass/OXWidgets.h>
#include <xclass/OXMsgBox.h>
#include <xclass/OString.h>
#include "OXTextEdit.h"

#define M_FILE_NEW         1
#define M_FILE_OPEN        2
#define M_FILE_SAVE        3
#define M_FILE_SAVEAS      4
#define M_FILE_PRINT       5
#define M_FILE_EXIT        6

#define M_EDIT_UNDO        7
#define M_EDIT_CUT         8
#define M_EDIT_COPY        9
#define M_EDIT_PASTE       10
#define M_EDIT_DELETE      11
#define M_EDIT_SELECTALL   12
#define M_EDIT_LINEBREAK   13

#define M_SEARCH_SEARCH    14
#define M_SEARCH_AGAIN     15
#define M_SEARCH_GOTO      16

#define M_HELP_CONTENTS   17
#define M_HELP_ABOUT      18


//---------------------------------------------------------------------

class OXAppMainFrame : public OXMainFrame {
public:
  OXAppMainFrame(const OXWindow *p, int w, int h);
  virtual ~OXAppMainFrame();

  void Clear();
  void Search(int ret);
  void Goto();
  void LoadFile(char *filename);
  void SaveFile(char *filename);
  void Print();
  void SaveFileAs();
  int IsSaved();
  virtual int ProcessMessage(long msg, long parm1, long parm2);
  virtual int HandleFocusChange(XFocusChangeEvent *event);
  virtual int HandleClientMessage(XClientMessageEvent *event);
  virtual int HandleTimer(OTimer *t);
protected:
  char *filename;
  char *printer, *printProg;
  OTimer *timer;
  OXLabel *_lstatus;
  OXCompositeFrame *_status;
  OXTextEdit *_te;
  OLayoutHints *_menuBarLayout, *_menuBarItemLayout;

  OXMenuBar *_menuBar;
  OXPopupMenu *_menuFile, *_menuEdit, *_menuSearch, *_menuHelp;
};

