/*********************************************************************
 *
 *            EZFM---EZWGL based file manager for X11
 *
 *             Copyright (C) 1998  Maorong Zou
 *
 *
 *  This file is part of EZFM.
 *
 *  EZFM 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, or (at your option)
 * any later version.
 *
 * EZFM 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 EZFM; see the file COPYING.  If not, write to
 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
 *
 *************************************************************************/



#define _MBTN_HELP_C_
#include "ezfm.h"

/**********************************************************************************/
void setupMBtnHelp      MY_ANSIARGS((void *btn, void *data));

/**********************************************************************************/
static void aboutEZFM        MY_ANSIARGS((void *widget, void *data));
static void bubbleHelpOnOff  MY_ANSIARGS((void *widget, void *data));
/**********************************************************************************
 *
 * setup MenuButton 'Help'
 */
void setupMBtnHelp(mbar, data)
     EZ_Widget *mbar; void *data;
{
  Toplevel  *toplevel = (Toplevel *)data;
  EZ_Widget *menu, *tmp;
  
  menu =     EZ_CreateWidgetXrm(EZ_WIDGET_MENU,      NULL,
				"HelpMenu", "helpMenu",
				NULL);
  tmp  =     EZ_CreateWidget(EZ_WIDGET_MENU_CHECK_BUTTON,  menu,
			     EZ_LABEL_STRING,              "Bubble Help",
			     EZ_UNDERLINE,                  0,
			     EZ_CHECK_BUTTON_ON_VALUE,      1,
			     EZ_CHECK_BUTTON_OFF_VALUE,     0,
			     EZ_CHECK_BUTTON_ON_OFF,        1,
			     EZ_CALLBACK,                   bubbleHelpOnOff, NULL,
			     NULL);
  tmp  =     EZ_CreateWidget(EZ_WIDGET_MENU_SEPARATOR,      menu,
			     NULL);

  tmp =     EZ_CreateWidget(EZ_WIDGET_MENU_NORMAL_BUTTON,   menu,
			    EZ_LABEL_STRING,                "About ... ",
			    EZ_CALLBACK,                    aboutEZFM, NULL,
			    NULL);


  EZ_MenuBarAddItemAndMenu(mbar, "Help", 0, menu);
}
/******************************************************************************/
static void bubbleHelpOnOff(widget, data)
     EZ_Widget *widget; void *data;
{
  int jnk, state = EZ_GetCheckButtonState(widget, &jnk);

  if(state > 0) EZ_EnableBubbleHelp();
  else EZ_DisableBubbleHelp();
}
/******************************************************************************/
#include "aboutEZFM.h"

static void clsCb(widget, data) EZ_Widget *widget; void *data;
{ EZ_DestroyWidget((EZ_Widget *)data); }

static void aboutEZFM(widget, data)
     EZ_Widget *widget; void *data;
{
  EZ_Widget *frame, *label, *btn;

  frame = EZ_CreateWidget(EZ_WIDGET_FRAME, NULL,
			  EZ_FILL_MODE,    EZ_FILL_BOTH,
			  EZ_ORIENTATION,  EZ_VERTICAL,
			  /* EZ_SIZE,         600, 400,*/
			  EZ_BG_PIXMAP,          bigPixmap, 
			  EZ_EVENT_HANDLER,      ConfigureNotifyHandler, NULL,
                          EZ_TRANSIENT,     1,
			  0);
  label = EZ_CreateWidget(EZ_WIDGET_LABEL, frame,
                          EZ_LABEL_STRING, EZFMVERSIONSTRING,
                          EZ_FONT_NAME,   "-adobe-helvetica-bold-r-normal-*-*-240-*-*-*-*-*-*",
                          EZ_FOREGROUND,  "red",
                          EZ_LABEL_SHADOW, 1,1,
                          EZ_HEIGHT, 0,
                          0);
  label = EZ_CreateWidget(EZ_WIDGET_LABEL, frame,
                          EZ_LABEL_STRING, ezfmInfoString,
                          EZ_FONT_NAME,   "-adobe-helvetica-bold-r-normal-*-*-180-*-*-*-*-*-*",
                          EZ_FOREGROUND,  "blue",
                          EZ_LABEL_SHADOW, 1,1,
                          EZ_TEXT_LINE_LENGTH, 80,
                          EZ_HEIGHT, 0,
                          0);
  
  btn =   EZ_CreateWidget(EZ_WIDGET_NORMAL_BUTTON, frame,
			  EZ_LABEL_STRING,         "close",
			  EZ_UNDERLINE,            0,
			  EZ_CALLBACK,             clsCb, frame,
			  EZ_SIZE,                 0, 0,
			  0);
  EZ_DisplayWidget(frame);
}
/******************************************************************************/
#define _MBTN_HELP_C_





