//
// 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 WSCCLASSUTRGEDITOR_H
#define WSCCLASSUTRGEDITOR_H

#include <WScom.h>
#include <WSCbaseDialog.h>

//class WSCscrForm;
class WSCvbtn;
class WSCform;
class WSCvlabel;
class WSCoption;
class WSCvifield;
class WSCcolorSelect;
class WSCmessageDialog;
//class WSCdialogBase;
class WSCfileSelect;
//class WSCvtoggle;
class WSClist;
class WSCpopupMenu;

class WSCclassUTrgEditor   :public WSCbaseDialog{

  private:
     void* _voidp_client;
  protected:

     WSCbase*     _client;
     WSClist*     _list;
     WSCvbtn*     _end_btn;
     WSCform*     _cmd_area1;
//     WSCform*     _area1;
     WSCvlabel*    _tlbs4;
     WSCvlabel*   _oname;
     WSCmessageDialog* _msg;
     WSCbaseDialog*  _dialog1;
     WSCvlabel*      _if1;
     WSCvifield*    _if2;
     WSCvifield*    _var_if;
     WSCoption*     _opt1;
//     WSCoption*     _opt2;
     WSCvifield*    _value_if;
//     WSCvtoggle*    _use_file;
     WSCstring      _src_path;
     WSCstring      _file_data;
     WSCstring      _file_name;
//     WSCvifield*    _bname_if;
//     WSCvifield*    _vsname_if;

     WSCform* _darea1;
//     WSCform* _darea2;
     WSCpopupMenu* _pmenu;

     WSMFpropertyDef( WSNclient,  void*,          _voidp_client ); 

static void _set_cbtn_work(WSCbase*);
static void _end_btn_work(WSCbase*);
static void _ibtn1_work(WSCbase*);
static void _ibtn2_work(WSCbase*);
static void _ibtn3_work(WSCbase*);
static void _dialog_set_work(WSCbase*);
//static void _op_delete_callback(long,void*);
static void _dialog1_resize_work(WSCbase*);
//static void _op_us_dummy();
//static void _op_cm_dummy(void*);
//static void _op_cb_dummy(WSCbase*);
//static void _op_rt_dummy(long,long*);
virtual void onValueChange();
virtual void onResize(WSCrect*);
    void _adjust();
  public:
    WSCclassUTrgEditor(WSCbase*,char*);
    virtual  long initialize();
//    virtual  long execEventProc(long,void*);

    void setEditClient(WSCbase*);
    WSCbase* getEditClient();
    virtual void onGuiPolicyChange(long);

    long getSelectedPropObj();

    void updateTriggers();
    void setSrcPath(char*);

    WSMFguiClassDef(WSCclassUTrgEditor,WSCbaseDialog);
};

#endif
