diff --git a/harbour/ChangeLog b/harbour/ChangeLog index c87714fb42..5e93351629 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,21 @@ 2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2008-11-23 17:28 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + * harbour/contrib/gtwvg/Makefile + * harbour/contrib/gtwvg/common.mak + + wvgtoolb.prg + + * harbour/contrib/gtwvg/hbgtwvg.ch + * harbour/contrib/gtwvg/wvgdlg.prg + * harbour/contrib/gtwvg/wvgmenub.prg + * harbour/contrib/gtwvg/wvgphdlr.prg + + harbour/contrib/gtwvg/wvgtoolb.prg + ! Initial commit. + * harbour/contrib/gtwvg/wvgwnd.prg + + ! Usual cleanup plus new functions/members etc. + 2008-11-23 15:00 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * harbour/contrib/gtwvg/Makefile * harbour/contrib/gtwvg/common.mak diff --git a/harbour/contrib/gtwvg/Makefile b/harbour/contrib/gtwvg/Makefile index 41f26c4237..ece073f4e4 100644 --- a/harbour/contrib/gtwvg/Makefile +++ b/harbour/contrib/gtwvg/Makefile @@ -25,6 +25,8 @@ PRG_SOURCES=\ wvgax.prg \ wvgdlg.prg \ wvgmenub.prg \ + wvgtoolb.prg \ + PRG_HEADERS=\ hbgtwvg.ch \ diff --git a/harbour/contrib/gtwvg/common.mak b/harbour/contrib/gtwvg/common.mak index c80b5a0cc7..83e11898e8 100644 --- a/harbour/contrib/gtwvg/common.mak +++ b/harbour/contrib/gtwvg/common.mak @@ -19,6 +19,7 @@ LIB_OBJS = \ $(OBJ_DIR)wvgax$(OBJEXT) \ $(OBJ_DIR)wvgdlg$(OBJEXT) \ $(OBJ_DIR)wvgmenub$(OBJEXT) \ + $(OBJ_DIR)wvgtoolb$(OBJEXT) \ \ $(OBJ_DIR)gtwvg$(OBJEXT) \ $(OBJ_DIR)wvgcore$(OBJEXT) \ diff --git a/harbour/contrib/gtwvg/hbgtwvg.ch b/harbour/contrib/gtwvg/hbgtwvg.ch index 0b95007104..174a871ca7 100644 --- a/harbour/contrib/gtwvg/hbgtwvg.ch +++ b/harbour/contrib/gtwvg/hbgtwvg.ch @@ -138,7 +138,45 @@ #define objTypeWindow 2 #define objTypeActiveX 3 #define objTypeDialog 4 +#define objTypeToolBar 5 +#define objTypeToolBarButton 6 +#define objTypeMenu 7 + +#define WVGALIGN_TOP 0 +#define WVGALIGN_LEFT 0 +#define WVGALIGN_HCENTER 1 +#define WVGALIGN_RIGHT 2 +#define WVGALIGN_VCENTER 4 +#define WVGALIGN_BOTTOM 8 +#define WVGALIGN_WORDBREAK 16 + +#define WVGFRAME_NONE 0 +#define WVGFRAME_RECT 1 +#define WVGFRAME_BOX 2 +#define WVGFRAME_RAISED 16 +#define WVGFRAME_RECESSED 32 +#define WVGFRAME_THICK 128 + +#define WVGTOOLBAR_STYLE_STANDARD 0 +#define WVGTOOLBAR_STYLE_FLAT 1 + +#define WVGTOOLBAR_BUTTON_UNPRESSED 0 +#define WVGTOOLBAR_BUTTON_PRESSED 1 + +#define WVGTOOLBAR_BUTTON_DEFAULT 0 +#define WVGTOOLBAR_BUTTON_TOGGLE 1 +#define WVGTOOLBAR_BUTTON_BUTTONGROUP 2 +#define WVGTOOLBAR_BUTTON_SEPARATOR 3 +#define WVGTOOLBAR_BUTTON_PLACEHOLDER 4 +#define WVGTOOLBAR_BUTTON_DROPDOWN 5 + +#define WVGTOOLBAR_STDIMAGES_SMALL 0 +#define WVGTOOLBAR_STDIMAGES_LARGE 1 +#define WVGTOOLBAR_VIEWIMAGES_SMALL 4 +#define WVGTOOLBAR_VIEWIMAGES_LARGE 5 +#define WVGTOOLBAR_EXPLORERIMAGES_SMALL 8 +#define WVGTOOLBAR_EXPLORERIMAGES_LARGE 9 //----------------------------------------------------------------------// -#endif +#endif // _HBGTWVG_CH \ No newline at end of file diff --git a/harbour/contrib/gtwvg/wvgdlg.prg b/harbour/contrib/gtwvg/wvgdlg.prg index 8fb9d92266..a588998e4d 100644 --- a/harbour/contrib/gtwvg/wvgdlg.prg +++ b/harbour/contrib/gtwvg/wvgdlg.prg @@ -77,6 +77,8 @@ CLASS WvgDialog FROM WvgWindow DATA oMenu + DATA drawingArea + METHOD init() METHOD create() METHOD configure() @@ -88,12 +90,14 @@ METHOD init( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) CLASS WvgDial ::WvgWindow:init( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) - ::className := 'WVGDIALOG' - ::resizeMode := 0 - ::mouseMode := 0 - ::objType := objTypeDialog + ::className := 'WVGDIALOG' + ::resizeMode := 0 + ::mouseMode := 0 + ::objType := objTypeDialog - ::style := WS_THICKFRAME+WS_OVERLAPPED+WS_CAPTION+WS_SYSMENU+WS_MINIMIZEBOX+WS_MAXIMIZEBOX; + ::style := WS_THICKFRAME+WS_OVERLAPPED+WS_CAPTION+WS_SYSMENU+WS_MINIMIZEBOX+WS_MAXIMIZEBOX; + + ::drawingArea := Self RETURN Self //----------------------------------------------------------------------// diff --git a/harbour/contrib/gtwvg/wvgmenub.prg b/harbour/contrib/gtwvg/wvgmenub.prg index f78446bf8c..6ba4803dca 100644 --- a/harbour/contrib/gtwvg/wvgmenub.prg +++ b/harbour/contrib/gtwvg/wvgmenub.prg @@ -252,7 +252,7 @@ METHOD delItem( nItemNum ) CLASS wvgMenuBar // { xCaption, bAction, nStyle, nAttrb } // METHOD addItem( aItem, p2, p3, p4 ) CLASS wvgMenuBar - LOCAL nItemIndex, nMenuItemID, cCaption + LOCAL nItemIndex, cCaption LOCAL xCaption, bAction, nStyle, nAttrib if PCount() == 1 .and. valtype( aItem ) == 'A' diff --git a/harbour/contrib/gtwvg/wvgphdlr.prg b/harbour/contrib/gtwvg/wvgphdlr.prg index 22e698aaa2..d63e6d38ca 100644 --- a/harbour/contrib/gtwvg/wvgphdlr.prg +++ b/harbour/contrib/gtwvg/wvgphdlr.prg @@ -233,9 +233,9 @@ METHOD setParent( oWvg ) CLASS WvgPartHandler //----------------------------------------------------------------------// METHOD notifier( nEvent, xParams ) CLASS WvgPartHandler - Local xResult, n, aPos + Local aPos LOCAL nReturn := 0 - LOCAL aMenuItem, bBlock, nPos + LOCAL aMenuItem DO CASE diff --git a/harbour/contrib/gtwvg/wvgtoolb.prg b/harbour/contrib/gtwvg/wvgtoolb.prg new file mode 100644 index 0000000000..da7e256f87 --- /dev/null +++ b/harbour/contrib/gtwvg/wvgtoolb.prg @@ -0,0 +1,293 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * Source file for the Wvg*Classes + * + * Copyright 2008 Pritpal Bedi + * 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. + * + */ +//----------------------------------------------------------------------// +//----------------------------------------------------------------------// +//----------------------------------------------------------------------// +// +// EkOnkar +// ( The LORD is ONE ) +// +// Xbase++ xbpToolBar Compatible Class +// +// Pritpal Bedi +// 23Nov2008 +// +//----------------------------------------------------------------------// +//----------------------------------------------------------------------// +//----------------------------------------------------------------------// + +#include 'hbclass.ch' +#include 'common.ch' +#include 'hbgtinfo.ch' +#include 'hbgtwvg.ch' +#include 'wvtwin.ch' +#include 'inkey.ch' + +//----------------------------------------------------------------------// + +CLASS WvgToolBar INHERIT WvgActiveXControl + + DATA appearance + DATA style INIT WVGTOOLBAR_STYLE_STANDARD + DATA allowCustomize INIT .T. + DATA enabled INIT .T. + DATA showToolTips INIT .T. + DATA borderStyle INIT WVGFRAME_NONE + DATA wrappable INIT .T. + DATA buttonWidth INIT 0 + DATA buttonHeight INIT 0 + DATA textAlign INIT WVGALIGN_BOTTOM + DATA imageWidth INIT 0 + DATA imageHeight INIT 0 + DATA transparentColor INIT 0 + + DATA aItems INIT {} + + METHOD new() + METHOD create() + METHOD configure() + METHOD destroy() + + METHOD addItem() + METHOD delItem() + METHOD getItem() + METHOD numItems() INLINE Len( ::aItems ) + METHOD clear() + METHOD customize() + METHOD loadImageSet() + METHOD saveToolbar() + METHOD restToolbar() + METHOD setPosAndSize() + METHOD setSize() + + DATA sl_buttonClick + DATA sl_change + DATA sl_buttonMenuClick + DATA sl_buttonDropDown + + METHOD buttonClick() SETGET + METHOD change() SETGET + METHOD buttonMenuClick() SETGET + METHOD buttonDropDown() SETGET + + + ENDCLASS +//----------------------------------------------------------------------// + +METHOD new( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) + + DEFAULT oParent TO ::oParent + DEFAULT oOwner TO ::oOwner + DEFAULT aPos TO ::aPos + DEFAULT aSize TO ::aSize + DEFAULT aPresParams TO ::aPresParams + DEFAULT lVisible TO ::visible + + ::oParent := oParent + ::oOwner := oOwner + ::aPos := aPos + ::aSize := aSize + ::aPresParams := aPresParams + ::visible := lVisible + + ::WvgActiveXControl:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) + + RETURN Self + +//----------------------------------------------------------------------// + +METHOD create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) + + DEFAULT oParent TO ::oParent + DEFAULT oOwner TO ::oOwner + DEFAULT aPos TO ::aPos + DEFAULT aSize TO ::aSize + DEFAULT aPresParams TO ::aPresParams + DEFAULT lVisible TO ::visible + + ::oParent := oParent + ::oOwner := oOwner + ::aPos := aPos + ::aSize := aSize + ::aPresParams := aPresParams + ::visible := lVisible + + RETURN Self + +//----------------------------------------------------------------------// + +METHOD configure( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) + + DEFAULT oParent TO ::oParent + DEFAULT oOwner TO ::oOwner + DEFAULT aPos TO ::aPos + DEFAULT aSize TO ::aSize + DEFAULT aPresParams TO ::aPresParams + DEFAULT lVisible TO ::visible + + ::oParent := oParent + ::oOwner := oOwner + ::aPos := aPos + ::aSize := aSize + ::aPresParams := aPresParams + ::visible := lVisible + + RETURN Self + +//----------------------------------------------------------------------// + +METHOD destroy() + + RETURN NIL + +//----------------------------------------------------------------------// + +METHOD addItem() + + RETURN Self + +//----------------------------------------------------------------------// + +METHOD delItem() + + RETURN Self + +//----------------------------------------------------------------------// + +METHOD getItem() + + RETURN Self + +//----------------------------------------------------------------------// + +METHOD clear() + + RETURN Self + +//----------------------------------------------------------------------// + +METHOD customize() + + RETURN Self + +//----------------------------------------------------------------------// + +METHOD loadImageSet() + + RETURN Self + +//----------------------------------------------------------------------// + +METHOD saveToolbar() + + RETURN Self + +//----------------------------------------------------------------------// + +METHOD restToolbar() + + RETURN Self + +//----------------------------------------------------------------------// + +METHOD setPosAndSize() + + RETURN Self + +//----------------------------------------------------------------------// + +METHOD setSize() + + RETURN Self + +//----------------------------------------------------------------------// + +METHOD buttonClick( xParam ) + + IF hb_isBlock( xParam ) .or. hb_isNil( xParam ) + ::sl_buttonClick := xParam + ENDIF + + RETURN Self + +//----------------------------------------------------------------------// + +METHOD change( xParam ) + + IF hb_isBlock( xParam ) .or. hb_isNil( xParam ) + ::sl_change := xParam + ENDIF + + RETURN Self + +//----------------------------------------------------------------------// + +METHOD buttonMenuClick( xParam ) + + IF hb_isBlock( xParam ) .or. hb_isNil( xParam ) + ::sl_buttonMenuClick := xParam + ENDIF + + RETURN Self + +//----------------------------------------------------------------------// + +METHOD buttonDropDown( xParam ) + + IF hb_isBlock( xParam ) .or. hb_isNil( xParam ) + ::sl_buttonDropDown := xParam + ENDIF + + RETURN Self + +//----------------------------------------------------------------------// + diff --git a/harbour/contrib/gtwvg/wvgwnd.prg b/harbour/contrib/gtwvg/wvgwnd.prg index 55e2c8049f..2290d5ff39 100644 --- a/harbour/contrib/gtwvg/wvgwnd.prg +++ b/harbour/contrib/gtwvg/wvgwnd.prg @@ -476,14 +476,20 @@ METHOD setPresParam() CLASS WvgWindow //----------------------------------------------------------------------// METHOD currentPos() CLASS WvgWindow + LOCAL aRect - RETURN Self + aRect := Win_GetWindowRect( ::hWnd ) + + RETURN { aRect[ 1 ], aRect[ 2 ] } //----------------------------------------------------------------------// METHOD currentSize() CLASS WvgWindow + LOCAL aRect - RETURN Self + aRect := Win_GetClientRect( ::hWnd ) + + RETURN { aRect[ 3 ] - aRect[ 1 ], aRect[ 4 ] - aRect[ 2 ] } //----------------------------------------------------------------------//