//
// 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 WSCCLASSRMETHODEDITOR_H
#define WSCCLASSRMETHODEDITOR_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 WSCclassRMethodEditor   :public WSCbaseDialog{

  private:
     void* _voidp_client;
  protected:

     WSCbase*     _client;
     WSClist*     _list;
     WSCvbtn*     _end_btn;
     WSCform*     _cmd_area1;
     WSCvlabel*    _tlbs4;
     WSCvlabel*   _oname;
     WSCmessageDialog* _msg;
     WSCbaseDialog*  _dialog1;
     WSCvlabel*      _if1;
     WSCvifield*    _if2;
     WSCoption*     _opt1;
     WSCoption*     _opt2;
     WSClist*     _plist;
     WSCvbtn*     _add_btn;
     WSCvbtn*     _del_btn;
     WSCvbtn*     _up_btn;
     WSCvbtn*     _down_btn;
     WSCvifield*    _pname_if;
     WSCvifield*    _cif1;
     WSCvifield*    _cif2;
     WSCvlabel*     _clb1;
     WSCvlabel*     _clb2;

     WSCform* _darea1;
     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 _dialog1_resize_work(WSCbase*);

static void _add_work(WSCbase*);
static void _del_work(WSCbase*);
static void _up_work(WSCbase*);
static void _down_work(WSCbase*);

virtual void onValueChange();
virtual void onResize(WSCrect*);
    void _adjust();
    WSCbool _check_param_name(char* pname);

  public:
    WSCclassRMethodEditor(WSCbase*,char*);
    virtual  long initialize();
//    virtual  long execEventProc(long,void*);

    void setEditClient(WSCbase*);
    WSCbase* getEditClient();
    virtual void onGuiPolicyChange(long);
    virtual void onVisibleChange(WSCbool);
    virtual void onActivate();


    long getSelectedPropObj();

    void updateProperties();
//    void setSrcPath(char*);

    WSMFguiClassDef(WSCclassRMethodEditor,WSCbaseDialog);
};

#endif
