source/QtCore/habstracttablemodelcls.prg: fixed

/*

  Qt4xHb - Bindings libraries for Harbour/xHarbour and Qt Framework 4

  Copyright (C) 2020 Marcos Antonio Gambeta <marcosgambeta AT outlook DOT com>

*/

#include "hbclass.ch"

REQUEST QMODELINDEX

CLASS HAbstractTableModel INHERIT QAbstractTableModel

   DATA self_destruction INIT .F.

   METHOD new
   METHOD delete

   METHOD setRowCountCB
   METHOD setColumnCountCB

   METHOD setDisplayRoleCB
   METHOD setDecorationRoleCB
   METHOD setEditRoleCB
   METHOD setToolTipRoleCB
   METHOD setStatusTipRoleCB
   METHOD setWhatsThisRoleCB
   METHOD setSizeHintRoleCB
   METHOD setFontRoleCB
   METHOD setTextAlignmentRoleCB
   METHOD setBackgroundRoleCB
   METHOD setForegroundRoleCB

   METHOD setHorizontalHeaderDisplayRoleCB
   METHOD setHorizontalHeaderDecorationRoleCB
   METHOD setHorizontalHeaderFontRoleCB
   METHOD setHorizontalHeaderTextAlignmentRoleCB
   METHOD setHorizontalHeaderBackgroundRoleCB
   METHOD setHorizontalHeaderForegroundRoleCB

   METHOD setVerticalHeaderDisplayRoleCB
   METHOD setVerticalHeaderDecorationRoleCB
   METHOD setVerticalHeaderFontRoleCB
   METHOD setVerticalHeaderTextAlignmentRoleCB
   METHOD setVerticalHeaderBackgroundRoleCB
   METHOD setVerticalHeaderForegroundRoleCB

   METHOD reloadData

   DESTRUCTOR destroyObject

END CLASS

METHOD destroyObject() CLASS HAbstractTableModel
   IF ::self_destruction
      ::delete()
   ENDIF
RETURN NIL

CLASS HDBFTableModel INHERIT HAbstractTableModel
END CLASS

CLASS HArrayTableModel INHERIT HAbstractTableModel
END CLASS

#pragma BEGINDUMP

#include <habstracttablemodel.h>

#include "qt4xhb_common.h"
#include "qt4xhb_macros.h"
#include "qt4xhb_utils.h"
#include "qt4xhb_events.h"
#include "qt4xhb_signals.h"

/*
HAbstractTableModel( QObject * parent = 0 )
*/
HB_FUNC( HABSTRACTTABLEMODEL_NEW )
{
  HAbstractTableModel * o = new HAbstractTableModel( OPQOBJECT(1,0) );
  Qt4xHb::returnNewObject( o, false );
}

/*
virtual ~HAbstractTableModel()
*/
HB_FUNC( HABSTRACTTABLEMODEL_DELETE )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
    Events_disconnect_all_events( obj, true );
    Signals_disconnect_all_signals( obj, true );
    delete obj;
    obj = NULL;
    PHB_ITEM self = hb_stackSelfItem();
    PHB_ITEM ptr = hb_itemPutPtr( NULL, NULL );
    hb_objSendMsg( self, "_pointer", 1, ptr );
    hb_itemRelease( ptr );
  }

  hb_itemReturn( hb_stackSelfItem() );
}

// linhas e colunas

/*
void setRowCountCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETROWCOUNTCB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setRowCountCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setColumnCountCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETCOLUMNCOUNTCB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setColumnCountCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

// clulas

/*
void setDisplayRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETDISPLAYROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setDisplayRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setDecorationRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETDECORATIONROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setDecorationRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setEditRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETEDITROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setEditRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setToolTipRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETTOOLTIPROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setToolTipRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setStatusTipRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETSTATUSTIPROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setStatusTipRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setWhatsThisRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETWHATSTHISROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setWhatsThisRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setSizeHintRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETSIZEHINTROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setSizeHintRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setFontRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETFONTROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setFontRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setTextAlignmentRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETTEXTALIGNMENTROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setTextAlignmentRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setBackgroundRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETBACKGROUNDROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setBackgroundRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setForegroundRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETFOREGROUNDROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setForegroundRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

// cabealho horizontal

/*
void setHorizontalHeaderDisplayRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETHORIZONTALHEADERDISPLAYROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setHorizontalHeaderDisplayRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setHorizontalHeaderDecorationRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETHORIZONTALHEADERDECORATIONROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setHorizontalHeaderDecorationRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setHorizontalHeaderFontRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETHORIZONTALHEADERFONTROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setHorizontalHeaderFontRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setHorizontalHeaderTextAlignmentRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETHORIZONTALHEADERTEXTALIGNMENTROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setHorizontalHeaderTextAlignmentRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setHorizontalHeaderBackgroundRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETHORIZONTALHEADERBACKGROUNDROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setHorizontalHeaderBackgroundRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setHorizontalHeaderForegroundRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETHORIZONTALHEADERFOREGROUNDROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setHorizontalHeaderForegroundRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

// cabealho vertical

/*
void setVerticalHeaderDisplayRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETVERTICALHEADERDISPLAYROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setVerticalHeaderDisplayRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setVerticalHeaderDecorationRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETVERTICALHEADERDECORATIONROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setVerticalHeaderDecorationRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setVerticalHeaderFontRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETVERTICALHEADERFONTROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setVerticalHeaderFontRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setVerticalHeaderTextAlignmentRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETVERTICALHEADERTEXTALIGNMENTROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setVerticalHeaderTextAlignmentRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setVerticalHeaderBackgroundRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETVERTICALHEADERBACKGROUNDROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setVerticalHeaderBackgroundRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setVerticalHeaderForegroundRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETVERTICALHEADERFOREGROUNDROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setVerticalHeaderForegroundRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
QVariant data( const QModelIndex & index, int role = Qt::DisplayRole ) const
*/

/*
QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const
*/

/*
int rowCount( const QModelIndex & parent = QModelIndex() ) const
*/

/*
int columnCount( const QModelIndex & parent = QModelIndex() ) const
*/

/*
void reloadData()
*/
HB_FUNC( HABSTRACTTABLEMODEL_RELOADDATA )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      obj->reloadData();
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

// /*
// QModelIndex createIndex ( int row, int column )
// */
// HB_FUNC( HABSTRACTTABLEMODEL_CREATEINDEX )
// {
//   HAbstractTableModel * obj = (HAbstractTableModel *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
//   if( obj )
//   {
//     QModelIndex * ptr = new QModelIndex( obj->createIndex ( hb_parni(1), hb_parni(2) ) );
//     _qt4xhb_createReturnClass ( ptr, "QMODELINDEX" );  }
// }

#pragma ENDDUMP

/*

  Qt4xHb - Bindings libraries for Harbour/xHarbour and Qt Framework 4

  Copyright (C) 2020 Marcos Antonio Gambeta <marcosgambeta AT outlook DOT com>

*/

#include "hbclass.ch"

REQUEST QMODELINDEX

CLASS HAbstractTableModel INHERIT QAbstractTableModel

   DATA self_destruction INIT .F.

   METHOD new
   METHOD delete

   METHOD setRowCountCB
   METHOD setColumnCountCB

   METHOD setDisplayRoleCB
   METHOD setDecorationRoleCB
   METHOD setEditRoleCB
   METHOD setToolTipRoleCB
   METHOD setStatusTipRoleCB
   METHOD setWhatsThisRoleCB
   METHOD setSizeHintRoleCB
   METHOD setFontRoleCB
   METHOD setTextAlignmentRoleCB
   METHOD setBackgroundRoleCB
   METHOD setForegroundRoleCB

   METHOD setHorizontalHeaderDisplayRoleCB
   METHOD setHorizontalHeaderDecorationRoleCB
   METHOD setHorizontalHeaderFontRoleCB
   METHOD setHorizontalHeaderTextAlignmentRoleCB
   METHOD setHorizontalHeaderBackgroundRoleCB
   METHOD setHorizontalHeaderForegroundRoleCB

   METHOD setVerticalHeaderDisplayRoleCB
   METHOD setVerticalHeaderDecorationRoleCB
   METHOD setVerticalHeaderFontRoleCB
   METHOD setVerticalHeaderTextAlignmentRoleCB
   METHOD setVerticalHeaderBackgroundRoleCB
   METHOD setVerticalHeaderForegroundRoleCB

   METHOD reloadData

   DESTRUCTOR destroyObject

END CLASS

METHOD destroyObject() CLASS HAbstractTableModel
   IF ::self_destruction
      ::delete()
   ENDIF
RETURN NIL

CLASS HDBFTableModel INHERIT HAbstractTableModel
END CLASS

CLASS HArrayTableModel INHERIT HAbstractTableModel
END CLASS

#pragma BEGINDUMP

#include <habstracttablemodel.h>

#include "qt4xhb_common.h"
#include "qt4xhb_macros.h"
#include "qt4xhb_utils.h"
#include "qt4xhb_events.h"
#include "qt4xhb_signals.h"

/*
HAbstractTableModel( QObject * parent = 0 )
*/
HB_FUNC( HABSTRACTTABLEMODEL_NEW )
{
  HAbstractTableModel * o = new HAbstractTableModel( OPQOBJECT(1,0) );
  Qt4xHb::returnNewObject( o, false );
}

/*
virtual ~HAbstractTableModel()
*/
HB_FUNC( HABSTRACTTABLEMODEL_DELETE )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
    Events_disconnect_all_events( obj, true );
    Signals_disconnect_all_signals( obj, true );
    delete obj;
    obj = NULL;
    PHB_ITEM self = hb_stackSelfItem();
    PHB_ITEM ptr = hb_itemPutPtr( NULL, NULL );
    hb_objSendMsg( self, "_pointer", 1, ptr );
    hb_itemRelease( ptr );
  }

  hb_itemReturn( hb_stackSelfItem() );
}

// linhas e colunas

