2001-08-24 23:40 GMT+2 Maurilio Longo <maurilio.longo@libero.it>

+ contrib/os2pm/tmenu.prg
   + contrib/os2pm/tmenuitm.prg
     + added
   * contrib/os2pm/tform.prg
   * contrib/os2pm/os2pm.c
     + added harbour licence and new methods and support functions
This commit is contained in:
Maurilio Longo
2001-08-24 21:38:06 +00:00
parent 37e8299b9d
commit 43cd2f0d11
7 changed files with 385 additions and 1 deletions

View File

@@ -1,3 +1,11 @@
2001-08-24 23:40 GMT+2 Maurilio Longo <maurilio.longo@libero.it>
+ contrib/os2pm/tmenu.prg
+ contrib/os2pm/tmenuitm.prg
+ added
* contrib/os2pm/tform.prg
* contrib/os2pm/os2pm.c
+ added harbour licence and new methods and support functions
2001-08-24 16:40 GMT+2 Maurilio Longo <maurilio.longo@libero.it>
* contrib/os2pm/os2pm.c
* moved here functions from mainpm.c

View File

@@ -8,7 +8,9 @@ C_SOURCES=\
os2pm.c \
PRG_SOURCES=\
tform.prg \
tform.prg \
tmenu.prg \
tmenuitm.prg \
LIBNAME=os2pm

View File

@@ -3,6 +3,57 @@
*/
/*
* 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
@@ -107,4 +158,51 @@ HB_FUNC( GETHAB )
}
HB_FUNC( WINCREATEMENU )
{
hb_retnl( ( LONG ) WinCreateMenu( ( HWND ) hb_parnl( 1 ),
( PVOID ) hb_parnl( 2 ) ) );
}
/* Some xBase for C language */
#define IF(x,y,z) ((x)?(y):(z))
HB_FUNC( WINADDMENUITEM )
{
MENUITEM mit;
mit.iPosition = hb_parni( 3 );
mit.afStyle = IF( ISCHAR( 2 ), MIS_TEXT, MIS_SEPARATOR );
mit.afAttribute = IF( ! 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 ) ) );
}
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_parni( 2 ),
( MPARAM ) IF( ISCHAR( 3 ), (ULONG) hb_parc( 3 ), hb_parnl( 3 ) ),
( MPARAM ) IF( ISCHAR( 4 ), (ULONG) hb_parc( 4 ), hb_parnl( 4 ) ) ) );
}

View File

@@ -3,6 +3,56 @@
*/
/*
* 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 _OS2EMX_H
#define INCL_DOS
#define INCL_DOSERRORS

View File

@@ -2,6 +2,56 @@
* $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"
@@ -10,6 +60,7 @@
CLASS TForm
DATA hWnd
DATA oMainMenu
CLASSDATA lRegistered
@@ -20,8 +71,12 @@ CLASS TForm
METHOD _cCaption( cNewCaption ) INLINE ;
WinSetWindowText( ::hWnd, cNewCaption )
METHOD oMenu() INLINE ::oMainMenu
METHOD _oMenu( oNewMenu )
ENDCLASS
METHOD New() CLASS TForm
local hWndClient
@@ -52,6 +107,7 @@ METHOD New() CLASS TForm
return Self
METHOD ShowModal() CLASS TForm
HB_PM_ShowModal()
@@ -59,4 +115,12 @@ METHOD ShowModal() CLASS TForm
return nil
METHOD _oMenu( oNewMenu ) CLASS TForm
::oMainMenu = oNewMenu
WinSetParent( oNewMenu:nHandle, ::hWnd, .t. )
WinSetOwner( oNewMenu:nHandle, ::hWnd )
WinSendMsg( ::hWnd, WM_UPDATEFRAME, FCF_MENU, 0 )
return nil

View File

@@ -0,0 +1,82 @@
/*
* $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"
CLASS TMenu
DATA nHandle
DATA aItems
METHOD New( oForm )
METHOD Add( oMenuItem )
ENDCLASS
METHOD New( oForm ) CLASS TMenu
::aItems = {}
::nHandle = WinCreateMenu( oForm:hWnd )
return Self
METHOD Add( oMenuItem ) CLASS TMenu
WinAddMenuItem( ::nHandle, oMenuItem:cCaption, Len( ::aItems ),;
nil, oMenuItem:nId, oMenuItem:lActive )
AAdd( ::aItems, oMenuItem )
return nil

View File

@@ -0,0 +1,80 @@
/*
* $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"
CLASS TMenuItem
DATA cCaption
DATA cAction
DATA nId
DATA lActive
CLASSDATA nIdStart
METHOD New()
ENDCLASS
METHOD New() CLASS TMenuItem
DEFAULT ::nIdStart TO 110
::cCaption = ""
::nId = ::nIdStart++
::lActive = .t.
return Self