2009-07-10 22:38 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* source/common/hbver.c
% Deleted unnecessary casts.
* examples/hbmsql/msql.c
* Fixed const warnings.
* examples/hbmake/hbmake.hbp
- examples/hbmake/hbmakec.c
* examples/hbmake/hbmake.prg
* Using portable HB_USERLANG() instead of local Windows-only solution.
- examples/hboleold
- Deleted. It's no longer easy to fix with new const usage.
- examples/hbgf
- Deleted. We have much better GUI examples these days then these
very early ones.
* examples/httpsrv/uhttpdc.c
* Minor formatting.
This commit is contained in:
@@ -17,6 +17,28 @@
|
||||
past entries belonging to author(s): Viktor Szakats.
|
||||
*/
|
||||
|
||||
2009-07-10 22:38 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* source/common/hbver.c
|
||||
% Deleted unnecessary casts.
|
||||
|
||||
* examples/hbmsql/msql.c
|
||||
* Fixed const warnings.
|
||||
|
||||
* examples/hbmake/hbmake.hbp
|
||||
- examples/hbmake/hbmakec.c
|
||||
* examples/hbmake/hbmake.prg
|
||||
* Using portable HB_USERLANG() instead of local Windows-only solution.
|
||||
|
||||
- examples/hboleold
|
||||
- Deleted. It's no longer easy to fix with new const usage.
|
||||
|
||||
- examples/hbgf
|
||||
- Deleted. We have much better GUI examples these days then these
|
||||
very early ones.
|
||||
|
||||
* examples/httpsrv/uhttpdc.c
|
||||
* Minor formatting.
|
||||
|
||||
2009-07-10 21:21 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* include/hbextern.ch
|
||||
+ Added HB_SETCLSHANDLE().
|
||||
|
||||
@@ -1,88 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Harbour GUI framework for Gtk
|
||||
* Class HBButton
|
||||
*
|
||||
* Copyright 2001 Antonio Linares <alinares@fivetech.com>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
* Additional Copyright notes :
|
||||
* adapted for Hgf Gtk by Marek Paliwoda <paliwoda@inetia.pl>
|
||||
*/
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
#include "common.ch"
|
||||
#include "hbclass.ch"
|
||||
#include "harbgtk.ch"
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
CLASS HBButton FROM HBWinControl
|
||||
|
||||
DATA OnClick PROPERTY
|
||||
METHOD New( oContainer )
|
||||
|
||||
ACCESS Caption() INLINE hb_GtkButtonGetText( ::hWnd ) PROPERTY
|
||||
ASSIGN Caption( cNewCaption ) INLINE ;
|
||||
hb_GtkButtonSetText( ::hWnd, cNewCaption )
|
||||
|
||||
ENDCLASS
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
METHOD New( oContainer ) CLASS HBButton
|
||||
::Container := oContainer
|
||||
|
||||
::hWnd := hb_GtkButtonCreate( oContainer:hWnd, ::GetNewID() )
|
||||
|
||||
::XSize := 80
|
||||
::YSize := 25
|
||||
|
||||
hb_GtkWidgetSetSize( ::hWnd, ::YSize, ::XSize )
|
||||
RETURN Self
|
||||
|
||||
/* ********************************************************************* */
|
||||
@@ -1,131 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Harbour GUI framework for Gtk
|
||||
*
|
||||
* Copyright 2001 Marek Paliwoda <paliwoda@inetia.pl>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
#include "harbgtk.h"
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
#include "shared.ch"
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
static gint ButtonClick( GtkWidget *Widget, gpointer Data )
|
||||
{
|
||||
GtkWidget *Form = ( GtkWidget * )gtk_object_get_data( GTK_OBJECT( Widget ), "Form" );
|
||||
return( CallHarbour( Form, Widget, HGF_EV_CLICK, GPOINTER_TO_INT( Data ), ( PHB_ITEM )NULL ) );
|
||||
}
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
HB_FUNC( HB_GTKBUTTONCREATE )
|
||||
{
|
||||
PHB_ITEM hWnd = hb_param( 1, HB_IT_ARRAY );
|
||||
|
||||
if( hWnd )
|
||||
{
|
||||
GtkWindow *Form = ( GtkWindow * )GUINT_TO_POINTER( hb_arrayGetNL( hWnd, 1 ) );
|
||||
GtkLayout *LayO = ( GtkLayout * )GUINT_TO_POINTER( hb_arrayGetNL( hWnd, 4 ) );
|
||||
gint ButtID = ( gint )hb_parni( 2 );
|
||||
|
||||
GtkWidget *Button = gtk_button_new_with_label( "" );
|
||||
gtk_object_set_data( GTK_OBJECT( Button ), "Form", ( gpointer )Form );
|
||||
|
||||
gtk_signal_connect
|
||||
(
|
||||
GTK_OBJECT( Button ),
|
||||
"clicked",
|
||||
GTK_SIGNAL_FUNC( ( GtkSignalFunc ) ButtonClick ),
|
||||
GINT_TO_POINTER( ButtID )
|
||||
);
|
||||
|
||||
if( LayO )
|
||||
gtk_layout_put( LayO, Button, 0, 0 );
|
||||
|
||||
hb_retnl( GPOINTER_TO_UINT( Button ) );
|
||||
}
|
||||
else
|
||||
hb_retnl( GPOINTER_TO_UINT( NULL ) );
|
||||
}
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
HB_FUNC( HB_GTKBUTTONGETTEXT )
|
||||
{
|
||||
GtkButton *Button = ( GtkButton * )GPOINTER_TO_UINT( hb_parnl( 1 ) );
|
||||
if( Button )
|
||||
{
|
||||
GtkLabel *Label = ( GtkLabel * )( GTK_BIN( Button )->child );
|
||||
if( Label )
|
||||
hb_retc( ( char * )Label->label );
|
||||
else
|
||||
hb_retc_null();
|
||||
}
|
||||
else
|
||||
hb_retc_null();
|
||||
}
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
HB_FUNC( HB_GTKBUTTONSETTEXT )
|
||||
{
|
||||
GtkButton *Button = ( GtkButton * )GPOINTER_TO_UINT( hb_parnl( 1 ) );
|
||||
if( Button )
|
||||
{
|
||||
GtkLabel *Label = ( GtkLabel * )( GTK_BIN( Button )->child );
|
||||
if( Label )
|
||||
gtk_label_set_text( Label, hb_parc( 2 ) );
|
||||
}
|
||||
}
|
||||
|
||||
/* ********************************************************************* */
|
||||
@@ -1,171 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Harbour GUI framework for Gtk
|
||||
*
|
||||
* Copyright 2001 Marek Paliwoda <paliwoda@inetia.pl>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
#include "harbgtk.h"
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
#include "shared.ch"
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
HB_FUNC( HB_GTKCREATEMENU )
|
||||
{
|
||||
GtkWidget *Menu = gtk_menu_new();
|
||||
hb_retnl( GPOINTER_TO_UINT( Menu ) );
|
||||
}
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
HB_FUNC( HB_GTKCREATEMENUBAR )
|
||||
{
|
||||
GtkBox *Box = ( GtkBox * )GUINT_TO_POINTER( hb_parnl( 1 ) );
|
||||
if( Box )
|
||||
{
|
||||
GtkWidget *MenuBar = gtk_menu_bar_new();
|
||||
gtk_box_pack_start( Box, MenuBar, FALSE, FALSE, 0 );
|
||||
gtk_box_reorder_child( Box, MenuBar, 0 );
|
||||
|
||||
hb_retnl( GPOINTER_TO_UINT( MenuBar ) );
|
||||
}
|
||||
else
|
||||
hb_retnl( GPOINTER_TO_UINT( NULL ) );
|
||||
}
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
static void ActivateMenuItem( GtkWidget *Widget, gpointer Data )
|
||||
{
|
||||
GtkWidget *Form = ( GtkWidget * )gtk_object_get_data( GTK_OBJECT( Widget ), "Form" );
|
||||
if( !( GTK_MENU_ITEM( Widget )->submenu ) )
|
||||
CallHarbour( Form, Widget, HGF_EV_MENU, GPOINTER_TO_INT( Data ), ( PHB_ITEM )NULL );
|
||||
}
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
HB_FUNC( HB_GTKBARADDMENUITEM )
|
||||
{
|
||||
GtkMenuBar *Bar = ( GtkMenuBar * )GUINT_TO_POINTER( hb_parnl( 1 ) );
|
||||
|
||||
if( Bar )
|
||||
{
|
||||
gchar *Caption = ( gchar * )hb_parc( 2 );
|
||||
gint ItemID = ( gint )hb_parni( 3 );
|
||||
gboolean Enabled = ( gboolean )hb_parl( 4 );
|
||||
GtkWidget *Form = ( GtkWidget * )GUINT_TO_POINTER( hb_parnl( 5 ) );
|
||||
|
||||
GtkWidget *Item = gtk_menu_item_new_with_label( Caption );
|
||||
|
||||
gtk_widget_set_sensitive( Item, Enabled );
|
||||
gtk_object_set_data( GTK_OBJECT( Item ), "Form", ( gpointer )Form );
|
||||
|
||||
gtk_signal_connect
|
||||
(
|
||||
GTK_OBJECT( Item ),
|
||||
"activate",
|
||||
GTK_SIGNAL_FUNC( ( GtkSignalFunc ) ActivateMenuItem ),
|
||||
GINT_TO_POINTER( ItemID )
|
||||
);
|
||||
|
||||
gtk_menu_bar_append( GTK_MENU_BAR( Bar ), Item );
|
||||
hb_retnl( GPOINTER_TO_UINT( Item ) );
|
||||
}
|
||||
else
|
||||
hb_retnl( GPOINTER_TO_UINT( NULL ) );
|
||||
}
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
HB_FUNC( HB_GTKADDMENUITEM )
|
||||
{
|
||||
GtkWidget *Menu = ( GtkWidget * )GUINT_TO_POINTER( hb_parnl( 1 ) );
|
||||
GtkMenuItem *Curr = ( GtkMenuItem * )GUINT_TO_POINTER( hb_parnl( 2 ) );
|
||||
|
||||
if( !Menu )
|
||||
{
|
||||
Menu = gtk_menu_new();
|
||||
gtk_menu_item_set_submenu( Curr, Menu );
|
||||
hb_stornl( GPOINTER_TO_UINT( Menu ), 1 );
|
||||
}
|
||||
|
||||
if( Curr )
|
||||
{
|
||||
GtkWidget *Item = ( GtkWidget * )GUINT_TO_POINTER( hb_parnl( 3 ) );
|
||||
gchar *Caption = ( gchar * )hb_parc( 4 );
|
||||
gint ItemID = ( gint )hb_parni( 5 );
|
||||
gboolean Enabled = ( gboolean )hb_parl( 6 );
|
||||
GtkWidget *Form = ( GtkWidget * )GUINT_TO_POINTER( hb_parnl( 7 ) );
|
||||
|
||||
if( !Item )
|
||||
Item = gtk_menu_item_new_with_label( Caption );
|
||||
|
||||
gtk_widget_set_sensitive( Item, Enabled );
|
||||
gtk_object_set_data( GTK_OBJECT( Item ), "Form", ( gpointer )Form );
|
||||
|
||||
gtk_signal_connect
|
||||
(
|
||||
GTK_OBJECT( Item ),
|
||||
"activate",
|
||||
GTK_SIGNAL_FUNC( ( GtkSignalFunc ) ActivateMenuItem ),
|
||||
GINT_TO_POINTER( ItemID )
|
||||
);
|
||||
|
||||
gtk_menu_append( GTK_MENU( Menu ), Item );
|
||||
hb_retnl( GPOINTER_TO_UINT( Item ) );
|
||||
}
|
||||
else
|
||||
hb_retnl( GPOINTER_TO_UINT( NULL ) );
|
||||
}
|
||||
|
||||
/* ********************************************************************* */
|
||||
@@ -1,280 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Harbour GUI framework for Gtk
|
||||
*
|
||||
* Copyright 2001 Marek Paliwoda <paliwoda@inetia.pl>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
#include "harbgtk.h"
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
#include "shared.ch"
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
static gint DeleteEventWindowCallback( GtkWidget *Widget, GdkEventAny *Event, gpointer Data )
|
||||
{
|
||||
HB_SYMBOL_UNUSED( Event );
|
||||
|
||||
return( CallHarbour( Widget, Widget, HGF_EV_CLOSE, GPOINTER_TO_INT( Data ), ( PHB_ITEM ) NULL ) );
|
||||
}
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
static gint DestroyWindowCallback( GtkWidget *Widget, gpointer Data )
|
||||
{
|
||||
gint Propagate = CallHarbour( Widget, Widget, HGF_EV_DESTROY, GPOINTER_TO_INT( Data ), ( PHB_ITEM )NULL );
|
||||
|
||||
if( !Propagate )
|
||||
{
|
||||
/* the code needs to be added here in the future ? */
|
||||
|
||||
if( Widget == gtk_widget_get_toplevel( Widget ) )
|
||||
gtk_main_quit();
|
||||
}
|
||||
|
||||
return ( Propagate );
|
||||
}
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
static gint ButtonPressCallback( GtkWidget *Widget, GdkEventButton *Event, gpointer Data )
|
||||
{
|
||||
GtkWidget *Form = ( GtkWidget * )gtk_object_get_data( GTK_OBJECT( Widget ), "Form" );
|
||||
gint Propagate = FALSE, ButtonNO = Event->button;
|
||||
|
||||
PHB_ITEM ReturnArray = hb_itemArrayNew( HGF_EVENTDATA_MAXLEN );
|
||||
PHB_ITEM ArrayItem = hb_itemNew( NULL );
|
||||
|
||||
if( !Form )
|
||||
Form = Widget;
|
||||
|
||||
hb_itemPutND( ArrayItem, ( double ) Event->y );
|
||||
hb_itemArrayPut( ReturnArray, 1, ArrayItem );
|
||||
|
||||
hb_itemPutND( ArrayItem, ( double ) Event->x );
|
||||
hb_itemArrayPut( ReturnArray, 2, ArrayItem );
|
||||
|
||||
hb_itemPutNL( ArrayItem, ( long ) Event->state & 0xFF );
|
||||
hb_itemArrayPut( ReturnArray, 3, ArrayItem );
|
||||
|
||||
switch ( ButtonNO )
|
||||
{
|
||||
case 1 :
|
||||
Propagate = CallHarbour( Form, Widget, HGF_EV_LBUTTONPRESSED, GPOINTER_TO_INT( Data ), ReturnArray );
|
||||
break;
|
||||
case 2 :
|
||||
Propagate = CallHarbour( Form, Widget, HGF_EV_RBUTTONPRESSED, GPOINTER_TO_INT( Data ), ReturnArray );
|
||||
break;
|
||||
default :
|
||||
Propagate = CallHarbour( Form, Widget, HGF_EV_MBUTTONPRESSED, GPOINTER_TO_INT( Data ), ReturnArray );
|
||||
break;
|
||||
}
|
||||
|
||||
hb_itemRelease( ReturnArray );
|
||||
hb_itemRelease( ArrayItem );
|
||||
|
||||
return( Propagate );
|
||||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
|
||||
HB_FUNC( HB_GTKWINDOWCREATE )
|
||||
{
|
||||
GtkWidget *MainWin, *VBox, *MoveBar, *MenuBar,
|
||||
*ScrlWin, *LayoutW, *Current;
|
||||
GtkTooltips *ToolTip = NULL;
|
||||
|
||||
/* for the future enhancements */
|
||||
gint YSize=400, XSize=500;
|
||||
|
||||
gint WinID = ( gint ) hb_parni( 1 );
|
||||
|
||||
MainWin = gtk_window_new( GTK_WINDOW_TOPLEVEL );
|
||||
gtk_window_set_default_size( GTK_WINDOW( MainWin ), XSize, YSize );
|
||||
gtk_window_set_policy( GTK_WINDOW( MainWin ), TRUE, TRUE, FALSE );
|
||||
|
||||
VBox = gtk_vbox_new( FALSE, 1 );
|
||||
gtk_container_add( GTK_CONTAINER( MainWin ), VBox );
|
||||
|
||||
/* for the future enhancements */
|
||||
Current = VBox;
|
||||
|
||||
LayoutW = gtk_layout_new( NULL, NULL );
|
||||
/* gtk_layout_set_size( GTK_LAYOUT( LayoutW ), XSize, YSize ); */
|
||||
gtk_box_pack_start( GTK_BOX( Current ), LayoutW, TRUE, TRUE, 0 );
|
||||
|
||||
gtk_signal_connect
|
||||
(
|
||||
GTK_OBJECT( MainWin ),
|
||||
"delete_event",
|
||||
GTK_SIGNAL_FUNC( ( GtkSignalFunc ) DeleteEventWindowCallback ),
|
||||
GINT_TO_POINTER( WinID )
|
||||
);
|
||||
|
||||
gtk_signal_connect
|
||||
(
|
||||
GTK_OBJECT( MainWin ),
|
||||
"destroy",
|
||||
GTK_SIGNAL_FUNC( ( GtkSignalFunc ) DestroyWindowCallback ),
|
||||
GINT_TO_POINTER( WinID )
|
||||
);
|
||||
|
||||
gtk_widget_add_events( MainWin, GDK_BUTTON_PRESS_MASK );
|
||||
gtk_signal_connect
|
||||
(
|
||||
GTK_OBJECT( MainWin ),
|
||||
"button_press_event",
|
||||
GTK_SIGNAL_FUNC( ButtonPressCallback ),
|
||||
GINT_TO_POINTER( WinID )
|
||||
);
|
||||
|
||||
ScrlWin = MoveBar = MenuBar = NULL;
|
||||
|
||||
{
|
||||
PHB_ITEM ReturnArray, ArrayItem;
|
||||
|
||||
ReturnArray = hb_itemArrayNew( 7 );
|
||||
ArrayItem = hb_itemNew( NULL );
|
||||
|
||||
hb_itemPutNL( ArrayItem, GPOINTER_TO_UINT( MainWin ) );
|
||||
hb_itemArrayPut( ReturnArray, 1, ArrayItem );
|
||||
|
||||
hb_itemPutNL( ArrayItem, GPOINTER_TO_UINT( VBox ) );
|
||||
hb_itemArrayPut( ReturnArray, 2, ArrayItem );
|
||||
|
||||
hb_itemPutNL( ArrayItem, GPOINTER_TO_UINT( ScrlWin ) );
|
||||
hb_itemArrayPut( ReturnArray, 3, ArrayItem );
|
||||
|
||||
hb_itemPutNL( ArrayItem, GPOINTER_TO_UINT( LayoutW ) );
|
||||
hb_itemArrayPut( ReturnArray, 4, ArrayItem );
|
||||
|
||||
hb_itemPutNL( ArrayItem, GPOINTER_TO_UINT( MoveBar ) );
|
||||
hb_itemArrayPut( ReturnArray, 5, ArrayItem );
|
||||
|
||||
hb_itemPutNL( ArrayItem, GPOINTER_TO_UINT( MenuBar ) );
|
||||
hb_itemArrayPut( ReturnArray, 6, ArrayItem );
|
||||
|
||||
hb_itemPutNL( ArrayItem, GPOINTER_TO_UINT( ToolTip ) );
|
||||
hb_itemArrayPut( ReturnArray, 7, ArrayItem );
|
||||
|
||||
hb_itemReturn( ReturnArray );
|
||||
hb_itemRelease( ReturnArray );
|
||||
hb_itemRelease( ArrayItem );
|
||||
}
|
||||
}
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
HB_FUNC( HB_GTKWINDOWGETTEXT )
|
||||
{
|
||||
PHB_ITEM hWnd = hb_param( 1, HB_IT_ARRAY );
|
||||
|
||||
if( hWnd )
|
||||
{
|
||||
GtkWindow *Win = ( GtkWindow * )GUINT_TO_POINTER( hb_arrayGetNL( hWnd, 1 ) );
|
||||
hb_retc( ( char * )Win->title );
|
||||
}
|
||||
else
|
||||
hb_retc_null();
|
||||
}
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
HB_FUNC( HB_GTKWINDOWSETTEXT )
|
||||
{
|
||||
PHB_ITEM hWnd = hb_param( 1, HB_IT_ARRAY );
|
||||
|
||||
if( hWnd )
|
||||
{
|
||||
gchar *Title = hb_parc( 2 );
|
||||
GtkWindow *Win = ( GtkWindow * )GUINT_TO_POINTER( hb_arrayGetNL( hWnd, 1 ) );
|
||||
gtk_window_set_title( Win, Title );
|
||||
}
|
||||
}
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
HB_FUNC( HB_GTKSHOWMODAL )
|
||||
{
|
||||
PHB_ITEM hWnd = hb_param( 1, HB_IT_ARRAY );
|
||||
|
||||
if( hWnd )
|
||||
{
|
||||
GtkWidget *Win = ( GtkWidget * )GUINT_TO_POINTER( hb_arrayGetNL( hWnd, 1 ) );
|
||||
gtk_widget_show_all( Win );
|
||||
/* NOTE : this does not make any sense. It is only an example */
|
||||
gtk_main();
|
||||
}
|
||||
}
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
HB_FUNC( HB_GTKWINDOWREQUESTDELETE )
|
||||
{
|
||||
GtkWidget *Widget;
|
||||
PHB_ITEM hWnd = hb_param( 1, HB_IT_ARRAY );
|
||||
|
||||
if( hWnd )
|
||||
Widget = ( GtkWidget * )GUINT_TO_POINTER( hb_arrayGetNL( hWnd, 1 ) );
|
||||
else
|
||||
Widget = ( GtkWidget * )GUINT_TO_POINTER( hb_parnl( 1 ) );
|
||||
|
||||
if( Widget )
|
||||
{
|
||||
GdkEvent Event;
|
||||
Event.type = GDK_DELETE;
|
||||
Event.any.window = Widget->window;
|
||||
gdk_event_put( &Event );
|
||||
}
|
||||
}
|
||||
|
||||
/* ********************************************************************* */
|
||||
@@ -1,87 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Harbour GUI framework for Gtk
|
||||
*
|
||||
* Copyright 2001 Marek Paliwoda <paliwoda@inetia.pl>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
|
||||
/* ************************************************************************* */
|
||||
|
||||
#include "harbgtk.h"
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
#include "shared.ch"
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
glong CallHarbour( GtkWidget *hWnd, GtkWidget *Widget, glong Command, gint ObjId, PHB_ITEM aParam )
|
||||
{
|
||||
PHB_DYNS pDynSym = hb_dynsymFind( "HB_GUI" );
|
||||
|
||||
if( pDynSym )
|
||||
{
|
||||
hb_vmPushDynSym( pDynSym );
|
||||
hb_vmPushNil();
|
||||
hb_vmPushLong( GPOINTER_TO_UINT( hWnd ) );
|
||||
hb_vmPushLong( GPOINTER_TO_UINT( Widget ) );
|
||||
hb_vmPushLong( Command );
|
||||
hb_vmPushInteger( ObjId );
|
||||
if( aParam )
|
||||
hb_vmPush( aParam );
|
||||
else
|
||||
hb_vmPushNil();
|
||||
hb_vmDo( 5 );
|
||||
|
||||
return hb_parni( -1 );
|
||||
}
|
||||
else
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
/* ********************************************************************* */
|
||||
@@ -1,223 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Harbour GUI framework for Gtk
|
||||
* Class HBForm
|
||||
*
|
||||
* Copyright 2001 Antonio Linares <alinares@fivetech.com>
|
||||
* Copyright 2001 Alexander Kresin <alex@belacy.belgorod.su>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
* Additional Copyright notes :
|
||||
* adapted for Hgf Gtk by Marek Paliwoda <paliwoda@inetia.pl>
|
||||
*/
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
#include "common.ch"
|
||||
#include "hbclass.ch"
|
||||
#include "harbgtk.ch"
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
static aForms := {}
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
CLASS HBForm FROM HBWinControl
|
||||
|
||||
DATA oMainMenu
|
||||
|
||||
DATA aControls INIT {} PROPERTY
|
||||
DATA OnClick PROPERTY
|
||||
|
||||
CLASSDATA lRegistered INIT .T.
|
||||
|
||||
ACCESS Caption() INLINE hb_GtkWindowGetText( ::hWnd ) PROPERTY
|
||||
ASSIGN Caption( cNewCaption ) INLINE ;
|
||||
hb_GtkWindowSetText( ::hWnd, cNewCaption )
|
||||
|
||||
METHOD New()
|
||||
/* NOTE: currently ::Close() probably does not work as in Hgf Win */
|
||||
METHOD Close() INLINE hb_GtkWindowRequestDelete( ::hWnd )
|
||||
METHOD Command( nCmd, nID, aEventData )
|
||||
METHOD CtrlCommand( nCmd, nID, aEventData )
|
||||
METHOD LButtonDown( nCmd, nID, aEventData )
|
||||
METHOD HandleEvent( nCmd, nID, aEventData )
|
||||
METHOD ShowModal()
|
||||
|
||||
METHOD InsertControl( oControl )
|
||||
|
||||
ACCESS Menu() INLINE ::oMainMenu PROPERTY
|
||||
ASSIGN Menu( oNewMenu )
|
||||
|
||||
ENDCLASS
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
METHOD New() CLASS HBForm
|
||||
/* HBForm is derived from HBWinControl so we should set its nID */
|
||||
::hWnd := hb_GtkWindowCreate( ::GetNewID() )
|
||||
::YSize := 400
|
||||
::XSize := 500
|
||||
AAdd( aForms, Self )
|
||||
RETURN Self
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
/* it is only for menu commands so it should be named MenuCommand() or so */
|
||||
METHOD Command( nCmd, nID, aEventData ) CLASS HBForm
|
||||
LOCAL oMenuItem
|
||||
|
||||
HB_SYMBOL_UNUSED( nCmd )
|
||||
HB_SYMBOL_UNUSED( aEventData )
|
||||
|
||||
IF ::Menu != nil
|
||||
IF ( oMenuItem := ::Menu:FindItem( nId ) ) != nil
|
||||
IF oMenuItem:OnClick != nil
|
||||
__ObjSendMsg( Self, oMenuItem:OnClick, oMenuItem )
|
||||
ENDIF
|
||||
ENDIF
|
||||
ENDIF
|
||||
RETURN nil
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
METHOD CtrlCommand( nCmd, nID, aEventData ) CLASS HBForm
|
||||
LOCAL nAt, oControl
|
||||
|
||||
HB_SYMBOL_UNUSED( nCmd )
|
||||
HB_SYMBOL_UNUSED( aEventData )
|
||||
|
||||
IF ( nAt := AScan( ::aControls, { | o | o:nID == nID } ) ) != 0
|
||||
oControl := ::aControls[ nAt ]
|
||||
IF oControl:OnClick != nil
|
||||
__ObjSendMsg( Self, oControl:OnClick, oControl )
|
||||
ENDIF
|
||||
ENDIF
|
||||
/* NOTE: currently return value is not portable. Needs fixing */
|
||||
RETURN 1
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
METHOD LButtonDown( nCmd, nID, aEventData ) CLASS HBForm
|
||||
|
||||
HB_SYMBOL_UNUSED( nCmd )
|
||||
HB_SYMBOL_UNUSED( nID )
|
||||
|
||||
IF ::OnClick != nil
|
||||
/* NOTE: aEventData[ 1 ] conatins mouse y position */
|
||||
/* aEventData[ 2 ] conatins mouse x position */
|
||||
/* aEventData[ 3 ] conatins keyboard modifiers */
|
||||
__ObjSendMsg( Self, ::OnClick, Self, aEventData )
|
||||
ENDIF
|
||||
/* NOTE: currently return value is not portable. Needs fixing */
|
||||
RETURN 1
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
/* NOTE: aEventData should be well defined because of portability reasons */
|
||||
/* it could be an array with additional parameters - like mouse x and y */
|
||||
/* position, keyboard state, time of the event, and so on */
|
||||
METHOD HandleEvent( nCmd, nID, aEventData ) CLASS HBForm
|
||||
DO CASE
|
||||
CASE nCmd == HGF_EV_MENU
|
||||
RETURN ::Command( nCmd, nID, aEventData )
|
||||
|
||||
CASE nCmd == HGF_EV_CLICK
|
||||
RETURN ::CtrlCommand( nCmd, nID, aEventData )
|
||||
|
||||
CASE nCmd == HGF_EV_LBUTTONPRESSED
|
||||
RETURN ::LButtonDown( nCmd, nID, aEventData )
|
||||
|
||||
CASE nCmd == HGF_EV_RBUTTONPRESSED
|
||||
/* NOTE: currently return value is not portable. Needs fixing */
|
||||
RETURN 1
|
||||
|
||||
CASE nCmd == HGF_EV_DESTROY
|
||||
/* NOTE: currently return value is not portable. Needs fixing */
|
||||
RETURN 0
|
||||
|
||||
CASE nCmd == HGF_EV_CLOSE
|
||||
/* NOTE: currently return value is not portable. Needs fixing */
|
||||
RETURN 0
|
||||
|
||||
ENDCASE
|
||||
RETURN nil
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
METHOD ShowModal() CLASS HBForm
|
||||
hb_GtkShowModal( ::hWnd )
|
||||
RETURN nil
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
METHOD InsertControl( oControl ) CLASS HBForm
|
||||
AAdd( ::aControls, oControl )
|
||||
oControl:Show()
|
||||
RETURN nil
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
ASSIGN Menu( oNewMenu ) CLASS HBForm
|
||||
::oMainMenu := oNewMenu
|
||||
RETURN nil
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
// messages entry point - I think it can be different for different GUIs
|
||||
FUNCTION HB_GUI( hWnd, Widget, nCmd, nID, aEventData )
|
||||
LOCAL aReturn := 0
|
||||
LOCAL nForm := AScan( aForms, { | oForm | oForm:hWnd[ 1 ] == hWnd } )
|
||||
|
||||
HB_SYMBOL_UNUSED( Widget )
|
||||
|
||||
IF nForm != 0
|
||||
aReturn := aForms[ nForm ]:HandleEvent( nCmd, nID, aEventData )
|
||||
ENDIF
|
||||
RETURN aReturn
|
||||
|
||||
/* ********************************************************************* */
|
||||
@@ -1,177 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Harbour GUI framework for Gtk
|
||||
*
|
||||
* Copyright 2001 Marek Paliwoda <paliwoda@inetia.pl>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
#include "harbgtk.h"
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
#include "shared.ch"
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
HB_FUNC( HB_GTKSHOWWIDGET )
|
||||
{
|
||||
GtkWidget *Widget;
|
||||
PHB_ITEM hWnd = hb_param( 1, HB_IT_ARRAY );
|
||||
|
||||
if( hWnd )
|
||||
Widget = ( GtkWidget * )GUINT_TO_POINTER( hb_arrayGetNL( hWnd, 1 ) );
|
||||
else
|
||||
Widget = ( GtkWidget * )GUINT_TO_POINTER( hb_parnl( 1 ) );
|
||||
|
||||
if( Widget )
|
||||
gtk_widget_show( Widget );
|
||||
}
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
HB_FUNC( HB_GTKDESTROYWIDGET )
|
||||
{
|
||||
GtkWidget *Widget;
|
||||
PHB_ITEM hWnd = hb_param( 1, HB_IT_ARRAY );
|
||||
|
||||
if( hWnd )
|
||||
Widget = ( GtkWidget * )GUINT_TO_POINTER( hb_arrayGetNL( hWnd, 1 ) );
|
||||
else
|
||||
Widget = ( GtkWidget * )GUINT_TO_POINTER( hb_parnl( 1 ) );
|
||||
|
||||
if( Widget )
|
||||
gtk_widget_destroy( Widget );
|
||||
}
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
HB_FUNC( HB_GTKWIDGETSETPOS )
|
||||
{
|
||||
GtkWidget *Widget;
|
||||
PHB_ITEM hWnd = hb_param( 1, HB_IT_ARRAY );
|
||||
|
||||
if( hWnd )
|
||||
Widget = ( GtkWidget * )GUINT_TO_POINTER( hb_arrayGetNL( hWnd, 1 ) );
|
||||
else
|
||||
Widget = ( GtkWidget * )GUINT_TO_POINTER( hb_parnl( 1 ) );
|
||||
|
||||
if( Widget )
|
||||
gtk_widget_set_uposition( Widget, hb_parni( 3 ), hb_parni( 2 ) );
|
||||
}
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
HB_FUNC( HB_GTKWIDGETSETSIZE )
|
||||
{
|
||||
PHB_ITEM hWnd = hb_param( 1, HB_IT_ARRAY );
|
||||
GtkWidget *Widget;
|
||||
|
||||
if( hWnd )
|
||||
{
|
||||
Widget = ( GtkWidget * )GUINT_TO_POINTER( hb_arrayGetNL( hWnd, 1 ) );
|
||||
if( Widget )
|
||||
gtk_window_set_default_size( GTK_WINDOW( Widget ), hb_parni( 3 ), hb_parni( 2 ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
Widget = ( GtkWidget * )GUINT_TO_POINTER( hb_parnl( 1 ) );
|
||||
if( Widget )
|
||||
gtk_widget_set_usize( Widget, hb_parni( 3 ), hb_parni( 2 ) );
|
||||
}
|
||||
}
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
HB_FUNC( HB_GTKWIDGETGETGEOMETRY )
|
||||
{
|
||||
PHB_ITEM hWnd = hb_param( 1, HB_IT_ARRAY );
|
||||
GtkWidget *Widget;
|
||||
|
||||
if( hWnd )
|
||||
{
|
||||
Widget = ( GtkWidget * )GUINT_TO_POINTER( hb_arrayGetNL( hWnd, 1 ) );
|
||||
|
||||
if( Widget && GTK_WIDGET_REALIZED( Widget ) )
|
||||
{
|
||||
gint x, y, w, h;
|
||||
gdk_window_get_origin( Widget->window, &x, &y );
|
||||
gdk_window_get_size( Widget->window, &w, &h );
|
||||
|
||||
switch ( hb_parni( 2 ) )
|
||||
{
|
||||
case 1: hb_retni( y ); break;
|
||||
case 2: hb_retni( x ); break;
|
||||
case 3: hb_retni( h ); break;
|
||||
case 4: hb_retni( w ); break;
|
||||
default: hb_retni( HGF_GTK_WIDGET_GEOMETRY_UNKNOWN );
|
||||
}
|
||||
}
|
||||
else
|
||||
hb_retni( HGF_GTK_WIDGET_GEOMETRY_UNKNOWN );
|
||||
}
|
||||
else
|
||||
{
|
||||
Widget = ( GtkWidget * )GUINT_TO_POINTER( hb_parnl( 1 ) );
|
||||
|
||||
if( Widget && GTK_WIDGET_REALIZED( Widget ) )
|
||||
switch ( hb_parni( 2 ) )
|
||||
{
|
||||
case 1: hb_retni( Widget->allocation.y ); break;
|
||||
case 2: hb_retni( Widget->allocation.x ); break;
|
||||
case 3: hb_retni( Widget->allocation.height ); break;
|
||||
case 4: hb_retni( Widget->allocation.width ); break;
|
||||
default: hb_retni( HGF_GTK_WIDGET_GEOMETRY_UNKNOWN );
|
||||
}
|
||||
else
|
||||
hb_retni( HGF_GTK_WIDGET_GEOMETRY_UNKNOWN );
|
||||
}
|
||||
}
|
||||
|
||||
/* ********************************************************************* */
|
||||
@@ -1,57 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Harbour GUI framework for Gtk
|
||||
*
|
||||
* Copyright 2001 Marek Paliwoda <paliwoda@inetia.pl>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
#include "shared.ch"
|
||||
|
||||
/* ********************************************************************* */
|
||||
@@ -1,77 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Harbour GUI framework for Gtk
|
||||
*
|
||||
* Copyright 2001 Marek Paliwoda <paliwoda@inetia.pl>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
|
||||
/* ************************************************************************* */
|
||||
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include <hbapi.h>
|
||||
#include <hbapiitm.h>
|
||||
#include <hbstack.h>
|
||||
#include <hbvm.h>
|
||||
|
||||
#include "shared.ch"
|
||||
|
||||
/* ************************************************************************* */
|
||||
|
||||
/* default MultiLine delimiters - they allow to divide */
|
||||
/* single string into MultiLine string by putting these */
|
||||
/* delimiters into it */
|
||||
extern const gchar *MultiLineDelimiters;
|
||||
|
||||
/* ************************************************************************* */
|
||||
|
||||
/* calls Harbour level dispatcher */
|
||||
glong CallHarbour( GtkWidget *hWnd, GtkWidget *Widget, glong Command, gint ObjId, PHB_ITEM aParam );
|
||||
|
||||
/* ************************************************************************* */
|
||||
@@ -1,28 +0,0 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
-hblib
|
||||
-ohbgfgtk
|
||||
-inc
|
||||
-q0 -w3 -es2 -l
|
||||
-i${HB_INC_GTK}
|
||||
|
||||
-inctrypath={linux}/usr/include
|
||||
-inctrypath={linux}/usr/include/glib-2.0
|
||||
|
||||
"-cflag=`pkg-config --cflags gtk+-2.0`"
|
||||
|
||||
creawin.c
|
||||
general.c
|
||||
creamenu.c
|
||||
creabutt.c
|
||||
dispatch.c
|
||||
msginfo.c
|
||||
mainlgtk.c
|
||||
|
||||
form.prg
|
||||
menu.prg
|
||||
button.prg
|
||||
menuitem.prg
|
||||
winctrl.prg
|
||||
@@ -1,76 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Linux GTK application entry point
|
||||
*
|
||||
* Copyright 2001 Marek Paliwoda <paliwoda@inetia.pl>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "hbapi.h"
|
||||
#include "hbvm.h"
|
||||
|
||||
int main( int argc, char * argv[] )
|
||||
{
|
||||
HB_TRACE(HB_TR_DEBUG, ("main(%d, %p)", argc, argv));
|
||||
|
||||
gtk_set_locale();
|
||||
|
||||
if( gtk_init_check( &argc, &argv ) )
|
||||
{
|
||||
hb_cmdargInit( argc, argv );
|
||||
hb_vmInit( TRUE );
|
||||
return hb_vmQuit();
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf( stderr, "%s\n", "Could not initialize GTK++ subsystem" );
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -1,136 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Harbour GUI framework for Gtk
|
||||
* Class HBMenu
|
||||
*
|
||||
* Copyright 2001 Antonio Linares <alinares@fivetech.com>
|
||||
* Copyright 2001 Maurilio Longo <maurilio.longo@libero.it>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
* Additional Copyright notes :
|
||||
* adapted for Hgf Gtk by Marek Paliwoda <paliwoda@inetia.pl>
|
||||
*/
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
#include "hbclass.ch"
|
||||
#include "harbgtk.ch"
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
CLASS HBMenu FROM HBPersistent
|
||||
|
||||
DATA nHandle
|
||||
DATA Items PROPERTY INIT {}
|
||||
|
||||
DATA Container
|
||||
|
||||
METHOD New( oForm )
|
||||
METHOD Add( oMenuItem )
|
||||
METHOD FindItem( nId ) // Searches for a sub menuitem given its id
|
||||
|
||||
HIDDEN:
|
||||
DATA nType
|
||||
|
||||
ENDCLASS
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
METHOD New( oForm ) CLASS HBMenu
|
||||
IF oForm != nil
|
||||
::Container := oForm
|
||||
::nHandle := hb_GtkCreateMenuBar( oForm:hWnd[ 2 ] )
|
||||
oForm:hWnd[ 6 ] := ::nHandle
|
||||
::nType := HBGTKMENUTYPEBAR
|
||||
ELSE
|
||||
::nHandle := hb_GtkCreateMenu()
|
||||
::nType := HBGTKMENUTYPEPOP
|
||||
ENDIF
|
||||
RETURN Self
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
METHOD Add( oMenuItem ) CLASS HBMenu
|
||||
/* required because of a stupid Harbour compiler error */
|
||||
LOCAL nHandle := ::nHandle
|
||||
|
||||
IF oMenuItem != nil
|
||||
IF ::nType == HBGTKMENUTYPEBAR
|
||||
oMenuItem:hMenuItem := hb_GtkBarAddMenuItem( ::nHandle, ;
|
||||
oMenuItem:Caption, oMenuItem:nId, oMenuItem:Enabled, ;
|
||||
::Container:hWnd[ 1 ] )
|
||||
ELSE
|
||||
oMenuItem:hMenuItem := hb_GtkAddMenuItem( @nHandle, ::nHandle, ;
|
||||
oMenuItem:hMenuItem, oMenuItem:Caption, oMenuItem:nId, ;
|
||||
oMenuItem:Enabled, ::Container:hWnd[ 1 ] )
|
||||
|
||||
//::nHandle := nHandle
|
||||
ENDIF
|
||||
|
||||
oMenuItem:oParent := Self
|
||||
AAdd( ::Items, oMenuItem )
|
||||
ENDIF
|
||||
RETURN nil
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
METHOD FindItem( nId ) CLASS HBMenu
|
||||
LOCAL oMenuItem, n
|
||||
|
||||
FOR n := 1 TO Len( ::Items )
|
||||
IF ( oMenuItem := ::Items[ n ] ):nId == nId
|
||||
RETURN oMenuItem
|
||||
ELSE
|
||||
IF oMenuItem:Items != nil
|
||||
IF ( oMenuItem := oMenuItem:FindItem( nId ) ) != nil
|
||||
RETURN oMenuItem
|
||||
ENDIF
|
||||
ENDIF
|
||||
ENDIF
|
||||
NEXT
|
||||
RETURN oMenuItem
|
||||
|
||||
/* ********************************************************************* */
|
||||
@@ -1,134 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Harbour GUI framework for Gtk
|
||||
* Class HGFMenuItem
|
||||
*
|
||||
* Copyright 2001 Antonio Linares <alinares@fivetech.com>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
* Additional Copyright notes :
|
||||
* adapted for Hgf Gtk by Marek Paliwoda <paliwoda@inetia.pl>
|
||||
*/
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
#include "common.ch"
|
||||
#include "hbclass.ch"
|
||||
#include "harbgtk.ch"
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
CLASS HGFMenuItem FROM HBPersistent
|
||||
|
||||
DATA Caption INIT "" PROPERTY // Specifies the text of the menu item
|
||||
DATA Name PROPERTY // The name of this component
|
||||
DATA OnClick PROPERTY // A character description of the method to invoke
|
||||
DATA Enabled INIT .T. PROPERTY // Specifies whether the menu item is enabled
|
||||
DATA Items INIT {} PROPERTY // Contains the menu items in the submenu of the menu item
|
||||
|
||||
DATA nId // Command value to send to the container form
|
||||
DATA oParent // Identifies the parent menu item of this menu item
|
||||
DATA Container
|
||||
|
||||
DATA nHandle INIT 0 // The handle of the submenu of this menu item
|
||||
DATA hMenuItem INIT 0 // The handle of this menu item
|
||||
|
||||
CLASSDATA nIdStart INIT 110 // start value for commands value to assign to menu items
|
||||
|
||||
METHOD New( oOwner ) // Creates a new menu item
|
||||
METHOD Add( oMenuItem ) // Adds a new drop down menu item
|
||||
METHOD FindItem( nId ) // Searches for a sub menuitem given its id
|
||||
|
||||
ENDCLASS
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
METHOD New( oOwner ) CLASS HGFMenuItem
|
||||
|
||||
::nId := ::nIdStart++
|
||||
IF oOwner != nil
|
||||
::Container := oOwner:Container
|
||||
ENDIF
|
||||
::oParent := oOwner
|
||||
|
||||
// NOTE : physical creation is delayed until MenuItem is added to a parent
|
||||
RETURN Self
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
METHOD Add( oMenuItem ) CLASS HGFMenuItem
|
||||
/* required because of a stupid Harbour compiler error */
|
||||
LOCAL nHandle := ::nHandle
|
||||
|
||||
oMenuItem:hMenuItem := hb_GtkAddMenuItem( @nHandle, ::hMenuItem, ;
|
||||
oMenuItem:hMenuItem, oMenuItem:Caption, oMenuItem:nId, ;
|
||||
oMenuItem:Enabled, ::Container:hWnd[ 1 ] )
|
||||
|
||||
::nHandle := nHandle
|
||||
|
||||
oMenuItem:oParent := Self
|
||||
AAdd( ::Items, oMenuItem )
|
||||
RETURN nil
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
METHOD FindItem( nId ) CLASS HGFMenuItem
|
||||
LOCAL oMenuItem, n
|
||||
|
||||
FOR n := 1 TO Len( ::Items )
|
||||
IF ( oMenuItem := ::Items[ n ] ):nId == nId
|
||||
RETURN oMenuItem
|
||||
ELSE
|
||||
IF oMenuItem:Items != nil
|
||||
IF ( oMenuItem := oMenuItem:FindItem( nId ) ) != nil
|
||||
RETURN oMenuItem
|
||||
ENDIF
|
||||
ENDIF
|
||||
ENDIF
|
||||
NEXT
|
||||
RETURN oMenuItem
|
||||
|
||||
/* ********************************************************************* */
|
||||
@@ -1,130 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Harbour GUI framework for Gtk
|
||||
*
|
||||
* Copyright 2001 Marek Paliwoda <paliwoda@inetia.pl>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
#include "harbgtk.h"
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
#include "shared.ch"
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
const gchar * MultiLineDelimiters = "\n\r";
|
||||
|
||||
static void GtkMsgInfoCallback( GtkWidget *Widget, gpointer Data )
|
||||
{
|
||||
HB_SYMBOL_UNUSED( Widget );
|
||||
|
||||
if( GTK_IS_WIDGET( ( GtkWidget * ) Data ) )
|
||||
gtk_widget_destroy( ( GtkWidget * ) Data );
|
||||
|
||||
gtk_main_quit();
|
||||
}
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
HB_FUNC( MSGINFO )
|
||||
{
|
||||
gchar *Message = g_strdelimit(
|
||||
( gchar * ) hb_parc( 1 ),
|
||||
MultiLineDelimiters, '\n'
|
||||
);
|
||||
GtkWidget *InfoWin = gtk_dialog_new();
|
||||
GtkWidget *Label = gtk_label_new( Message );
|
||||
GtkWidget *BtnOK = gtk_button_new_with_label( "Ok" );
|
||||
|
||||
gtk_window_set_title( GTK_WINDOW( InfoWin ), "Message" );
|
||||
gtk_window_set_position( GTK_WINDOW( InfoWin ), GTK_WIN_POS_CENTER );
|
||||
gtk_container_border_width( GTK_CONTAINER( InfoWin ), 0 );
|
||||
gtk_container_border_width
|
||||
(
|
||||
GTK_CONTAINER( GTK_BOX( GTK_DIALOG( InfoWin )->vbox ) ), 5
|
||||
);
|
||||
|
||||
gtk_window_set_modal( GTK_WINDOW( InfoWin ), TRUE );
|
||||
gtk_window_set_policy( GTK_WINDOW( InfoWin ), FALSE, FALSE, FALSE );
|
||||
|
||||
gtk_signal_connect
|
||||
(
|
||||
GTK_OBJECT( InfoWin ),
|
||||
"destroy",
|
||||
GTK_SIGNAL_FUNC( ( GtkSignalFunc ) GtkMsgInfoCallback ),
|
||||
NULL
|
||||
);
|
||||
|
||||
gtk_signal_connect
|
||||
(
|
||||
GTK_OBJECT( BtnOK ),
|
||||
"clicked",
|
||||
GTK_SIGNAL_FUNC( ( GtkSignalFunc ) GtkMsgInfoCallback ),
|
||||
( gpointer ) InfoWin
|
||||
);
|
||||
|
||||
gtk_box_pack_start
|
||||
(
|
||||
GTK_BOX( GTK_BOX( GTK_DIALOG( InfoWin )->vbox ) ),
|
||||
Label, TRUE, TRUE, 10
|
||||
);
|
||||
|
||||
gtk_box_pack_start
|
||||
(
|
||||
GTK_BOX( GTK_BOX( GTK_DIALOG( InfoWin )->action_area ) ),
|
||||
BtnOK, TRUE, TRUE, 10
|
||||
);
|
||||
|
||||
gtk_widget_show_all( InfoWin );
|
||||
gtk_main();
|
||||
}
|
||||
|
||||
/* ********************************************************************* */
|
||||
@@ -1,77 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Harbour GUI framework for Gtk
|
||||
*
|
||||
* Copyright 2001 Marek Paliwoda <paliwoda@inetia.pl>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
|
||||
/* ************************************************************************* */
|
||||
|
||||
#define HGF_EV_MENU 0x0001
|
||||
#define HGF_EV_CLICK 0x0002
|
||||
#define HGF_EV_CLOSE 0x0003
|
||||
#define HGF_EV_DESTROY 0x0004
|
||||
#define HGF_EV_LBUTTONPRESSED 0x0005
|
||||
#define HGF_EV_RBUTTONPRESSED 0x0006
|
||||
#define HGF_EV_MBUTTONPRESSED 0x0007
|
||||
|
||||
/* ************************************************************************* */
|
||||
|
||||
#define HGF_EVENTDATA_MAXLEN 3
|
||||
|
||||
/* ************************************************************************* */
|
||||
|
||||
/* These are for HGF GTK only */
|
||||
|
||||
/* Harbour equivalent menu types of GTK+ menu types */
|
||||
#define HBGTKMENUTYPEBAR 0
|
||||
#define HBGTKMENUTYPEPOP 1
|
||||
|
||||
#define HGF_GTK_WIDGET_GEOMETRY_UNKNOWN -99999
|
||||
|
||||
/* ************************************************************************* */
|
||||
@@ -1,144 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Harbour GUI framework for Gtk
|
||||
* Class HBWinControl
|
||||
*
|
||||
* Copyright 2001 Antonio Linares <alinares@fivetech.com>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
* Additional Copyright notes :
|
||||
* adapted for Hgf Gtk by Marek Paliwoda <paliwoda@inetia.pl>
|
||||
*/
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
#include "common.ch"
|
||||
#include "hbclass.ch"
|
||||
#include "harbgtk.ch"
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
CLASS HBWinControl FROM HBPersistent
|
||||
|
||||
//PROTECTED:
|
||||
/* should be PROTECTED */
|
||||
EXPORTED:
|
||||
/* NOTE: because I didn't find a way to set Top and Left or Width */
|
||||
/* and Height individualy, and because Widget geometry is unknown */
|
||||
/* until it is realized I had to introduce these vars */
|
||||
DATA YPos INIT 0
|
||||
DATA XPos INIT 0
|
||||
DATA YSize INIT 1
|
||||
DATA XSize INIT 1
|
||||
|
||||
EXPORTED:
|
||||
DATA hWnd
|
||||
DATA nId
|
||||
DATA Container
|
||||
|
||||
CLASSDATA nInitId INIT 1
|
||||
|
||||
ACCESS Caption() INLINE "" PROPERTY // should be virtual for Gtk
|
||||
ASSIGN Caption( cNewCaption ) INLINE cNewCaption // should be virtual for Gtk
|
||||
|
||||
ACCESS Top() PROPERTY
|
||||
ASSIGN Top( nNewTop ) INLINE ::YPos := nNewTop, ;
|
||||
hb_GtkWidgetSetPos( ::hWnd, ::YPos, ::XPos )
|
||||
|
||||
ACCESS Left() PROPERTY
|
||||
ASSIGN Left( nNewLeft ) INLINE ::XPos := nNewLeft, ;
|
||||
hb_GtkWidgetSetPos( ::hWnd, ::YPos, ::XPos )
|
||||
|
||||
ACCESS Height() PROPERTY
|
||||
ASSIGN Height( nNewHeight ) INLINE ::YSize := nNewHeight, ;
|
||||
hb_GtkWidgetSetSize( ::hWnd, ::YSize, ::XSize )
|
||||
|
||||
ACCESS Width() PROPERTY
|
||||
ASSIGN Width( nNewWidth ) INLINE ::XSize := nNewWidth, ;
|
||||
hb_GtkWidgetSetSize( ::hWnd, ::YSize, ::XSize )
|
||||
|
||||
METHOD GetNewID() INLINE ::nId := ::nInitId++
|
||||
|
||||
METHOD Show() INLINE hb_GtkShowWidget( ::hWnd )
|
||||
ENDCLASS
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
ACCESS Top() CLASS HBWinControl
|
||||
LOCAL PosY := hb_GtkWidgetGetGeometry( ::hWnd, 1 )
|
||||
IF PosY != HGF_GTK_WIDGET_GEOMETRY_UNKNOWN
|
||||
::YPos := PosY
|
||||
ENDIF
|
||||
RETURN ::YPos
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
ACCESS Left() CLASS HBWinControl
|
||||
LOCAL PosX := hb_GtkWidgetGetGeometry( ::hWnd, 2 )
|
||||
IF PosX != HGF_GTK_WIDGET_GEOMETRY_UNKNOWN
|
||||
::XPos := PosX
|
||||
ENDIF
|
||||
RETURN ::XPos
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
ACCESS Height() CLASS HBWinControl
|
||||
LOCAL SizeY := hb_GtkWidgetGetGeometry( ::hWnd, 3 )
|
||||
IF SizeY != HGF_GTK_WIDGET_GEOMETRY_UNKNOWN
|
||||
::YSize := SizeY
|
||||
ENDIF
|
||||
RETURN ::YSize
|
||||
|
||||
/* ********************************************************************* */
|
||||
|
||||
ACCESS Width() CLASS HBWinControl
|
||||
LOCAL SizeX := hb_GtkWidgetGetGeometry( ::hWnd, 4 )
|
||||
IF SizeX != HGF_GTK_WIDGET_GEOMETRY_UNKNOWN
|
||||
::XSize := SizeX
|
||||
ENDIF
|
||||
RETURN ::XSize
|
||||
|
||||
/* ********************************************************************* */
|
||||
@@ -1,93 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Harbour GUI framework for IBM OS/2 Presentation Manager
|
||||
* Class HBButton
|
||||
*
|
||||
* Copyright 2001 Antonio Linares <alinares@fivetech.com>
|
||||
* Copyright 2001 Maurilio Longo <maurilio.longo@libero.it>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "common.ch"
|
||||
#include "hbclass.ch"
|
||||
#include "os2pm.ch"
|
||||
|
||||
|
||||
// NOTE: Be sure they are the same
|
||||
#define WS_CHILD WS_DISABLED //0x40000000
|
||||
|
||||
|
||||
CLASS HBButton FROM HBWinControl
|
||||
|
||||
DATA OnClick PROPERTY
|
||||
|
||||
METHOD New( oContainer )
|
||||
|
||||
ENDCLASS
|
||||
|
||||
|
||||
METHOD New( oContainer ) CLASS HBButton
|
||||
|
||||
::hWnd := WinCreateWindow(oContainer:hWndClient,; /* Parent window */
|
||||
WC_BUTTON,; /* Class window */
|
||||
"",; /* Button text */
|
||||
WS_VISIBLE + WS_TABSTOP+; /* Visible style */
|
||||
BS_PUSHBUTTON + BS_AUTOSIZE,; /* Button style */
|
||||
0, 0,; /* x, y */
|
||||
80, 30,; /* cx, cy */
|
||||
oContainer:hWndClient,; /* Owner window */
|
||||
HWND_TOP,; /* Top of z-order */
|
||||
::GetNewId(),; /* Identifier */
|
||||
nil,; /* Control data */
|
||||
nil) /* parameters */
|
||||
|
||||
// NOTE: There is no need to modify it later since I can give it an initial
|
||||
// size during window creartion
|
||||
//::Width := 80
|
||||
//::Height := 25
|
||||
|
||||
return Self
|
||||
@@ -1,83 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Harbour GUI framework for IBM OS/2 Presentation Manager
|
||||
* Class HBEdit
|
||||
*
|
||||
* Copyright 2001 Antonio Linares <alinares@fivetech.com>
|
||||
* Copyright 2001 Maurilio Longo <maurilio.longo@libero.it>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "common.ch"
|
||||
#include "hbclass.ch"
|
||||
#include "os2pm.ch"
|
||||
|
||||
CLASS HBEdit FROM HBWinControl
|
||||
|
||||
METHOD New( oContainer )
|
||||
|
||||
ENDCLASS
|
||||
|
||||
METHOD New( oContainer ) CLASS HBEdit
|
||||
|
||||
::hWnd := WinCreateWindow(oContainer:hWndClient,; /* Parent window */
|
||||
WC_ENTRYFIELD,; /* Class window */
|
||||
"",; /* Button text */
|
||||
WS_VISIBLE + WS_TABSTOP+; /* Visible style */
|
||||
ES_MARGIN,; /* window style */
|
||||
0, 0,; /* x, y */
|
||||
121, 21,; /* cx, cy */
|
||||
oContainer:hWndClient,; /* Owner window */
|
||||
HWND_TOP,; /* Top of z-order */
|
||||
::GetNewId(),; /* Identifier */
|
||||
nil,; /* Control data */
|
||||
nil) /* parameters */
|
||||
|
||||
//::Width := 121
|
||||
//::Height := 21
|
||||
|
||||
return Self
|
||||
@@ -1,20 +0,0 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
-hblib
|
||||
-ohbgfos2
|
||||
-inc
|
||||
-q0 -w3 -es2 -l
|
||||
|
||||
"-echo={!os2}This library builds on os2 only."
|
||||
-stop{!os2}
|
||||
|
||||
os2pm.c
|
||||
|
||||
tform.prg
|
||||
tmenu.prg
|
||||
tmenuit.prg
|
||||
winctrl.prg
|
||||
button.prg
|
||||
edit.prg
|
||||
@@ -1,417 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Harbour GUI framework for IBM OS/2 Presentation Manager
|
||||
*
|
||||
* Copyright 2001 Antonio Linares <alinares@fivetech.com>
|
||||
* Copyright 2001 Maurilio Longo <maurilio.longo@libero.it>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
|
||||
#define INCL_BASE
|
||||
#define INCL_PM
|
||||
#include <os2.h>
|
||||
|
||||
#include "hbapi.h"
|
||||
#include "hbvm.h"
|
||||
|
||||
#define LOWORD(l) ((USHORT)l)
|
||||
#define HIWORD(l) ((USHORT)((ULONG)l >> 16))
|
||||
|
||||
HAB hb_pm_GetHab( void );
|
||||
MRESULT EXPENTRY WndProc( HWND, ULONG, MPARAM, MPARAM );
|
||||
|
||||
|
||||
MRESULT EXPENTRY WndProc( HWND hWnd, ULONG Msg, MPARAM mp1, MPARAM mp2 )
|
||||
{
|
||||
static PHB_DYNS s_pDynSym = 0;
|
||||
|
||||
MRESULT mResult;
|
||||
HPS hps;
|
||||
|
||||
if( ! s_pDynSym )
|
||||
s_pDynSym = hb_dynsymFind( "HB_GUI" );
|
||||
|
||||
switch (Msg)
|
||||
{
|
||||
case WM_PAINT:
|
||||
hps = WinBeginPaint( hWnd, 0L, NULL );
|
||||
GpiErase( hps );
|
||||
WinEndPaint( hps );
|
||||
return 0;
|
||||
|
||||
default:
|
||||
hb_vmPushState();
|
||||
hb_vmPushDynSym( s_pDynSym );
|
||||
hb_vmPushNil();
|
||||
hb_vmPushLong( ( long ) hWnd );
|
||||
hb_vmPushLong( ( long ) Msg );
|
||||
hb_vmPushLong( ( long ) mp1 );
|
||||
hb_vmPushLong( ( long ) mp2 );
|
||||
hb_vmDo( 4 );
|
||||
if( hb_arrayGetType( hb_param( -1, HB_IT_ANY ), 1 ) == HB_IT_NIL )
|
||||
mResult = ( MRESULT ) WinDefWindowProc( hWnd, Msg, mp1, mp2 );
|
||||
else
|
||||
mResult = ( MRESULT ) hb_parnl( -1, 1 );
|
||||
hb_vmPopState();
|
||||
|
||||
return mResult;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
HB_FUNC( WINREGISTERCLASS )
|
||||
{
|
||||
hb_retl( WinRegisterClass( hb_pm_GetHab(), /* anchor block handle */
|
||||
( PCSZ ) hb_parc( 1 ), /* Class Name */
|
||||
( PFNWP ) WndProc, /* default Class procedure */
|
||||
hb_parnl( 2 ), /* style */
|
||||
hb_parnl( 3 ) ) ); /* extra bytes */
|
||||
}
|
||||
|
||||
|
||||
HB_FUNC(WINCREATEWINDOW)
|
||||
{
|
||||
hb_retnl( (LONG) WinCreateWindow( (HWND) hb_parnl(1), /* hWnd parent */
|
||||
(PCSZ) hb_parc(2), /* pszClass */
|
||||
(PCSZ) hb_parc(3), /* pszName */
|
||||
(ULONG) hb_parnl(4), /* flStyle */
|
||||
(LONG) hb_parnl(5), /* x */
|
||||
(LONG) hb_parnl(6), /* y */
|
||||
(LONG) hb_parnl(7), /* cx */
|
||||
(LONG) hb_parnl(8), /* cy */
|
||||
(HWND) hb_parnl(9), /* hwndOwner */
|
||||
(HWND) hb_parnl(10), /* hwndInsertBehind */
|
||||
(ULONG) hb_parnl(11), /* id */
|
||||
(PVOID) hb_parnl(12), /* pCtlData, */
|
||||
(PVOID) hb_parnl(13))); /* pPresParams */
|
||||
}
|
||||
|
||||
|
||||
HB_FUNC( WINCREATESTDWINDOW )
|
||||
{
|
||||
ULONG lFrame = hb_parnl( 3 );
|
||||
HWND hWndClient;
|
||||
|
||||
hb_retnl( (LONG) WinCreateStdWindow( ( HWND ) hb_parnl( 1 ), /* hWndParent */
|
||||
hb_parnl( 2 ), /* style */
|
||||
&lFrame, /* lFrame */
|
||||
( PCSZ ) hb_parc( 4 ), /* cClassName */
|
||||
( PCSZ ) hb_parc( 5 ), /* cCaption */
|
||||
hb_parnl( 6 ), /* lStyleClient */
|
||||
hb_parnl( 7 ), /* hModule */
|
||||
hb_parnl( 8 ), /* nId */
|
||||
( PHWND ) &hWndClient )); /* Window client handle */
|
||||
|
||||
hb_stornl( ( LONG ) hWndClient, 9 );
|
||||
}
|
||||
|
||||
|
||||
HB_FUNC( HB_FORMSHOWMODAL )
|
||||
{
|
||||
QMSG qmsg;
|
||||
HAB hab = hb_pm_GetHab();
|
||||
|
||||
WinShowWindow( ( HWND ) hb_parnl( 1 ), 1 );
|
||||
while( WinGetMsg( hab, &qmsg, 0, 0, 0 ) )
|
||||
WinDispatchMsg( hab, &qmsg );
|
||||
}
|
||||
|
||||
|
||||
/* nOr() is a very used function */
|
||||
HB_FUNC( NOR )
|
||||
{
|
||||
LONG lRet = 0;
|
||||
USHORT i = 0;
|
||||
|
||||
while( i < hb_pcount() )
|
||||
lRet = lRet | hb_parnl( ++i );
|
||||
|
||||
hb_retnl( lRet );
|
||||
}
|
||||
|
||||
|
||||
HB_FUNC( WINSETWINDOWTEXT )
|
||||
{
|
||||
hb_retl( WinSetWindowText( ( HWND ) hb_parnl( 1 ), ( PCSZ ) hb_parc( 2 ) ) );
|
||||
}
|
||||
|
||||
|
||||
HB_FUNC( WINGETTEXT )
|
||||
{
|
||||
char bBuffer[ 255 ];
|
||||
|
||||
WinQueryWindowText( ( HWND ) hb_parnl( 1 ), sizeof( bBuffer ) - 1, ( PSZ ) bBuffer );
|
||||
hb_retc( bBuffer );
|
||||
}
|
||||
|
||||
|
||||
HB_FUNC( MSGINFO )
|
||||
{
|
||||
HWND hWnd = WinQueryActiveWindow( HWND_DESKTOP);
|
||||
PCSZ szCaption = HB_ISCHAR( 2 ) ? ( PCSZ ) hb_parc( 2 ) : ( PCSZ ) "Information";
|
||||
|
||||
hb_retnl( WinMessageBox( HWND_DESKTOP, hWnd, ( PCSZ ) hb_parc( 1 ), szCaption,
|
||||
0, MB_INFORMATION | MB_OK | MB_MOVEABLE | MB_APPLMODAL ) );
|
||||
}
|
||||
|
||||
|
||||
HAB hb_pm_GetHab()
|
||||
{
|
||||
return WinQueryAnchorBlock( WinQueryActiveWindow( HWND_DESKTOP ) );
|
||||
}
|
||||
|
||||
|
||||
HB_FUNC( GETHAB )
|
||||
{
|
||||
hb_retnl( ( LONG ) hb_pm_GetHab() );
|
||||
}
|
||||
|
||||
|
||||
HB_FUNC( WINCREATEMENU )
|
||||
{
|
||||
hb_retnl( (LONG) WinCreateMenu((HWND) hb_parnl(1), (PVOID) NULL));
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* Some xBase for C language */
|
||||
#define IIF(x,y,z) ((x)?(y):(z))
|
||||
|
||||
|
||||
HB_FUNC( WINADDMENUITEM )
|
||||
{
|
||||
MENUITEM mit;
|
||||
|
||||
mit.iPosition = hb_parni( 3 );
|
||||
mit.afStyle = IIF( HB_ISCHAR( 2 ), MIS_TEXT, MIS_SEPARATOR );
|
||||
mit.afAttribute = IIF( ! hb_parl( 6 ), MIA_DISABLED, 0 );
|
||||
mit.id = hb_parni( 5 );
|
||||
mit.hwndSubMenu = hb_parnl( 4 );
|
||||
mit.hItem = 0;
|
||||
|
||||
hb_retni( ( LONG ) WinSendMsg( ( HWND ) hb_parnl( 1 ), MM_INSERTITEM,
|
||||
&mit, ( MPARAM ) hb_parc( 2 ) ) );
|
||||
}
|
||||
|
||||
|
||||
/* Given an id of a menuitem changes it to a MIS_SUBMENU type of menu item
|
||||
NOTE: You have to delete and reinsert a menu item if you want to change it from
|
||||
a MIS_TEXT to a MIS_SUBMENU type of menuitem */
|
||||
HB_FUNC( WINMAKESUBMENUITEM )
|
||||
{
|
||||
MENUITEM mit;
|
||||
MRESULT rc;
|
||||
char text[ 100 ];
|
||||
|
||||
rc = WinSendMsg((HWND) hb_parnl(1), MM_QUERYITEM, MPFROM2SHORT(hb_parni(2), FALSE ), &mit );
|
||||
if ((BOOL)rc) {
|
||||
WinSendMsg((HWND) hb_parnl(1), MM_QUERYITEMTEXT, MPFROM2SHORT(hb_parni(2), sizeof( text ) ), &text );
|
||||
WinSendMsg((HWND) hb_parnl(1), MM_DELETEITEM, MPFROM2SHORT(hb_parni(2), FALSE ), 0L );
|
||||
|
||||
mit.hwndSubMenu = hb_parnl(3);
|
||||
mit.afStyle |= MIS_SUBMENU;
|
||||
|
||||
/* re-insert the menuitem */
|
||||
WinSendMsg((HWND) hb_parnl(1), MM_INSERTITEM, &mit, &text);
|
||||
}
|
||||
hb_retnl(0);
|
||||
}
|
||||
|
||||
|
||||
HB_FUNC( WINSETPARENT )
|
||||
{
|
||||
hb_retl( WinSetParent( ( HWND ) hb_parnl( 1 ), ( HWND ) hb_parnl( 2 ),
|
||||
hb_parl( 3 ) ) );
|
||||
}
|
||||
|
||||
|
||||
HB_FUNC( WINSETOWNER )
|
||||
{
|
||||
hb_retl( WinSetOwner( ( HWND ) hb_parnl( 1 ), ( HWND ) hb_parnl( 2 ) ) );
|
||||
}
|
||||
|
||||
|
||||
HB_FUNC( WINSENDMSG )
|
||||
{
|
||||
hb_retnl( ( LONG ) WinSendMsg( ( HWND ) hb_parnl( 1 ), hb_parnl( 2 ),
|
||||
( MPARAM ) IIF( HB_ISCHAR( 3 ), (ULONG) hb_parc( 3 ), (ULONG) hb_parnl( 3 ) ),
|
||||
( MPARAM ) IIF( HB_ISCHAR( 4 ), (ULONG) hb_parc( 4 ), (ULONG) hb_parnl( 4 ) ) ) );
|
||||
}
|
||||
|
||||
|
||||
HB_FUNC( WINGETWIDTH )
|
||||
{
|
||||
HWND hWnd = ( HWND ) hb_parnl( 1 );
|
||||
RECTL rcWnd;
|
||||
|
||||
WinQueryWindowRect( hWnd, &rcWnd );
|
||||
hb_retnl( rcWnd.xRight - rcWnd.xLeft );
|
||||
}
|
||||
|
||||
|
||||
HB_FUNC( WINSETWIDTH )
|
||||
{
|
||||
HWND hWnd = ( HWND ) hb_parnl( 1 );
|
||||
SWP swp;
|
||||
|
||||
WinQueryWindowPos( hWnd, &swp );
|
||||
WinSetWindowPos( hWnd, HWND_TOP, swp.x,
|
||||
swp.y, (LONG) hb_parnl( 2 ), swp.cy,
|
||||
SWP_MOVE | SWP_SIZE | SWP_SHOW | SWP_ZORDER );
|
||||
}
|
||||
|
||||
|
||||
HB_FUNC( SENDMESSAGE )
|
||||
{
|
||||
hb_retnl( (LONG) WinSendMsg(
|
||||
(HWND) hb_parnl( 1 ), /* handle of destination window */
|
||||
(ULONG) hb_parnl( 2 ), /* message to send */
|
||||
(MPARAM) hb_parnl( 3 ), /* first message parameter */
|
||||
(MPARAM) hb_parnl( 4 ) /* second message parameter */
|
||||
) );
|
||||
}
|
||||
|
||||
|
||||
HB_FUNC( NLOWORD )
|
||||
{
|
||||
hb_retnl( LOWORD( hb_parnl( 1 ) ) );
|
||||
}
|
||||
|
||||
|
||||
HB_FUNC( NHIWORD )
|
||||
{
|
||||
hb_retnl( HIWORD( hb_parnl( 1 ) ) );
|
||||
}
|
||||
|
||||
|
||||
HB_FUNC( WINGETHEIGHT )
|
||||
{
|
||||
HWND hWnd = ( HWND ) hb_parnl( 1 );
|
||||
RECTL rct;
|
||||
|
||||
WinQueryWindowRect( hWnd, &rct );
|
||||
|
||||
hb_retnl( rct.yBottom - rct.yTop );
|
||||
}
|
||||
|
||||
|
||||
HB_FUNC( WINSETHEIGHT )
|
||||
{
|
||||
HWND hWnd = ( HWND ) hb_parnl( 1 );
|
||||
SWP swp;
|
||||
|
||||
WinQueryWindowPos( hWnd, &swp );
|
||||
WinSetWindowPos( hWnd, HWND_TOP, swp.x,
|
||||
swp.y, swp.cx, hb_parnl( 2 ),
|
||||
SWP_MOVE | SWP_SIZE | SWP_SHOW | SWP_ZORDER );
|
||||
}
|
||||
|
||||
|
||||
HB_FUNC( WINGETTOP )
|
||||
{
|
||||
HWND hWnd = ( HWND ) hb_parnl( 1 );
|
||||
RECTL rct;
|
||||
|
||||
WinQueryWindowRect( hWnd, &rct );
|
||||
|
||||
hb_retnl( rct.yTop );
|
||||
}
|
||||
|
||||
|
||||
HB_FUNC( WINSETTOP )
|
||||
{
|
||||
HWND hWnd = ( HWND ) hb_parnl( 1 );
|
||||
SWP swp;
|
||||
|
||||
WinQueryWindowPos( hWnd, &swp );
|
||||
WinSetWindowPos( hWnd, HWND_TOP, hb_parnl( 2 ),
|
||||
swp.y, swp.cx, swp.cy,
|
||||
SWP_MOVE | SWP_SIZE | SWP_SHOW | SWP_ZORDER );
|
||||
}
|
||||
|
||||
|
||||
HB_FUNC( WINGETLEFT )
|
||||
{
|
||||
HWND hWnd = ( HWND ) hb_parnl( 1 );
|
||||
RECTL rct;
|
||||
|
||||
WinQueryWindowRect( hWnd, &rct );
|
||||
|
||||
hb_retnl( rct.xLeft );
|
||||
}
|
||||
|
||||
|
||||
HB_FUNC( WINSETLEFT )
|
||||
{
|
||||
HWND hWnd = ( HWND ) hb_parnl( 1 );
|
||||
SWP swp;
|
||||
|
||||
WinQueryWindowPos( hWnd, &swp );
|
||||
WinSetWindowPos( hWnd, HWND_TOP, swp.x,
|
||||
hb_parnl( 2 ), swp.cx, swp.cy,
|
||||
SWP_MOVE | SWP_SIZE | SWP_SHOW | SWP_ZORDER );
|
||||
}
|
||||
|
||||
|
||||
HB_FUNC( POSTQUITMESSAGE )
|
||||
{
|
||||
WinPostMsg((HWND) hb_parnl( 1 ), WM_QUIT, 0L, 0L);
|
||||
/*PostQuitMessage( hb_parnl( 1 ) );*/
|
||||
}
|
||||
|
||||
|
||||
HB_FUNC( SHOWWINDOW )
|
||||
{
|
||||
hb_retl( WinShowWindow( ( HWND ) hb_parnl( 1 ), hb_parl( 2 ) ) );
|
||||
}
|
||||
|
||||
|
||||
HB_FUNC( WINGETLASTERROR )
|
||||
{
|
||||
hb_retnl((LONG) WinGetLastError( hb_pm_GetHab() ) );
|
||||
}
|
||||
@@ -1,867 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Harbour GUI framework for IBM OS/2 Presentation Manager
|
||||
*
|
||||
* Copyright 2001 Antonio Linares <alinares@fivetech.com>
|
||||
* Copyright 2001 Maurilio Longo <maurilio.longo@libero.it>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#define WC_FRAME "#1" //0xffff0001
|
||||
#define WC_COMBOBOX "#2" //0xffff0002
|
||||
#define WC_BUTTON "#3" //0xffff0003
|
||||
#define WC_MENU "#4" //0xffff0004
|
||||
#define WC_STATIC "#5" //0xffff0005
|
||||
#define WC_ENTRYFIELD "#6" //0xffff0006
|
||||
#define WC_LISTBOX "#7" //0xffff0007
|
||||
#define WC_SCROLLBAR "#8" //0xffff0008
|
||||
#define WC_TITLEBAR "#9" //0xffff0009
|
||||
#define WC_MLE "#10" //0xffff000a
|
||||
#define WC_APPSTAT "#16" //0xffff0010
|
||||
#define WC_KBDSTAT "#17" //0xffff0011
|
||||
#define WC_PECIC "#18" //0xffff0012
|
||||
#define WC_DBE_KKPOPUP "#19" //0xffff0013
|
||||
#define WC_SPINBUTTON "#32" //0xffff0020
|
||||
#define WC_CONTAINER "#37" //0xffff0025
|
||||
#define WC_SLIDER "#38" //0xffff0026
|
||||
#define WC_VALUESET "#39" //0xffff0027
|
||||
#define WC_NOTEBOOK "#40" //0xffff0028
|
||||
#define WC_PENFIRST "#41" //0xffff0029
|
||||
#define WC_PENLAST "#44" //0xffff002c
|
||||
#define WC_MMPMFIRST "#64" //0xffff0040
|
||||
#define WC_CIRCULARSLIDER "#65" //0xffff0041
|
||||
#define WC_MMPMLAST "#79" //0xffff004f
|
||||
|
||||
#define WS_VISIBLE 0x80000000
|
||||
#define WS_DISABLED 0x40000000
|
||||
#define WS_CLIPCHILDREN 0x20000000
|
||||
#define WS_CLIPSIBLINGS 0x10000000
|
||||
#define WS_PARENTCLIP 0x08000000
|
||||
#define WS_SAVEBITS 0x04000000
|
||||
#define WS_SYNCPAINT 0x02000000
|
||||
#define WS_MINIMIZED 0x01000000
|
||||
#define WS_MAXIMIZED 0x00800000
|
||||
#define WS_ANIMATE 0x00400000
|
||||
#define WS_GROUP 0x00010000
|
||||
#define WS_TABSTOP 0x00020000
|
||||
#define WS_MULTISELECT 0x00040000
|
||||
|
||||
#define CS_MOVENOTIFY 0x00000001
|
||||
#define CS_SIZEREDRAW 0x00000004
|
||||
#define CS_HITTEST 0x00000008
|
||||
#define CS_PUBLIC 0x00000010
|
||||
#define CS_FRAME 0x00000020
|
||||
#define CS_CLIPCHILDREN 0x20000000
|
||||
#define CS_CLIPSIBLINGS 0x10000000
|
||||
#define CS_PARENTCLIP 0x08000000
|
||||
#define CS_SAVEBITS 0x04000000
|
||||
#define CS_SYNCPAINT 0x02000000
|
||||
|
||||
#define WM_NULL 0x0000
|
||||
#define WM_CREATE 0x0001
|
||||
#define WM_DESTROY 0x0002
|
||||
#define WM_ENABLE 0x0004
|
||||
#define WM_SHOW 0x0005
|
||||
#define WM_MOVE 0x0006
|
||||
#define WM_SIZE 0x0007
|
||||
#define WM_ADJUSTWINDOWPOS 0x0008
|
||||
#define WM_CALCVALIDRECTS 0x0009
|
||||
#define WM_SETWINDOWPARAMS 0x000a
|
||||
#define WM_QUERYWINDOWPARAMS 0x000b
|
||||
#define WM_HITTEST 0x000c
|
||||
#define WM_ACTIVATE 0x000d
|
||||
#define WM_SETFOCUS 0x000f
|
||||
#define WM_SETSELECTION 0x0010
|
||||
#define WM_PPAINT 0x0011
|
||||
#define WM_PSETFOCUS 0x0012
|
||||
#define WM_PSYSCOLORCHANGE 0x0013
|
||||
#define WM_PSIZE 0x0014
|
||||
#define WM_PACTIVATE 0x0015
|
||||
#define WM_PCONTROL 0x0016
|
||||
#define WM_COMMAND 0x0020
|
||||
#define WM_SYSCOMMAND 0x0021
|
||||
#define WM_HELP 0x0022
|
||||
#define WM_PAINT 0x0023
|
||||
#define WM_TIMER 0x0024
|
||||
#define WM_SEM1 0x0025
|
||||
#define WM_SEM2 0x0026
|
||||
#define WM_SEM3 0x0027
|
||||
#define WM_SEM4 0x0028
|
||||
#define WM_CLOSE 0x0029
|
||||
#define WM_QUIT 0x002a
|
||||
#define WM_SYSCOLORCHANGE 0x002b
|
||||
#define WM_SYSVALUECHANGED 0x002d
|
||||
#define WM_APPTERMINATENOTIFY 0x002e
|
||||
#define WM_PRESPARAMCHANGED 0x002f
|
||||
#define WM_CONTROL 0x0030
|
||||
#define WM_VSCROLL 0x0031
|
||||
#define WM_HSCROLL 0x0032
|
||||
#define WM_INITMENU 0x0033
|
||||
#define WM_MENUSELECT 0x0034
|
||||
#define WM_MENUEND 0x0035
|
||||
#define WM_DRAWITEM 0x0036
|
||||
#define WM_MEASUREITEM 0x0037
|
||||
#define WM_CONTROLPOINTER 0x0038
|
||||
#define WM_QUERYDLGCODE 0x003a
|
||||
#define WM_INITDLG 0x003b
|
||||
#define WM_SUBSTITUTESTRING 0x003c
|
||||
#define WM_MATCHMNEMONIC 0x003d
|
||||
#define WM_SAVEAPPLICATION 0x003e
|
||||
#define WM_HELPBASE 0x0f00
|
||||
#define WM_HELPTOP 0x0fff
|
||||
#define WM_USER 0x1000
|
||||
#define WM_FLASHWINDOW 0x0040
|
||||
#define WM_FORMATFRAME 0x0041
|
||||
#define WM_UPDATEFRAME 0x0042
|
||||
#define WM_FOCUSCHANGE 0x0043
|
||||
#define WM_SETBORDERSIZE 0x0044
|
||||
#define WM_TRACKFRAME 0x0045
|
||||
#define WM_MINMAXFRAME 0x0046
|
||||
#define WM_SETICON 0x0047
|
||||
#define WM_QUERYICON 0x0048
|
||||
#define WM_SETACCELTABLE 0x0049
|
||||
#define WM_QUERYACCELTABLE 0x004a
|
||||
#define WM_TRANSLATEACCEL 0x004b
|
||||
#define WM_QUERYTRACKINFO 0x004c
|
||||
#define WM_QUERYBORDERSIZE 0x004d
|
||||
#define WM_NEXTMENU 0x004e
|
||||
#define WM_ERASEBACKGROUND 0x004f
|
||||
#define WM_QUERYFRAMEINFO 0x0050
|
||||
#define WM_QUERYFOCUSCHAIN 0x0051
|
||||
#define WM_OWNERPOSCHANGE 0x0052
|
||||
#define WM_CALCFRAMERECT 0x0053
|
||||
#define WM_WINDOWPOSCHANGED 0x0055
|
||||
#define WM_ADJUSTFRAMEPOS 0x0056
|
||||
#define WM_QUERYFRAMECTLCOUNT 0x0059
|
||||
#define WM_QUERYHELPINFO 0x005b
|
||||
#define WM_SETHELPINFO 0x005c
|
||||
#define WM_ERROR 0x005d
|
||||
#define WM_REALIZEPALETTE 0x005e
|
||||
#define WM_QUERYCONVERTPOS 0x00b0
|
||||
#define WM_RENDERFMT 0x0060
|
||||
#define WM_RENDERALLFMTS 0x0061
|
||||
#define WM_DESTROYCLIPBOARD 0x0062
|
||||
#define WM_PAINTCLIPBOARD 0x0063
|
||||
#define WM_SIZECLIPBOARD 0x0064
|
||||
#define WM_HSCROLLCLIPBOARD 0x0065
|
||||
#define WM_VSCROLLCLIPBOARD 0x0066
|
||||
#define WM_MOUSEFIRST 0x0070
|
||||
#define WM_MOUSEMOVE 0x0070
|
||||
#define WM_BUTTONCLICKFIRST 0x0071
|
||||
#define WM_BUTTON1DOWN 0x0071
|
||||
#define WM_BUTTON1UP 0x0072
|
||||
#define WM_BUTTON1DBLCLK 0x0073
|
||||
#define WM_BUTTON2DOWN 0x0074
|
||||
#define WM_BUTTON2UP 0x0075
|
||||
#define WM_BUTTON2DBLCLK 0x0076
|
||||
#define WM_BUTTON3DOWN 0x0077
|
||||
#define WM_BUTTON3UP 0x0078
|
||||
#define WM_BUTTON3DBLCLK 0x0079
|
||||
#define WM_BUTTONCLICKLAST 0x0079
|
||||
#define WM_MOUSELAST 0x0079
|
||||
#define WM_CHAR 0x007a
|
||||
#define WM_VIOCHAR 0x007b
|
||||
#define WM_JOURNALNOTIFY 0x007c
|
||||
#define WM_MOUSEMAP 0x007d
|
||||
#define WM_VRNDISABLED 0x007e
|
||||
#define WM_VRNENABLED 0x007f
|
||||
#define WM_EXTMOUSEFIRST 0x0410
|
||||
#define WM_CHORD 0x0410
|
||||
#define WM_BUTTON1MOTIONSTART 0x0411
|
||||
#define WM_BUTTON1MOTIONEND 0x0412
|
||||
#define WM_BUTTON1CLICK 0x0413
|
||||
#define WM_BUTTON2MOTIONSTART 0x0414
|
||||
#define WM_BUTTON2MOTIONEND 0x0415
|
||||
#define WM_BUTTON2CLICK 0x0416
|
||||
#define WM_BUTTON3MOTIONSTART 0x0417
|
||||
#define WM_BUTTON3MOTIONEND 0x0418
|
||||
#define WM_BUTTON3CLICK 0x0419
|
||||
#define WM_EXTMOUSELAST 0x0419
|
||||
#define WM_MOUSETRANSLATEFIRST 0x0420
|
||||
#define WM_BEGINDRAG 0x0420
|
||||
#define WM_ENDDRAG 0x0421
|
||||
#define WM_SINGLESELECT 0x0422
|
||||
#define WM_OPEN 0x0423
|
||||
#define WM_CONTEXTMENU 0x0424
|
||||
#define WM_CONTEXTHELP 0x0425
|
||||
#define WM_TEXTEDIT 0x0426
|
||||
#define WM_BEGINSELECT 0x0427
|
||||
#define WM_ENDSELECT 0x0428
|
||||
#define WM_MOUSETRANSLATELAST 0x0428
|
||||
#define WM_PICKUP 0x0429
|
||||
#define WM_PENFIRST 0x0481
|
||||
#define WM_PENLAST 0x049f
|
||||
#define WM_MMPMFIRST 0x0500
|
||||
#define WM_MMPMLAST 0x05ff
|
||||
#define WM_BIDI_FIRST 0x0bd0
|
||||
#define WM_BIDI_LAST 0x0bff
|
||||
#define WM_MSGBOXINIT 0x010e
|
||||
#define WM_MSGBOXDISMISS 0x010f
|
||||
#define WM_CTLCOLORCHANGE 0x0129
|
||||
#define WM_QUERYCTLTYPE 0x0130 /*0x012a?*/
|
||||
#define WM_DRAGFIRST 0x0310
|
||||
#define WM_DRAGLAST 0x032f
|
||||
|
||||
#define HWND_DESKTOP 1
|
||||
#define HWND_OBJECT 2
|
||||
#define HWND_TOP 3
|
||||
#define HWND_BOTTOM 4
|
||||
#define HWND_THREADCAPTURE 5
|
||||
#define HWND_PARENT NIL
|
||||
|
||||
#define FCF_TITLEBAR 0x00000001
|
||||
#define FCF_SYSMENU 0x00000002
|
||||
#define FCF_MENU 0x00000004
|
||||
#define FCF_SIZEBORDER 0x00000008
|
||||
#define FCF_MINBUTTON 0x00000010
|
||||
#define FCF_MAXBUTTON 0x00000020
|
||||
#define FCF_MINMAX (FCF_MINBUTTON + FCF_MAXBUTTON)
|
||||
#define FCF_VERTSCROLL 0x00000040
|
||||
#define FCF_HORZSCROLL 0x00000080
|
||||
#define FCF_DLGBORDER 0x00000100
|
||||
#define FCF_BORDER 0x00000200
|
||||
#define FCF_SHELLPOSITION 0x00000400
|
||||
#define FCF_TASKLIST 0x00000800
|
||||
#define FCF_NOBYTEALIGN 0x00001000
|
||||
#define FCF_NOMOVEWITHOWNER 0x00002000
|
||||
#define FCF_ICON 0x00004000
|
||||
#define FCF_ACCELTABLE 0x00008000
|
||||
#define FCF_SYSMODAL 0x00010000
|
||||
#define FCF_SCREENALIGN 0x00020000
|
||||
#define FCF_MOUSEALIGN 0x00040000
|
||||
#define FCF_PALETTE_NORMAL 0x00080000
|
||||
#define FCF_PALETTE_HELP 0x00100000
|
||||
#define FCF_PALETTE_POPUPODD 0x00200000
|
||||
#define FCF_PALETTE_POPUPEVEN 0x00400000
|
||||
#define FCF_HIDEBUTTON 0x01000000
|
||||
#define FCF_HIDEMAX 0x01000020
|
||||
#define FCF_AUTOICON 0x40000000
|
||||
#define FCF_DBE_APPSTAT 0x80000000
|
||||
#define FCF_STANDARD 0x0000cc3f
|
||||
|
||||
#define MIA_NODISMISS 0x0020
|
||||
#define MIA_FRAMED 0x1000
|
||||
#define MIA_CHECKED 0x2000
|
||||
#define MIA_DISABLED 0x4000
|
||||
#define MIA_HILITED 0x8000
|
||||
#define MIS_TEXT 0x0001
|
||||
#define MIS_BITMAP 0x0002
|
||||
#define MIS_SEPARATOR 0x0004
|
||||
#define MIS_OWNERDRAW 0x0008
|
||||
#define MIS_SUBMENU 0x0010
|
||||
#define MIS_MULTMENU 0x0020
|
||||
#define MIS_SYSCOMMAND 0x0040
|
||||
#define MIS_HELP 0x0080
|
||||
#define MIS_STATIC 0x0100
|
||||
#define MIS_BUTTONSEPARATOR 0x0200
|
||||
#define MIS_BREAK 0x0400
|
||||
#define MIS_BREAKSEPARATOR 0x0800
|
||||
#define MIS_GROUP 0x1000
|
||||
#define MIS_SINGLE 0x2000
|
||||
#define MIT_END (-1)
|
||||
#define MIT_NONE (-1)
|
||||
#define MIT_MEMERROR (-1)
|
||||
#define MIT_ERROR (-1)
|
||||
#define MIT_FIRST (-2)
|
||||
#define MIT_LAST (-3)
|
||||
|
||||
#define BS_PUSHBUTTON 0
|
||||
#define BS_CHECKBOX 1
|
||||
#define BS_AUTOCHECKBOX 2
|
||||
#define BS_RADIOBUTTON 3
|
||||
#define BS_AUTORADIOBUTTON 4
|
||||
#define BS_3STATE 5
|
||||
#define BS_AUTO3STATE 6
|
||||
#define BS_USERBUTTON 7
|
||||
#define BS_PRIMARYSTYLES 0x000f
|
||||
#define BS_TEXT 0x0010
|
||||
#define BS_MINIICON 0x0020
|
||||
#define BS_BITMAP 0x0040
|
||||
#define BS_ICON 0x0080
|
||||
#define BS_HELP 0x0100
|
||||
#define BS_SYSCOMMAND 0x0200
|
||||
#define BS_DEFAULT 0x0400
|
||||
#define BS_NOPOINTERFOCUS 0x0800
|
||||
#define BS_NOBORDER 0x1000
|
||||
#define BS_NOCURSORSELECT 0x2000
|
||||
#define BS_AUTOSIZE 0x4000
|
||||
|
||||
#define MLS_WORDWRAP 0x0001
|
||||
#define MLS_BORDER 0x0002
|
||||
#define MLS_VSCROLL 0x0004
|
||||
#define MLS_HSCROLL 0x0008
|
||||
#define MLS_READONLY 0x0010
|
||||
#define MLS_IGNORETAB 0x0020
|
||||
#define MLS_DISABLEUNDO 0x0040
|
||||
|
||||
#define ES_LEFT 0x0000
|
||||
#define ES_CENTER 0x0001
|
||||
#define ES_RIGHT 0x0002
|
||||
#define ES_AUTOSCROLL 0x0004
|
||||
#define ES_MARGIN 0x0008
|
||||
#define ES_AUTOTAB 0x0010
|
||||
#define ES_READONLY 0x0020
|
||||
#define ES_COMMAND 0x0040
|
||||
#define ES_UNREADABLE 0x0080
|
||||
#define ES_AUTOSIZE 0x0200
|
||||
#define ES_ANY 0x0000
|
||||
#define ES_SBCS 0x1000
|
||||
#define ES_DBCS 0x2000
|
||||
#define ES_MIXED 0x3000
|
||||
|
||||
#define CMDSRC_OTHER 0
|
||||
#define CMDSRC_PUSHBUTTON 1
|
||||
#define CMDSRC_MENU 2
|
||||
#define CMDSRC_ACCELERATOR 3
|
||||
#define CMDSRC_FONTDLG 4
|
||||
#define CMDSRC_FILEDLG 5
|
||||
#define CMDSRC_PRINTDLG 6
|
||||
#define CMDSRC_COLORDLG 7
|
||||
|
||||
|
||||
#define PMERR_INVALID_HWND 0x1001
|
||||
#define PMERR_INVALID_HMQ 0x1002
|
||||
#define PMERR_PARAMETER_OUT_OF_RANGE 0x1003
|
||||
#define PMERR_WINDOW_LOCK_UNDERFLOW 0x1004
|
||||
#define PMERR_WINDOW_LOCK_OVERFLOW 0x1005
|
||||
#define PMERR_BAD_WINDOW_LOCK_COUNT 0x1006
|
||||
#define PMERR_WINDOW_NOT_LOCKED 0x1007
|
||||
#define PMERR_INVALID_SELECTOR 0x1008
|
||||
#define PMERR_CALL_FROM_WRONG_THREAD 0x1009
|
||||
#define PMERR_RESOURCE_NOT_FOUND 0x100a
|
||||
#define PMERR_INVALID_STRING_PARM 0x100b
|
||||
#define PMERR_INVALID_HHEAP 0x100c
|
||||
#define PMERR_INVALID_HEAP_POINTER 0x100d
|
||||
#define PMERR_INVALID_HEAP_SIZE_PARM 0x100e
|
||||
#define PMERR_INVALID_HEAP_SIZE 0x100f
|
||||
#define PMERR_INVALID_HEAP_SIZE_WORD 0x1010
|
||||
#define PMERR_HEAP_OUT_OF_MEMORY 0x1011
|
||||
#define PMERR_HEAP_MAX_SIZE_REACHED 0x1012
|
||||
#define PMERR_INVALID_HATOMTBL 0x1013
|
||||
#define PMERR_INVALID_ATOM 0x1014
|
||||
#define PMERR_INVALID_ATOM_NAME 0x1015
|
||||
#define PMERR_INVALID_INTEGER_ATOM 0x1016
|
||||
#define PMERR_ATOM_NAME_NOT_FOUND 0x1017
|
||||
#define PMERR_QUEUE_TOO_LARGE 0x1018
|
||||
#define PMERR_INVALID_FLAG 0x1019
|
||||
#define PMERR_INVALID_HACCEL 0x101a
|
||||
#define PMERR_INVALID_HPTR 0x101b
|
||||
#define PMERR_INVALID_HENUM 0x101c
|
||||
#define PMERR_INVALID_SRC_CODEPAGE 0x101d
|
||||
#define PMERR_INVALID_DST_CODEPAGE 0x101e
|
||||
#define PMERR_UNKNOWN_COMPONENT_ID 0x101f
|
||||
#define PMERR_UNKNOWN_ERROR_CODE 0x1020
|
||||
#define PMERR_SEVERITY_LEVELS 0x1021
|
||||
#define PMERR_INVALID_RESOURCE_FORMAT 0x1034
|
||||
#define PMERR_NO_MSG_QUEUE 0x1036
|
||||
#define PMERR_CANNOT_SET_FOCUS 0x1037
|
||||
#define PMERR_QUEUE_FULL 0x1038
|
||||
#define PMERR_LIBRARY_LOAD_FAILED 0x1039
|
||||
#define PMERR_PROCEDURE_LOAD_FAILED 0x103a
|
||||
#define PMERR_LIBRARY_DELETE_FAILED 0x103b
|
||||
#define PMERR_PROCEDURE_DELETE_FAILED 0x103c
|
||||
#define PMERR_ARRAY_TOO_LARGE 0x103d
|
||||
#define PMERR_ARRAY_TOO_SMALL 0x103e
|
||||
#define PMERR_DATATYPE_ENTRY_BAD_INDEX 0x103f
|
||||
#define PMERR_DATATYPE_ENTRY_CTL_BAD 0x1040
|
||||
#define PMERR_DATATYPE_ENTRY_CTL_MISS 0x1041
|
||||
#define PMERR_DATATYPE_ENTRY_INVALID 0x1042
|
||||
#define PMERR_DATATYPE_ENTRY_NOT_NUM 0x1043
|
||||
#define PMERR_DATATYPE_ENTRY_NOT_OFF 0x1044
|
||||
#define PMERR_DATATYPE_INVALID 0x1045
|
||||
#define PMERR_DATATYPE_NOT_UNIQUE 0x1046
|
||||
#define PMERR_DATATYPE_TOO_LONG 0x1047
|
||||
#define PMERR_DATATYPE_TOO_SMALL 0x1048
|
||||
#define PMERR_DIRECTION_INVALID 0x1049
|
||||
#define PMERR_INVALID_HAB 0x104a
|
||||
#define PMERR_INVALID_HSTRUCT 0x104d
|
||||
#define PMERR_LENGTH_TOO_SMALL 0x104e
|
||||
#define PMERR_MSGID_TOO_SMALL 0x104f
|
||||
#define PMERR_NO_HANDLE_ALLOC 0x1050
|
||||
#define PMERR_NOT_IN_A_PM_SESSION 0x1051
|
||||
#define PMERR_MSG_QUEUE_ALREADY_EXISTS 0x1052
|
||||
#define PMERR_SEND_MSG_TIMEOUT 0x1053
|
||||
#define PMERROR_SEND_MSG_FAILED 0x1054
|
||||
#define PMERR_OLD_RESOURCE 0x1055
|
||||
#define PMERR_WPDSERVER_IS_ACTIVE 0x1056
|
||||
#define PMERR_WPDSERVER_NOT_STARTED 0x1057
|
||||
#define PMERR_SOMDD_IS_ACTIVE 0x1058
|
||||
#define PMERR_SOMDD_NOT_STARTED 0x1059
|
||||
#define PMERR_BIDI_FIRST 0x10f0
|
||||
#define PMERR_BIDI_LAST 0x10ff
|
||||
#define PMERR_INVALID_PIB 0x1101
|
||||
#define PMERR_INSUFF_SPACE_TO_ADD 0x1102
|
||||
#define PMERR_INVALID_GROUP_HANDLE 0x1103
|
||||
#define PMERR_DUPLICATE_TITLE 0x1104
|
||||
#define PMERR_INVALID_TITLE 0x1105
|
||||
#define PMERR_HANDLE_NOT_IN_GROUP 0x1107
|
||||
#define PMERR_INVALID_TARGET_HANDLE 0x1106
|
||||
#define PMERR_INVALID_PATH_STATEMENT 0x1108
|
||||
#define PMERR_NO_PROGRAM_FOUND 0x1109
|
||||
#define PMERR_INVALID_BUFFER_SIZE 0x110a
|
||||
#define PMERR_BUFFER_TOO_SMALL 0x110b
|
||||
#define PMERR_PL_INITIALISATION_FAIL 0x110c
|
||||
#define PMERR_CANT_DESTROY_SYS_GROUP 0x110d
|
||||
#define PMERR_INVALID_TYPE_CHANGE 0x110e
|
||||
#define PMERR_INVALID_PROGRAM_HANDLE 0x110f
|
||||
#define PMERR_NOT_CURRENT_PL_VERSION 0x1110
|
||||
#define PMERR_INVALID_CIRCULAR_REF 0x1111
|
||||
#define PMERR_MEMORY_ALLOCATION_ERR 0x1112
|
||||
#define PMERR_MEMORY_DEALLOCATION_ERR 0x1113
|
||||
#define PMERR_TASK_HEADER_TOO_BIG 0x1114
|
||||
#define PMERR_INVALID_INI_FILE_HANDLE 0x1115
|
||||
#define PMERR_MEMORY_SHARE 0x1116
|
||||
#define PMERR_OPEN_QUEUE 0x1117
|
||||
#define PMERR_CREATE_QUEUE 0x1118
|
||||
#define PMERR_WRITE_QUEUE 0x1119
|
||||
#define PMERR_READ_QUEUE 0x111a
|
||||
#define PMERR_CALL_NOT_EXECUTED 0x111b
|
||||
#define PMERR_UNKNOWN_APIPKT 0x111c
|
||||
#define PMERR_INITHREAD_EXISTS 0x111d
|
||||
#define PMERR_CREATE_THREAD 0x111e
|
||||
#define PMERR_NO_HK_PROFILE_INSTALLED 0x111f
|
||||
#define PMERR_INVALID_DIRECTORY 0x1120
|
||||
#define PMERR_WILDCARD_IN_FILENAME 0x1121
|
||||
#define PMERR_FILENAME_BUFFER_FULL 0x1122
|
||||
#define PMERR_FILENAME_TOO_LONG 0x1123
|
||||
#define PMERR_INI_FILE_IS_SYS_OR_USER 0x1124
|
||||
#define PMERR_BROADCAST_PLMSG 0x1125
|
||||
#define PMERR_190_INIT_DONE 0x1126
|
||||
#define PMERR_HMOD_FOR_PMSHAPI 0x1127
|
||||
#define PMERR_SET_HK_PROFILE 0x1128
|
||||
#define PMERR_API_NOT_ALLOWED 0x1129
|
||||
#define PMERR_INI_STILL_OPEN 0x112a
|
||||
#define PMERR_PROGDETAILS_NOT_IN_INI 0x112b
|
||||
#define PMERR_PIBSTRUCT_NOT_IN_INI 0x112c
|
||||
#define PMERR_INVALID_DISKPROGDETAILS 0x112d
|
||||
#define PMERR_PROGDETAILS_READ_FAILURE 0x112e
|
||||
#define PMERR_PROGDETAILS_WRITE_FAILURE 0x112f
|
||||
#define PMERR_PROGDETAILS_QSIZE_FAILURE 0x1130
|
||||
#define PMERR_INVALID_PROGDETAILS 0x1131
|
||||
#define PMERR_SHEPROFILEHOOK_NOT_FOUND 0x1132
|
||||
#define PMERR_190PLCONVERTED 0x1133
|
||||
#define PMERR_FAILED_TO_CONVERT_INI_PL 0x1134
|
||||
#define PMERR_PMSHAPI_NOT_INITIALISED 0x1135
|
||||
#define PMERR_INVALID_SHELL_API_HOOK_ID 0x1136
|
||||
#define PMERR_DOS_ERROR 0x1200
|
||||
#define PMERR_NO_SPACE 0x1201
|
||||
#define PMERR_INVALID_SWITCH_HANDLE 0x1202
|
||||
#define PMERR_NO_HANDLE 0x1203
|
||||
#define PMERR_INVALID_PROCESS_ID 0x1204
|
||||
#define PMERR_NOT_SHELL 0x1205
|
||||
#define PMERR_INVALID_WINDOW 0x1206
|
||||
#define PMERR_INVALID_POST_MSG 0x1207
|
||||
#define PMERR_INVALID_PARAMETERS 0x1208
|
||||
#define PMERR_INVALID_PROGRAM_TYPE 0x1209
|
||||
#define PMERR_NOT_EXTENDED_FOCUS 0x120a
|
||||
#define PMERR_INVALID_SESSION_ID 0x120b
|
||||
#define PMERR_SMG_INVALID_ICON_FILE 0x120c
|
||||
#define PMERR_SMG_ICON_NOT_CREATED 0x120d
|
||||
#define PMERR_SHL_DEBUG 0x120e
|
||||
#define PMERR_OPENING_INI_FILE 0x1301
|
||||
#define PMERR_INI_FILE_CORRUPT 0x1302
|
||||
#define PMERR_INVALID_PARM 0x1303
|
||||
#define PMERR_NOT_IN_IDX 0x1304
|
||||
#define PMERR_NO_ENTRIES_IN_GROUP 0x1305
|
||||
#define PMERR_INI_WRITE_FAIL 0x1306
|
||||
#define PMERR_IDX_FULL 0x1307
|
||||
#define PMERR_INI_PROTECTED 0x1308
|
||||
#define PMERR_MEMORY_ALLOC 0x1309
|
||||
#define PMERR_INI_INIT_ALREADY_DONE 0x130a
|
||||
#define PMERR_INVALID_INTEGER 0x130b
|
||||
#define PMERR_INVALID_ASCIIZ 0x130c
|
||||
#define PMERR_CAN_NOT_CALL_SPOOLER 0x130d
|
||||
#define PMERR_VALIDATION_REJECTED 0x130d /*!*/
|
||||
#define PMERR_WARNING_WINDOW_NOT_KILLED 0x1401
|
||||
#define PMERR_ERROR_INVALID_WINDOW 0x1402
|
||||
#define PMERR_ALREADY_INITIALIZED 0x1403
|
||||
#define PMERR_MSG_PROG_NO_MOU 0x1405
|
||||
#define PMERR_MSG_PROG_NON_RECOV 0x1406
|
||||
#define PMERR_WINCONV_INVALID_PATH 0x1407
|
||||
#define PMERR_PI_NOT_INITIALISED 0x1408
|
||||
#define PMERR_PL_NOT_INITIALISED 0x1409
|
||||
#define PMERR_NO_TASK_MANAGER 0x140a
|
||||
#define PMERR_SAVE_NOT_IN_PROGRESS 0x140b
|
||||
#define PMERR_NO_STACK_SPACE 0x140c
|
||||
#define PMERR_INVALID_COLR_FIELD 0x140d
|
||||
#define PMERR_INVALID_COLR_VALUE 0x140e
|
||||
#define PMERR_COLR_WRITE 0x140f
|
||||
#define PMERR_TARGET_FILE_EXISTS 0x1501
|
||||
#define PMERR_SOURCE_SAME_AS_TARGET 0x1502
|
||||
#define PMERR_SOURCE_FILE_NOT_FOUND 0x1503
|
||||
#define PMERR_INVALID_NEW_PATH 0x1504
|
||||
#define PMERR_TARGET_FILE_NOT_FOUND 0x1505
|
||||
#define PMERR_INVALID_DRIVE_NUMBER 0x1506
|
||||
#define PMERR_NAME_TOO_LONG 0x1507
|
||||
#define PMERR_NOT_ENOUGH_ROOM_ON_DISK 0x1508
|
||||
#define PMERR_NOT_ENOUGH_MEM 0x1509
|
||||
#define PMERR_LOG_DRV_DOES_NOT_EXIST 0x150b
|
||||
#define PMERR_INVALID_DRIVE 0x150c
|
||||
#define PMERR_ACCESS_DENIED 0x150d
|
||||
#define PMERR_NO_FIRST_SLASH 0x150e
|
||||
#define PMERR_READ_ONLY_FILE 0x150f
|
||||
#define PMERR_GROUP_PROTECTED 0x151f
|
||||
#define PMERR_INVALID_PROGRAM_CATEGORY 0x152f
|
||||
#define PMERR_INVALID_APPL 0x1530
|
||||
#define PMERR_CANNOT_START 0x1531
|
||||
#define PMERR_STARTED_IN_BACKGROUND 0x1532
|
||||
#define PMERR_INVALID_HAPP 0x1533
|
||||
#define PMERR_CANNOT_STOP 0x1534
|
||||
#define PMERR_INVALID_FREE_MESSAGE_ID 0x1630
|
||||
#define PMERR_FUNCTION_NOT_SUPPORTED 0x1641
|
||||
#define PMERR_INVALID_ARRAY_COUNT 0x1642
|
||||
#define PMERR_INVALID_LENGTH 0x1643
|
||||
#define PMERR_INVALID_BUNDLE_TYPE 0x1644
|
||||
#define PMERR_INVALID_PARAMETER 0x1645
|
||||
#define PMERR_INVALID_NUMBER_OF_PARMS 0x1646
|
||||
#define PMERR_GREATER_THAN_64K 0x1647
|
||||
#define PMERR_INVALID_PARAMETER_TYPE 0x1648
|
||||
#define PMERR_NEGATIVE_STRCOND_DIM 0x1649
|
||||
#define PMERR_INVALID_NUMBER_OF_TYPES 0x164a
|
||||
#define PMERR_INCORRECT_HSTRUCT 0x164b
|
||||
#define PMERR_INVALID_ARRAY_SIZE 0x164c
|
||||
#define PMERR_INVALID_CONTROL_DATATYPE 0x164d
|
||||
#define PMERR_INCOMPLETE_CONTROL_SEQU 0x164e
|
||||
#define PMERR_INVALID_DATATYPE 0x164f
|
||||
#define PMERR_INCORRECT_DATATYPE 0x1650
|
||||
#define PMERR_NOT_SELF_DESCRIBING_DTYP 0x1651
|
||||
#define PMERR_INVALID_CTRL_SEQ_INDEX 0x1652
|
||||
#define PMERR_INVALID_TYPE_FOR_LENGTH 0x1653
|
||||
#define PMERR_INVALID_TYPE_FOR_OFFSET 0x1654
|
||||
#define PMERR_INVALID_TYPE_FOR_MPARAM 0x1655
|
||||
#define PMERR_INVALID_MESSAGE_ID 0x1656
|
||||
#define PMERR_C_LENGTH_TOO_SMALL 0x1657
|
||||
#define PMERR_APPL_STRUCTURE_TOO_SMALL 0x1658
|
||||
#define PMERR_INVALID_ERRORINFO_HANDLE 0x1659
|
||||
#define PMERR_INVALID_CHARACTER_INDEX 0x165a
|
||||
#define PMERR_OK 0x0000
|
||||
#define PMERR_ALREADY_IN_AREA 0x2001
|
||||
#define PMERR_ALREADY_IN_ELEMENT 0x2002
|
||||
#define PMERR_ALREADY_IN_PATH 0x2003
|
||||
#define PMERR_ALREADY_IN_SEG 0x2004
|
||||
#define PMERR_AREA_INCOMPLETE 0x2005
|
||||
#define PMERR_BASE_ERROR 0x2006
|
||||
#define PMERR_BITBLT_LENGTH_EXCEEDED 0x2007
|
||||
#define PMERR_BITMAP_IN_USE 0x2008
|
||||
#define PMERR_BITMAP_IS_SELECTED 0x2009
|
||||
#define PMERR_BITMAP_NOT_FOUND 0x200a
|
||||
#define PMERR_BITMAP_NOT_SELECTED 0x200b
|
||||
#define PMERR_BOUNDS_OVERFLOW 0x200c
|
||||
#define PMERR_CALLED_SEG_IS_CHAINED 0x200d
|
||||
#define PMERR_CALLED_SEG_IS_CURRENT 0x200e
|
||||
#define PMERR_CALLED_SEG_NOT_FOUND 0x200f
|
||||
#define PMERR_CANNOT_DELETE_ALL_DATA 0x2010
|
||||
#define PMERR_CANNOT_REPLACE_ELEMENT_0 0x2011
|
||||
#define PMERR_COL_TABLE_NOT_REALIZABLE 0x2012
|
||||
#define PMERR_COL_TABLE_NOT_REALIZED 0x2013
|
||||
#define PMERR_COORDINATE_OVERFLOW 0x2014
|
||||
#define PMERR_CORR_FORMAT_MISMATCH 0x2015
|
||||
#define PMERR_DATA_TOO_LONG 0x2016
|
||||
#define PMERR_DC_IS_ASSOCIATED 0x2017
|
||||
#define PMERR_DESC_STRING_TRUNCATED 0x2018
|
||||
#define PMERR_DEVICE_DRIVER_ERROR_1 0x2019
|
||||
#define PMERR_DEVICE_DRIVER_ERROR_2 0x201a
|
||||
#define PMERR_DEVICE_DRIVER_ERROR_3 0x201b
|
||||
#define PMERR_DEVICE_DRIVER_ERROR_4 0x201c
|
||||
#define PMERR_DEVICE_DRIVER_ERROR_5 0x201d
|
||||
#define PMERR_DEVICE_DRIVER_ERROR_6 0x201e
|
||||
#define PMERR_DEVICE_DRIVER_ERROR_7 0x201f
|
||||
#define PMERR_DEVICE_DRIVER_ERROR_8 0x2020
|
||||
#define PMERR_DEVICE_DRIVER_ERROR_9 0x2021
|
||||
#define PMERR_DEVICE_DRIVER_ERROR_10 0x2022
|
||||
#define PMERR_DEV_FUNC_NOT_INSTALLED 0x2023
|
||||
#define PMERR_DOSOPEN_FAILURE 0x2024
|
||||
#define PMERR_DOSREAD_FAILURE 0x2025
|
||||
#define PMERR_DRIVER_NOT_FOUND 0x2026
|
||||
#define PMERR_DUP_SEG 0x2027
|
||||
#define PMERR_DYNAMIC_SEG_SEQ_ERROR 0x2028
|
||||
#define PMERR_DYNAMIC_SEG_ZERO_INV 0x2029
|
||||
#define PMERR_ELEMENT_INCOMPLETE 0x202a
|
||||
#define PMERR_ESC_CODE_NOT_SUPPORTED 0x202b
|
||||
#define PMERR_EXCEEDS_MAX_SEG_LENGTH 0x202c
|
||||
#define PMERR_FONT_AND_MODE_MISMATCH 0x202d
|
||||
#define PMERR_FONT_FILE_NOT_LOADED 0x202e
|
||||
#define PMERR_FONT_NOT_LOADED 0x202f
|
||||
#define PMERR_FONT_TOO_BIG 0x2030
|
||||
#define PMERR_HARDWARE_INIT_FAILURE 0x2031
|
||||
#define PMERR_HBITMAP_BUSY 0x2032
|
||||
#define PMERR_HDC_BUSY 0x2033
|
||||
#define PMERR_HRGN_BUSY 0x2034
|
||||
#define PMERR_HUGE_FONTS_NOT_SUPPORTED 0x2035
|
||||
#define PMERR_ID_HAS_NO_BITMAP 0x2036
|
||||
#define PMERR_IMAGE_INCOMPLETE 0x2037
|
||||
#define PMERR_INCOMPAT_COLOR_FORMAT 0x2038
|
||||
#define PMERR_INCOMPAT_COLOR_OPTIONS 0x2039
|
||||
#define PMERR_INCOMPATIBLE_BITMAP 0x203a
|
||||
#define PMERR_INCOMPATIBLE_METAFILE 0x203b
|
||||
#define PMERR_INCORRECT_DC_TYPE 0x203c
|
||||
#define PMERR_INSUFFICIENT_DISK_SPACE 0x203d
|
||||
#define PMERR_INSUFFICIENT_MEMORY 0x203e
|
||||
#define PMERR_INV_ANGLE_PARM 0x203f
|
||||
#define PMERR_INV_ARC_CONTROL 0x2040
|
||||
#define PMERR_INV_AREA_CONTROL 0x2041
|
||||
#define PMERR_INV_ARC_POINTS 0x2042
|
||||
#define PMERR_INV_ATTR_MODE 0x2043
|
||||
#define PMERR_INV_BACKGROUND_COL_ATTR 0x2044
|
||||
#define PMERR_INV_BACKGROUND_MIX_ATTR 0x2045
|
||||
#define PMERR_INV_BITBLT_MIX 0x2046
|
||||
#define PMERR_INV_BITBLT_STYLE 0x2047
|
||||
#define PMERR_INV_BITMAP_DIMENSION 0x2048
|
||||
#define PMERR_INV_BOX_CONTROL 0x2049
|
||||
#define PMERR_INV_BOX_ROUNDING_PARM 0x204a
|
||||
#define PMERR_INV_CHAR_ANGLE_ATTR 0x204b
|
||||
#define PMERR_INV_CHAR_DIRECTION_ATTR 0x204c
|
||||
#define PMERR_INV_CHAR_MODE_ATTR 0x204d
|
||||
#define PMERR_INV_CHAR_POS_OPTIONS 0x204e
|
||||
#define PMERR_INV_CHAR_SET_ATTR 0x204f
|
||||
#define PMERR_INV_CHAR_SHEAR_ATTR 0x2050
|
||||
#define PMERR_INV_CLIP_PATH_OPTIONS 0x2051
|
||||
#define PMERR_INV_CODEPAGE 0x2052
|
||||
#define PMERR_INV_COLOR_ATTR 0x2053
|
||||
#define PMERR_INV_COLOR_DATA 0x2054
|
||||
#define PMERR_INV_COLOR_FORMAT 0x2055
|
||||
#define PMERR_INV_COLOR_INDEX 0x2056
|
||||
#define PMERR_INV_COLOR_OPTIONS 0x2057
|
||||
#define PMERR_INV_COLOR_START_INDEX 0x2058
|
||||
#define PMERR_INV_COORD_OFFSET 0x2059
|
||||
#define PMERR_INV_COORD_SPACE 0x205a
|
||||
#define PMERR_INV_COORDINATE 0x205b
|
||||
#define PMERR_INV_CORRELATE_DEPTH 0x205c
|
||||
#define PMERR_INV_CORRELATE_TYPE 0x205d
|
||||
#define PMERR_INV_CURSOR_BITMAP 0x205e
|
||||
#define PMERR_INV_DC_DATA 0x205f
|
||||
#define PMERR_INV_DC_TYPE 0x2060
|
||||
#define PMERR_INV_DEVICE_NAME 0x2061
|
||||
#define PMERR_INV_DEV_MODES_OPTIONS 0x2062
|
||||
#define PMERR_INV_DRAW_CONTROL 0x2063
|
||||
#define PMERR_INV_DRAW_VALUE 0x2064
|
||||
#define PMERR_INV_DRAWING_MODE 0x2065
|
||||
#define PMERR_INV_DRIVER_DATA 0x2066
|
||||
#define PMERR_INV_DRIVER_NAME 0x2067
|
||||
#define PMERR_INV_DRAW_BORDER_OPTION 0x2068
|
||||
#define PMERR_INV_EDIT_MODE 0x2069
|
||||
#define PMERR_INV_ELEMENT_OFFSET 0x206a
|
||||
#define PMERR_INV_ELEMENT_POINTER 0x206b
|
||||
#define PMERR_INV_END_PATH_OPTIONS 0x206c
|
||||
#define PMERR_INV_ESC_CODE 0x206d
|
||||
#define PMERR_INV_ESCAPE_DATA 0x206e
|
||||
#define PMERR_INV_EXTENDED_LCID 0x206f
|
||||
#define PMERR_INV_FILL_PATH_OPTIONS 0x2070
|
||||
#define PMERR_INV_FIRST_CHAR 0x2071
|
||||
#define PMERR_INV_FONT_ATTRS 0x2072
|
||||
#define PMERR_INV_FONT_FILE_DATA 0x2073
|
||||
#define PMERR_INV_FOR_THIS_DC_TYPE 0x2074
|
||||
#define PMERR_INV_FORMAT_CONTROL 0x2075
|
||||
#define PMERR_INV_FORMS_CODE 0x2076
|
||||
#define PMERR_INV_FONTDEF 0x2077
|
||||
#define PMERR_INV_GEOM_LINE_WIDTH_ATTR 0x2078
|
||||
#define PMERR_INV_GETDATA_CONTROL 0x2079
|
||||
#define PMERR_INV_GRAPHICS_FIELD 0x207a
|
||||
#define PMERR_INV_HBITMAP 0x207b
|
||||
#define PMERR_INV_HDC 0x207c
|
||||
#define PMERR_INV_HJOURNAL 0x207d
|
||||
#define PMERR_INV_HMF 0x207e
|
||||
#define PMERR_INV_HPS 0x207f
|
||||
#define PMERR_INV_HRGN 0x2080
|
||||
#define PMERR_INV_ID 0x2081
|
||||
#define PMERR_INV_IMAGE_DATA_LENGTH 0x2082
|
||||
#define PMERR_INV_IMAGE_DIMENSION 0x2083
|
||||
#define PMERR_INV_IMAGE_FORMAT 0x2084
|
||||
#define PMERR_INV_IN_AREA 0x2085
|
||||
#define PMERR_INV_IN_CALLED_SEG 0x2086
|
||||
#define PMERR_INV_IN_CURRENT_EDIT_MODE 0x2087
|
||||
#define PMERR_INV_IN_DRAW_MODE 0x2088
|
||||
#define PMERR_INV_IN_ELEMENT 0x2089
|
||||
#define PMERR_INV_IN_IMAGE 0x208a
|
||||
#define PMERR_INV_IN_PATH 0x208b
|
||||
#define PMERR_INV_IN_RETAIN_MODE 0x208c
|
||||
#define PMERR_INV_IN_SEG 0x208d
|
||||
#define PMERR_INV_IN_VECTOR_SYMBOL 0x208e
|
||||
#define PMERR_INV_INFO_TABLE 0x208f
|
||||
#define PMERR_INV_JOURNAL_OPTION 0x2090
|
||||
#define PMERR_INV_KERNING_FLAGS 0x2091
|
||||
#define PMERR_INV_LENGTH_OR_COUNT 0x2092
|
||||
#define PMERR_INV_LINE_END_ATTR 0x2093
|
||||
#define PMERR_INV_LINE_JOIN_ATTR 0x2094
|
||||
#define PMERR_INV_LINE_TYPE_ATTR 0x2095
|
||||
#define PMERR_INV_LINE_WIDTH_ATTR 0x2096
|
||||
#define PMERR_INV_LOGICAL_ADDRESS 0x2097
|
||||
#define PMERR_INV_MARKER_BOX_ATTR 0x2098
|
||||
#define PMERR_INV_MARKER_SET_ATTR 0x2099
|
||||
#define PMERR_INV_MARKER_SYMBOL_ATTR 0x209a
|
||||
#define PMERR_INV_MATRIX_ELEMENT 0x209b
|
||||
#define PMERR_INV_MAX_HITS 0x209c
|
||||
#define PMERR_INV_METAFILE 0x209d
|
||||
#define PMERR_INV_METAFILE_LENGTH 0x209e
|
||||
#define PMERR_INV_METAFILE_OFFSET 0x209f
|
||||
#define PMERR_INV_MICROPS_DRAW_CONTROL 0x20a0
|
||||
#define PMERR_INV_MICROPS_FUNCTION 0x20a1
|
||||
#define PMERR_INV_MICROPS_ORDER 0x20a2
|
||||
#define PMERR_INV_MIX_ATTR 0x20a3
|
||||
#define PMERR_INV_MODE_FOR_OPEN_DYN 0x20a4
|
||||
#define PMERR_INV_MODE_FOR_REOPEN_SEG 0x20a5
|
||||
#define PMERR_INV_MODIFY_PATH_MODE 0x20a6
|
||||
#define PMERR_INV_MULTIPLIER 0x20a7
|
||||
#define PMERR_INV_NESTED_FIGURES 0x20a8
|
||||
#define PMERR_INV_OR_INCOMPAT_OPTIONS 0x20a9
|
||||
#define PMERR_INV_ORDER_LENGTH 0x20aa
|
||||
#define PMERR_INV_ORDERING_PARM 0x20ab
|
||||
#define PMERR_INV_OUTSIDE_DRAW_MODE 0x20ac
|
||||
#define PMERR_INV_PAGE_VIEWPORT 0x20ad
|
||||
#define PMERR_INV_PATH_ID 0x20ae
|
||||
#define PMERR_INV_PATH_MODE 0x20af
|
||||
#define PMERR_INV_PATTERN_ATTR 0x20b0
|
||||
#define PMERR_INV_PATTERN_REF_PT_ATTR 0x20b1
|
||||
#define PMERR_INV_PATTERN_SET_ATTR 0x20b2
|
||||
#define PMERR_INV_PATTERN_SET_FONT 0x20b3
|
||||
#define PMERR_INV_PICK_APERTURE_OPTION 0x20b4
|
||||
#define PMERR_INV_PICK_APERTURE_POSN 0x20b5
|
||||
#define PMERR_INV_PICK_APERTURE_SIZE 0x20b6
|
||||
#define PMERR_INV_PICK_NUMBER 0x20b7
|
||||
#define PMERR_INV_PLAY_METAFILE_OPTION 0x20b8
|
||||
#define PMERR_INV_PRIMITIVE_TYPE 0x20b9
|
||||
#define PMERR_INV_PS_SIZE 0x20ba
|
||||
#define PMERR_INV_PUTDATA_FORMAT 0x20bb
|
||||
#define PMERR_INV_QUERY_ELEMENT_NO 0x20bc
|
||||
#define PMERR_INV_RECT 0x20bd
|
||||
#define PMERR_INV_REGION_CONTROL 0x20be
|
||||
#define PMERR_INV_REGION_MIX_MODE 0x20bf
|
||||
#define PMERR_INV_REPLACE_MODE_FUNC 0x20c0
|
||||
#define PMERR_INV_RESERVED_FIELD 0x20c1
|
||||
#define PMERR_INV_RESET_OPTIONS 0x20c2
|
||||
#define PMERR_INV_RGBCOLOR 0x20c3
|
||||
#define PMERR_INV_SCAN_START 0x20c4
|
||||
#define PMERR_INV_SEG_ATTR 0x20c5
|
||||
#define PMERR_INV_SEG_ATTR_VALUE 0x20c6
|
||||
#define PMERR_INV_SEG_CH_LENGTH 0x20c7
|
||||
#define PMERR_INV_SEG_NAME 0x20c8
|
||||
#define PMERR_INV_SEG_OFFSET 0x20c9
|
||||
#define PMERR_INV_SETID 0x20ca
|
||||
#define PMERR_INV_SETID_TYPE 0x20cb
|
||||
#define PMERR_INV_SET_VIEWPORT_OPTION 0x20cc
|
||||
#define PMERR_INV_SHARPNESS_PARM 0x20cd
|
||||
#define PMERR_INV_SOURCE_OFFSET 0x20ce
|
||||
#define PMERR_INV_STOP_DRAW_VALUE 0x20cf
|
||||
#define PMERR_INV_TRANSFORM_TYPE 0x20d0
|
||||
#define PMERR_INV_USAGE_PARM 0x20d1
|
||||
#define PMERR_INV_VIEWING_LIMITS 0x20d2
|
||||
#define PMERR_JFILE_BUSY 0x20d3
|
||||
#define PMERR_JNL_FUNC_DATA_TOO_LONG 0x20d4
|
||||
#define PMERR_KERNING_NOT_SUPPORTED 0x20d5
|
||||
#define PMERR_LABEL_NOT_FOUND 0x20d6
|
||||
#define PMERR_MATRIX_OVERFLOW 0x20d7
|
||||
#define PMERR_METAFILE_INTERNAL_ERROR 0x20d8
|
||||
#define PMERR_METAFILE_IN_USE 0x20d9
|
||||
#define PMERR_METAFILE_LIMIT_EXCEEDED 0x20da
|
||||
#define PMERR_NAME_STACK_FULL 0x20db
|
||||
#define PMERR_NOT_CREATED_BY_DEVOPENDC 0x20dc
|
||||
#define PMERR_NOT_IN_AREA 0x20dd
|
||||
#define PMERR_NOT_IN_DRAW_MODE 0x20de
|
||||
#define PMERR_NOT_IN_ELEMENT 0x20df
|
||||
#define PMERR_NOT_IN_IMAGE 0x20e0
|
||||
#define PMERR_NOT_IN_PATH 0x20e1
|
||||
#define PMERR_NOT_IN_RETAIN_MODE 0x20e2
|
||||
#define PMERR_NOT_IN_SEG 0x20e3
|
||||
#define PMERR_NO_BITMAP_SELECTED 0x20e4
|
||||
#define PMERR_NO_CURRENT_ELEMENT 0x20e5
|
||||
#define PMERR_NO_CURRENT_SEG 0x20e6
|
||||
#define PMERR_NO_METAFILE_RECORD_HANDLE 0x20e7
|
||||
#define PMERR_ORDER_TOO_BIG 0x20e8
|
||||
#define PMERR_OTHER_SET_ID_REFS 0x20e9
|
||||
#define PMERR_OVERRAN_SEG 0x20ea
|
||||
#define PMERR_OWN_SET_ID_REFS 0x20eb
|
||||
#define PMERR_PATH_INCOMPLETE 0x20ec
|
||||
#define PMERR_PATH_LIMIT_EXCEEDED 0x20ed
|
||||
#define PMERR_PATH_UNKNOWN 0x20ee
|
||||
#define PMERR_PEL_IS_CLIPPED 0x20ef
|
||||
#define PMERR_PEL_NOT_AVAILABLE 0x20f0
|
||||
#define PMERR_PRIMITIVE_STACK_EMPTY 0x20f1
|
||||
#define PMERR_PROLOG_ERROR 0x20f2
|
||||
#define PMERR_PROLOG_SEG_ATTR_NOT_SET 0x20f3
|
||||
#define PMERR_PS_BUSY 0x20f4
|
||||
#define PMERR_PS_IS_ASSOCIATED 0x20f5
|
||||
#define PMERR_RAM_JNL_FILE_TOO_SMALL 0x20f6
|
||||
#define PMERR_REALIZE_NOT_SUPPORTED 0x20f7
|
||||
#define PMERR_REGION_IS_CLIP_REGION 0x20f8
|
||||
#define PMERR_RESOURCE_DEPLETION 0x20f9
|
||||
#define PMERR_SEG_AND_REFSEG_ARE_SAME 0x20fa
|
||||
#define PMERR_SEG_CALL_RECURSIVE 0x20fb
|
||||
#define PMERR_SEG_CALL_STACK_EMPTY 0x20fc
|
||||
#define PMERR_SEG_CALL_STACK_FULL 0x20fd
|
||||
#define PMERR_SEG_IS_CURRENT 0x20fe
|
||||
#define PMERR_SEG_NOT_CHAINED 0x20ff
|
||||
#define PMERR_SEG_NOT_FOUND 0x2100
|
||||
#define PMERR_SEG_STORE_LIMIT_EXCEEDED 0x2101
|
||||
#define PMERR_SETID_IN_USE 0x2102
|
||||
#define PMERR_SETID_NOT_FOUND 0x2103
|
||||
#define PMERR_STARTDOC_NOT_ISSUED 0x2104
|
||||
#define PMERR_STOP_DRAW_OCCURRED 0x2105
|
||||
#define PMERR_TOO_MANY_METAFILES_IN_USE 0x2106
|
||||
#define PMERR_TRUNCATED_ORDER 0x2107
|
||||
#define PMERR_UNCHAINED_SEG_ZERO_INV 0x2108
|
||||
#define PMERR_UNSUPPORTED_ATTR 0x2109
|
||||
#define PMERR_UNSUPPORTED_ATTR_VALUE 0x210a
|
||||
#define PMERR_ENDDOC_NOT_ISSUED 0x210b
|
||||
#define PMERR_PS_NOT_ASSOCIATED 0x210c
|
||||
#define PMERR_INV_FLOOD_FILL_OPTIONS 0x210d
|
||||
#define PMERR_INV_FACENAME 0x210e
|
||||
#define PMERR_PALETTE_SELECTED 0x210f
|
||||
#define PMERR_NO_PALETTE_SELECTED 0x2110
|
||||
#define PMERR_INV_HPAL 0x2111
|
||||
#define PMERR_PALETTE_BUSY 0x2112
|
||||
#define PMERR_START_POINT_CLIPPED 0x2113
|
||||
#define PMERR_NO_FILL 0x2114
|
||||
#define PMERR_INV_FACENAMEDESC 0x2115
|
||||
#define PMERR_INV_BITMAP_DATA 0x2116
|
||||
#define PMERR_INV_CHAR_ALIGN_ATTR 0x2117
|
||||
#define PMERR_INV_HFONT 0x2118
|
||||
#define PMERR_HFONT_IS_SELECTED 0x2119
|
||||
#define PMERR_DRVR_NOT_SUPPORTED 0x2120
|
||||
#define PMERR_INV_INKPS_FUNCTION 0x2121
|
||||
|
||||
@@ -1,236 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Harbour GUI framework for IBM OS/2 Presentation Manager
|
||||
*
|
||||
* Copyright 2001 Antonio Linares <alinares@fivetech.com>
|
||||
* Copyright 2001 Maurilio Longo <maurilio.longo@libero.it>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "common.ch"
|
||||
#include "hbclass.ch"
|
||||
#include "os2pm.ch" // Needed to store some OS/2 PM constant values
|
||||
|
||||
|
||||
// Windows compatibility Message redefinition
|
||||
#define WM_LBUTTONDOWN WM_BUTTON1DOWN
|
||||
|
||||
|
||||
static aForms := {}
|
||||
|
||||
|
||||
CLASS HBForm FROM HBWinControl
|
||||
|
||||
DATA oMainMenu
|
||||
DATA OnClick PROPERTY
|
||||
DATA aControls PROPERTY
|
||||
|
||||
CLASSDATA lRegistered
|
||||
|
||||
METHOD New()
|
||||
METHOD Close() INLINE SendMessage( ::hWnd, WM_CLOSE )
|
||||
METHOD Command( nNotifyCode, nId, hWndCtl )
|
||||
METHOD HandleEvent( nMsg, nParam1, nParam2 )
|
||||
METHOD InsertControl( oControl )
|
||||
METHOD LButtonDown( nKeyFlags, nXPos, nYPos )
|
||||
METHOD ShowModal()
|
||||
|
||||
ACCESS Menu() INLINE ::oMainMenu PROPERTY
|
||||
ASSIGN Menu( oNewMenu )
|
||||
|
||||
ENDCLASS
|
||||
|
||||
|
||||
METHOD New() CLASS HBForm
|
||||
|
||||
local hWC
|
||||
|
||||
DEFAULT ::lRegistered TO .f.
|
||||
|
||||
|
||||
if ! ::lRegistered
|
||||
// Notice that this code may be moved to a method Register()
|
||||
// so we hide again the OS API details
|
||||
WinRegisterClass("HB_HBForm", CS_SIZEREDRAW, 0, 0 )
|
||||
::lRegistered := .t.
|
||||
endif
|
||||
|
||||
// Again this code may be moved to a method Create() to hide the
|
||||
// OS API details
|
||||
::hWnd := WinCreateStdWindow( HWND_DESKTOP,;
|
||||
WS_VISIBLE,;
|
||||
(FCF_TITLEBAR + FCF_SYSMENU +;
|
||||
FCF_SIZEBORDER + FCF_TASKLIST +;
|
||||
FCF_MINMAX + FCF_SHELLPOSITION ),;
|
||||
"HB_HBForm", "Harbour HBForm",;
|
||||
(WS_SYNCPAINT + WS_VISIBLE ),,,;
|
||||
@hWC )
|
||||
|
||||
::hWndClient := hWC
|
||||
|
||||
AAdd(aForms, Self)
|
||||
return Self
|
||||
|
||||
|
||||
METHOD Command( nNotifyCode, nId, hWndCtl ) CLASS HBForm
|
||||
|
||||
local oMenuItem, nAt, oControl
|
||||
|
||||
HB_SYMBOL_UNUSED( hWndCtl )
|
||||
|
||||
do case
|
||||
case nNotifyCode == CMDSRC_MENU // Menu command
|
||||
if ::Menu != nil
|
||||
if ( oMenuItem := ::Menu:FindItem( nId ) ) != nil
|
||||
if oMenuItem:OnClick != nil
|
||||
__ObjSendMsg( Self, oMenuItem:OnClick, oMenuItem )
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
case nNotifyCode == CMDSRC_PUSHBUTTON
|
||||
nAt := AScan( ::aControls, { | o | o:nId == nId } )
|
||||
if nAt != 0
|
||||
oControl := ::aControls[ nAt ]
|
||||
if oControl:OnClick != nil
|
||||
__ObjSendMsg( Self, oControl:OnClick, oControl )
|
||||
endif
|
||||
endif
|
||||
|
||||
otherwise
|
||||
endcase
|
||||
|
||||
return nil
|
||||
|
||||
|
||||
METHOD InsertControl( oControl ) CLASS HBForm
|
||||
|
||||
DEFAULT ::aControls TO {}
|
||||
|
||||
AAdd( ::aControls, oControl )
|
||||
oControl:Show()
|
||||
|
||||
return nil
|
||||
|
||||
|
||||
METHOD LButtonDown( nKeyFlags, nXPos, nYPos ) CLASS HBForm
|
||||
|
||||
HB_SYMBOL_UNUSED( nKeyFlags )
|
||||
|
||||
if ::OnClick != nil
|
||||
return __ObjSendMsg( Self, ::OnClick, Self, nXPos, nYPos )
|
||||
endif
|
||||
|
||||
return nil
|
||||
|
||||
|
||||
METHOD HandleEvent( nMsg, nParam1, nParam2 ) CLASS HBForm
|
||||
|
||||
do case
|
||||
case nMsg == WM_COMMAND
|
||||
/*
|
||||
param1
|
||||
USHORT uscmd // Command value.
|
||||
param2
|
||||
USHORT ussource // Source type.
|
||||
USHORT uspointer // Pointer-device indicator.
|
||||
returns
|
||||
ULONG ulReserved // Reserved value, should be 0.
|
||||
*/
|
||||
::Command( nLoWord( nParam2 ), nLoWord( nParam1 ), nil )
|
||||
return 0
|
||||
|
||||
case nMsg == WM_LBUTTONDOWN
|
||||
/*
|
||||
param1
|
||||
POINTS ptspointerpos // Pointer position.
|
||||
param2
|
||||
USHORT fsHitTestres // Hit-test result.
|
||||
USHORT fsflags // Keyboard control codes.
|
||||
returns
|
||||
BOOL rc // Processed indicator.
|
||||
*/
|
||||
return ::LButtonDown( nHiWord(nParam2), nLoWord( nParam1 ), nHiWord( nParam1 ) )
|
||||
|
||||
case nMsg == WM_DESTROY
|
||||
PostQuitMessage( 0 )
|
||||
return 0
|
||||
endcase
|
||||
|
||||
return nil
|
||||
|
||||
METHOD ShowModal() CLASS HBForm
|
||||
|
||||
HB_FormShowModal(::hWnd)
|
||||
|
||||
return nil
|
||||
|
||||
|
||||
ASSIGN Menu( oNewMenu ) CLASS HBForm
|
||||
|
||||
::oMainMenu := oNewMenu
|
||||
|
||||
WinSetParent( oNewMenu:nHandle, ::hWnd, .t. )
|
||||
WinSetOwner( oNewMenu:nHandle, ::hWnd )
|
||||
WinSendMsg( ::hWnd, WM_UPDATEFRAME, FCF_MENU, 0 )
|
||||
|
||||
return nil
|
||||
|
||||
|
||||
function HB_GUI( hWnd, nMsg, nParam1, nParam2 ) // messages entry point
|
||||
|
||||
static aReturn := { nil, nil }
|
||||
|
||||
local nForm := AScan( aForms, { | oForm | oForm:hWndClient == hWnd } )
|
||||
|
||||
if nForm != 0
|
||||
aReturn[ 1 ] := aForms[ nForm ]:HandleEvent( nMsg, nParam1, nParam2 )
|
||||
endif
|
||||
|
||||
return aReturn
|
||||
@@ -1,109 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Harbour GUI framework for IBM OS/2 Presentation Manager
|
||||
*
|
||||
* Copyright 2001 Antonio Linares <alinares@fivetech.com>
|
||||
* Copyright 2001 Maurilio Longo <maurilio.longo@libero.it>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "hbclass.ch"
|
||||
#include "os2pm.ch"
|
||||
|
||||
|
||||
CLASS HBMenu FROM HBPersistent
|
||||
|
||||
DATA nHandle // Handle of MIS_ACTIONBAR
|
||||
DATA Items PROPERTY // Items inside this menu
|
||||
|
||||
METHOD New(oForm)
|
||||
METHOD Add(oMenuItem)
|
||||
METHOD FindItem( nId ) // Searches for a sub menuitem given its id
|
||||
|
||||
ENDCLASS
|
||||
|
||||
|
||||
METHOD New( oForm ) CLASS HBMenu
|
||||
|
||||
::Items := {}
|
||||
|
||||
if oForm != nil
|
||||
::nHandle := WinCreateMenu( oForm:hWnd )
|
||||
endif
|
||||
|
||||
return Self
|
||||
|
||||
|
||||
METHOD Add( oMenuItem ) CLASS HBMenu
|
||||
|
||||
WinAddMenuItem( ::nHandle, oMenuItem:Caption, MIT_END,;
|
||||
nil, oMenuItem:nId, oMenuItem:Enabled )
|
||||
|
||||
AAdd( ::Items, oMenuItem )
|
||||
|
||||
return nil
|
||||
|
||||
|
||||
METHOD FindItem( nId ) CLASS HBMenu
|
||||
|
||||
local oMenuItem, n
|
||||
|
||||
for n := 1 to Len( ::Items )
|
||||
if ( oMenuItem := ::Items[ n ] ):nId == nId
|
||||
return oMenuItem
|
||||
else
|
||||
if oMenuItem:Items != nil
|
||||
if ( oMenuItem := oMenuItem:FindItem( nId ) ) != nil
|
||||
return oMenuItem
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
next
|
||||
|
||||
return oMenuItem
|
||||
@@ -1,128 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Harbour GUI framework for IBM OS/2 Presentation Manager
|
||||
*
|
||||
* Copyright 2001 Antonio Linares <alinares@fivetech.com>
|
||||
* Copyright 2001 Maurilio Longo <maurilio.longo@libero.it>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "common.ch"
|
||||
#include "hbclass.ch"
|
||||
#include "os2pm.ch"
|
||||
|
||||
|
||||
CLASS HGFMenuItem FROM HBPersistent
|
||||
|
||||
DATA Caption PROPERTY // Specifies the text of the menu item
|
||||
DATA Name PROPERTY // The name of this component
|
||||
DATA OnClick PROPERTY // A character description of the method to invoke
|
||||
DATA Enabled PROPERTY // Specifies whether the menu item is enabled
|
||||
DATA Items PROPERTY // Contains the menu items in the submenu of the menu item
|
||||
|
||||
DATA nId // Command value to send to the container form
|
||||
DATA oParent // Identifies the parent menu item of this menu item
|
||||
DATA nHandle // The handle of the submenu of this menu item
|
||||
|
||||
CLASSDATA nIdStart // start value for commands value to assign to menu items
|
||||
|
||||
METHOD New( oOwner ) // Creates a new menu item
|
||||
METHOD Add( oMenuItem ) // Adds a new drop down menu item
|
||||
METHOD FindItem( nId ) // Searches for a sub menuitem given its id
|
||||
|
||||
ENDCLASS
|
||||
|
||||
|
||||
METHOD New( oOwner ) CLASS HGFMenuItem
|
||||
|
||||
DEFAULT ::nIdStart TO 110
|
||||
|
||||
::Caption := ""
|
||||
::nId := ::nIdStart++
|
||||
::Enabled := .t.
|
||||
::oParent := oOwner
|
||||
::nHandle := nil
|
||||
|
||||
return Self
|
||||
|
||||
|
||||
METHOD Add( oMenuItem ) CLASS HGFMenuItem
|
||||
|
||||
DEFAULT ::Items TO {}
|
||||
|
||||
if ::nHandle == nil
|
||||
::nHandle := WinCreateMenu( ::oParent:nHandle )
|
||||
WinMakeSubMenuItem(::oParent:nHandle, ::nId, ::nHandle)
|
||||
|
||||
endif
|
||||
|
||||
WinAddMenuItem(::nHandle, oMenuItem:Caption, MIT_END,;
|
||||
nil, oMenuItem:nId, oMenuItem:Enabled )
|
||||
|
||||
AAdd( ::Items, oMenuItem )
|
||||
|
||||
return nil
|
||||
|
||||
|
||||
METHOD FindItem( nId ) CLASS HGFMenuItem
|
||||
|
||||
local oMenuItem, n
|
||||
|
||||
for n := 1 to Len( ::Items )
|
||||
if ( oMenuItem := ::Items[ n ] ):nId == nId
|
||||
return oMenuItem
|
||||
else
|
||||
if oMenuItem:Items != nil
|
||||
if ( oMenuItem := oMenuItem:FindItem( nId ) ) != nil
|
||||
return oMenuItem
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
next
|
||||
|
||||
return oMenuItem
|
||||
@@ -1,95 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Harbour GUI framework for IBM OS/2 Presentation Manager
|
||||
* Class HBWinControl
|
||||
*
|
||||
* Copyright 2001 Antonio Linares <alinares@fivetech.com>
|
||||
* Copyright 2001 Maurilio Longo <maurilio.longo@libero.it>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* Copyright 2001 Antonio Linares <alinares@fivetech.com>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "common.ch"
|
||||
#include "hbclass.ch"
|
||||
|
||||
// NOTE: What does this define do under Windows?
|
||||
#define SW_SHOWNA 8
|
||||
|
||||
|
||||
CLASS HBWinControl FROM HBPersistent
|
||||
|
||||
DATA hWnd // Frame Window Handle
|
||||
DATA hWndClient // Client Window Handle
|
||||
|
||||
DATA nId
|
||||
|
||||
CLASSDATA nInitId
|
||||
|
||||
ACCESS Caption() INLINE WinGetText( ::hWnd ) PROPERTY
|
||||
ASSIGN Caption( cNewCaption ) INLINE ;
|
||||
WinSetWindowText( ::hWnd, cNewCaption )
|
||||
|
||||
ACCESS Top() INLINE WinGetTop( ::hWnd ) PROPERTY
|
||||
ASSIGN Top( nNewTop ) INLINE WinSetTop( ::hWnd, nNewTop )
|
||||
|
||||
ACCESS Left() INLINE WinGetLeft( ::hWnd ) PROPERTY
|
||||
ASSIGN Left( nNewLeft ) INLINE WinSetLeft( ::hWnd, nNewLeft )
|
||||
|
||||
ACCESS Height() INLINE WinGetHeight( ::hWnd ) PROPERTY
|
||||
ASSIGN Height( nNewHeight ) INLINE WinSetHeight( ::hWnd, nNewHeight )
|
||||
|
||||
ACCESS Width() INLINE WinGetWidth( ::hWnd ) PROPERTY
|
||||
ASSIGN Width( nNewWidth ) INLINE WinSetWidth( ::hWnd, nNewWidth )
|
||||
|
||||
METHOD GetNewId() INLINE ::nId := iif( ::nInitId == NIL, ::nInitId := 1,;
|
||||
++::nInitId )
|
||||
|
||||
METHOD Show() INLINE ShowWindow( ::hWnd, .T. /*SW_SHOWNA*/ )
|
||||
|
||||
ENDCLASS
|
||||
@@ -1,73 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Harbour GUI framework for Windows
|
||||
* Class HBButton
|
||||
*
|
||||
* Copyright 2001 Antonio Linares <alinares@fivetech.com>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "common.ch"
|
||||
#include "hbclass.ch"
|
||||
#include "hbgfwin.ch"
|
||||
|
||||
CLASS HBButton FROM HBWinControl
|
||||
|
||||
DATA OnClick PROPERTY
|
||||
|
||||
METHOD New( oContainer )
|
||||
|
||||
ENDCLASS
|
||||
|
||||
METHOD New( oContainer ) CLASS HBButton
|
||||
|
||||
::hWnd := WinCreateStdWindow( , nOr( WS_CHILD, WS_TABSTOP ),, "BUTTON", "",,;
|
||||
oContainer:hWnd, ::GetNewId() )
|
||||
::Width := 80
|
||||
::Height := 25
|
||||
|
||||
return Self
|
||||
@@ -1,71 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Harbour GUI framework for Windows
|
||||
* Class HBEdit
|
||||
*
|
||||
* Copyright 2001 Antonio Linares <alinares@fivetech.com>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "common.ch"
|
||||
#include "hbclass.ch"
|
||||
#include "hbgfwin.ch"
|
||||
|
||||
CLASS HBEdit FROM HBWinControl
|
||||
|
||||
METHOD New( oContainer )
|
||||
|
||||
ENDCLASS
|
||||
|
||||
METHOD New( oContainer ) CLASS HBEdit
|
||||
|
||||
::hWnd := WinCreateStdWindow( , nOr( WS_BORDER, WS_CHILD, WS_TABSTOP ),,;
|
||||
"EDIT", "",, oContainer:hWnd, ::GetNewId() )
|
||||
::Width := 121
|
||||
::Height := 21
|
||||
|
||||
return Self
|
||||
@@ -1,184 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Harbour GUI framework for Windows
|
||||
* Class HBForm
|
||||
*
|
||||
* Copyright 2001 Antonio Linares <alinares@fivetech.com>
|
||||
* Copyright 2001 Alexander Kresin <alex@belacy.belgorod.su>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "common.ch"
|
||||
#include "hbclass.ch"
|
||||
#include "hbgfwin.ch"
|
||||
|
||||
static aForms := {}
|
||||
|
||||
CLASS HBForm FROM HBWinControl
|
||||
|
||||
DATA oMainMenu
|
||||
|
||||
DATA aControls PROPERTY
|
||||
DATA OnClick PROPERTY
|
||||
|
||||
CLASSDATA lRegistered
|
||||
|
||||
METHOD New()
|
||||
METHOD Close() INLINE SendMessage( ::hWnd, WM_CLOSE )
|
||||
METHOD Command( nNotifyCode, nId, hWndCtl )
|
||||
METHOD HandleEvent( nMsg, nParam1, nParam2 )
|
||||
METHOD InsertControl( oControl )
|
||||
METHOD LButtonDown( nKeyFlags, nXPos, nYPos )
|
||||
METHOD ShowModal()
|
||||
|
||||
ACCESS Menu() INLINE ::oMainMenu PROPERTY
|
||||
ASSIGN Menu( oNewMenu )
|
||||
|
||||
ENDCLASS
|
||||
|
||||
|
||||
METHOD New() CLASS HBForm
|
||||
|
||||
DEFAULT ::lRegistered TO .f.
|
||||
|
||||
if ! ::lRegistered
|
||||
WinRegisterClass( "HB_TFORM" )
|
||||
::lRegistered := .t.
|
||||
endif
|
||||
|
||||
::hWnd := WinCreateStdWindow( , nOr( WS_OVERLAPPEDWINDOW ),,;
|
||||
"HB_TFORM", "Harbour TForm" )
|
||||
|
||||
AAdd( aForms, Self )
|
||||
|
||||
return Self
|
||||
|
||||
METHOD Command( nNotifyCode, nId, hWndCtl ) CLASS HBForm
|
||||
|
||||
local oMenuItem, nAt, oControl
|
||||
|
||||
if nNotifyCode == 0 // Menu command
|
||||
if ::Menu != nil
|
||||
if ( oMenuItem := ::Menu:FindItem( nId ) ) != nil
|
||||
if oMenuItem:OnClick != nil
|
||||
__ObjSendMsg( Self, oMenuItem:OnClick, oMenuItem )
|
||||
endif
|
||||
endif
|
||||
else // Control command
|
||||
nAt := AScan( ::aControls, { | o | o:hWnd == hWndCtl } )
|
||||
if nAt != 0
|
||||
oControl := ::aControls[ nAt ]
|
||||
if oControl:OnClick != nil
|
||||
__ObjSendMsg( Self, oControl:OnClick, oControl )
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
return nil
|
||||
|
||||
METHOD InsertControl( oControl ) CLASS HBForm
|
||||
|
||||
DEFAULT ::aControls TO {}
|
||||
|
||||
AAdd( ::aControls, oControl )
|
||||
oControl:Show()
|
||||
|
||||
return nil
|
||||
|
||||
METHOD LButtonDown( nKeyFlags, nXPos, nYPos ) CLASS HBForm
|
||||
|
||||
HB_SYMBOL_UNUSED( nKeyFlags )
|
||||
|
||||
if ::OnClick != nil
|
||||
return __ObjSendMsg( Self, ::OnClick, Self, nXPos, nYPos )
|
||||
endif
|
||||
|
||||
return nil
|
||||
|
||||
METHOD HandleEvent( nMsg, nParam1, nParam2 ) CLASS HBForm
|
||||
|
||||
do case
|
||||
case nMsg == WM_COMMAND
|
||||
return ::Command( nHiWord( nParam1 ), nLoWord( nParam1 ), nParam2 )
|
||||
|
||||
case nMsg == WM_LBUTTONDOWN
|
||||
return ::LButtonDown( nParam1, nLoWord( nParam2 ), nHiWord( nParam2 ) )
|
||||
|
||||
case nMsg == WM_DESTROY
|
||||
PostQuitMessage( 0 )
|
||||
return 0
|
||||
endcase
|
||||
|
||||
return nil
|
||||
|
||||
METHOD ShowModal() CLASS HBForm
|
||||
|
||||
HB_FormShowModal( ::hWnd )
|
||||
|
||||
return nil
|
||||
|
||||
|
||||
ASSIGN Menu( oNewMenu ) CLASS HBForm
|
||||
|
||||
::oMainMenu := oNewMenu
|
||||
|
||||
SetMenu( ::hWnd, oNewMenu:nHandle )
|
||||
|
||||
return nil
|
||||
|
||||
function HB_GUI( hWnd, nMsg, nParam1, nParam2 ) // messages entry point
|
||||
|
||||
local nForm := AScan( aForms, { | oForm | oForm:hWnd == hWnd } )
|
||||
|
||||
static aReturn := { nil, nil }
|
||||
|
||||
if nForm != 0
|
||||
aReturn[ 1 ] := aForms[ nForm ]:HandleEvent( nMsg, nParam1, nParam2 )
|
||||
endif
|
||||
|
||||
return aReturn
|
||||
@@ -1,80 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Harbour GUI framework for Windows
|
||||
* Constants definitions header file
|
||||
*
|
||||
* Copyright 2001 Antonio Linares <alinares@fivetech.com>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HB_GFWIN_CH_
|
||||
#define HB_GFWIN_CH_
|
||||
|
||||
#define WM_CLOSE 0x0010
|
||||
#define WM_COMMAND 0x0111
|
||||
#define WM_DESTROY 0x0002
|
||||
#define WM_LBUTTONDOWN 0x0201
|
||||
|
||||
#define WS_VISIBLE 0x10000000
|
||||
#define WS_OVERLAPPED 0x00000000
|
||||
#define WS_MINIMIZE 0x20000000
|
||||
#define WS_MAXIMIZE 0x01000000
|
||||
#define WS_CAPTION 0x00C00000
|
||||
#define WS_BORDER 0x00800000
|
||||
#define WS_SYSMENU 0x00080000
|
||||
#define WS_THICKFRAME 0x00040000
|
||||
#define WS_MINIMIZEBOX 0x00020000
|
||||
#define WS_MAXIMIZEBOX 0x00010000
|
||||
|
||||
#define WS_OVERLAPPEDWINDOW ( WS_OVERLAPPED + WS_CAPTION + ;
|
||||
WS_SYSMENU + WS_THICKFRAME + WS_MINIMIZEBOX + ;
|
||||
WS_MAXIMIZEBOX)
|
||||
|
||||
#define WS_CHILD 0x40000000
|
||||
#define WS_TABSTOP 0x00010000
|
||||
|
||||
#endif
|
||||
@@ -1,20 +0,0 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
-hblib
|
||||
-ohbgfwin
|
||||
-inc
|
||||
-q0 -w3 -es2 -l
|
||||
|
||||
"-echo={!allwin}This library builds on win/wce only."
|
||||
-stop{!allwin}
|
||||
|
||||
winapi.c
|
||||
|
||||
button.prg
|
||||
edit.prg
|
||||
form.prg
|
||||
menu.prg
|
||||
menuitem.prg
|
||||
winctrl.prg
|
||||
@@ -1,104 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Harbour GUI framework for Windows
|
||||
* Class HBMenu
|
||||
*
|
||||
* Copyright 2001 Antonio Linares <alinares@fivetech.com>
|
||||
* Copyright 2001 Maurilio Longo <maurilio.longo@libero.it>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "hbclass.ch"
|
||||
|
||||
CLASS HBMenu FROM HBPersistent
|
||||
|
||||
DATA nHandle
|
||||
DATA Items PROPERTY
|
||||
|
||||
METHOD New( oForm ) // Creates a new menu
|
||||
METHOD Add( oMenuItem ) // Adds a menuitem
|
||||
METHOD FindItem( nId ) // Searches for a sub menuitem given its id
|
||||
|
||||
ENDCLASS
|
||||
|
||||
METHOD New( oForm ) CLASS HBMenu
|
||||
|
||||
::Items := {}
|
||||
|
||||
if oForm != nil
|
||||
::nHandle := WinCreateMenu( oForm:hWnd )
|
||||
endif
|
||||
|
||||
return Self
|
||||
|
||||
METHOD Add( oMenuItem ) CLASS HBMenu
|
||||
|
||||
WinAddMenuItem( ::nHandle, oMenuItem:Caption, Len( ::Items ),;
|
||||
nil, oMenuItem:nId, oMenuItem:Enabled )
|
||||
|
||||
oMenuItem:oParent := Self
|
||||
AAdd( ::Items, oMenuItem )
|
||||
|
||||
return nil
|
||||
|
||||
METHOD FindItem( nId ) CLASS HBMenu
|
||||
|
||||
local oMenuItem, n
|
||||
|
||||
for n := 1 to Len( ::Items )
|
||||
if ( oMenuItem := ::Items[ n ] ):nId == nId
|
||||
return oMenuItem
|
||||
else
|
||||
if oMenuItem:Items != nil
|
||||
if ( oMenuItem := oMenuItem:FindItem( nId ) ) != nil
|
||||
return oMenuItem
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
next
|
||||
|
||||
return oMenuItem
|
||||
@@ -1,117 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Harbour GUI framework for Windows
|
||||
* Class HGFMenuItem
|
||||
*
|
||||
* Copyright 2001 Antonio Linares <alinares@fivetech.com>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "common.ch"
|
||||
#include "hbclass.ch"
|
||||
|
||||
CLASS HGFMenuItem FROM HBPersistent
|
||||
|
||||
DATA Caption PROPERTY // Specifies the text of the menu item
|
||||
DATA Name PROPERTY // The name of this component
|
||||
DATA OnClick PROPERTY // A character description of the method to invoke
|
||||
DATA Enabled PROPERTY // Specifies whether the menu item is enabled
|
||||
DATA Items PROPERTY // Contains the menu items in the submenu of the menu item
|
||||
|
||||
DATA nId // Command value to send to the container form
|
||||
DATA oParent // Identifies the parent menu item of this menu item
|
||||
DATA nHandle // The handle of the submenu of this menu item
|
||||
|
||||
CLASSDATA nIdStart // start value for commands value to assign to menu items
|
||||
|
||||
METHOD New( oOwner ) // Creates a new menu item
|
||||
METHOD Add( oMenuItem ) // Adds a new drop down menu item
|
||||
METHOD FindItem( nId ) // Searches for a sub menuitem given its id
|
||||
|
||||
ENDCLASS
|
||||
|
||||
METHOD New( oOwner ) CLASS HGFMenuItem
|
||||
|
||||
DEFAULT ::nIdStart TO 110
|
||||
|
||||
::Caption := ""
|
||||
::Enabled := .t.
|
||||
::nId := ::nIdStart++
|
||||
::oParent := oOwner
|
||||
|
||||
return Self
|
||||
|
||||
METHOD Add( oMenuItem ) CLASS HGFMenuItem
|
||||
|
||||
DEFAULT ::Items TO {}
|
||||
DEFAULT ::nHandle TO WinCreateSubMenu( ::oParent:nHandle, ::nId )
|
||||
|
||||
WinAddMenuItem( ::nHandle, oMenuItem:Caption, Len( ::Items ),;
|
||||
nil, oMenuItem:nId, oMenuItem:Enabled )
|
||||
|
||||
oMenuItem:oParent := Self
|
||||
AAdd( ::Items, oMenuItem )
|
||||
|
||||
return nil
|
||||
|
||||
METHOD FindItem( nId ) CLASS HGFMenuItem
|
||||
|
||||
local oMenuItem, n
|
||||
|
||||
for n := 1 to Len( ::Items )
|
||||
if ( oMenuItem := ::Items[ n ] ):nId == nId
|
||||
return oMenuItem
|
||||
else
|
||||
if oMenuItem:Items != nil
|
||||
if ( oMenuItem := oMenuItem:FindItem( nId ) ) != nil
|
||||
return oMenuItem
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
next
|
||||
|
||||
return oMenuItem
|
||||
@@ -1,421 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Harbour GUI framework for Windows
|
||||
*
|
||||
* Copyright 2001 Alexander S.Kresin <alex@belacy.belgorod.su>
|
||||
* Copyright 2001 Antonio Linares <alinares@fivetech.com>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
|
||||
#define _WIN32_WINNT 0x0400
|
||||
|
||||
#define HB_OS_WIN_USED
|
||||
|
||||
#include "hbapi.h"
|
||||
#include "hbvm.h"
|
||||
#include "hbstack.h"
|
||||
|
||||
LRESULT CALLBACK WndProc( HWND, UINT, WPARAM, LPARAM );
|
||||
|
||||
HB_FUNC( WINREGISTERCLASS )
|
||||
{
|
||||
WNDCLASS wndclass;
|
||||
LPTSTR lpszClassName = HB_TCHAR_CONVTO( hb_parcx( 1 ) );
|
||||
|
||||
wndclass.lpszClassName = lpszClassName;
|
||||
wndclass.style = CS_OWNDC | CS_VREDRAW | CS_HREDRAW; /* hb_parnl( 2 ); */
|
||||
wndclass.cbClsExtra = hb_parnl( 3 );
|
||||
wndclass.cbWndExtra = 0;
|
||||
wndclass.lpfnWndProc = WndProc;
|
||||
wndclass.hInstance = GetModuleHandle( NULL );
|
||||
wndclass.hIcon = LoadIcon( NULL, IDI_APPLICATION );
|
||||
wndclass.hCursor = LoadCursor( NULL, IDC_ARROW );
|
||||
wndclass.hbrBackground = ( HBRUSH ) ( COLOR_BTNFACE + 1 );
|
||||
wndclass.lpszMenuName = NULL;
|
||||
|
||||
hb_retl( RegisterClass( &wndclass ) );
|
||||
|
||||
HB_TCHAR_FREE( lpszClassName );
|
||||
}
|
||||
|
||||
HB_FUNC( WINCREATESTDWINDOW )
|
||||
{
|
||||
LPTSTR lpszClassName = HB_TCHAR_CONVTO( hb_parcx( 4 ) );
|
||||
LPTSTR lpszCaption = HB_TCHAR_CONVTO( hb_parcx( 5 ) );
|
||||
|
||||
hb_retptr( CreateWindow( lpszClassName,
|
||||
lpszCaption,
|
||||
hb_parnl( 2 ), /* style */
|
||||
CW_USEDEFAULT, CW_USEDEFAULT,
|
||||
CW_USEDEFAULT, CW_USEDEFAULT,
|
||||
( HWND ) hb_parptr( 7 ), /* hWndParent */
|
||||
( HMENU ) hb_parptr( 8 ), /* hMenu or nId */
|
||||
GetModuleHandle( NULL ), NULL ) );
|
||||
|
||||
HB_TCHAR_FREE( lpszClassName );
|
||||
HB_TCHAR_FREE( lpszCaption );
|
||||
}
|
||||
|
||||
HB_FUNC( HB_FORMSHOWMODAL )
|
||||
{
|
||||
MSG msg;
|
||||
|
||||
ShowWindow( ( HWND ) hb_parptr( 1 ), 1 );
|
||||
while( GetMessage( &msg, NULL, 0, 0 ) )
|
||||
{
|
||||
TranslateMessage( &msg );
|
||||
DispatchMessage( &msg );
|
||||
}
|
||||
}
|
||||
|
||||
/* nOr() is a very used function */
|
||||
|
||||
HB_FUNC( NOR )
|
||||
{
|
||||
LONG lRet = 0;
|
||||
USHORT i = 0;
|
||||
|
||||
while( i < hb_pcount() )
|
||||
lRet = lRet | hb_parnl( ++i );
|
||||
|
||||
hb_retnl( lRet );
|
||||
}
|
||||
|
||||
HB_FUNC( WINSETWINDOWTEXT )
|
||||
{
|
||||
LPTSTR lpszText = HB_TCHAR_CONVTO( hb_parcx( 1 ) );
|
||||
|
||||
hb_retl( SetWindowText( ( HWND ) hb_parptr( 1 ), lpszText ) );
|
||||
|
||||
HB_TCHAR_FREE( lpszText );
|
||||
}
|
||||
|
||||
|
||||
HB_FUNC( WINGETTEXT )
|
||||
{
|
||||
TCHAR bBuffer[ 256 ];
|
||||
char * szText;
|
||||
|
||||
GetWindowText( ( HWND ) hb_parptr( 1 ), bBuffer, sizeof( bBuffer ) - 1 );
|
||||
|
||||
szText = HB_TCHAR_CONVFROM( bBuffer );
|
||||
hb_retc( szText );
|
||||
HB_TCHAR_FREE( szText );
|
||||
}
|
||||
|
||||
|
||||
HB_FUNC( MSGINFO )
|
||||
{
|
||||
LPCTSTR lpStr1 = HB_TCHAR_CONVTO( hb_parcx( 2 ) ),
|
||||
lpStr2 = HB_TCHAR_CONVTO( HB_ISCHAR( 2 ) ? hb_parc( 3 ) : "Information" );
|
||||
|
||||
hb_retni( MessageBox( GetActiveWindow(), lpStr1, lpStr2, MB_OK | MB_ICONINFORMATION ) );
|
||||
|
||||
HB_TCHAR_FREE( lpStr1 );
|
||||
HB_TCHAR_FREE( lpStr2 );
|
||||
}
|
||||
|
||||
|
||||
HB_FUNC( WINCREATEMENU )
|
||||
{
|
||||
hb_retptr( CreateMenu() );
|
||||
}
|
||||
|
||||
|
||||
HB_FUNC( WINADDMENUITEM )
|
||||
{
|
||||
LPTSTR lpszText = NULL;
|
||||
MENUITEMINFO mii;
|
||||
HMENU hSubMenu = ( ! HB_ISNIL( 4 ) ) ? ( HMENU ) hb_parptr( 4 ) : 0;
|
||||
|
||||
mii.cbSize = sizeof( MENUITEMINFO );
|
||||
mii.fMask = MIIM_TYPE | MIIM_STATE | MIIM_ID | ( hSubMenu ? MIIM_SUBMENU : 0 );
|
||||
mii.fState = ! hb_parl( 6 ) ? MFS_DISABLED : 0;
|
||||
mii.wID = hb_parni( 5 );
|
||||
mii.hSubMenu = hSubMenu;
|
||||
if( HB_ISCHAR( 2 ) )
|
||||
{
|
||||
lpszText = HB_TCHAR_CONVTO( hb_parc( 1 ) );
|
||||
mii.dwTypeData = lpszText;
|
||||
mii.cch = lstrlen( lpszText );
|
||||
mii.fType = MFT_STRING;
|
||||
}
|
||||
else
|
||||
mii.fType = MFT_SEPARATOR;
|
||||
|
||||
hb_retl( InsertMenuItem( ( HMENU ) hb_parptr( 1 ), hb_parni( 3 ), 1, &mii ) );
|
||||
if( lpszText )
|
||||
HB_TCHAR_FREE( lpszText );
|
||||
}
|
||||
|
||||
HB_FUNC( WINCREATESUBMENU )
|
||||
{
|
||||
|
||||
MENUITEMINFO mii;
|
||||
HMENU hSubMenu = CreateMenu();
|
||||
|
||||
mii.cbSize = sizeof( MENUITEMINFO );
|
||||
mii.fMask = MIIM_SUBMENU;
|
||||
mii.hSubMenu = hSubMenu;
|
||||
|
||||
SetMenuItemInfo( ( HMENU ) hb_parptr( 1 ),
|
||||
hb_parni( 2 ),
|
||||
0,
|
||||
&mii );
|
||||
|
||||
hb_retptr( hSubMenu );
|
||||
}
|
||||
|
||||
HB_FUNC( SETMENU )
|
||||
{
|
||||
hb_retl( SetMenu( ( HWND ) hb_parptr( 1 ), ( HMENU ) hb_parptr( 2 ) ) );
|
||||
}
|
||||
|
||||
HB_FUNC( SENDMESSAGE )
|
||||
{
|
||||
hb_retnl( ( LONG ) SendMessage(
|
||||
( HWND ) hb_parptr( 1 ), /* handle of destination window */
|
||||
( UINT ) hb_parni( 2 ), /* message to send */
|
||||
( WPARAM ) hb_parnint( 3 ), /* first message parameter */
|
||||
( LPARAM ) hb_parnint( 4 ) /* second message parameter */
|
||||
) );
|
||||
}
|
||||
|
||||
|
||||
LRESULT CALLBACK WndProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam )
|
||||
{
|
||||
static PHB_DYNS pDynSym = NULL;
|
||||
|
||||
if( ! pDynSym )
|
||||
pDynSym = hb_dynsymFindName( "HB_GUI" );
|
||||
|
||||
if( pDynSym )
|
||||
{
|
||||
hb_vmPushDynSym( pDynSym );
|
||||
hb_vmPushNil();
|
||||
hb_vmPushPointer( hWnd );
|
||||
hb_vmPushLong( message );
|
||||
hb_vmPushNumInt( ( HB_LONG ) wParam );
|
||||
hb_vmPushNumInt( ( HB_LONG ) lParam );
|
||||
hb_vmDo( 4 );
|
||||
|
||||
if( hb_arrayGetType( hb_stackReturnItem(), 1 ) == HB_IT_NIL )
|
||||
return DefWindowProc( ( HWND ) hWnd, message, wParam, lParam );
|
||||
}
|
||||
|
||||
return hb_parvnl( -1, 1 );
|
||||
}
|
||||
|
||||
HB_FUNC( POSTQUITMESSAGE )
|
||||
{
|
||||
PostQuitMessage( hb_parnl( 1 ) );
|
||||
}
|
||||
|
||||
HB_FUNC( NLOWORD )
|
||||
{
|
||||
hb_retnl( LOWORD( hb_parnl( 1 ) ) );
|
||||
}
|
||||
|
||||
HB_FUNC( NHIWORD )
|
||||
{
|
||||
hb_retnl( HIWORD( hb_parnl( 1 ) ) );
|
||||
}
|
||||
|
||||
HB_FUNC( WINGETWIDTH )
|
||||
{
|
||||
HWND hWnd = ( HWND ) hb_parptr( 1 );
|
||||
RECT rct;
|
||||
|
||||
GetWindowRect( hWnd, &rct );
|
||||
|
||||
hb_retnl( rct.right - rct.left );
|
||||
}
|
||||
|
||||
HB_FUNC( WINSETWIDTH )
|
||||
{
|
||||
HWND hWnd = ( HWND ) hb_parptr( 1 );
|
||||
RECT rct;
|
||||
POINT pt;
|
||||
WORD wHeight;
|
||||
|
||||
GetWindowRect( hWnd, &rct );
|
||||
wHeight = ( WORD ) ( rct.bottom - rct.top );
|
||||
|
||||
if( GetWindowLong( hWnd, GWL_STYLE ) && WS_CHILD )
|
||||
{
|
||||
pt.x = rct.left;
|
||||
pt.y = rct.top;
|
||||
ScreenToClient( GetParent( hWnd ), &pt );
|
||||
rct.left = pt.x;
|
||||
rct.top = pt.y;
|
||||
}
|
||||
|
||||
MoveWindow( hWnd, rct.left, rct.top, hb_parnl( 2 ), wHeight, TRUE );
|
||||
}
|
||||
|
||||
HB_FUNC( WINGETHEIGHT )
|
||||
{
|
||||
HWND hWnd = ( HWND ) hb_parptr( 1 );
|
||||
RECT rct;
|
||||
|
||||
GetWindowRect( hWnd, &rct );
|
||||
|
||||
hb_retnl( rct.bottom - rct.top );
|
||||
}
|
||||
|
||||
HB_FUNC( WINSETHEIGHT )
|
||||
{
|
||||
HWND hWnd = ( HWND ) hb_parptr( 1 );
|
||||
RECT rct;
|
||||
POINT pt;
|
||||
WORD wWidth;
|
||||
|
||||
GetWindowRect( hWnd, &rct );
|
||||
wWidth = ( WORD ) ( rct.right - rct.left );
|
||||
|
||||
if( GetWindowLong( hWnd, GWL_STYLE ) && WS_CHILD )
|
||||
{
|
||||
pt.x = rct.left;
|
||||
pt.y = rct.top;
|
||||
ScreenToClient( GetParent( hWnd ), &pt );
|
||||
rct.left = pt.x;
|
||||
rct.top = pt.y;
|
||||
}
|
||||
|
||||
MoveWindow( hWnd, rct.left, rct.top, wWidth, hb_parnl( 2 ), TRUE );
|
||||
}
|
||||
|
||||
HB_FUNC( WINGETTOP )
|
||||
{
|
||||
HWND hWnd = ( HWND ) hb_parptr( 1 );
|
||||
RECT rct;
|
||||
POINT pt;
|
||||
|
||||
GetWindowRect( hWnd, &rct );
|
||||
|
||||
if( GetWindowLong( hWnd, GWL_STYLE ) && WS_CHILD )
|
||||
{
|
||||
pt.x = rct.left;
|
||||
pt.y = rct.top;
|
||||
ScreenToClient( GetParent( hWnd ), &pt );
|
||||
rct.left = pt.x;
|
||||
rct.top = pt.y;
|
||||
}
|
||||
|
||||
hb_retnl( rct.top );
|
||||
}
|
||||
|
||||
HB_FUNC( WINSETTOP )
|
||||
{
|
||||
HWND hWnd = ( HWND ) hb_parptr( 1 );
|
||||
RECT rct;
|
||||
POINT pt;
|
||||
WORD wHeight, wWidth;
|
||||
|
||||
GetWindowRect( hWnd, &rct );
|
||||
wHeight = ( WORD ) ( rct.bottom - rct.top );
|
||||
wWidth = ( WORD ) ( rct.right - rct.left );
|
||||
|
||||
if( GetWindowLong( hWnd, GWL_STYLE ) && WS_CHILD )
|
||||
{
|
||||
pt.x = rct.left;
|
||||
pt.y = hb_parnl( 2 );
|
||||
ScreenToClient( GetParent( hWnd ), &pt );
|
||||
rct.left = pt.x;
|
||||
rct.top = pt.y;
|
||||
}
|
||||
|
||||
MoveWindow( hWnd, rct.left, hb_parnl( 2 ), wWidth, wHeight, TRUE );
|
||||
}
|
||||
|
||||
HB_FUNC( WINGETLEFT )
|
||||
{
|
||||
HWND hWnd = ( HWND ) hb_parptr( 1 );
|
||||
RECT rct;
|
||||
POINT pt;
|
||||
|
||||
GetWindowRect( hWnd, &rct );
|
||||
|
||||
if( GetWindowLong( hWnd, GWL_STYLE ) && WS_CHILD )
|
||||
{
|
||||
pt.x = rct.left;
|
||||
pt.y = rct.top;
|
||||
ScreenToClient( GetParent( hWnd ), &pt );
|
||||
rct.left = pt.x;
|
||||
rct.top = pt.y;
|
||||
}
|
||||
|
||||
hb_retnl( rct.left );
|
||||
}
|
||||
|
||||
HB_FUNC( WINSETLEFT )
|
||||
{
|
||||
HWND hWnd = ( HWND ) hb_parptr( 1 );
|
||||
RECT rct;
|
||||
POINT pt;
|
||||
WORD wHeight, wWidth;
|
||||
|
||||
GetWindowRect( hWnd, &rct );
|
||||
wHeight = ( WORD ) ( rct.bottom - rct.top );
|
||||
wWidth = ( WORD ) ( rct.right - rct.left );
|
||||
|
||||
if( GetWindowLong( hWnd, GWL_STYLE ) && WS_CHILD )
|
||||
{
|
||||
pt.x = hb_parnl( 2 );
|
||||
pt.y = rct.top;
|
||||
ScreenToClient( GetParent( hWnd ), &pt );
|
||||
rct.left = pt.x;
|
||||
rct.top = pt.y;
|
||||
}
|
||||
|
||||
MoveWindow( hWnd, hb_parnl( 2 ), rct.top, wWidth, wHeight, TRUE );
|
||||
}
|
||||
|
||||
HB_FUNC( SHOWWINDOW )
|
||||
{
|
||||
hb_retl( ShowWindow( ( HWND ) hb_parptr( 1 ), hb_parl( 2 ) ) );
|
||||
}
|
||||
@@ -1,88 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Harbour GUI framework for Windows
|
||||
* Class HBWinControl
|
||||
*
|
||||
* Copyright 2001 Antonio Linares <alinares@fivetech.com>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "common.ch"
|
||||
#include "hbclass.ch"
|
||||
|
||||
#define SW_SHOWNA 8
|
||||
|
||||
|
||||
CLASS HBWinControl FROM HBPersistent
|
||||
|
||||
DATA hWnd
|
||||
DATA nId
|
||||
|
||||
CLASSDATA nInitId
|
||||
|
||||
ACCESS Caption() INLINE WinGetText( ::hWnd ) PROPERTY
|
||||
ASSIGN Caption( cNewCaption ) INLINE ;
|
||||
WinSetWindowText( ::hWnd, cNewCaption )
|
||||
|
||||
ACCESS Top() INLINE WinGetTop( ::hWnd ) PROPERTY
|
||||
ASSIGN Top( nNewTop ) INLINE WinSetTop( ::hWnd, nNewTop )
|
||||
|
||||
ACCESS Left() INLINE WinGetLeft( ::hWnd ) PROPERTY
|
||||
ASSIGN Left( nNewLeft ) INLINE WinSetLeft( ::hWnd, nNewLeft )
|
||||
|
||||
ACCESS Height() INLINE WinGetHeight( ::hWnd ) PROPERTY
|
||||
ASSIGN Height( nNewHeight ) INLINE WinSetHeight( ::hWnd, nNewHeight )
|
||||
|
||||
ACCESS Width() INLINE WinGetWidth( ::hWnd ) PROPERTY
|
||||
ASSIGN Width( nNewWidth ) INLINE WinSetWidth( ::hWnd, nNewWidth )
|
||||
|
||||
METHOD GetNewId() INLINE ::nId := iif( ::nInitId == nil, ::nInitId := 1,;
|
||||
++::nInitId )
|
||||
|
||||
METHOD Show() INLINE ShowWindow( ::hWnd, SW_SHOWNA )
|
||||
|
||||
ENDCLASS
|
||||
@@ -1,56 +0,0 @@
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// Inheriting from Class HBForm sample
|
||||
|
||||
#include "hbclass.ch"
|
||||
|
||||
function Main()
|
||||
|
||||
local oForm2 := HBForm2():New()
|
||||
|
||||
oForm2:ShowModal()
|
||||
|
||||
return nil
|
||||
|
||||
CLASS HBForm2 FROM HBForm
|
||||
|
||||
METHOD New()
|
||||
|
||||
METHOD TestClick( oSender )
|
||||
METHOD ExitClick( oSender ) INLINE ::Close()
|
||||
|
||||
ENDCLASS
|
||||
|
||||
METHOD New() CLASS HBForm2
|
||||
|
||||
local oMenu, oMenuItem
|
||||
|
||||
Super:New()
|
||||
|
||||
::Caption = "Harbour GUI demo"
|
||||
|
||||
oMenu = HBMenu():New( Self )
|
||||
|
||||
oMenuItem = HGFMenuItem():New( oMenu )
|
||||
oMenuitem:Caption = "Test"
|
||||
oMenuitem:Name = "Test"
|
||||
oMenuItem:OnClick = "TestClick" // The container method to execute
|
||||
oMenu:Add( oMenuItem )
|
||||
|
||||
oMenuItem = HGFMenuItem():New( oMenu )
|
||||
oMenuitem:Caption = "Exit"
|
||||
oMenuitem:Name = "Exit"
|
||||
oMenuItem:OnClick = "ExitClick" // The container method to execute
|
||||
oMenu:Add( oMenuItem )
|
||||
|
||||
::Menu = oMenu
|
||||
|
||||
return Self
|
||||
|
||||
METHOD TestClick( oSender ) CLASS HBForm2
|
||||
|
||||
MsgInfo( "This event has been fired by a " + oSender:ClassName() + " object",;
|
||||
"Welcome to Harbour GUI power" )
|
||||
|
||||
return nil
|
||||
@@ -1,10 +0,0 @@
|
||||
OBJECT oForm3 AS HBForm3
|
||||
|
||||
::Caption = "Harbour GUI Framework power"
|
||||
::Top = 200
|
||||
::Left = 150
|
||||
::Width = 400
|
||||
::Height = 250
|
||||
::OnClick = "FormClick"
|
||||
|
||||
ENDOBJECT
|
||||
@@ -1,31 +0,0 @@
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// Use of persistence files to build a form
|
||||
|
||||
#include "hbclass.ch"
|
||||
#include "hbpers.ch"
|
||||
|
||||
function Main()
|
||||
|
||||
local oForm3 := HBForm3():New()
|
||||
|
||||
oForm3:ShowModal()
|
||||
|
||||
return nil
|
||||
|
||||
CLASS HBForm3 FROM HBForm
|
||||
|
||||
METHOD New()
|
||||
|
||||
METHOD FormClick( oSender, nX, nY ) INLINE MsgInfo( "Click" )
|
||||
|
||||
ENDCLASS
|
||||
|
||||
METHOD New() CLASS HBForm3
|
||||
|
||||
Super:New()
|
||||
|
||||
#include "form3.hbf" // Notice this is just a persistence ascii file
|
||||
// renamed as .hbf = Harbour form
|
||||
return Self
|
||||
@@ -1,22 +0,0 @@
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// Loading persistence files at runtime sample
|
||||
|
||||
#include "hbclass.ch"
|
||||
|
||||
function Main()
|
||||
|
||||
local oForm3 := HBForm3():New()
|
||||
|
||||
oForm3:LoadFromFile( "form3.hbf" )
|
||||
|
||||
oForm3:ShowModal()
|
||||
|
||||
return nil
|
||||
|
||||
CLASS HBForm3 FROM HBForm
|
||||
|
||||
METHOD FormClick( oSender, nX, nY ) INLINE MsgInfo( "Click" )
|
||||
|
||||
ENDCLASS
|
||||
@@ -1,60 +0,0 @@
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// Testing forms persistence
|
||||
|
||||
#include "hbclass.ch"
|
||||
|
||||
function Main()
|
||||
|
||||
local oForm2 := HBForm2():New()
|
||||
|
||||
oForm2:OnClick := "Form2Click"
|
||||
|
||||
oForm2:ShowModal()
|
||||
|
||||
return nil
|
||||
|
||||
CLASS HBForm2 FROM HBForm
|
||||
|
||||
METHOD New()
|
||||
|
||||
METHOD ViewAsTextClick( oSender ) INLINE MsgInfo( ::SaveToText() )
|
||||
METHOD ExitClick( oSender ) INLINE ::Close()
|
||||
|
||||
METHOD Form2Click( oSender, nXPos, nYPos )
|
||||
|
||||
ENDCLASS
|
||||
|
||||
METHOD New() CLASS HBForm2
|
||||
|
||||
local oMenu, oMenuItem
|
||||
|
||||
Super:New()
|
||||
|
||||
::Caption := "Harbour GUI demo"
|
||||
|
||||
oMenu := HBMenu():New( Self )
|
||||
|
||||
oMenuItem := HGFMenuItem():New( oMenu )
|
||||
oMenuitem:Caption := "View as Text"
|
||||
oMenuitem:Name := "ViewAsText"
|
||||
oMenuItem:OnClick := "ViewAsTextClick" // The container method to execute
|
||||
oMenu:Add( oMenuItem )
|
||||
|
||||
oMenuItem := HGFMenuItem():New( oMenu )
|
||||
oMenuitem:Caption := "Exit"
|
||||
oMenuitem:Name := "Exit"
|
||||
oMenuItem:OnClick := "ExitClick" // The container method to execute
|
||||
oMenu:Add( oMenuItem )
|
||||
|
||||
::Menu := oMenu
|
||||
|
||||
return Self
|
||||
|
||||
METHOD Form2Click( oSender, nXPos, nYPos ) CLASS HBForm2
|
||||
|
||||
MsgInfo( "Click at " + AllTrim( Str( nXPos ) ) + ", " + ;
|
||||
AllTrim( Str( nYPos ) ) )
|
||||
|
||||
return nil
|
||||
@@ -1,7 +0,0 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
{win}libs=hbgfwin
|
||||
{os2}libs=hbgfos2
|
||||
{linux|darwin|bsd|sunos}libs=hbgfgtk
|
||||
@@ -1,58 +0,0 @@
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// Testing Harbour GUI framework controls
|
||||
|
||||
#include "hbclass.ch"
|
||||
|
||||
function Main()
|
||||
|
||||
local oForm := HBFormControls():New()
|
||||
local oEdit, oBtn
|
||||
|
||||
oForm:Caption := "Harbour GUI Framework controls"
|
||||
oForm:Top := 175
|
||||
oForm:Left := 197
|
||||
oForm:Width := 382
|
||||
oForm:Height := 249
|
||||
|
||||
oEdit := HBEdit():New( oForm )
|
||||
oEdit:Top := 30
|
||||
oEdit:Left := 100
|
||||
oEdit:Width := 200
|
||||
oEdit:Caption := "Edit control"
|
||||
oForm:InsertControl( oEdit )
|
||||
|
||||
oBtn := HBButton():New( oForm )
|
||||
oBtn:Caption := "&View as text"
|
||||
oBtn:Top := 150
|
||||
oBtn:Left := 10
|
||||
oBtn:Width := 100
|
||||
oBtn:OnClick := "BtnViewAsTextClick"
|
||||
oForm:InsertControl( oBtn )
|
||||
|
||||
oBtn := HBButton():New( oForm )
|
||||
oBtn:Caption := "&Ok"
|
||||
oBtn:Top := 150
|
||||
oBtn:Left := 180
|
||||
oBtn:OnClick := "BtnOkClick"
|
||||
oForm:InsertControl( oBtn )
|
||||
|
||||
oBtn := HBButton():New( oForm )
|
||||
oBtn:Caption := "&Cancel"
|
||||
oBtn:Top := 150
|
||||
oBtn:Left := 280
|
||||
oBtn:OnClick := "BtnCancelClick"
|
||||
oForm:InsertControl( oBtn )
|
||||
|
||||
oForm:ShowModal()
|
||||
|
||||
return nil
|
||||
|
||||
CLASS HBFormControls FROM HBForm
|
||||
|
||||
METHOD BtnViewAsTextClick( oSender ) INLINE MsgInfo( ::SaveToText() )
|
||||
METHOD BtnOkClick( oSender ) INLINE MsgInfo( "Ok was pressed" )
|
||||
METHOD BtnCancelClick( oSender ) INLINE MsgInfo( "Cancel was pressed" )
|
||||
|
||||
ENDCLASS
|
||||
@@ -1,47 +0,0 @@
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
|
||||
// Testing Harbour GUI framework
|
||||
|
||||
function Main()
|
||||
|
||||
local oForm := HBForm():New()
|
||||
local oMenu := HBMenu():New( oForm )
|
||||
local oMenuItem, oSubItem, oSubItem2
|
||||
|
||||
oMenuItem := HGFMenuItem():New( oMenu )
|
||||
oMenuItem:Caption := "One"
|
||||
oMenu:Add( oMenuItem )
|
||||
|
||||
oSubItem := HGFMenuItem():New( oMenuItem )
|
||||
oSubItem:Caption := "First"
|
||||
oMenuItem:Add( oSubItem )
|
||||
|
||||
oSubItem := HGFMenuItem():New( oMenuItem )
|
||||
oSubItem:Caption := "Second"
|
||||
oMenuItem:Add( oSubItem )
|
||||
|
||||
oSubItem2 := HGFMenuItem():New( oSubItem )
|
||||
oSubItem2:Caption := "Some"
|
||||
oSubItem:Add( oSubItem2 )
|
||||
|
||||
oSubItem2 := HGFMenuItem():New( oSubItem )
|
||||
oSubItem2:Caption := "More"
|
||||
oSubItem:Add( oSubItem2 )
|
||||
|
||||
oMenuItem := HGFMenuItem():New( oMenu )
|
||||
oMenuItem:Caption := "Two"
|
||||
oMenu:Add( oMenuItem )
|
||||
|
||||
oMenuItem := HGFMenuItem():New( oMenu )
|
||||
oMenuItem:Caption := "Three"
|
||||
oMenu:Add( oMenuItem )
|
||||
|
||||
oForm:Menu := oMenu
|
||||
|
||||
oForm:Caption := "Harbour GUI Framework"
|
||||
|
||||
oForm:ShowModal()
|
||||
|
||||
return nil
|
||||
@@ -5,7 +5,6 @@
|
||||
# To build hbmake, type: 'hbmk2 hbmake.hbp'
|
||||
|
||||
hbmake.prg
|
||||
hbmakec.c
|
||||
|
||||
-lhbclipsm
|
||||
-lxhb
|
||||
|
||||
@@ -6026,5 +6026,14 @@ FUNCTION CmdLineParam( cFile, cCmdParams )
|
||||
|
||||
RETURN xReturn
|
||||
|
||||
STATIC FUNCTION GETUSERLANG()
|
||||
|
||||
SWITCH Upper( Left( hb_UserLang(), 2 ) )
|
||||
CASE "PT" ; RETURN 1
|
||||
CASE "ES" ; RETURN 3
|
||||
ENDSWITCH
|
||||
|
||||
RETURN 2 /* EN */
|
||||
|
||||
STATIC FUNCTION HBRawVersion()
|
||||
RETURN StrTran( Version(), "Harbour ", "" )
|
||||
|
||||
@@ -1,116 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* hbmake C support code
|
||||
*
|
||||
* Copyright 2000,2001 Luiz Rafael Culik <culik@sl.conex.net> [GETUSERLANG()]
|
||||
* Copyright 2003 Marcelo Lombardo - lombardo@uol.com.br [HB_FREADLINE()]
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
|
||||
#define HB_OS_WIN_USED
|
||||
|
||||
#include "hbapi.h"
|
||||
|
||||
HB_FUNC( GETUSERLANG )
|
||||
{
|
||||
long lRet;
|
||||
|
||||
#if defined(HB_OS_WIN) && (!defined(__RSXNT__)) && (!defined(__CYGWIN__))
|
||||
|
||||
switch( GetSystemDefaultLangID() )
|
||||
{
|
||||
case 0x0416:
|
||||
case 0x0816:
|
||||
lRet = 1;
|
||||
break;
|
||||
|
||||
case 0x0409:
|
||||
case 0x0809:
|
||||
case 0x0C09:
|
||||
case 0x1009:
|
||||
case 0x1409:
|
||||
case 0x1809:
|
||||
case 0x1C09:
|
||||
case 0x2009:
|
||||
case 0x2409:
|
||||
case 0x2809:
|
||||
case 0x2C09:
|
||||
lRet = 2;
|
||||
break;
|
||||
|
||||
case 0x040A:
|
||||
case 0x080A:
|
||||
case 0x0C0A:
|
||||
case 0x100A:
|
||||
case 0x140A:
|
||||
case 0x180A:
|
||||
case 0x1C0A:
|
||||
case 0x200A:
|
||||
case 0x240A:
|
||||
case 0x280A:
|
||||
case 0x2C0A:
|
||||
case 0x300A:
|
||||
case 0x340A:
|
||||
case 0x380A:
|
||||
case 0x3C0A:
|
||||
case 0x400A:
|
||||
case 0x440A:
|
||||
case 0x480A:
|
||||
case 0x4C0A:
|
||||
case 0x500A:
|
||||
lRet = 3;
|
||||
break;
|
||||
|
||||
default:
|
||||
lRet = 2;
|
||||
break;
|
||||
}
|
||||
#else
|
||||
lRet = 2;
|
||||
#endif
|
||||
hb_retnl( lRet );
|
||||
}
|
||||
@@ -65,7 +65,7 @@
|
||||
|
||||
HB_FUNC( MSQLCONNEC ) /* int msqlConnect(char *) */
|
||||
{
|
||||
hb_retni( msqlConnect( hb_parc( 1 ) ) );
|
||||
hb_retni( msqlConnect( ( char * ) hb_parc( 1 ) ) );
|
||||
}
|
||||
|
||||
HB_FUNC( MSQLCLOSE ) /* void msqlClose(int) */
|
||||
@@ -75,12 +75,12 @@ HB_FUNC( MSQLCLOSE ) /* void msqlClose(int) */
|
||||
|
||||
HB_FUNC( MSQLSELECT ) /* int msqlSelectDB(int, char *) */
|
||||
{
|
||||
hb_retni( msqlSelectDB( hb_parni( 1 ), hb_parc( 2 ) ) );
|
||||
hb_retni( msqlSelectDB( hb_parni( 1 ), ( char * ) hb_parc( 2 ) ) );
|
||||
}
|
||||
|
||||
HB_FUNC( MSQLQUERY ) /* int msqlQuery(int, char *) */
|
||||
{
|
||||
hb_retni( msqlQuery( hb_parni( 1 ), hb_parc( 2 ) ) );
|
||||
hb_retni( msqlQuery( hb_parni( 1 ), ( char * ) hb_parc( 2 ) ) );
|
||||
}
|
||||
|
||||
HB_FUNC( MSQLSTORER ) /* m_result *msqlStoreResult() */
|
||||
@@ -107,7 +107,7 @@ HB_FUNC( MSQLFETCHR ) /* m_row msqlFetchRow(m_result *, int) */
|
||||
|
||||
hb_itemReturnRelease( aRow );
|
||||
}
|
||||
|
||||
|
||||
HB_FUNC( MSQLDATASE ) /* void msqlDataSeek(m_result *, int) */
|
||||
{
|
||||
msqlDataSeek( ( m_result * ) HB_PARPTR( 1 ), hb_parni( 2 ) );
|
||||
@@ -147,7 +147,7 @@ HB_FUNC( MSQLNUMFIE ) /* int msqlNumFields(m_result *) */
|
||||
|
||||
HB_FUNC( MSQLLISTFI ) /* m_result *msqlListFields(int, char *); */
|
||||
{
|
||||
HB_RETPTR( ( void * ) msqlListFields( hb_parni( 1 ), hb_parc( 2 ) ) );
|
||||
HB_RETPTR( ( void * ) msqlListFields( hb_parni( 1 ), ( char * ) hb_parc( 2 ) ) );
|
||||
}
|
||||
|
||||
HB_FUNC( MSQLGETERR ) /* char *msqlGetErrMsg(char *); */
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
-hblib
|
||||
-olib/${hb_arch}/${hb_comp}/hboleold
|
||||
-inc
|
||||
-q0 -w3 -es2 -l
|
||||
|
||||
"-echo={!allwin}This library builds on win/wce only."
|
||||
-stop{!allwin}
|
||||
|
||||
win_ole.c
|
||||
win_tole.prg
|
||||
@@ -1,5 +0,0 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
../hboleold.hbc
|
||||
@@ -1,330 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* demonstration code for FOR EACH used for OLE objects
|
||||
* this code needs hbwin library
|
||||
*
|
||||
* Copyright 2007 Enrico Maria Giordano e.m.giordano at emagsoftware.it
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
*/
|
||||
|
||||
/* Explicit usage of OLE DEFAULT Method when syntax implies it. */
|
||||
#xtranslate :<!Method!>( <args,...> ) := => :<Method>( <args> ):Value :=
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL nOption
|
||||
|
||||
CLS
|
||||
SetColor("W+/R")
|
||||
@ 6, 25 TO 19, 55 DOUBLE
|
||||
@ 8, 28 SAY "Test Harbour OLE with..."
|
||||
|
||||
While .t.
|
||||
@ 10, 32 PROMPT "MS Excel"
|
||||
@ 11, 32 PROMPT "MS Word"
|
||||
@ 12, 32 PROMPT "MS Outlook (1)"
|
||||
@ 13, 32 PROMPT "MS Outlook (2)"
|
||||
@ 14, 32 PROMPT "Internet Explorer"
|
||||
@ 15, 32 PROMPT "XP CDO"
|
||||
@ 16, 32 PROMPT "OpenOffice"
|
||||
@ 17, 32 PROMPT "Quit"
|
||||
|
||||
MENU TO nOption
|
||||
|
||||
IF nOption == 0
|
||||
nOption := 8
|
||||
ELSEIF nOption == 1
|
||||
Exm_MSExcel()
|
||||
ELSEIF nOption == 2
|
||||
Exm_MSWord()
|
||||
ELSEIF nOption == 3
|
||||
Exm_MSOutlook()
|
||||
ELSEIF nOption == 4
|
||||
Exm_MSOutlook2()
|
||||
ELSEIF nOption == 5
|
||||
Exm_IExplorer()
|
||||
ELSEIF nOption == 6
|
||||
Exm_CDO()
|
||||
ELSEIF nOption == 7
|
||||
Exm_OpenOffice()
|
||||
ELSEIF nOption == 8
|
||||
EXIT
|
||||
ENDIF
|
||||
End
|
||||
|
||||
SetColor("W/N")
|
||||
CLS
|
||||
|
||||
RETURN
|
||||
|
||||
// ; Requires Windows XP
|
||||
|
||||
STATIC PROCEDURE Exm_CDO()
|
||||
|
||||
LOCAL oCDOMsg
|
||||
LOCAL oCDOConf
|
||||
|
||||
BEGIN SEQUENCE WITH {|oErr| Break( oErr )}
|
||||
oCDOMsg := CreateObject( "CDO.Message" )
|
||||
BEGIN SEQUENCE WITH {|oErr| Break( oErr )}
|
||||
|
||||
oCDOConf := CreateObject( "CDO.Configuration" )
|
||||
|
||||
oCDOConf:Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") := 2 // ; cdoSendUsingPort
|
||||
oCDOConf:Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") := "localhost"
|
||||
oCDOConf:Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") := 25
|
||||
oCDOConf:Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") := 120
|
||||
oCDOConf:Fields:Update()
|
||||
|
||||
oCDOMsg:Configuration := oCDOConf
|
||||
oCDOMsg:BodyPart:Charset := "iso-8859-2" // "iso-8859-1" "utf-8"
|
||||
oCDOMsg:To := "test@localhost"
|
||||
oCDOMsg:From := "sender@localhost"
|
||||
oCDOMsg:Subject := "Test message"
|
||||
oCDOMsg:TextBody := "Test message body"
|
||||
|
||||
BEGIN SEQUENCE WITH {|oErr| Break( oErr )}
|
||||
oCDOMsg:Send()
|
||||
RECOVER
|
||||
Alert( "Error: CDO send error. [" + Ole2TxtError()+ "]" )
|
||||
END SEQUENCE
|
||||
|
||||
oCDOConf := NIL
|
||||
|
||||
END SEQUENCE
|
||||
|
||||
oCDOMsg := NIL
|
||||
|
||||
RECOVER
|
||||
Alert( "Error: CDO subsystem not available. [" + Ole2TxtError()+ "]" )
|
||||
END SEQUENCE
|
||||
|
||||
RETURN
|
||||
|
||||
STATIC PROCEDURE Exm_IExplorer()
|
||||
|
||||
LOCAL oIE
|
||||
|
||||
BEGIN SEQUENCE WITH {|oErr| Break( oErr )}
|
||||
oIE := CreateObject( "InternetExplorer.Application" )
|
||||
BEGIN SEQUENCE WITH {|oErr| Break( oErr )}
|
||||
oIE:Visible := .T.
|
||||
oIE:Navigate( "http://www.harbour-project.org" )
|
||||
END SEQUENCE
|
||||
RECOVER
|
||||
Alert( "Error: IExplorer not available. [" + Ole2TxtError()+ "]" )
|
||||
END SEQUENCE
|
||||
|
||||
RETURN
|
||||
|
||||
STATIC PROCEDURE Exm_MSExcel()
|
||||
|
||||
LOCAL oExcel
|
||||
LOCAL oWorkBook
|
||||
LOCAL oWorkSheet
|
||||
LOCAL oAS
|
||||
|
||||
BEGIN SEQUENCE WITH {|oErr| Break( oErr )}
|
||||
oExcel := CreateObject( "Excel.Application" )
|
||||
BEGIN SEQUENCE WITH {|oErr| Break( oErr )}
|
||||
|
||||
oWorkBook := oExcel:WorkBooks:Add()
|
||||
|
||||
FOR EACH oWorkSheet IN oWorkBook:WorkSheets
|
||||
? oWorkSheet:Name
|
||||
NEXT
|
||||
|
||||
oAS := oExcel:ActiveSheet()
|
||||
|
||||
oAS:Cells:Font:Name := "Arial"
|
||||
oAS:Cells:Font:Size := 12
|
||||
|
||||
// Explicit use of DEFAULT method by means of #xtranslate above!!!
|
||||
oAS:Cells( 3, 1 ) := "Explict DEFAULT Method Text:"
|
||||
|
||||
// Array notation seem to have REVERSED indexs for the Cells Collections!!!
|
||||
// Implicitly using DEFAULT Method
|
||||
oAS:Cells[ 2, 3 ] := "Implicit DEFAULT Method using *reversed* array index notation"
|
||||
|
||||
// Operator overloading will attempt explict resolutin using :OleValue
|
||||
oAS:Cells[ 2, 3 ] += "!"
|
||||
|
||||
oAS:Cells( 4, 1 ):Value := "Numeric:"
|
||||
oAS:Cells( 4, 2 ):NumberFormat := "#.##0,00"
|
||||
|
||||
oAS:Cells[ 2, 4 ] := 1234.50
|
||||
oAS:Cells[ 2, 4 ] *= 4
|
||||
? oAS:Cells[ 2, 4 ], oAS:Cells[ 2, 4 ]:Value
|
||||
oAS:Cells[ 2, 4 ] /= 2
|
||||
? oAS:Cells[ 2, 4 ], oAS:Cells[ 2, 4 ]:Value
|
||||
|
||||
oAS:Cells[ 2, 4 ]++
|
||||
? oAS:Cells[ 2, 4 ], oAS:Cells[ 2, 4 ]:Value
|
||||
oAS:Cells[ 2, 4 ]--
|
||||
? oAS:Cells[ 2, 4 ], oAS:Cells[ 2, 4 ]:Value
|
||||
|
||||
oAS:Cells( 5, 1 ):Value := "Logical:"
|
||||
oAS:Cells( 5, 2 ):Value := .T.
|
||||
oAS:Cells( 6, 1 ):Value := "Date:"
|
||||
oAS:Cells( 6, 2 ):Value := DATE()
|
||||
|
||||
oAS:Columns( 1 ):Font:Bold := .T.
|
||||
oAS:Columns( 2 ):HorizontalAlignment := -4152 // xlRight
|
||||
|
||||
oAS:Columns( 1 ):AutoFit()
|
||||
oAS:Columns( 2 ):AutoFit()
|
||||
|
||||
oAS:Cells( 1, 1 ):Value := "OLE from Harbour"
|
||||
oAS:Cells( 1, 1 ):Font:Size := 16
|
||||
oAS:Range( "A1:B1" ):HorizontalAlignment := 7
|
||||
|
||||
oAS:Cells( 1, 1 ):Select()
|
||||
|
||||
oExcel:Visible := .T.
|
||||
|
||||
oExcel:Quit()
|
||||
|
||||
END SEQUENCE
|
||||
RECOVER
|
||||
Alert( "Error: MS Excel not available. [" + Ole2TxtError()+ "]" )
|
||||
END SEQUENCE
|
||||
|
||||
RETURN
|
||||
|
||||
STATIC PROCEDURE Exm_MSWord()
|
||||
|
||||
LOCAL oWord
|
||||
LOCAL oText
|
||||
|
||||
BEGIN SEQUENCE WITH {|oErr| Break( oErr )}
|
||||
oWord := CreateObject( "Word.Application" )
|
||||
BEGIN SEQUENCE WITH {|oErr| Break( oErr )}
|
||||
|
||||
oWord:Documents:Add()
|
||||
|
||||
oText := oWord:Selection()
|
||||
|
||||
oText:Text := "OLE from Harbour" + hb_OSNewLine()
|
||||
oText:Font:Name := "Arial"
|
||||
oText:Font:Size := 48
|
||||
oText:Font:Bold := .T.
|
||||
|
||||
oWord:Visible := .T.
|
||||
oWord:WindowState := 1 // ; Maximize
|
||||
|
||||
END SEQUENCE
|
||||
RECOVER
|
||||
Alert( "Error: MS Word not available. [" + Ole2TxtError()+ "]" )
|
||||
END SEQUENCE
|
||||
|
||||
RETURN
|
||||
|
||||
STATIC PROCEDURE Exm_MSOutlook()
|
||||
|
||||
LOCAL oOL
|
||||
LOCAL oList
|
||||
|
||||
BEGIN SEQUENCE WITH {|oErr| Break( oErr )}
|
||||
oOL := CreateObject( "Outlook.Application" )
|
||||
BEGIN SEQUENCE WITH {|oErr| Break( oErr )}
|
||||
oList := oOL:CreateItem( 7 ) // ; olDistributionListItem
|
||||
oList:DLName := "Distribution List"
|
||||
oList:Display( .F. )
|
||||
END SEQUENCE
|
||||
RECOVER
|
||||
Alert( "Error: MS Outlook not available. [" + Ole2TxtError()+ "]" )
|
||||
END SEQUENCE
|
||||
|
||||
RETURN
|
||||
|
||||
STATIC PROCEDURE Exm_MSOutlook2()
|
||||
|
||||
LOCAL oOL
|
||||
LOCAL oLista
|
||||
LOCAL oMail
|
||||
LOCAL i
|
||||
|
||||
oOL := TOleAuto():New( "Outlook.Application.9" )
|
||||
|
||||
IF Ole2TxtError() != "S_OK"
|
||||
Alert("Outlook is not available", "Error")
|
||||
ELSE
|
||||
oMail := oOL:CreateItem( 0 ) // olMailItem
|
||||
|
||||
FOR i := 1 TO 10
|
||||
oMail:Recipients:Add( "Contact" + LTRIM( STR( i, 2 ) ) + ;
|
||||
"<contact" + LTRIM( STR( i, 2 ) ) + "@server.com>" )
|
||||
NEXT
|
||||
|
||||
oLista := oOL:CreateItem( 7 ) // olDistributionListItem
|
||||
oLista:DLName := "Test with distribution list"
|
||||
oLista:Display( .F. )
|
||||
oLista:AddMembers( oMail:Recipients )
|
||||
oLista:Save()
|
||||
oLista:Close( 0 )
|
||||
|
||||
oMail:End()
|
||||
oLista:End()
|
||||
oOL:End()
|
||||
|
||||
ENDIF
|
||||
|
||||
RETURN
|
||||
|
||||
STATIC PROCEDURE Exm_OpenOffice()
|
||||
|
||||
LOCAL oOO_ServiceManager
|
||||
LOCAL oOO_Desktop
|
||||
LOCAL oOO_PropVal01
|
||||
LOCAL oOO_Doc
|
||||
|
||||
LOCAL cDir
|
||||
|
||||
BEGIN SEQUENCE WITH {|oErr| Break( oErr )}
|
||||
|
||||
oOO_ServiceManager := CreateObject( "com.sun.star.ServiceManager" )
|
||||
|
||||
BEGIN SEQUENCE WITH {|oErr| Break( oErr )}
|
||||
|
||||
hb_FNameSplit( hb_ArgV( 0 ), @cDir )
|
||||
|
||||
oOO_Desktop := oOO_ServiceManager:createInstance( "com.sun.star.frame.Desktop" )
|
||||
oOO_PropVal01 := oOO_ServiceManager:Bridge_GetStruct( "com.sun.star.beans.PropertyValue" )
|
||||
oOO_Doc := oOO_Desktop:loadComponentFromURL( OO_ConvertToURL( hb_FNameMerge( cDir, "sample.odt" ) ), "_blank", 0, { oOO_PropVal01 } )
|
||||
|
||||
// ...
|
||||
|
||||
oOO_Doc:Close( .T. )
|
||||
oOO_Doc := NIL
|
||||
|
||||
oOO_Desktop:Terminate()
|
||||
oOO_Desktop := NIL
|
||||
oOO_PropVal01 := NIL
|
||||
|
||||
END SEQUENCE
|
||||
|
||||
oOO_ServiceManager := NIL
|
||||
|
||||
RECOVER
|
||||
Alert( "Error: OpenOffice not available. [" + Ole2TxtError()+ "]" )
|
||||
END SEQUENCE
|
||||
|
||||
RETURN
|
||||
|
||||
STATIC FUNCTION OO_ConvertToURL( cString )
|
||||
|
||||
// ; Handle UNC paths
|
||||
IF !( Left( cString, 2 ) == "\\" )
|
||||
cString := StrTran( cString, ":", "|" )
|
||||
cString := "///" + cString
|
||||
ENDIF
|
||||
|
||||
cString := StrTran( cString, "\", "/" )
|
||||
cString := StrTran( cString, " ", "%20" )
|
||||
|
||||
RETURN "file:" + cString
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,683 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright 2002 Jose F. Gimenez (JFG) - <jfgimenez@wanadoo.es>
|
||||
* Ron Pinkas - <ron@ronpinkas.com>
|
||||
*
|
||||
* www - http://www.xharbour.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the xHarbour Project gives permission for
|
||||
* additional uses of the text contained in its release of xHarbour.
|
||||
*
|
||||
* The exception is that, if you link the xHarbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the xHarbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the xHarbour
|
||||
* Project under the name xHarbour. If you copy code from other
|
||||
* xHarbour Project or Free Software Foundation releases into a copy of
|
||||
* xHarbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for xHarbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __PLATFORM__WINDOWS
|
||||
FUNCTION CreateObject()
|
||||
RETURN NIL
|
||||
|
||||
FUNCTION GetActiveObject()
|
||||
RETURN NIL
|
||||
#else
|
||||
|
||||
#define HB_CLS_NOTOBJECT
|
||||
|
||||
#include "common.ch"
|
||||
#include "hbclass.ch"
|
||||
#include "error.ch"
|
||||
|
||||
#ifndef __XHARBOUR__
|
||||
|
||||
#define EG_OLEEXCEPTION 1001
|
||||
|
||||
#xcommand TRY => BEGIN SEQUENCE WITH t_bBreak
|
||||
#xcommand CATCH [<!oErr!>] => RECOVER [USING <oErr>] <-oErr->
|
||||
#xcommand FINALLY => ALWAYS
|
||||
|
||||
THREAD STATIC t_bBreak := { |oErr| break( oErr ) }
|
||||
|
||||
STATIC PROCEDURE THROW( oError )
|
||||
LOCAL lError := Eval( ErrorBlock(), oError )
|
||||
IF !HB_ISLOGICAL( lError ) .OR. lError
|
||||
__ErrInHandler()
|
||||
ENDIF
|
||||
Break( oError )
|
||||
RETURN
|
||||
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
|
||||
FUNCTION CreateObject( cString, cLicense )
|
||||
|
||||
RETURN TOleAuto():New( cString, , cLicense )
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
|
||||
FUNCTION GetActiveObject( cString )
|
||||
|
||||
RETURN TOleAuto():GetActiveObject( cString )
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
|
||||
INIT PROCEDURE HB_OleInit()
|
||||
|
||||
/* It's important to store value returned by __HB_OLE_INIT() in
|
||||
* STATIC variable. When HVM will clear STATICs on HVM exit
|
||||
* then it will execute destructor bound with this variable which
|
||||
* calls OleUninitialize() - such method causes that OleUninitialize()
|
||||
* will be called very lately after all user EXIT functions, ALWAYS
|
||||
* blocks and .prg object destructors which may also use OLE.
|
||||
*/
|
||||
static s_ole
|
||||
|
||||
s_ole := __HB_OLE_INIT()
|
||||
|
||||
RETURN
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
|
||||
CLASS VTWrapper
|
||||
DATA vt
|
||||
DATA Value
|
||||
|
||||
METHOD New( vt, xVal ) CONSTRUCTOR
|
||||
ENDCLASS
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
METHOD New( vt, xVal ) CLASS VTWrapper
|
||||
|
||||
::vt := vt
|
||||
::Value := xVal
|
||||
|
||||
//TraceLog( vt, ::vt, xVal, ::Value )
|
||||
|
||||
RETURN Self
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
CLASS VTArrayWrapper FROM VTWrapper
|
||||
|
||||
METHOD AsArray( nIndex, xValue ) OPERATOR "[]"
|
||||
METHOD __enumStart( enum, lDescend )
|
||||
|
||||
ENDCLASS
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
METHOD AsArray( nIndex, xValue ) CLASS VTArrayWrapper
|
||||
|
||||
RETURN IIF( PCount() == 1, ::Value[nIndex], ::Value[nIndex] := xValue )
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
METHOD __enumStart( enum, lDescend ) CLASS VTarrayWrapper
|
||||
|
||||
HB_SYMBOL_UNUSED( lDescend )
|
||||
|
||||
/* set base value for enumerator */
|
||||
(@enum):__enumBase( ::Value )
|
||||
|
||||
RETURN !Empty( ::Value )
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
CLASS TOleAuto
|
||||
|
||||
DATA hObj
|
||||
DATA cClassName
|
||||
DATA pOleEnumerator
|
||||
|
||||
METHOD New( uObj, cClass, cLicense ) CONSTRUCTOR
|
||||
METHOD GetActiveObject( cClass ) CONSTRUCTOR
|
||||
|
||||
METHOD Invoke()
|
||||
MESSAGE CallMethod METHOD Invoke()
|
||||
|
||||
METHOD Set()
|
||||
MESSAGE SetProperty METHOD Set()
|
||||
|
||||
METHOD Get()
|
||||
MESSAGE GetProperty METHOD Get()
|
||||
|
||||
METHOD OleValue()
|
||||
METHOD _OleValue( xSetValue )
|
||||
|
||||
METHOD OleNewEnumerator()
|
||||
|
||||
METHOD OleCollection( xIndex, xValue ) OPERATOR "[]"
|
||||
|
||||
METHOD OleValuePlus( xArg ) OPERATOR "+"
|
||||
METHOD OleValueMinus( xArg ) OPERATOR "-"
|
||||
METHOD OleValueMultiply( xArg ) OPERATOR "*"
|
||||
METHOD OleValueDivide( xArg ) OPERATOR "/"
|
||||
METHOD OleValueModulus( xArg ) OPERATOR "%"
|
||||
METHOD OleValueInc() OPERATOR "++"
|
||||
METHOD OleValueDec() OPERATOR "--"
|
||||
METHOD OleValuePower( xArg ) OPERATOR "^"
|
||||
|
||||
METHOD OleValueEqual( xArg ) OPERATOR "="
|
||||
METHOD OleValueExactEqual( xArg ) OPERATOR "=="
|
||||
METHOD OleValueNotEqual( xArg ) OPERATOR "!="
|
||||
|
||||
METHOD __enumStart( enum, lDescend )
|
||||
METHOD __enumSkip( enum, lDescend )
|
||||
METHOD __enumStop()
|
||||
|
||||
ERROR HANDLER OnError()
|
||||
|
||||
DESTRUCTOR Release()
|
||||
|
||||
// Needed to refernce, or hb_dynsymFindName() will fail
|
||||
METHOD ForceSymbols() INLINE ::cClassName()
|
||||
|
||||
ENDCLASS
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
METHOD New( uObj, cClass, cLicense ) CLASS TOleAuto
|
||||
|
||||
LOCAL oErr
|
||||
|
||||
// Hack in case OLE Server already created and New() is attempted as an OLE Method.
|
||||
IF ::hObj != NIL
|
||||
RETURN HB_ExecFromArray( Self, "_New", HB_aParams() )
|
||||
ENDIF
|
||||
|
||||
IF ISCHARACTER( uObj )
|
||||
::hObj := CreateOleObject( uObj, , cLicense )
|
||||
|
||||
IF OleError() != 0
|
||||
IF Ole2TxtError() == "DISP_E_EXCEPTION"
|
||||
oErr := ErrorNew()
|
||||
oErr:Args := HB_aParams()
|
||||
oErr:CanDefault := .F.
|
||||
oErr:CanRetry := .F.
|
||||
oErr:CanSubstitute := .T.
|
||||
oErr:Description := OLEExceptionDescription()
|
||||
oErr:GenCode := EG_OLEEXCEPTION
|
||||
oErr:Operation := ProcName()
|
||||
oErr:Severity := ES_ERROR
|
||||
oErr:SubCode := -1
|
||||
oErr:SubSystem := OLEExceptionSource()
|
||||
|
||||
RETURN Throw( oErr )
|
||||
ELSE
|
||||
oErr := ErrorNew()
|
||||
oErr:Args := HB_aParams()
|
||||
oErr:CanDefault := .F.
|
||||
oErr:CanRetry := .F.
|
||||
oErr:CanSubstitute := .T.
|
||||
oErr:Description := Ole2TxtError()
|
||||
oErr:GenCode := EG_OLEEXCEPTION
|
||||
oErr:Operation := ProcName()
|
||||
oErr:Severity := ES_ERROR
|
||||
oErr:SubCode := -1
|
||||
oErr:SubSystem := "TOleAuto"
|
||||
|
||||
RETURN Throw( oErr )
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
::cClassName := uObj
|
||||
ELSEIF ISNUMBER( uObj )
|
||||
OleAddRef( uObj )
|
||||
::hObj := uObj
|
||||
|
||||
IF ISCHARACTER( cClass )
|
||||
::cClassName := cClass
|
||||
ELSE
|
||||
::cClassName := LTrim( Str( uObj ) )
|
||||
ENDIF
|
||||
ELSE
|
||||
oErr := ErrorNew()
|
||||
oErr:Args := HB_aParams()
|
||||
oErr:CanDefault := .F.
|
||||
oErr:CanRetry := .F.
|
||||
oErr:CanSubstitute := .T.
|
||||
oErr:Description := "Invalid argument to contructor!"
|
||||
oErr:GenCode := 0
|
||||
oErr:Operation := ProcName()
|
||||
oErr:Severity := ES_ERROR
|
||||
oErr:SubCode := -1
|
||||
oErr:SubSystem := "TOleAuto"
|
||||
|
||||
RETURN Throw( oErr )
|
||||
ENDIF
|
||||
|
||||
RETURN Self
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Destructor!
|
||||
PROCEDURE Release() CLASS TOleAuto
|
||||
|
||||
//TraceLog( ::cClassName, ::hObj )
|
||||
|
||||
IF ! Empty( ::hObj )
|
||||
//TraceLog( ::cClassName, ::hObj )
|
||||
OleReleaseObject( ::hObj )
|
||||
//::hObj := NIL
|
||||
ENDIF
|
||||
|
||||
RETURN
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
METHOD GetActiveObject( cClass ) CLASS TOleAuto
|
||||
|
||||
LOCAL oErr
|
||||
|
||||
IF ISCHARACTER( cClass )
|
||||
::hObj := GetOleObject( cClass )
|
||||
|
||||
IF OleError() != 0
|
||||
IF Ole2TxtError() == "DISP_E_EXCEPTION"
|
||||
oErr := ErrorNew()
|
||||
oErr:Args := { cClass }
|
||||
oErr:CanDefault := .F.
|
||||
oErr:CanRetry := .F.
|
||||
oErr:CanSubstitute := .T.
|
||||
oErr:Description := OLEExceptionDescription()
|
||||
oErr:GenCode := EG_OLEEXCEPTION
|
||||
oErr:Operation := ProcName()
|
||||
oErr:Severity := ES_ERROR
|
||||
oErr:SubCode := -1
|
||||
oErr:SubSystem := OLEExceptionSource()
|
||||
|
||||
RETURN Throw( oErr )
|
||||
ELSE
|
||||
oErr := ErrorNew()
|
||||
oErr:Args := { cClass }
|
||||
oErr:CanDefault := .F.
|
||||
oErr:CanRetry := .F.
|
||||
oErr:CanSubstitute := .T.
|
||||
oErr:Description := Ole2TxtError()
|
||||
oErr:GenCode := EG_OLEEXCEPTION
|
||||
oErr:Operation := ProcName()
|
||||
oErr:Severity := ES_ERROR
|
||||
oErr:SubCode := -1
|
||||
oErr:SubSystem := "TOleAuto"
|
||||
|
||||
RETURN Throw( oErr )
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
::cClassName := cClass
|
||||
ELSE
|
||||
Alert( "OLE interface: Invalid parameter type to constructor TOleAuto():GetActiveObject()" )
|
||||
::hObj := 0
|
||||
ENDIF
|
||||
|
||||
RETURN Self
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
METHOD OleCollection( xIndex, xValue ) CLASS TOleAuto
|
||||
|
||||
LOCAL xRet
|
||||
|
||||
//TraceLog( PCount(), xIndex, xValue )
|
||||
|
||||
IF PCount() == 1
|
||||
RETURN ::Item( xIndex )
|
||||
ENDIF
|
||||
|
||||
IF ISNUMBER( xIndex ) .AND. xIndex < 0
|
||||
xIndex += ( ::Count + 1 )
|
||||
ENDIF
|
||||
|
||||
TRY
|
||||
// ASP Collection syntax.
|
||||
xRet := ::_Item( xIndex, xValue )
|
||||
CATCH
|
||||
xRet := ::SetItem( xIndex, xValue )
|
||||
END
|
||||
|
||||
RETURN xRet
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
METHOD OleValuePlus( xArg ) CLASS TOleAuto
|
||||
|
||||
LOCAL xRet, oErr
|
||||
|
||||
TRY
|
||||
xRet := ::OleValue + xArg
|
||||
CATCH
|
||||
oErr := ErrorNew()
|
||||
oErr:Args := { Self, xArg }
|
||||
oErr:CanDefault := .F.
|
||||
oErr:CanRetry := .F.
|
||||
oErr:CanSubstitute := .T.
|
||||
oErr:Description := "argument error"
|
||||
oErr:GenCode := EG_ARG
|
||||
oErr:Operation := "+"
|
||||
oErr:Severity := ES_ERROR
|
||||
oErr:SubCode := 1081
|
||||
oErr:SubSystem := "BASE"
|
||||
|
||||
RETURN Throw( oErr )
|
||||
END
|
||||
|
||||
RETURN xRet
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
METHOD OleValueMinus( xArg ) CLASS TOleAuto
|
||||
|
||||
LOCAL xRet, oErr
|
||||
|
||||
TRY
|
||||
xRet := ::OleValue - xArg
|
||||
CATCH
|
||||
oErr := ErrorNew()
|
||||
oErr:Args := { Self, xArg }
|
||||
oErr:CanDefault := .F.
|
||||
oErr:CanRetry := .F.
|
||||
oErr:CanSubstitute := .T.
|
||||
oErr:Description := "argument error"
|
||||
oErr:GenCode := EG_ARG
|
||||
oErr:Operation := "-"
|
||||
oErr:Severity := ES_ERROR
|
||||
oErr:SubCode := 1082
|
||||
oErr:SubSystem := "BASE"
|
||||
|
||||
RETURN Throw( oErr )
|
||||
END
|
||||
|
||||
RETURN xRet
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
METHOD OleValueMultiply( xArg ) CLASS TOleAuto
|
||||
|
||||
LOCAL xRet, oErr
|
||||
|
||||
TRY
|
||||
xRet := ::OleValue * xArg
|
||||
CATCH
|
||||
oErr := ErrorNew()
|
||||
oErr:Args := { Self, xArg }
|
||||
oErr:CanDefault := .F.
|
||||
oErr:CanRetry := .F.
|
||||
oErr:CanSubstitute := .T.
|
||||
oErr:Description := "argument error"
|
||||
oErr:GenCode := EG_ARG
|
||||
oErr:Operation := "*"
|
||||
oErr:Severity := ES_ERROR
|
||||
oErr:SubCode := 1083
|
||||
oErr:SubSystem := "BASE"
|
||||
|
||||
RETURN Throw( oErr )
|
||||
END
|
||||
|
||||
RETURN xRet
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
METHOD OleValueDivide( xArg ) CLASS TOleAuto
|
||||
|
||||
LOCAL xRet, oErr
|
||||
|
||||
TRY
|
||||
xRet := ::OleValue / xArg
|
||||
CATCH
|
||||
oErr := ErrorNew()
|
||||
oErr:Args := { Self, xArg }
|
||||
oErr:CanDefault := .F.
|
||||
oErr:CanRetry := .F.
|
||||
oErr:CanSubstitute := .T.
|
||||
oErr:Description := "argument error"
|
||||
oErr:GenCode := EG_ARG
|
||||
oErr:Operation := "/"
|
||||
oErr:Severity := ES_ERROR
|
||||
oErr:SubCode := 1084
|
||||
oErr:SubSystem := "BASE"
|
||||
|
||||
RETURN Throw( oErr )
|
||||
END
|
||||
|
||||
RETURN xRet
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
METHOD OleValueModulus( xArg ) CLASS TOleAuto
|
||||
|
||||
LOCAL xRet, oErr
|
||||
|
||||
TRY
|
||||
xRet := ::OleValue % xArg
|
||||
CATCH
|
||||
oErr := ErrorNew()
|
||||
oErr:Args := { Self, xArg }
|
||||
oErr:CanDefault := .F.
|
||||
oErr:CanRetry := .F.
|
||||
oErr:CanSubstitute := .T.
|
||||
oErr:Description := "argument error"
|
||||
oErr:GenCode := EG_ARG
|
||||
oErr:Operation := "%"
|
||||
oErr:Severity := ES_ERROR
|
||||
oErr:SubCode := 1085
|
||||
oErr:SubSystem := "BASE"
|
||||
|
||||
RETURN Throw( oErr )
|
||||
END
|
||||
|
||||
RETURN xRet
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
METHOD OleValueInc() CLASS TOleAuto
|
||||
|
||||
LOCAL oErr
|
||||
|
||||
TRY
|
||||
++::OleValue
|
||||
CATCH
|
||||
oErr := ErrorNew()
|
||||
oErr:Args := { Self }
|
||||
oErr:CanDefault := .F.
|
||||
oErr:CanRetry := .F.
|
||||
oErr:CanSubstitute := .T.
|
||||
oErr:Description := "argument error"
|
||||
oErr:GenCode := EG_ARG
|
||||
oErr:Operation := "++"
|
||||
oErr:Severity := ES_ERROR
|
||||
oErr:SubCode := 1086
|
||||
oErr:SubSystem := "BASE"
|
||||
|
||||
RETURN Throw( oErr )
|
||||
END
|
||||
|
||||
RETURN Self
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
METHOD OleValueDec() CLASS TOleAuto
|
||||
|
||||
LOCAL oErr
|
||||
|
||||
TRY
|
||||
--::OleValue
|
||||
CATCH
|
||||
oErr := ErrorNew()
|
||||
oErr:Args := { Self }
|
||||
oErr:CanDefault := .F.
|
||||
oErr:CanRetry := .F.
|
||||
oErr:CanSubstitute := .T.
|
||||
oErr:Description := "argument error"
|
||||
oErr:GenCode := EG_ARG
|
||||
oErr:Operation := "--"
|
||||
oErr:Severity := ES_ERROR
|
||||
oErr:SubCode := 1087
|
||||
oErr:SubSystem := "BASE"
|
||||
|
||||
RETURN Throw( oErr )
|
||||
END
|
||||
|
||||
RETURN Self
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
METHOD OleValuePower( xArg ) CLASS TOleAuto
|
||||
|
||||
LOCAL xRet, oErr
|
||||
|
||||
TRY
|
||||
xRet := ::OleValue ^ xArg
|
||||
CATCH
|
||||
oErr := ErrorNew()
|
||||
oErr:Args := { Self, xArg }
|
||||
oErr:CanDefault := .F.
|
||||
oErr:CanRetry := .F.
|
||||
oErr:CanSubstitute := .T.
|
||||
oErr:Description := "argument error"
|
||||
oErr:GenCode := EG_ARG
|
||||
oErr:Operation := "^"
|
||||
oErr:Severity := ES_ERROR
|
||||
oErr:SubCode := 1088
|
||||
oErr:SubSystem := "BASE"
|
||||
|
||||
RETURN Throw( oErr )
|
||||
END
|
||||
|
||||
RETURN xRet
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
METHOD OleValueEqual( xArg ) CLASS TOleAuto
|
||||
|
||||
LOCAL xRet, oErr
|
||||
|
||||
TRY
|
||||
xRet := ( ::OleValue = xArg ) /* NOTE: Intentionally using '=' operator. */
|
||||
CATCH
|
||||
oErr := ErrorNew()
|
||||
oErr:Args := { Self, xArg }
|
||||
oErr:CanDefault := .F.
|
||||
oErr:CanRetry := .F.
|
||||
oErr:CanSubstitute := .T.
|
||||
oErr:Description := "argument error"
|
||||
oErr:GenCode := EG_ARG
|
||||
oErr:Operation := "="
|
||||
oErr:Severity := ES_ERROR
|
||||
oErr:SubCode := 1085
|
||||
oErr:SubSystem := "BASE"
|
||||
|
||||
RETURN Throw( oErr )
|
||||
END
|
||||
|
||||
RETURN xRet
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
METHOD OleValueExactEqual( xArg ) CLASS TOleAuto
|
||||
|
||||
LOCAL xRet, oErr
|
||||
|
||||
TRY
|
||||
xRet := ( ::OleValue == xArg )
|
||||
CATCH
|
||||
oErr := ErrorNew()
|
||||
oErr:Args := { Self, xArg }
|
||||
oErr:CanDefault := .F.
|
||||
oErr:CanRetry := .F.
|
||||
oErr:CanSubstitute := .T.
|
||||
oErr:Description := "argument error"
|
||||
oErr:GenCode := EG_ARG
|
||||
oErr:Operation := "=="
|
||||
oErr:Severity := ES_ERROR
|
||||
oErr:SubCode := 1085
|
||||
oErr:SubSystem := "BASE"
|
||||
|
||||
RETURN Throw( oErr )
|
||||
END
|
||||
|
||||
RETURN xRet
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
METHOD OleValueNotEqual( xArg ) CLASS TOleAuto
|
||||
|
||||
LOCAL xRet, oErr
|
||||
|
||||
TRY
|
||||
xRet := ::OleValue != xArg
|
||||
CATCH
|
||||
oErr := ErrorNew()
|
||||
oErr:Args := { Self, xArg }
|
||||
oErr:CanDefault := .F.
|
||||
oErr:CanRetry := .F.
|
||||
oErr:CanSubstitute := .T.
|
||||
oErr:Description := "argument error"
|
||||
oErr:GenCode := EG_ARG
|
||||
oErr:Operation := "!="
|
||||
oErr:Severity := ES_ERROR
|
||||
oErr:SubCode := 1085
|
||||
oErr:SubSystem := "BASE"
|
||||
|
||||
RETURN Throw( oErr )
|
||||
END
|
||||
|
||||
RETURN xRet
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
METHOD __enumStart( enum, lDescend ) CLASS TOleAuto
|
||||
|
||||
/* TODO: add support for descend order */
|
||||
::pOleEnumerator := ::OleNewEnumerator()
|
||||
|
||||
RETURN ::__enumSkip( @enum, lDescend )
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
METHOD __enumSkip( enum, lDescend ) CLASS TOleAuto
|
||||
|
||||
LOCAL lContinue, xValue
|
||||
|
||||
/* TODO: add support for descend order */
|
||||
HB_SYMBOL_UNUSED( lDescend )
|
||||
|
||||
xValue := __OLEENUMNEXT( ::pOleEnumerator, @lContinue )
|
||||
|
||||
/* set enumerator value */
|
||||
(@enum):__enumValue( xValue )
|
||||
|
||||
RETURN lContinue
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
METHOD PROCEDURE __enumStop() CLASS TOleAuto
|
||||
|
||||
__OLEENUMSTOP( ::pOleEnumerator )
|
||||
::pOleEnumerator := NIL
|
||||
|
||||
RETURN
|
||||
|
||||
PROCEDURE OleShowException()
|
||||
|
||||
Alert( OleExceptionSource() + ": " + OleExceptionDescription() )
|
||||
|
||||
RETURN
|
||||
|
||||
#endif
|
||||
@@ -77,11 +77,11 @@ BOOL win_SysRefresh( int iMsec )
|
||||
/* Begin the operation and continue until it is complete
|
||||
or until the user clicks the mouse or presses a key. */
|
||||
|
||||
while( MsgWaitForMultipleObjects( 1, &hDummyEvent, FALSE, ( iMsec == 0 ? INFINITE : ( ULONG ) iMsec ), QS_ALLINPUT | QS_ALLPOSTMESSAGE) == WAIT_OBJECT_0 + 1 )
|
||||
while( MsgWaitForMultipleObjects( 1, &hDummyEvent, FALSE, ( iMsec == 0 ? INFINITE : ( ULONG ) iMsec ), QS_ALLINPUT | QS_ALLPOSTMESSAGE ) == WAIT_OBJECT_0 + 1 )
|
||||
{
|
||||
MSG msg;
|
||||
|
||||
while( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) )
|
||||
while( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) )
|
||||
{
|
||||
switch( msg.message )
|
||||
{
|
||||
@@ -145,7 +145,7 @@ HB_FUNC( HB_UTCOFFSET )
|
||||
char * szRet = ( char * ) hb_xgrab( 6 );
|
||||
int nLen;
|
||||
|
||||
#if defined(HB_OS_WIN)
|
||||
#if defined( HB_OS_WIN )
|
||||
{
|
||||
TIME_ZONE_INFORMATION tzInfo;
|
||||
|
||||
|
||||
@@ -344,12 +344,12 @@ char * hb_verPlatform( void )
|
||||
break;
|
||||
}
|
||||
|
||||
hb_snprintf( pszPlatform, PLATFORM_BUF_SIZE + 1, "Windows%s%s %lu.%lu.%04d",
|
||||
hb_snprintf( pszPlatform, PLATFORM_BUF_SIZE + 1, "Windows%s%s %lu.%lu.%04u",
|
||||
pszName,
|
||||
pszWine,
|
||||
( ULONG ) osVer.dwMajorVersion,
|
||||
( ULONG ) osVer.dwMinorVersion,
|
||||
( USHORT ) LOWORD( osVer.dwBuildNumber ) );
|
||||
osVer.dwMajorVersion,
|
||||
osVer.dwMinorVersion,
|
||||
LOWORD( osVer.dwBuildNumber ) );
|
||||
|
||||
/* Add service pack/other info */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user