/*
void setRowCountCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETROWCOUNTCB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setRowCountCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setColumnCountCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETCOLUMNCOUNTCB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setColumnCountCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

// clulas

/*
void setDisplayRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETDISPLAYROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setDisplayRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setDecorationRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETDECORATIONROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setDecorationRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setEditRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETEDITROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setEditRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setToolTipRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETTOOLTIPROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setToolTipRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setStatusTipRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETSTATUSTIPROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setStatusTipRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setWhatsThisRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETWHATSTHISROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setWhatsThisRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setSizeHintRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETSIZEHINTROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setSizeHintRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setFontRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETFONTROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setFontRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setTextAlignmentRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETTEXTALIGNMENTROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setTextAlignmentRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setBackgroundRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETBACKGROUNDROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setBackgroundRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setForegroundRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETFOREGROUNDROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setForegroundRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

// cabealho horizontal

/*
void setHorizontalHeaderDisplayRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETHORIZONTALHEADERDISPLAYROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setHorizontalHeaderDisplayRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setHorizontalHeaderDecorationRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETHORIZONTALHEADERDECORATIONROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setHorizontalHeaderDecorationRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setHorizontalHeaderFontRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETHORIZONTALHEADERFONTROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setHorizontalHeaderFontRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setHorizontalHeaderTextAlignmentRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETHORIZONTALHEADERTEXTALIGNMENTROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setHorizontalHeaderTextAlignmentRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setHorizontalHeaderBackgroundRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETHORIZONTALHEADERBACKGROUNDROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setHorizontalHeaderBackgroundRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setHorizontalHeaderForegroundRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETHORIZONTALHEADERFOREGROUNDROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setHorizontalHeaderForegroundRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

// cabealho vertical

/*
void setVerticalHeaderDisplayRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETVERTICALHEADERDISPLAYROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setVerticalHeaderDisplayRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setVerticalHeaderDecorationRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETVERTICALHEADERDECORATIONROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setVerticalHeaderDecorationRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setVerticalHeaderFontRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETVERTICALHEADERFONTROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setVerticalHeaderFontRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setVerticalHeaderTextAlignmentRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETVERTICALHEADERTEXTALIGNMENTROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setVerticalHeaderTextAlignmentRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setVerticalHeaderBackgroundRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETVERTICALHEADERBACKGROUNDROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setVerticalHeaderBackgroundRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setVerticalHeaderForegroundRoleCB( PHB_ITEM block )
*/
HB_FUNC( HABSTRACTTABLEMODEL_SETVERTICALHEADERFOREGROUNDROLECB )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->setVerticalHeaderForegroundRoleCB( hb_param( 1, HB_IT_BLOCK | HB_IT_SYMBOL ) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
QVariant data( const QModelIndex & index, int role = Qt::DisplayRole ) const
*/

/*
QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const
*/

/*
int rowCount( const QModelIndex & parent = QModelIndex() ) const
*/

/*
int columnCount( const QModelIndex & parent = QModelIndex() ) const
*/

/*
void reloadData()
*/
HB_FUNC( HABSTRACTTABLEMODEL_RELOADDATA )
{
  HAbstractTableModel * obj = (HAbstractTableModel *) Qt4xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) )
    {
#endif
      obj->reloadData();
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

// /*
// QModelIndex createIndex ( int row, int column )
// */
// HB_FUNC( HABSTRACTTABLEMODEL_CREATEINDEX )
// {
//   HAbstractTableModel * obj = (HAbstractTableModel *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
//   if( obj )
//   {
//     QModelIndex * ptr = new QModelIndex( obj->createIndex ( hb_parni(1), hb_parni(2) ) );
//     _qt4xhb_createReturnClass ( ptr, "QMODELINDEX" );  }
// }

#pragma ENDDUMP


QtUiTools: module updated

QtUiTools: module updated

Modified:
source/QtUiTools/QUiLoader.prg

/*

  Qt5xHb - Bindings libraries for Harbour/xHarbour and Qt Framework 5

  Copyright (C) 2018 Marcos Antonio Gambeta <marcosgambeta AT outlook DOT com>

*/

/*
  DO NOT EDIT THIS FILE - the content was created using a source code generator
*/

#include "hbclass.ch"

#ifndef QT5XHB_NO_REQUESTS
REQUEST QACTION
REQUEST QACTIONGROUP
REQUEST QLAYOUT
REQUEST QWIDGET
REQUEST QDIR
#endif

CLASS QUiLoader INHERIT QObject

   METHOD new
   METHOD delete
   METHOD addPluginPath
   METHOD availableLayouts
   METHOD availableWidgets
   METHOD clearPluginPaths
   METHOD createAction
   METHOD createActionGroup
   METHOD createLayout
   METHOD createWidget
   METHOD isLanguageChangeEnabled
   METHOD load
   METHOD pluginPaths
   METHOD setLanguageChangeEnabled
   METHOD setWorkingDirectory
   METHOD workingDirectory

   DESTRUCTOR destroyObject

END CLASS

PROCEDURE destroyObject () CLASS QUiLoader
   IF ::self_destruction
      ::delete()
   ENDIF
RETURN

#pragma BEGINDUMP

#include <Qt>

#ifndef __XHARBOUR__
#include <QUiLoader>
#endif

#include "qt5xhb_common.h"
#include "qt5xhb_macros.h"
#include "qt5xhb_utils.h"

#ifdef __XHARBOUR__
#include <QUiLoader>
#endif

#include <QStringList>
#include <QDir>
#include <QAction>
#include <QActionGroup>
#include <QLayout>

/*
QUiLoader ( QObject * parent = 0 )
*/
HB_FUNC_STATIC( QUILOADER_NEW )
{
  if( ISBETWEEN(0,1) && (ISQOBJECT(1)||ISNIL(1)) )
  {
    QUiLoader * o = new QUiLoader ( OPQOBJECT(1,0) );
    _qt5xhb_returnNewObject( o, false );
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

HB_FUNC_STATIC( QUILOADER_DELETE )
{
  QUiLoader * obj = (QUiLoader *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    delete obj;
    obj = NULL;
    PHB_ITEM self = hb_stackSelfItem();
    PHB_ITEM ptr = hb_itemPutPtr( NULL, NULL );
    hb_objSendMsg( self, "_pointer", 1, ptr );
    hb_itemRelease( ptr );
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void addPluginPath ( const QString & path )
*/
HB_FUNC_STATIC( QUILOADER_ADDPLUGINPATH )
{
  QUiLoader * obj = (QUiLoader *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(1) && ISCHAR(1) )
    {
      obj->addPluginPath ( PQSTRING(1) );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
QStringList availableLayouts () const
*/
HB_FUNC_STATIC( QUILOADER_AVAILABLELAYOUTS )
{
  QUiLoader * obj = (QUiLoader *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      RQSTRINGLIST( obj->availableLayouts () );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
}

/*
QStringList availableWidgets () const
*/
HB_FUNC_STATIC( QUILOADER_AVAILABLEWIDGETS )
{
  QUiLoader * obj = (QUiLoader *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      RQSTRINGLIST( obj->availableWidgets () );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
}

/*
void clearPluginPaths ()
*/
HB_FUNC_STATIC( QUILOADER_CLEARPLUGINPATHS )
{
  QUiLoader * obj = (QUiLoader *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      obj->clearPluginPaths ();
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
virtual QAction * createAction ( QObject * parent = 0, const QString & name = QString() )
*/
HB_FUNC_STATIC( QUILOADER_CREATEACTION )
{
  QUiLoader * obj = (QUiLoader *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISBETWEEN(0,2) && (ISQOBJECT(1)||ISNIL(1)) && ISOPTCHAR(2) )
    {
      QAction * ptr = obj->createAction ( OPQOBJECT(1,0), OPQSTRING(2,QString()) );
      _qt5xhb_createReturnQObjectClass ( ptr, "QACTION" );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
}

/*
virtual QActionGroup * createActionGroup ( QObject * parent = 0, const QString & name = QString() )
*/
HB_FUNC_STATIC( QUILOADER_CREATEACTIONGROUP )
{
  QUiLoader * obj = (QUiLoader *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISBETWEEN(0,2) && (ISQOBJECT(1)||ISNIL(1)) && ISOPTCHAR(2) )
    {
      QActionGroup * ptr = obj->createActionGroup ( OPQOBJECT(1,0), OPQSTRING(2,QString()) );
      _qt5xhb_createReturnQObjectClass ( ptr, "QACTIONGROUP" );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
}

/*
virtual QLayout * createLayout ( const QString & className, QObject * parent = 0, const QString & name = QString() )
*/
HB_FUNC_STATIC( QUILOADER_CREATELAYOUT )
{
  QUiLoader * obj = (QUiLoader *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISBETWEEN(1,3) && ISCHAR(1) && (ISQOBJECT(2)||ISNIL(2)) && ISOPTCHAR(3) )
    {
      QLayout * ptr = obj->createLayout ( PQSTRING(1), OPQOBJECT(2,0), OPQSTRING(3,QString()) );
      _qt5xhb_createReturnQObjectClass ( ptr, "QLAYOUT" );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
}

/*
virtual QWidget * createWidget ( const QString & className, QWidget * parent = 0, const QString & name = QString() )
*/
HB_FUNC_STATIC( QUILOADER_CREATEWIDGET )
{
  QUiLoader * obj = (QUiLoader *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISBETWEEN(1,3) && ISCHAR(1) && (ISQWIDGET(2)||ISNIL(2)) && ISOPTCHAR(3) )
    {
      QWidget * ptr = obj->createWidget ( PQSTRING(1), OPQWIDGET(2,0), OPQSTRING(3,QString()) );
      _qt5xhb_createReturnQWidgetClass ( ptr, "QWIDGET" );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
}

/*
bool isLanguageChangeEnabled () const
*/
HB_FUNC_STATIC( QUILOADER_ISLANGUAGECHANGEENABLED )
{
  QUiLoader * obj = (QUiLoader *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      RBOOL( obj->isLanguageChangeEnabled () );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
}

/*
QWidget * load ( QIODevice * device, QWidget * parentWidget = 0 )
*/
HB_FUNC_STATIC( QUILOADER_LOAD )
{
  QUiLoader * obj = (QUiLoader *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISBETWEEN(1,2) && ISQIODEVICE(1) && (ISQWIDGET(2)||ISNIL(2)) )
    {
      QWidget * ptr = obj->load ( PQIODEVICE(1), OPQWIDGET(2,0) );
      _qt5xhb_createReturnQWidgetClass ( ptr, "QWIDGET" );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
}

/*
QStringList pluginPaths () const
*/
HB_FUNC_STATIC( QUILOADER_PLUGINPATHS )
{
  QUiLoader * obj = (QUiLoader *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      RQSTRINGLIST( obj->pluginPaths () );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
}

/*
void setLanguageChangeEnabled ( bool enabled )
*/
HB_FUNC_STATIC( QUILOADER_SETLANGUAGECHANGEENABLED )
{
  QUiLoader * obj = (QUiLoader *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(1) && ISLOG(1) )
    {
      obj->setLanguageChangeEnabled ( PBOOL(1) );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setWorkingDirectory ( const QDir & dir )
*/
HB_FUNC_STATIC( QUILOADER_SETWORKINGDIRECTORY )
{
  QUiLoader * obj = (QUiLoader *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(1) && ISQDIR(1) )
    {
      obj->setWorkingDirectory ( *PQDIR(1) );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
QDir workingDirectory () const
*/
HB_FUNC_STATIC( QUILOADER_WORKINGDIRECTORY )
{
  QUiLoader * obj = (QUiLoader *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      QDir * ptr = new QDir( obj->workingDirectory () );
      _qt5xhb_createReturnClass ( ptr, "QDIR", true );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
}

#pragma ENDDUMP

/*

  Qt5xHb - Bindings libraries for Harbour/xHarbour and Qt Framework 5

  Copyright (C) 2018 Marcos Antonio Gambeta <marcosgambeta AT outlook DOT com>

*/

/*
  DO NOT EDIT THIS FILE - the content was created using a source code generator
*/

#include "hbclass.ch"

#ifndef QT5XHB_NO_REQUESTS
REQUEST QACTION
REQUEST QACTIONGROUP
REQUEST QLAYOUT
REQUEST QWIDGET
REQUEST QDIR
#endif

CLASS QUiLoader INHERIT QObject

   METHOD new
   METHOD delete
   METHOD addPluginPath
   METHOD availableLayouts
   METHOD availableWidgets
   METHOD clearPluginPaths
   METHOD createAction
   METHOD createActionGroup
   METHOD createLayout
   METHOD createWidget
   METHOD isLanguageChangeEnabled
   METHOD load
   METHOD pluginPaths
   METHOD setLanguageChangeEnabled
   METHOD setWorkingDirectory
   METHOD workingDirectory

   DESTRUCTOR destroyObject

END CLASS

PROCEDURE destroyObject () CLASS QUiLoader
   IF ::self_destruction
      ::delete()
   ENDIF
RETURN

#pragma BEGINDUMP

#include <Qt>

#ifndef __XHARBOUR__
#include <QUiLoader>
#endif

#include "qt5xhb_common.h"
#include "qt5xhb_macros.h"
#include "qt5xhb_utils.h"

#ifdef __XHARBOUR__
#include <QUiLoader>
#endif

#include <QStringList>
#include <QDir>
#include <QAction>
#include <QActionGroup>
#include <QLayout>

/*
QUiLoader ( QObject * parent = 0 )
*/
HB_FUNC_STATIC( QUILOADER_NEW )
{
  if( ISBETWEEN(0,1) && (ISQOBJECT(1)||ISNIL(1)) )
  {
    QUiLoader * o = new QUiLoader ( OPQOBJECT(1,0) );
    _qt5xhb_returnNewObject( o, false );
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

HB_FUNC_STATIC( QUILOADER_DELETE )
{
  QUiLoader * obj = (QUiLoader *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    delete obj;
    obj = NULL;
    PHB_ITEM self = hb_stackSelfItem();
    PHB_ITEM ptr = hb_itemPutPtr( NULL, NULL );
    hb_objSendMsg( self, "_pointer", 1, ptr );
    hb_itemRelease( ptr );
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void addPluginPath ( const QString & path )
*/
HB_FUNC_STATIC( QUILOADER_ADDPLUGINPATH )
{
  QUiLoader * obj = (QUiLoader *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(1) && ISCHAR(1) )
    {
      obj->addPluginPath ( PQSTRING(1) );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
QStringList availableLayouts () const
*/
HB_FUNC_STATIC( QUILOADER_AVAILABLELAYOUTS )
{
  QUiLoader * obj = (QUiLoader *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      RQSTRINGLIST( obj->availableLayouts () );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
}

/*
QStringList availableWidgets () const
*/
HB_FUNC_STATIC( QUILOADER_AVAILABLEWIDGETS )
{
  QUiLoader * obj = (QUiLoader *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      RQSTRINGLIST( obj->availableWidgets () );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
}

/*
void clearPluginPaths ()
*/
HB_FUNC_STATIC( QUILOADER_CLEARPLUGINPATHS )
{
  QUiLoader * obj = (QUiLoader *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      obj->clearPluginPaths ();
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
virtual QAction * createAction ( QObject * parent = 0, const QString & name = QString() )
*/
HB_FUNC_STATIC( QUILOADER_CREATEACTION )
{
  QUiLoader * obj = (QUiLoader *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISBETWEEN(1,2) && (ISQOBJECT(1)||ISNIL(1)) && ISOPTCHAR(2) )
    {
      QAction * ptr = obj->createAction ( OPQOBJECT(1,0), OPQSTRING(2,QString()) );
      _qt5xhb_createReturnQObjectClass ( ptr, "QACTION" );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
}

/*
virtual QActionGroup * createActionGroup ( QObject * parent = 0, const QString & name = QString() )
*/
HB_FUNC_STATIC( QUILOADER_CREATEACTIONGROUP )
{
  QUiLoader * obj = (QUiLoader *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISBETWEEN(1,2) && (ISQOBJECT(1)||ISNIL(1)) && ISOPTCHAR(2) )
    {
      QActionGroup * ptr = obj->createActionGroup ( OPQOBJECT(1,0), OPQSTRING(2,QString()) );
      _qt5xhb_createReturnQObjectClass ( ptr, "QACTIONGROUP" );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
}

/*
virtual QLayout * createLayout ( const QString & className, QObject * parent = 0, const QString & name = QString() )
*/
HB_FUNC_STATIC( QUILOADER_CREATELAYOUT )
{
  QUiLoader * obj = (QUiLoader *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISBETWEEN(2,3) && ISCHAR(1) && (ISQOBJECT(2)||ISNIL(2)) && ISOPTCHAR(3) )
    {
      QLayout * ptr = obj->createLayout ( PQSTRING(1), OPQOBJECT(2,0), OPQSTRING(3,QString()) );
      _qt5xhb_createReturnQObjectClass ( ptr, "QLAYOUT" );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
}

/*
virtual QWidget * createWidget ( const QString & className, QWidget * parent = 0, const QString & name = QString() )
*/
HB_FUNC_STATIC( QUILOADER_CREATEWIDGET )
{
  QUiLoader * obj = (QUiLoader *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISBETWEEN(2,3) && ISCHAR(1) && (ISQWIDGET(2)||ISNIL(2)) && ISOPTCHAR(3) )
    {
      QWidget * ptr = obj->createWidget ( PQSTRING(1), OPQWIDGET(2,0), OPQSTRING(3,QString()) );
      _qt5xhb_createReturnQWidgetClass ( ptr, "QWIDGET" );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
}

/*
bool isLanguageChangeEnabled () const
*/
HB_FUNC_STATIC( QUILOADER_ISLANGUAGECHANGEENABLED )
{
  QUiLoader * obj = (QUiLoader *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      RBOOL( obj->isLanguageChangeEnabled () );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
}

/*
QWidget * load ( QIODevice * device, QWidget * parentWidget = 0 )
*/
HB_FUNC_STATIC( QUILOADER_LOAD )
{
  QUiLoader * obj = (QUiLoader *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISBETWEEN(1,2) && ISQIODEVICE(1) && (ISQWIDGET(2)||ISNIL(2)) )
    {
      QWidget * ptr = obj->load ( PQIODEVICE(1), OPQWIDGET(2,0) );
      _qt5xhb_createReturnQWidgetClass ( ptr, "QWIDGET" );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
}

/*
QStringList pluginPaths () const
*/
HB_FUNC_STATIC( QUILOADER_PLUGINPATHS )
{
  QUiLoader * obj = (QUiLoader *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      RQSTRINGLIST( obj->pluginPaths () );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
}

/*
void setLanguageChangeEnabled ( bool enabled )
*/
HB_FUNC_STATIC( QUILOADER_SETLANGUAGECHANGEENABLED )
{
  QUiLoader * obj = (QUiLoader *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(1) && ISLOG(1) )
    {
      obj->setLanguageChangeEnabled ( PBOOL(1) );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setWorkingDirectory ( const QDir & dir )
*/
HB_FUNC_STATIC( QUILOADER_SETWORKINGDIRECTORY )
{
  QUiLoader * obj = (QUiLoader *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(1) && ISQDIR(1) )
    {
      obj->setWorkingDirectory ( *PQDIR(1) );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
QDir workingDirectory () const
*/
HB_FUNC_STATIC( QUILOADER_WORKINGDIRECTORY )
{
  QUiLoader * obj = (QUiLoader *) _qt5xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    if( ISNUMPAR(0) )
    {
      QDir * ptr = new QDir( obj->workingDirectory () );
      _qt5xhb_createReturnClass ( ptr, "QDIR", true );
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
  }
}

#pragma ENDDUMP


[TypedSDK] Strongly typed a FOREACH iteration variable to avoid a handled exception inside the late bound call in Send() (MenuItems is an array of OBJECTs)

USING System.Reflection
USING VOSDK := XSharp.VO.SDK
CLASS Menu INHERIT VObject
	PROTECT oWindow			as Window
	PROTECT oParent 		AS Menu
	PROTECT oMenu 			AS VOMenu
	PROTECT aChildren		AS ARRAY
	PROTECT iAutoPosition	AS INT
	PROTECT oAccelerator	AS Accelerator
	PROTECT oToolBar 		AS ToolBar
	PROTECT aItem 			AS ARRAY

	ACCESS __Menu as VOMenu
		RETURN oMenu

	ASSIGN __Owner(oWin as Window)
		oWindow := oWIn

	METHOD __GetParent() AS Menu
		LOCAL oMenu as Menu
		oMenu := SELF

		DO WHILE oMenu:oParent != NULL_OBJECT
			oMenu := oMenu:oParent
		ENDDO
		RETURN oMenu

	METHOD __CreateMenuItem(cCaption AS STRING, nId AS LONG) AS VOMenuItem
		LOCAL oItem AS VOMenuItem
		oItem := VOMenuItem{}
		IF STRING.IsNullOrEmpty(cCaption)
			oItem:Text := "-"
		ELSE
			oItem:Text	:= cCaption
		ENDIF
		oItem:ShowShortcut := FALSE
		oItem:MenuItemID   := nId
		oItem:Click  += OnItemClick
		oItem:Select += OnItemSelect
		oItem:Popup  += OnItemPopup
		RETURN oItem

	PROPERTY Accelerator AS Accelerator GET oAccelerator SET oAccelerator := Value

	ACCESS Items AS ARRAY
		RETURN aItem

	METHOD AddChild(oMenu as Menu) AS VOID
		aadd(aChildren, oMenu)
		RETURN

	METHOD AppendItem(nItemID , xNewItem )
		LOCAL cNewItem AS STRING
		LOCAL oSubMenu	AS Menu
		LOCAL oItem	    AS VOMenuItem
		LOCAL oHl		AS HyperLabel
		LOCAL aItems	AS VOMenuItem[]
		IF IsInstanceOfUsual(nItemID, #Menu)
			oSubMenu := nItemID
			oSubMenu:SetParent(SELF)
			SELF:AddChild(nItemID)
			cNewItem := xNewItem
			oItem := SELF:__CreateMenuItem(cNewItem, oSubMenu:GetHashCode())
			SELF:oMenu:MenuItems:Add(oItem)

			aItems := VOMenuItem[]{oSubMenu:__Menu:MenuItems:Count}
			oSubMenu:__Menu:MenuItems:CopyTo(aItems, 0)
			oItem:MenuItems:AddRange(aItems)

		ELSEIF IsNumeric(nItemID)
			IF nItemID == MENUSEPARATOR
				oItem := SELF:__CreateMenuItem("-", nItemID)
				SELF:oMenu:MenuItems:Add(oItem)
			ELSE
				IF IsInstanceOfUsual(xNewItem, #HyperLabel)
					oHl := xNewItem
					cNewItem := oHl:Caption
					oItem := SELF:__CreateMenuItem(cNewItem, nItemID)
					SELF:oMenu:MenuItems:Add(oItem)
					AAdd(aItem, {nItemID, oHl})
				ELSEIF IsString(xNewItem)
					oItem := SELF:__CreateMenuItem(cNewItem, nItemID)
					SELF:oMenu:MenuItems:Add(oItem)
				ELSEIF IsInstanceOfUsual(xNewItem, #Bitmap)
					// todo Menu Bitmaps
					//lRetVal := AppendMenu(hMenu, _OR(MF_BYCOMMAND, MF_BITMAP, MF_ENABLED), nItemID, xNewItem:Handle())
				ENDIF
			ENDIF
		ENDIF

		RETURN oItem != NULL_OBJECT

	METHOD CheckItem(nItemID )
		IF IsSymbol(nItemID)
			nItemID := SELF:GetMenuID((SYMBOL) nItemID)
		ENDIF
		LOCAL IMPLIED oItem := oMenu:GetItemByID(nItemID)
		IF oItem != NULL_OBJECT
			TRY
				oItem:Checked := TRUE
			CATCH
				// Do nothing
			END TRY
		ENDIF

		RETURN oItem != NULL_OBJECT

	METHOD DeleteChild(oMenu as Menu)  AS LOGIC
		LOCAL dwI, dwCount AS DWORD

		dwCount := ALen(aChildren)
		FOR dwI := 1 UPTO dwCount
			IF aChildren[dwI] = oMenu
				ATrueDel(aChildren, dwI)
				RETURN TRUE
			ENDIF
		NEXT  // dwI
		RETURN FALSE

	METHOD DeleteItem(xItemIdOrMenu AS USUAL) AS LOGIC
		LOCAL retVal AS LOGIC
		LOCAL nItemID AS LONG
		retVal := FALSE
		IF IsInstanceOfUsual(xItemIdOrMenu, #Menu)
			LOCAL oSubMenu AS Menu
			oSubMenu := xItemIdOrMenu
			nItemID := oSubMenu:GetHashCode()
			LOCAL IMPLIED oItem := oMenu:GetItemByID(nItemID)
			IF oItem != NULL_OBJECT
				SELF:DeleteChild(xItemIdOrMenu)
				IF oItem != NULL_OBJECT
					oItem:Parent:MenuItems:Remove(oItem)
					retVal := TRUE
				ENDIF
			ENDIF
		ELSE
			nItemID := xItemIdOrMenu
			LOCAL IMPLIED oItem := oMenu:GetItemByID(nItemID)
			IF oItem != NULL_OBJECT
				oItem:Parent:MenuItems:Remove(oItem)
				retVal := TRUE
			ENDIF
			IF (oToolBar != NULL_OBJECT)
				oToolBar:DeleteItem(xItemIdOrMenu)
			ENDIF
		ENDIF
		RETURN retVal

	METHOD Destroy() AS USUAL
		oMenu			:= NULL_OBJECT
		aItem			:= NULL_ARRAY
		aChildren		:= NULL_ARRAY
		oWindow			:= NULL_OBJECT
		oAccelerator	:= NULL_OBJECT
		SUPER:Destroy()

		RETURN NIL

	METHOD DisableItem(nItemID )
		IF IsSymbol(nItemID)
			nItemID := SELF:GetMenuID((SYMBOL) nItemID)
		ENDIF
		IF (oToolBar != NULL_OBJECT)
			oToolBar:DisableItem(nItemID)
		ENDIF
		LOCAL IMPLIED oItem := oMenu:GetItemByID(nItemID)
		IF oItem != NULL_OBJECT
			oItem:Enabled:= FALSE
		ENDIF

		RETURN oItem != NULL_OBJECT

	METHOD DisableAutoUpdate() AS VOID CLIPPER
		SELF:SetAutoUpdate(999)

		RETURN

	METHOD EnableItem(nItemID)
		IF IsSymbol(nItemID)
			nItemID := SELF:GetMenuID((SYMBOL) nItemID)
		ENDIF
		IF (oToolBar != NULL_OBJECT)
			oToolBar:EnableItem(nItemID)
		ENDIF
		LOCAL IMPLIED oItem := oMenu:GetItemByID(nItemID)
		IF oItem != NULL_OBJECT
			oItem:Enabled:= TRUE
		ENDIF
		RETURN oItem != NULL_OBJECT

	METHOD GetAutoUpdate() AS LONG CLIPPER
		RETURN iAutoPosition

	METHOD GetSubMenu(nIndex AS DWORD)  AS Menu
		LOCAL oResult AS Menu
		LOCAL oSubMenu AS System.Windows.Forms.Menu
		oSubMenu := SELF:__Menu:MenuItems[(LONG) nIndex]:CloneMenu()
		oResult := Menu{oSubMenu}
		FOREACH aItem AS ARRAY IN SELF:aItem
			oResult:RegisterItem(aItem[1], aItem[2])		// ID, HyperLabel
		NEXT
		RETURN oResult

	METHOD Handle() AS VOMenu STRICT
		RETURN oMenu

	METHOD HyperLabel(nItemID)
		LOCAL dwIndex AS DWORD
		LOCAL dwCount AS DWORD
		LOCAL oHyperLabel AS HyperLabel
		LOCAL oChildMenu AS VOSDK.Menu
		IF IsSymbol(nItemID)
			nItemID := SELF:GetMenuID((SYMBOL) nItemID)
		ENDIF

		dwCount := ALen(aItem)
		FOR dwIndex := 1 UPTO dwCount
			IF nItemID == aItem[dwIndex][ 1]
				RETURN aItem[dwIndex][2]
			ENDIF
		NEXT  // dwI

		dwCount := ALen(aChildren)
		FOR dwIndex := 1 UPTO ALen(aChildren)
			oChildMenu := aChildren[dwIndex]
			oHyperLabel := oChildMenu:HyperLabel(nItemID)
			IF oHyperLabel != NULL_OBJECT
				RETURN oHyperLabel
			ENDIF
		NEXT  // dwIndex

		RETURN NULL_OBJECT

	CONSTRUCTOR(xResourceID)

		LOCAL oResMenu AS ResourceMenu
		LOCAL oResourceID AS ResourceID
		SUPER()
		aChildren := {}
		aItem := {}
		IF IsInstanceOf(xResourceID, #VoMenu)
			oMenu := xResourceID
		ELSEIF IsInstanceOf(xResourceID, #VoMenuItem)
			LOCAL oItem AS VOMenuItem
			oItem := xResourceID
			oMenu := VOMenu{}
			FOREACH IMPLIED oSubItem IN oItem:MenuItemArray
				oMenu:MenuItems:Add(oSubItem:CloneMenu())
			NEXT

		ELSE
			oMenu := VOMenu{}
			IF IsNil(xResourceID)
				// Do nothing
			ELSE
				IF IsNumeric(xResourceID) .OR. IsPtr(xResourceID) .OR. IsSymbol(xResourceID) .OR. IsString(xResourceID)
					oResourceID := ResourceID{xResourceID}
				ELSEIF !IsInstanceOfUsual(xResourceID, #ResourceID)
					WCError{#Init, #Menu, __WCSTypeError}:@@Throw()
				ELSE
					oResourceID := xResourceID
				ENDIF
				oResMenu := ResourceMenu{oResourceID:Handle(), oResourceID:Name}
				oResMenu:AddItemsTo(SELF)
			ENDIF
		ENDIF
		RETURN

	METHOD InsertItem(nItemID AS USUAL, xNewItem AS USUAL, nBeforeID AS INT) AS LOGIC
		LOCAL retVal AS LOGIC
		LOCAL cNewItem AS STRING
		LOCAL oSubMenu AS Menu
		LOCAL oItem	    as VOMenuItem
		LOCAL aItems	as VOMenuItem[]
		LOCAL oHl		as HyperLabel

		IF IsInstanceOfUsual(nItemID, #Menu)
			oSubMenu := nItemID
			oSubMenu:SetParent(SELF)
			SELF:AddChild(oSubMenu)
			cNewItem := xNewItem
			oItem := SELF:__CreateMenuItem(cNewItem, oSubMenu:GetHashCode())
			oItem := VOMenuItem{cNewItem}
			SELF:oMenu:MenuItems:Add(nBeforeID, oItem)
			aItems := VOMenuItem[]{oSubMenu:__Menu:MenuItems:Count}
			oSubMenu:__Menu:MenuItems:CopyTo(aItems, 0)
			oItem:MenuItems:AddRange(aItems)

		ELSEIF IsNumeric(nItemID)
			IF (nItemID == MENUSEPARATOR)
				oItem := SELF:__CreateMenuItem("-", nItemID)
				SELF:oMenu:MenuItems:Add(nBeforeID, oItem )

			ELSE
				IF IsInstanceOfUsual(xNewItem, #HyperLabel)
					oHl := xNewItem
					cNewItem := oHl:Caption
					oItem := SELF:__CreateMenuItem(cNewItem, nItemID)
					SELF:oMenu:MenuItems:Add(nBeforeID, oItem)
				ELSEIF IsString(xNewItem)
					cNewItem := xNewItem
					oItem := SELF:__CreateMenuItem(cNewItem, nItemID)
					SELF:oMenu:MenuItems:Add(nBeforeID, oItem)
				ELSEIF IsInstanceOfUsual(xNewItem, #Bitmap)
					//retVal := InsertMenu(hMenu, nBeforeID, _OR(_OR(MF_BYCOMMAND, MF_BITMAP), MF_ENABLED), nItemID, PSZ(_CAST, xNewItem:Handle()))
				ENDIF
			ENDIF
		ENDIF
		RETURN retVal

	METHOD MakeMenuRtol(lRToL AS LOGIC)
		//Todo MakeMenuRtol
		RETURN SELF

	METHOD Name(nItemID AS LONG)  AS STRING
		LOCAL oHL AS HyperLabel

		oHL := SELF:HyperLabel(nItemID)
		IF (oHL != NULL_OBJECT)
			RETURN oHL:Name
		ENDIF

		RETURN NULL_STRING

	METHOD NameSym(nItemID AS LONG) AS SYMBOL
		LOCAL oHL AS HyperLabel

		oHL:=SELF:HyperLabel(nItemID)

		IF (oHL != NULL_OBJECT)
			RETURN oHL:NameSym
		ENDIF

		RETURN NULL_SYMBOL

	METHOD PostInit()
		RETURN NIL

	METHOD PreInit()
		RETURN NIL

	METHOD RegisterItem(nItemID, oHyperLabel ,  hParentMenu , nPosition ) AS LOGIC
		// hParentMenu and nPosition are now ignored
		LOCAL lResult AS LOGIC
		LOCAL oItem	AS VOMenuItem
		IF IsSymbol(nItemID)
			nItemID := SELF:GetMenuID((SYMBOL) nItemID)
		ENDIF
		IF IsLong(nItemID)
			oItem := oMenu:GetItemByID(nItemID)
			IF oItem != NULL_OBJECT
				oItem:Text := oHyperLabel:Caption
				// Poor Man's ShortCuts
				//if oItem:Text:Contains(e"\t")
				//	LOCAL cShortCut as STRING
				//	cShortCut := oItem:Text:Substring(oItem:Text:IndexOf(e"\t")+1)
				//	try
				//		oItem:Shortcut := (System.Windows.Forms.Shortcut) Enum.Parse(typeof(System.Windows.Forms.Shortcut), cShortCut:Replace("+",""))
				//		oItem:Text := oItem:Text:Substring(0, oItem:Text:IndexOf(e"\t"))
				//		oItem:ShowShortcut := TRUE
				//	catch e as Exception

				//	end try
				//ENDIF
			ENDIF

		ENDIF
		AAdd(aItem, {nItemID, oHyperLabel})
		lResult := TRUE
		RETURN lResult

	METHOD SetAutoUpdate(nMenuNumber AS LONG) AS VOID
		iAutoPosition := nMenuNumber
		RETURN

	METHOD SetParent(oMenu AS Menu) AS VOID
		oParent := oMenu
		RETURN

	METHOD SetShortCuts(oAccelerator AS Accelerator) AS VOID
		SELF:__ClearShortCuts(SELF:__Menu)
		IF oAccelerator != NULL_OBJECT
			FOREACH IMPLIED oKey IN oAccelerator:Keys
				LOCAL IMPLIED oItem := SELF:__Menu:GetItemByID(oKey:ID)
				IF oItem != NULL_OBJECT
					oItem:SetShortCut(oKey:Shortcut)
				ENDIF
			NEXT
		ENDIF

	METHOD __ClearShortCuts(oMenu as System.Windows.Forms.Menu) as VOID
		FOREACH oItem AS System.Windows.Forms.MenuItem in oMenu:MenuItems
			oItem:Shortcut := System.Windows.Forms.Shortcut.None
			SELF:__ClearShortCuts(oItem)
		NEXT
		RETURN

	METHOD ShowAsPopup(oOwner, oPoint, kButton, kAlignment, oNotOverlap)
		//Todo ShowAsPopup
		/*
		LOCAL hPopUpMenu  AS PTR
		LOCAL strucPoint  IS _winPoint
		LOCAL strucTPM    IS _winTPMParams
		LOCAL pTPM        AS _winTPMParams
		LOCAL sRect       IS _winRect
		LOCAL sRectItem   IS _winRect
		LOCAL liItem      AS LONGINT
		LOCAL hWnd        AS PTR
		LOCAL lRet := FALSE AS LOGIC
		//PP-030319 new parameter oNotOverlap, courtesy S. Ebert
		//PP-041001 Update from S. Ebert

		IF !IsInstanceOfUsual(oOwner, #Window) .AND. !IsInstanceOfUsual(oOwner, #Control)
		WCError{#ShowPopup, #Menu, __WCSTypeError, oOwner, 1}:@@Throw()
		ENDIF

		Default(@kButton, PM_RIGHTBUTTON)
		Default(@kAlignment, PM_ALIGNLEFT)

		IF IsInstanceOfUsual(oPoint, #Point)
		strucPoint:x := oPoint:X
		IF strucPoint:x > GetSystemMetrics(SM_CXScreen)
		strucPoint:x := GetSystemMetrics(SM_CXScreen)
		ELSEIF strucPoint:x < 0
		strucPoint:x := 0
		ENDIF
		strucPoint:y := oPoint:Y
		IF WCGetCoordinateSystem()
		strucPoint:y := GetSystemMetrics(SM_CYSCREEN) - strucPoint:y
		ENDIF
		IF strucPoint:y > GetSystemMetrics(SM_CYScreen)
		strucPoint:y := GetSystemMetrics(SM_CYScreen)
		ELSEIF strucPoint:y < 0
		strucPoint:y := 0
		ENDIF
		ELSEIF IsLong(oPoint)
		strucPoint:x := SHORTINT(_CAST, LoWord(DWORD(_CAST, oPoint)))
		strucPoint:y := SHORTINT(_CAST, HiWord(DWORD(_CAST, oPoint)))
		ELSE
		GetCursorPos(@strucPoint)
		ENDIF

		IF strucPoint:x = -1 .AND. strucPoint:y = -1 //Keyboard call
		hWnd := oOwner:Handle()
		GetCursorPos(@strucPoint)
		GetWindowRect(hWnd, @sRect)
		DO CASE
		CASE IsInstanceOfUsual(oOwner, #ListView)
		liItem := ListView_GetNextItem(hWnd, -1, LV_GNIBYITEM+LVNI_FOCUSED)
		IF liItem >= 0 .AND. liItem >= ListView_GetTopIndex(hWnd)
		sRectItem:left := LVIR_LABEL
		IF LOGIC(_CAST, SendMessage(hWnd, LVM_GETITEMRECT, DWORD(liItem), LONGINT(_CAST,@sRectItem)))
		strucPoint:x := sRectItem:Left
		strucPoint:y := sRectItem:Bottom
		ScreenToClient(hWnd, @strucPoint)
		ENDIF
		ENDIF
		CASE IsInstanceOfUsual(oOwner, #TreeView)
		liItem := LONGINT(_CAST, TreeView_GetNextItem(hWnd, -1, TVGN_CARET))
		IF liItem >= 0
		sRectItem:left := liItem
		IF LOGIC(_CAST, SendMessage(hWnd, TVM_GETITEMRECT, 1, LONGINT(_CAST,@sRectItem)))
		strucPoint:x := sRectItem:Left
		strucPoint:y := sRectItem:Bottom
		ScreenToClient(hWnd, @strucPoint)
		ENDIF
		ENDIF
		ENDCASE
		IF ! PtInRect(@sRect, strucPoint)
		strucPoint:x := (sRect:left + sRect:right)  / 2
		strucPoint:y := (sRect:top  + sRect:bottom) / 2
		ENDIF
		ENDIF

		IF IsInstanceOfUsual(oNotOverlap, #Control) .OR. IsInstanceOfUsual(oNotOverlap, #Window)
		strucTPM:cbSize := _SIZEOF(_winTPMParams)
		GetWindowRect(oNotOverlap:Handle(), @strucTPM:rcExclude)
		pTPM := @strucTPM
		ELSEIF IsInstanceOfUsual(oNotOverlap, #BoundingBox)
		strucTPM:cbSize := _SIZEOF(_winTPMParams)
		SetRect(@strucTPM:rcExclude,oNotOverlap:Left,oNotOverlap:Top,oNotOverlap:Right,oNotOverlap:Bottom)
		IF WCGetCoordinateSystem()
		strucTPM:rcExclude:Top    := GetSystemMetrics(SM_CYSCREEN) - strucTPM:rcExclude:Top
		strucTPM:rcExclude:Bottom := GetSystemMetrics(SM_CYSCREEN) - strucTPM:rcExclude:Bottom
		ENDIF
		pTPM := @strucTPM
		ELSEIF IsPtr(oNotOverlap)
		strucTPM:cbSize := _SIZEOF(_winTPMParams)
		CopyRect(@strucTPM:rcExclude, oNotOverlap)
		pTPM := @strucTPM
		ENDIF

		hPopUpMenu := GetSubMenu(SELF:Handle(), 0)
		IF hPopUpMenu != NULL_PTR
		lRet := TrackPopupMenuEx(hPopUpMenu, _OR(DWORD(kButton), DWORD(kAlignment)),;
		strucPoint:x, strucPoint:y, oOwner:Handle(), pTPM)
		ENDIF

		RETURN lRet
		*/
		RETURN FALSE

	PROPERTY ToolBar as ToolBar GET oToolBar SET oToolBar := Value

	METHOD UncheckItem(nItemID)
		IF IsSymbol(nItemID)
			nItemID := SELF:GetMenuID((SYMBOL) nItemID)
		ENDIF
		LOCAL IMPLIED oItem := oMenu:GetItemByID(nItemID)
		IF oItem != NULL_OBJECT
			oItem:Checked := FALSE
		ENDIF
		RETURN oItem != NULL_OBJECT

	METHOD UnregisterItem(nItemID )
		LOCAL dwIndex AS DWORD
		LOCAL dwCount AS DWORD
		IF IsSymbol(nItemID)
			nItemID := SELF:GetMenuID((SYMBOL) nItemID)
		ENDIF
		dwCount := ALen(aItem)
		FOR dwIndex := 1 UPTO dwCount
			IF nItemID == aItem[dwIndex][ 1]
				ATrueDel(aItem,dwIndex)
				EXIT
			ENDIF
		NEXT  // dwIndex
		RETURN TRUE

	#region Events

	METHOD OnItemClick(Sender AS OBJECT, e AS EventArgs) AS VOID
		LOCAL oEvt AS MenuCommandEvent
		LOCAL oMenu AS Menu
		LOCAL oMenuItem AS VOMenuItem
		oMenu := SELF:__GetParent()

		IF oMenu:oWindow != NULL_OBJECT
			oMenuItem := Sender
			oEvt := MenuCommandEvent{SELF,oMenu:oWindow, oMenuItem:MenuItemID}
			oMenu:oWindow:__PreMenuCommand(oEvt)
		ENDIF
		RETURN

	METHOD OnItemSelect(Sender AS OBJECT, e AS EventArgs) AS VOID
		LOCAL oMenu AS Menu
		LOCAL oMenuItem AS VOMenuItem

		oMenu := SELF:__GetParent()

		IF oMenu:oWindow != NULL_OBJECT
			oMenuItem := Sender
			oMenu:oWindow:MenuSelect(MenuSelectEvent{SELF,oMenu:oWindow, oMenuItem:MenuItemID})
		ENDIF
		RETURN

	METHOD OnItemPopup(Sender as OBJECT, e as EventArgs) AS VOid
		LOCAL oMenu as Menu
		LOCAL oMenuItem as VOMenuItem
		oMenu := SELF:__GetParent()

		if oMenu:oWindow != NULL_OBJECT
			oMenuItem := Sender
			oMenu:oWindow:MenuInit(MenuInitEvent{SELF,oMenu:oWindow, oMenuItem:MenuItemID})
		ENDIF
		RETURN

	#endregion

	#region Extensions

	METHOD GetMenuID(symItem AS SYMBOL) AS LONG
		LOCAL nItem, nCount AS DWORD
		LOCAL oHL			AS HyperLabel
		nCount := Alen(aItem)
		FOR nItem := 1 TO nCount
			oHL := aItem[nItem][2]
			IF oHL:NameSym == symItem
				RETURN aItem[nItem][1]
			ENDIF
		NEXT
		RETURN 0

	METHOD SetAble(nID , lEnable ) AS VOID
		DEFAULT(@lEnable, TRUE)
		IF IsSymbol (nID)
			nID := SELF:GetMenuID(nID)
		ENDIF
		IF IsNumeric(nID)
			IF lEnable
				SELF:EnableItem(nID)
			ELSE
				SELF:DisableItem(nID)
			ENDIF
		ENDIF
		RETURN

	METHOD SetCheck( nID , lCheck) AS VOID
		DEFAULT(@lCheck, TRUE)
		IF IsSymbol (nID)
			nID := SELF:GetMenuID(nID)
		ENDIF
		IF IsNumeric(nID)
			IF lCheck
				SELF:CheckItem(nID)
			ELSE
				SELF:UnCheckItem(nID)
			ENDIF
		ENDIF
	#endregion

END CLASS

//CLASS SystemMenu INHERIT Menu

//	METHOD Destroy()  AS USUAL CLIPPER

//		SUPER:Destroy()
//		RETURN SELF

//	CONSTRUCTOR(oOwner)
//		//Todo SystemMenu class
//		//SUPER(GetSystemMenu(((Window)oOwner):Handle(), FALSE))
//		SUPER()
//		RETURN
//END CLASS

FUNCTION GetMenuItemCount(oMenu AS VOMenu) AS LONG
	RETURN oMenu:MenuItems:Count

FUNCTION GetSubMenu(oMenu AS VOMenu, nItem AS LONG) AS VOMenuItem
	LOCAL nCurrent AS LONG
	nCurrent := 0
	FOREACH oItem AS VOMenuItem IN oMenu:MenuItems
		IF oItem:MenuItems:Count > 0
			// This is a SubMenu
			IF nCurrent == nItem
				RETURN oItem
			ENDIF
			++nCurrent
		ENDIF
	NEXT
	RETURN NULL_OBJECT

USING System.Reflection
USING VOSDK := XSharp.VO.SDK
CLASS Menu INHERIT VObject
	PROTECT oWindow			as Window
	PROTECT oParent 		AS Menu
	PROTECT oMenu 			AS VOMenu
	PROTECT aChildren		AS ARRAY
	PROTECT iAutoPosition	AS INT
	PROTECT oAccelerator	AS Accelerator
	PROTECT oToolBar 		AS ToolBar
	PROTECT aItem 			AS ARRAY

	ACCESS __Menu as VOMenu
		RETURN oMenu

	ASSIGN __Owner(oWin as Window)
		oWindow := oWIn

	METHOD __GetParent() AS Menu
		LOCAL oMenu as Menu
		oMenu := SELF

		DO WHILE oMenu:oParent != NULL_OBJECT
			oMenu := oMenu:oParent
		ENDDO
		RETURN oMenu

	METHOD __CreateMenuItem(cCaption AS STRING, nId AS LONG) AS VOMenuItem
		LOCAL oItem AS VOMenuItem
		oItem := VOMenuItem{}
		IF STRING.IsNullOrEmpty(cCaption)
			oItem:Text := "-"
		ELSE
			oItem:Text	:= cCaption
		ENDIF
		oItem:ShowShortcut := FALSE
		oItem:MenuItemID   := nId
		oItem:Click  += OnItemClick
		oItem:Select += OnItemSelect
		oItem:Popup  += OnItemPopup
		RETURN oItem

	PROPERTY Accelerator AS Accelerator GET oAccelerator SET oAccelerator := Value

	ACCESS Items AS ARRAY
		RETURN aItem

	METHOD AddChild(oMenu as Menu) AS VOID
		aadd(aChildren, oMenu)
		RETURN

	METHOD AppendItem(nItemID , xNewItem )
		LOCAL cNewItem AS STRING
		LOCAL oSubMenu	AS Menu
		LOCAL oItem	    AS VOMenuItem
		LOCAL oHl		AS HyperLabel
		LOCAL aItems	AS VOMenuItem[]
		IF IsInstanceOfUsual(nItemID, #Menu)
			oSubMenu := nItemID
			oSubMenu:SetParent(SELF)
			SELF:AddChild(nItemID)
			cNewItem := xNewItem
			oItem := SELF:__CreateMenuItem(cNewItem, oSubMenu:GetHashCode())
			SELF:oMenu:MenuItems:Add(oItem)

			aItems := VOMenuItem[]{oSubMenu:__Menu:MenuItems:Count}
			oSubMenu:__Menu:MenuItems:CopyTo(aItems, 0)
			oItem:MenuItems:AddRange(aItems)

		ELSEIF IsNumeric(nItemID)
			IF nItemID == MENUSEPARATOR
				oItem := SELF:__CreateMenuItem("-", nItemID)
				SELF:oMenu:MenuItems:Add(oItem)
			ELSE
				IF IsInstanceOfUsual(xNewItem, #HyperLabel)
					oHl := xNewItem
					cNewItem := oHl:Caption
					oItem := SELF:__CreateMenuItem(cNewItem, nItemID)
					SELF:oMenu:MenuItems:Add(oItem)
					AAdd(aItem, {nItemID, oHl})
				ELSEIF IsString(xNewItem)
					oItem := SELF:__CreateMenuItem(cNewItem, nItemID)
					SELF:oMenu:MenuItems:Add(oItem)
				ELSEIF IsInstanceOfUsual(xNewItem, #Bitmap)
					// todo Menu Bitmaps
					//lRetVal := AppendMenu(hMenu, _OR(MF_BYCOMMAND, MF_BITMAP, MF_ENABLED), nItemID, xNewItem:Handle())
				ENDIF
			ENDIF
		ENDIF

		RETURN oItem != NULL_OBJECT

	METHOD CheckItem(nItemID )
		IF IsSymbol(nItemID)
			nItemID := SELF:GetMenuID((SYMBOL) nItemID)
		ENDIF
		LOCAL IMPLIED oItem := oMenu:GetItemByID(nItemID)
		IF oItem != NULL_OBJECT
			TRY
				oItem:Checked := TRUE
			CATCH
				// Do nothing
			END TRY
		ENDIF

		RETURN oItem != NULL_OBJECT

	METHOD DeleteChild(oMenu as Menu)  AS LOGIC
		LOCAL dwI, dwCount AS DWORD

		dwCount := ALen(aChildren)
		FOR dwI := 1 UPTO dwCount
			IF aChildren[dwI] = oMenu
				ATrueDel(aChildren, dwI)
				RETURN TRUE
			ENDIF
		NEXT  // dwI
		RETURN FALSE

	METHOD DeleteItem(xItemIdOrMenu AS USUAL) AS LOGIC
		LOCAL retVal AS LOGIC
		LOCAL nItemID AS LONG
		retVal := FALSE
		IF IsInstanceOfUsual(xItemIdOrMenu, #Menu)
			LOCAL oSubMenu AS Menu
			oSubMenu := xItemIdOrMenu
			nItemID := oSubMenu:GetHashCode()
			LOCAL IMPLIED oItem := oMenu:GetItemByID(nItemID)
			IF oItem != NULL_OBJECT
				SELF:DeleteChild(xItemIdOrMenu)
				IF oItem != NULL_OBJECT
					oItem:Parent:MenuItems:Remove(oItem)
					retVal := TRUE
				ENDIF
			ENDIF
		ELSE
			nItemID := xItemIdOrMenu
			LOCAL IMPLIED oItem := oMenu:GetItemByID(nItemID)
			IF oItem != NULL_OBJECT
				oItem:Parent:MenuItems:Remove(oItem)
				retVal := TRUE
			ENDIF
			IF (oToolBar != NULL_OBJECT)
				oToolBar:DeleteItem(xItemIdOrMenu)
			ENDIF
		ENDIF
		RETURN retVal

	METHOD Destroy() AS USUAL
		oMenu			:= NULL_OBJECT
		aItem			:= NULL_ARRAY
		aChildren		:= NULL_ARRAY
		oWindow			:= NULL_OBJECT
		oAccelerator	:= NULL_OBJECT
		SUPER:Destroy()

		RETURN NIL

	METHOD DisableItem(nItemID )
		IF IsSymbol(nItemID)
			nItemID := SELF:GetMenuID((SYMBOL) nItemID)
		ENDIF
		IF (oToolBar != NULL_OBJECT)
			oToolBar:DisableItem(nItemID)
		ENDIF
		LOCAL IMPLIED oItem := oMenu:GetItemByID(nItemID)
		IF oItem != NULL_OBJECT
			oItem:Enabled:= FALSE
		ENDIF

		RETURN oItem != NULL_OBJECT

	METHOD DisableAutoUpdate() AS VOID CLIPPER
		SELF:SetAutoUpdate(999)

		RETURN

	METHOD EnableItem(nItemID)
		IF IsSymbol(nItemID)
			nItemID := SELF:GetMenuID((SYMBOL) nItemID)
		ENDIF
		IF (oToolBar != NULL_OBJECT)
			oToolBar:EnableItem(nItemID)
		ENDIF
		LOCAL IMPLIED oItem := oMenu:GetItemByID(nItemID)
		IF oItem != NULL_OBJECT
			oItem:Enabled:= TRUE
		ENDIF
		RETURN oItem != NULL_OBJECT

	METHOD GetAutoUpdate() AS LONG CLIPPER
		RETURN iAutoPosition

	METHOD GetSubMenu(nIndex AS DWORD)  AS Menu
		LOCAL oResult AS Menu
		LOCAL oSubMenu AS System.Windows.Forms.Menu
		oSubMenu := SELF:__Menu:MenuItems[(LONG) nIndex]:CloneMenu()
		oResult := Menu{oSubMenu}
		FOREACH aItem AS ARRAY IN SELF:aItem
			oResult:RegisterItem(aItem[1], aItem[2])		// ID, HyperLabel
		NEXT
		RETURN oResult

	METHOD Handle() AS VOMenu STRICT
		RETURN oMenu

	METHOD HyperLabel(nItemID)
		LOCAL dwIndex AS DWORD
		LOCAL dwCount AS DWORD
		LOCAL oHyperLabel AS HyperLabel
		LOCAL oChildMenu AS VOSDK.Menu
		IF IsSymbol(nItemID)
			nItemID := SELF:GetMenuID((SYMBOL) nItemID)
		ENDIF

		dwCount := ALen(aItem)
		FOR dwIndex := 1 UPTO dwCount
			IF nItemID == aItem[dwIndex][ 1]
				RETURN aItem[dwIndex][2]
			ENDIF
		NEXT  // dwI

		dwCount := ALen(aChildren)
		FOR dwIndex := 1 UPTO ALen(aChildren)
			oChildMenu := aChildren[dwIndex]
			oHyperLabel := oChildMenu:HyperLabel(nItemID)
			IF oHyperLabel != NULL_OBJECT
				RETURN oHyperLabel
			ENDIF
		NEXT  // dwIndex

		RETURN NULL_OBJECT

	CONSTRUCTOR(xResourceID)

		LOCAL oResMenu AS ResourceMenu
		LOCAL oResourceID AS ResourceID
		SUPER()
		aChildren := {}
		aItem := {}
		IF IsInstanceOf(xResourceID, #VoMenu)
			oMenu := xResourceID
		ELSEIF IsInstanceOf(xResourceID, #VoMenuItem)
			LOCAL oItem AS VOMenuItem
			oItem := xResourceID
			oMenu := VOMenu{}
			FOREACH IMPLIED oSubItem IN oItem:MenuItemArray
				oMenu:MenuItems:Add(oSubItem:CloneMenu())
			NEXT

		ELSE
			oMenu := VOMenu{}
			IF IsNil(xResourceID)
				// Do nothing
			ELSE
				IF IsNumeric(xResourceID) .OR. IsPtr(xResourceID) .OR. IsSymbol(xResourceID) .OR. IsString(xResourceID)
					oResourceID := ResourceID{xResourceID}
				ELSEIF !IsInstanceOfUsual(xResourceID, #ResourceID)
					WCError{#Init, #Menu, __WCSTypeError}:@@Throw()
				ELSE
					oResourceID := xResourceID
				ENDIF
				oResMenu := ResourceMenu{oResourceID:Handle(), oResourceID:Name}
				oResMenu:AddItemsTo(SELF)
			ENDIF
		ENDIF
		RETURN

	METHOD InsertItem(nItemID AS USUAL, xNewItem AS USUAL, nBeforeID AS INT) AS LOGIC
		LOCAL retVal AS LOGIC
		LOCAL cNewItem AS STRING
		LOCAL oSubMenu AS Menu
		LOCAL oItem	    as VOMenuItem
		LOCAL aItems	as VOMenuItem[]
		LOCAL oHl		as HyperLabel

		IF IsInstanceOfUsual(nItemID, #Menu)
			oSubMenu := nItemID
			oSubMenu:SetParent(SELF)
			SELF:AddChild(oSubMenu)
			cNewItem := xNewItem
			oItem := SELF:__CreateMenuItem(cNewItem, oSubMenu:GetHashCode())
			oItem := VOMenuItem{cNewItem}
			SELF:oMenu:MenuItems:Add(nBeforeID, oItem)
			aItems := VOMenuItem[]{oSubMenu:__Menu:MenuItems:Count}
			oSubMenu:__Menu:MenuItems:CopyTo(aItems, 0)
			oItem:MenuItems:AddRange(aItems)

		ELSEIF IsNumeric(nItemID)
			IF (nItemID == MENUSEPARATOR)
				oItem := SELF:__CreateMenuItem("-", nItemID)
				SELF:oMenu:MenuItems:Add(nBeforeID, oItem )

			ELSE
				IF IsInstanceOfUsual(xNewItem, #HyperLabel)
					oHl := xNewItem
					cNewItem := oHl:Caption
					oItem := SELF:__CreateMenuItem(cNewItem, nItemID)
					SELF:oMenu:MenuItems:Add(nBeforeID, oItem)
				ELSEIF IsString(xNewItem)
					cNewItem := xNewItem
					oItem := SELF:__CreateMenuItem(cNewItem, nItemID)
					SELF:oMenu:MenuItems:Add(nBeforeID, oItem)
				ELSEIF IsInstanceOfUsual(xNewItem, #Bitmap)
					//retVal := InsertMenu(hMenu, nBeforeID, _OR(_OR(MF_BYCOMMAND, MF_BITMAP), MF_ENABLED), nItemID, PSZ(_CAST, xNewItem:Handle()))
				ENDIF
			ENDIF
		ENDIF
		RETURN retVal

	METHOD MakeMenuRtol(lRToL AS LOGIC)
		//Todo MakeMenuRtol
		RETURN SELF

	METHOD Name(nItemID AS LONG)  AS STRING
		LOCAL oHL AS HyperLabel

		oHL := SELF:HyperLabel(nItemID)
		IF (oHL != NULL_OBJECT)
			RETURN oHL:Name
		ENDIF

		RETURN NULL_STRING

	METHOD NameSym(nItemID AS LONG) AS SYMBOL
		LOCAL oHL AS HyperLabel

		oHL:=SELF:HyperLabel(nItemID)

		IF (oHL != NULL_OBJECT)
			RETURN oHL:NameSym
		ENDIF

		RETURN NULL_SYMBOL

	METHOD PostInit()
		RETURN NIL

	METHOD PreInit()
		RETURN NIL

	METHOD RegisterItem(nItemID, oHyperLabel ,  hParentMenu , nPosition ) AS LOGIC
		// hParentMenu and nPosition are now ignored
		LOCAL lResult AS LOGIC
		LOCAL oItem	AS VOMenuItem
		IF IsSymbol(nItemID)
			nItemID := SELF:GetMenuID((SYMBOL) nItemID)
		ENDIF
		IF IsLong(nItemID)
			oItem := oMenu:GetItemByID(nItemID)
			IF oItem != NULL_OBJECT
				oItem:Text := oHyperLabel:Caption
				// Poor Man's ShortCuts
				//if oItem:Text:Contains(e"\t")
				//	LOCAL cShortCut as STRING
				//	cShortCut := oItem:Text:Substring(oItem:Text:IndexOf(e"\t")+1)
				//	try
				//		oItem:Shortcut := (System.Windows.Forms.Shortcut) Enum.Parse(typeof(System.Windows.Forms.Shortcut), cShortCut:Replace("+",""))
				//		oItem:Text := oItem:Text:Substring(0, oItem:Text:IndexOf(e"\t"))
				//		oItem:ShowShortcut := TRUE
				//	catch e as Exception

				//	end try
				//ENDIF
			ENDIF

		ENDIF
		AAdd(aItem, {nItemID, oHyperLabel})
		lResult := TRUE
		RETURN lResult

	METHOD SetAutoUpdate(nMenuNumber AS LONG) AS VOID
		iAutoPosition := nMenuNumber
		RETURN

	METHOD SetParent(oMenu AS Menu) AS VOID
		oParent := oMenu
		RETURN

	METHOD SetShortCuts(oAccelerator AS Accelerator) AS VOID
		SELF:__ClearShortCuts(SELF:__Menu)
		IF oAccelerator != NULL_OBJECT
			FOREACH IMPLIED oKey IN oAccelerator:Keys
				LOCAL IMPLIED oItem := SELF:__Menu:GetItemByID(oKey:ID)
				IF oItem != NULL_OBJECT
					oItem:SetShortCut(oKey:Shortcut)
				ENDIF
			NEXT
		ENDIF

	METHOD __ClearShortCuts(oMenu as System.Windows.Forms.Menu) as VOID
		FOREACH IMPLIED oItem in oMenu:MenuItems
			oItem:Shortcut := System.Windows.Forms.Shortcut.None
			SELF:__ClearShortCuts(oItem)
		NEXT
		RETURN

	METHOD ShowAsPopup(oOwner, oPoint, kButton, kAlignment, oNotOverlap)
		//Todo ShowAsPopup
		/*
		LOCAL hPopUpMenu  AS PTR
		LOCAL strucPoint  IS _winPoint
		LOCAL strucTPM    IS _winTPMParams
		LOCAL pTPM        AS _winTPMParams
		LOCAL sRect       IS _winRect
		LOCAL sRectItem   IS _winRect
		LOCAL liItem      AS LONGINT
		LOCAL hWnd        AS PTR
		LOCAL lRet := FALSE AS LOGIC
		//PP-030319 new parameter oNotOverlap, courtesy S. Ebert
		//PP-041001 Update from S. Ebert

		IF !IsInstanceOfUsual(oOwner, #Window) .AND. !IsInstanceOfUsual(oOwner, #Control)
		WCError{#ShowPopup, #Menu, __WCSTypeError, oOwner, 1}:@@Throw()
		ENDIF

		Default(@kButton, PM_RIGHTBUTTON)
		Default(@kAlignment, PM_ALIGNLEFT)

		IF IsInstanceOfUsual(oPoint, #Point)
		strucPoint:x := oPoint:X
		IF strucPoint:x > GetSystemMetrics(SM_CXScreen)
		strucPoint:x := GetSystemMetrics(SM_CXScreen)
		ELSEIF strucPoint:x < 0
		strucPoint:x := 0
		ENDIF
		strucPoint:y := oPoint:Y
		IF WCGetCoordinateSystem()
		strucPoint:y := GetSystemMetrics(SM_CYSCREEN) - strucPoint:y
		ENDIF
		IF strucPoint:y > GetSystemMetrics(SM_CYScreen)
		strucPoint:y := GetSystemMetrics(SM_CYScreen)
		ELSEIF strucPoint:y < 0
		strucPoint:y := 0
		ENDIF
		ELSEIF IsLong(oPoint)
		strucPoint:x := SHORTINT(_CAST, LoWord(DWORD(_CAST, oPoint)))
		strucPoint:y := SHORTINT(_CAST, HiWord(DWORD(_CAST, oPoint)))
		ELSE
		GetCursorPos(@strucPoint)
		ENDIF

		IF strucPoint:x = -1 .AND. strucPoint:y = -1 //Keyboard call
		hWnd := oOwner:Handle()
		GetCursorPos(@strucPoint)
		GetWindowRect(hWnd, @sRect)
		DO CASE
		CASE IsInstanceOfUsual(oOwner, #ListView)
		liItem := ListView_GetNextItem(hWnd, -1, LV_GNIBYITEM+LVNI_FOCUSED)
		IF liItem >= 0 .AND. liItem >= ListView_GetTopIndex(hWnd)
		sRectItem:left := LVIR_LABEL
		IF LOGIC(_CAST, SendMessage(hWnd, LVM_GETITEMRECT, DWORD(liItem), LONGINT(_CAST,@sRectItem)))
		strucPoint:x := sRectItem:Left
		strucPoint:y := sRectItem:Bottom
		ScreenToClient(hWnd, @strucPoint)
		ENDIF
		ENDIF
		CASE IsInstanceOfUsual(oOwner, #TreeView)
		liItem := LONGINT(_CAST, TreeView_GetNextItem(hWnd, -1, TVGN_CARET))
		IF liItem >= 0
		sRectItem:left := liItem
		IF LOGIC(_CAST, SendMessage(hWnd, TVM_GETITEMRECT, 1, LONGINT(_CAST,@sRectItem)))
		strucPoint:x := sRectItem:Left
		strucPoint:y := sRectItem:Bottom
		ScreenToClient(hWnd, @strucPoint)
		ENDIF
		ENDIF
		ENDCASE
		IF ! PtInRect(@sRect, strucPoint)
		strucPoint:x := (sRect:left + sRect:right)  / 2
		strucPoint:y := (sRect:top  + sRect:bottom) / 2
		ENDIF
		ENDIF

		IF IsInstanceOfUsual(oNotOverlap, #Control) .OR. IsInstanceOfUsual(oNotOverlap, #Window)
		strucTPM:cbSize := _SIZEOF(_winTPMParams)
		GetWindowRect(oNotOverlap:Handle(), @strucTPM:rcExclude)
		pTPM := @strucTPM
		ELSEIF IsInstanceOfUsual(oNotOverlap, #BoundingBox)
		strucTPM:cbSize := _SIZEOF(_winTPMParams)
		SetRect(@strucTPM:rcExclude,oNotOverlap:Left,oNotOverlap:Top,oNotOverlap:Right,oNotOverlap:Bottom)
		IF WCGetCoordinateSystem()
		strucTPM:rcExclude:Top    := GetSystemMetrics(SM_CYSCREEN) - strucTPM:rcExclude:Top
		strucTPM:rcExclude:Bottom := GetSystemMetrics(SM_CYSCREEN) - strucTPM:rcExclude:Bottom
		ENDIF
		pTPM := @strucTPM
		ELSEIF IsPtr(oNotOverlap)
		strucTPM:cbSize := _SIZEOF(_winTPMParams)
		CopyRect(@strucTPM:rcExclude, oNotOverlap)
		pTPM := @strucTPM
		ENDIF

		hPopUpMenu := GetSubMenu(SELF:Handle(), 0)
		IF hPopUpMenu != NULL_PTR
		lRet := TrackPopupMenuEx(hPopUpMenu, _OR(DWORD(kButton), DWORD(kAlignment)),;
		strucPoint:x, strucPoint:y, oOwner:Handle(), pTPM)
		ENDIF

		RETURN lRet
		*/
		RETURN FALSE

	PROPERTY ToolBar as ToolBar GET oToolBar SET oToolBar := Value

	METHOD UncheckItem(nItemID)
		IF IsSymbol(nItemID)
			nItemID := SELF:GetMenuID((SYMBOL) nItemID)
		ENDIF
		LOCAL IMPLIED oItem := oMenu:GetItemByID(nItemID)
		IF oItem != NULL_OBJECT
			oItem:Checked := FALSE
		ENDIF
		RETURN oItem != NULL_OBJECT

	METHOD UnregisterItem(nItemID )
		LOCAL dwIndex AS DWORD
		LOCAL dwCount AS DWORD
		IF IsSymbol(nItemID)
			nItemID := SELF:GetMenuID((SYMBOL) nItemID)
		ENDIF
		dwCount := ALen(aItem)
		FOR dwIndex := 1 UPTO dwCount
			IF nItemID == aItem[dwIndex][ 1]
				ATrueDel(aItem,dwIndex)
				EXIT
			ENDIF
		NEXT  // dwIndex
		RETURN TRUE

	#region Events

	METHOD OnItemClick(Sender AS OBJECT, e AS EventArgs) AS VOID
		LOCAL oEvt AS MenuCommandEvent
		LOCAL oMenu AS Menu
		LOCAL oMenuItem AS VOMenuItem
		oMenu := SELF:__GetParent()

		IF oMenu:oWindow != NULL_OBJECT
			oMenuItem := Sender
			oEvt := MenuCommandEvent{SELF,oMenu:oWindow, oMenuItem:MenuItemID}
			oMenu:oWindow:__PreMenuCommand(oEvt)
		ENDIF
		RETURN

	METHOD OnItemSelect(Sender AS OBJECT, e AS EventArgs) AS VOID
		LOCAL oMenu AS Menu
		LOCAL oMenuItem AS VOMenuItem

		oMenu := SELF:__GetParent()

		IF oMenu:oWindow != NULL_OBJECT
			oMenuItem := Sender
			oMenu:oWindow:MenuSelect(MenuSelectEvent{SELF,oMenu:oWindow, oMenuItem:MenuItemID})
		ENDIF
		RETURN

	METHOD OnItemPopup(Sender as OBJECT, e as EventArgs) AS VOid
		LOCAL oMenu as Menu
		LOCAL oMenuItem as VOMenuItem
		oMenu := SELF:__GetParent()

		if oMenu:oWindow != NULL_OBJECT
			oMenuItem := Sender
			oMenu:oWindow:MenuInit(MenuInitEvent{SELF,oMenu:oWindow, oMenuItem:MenuItemID})
		ENDIF
		RETURN

	#endregion

	#region Extensions

	METHOD GetMenuID(symItem AS SYMBOL) AS LONG
		LOCAL nItem, nCount AS DWORD
		LOCAL oHL			AS HyperLabel
		nCount := Alen(aItem)
		FOR nItem := 1 TO nCount
			oHL := aItem[nItem][2]
			IF oHL:NameSym == symItem
				RETURN aItem[nItem][1]
			ENDIF
		NEXT
		RETURN 0

	METHOD SetAble(nID , lEnable ) AS VOID
		DEFAULT(@lEnable, TRUE)
		IF IsSymbol (nID)
			nID := SELF:GetMenuID(nID)
		ENDIF
		IF IsNumeric(nID)
			IF lEnable
				SELF:EnableItem(nID)
			ELSE
				SELF:DisableItem(nID)
			ENDIF
		ENDIF
		RETURN

	METHOD SetCheck( nID , lCheck) AS VOID
		DEFAULT(@lCheck, TRUE)
		IF IsSymbol (nID)
			nID := SELF:GetMenuID(nID)
		ENDIF
		IF IsNumeric(nID)
			IF lCheck
				SELF:CheckItem(nID)
			ELSE
				SELF:UnCheckItem(nID)
			ENDIF
		ENDIF
	#endregion

END CLASS

//CLASS SystemMenu INHERIT Menu

//	METHOD Destroy()  AS USUAL CLIPPER

//		SUPER:Destroy()
//		RETURN SELF

//	CONSTRUCTOR(oOwner)
//		//Todo SystemMenu class
//		//SUPER(GetSystemMenu(((Window)oOwner):Handle(), FALSE))
//		SUPER()
//		RETURN
//END CLASS

FUNCTION GetMenuItemCount(oMenu AS VOMenu) AS LONG
	RETURN oMenu:MenuItems:Count

FUNCTION GetSubMenu(oMenu AS VOMenu, nItem AS LONG) AS VOMenuItem
	LOCAL nCurrent AS LONG
	nCurrent := 0
	FOREACH oItem AS VOMenuItem IN oMenu:MenuItems
		IF oItem:MenuItems:Count > 0
			// This is a SubMenu
			IF nCurrent == nItem
				RETURN oItem
			ENDIF
			++nCurrent
		ENDIF
	NEXT
	RETURN NULL_OBJECT


QtUiTools: data for code generation updated

Modified:
codegen/QtUiTools/QUiLoader.prg

$header

#include "hbclass.ch"

#ifndef QT4XHB_NO_REQUESTS
REQUEST QACTION
REQUEST QACTIONGROUP
REQUEST QLAYOUT
REQUEST QWIDGET
REQUEST QDIR
#endif

CLASS QUiLoader INHERIT QObject

   DATA self_destruction INIT .F.

   METHOD new
   METHOD delete
   METHOD addPluginPath
   METHOD availableLayouts
   METHOD availableWidgets
   METHOD clearPluginPaths
   METHOD createAction
   METHOD createActionGroup
   METHOD createLayout
   METHOD createWidget
   METHOD isLanguageChangeEnabled
   METHOD load
   METHOD pluginPaths
   METHOD setLanguageChangeEnabled
   METHOD setWorkingDirectory
   METHOD workingDirectory
   DESTRUCTOR destroyObject

END CLASS

$destructor

#pragma BEGINDUMP

#include <QUiLoader>

#include "qt4xhb_common.h"
#include "qt4xhb_macros.h"
#include "qt4xhb_utils.h"

#include <QStringList>
#include <QDir>

/*
QUiLoader ( QObject * parent = 0 )
*/
HB_FUNC_STATIC( QUILOADER_NEW )
{
  QUiLoader * o = new QUiLoader ( OPQOBJECT(1,0) );
  _qt4xhb_storePointerAndFlag ( o, false );
}

$deleteMethod

/*
void addPluginPath ( const QString & path )
*/
HB_FUNC_STATIC( QUILOADER_ADDPLUGINPATH )
{
  QUiLoader * obj = (QUiLoader *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    obj->addPluginPath ( PQSTRING(1) );
  }
  hb_itemReturn( hb_stackSelfItem() );
}

/*
QStringList availableLayouts () const
*/
HB_FUNC_STATIC( QUILOADER_AVAILABLELAYOUTS )
{
  QUiLoader * obj = (QUiLoader *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    RQSTRINGLIST( obj->availableLayouts () );
  }
}

/*
QStringList availableWidgets () const
*/
HB_FUNC_STATIC( QUILOADER_AVAILABLEWIDGETS )
{
  QUiLoader * obj = (QUiLoader *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    RQSTRINGLIST( obj->availableWidgets () );
  }
}

/*
void clearPluginPaths ()
*/
HB_FUNC_STATIC( QUILOADER_CLEARPLUGINPATHS )
{
  QUiLoader * obj = (QUiLoader *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    obj->clearPluginPaths ();
  }
  hb_itemReturn( hb_stackSelfItem() );
}

/*
virtual QAction * createAction ( QObject * parent = 0, const QString & name = QString() )
*/
HB_FUNC_STATIC( QUILOADER_CREATEACTION )
{
  QUiLoader * obj = (QUiLoader *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    QAction * ptr = obj->createAction ( OPQOBJECT(1,0), OPQSTRING(2,QString()) );
    _qt4xhb_createReturnClass ( ptr, "QACTION" );
  }
}

/*
virtual QActionGroup * createActionGroup ( QObject * parent = 0, const QString & name = QString() )
*/
HB_FUNC_STATIC( QUILOADER_CREATEACTIONGROUP )
{
  QUiLoader * obj = (QUiLoader *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    QActionGroup * ptr = obj->createActionGroup ( OPQOBJECT(1,0), OPQSTRING(2,QString()) );
    _qt4xhb_createReturnClass ( ptr, "QACTIONGROUP" );
  }
}

/*
virtual QLayout * createLayout ( const QString & className, QObject * parent = 0, const QString & name = QString() )
*/
HB_FUNC_STATIC( QUILOADER_CREATELAYOUT )
{
  QUiLoader * obj = (QUiLoader *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    QLayout * ptr = obj->createLayout ( PQSTRING(1), OPQOBJECT(2,0), OPQSTRING(3,QString()) );
    _qt4xhb_createReturnClass ( ptr, "QLAYOUT" );
  }
}

/*
virtual QWidget * createWidget ( const QString & className, QWidget * parent = 0, const QString & name = QString() )
*/
HB_FUNC_STATIC( QUILOADER_CREATEWIDGET )
{
  QUiLoader * obj = (QUiLoader *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    QWidget * ptr = obj->createWidget ( PQSTRING(1), OPQWIDGET(2,0), OPQSTRING(3,QString()) );
    _qt4xhb_createReturnQWidgetClass ( ptr, "QWIDGET" );
  }
}

/*
bool isLanguageChangeEnabled () const
*/
HB_FUNC_STATIC( QUILOADER_ISLANGUAGECHANGEENABLED )
{
  QUiLoader * obj = (QUiLoader *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    RBOOL( obj->isLanguageChangeEnabled () );
  }
}

/*
QWidget * load ( QIODevice * device, QWidget * parentWidget = 0 )
*/
HB_FUNC_STATIC( QUILOADER_LOAD )
{
  QUiLoader * obj = (QUiLoader *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    QWidget * ptr = obj->load ( PQIODEVICE(1), OPQWIDGET(2,0) );
    _qt4xhb_createReturnQWidgetClass ( ptr, "QWIDGET" );
  }
}

/*
QStringList pluginPaths () const
*/
HB_FUNC_STATIC( QUILOADER_PLUGINPATHS )
{
  QUiLoader * obj = (QUiLoader *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    RQSTRINGLIST( obj->pluginPaths () );
  }
}

/*
void setLanguageChangeEnabled ( bool enabled )
*/
HB_FUNC_STATIC( QUILOADER_SETLANGUAGECHANGEENABLED )
{
  QUiLoader * obj = (QUiLoader *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    obj->setLanguageChangeEnabled ( PBOOL(1) );
  }
  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setWorkingDirectory ( const QDir & dir )
*/
HB_FUNC_STATIC( QUILOADER_SETWORKINGDIRECTORY )
{
  QUiLoader * obj = (QUiLoader *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    obj->setWorkingDirectory ( *PQDIR(1) );
  }
  hb_itemReturn( hb_stackSelfItem() );
}

/*
QDir workingDirectory () const
*/
HB_FUNC_STATIC( QUILOADER_WORKINGDIRECTORY )
{
  QUiLoader * obj = (QUiLoader *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    QDir * ptr = new QDir( obj->workingDirectory () );
    _qt4xhb_createReturnClass ( ptr, "QDIR", true );
  }
}

#pragma ENDDUMP

$header

#include "hbclass.ch"

#ifndef QT4XHB_NO_REQUESTS
REQUEST QACTION
REQUEST QACTIONGROUP
REQUEST QLAYOUT
REQUEST QWIDGET
REQUEST QDIR
#endif

CLASS QUiLoader INHERIT QObject

   DATA self_destruction INIT .F.

   METHOD new
   METHOD delete
   METHOD addPluginPath
   METHOD availableLayouts
   METHOD availableWidgets
   METHOD clearPluginPaths
   METHOD createAction
   METHOD createActionGroup
   METHOD createLayout
   METHOD createWidget
   METHOD isLanguageChangeEnabled
   METHOD load
   METHOD pluginPaths
   METHOD setLanguageChangeEnabled
   METHOD setWorkingDirectory
   METHOD workingDirectory
   DESTRUCTOR destroyObject

END CLASS

$destructor

#pragma BEGINDUMP

#include <QUiLoader>

#include "qt4xhb_common.h"
#include "qt4xhb_macros.h"
#include "qt4xhb_utils.h"

#include <QStringList>
#include <QDir>

/*
QUiLoader ( QObject * parent = 0 )
*/
HB_FUNC_STATIC( QUILOADER_NEW )
{
  QUiLoader * o = new QUiLoader ( OPQOBJECT(1,0) );
  _qt4xhb_storePointerAndFlag ( o, false );
}

HB_FUNC_STATIC( QUILOADER_DELETE )
{
  QUiLoader * obj = (QUiLoader *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    delete obj;
    obj = NULL;
    PHB_ITEM self = hb_stackSelfItem();
    PHB_ITEM ptr = hb_itemPutPtr( NULL, NULL );
    hb_objSendMsg( self, "_pointer", 1, ptr );
    hb_itemRelease( ptr );
  }
  hb_itemReturn( hb_stackSelfItem() );
}

/*
void addPluginPath ( const QString & path )
*/
HB_FUNC_STATIC( QUILOADER_ADDPLUGINPATH )
{
  QUiLoader * obj = (QUiLoader *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    obj->addPluginPath ( PQSTRING(1) );
  }
  hb_itemReturn( hb_stackSelfItem() );
}

/*
QStringList availableLayouts () const
*/
HB_FUNC_STATIC( QUILOADER_AVAILABLELAYOUTS )
{
  QUiLoader * obj = (QUiLoader *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    RQSTRINGLIST( obj->availableLayouts () );
  }
}

/*
QStringList availableWidgets () const
*/
HB_FUNC_STATIC( QUILOADER_AVAILABLEWIDGETS )
{
  QUiLoader * obj = (QUiLoader *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    RQSTRINGLIST( obj->availableWidgets () );
  }
}

/*
void clearPluginPaths ()
*/
HB_FUNC_STATIC( QUILOADER_CLEARPLUGINPATHS )
{
  QUiLoader * obj = (QUiLoader *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    obj->clearPluginPaths ();
  }
  hb_itemReturn( hb_stackSelfItem() );
}

/*
virtual QAction * createAction ( QObject * parent = 0, const QString & name = QString() )
*/
HB_FUNC_STATIC( QUILOADER_CREATEACTION )
{
  QUiLoader * obj = (QUiLoader *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    QAction * ptr = obj->createAction ( OPQOBJECT(1,0), OPQSTRING(2,QString()) );
    _qt4xhb_createReturnClass ( ptr, "QACTION" );
  }
}

/*
virtual QActionGroup * createActionGroup ( QObject * parent = 0, const QString & name = QString() )
*/
HB_FUNC_STATIC( QUILOADER_CREATEACTIONGROUP )
{
  QUiLoader * obj = (QUiLoader *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    QActionGroup * ptr = obj->createActionGroup ( OPQOBJECT(1,0), OPQSTRING(2,QString()) );
    _qt4xhb_createReturnClass ( ptr, "QACTIONGROUP" );
  }
}

/*
virtual QLayout * createLayout ( const QString & className, QObject * parent = 0, const QString & name = QString() )
*/
HB_FUNC_STATIC( QUILOADER_CREATELAYOUT )
{
  QUiLoader * obj = (QUiLoader *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    QLayout * ptr = obj->createLayout ( PQSTRING(1), OPQOBJECT(2,0), OPQSTRING(3,QString()) );
    _qt4xhb_createReturnClass ( ptr, "QLAYOUT" );
  }
}

/*
virtual QWidget * createWidget ( const QString & className, QWidget * parent = 0, const QString & name = QString() )
*/
HB_FUNC_STATIC( QUILOADER_CREATEWIDGET )
{
  QUiLoader * obj = (QUiLoader *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    QWidget * ptr = obj->createWidget ( PQSTRING(1), OPQWIDGET(2,0), OPQSTRING(3,QString()) );
    _qt4xhb_createReturnQWidgetClass ( ptr, "QWIDGET" );
  }
}

/*
bool isLanguageChangeEnabled () const
*/
HB_FUNC_STATIC( QUILOADER_ISLANGUAGECHANGEENABLED )
{
  QUiLoader * obj = (QUiLoader *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    RBOOL( obj->isLanguageChangeEnabled () );
  }
}

/*
QWidget * load ( QIODevice * device, QWidget * parentWidget = 0 )
*/
HB_FUNC_STATIC( QUILOADER_LOAD )
{
  QUiLoader * obj = (QUiLoader *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    QWidget * ptr = obj->load ( PQIODEVICE(1), OPQWIDGET(2,0) );
    _qt4xhb_createReturnQWidgetClass ( ptr, "QWIDGET" );
  }
}

/*
QStringList pluginPaths () const
*/
HB_FUNC_STATIC( QUILOADER_PLUGINPATHS )
{
  QUiLoader * obj = (QUiLoader *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    RQSTRINGLIST( obj->pluginPaths () );
  }
}

/*
void setLanguageChangeEnabled ( bool enabled )
*/
HB_FUNC_STATIC( QUILOADER_SETLANGUAGECHANGEENABLED )
{
  QUiLoader * obj = (QUiLoader *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    obj->setLanguageChangeEnabled ( PBOOL(1) );
  }
  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setWorkingDirectory ( const QDir & dir )
*/
HB_FUNC_STATIC( QUILOADER_SETWORKINGDIRECTORY )
{
  QUiLoader * obj = (QUiLoader *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    obj->setWorkingDirectory ( *PQDIR(1) );
  }
  hb_itemReturn( hb_stackSelfItem() );
}

/*
QDir workingDirectory () const
*/
HB_FUNC_STATIC( QUILOADER_WORKINGDIRECTORY )
{
  QUiLoader * obj = (QUiLoader *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    QDir * ptr = new QDir( obj->workingDirectory () );
    _qt4xhb_createReturnClass ( ptr, "QDIR", true );
  }
}

#pragma ENDDUMP