//
// Copyright (C) 1999-2004 Toshikaz Hirabayashi
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// TOSHIKAZ HIRABAYASHI BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
// OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
// Except as contained in this notice, the name of Toshikaz Hirabayashi shall
// not be used in advertising or otherwise to promote the sale, use or other
// dealings in this Software without prior written authorization from
// Toshikaz Hirabayashi.

#ifndef WSDXFONTSELECT_H
#define WSDXFONTSELECT_H
#include <WScom.h>
#include <WSDappDev.h>
#include <WSCbaseDialog.h>

class WSCform;
class WSCvbtn;
class WSCvlabel;
class WSCoption;

class WSDxfontSelect :public WSCbaseDialog {
  private:
  char*    _font_name;
  void*    _rep;
  unsigned _font_no:4;
  protected:

  WSMFpropertyDef(WSNfontName,char*,_font_name);
//  WSMFpropertyDef(WSNreplyHandler,void*,_rep);
  WSMFpropertyDef(WSNfont,WSCuchar,_font_no);

  WSCvlabel* lb004;
  WSCoption* opt000;
  WSCoption* opt001;
  WSCoption* opt002;
  WSCoption* opt003;
  WSCoption* opt004;
  WSCoption* opt005;
  WSCoption* opt006;
  WSCform* xfonarea001;
  WSCvlabel* xfonvtex014;
  WSCvlabel* xfonvtex017;

  virtual void onResize(WSCrect*);

  public:

  virtual long initialize();

//  static void xfdEnd(WSCbase*);
//  static void xfdSet(WSCbase*);
  static void xfdVch(WSCbase*);

  long       _size;
  WSCstring _ev;
  WSCstring _kv;
  WSCstring _gv;
  WSCstring _ec;
  WSCstring _kc;
  WSCstring _gc;

  WSCstring _fmly;
  WSCstring _wght;
  WSCstring _slant;


  WSClistData _size_list;
  WSClistData _ev_name_list;
  WSClistData _ec_name_list;
  WSClistData _kv_name_list;
  WSClistData _kc_name_list;
  WSClistData _gv_name_list;
  WSClistData _gc_name_list;

  WSClistData _fmly_name_list;
  WSClistData _wght_name_list;
  WSClistData _slant_name_list;

  void updateList();
  virtual void onActivate();
  virtual void onVisibleChange(WSCbool);

 void _add_name(char*,WSClistData*);
 void addEvName(char*);
 void addKvName(char*);
 void addGvName(char*);
 void addEcName(char*);
 void addKcName(char*);
 void addGcName(char*);

 void addFmlyName(char*);
 void addWghtName(char*);
 void addSlantName(char*);

 public:
   WSDxfontSelect(WSCbase* base,char* name);
   virtual ~WSDxfontSelect();
   virtual long execEventProc(long ev,void*);
   WSMFguiClassDef(WSDxfontSelect,WSCwindow);
};
#endif
