diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 0cd802e9fc..fc685e6aca 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,54 @@ 2009-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2009-03-06 13:14 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + * harbour/contrib/gtwvg/Makefile + + wvgtabpg.prg + + * harbour/contrib/gtwvg/wvtwin.ch + * harbour/contrib/gtwvg/wvgparts.ch + + Added constants to manage Tab Pages + + * harbour/contrib/gtwvg/gtwvg.c + ! Changed the behavior if a GT is child of another GT. + + * harbour/contrib/gtwvg/wincallb.c + ! Cleanups. + + * harbour/contrib/gtwvg/wvgsink.c + ! Cleanup. + % Fixed a potential nasty bug. Kept it in the code to refer if some + problem arises in the future. + + * harbour/contrib/gtwvg/wvgwin.c + ! Cleanup. Removed yet unfinished code. + + * harbour/contrib/gtwvg/wvgcombo.prg + ! Cleanups and documentation update. + + * harbour/contrib/gtwvg/wvgcrt.prg + ! Changed the style of modal GT console. + + * harbour/contrib/gtwvg/wvgwnd.prg + % Rearrangement of methods. + ! Updated to use either protocol - HB_ASCallBck() or SetProp() + controllable by a #define constant. + + + harbour/contrib/gtwvg/wvgtabpg.prg + + Started WvgTabPage() compatible with - XbpTabPage() of Xbase++. + Unfinished but yet usable as demonstrated in demowvg.prg. + + * harbour/contrib/hbwin/hbwapi.h + + Added wapi_par_WORD|DWORD() macros. + + * harbour/contrib/hbwin/wapi_commctrl.c + + Added TabCtrl_* WINAPI macros as functions. + + * harbour/contrib/gtwvg/tests/demowvg.prg + ! Updated to execute pure Xbase++ code in all its fury. + + Added WvgTabPage() implementation via CUI+GUI demo in + menu option. + 2009-03-06 21:56 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/rtl/dirdrive.c ! fixed ISDISK() and DISKCHANGE() return value - due to typo the diff --git a/harbour/contrib/gtwvg/Makefile b/harbour/contrib/gtwvg/Makefile index 3c7837a1be..c72b4f8988 100644 --- a/harbour/contrib/gtwvg/Makefile +++ b/harbour/contrib/gtwvg/Makefile @@ -48,6 +48,7 @@ PRG_SOURCES=\ wvgsysw.prg \ wvgdarea.prg \ wvgscrlb.prg \ + wvgtabpg.prg \ PRG_HEADERS=\ hbgtwvg.ch \ diff --git a/harbour/contrib/gtwvg/gtwvg.c b/harbour/contrib/gtwvg/gtwvg.c index b8b9a80bc0..6df5c6a481 100644 --- a/harbour/contrib/gtwvg/gtwvg.c +++ b/harbour/contrib/gtwvg/gtwvg.c @@ -2311,19 +2311,39 @@ static HWND hb_gt_wvt_CreateWindow( PHB_GTWVT pWVT, BOOL bResizable ) RECT rc; POINT pt; - GetClientRect( hWndParent, &rc ); - if( pWVT->pPP->bRowCols ) + if( pWVT->pPP->y < 0 ) { - pt.x = rc.left + ( pWVTp->PTEXTSIZE.x * pWVT->pPP->y ); - pt.y = rc.top + ( pWVTp->PTEXTSIZE.y * pWVT->pPP->x ); + GetClientRect( hWndParent, &rc ); + if( pWVT->pPP->bRowCols ) + { + pWVT->ROWS = pWVT->pPP->width; + pWVT->COLS = pWVT->pPP->height; - pWVT->ROWS = pWVT->pPP->width; - pWVT->COLS = pWVT->pPP->height; + pt.x = ( rc.right-rc.left + 1 - ( pWVT->PTEXTSIZE.x * pWVT->COLS ) ) / 2; + pt.y = ( rc.bottom-rc.top + 1 - ( pWVT->PTEXTSIZE.y * pWVT->ROWS ) ) / 2; + } + else + { + pt.x = rc.left + pWVT->pPP->x; + pt.y = rc.top + pWVT->pPP->y; + } } else { - pt.x = rc.left + pWVT->pPP->x; - pt.y = rc.top + pWVT->pPP->y; + GetClientRect( hWndParent, &rc ); + if( pWVT->pPP->bRowCols ) + { + pWVT->ROWS = pWVT->pPP->width; + pWVT->COLS = pWVT->pPP->height; + + pt.x = rc.left + ( pWVTp->PTEXTSIZE.x * pWVT->pPP->y ); + pt.y = rc.top + ( pWVTp->PTEXTSIZE.y * pWVT->pPP->x ); + } + else + { + pt.x = rc.left + pWVT->pPP->x; + pt.y = rc.top + pWVT->pPP->y; + } } ClientToScreen( hWndParent, &pt ); @@ -2332,9 +2352,6 @@ static HWND hb_gt_wvt_CreateWindow( PHB_GTWVT pWVT, BOOL bResizable ) pWVT->pPP->y = pt.y; bByConf = TRUE; - - //WS_THICKFRAME|WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX|WS_MAXIMIZEBOX; - pWVT->pPP->style = WS_POPUP|WS_CAPTION|WS_DLGFRAME; } } } diff --git a/harbour/contrib/gtwvg/tests/demowvg.prg b/harbour/contrib/gtwvg/tests/demowvg.prg index 47333a3e8e..9749995e08 100644 --- a/harbour/contrib/gtwvg/tests/demowvg.prg +++ b/harbour/contrib/gtwvg/tests/demowvg.prg @@ -504,6 +504,7 @@ FUNCTION Wvt_Paint() // needs to process messages sent through WM_SETFOCUS message // received by the window. //-------------------------------------------------------------------// +#if 0 FUNCTION Wvt_SetFocus() LOCAL nRow := row() @@ -514,11 +515,13 @@ FUNCTION Wvt_SetFocus() DevPos( nRow, nCol ) RETURN nil +#endif //-------------------------------------------------------------------// // Wvt_KillFocus() must be a FUNCTION in your application // needs to process messages sent through WM_KILLFOCUS message // received by the window. //-------------------------------------------------------------------// +#if 0 FUNCTION Wvt_KillFocus() LOCAL nRow := row() @@ -529,6 +532,7 @@ FUNCTION Wvt_KillFocus() DevPos( nRow, nCol ) RETURN nil +#endif //-------------------------------------------------------------------// // // Wvt_Mouse() must be present if you want to catch and fire @@ -2288,7 +2292,6 @@ Static Function DoModalWindow() oCrt := WvgCrt():New( , , { 4,8 }, { 12,49 }, , .T. ) oCrt:lModal := .t. - oCrt:exStyle := WS_EX_DLGMODALFRAME oCrt:resizable := .f. oCrt:closable := .f. oCrt:title := 'Information! [R:4 C:8]' @@ -3419,7 +3422,7 @@ STATIC FUNCTION ExeFontDialog( oCrt ) oFontDlg := WvgFontDialog():new( oCrt ) - oFontDlg:title := 'Select a Screen Font' + oFontDlg:title := 'Select a Screen Font!' oFontDlg:aPos := { 150,150 } oFontDlg:buttonApply := .t. oFontDlg:activateApply := {|| NIL } @@ -3454,16 +3457,18 @@ STATIC FUNCTION ExeFontDialog( oCrt ) PROCEDURE ExecGCUI() IF hb_mtvm() - Hb_ThreadStart( {|oCrt| oCrt := WvgCrt():New( , , { 2,4 }, { 20,51 }, , .t. ) , ; + Hb_ThreadStart( {|oCrt| oCrt := WvgCrt():New( , , { 2,4 }, { 20,81 }, , .t. ) , ; oCrt:create(), ; - GCUIConsole() , ; + GCUIConsole( oCrt ) , ; oCrt:destroy() } ) ENDIF RETURN //----------------------------------------------------------------------// -PROCEDURE GCUIConsole() +#xTranslate Alert( => MyAlert( + +PROCEDURE GCUIConsole( oCrt ) LOCAL dDate := ctod( "" ) LOCAL cName := Space( 35 ) LOCAL cAdd1 := Space( 35 ) @@ -3473,23 +3478,37 @@ PROCEDURE GCUIConsole() LOCAL nColGet := 8 LOCAL GetList := {} LOCAL cLabel := "VOUCH, that GROWS with you" + LOCAL oTab, oStat SetColor( "N/W,N/GR*,,,N/W*" ) CLS hb_gtInfo( HB_GTI_WINTITLE, "WVG Simplified GUI Console" ) +#if 0 + oTab := WvgTabPage():New( oCrt, , { 430, 9 }, { 210, 301 }, , .t. ) + oTab:caption := 'First' + oTab:minimized := .f. + oTab:create() + oTab:tabActivate := {|mp1,mp2,oTab| oTab:Show() } + oStat := WvgStatic():New( oTab, , { 10, 30 }, { 190, 50 }, , .t. ) + oStat:type := WVGSTATIC_TYPE_TEXT + oStat:options := WVGSTATIC_TEXT_CENTER + oStat:caption := 'This is first caption' + oStat:create() + oStat:setColorBG( RGB( 240, 255, 0 ) ) +#endif @ MaxRow(), 0 SAY PadC( "GTWVG Simplified GUI Console", maxcol()+1 ) COLOR "W+/B*" @ 2, nColGet SAY "< Date >" - @ 5, nColGet SAY "<" + PadC( "Name", 33 ) + ">" - @ 8, nColGet SAY "<" + PadC( "Address", 33) + ">" + @ 5, nColGet SAY "<" + PadC( "Name" , 33 ) + ">" + @ 8, nColGet SAY "<" + PadC( "Address", 33 ) + ">" @ 15, nColGet SAY "< Salary >" - @ 3, nColGet GET dDate - @ 6, nColGet GET cName - @ 9, nColGet GET cAdd1 - @ 11, nColGet GET cAdd2 - @ 13, nColGet GET cAdd3 + @ 3, nColGet GET dDate Valid {|| Alert( 'How did you like the "Alert" replacement?', { 'WOW','OK','OOps'} ) == 1 } + @ 6, nColGet GET cName Valid {|| oTab:hide(), .t. } + @ 9, nColGet GET cAdd1 Valid {|| oTab:show(), .t. } + @ 11, nColGet GET cAdd2 Valid {|| oTab:hide(), .t. } + @ 13, nColGet GET cAdd3 Valid {|| oTab:show(), .t. } @ 16, nColGet GET nSlry PICTURE "@Z 9999999.99" // The only additional calls to render your console GUI @@ -3512,4 +3531,28 @@ PROCEDURE GCUIConsole() READ RETURN -//-------------------------------------------------------------------// +/*----------------------------------------------------------------------*/ +#xUntranslate alert( => + +FUNCTION MyAlert( cMsg, aOpt ) + LOCAL nSel, oCrt + + oCrt := WvgCrt():New( , , { -1,-1 }, { 9, MaxCol()-4 }, , .t. ) + oCrt:lModal := .t. + oCrt:icon := "dia_excl.ico" + oCrt:create() + oCrt:resizable := .t. + + SetColor( 'N/W' ) + CLS + hb_gtInfo( HB_GTI_WINTITLE, cMsg ) + + nSel := Alert( cMsg, aOpt ) + + oCrt:destroy() + + RETURN nSel + +#xTranslate Alert( => MyAlert( +/*----------------------------------------------------------------------*/ + diff --git a/harbour/contrib/gtwvg/wincallb.c b/harbour/contrib/gtwvg/wincallb.c index 1df07c35b5..c29d66e21a 100644 --- a/harbour/contrib/gtwvg/wincallb.c +++ b/harbour/contrib/gtwvg/wincallb.c @@ -152,9 +152,7 @@ HB_FUNC( _ASCALLBACK ) else { if( ISOBJECT( 2 ) ) - { Callback.pSelf = hb_itemNew( hb_param( 2, HB_IT_OBJECT ) ); - } else Callback.pSelf = NULL; @@ -320,7 +318,6 @@ LRESULT CALLBACK GeneratedCode( formal params.... ) static LPVOID _GenerateCallback( CALLBACKDATA * pCallback ) { byte * pMem; - //int nFuncSize; PCALLBACKDATA pCallbackRecord; int iOffset; int i; @@ -337,15 +334,15 @@ static LPVOID _GenerateCallback( CALLBACKDATA * pCallback ) if ( pCallback->iFormalParams == 0 ) { - BYTE pFuncBody[] = { 0x68, 0x00, 0x00, 0x00, 0x00, // push long (constant) - 0xE8, 0x00, 0x00, 0x00, 0x00, // call function - 0x59, // pop cx - 0xC3, 0x90, 0x90, 0x90 }; // return + BYTE pFuncBody[] = { 0x68, 0x00, 0x00, 0x00, 0x00, // push long (constant) + 0xE8, 0x00, 0x00, 0x00, 0x00, // call function + 0x59, // pop cx + 0xC3, 0x90, 0x90, 0x90 }; // return // size: 15 memcpy( pMem, pFuncBody, 15 ); - _udp( pMem, 1, pCallbackRecord ) ; // update callbackdata pointer - _ucp( pMem, 6, __CallbackDispatcher, 10 ); // update code pointer + _udp( pMem, 1, pCallbackRecord ) ; // update callbackdata pointer + _ucp( pMem, 6, __CallbackDispatcher, 10 ); // update code pointer } else @@ -353,12 +350,12 @@ static LPVOID _GenerateCallback( CALLBACKDATA * pCallback ) BYTE pFuncProlog[] = { 0x55, // push bp 0x8B, 0xEC }; // mov bp,sp - BYTE pFuncEpilog[] = { 0x68, 0x00, 0x00, 0x00, 0x00, // push long (constant) - 0xE8, 0x00, 0x00, 0x00, 0x00, // call function + BYTE pFuncEpilog[] = { 0x68, 0x00, 0x00, 0x00, 0x00, // push long (constant) + 0xE8, 0x00, 0x00, 0x00, 0x00, // call function 0x83, 0xC4, 0x00, - 0x5D, // pop bp + 0x5D, // pop bp 0xC2, 0x00, 0x00, - 0x90, 0x90, 0x90 }; // size: 20 + 0x90, 0x90, 0x90 }; // size: 20 BYTE pParamData[] = { 0x8B, 0x00, 0x00, 0x00 }; @@ -459,7 +456,6 @@ static LPVOID FuncMemAlloc( void ) SYSTEM_INFO sSysInfo; // useful information about the system LPVOID lpvBase; - //LPVOID lpvResult; DWORD i,j,k,l; BOOL bFound; char * lpPage; @@ -538,7 +534,6 @@ static LPVOID FuncMemAlloc( void ) if( lpvBase == NULL ) { // error commiting mem page -//hb_ToOutDebug( "error committing memory" ); bError = TRUE; break; } @@ -584,7 +579,6 @@ static LPVOID FuncMemAlloc( void ) if( lpvBase == NULL ) { // error commiting mem page -//hb_ToOutDebug( "error reserving memory" ); bError = TRUE; break; } @@ -636,7 +630,6 @@ static void FreeCallbackRecord( PCALLBACKDATA pCallback ) static BOOL FuncMemFree( LPBYTE pMem ) { DWORD i,j,k; - //pPageData lpPage; BOOL bSuccess = FALSE; for( i = 0 ; i < dwReservedLen ; i++ ) // each reservation @@ -669,7 +662,6 @@ static BOOL FuncMemFree( LPBYTE pMem ) static void FuncMemFreeAll( void ) { DWORD i,j,k; - //pPageData lpPage; LPBYTE pMem; if( pAllAllocs != NULL ) @@ -711,4 +703,3 @@ HB_FUNC( _FREEALLCALLBACKS ) } //----------------------------------------------------------------------// - diff --git a/harbour/contrib/gtwvg/wvgcombo.prg b/harbour/contrib/gtwvg/wvgcombo.prg index 7e345bcb0e..ca6e25a1a8 100644 --- a/harbour/contrib/gtwvg/wvgcombo.prg +++ b/harbour/contrib/gtwvg/wvgcombo.prg @@ -308,21 +308,25 @@ Messages ======== CB_ADDSTRING -Adds a string to the list box of a combo box. If the combo box does not have the CBS_SORT style, -the string is added to the end of the list. Otherwise, the string is inserted into the list, -and the list is sorted. +Adds a string to the list box of a combo box. If the combo box does not have +the CBS_SORT style, the string is added to the end of the list. Otherwise, the +string is inserted into the list, and the list is sorted. CB_DELETESTRING Deletes a string in the list box of a combo box. CB_DIR -Adds names to the list displayed by the combo box. The message adds the names of directories and files that match a specified string and set of file attributes. CB_DIR can also add mapped drive letters to the list. +Adds names to the list displayed by the combo box. The message adds the names of +directories and files that match a specified string and set of file attributes. +CB_DIR can also add mapped drive letters to the list. CB_FINDSTRING -Searches the list box of a combo box for an item beginning with the characters in a specified string. +Searches the list box of a combo box for an item beginning with the characters in +a specified string. CB_FINDSTRINGEXACT -Finds the first list box string in a combo box that matches the string specified in the lParam parameter. +Finds the first list box string in a combo box that matches the string specified in +the lParam parameter. CB_GETCOMBOBOXINFO Gets information about the specified combo box. @@ -335,8 +339,8 @@ Gets the cue banner text displayed in the edit control of a combo box. Send this message explicitly or by using the ComboBox_GetCueBannerText macro. CB_GETCURSEL -An application sends a CB_GETCURSEL message to retrieve the index of the currently selected item, -if any, in the list box of a combo box. +An application sends a CB_GETCURSEL message to retrieve the index of the currently +selected item, if any, in the list box of a combo box. CB_GETDROPPEDCONTROLRECT An application sends a CB_GETDROPPEDCONTROLRECT message to retrieve the screen coordinates of a @@ -411,7 +415,8 @@ Sets the cue banner text that is displayed for the edit control of a combo box. CB_SETCURSEL An application sends a CB_SETCURSEL message to select a string in the list of a combo box. If necessary, the list scrolls the string into view. The text in the edit control of the - combo box changes to reflect the new selection, and any previous selection in the list is removed. +combo box changes to reflect the new selection, and any previous selection in the list +is removed. CB_SETDROPPEDWIDTH An application sends the CB_SETDROPPEDWIDTH message to set the maximum allowable width, diff --git a/harbour/contrib/gtwvg/wvgcrt.prg b/harbour/contrib/gtwvg/wvgcrt.prg index 7393b376c4..c5a013f9e5 100644 --- a/harbour/contrib/gtwvg/wvgcrt.prg +++ b/harbour/contrib/gtwvg/wvgcrt.prg @@ -322,7 +322,7 @@ METHOD create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) CLASS WvgCr endif if ::lModal - ::style := WS_POPUP + WS_CAPTION + ::style := WS_POPUP + WS_CAPTION + WS_SYSMENU if !( ::resizable ) //::exStyle := WS_EX_DLGMODALFRAME //::style += WS_DLGFRAME diff --git a/harbour/contrib/gtwvg/wvgparts.ch b/harbour/contrib/gtwvg/wvgparts.ch index e71b002dd9..c23a30eb2d 100644 --- a/harbour/contrib/gtwvg/wvgparts.ch +++ b/harbour/contrib/gtwvg/wvgparts.ch @@ -83,6 +83,7 @@ #define objTypeMLE 19 #define objTypeDA 20 #define objTypeScrollBar 21 +#define objTypeTabPage 22 //----------------------------------------------------------------------// // NMHDR info @@ -210,6 +211,9 @@ #define WVGSB_TOP 11 #define WVGSB_BOTTOM 12 +#define WVGTABPAGE_TAB_BOTTOM 2 +#define WVGTABPAGE_TAB_TOP 4 + #endif // #ifndef _WVG_CH //----------------------------------------------------------------------// diff --git a/harbour/contrib/gtwvg/wvgsink.c b/harbour/contrib/gtwvg/wvgsink.c index 06af3722e4..4da3d40971 100644 --- a/harbour/contrib/gtwvg/wvgsink.c +++ b/harbour/contrib/gtwvg/wvgsink.c @@ -373,10 +373,8 @@ hb_ToOutDebug( "static ULONG STDMETHODCALLTYPE Release( IEventHandler *self )->c { GlobalFree( ( MyRealIEventHandler * ) self ); } -//hb_ToOutDebug( " ULONG STDMETHODCALLTYPE Release( IEventHandler *self )->self" ); return( ( ULONG ) 0 ); } - //return( ( ULONG ) ( ( MyRealIEventHandler * ) self )->count < 0 ? ( ( MyRealIEventHandler * ) self )->count : 0 ); return( ( ULONG ) ( ( MyRealIEventHandler * ) self )->count ); } //----------------------------------------------------------------------// @@ -501,34 +499,9 @@ static HRESULT STDMETHODCALLTYPE Invoke( IEventHandler *self, DISPID dispid, REF for( i=iArg; i > 0; i-- ) { - //if( ( ( &( params->rgvarg[ iArg-i ] ) )->n1.n2.vt & VT_BYREF ) == VT_BYREF ) if( HB_IS_BYREF( pItemArray[ iArg-i ] ) ) { hb_oleItemToVariant( &( params->rgvarg[ iArg-i ] ), pItemArray[ iArg-i ] ); - - #if 0 - switch( ( &( params->rgvarg[ iArg-i ] ) )->n1.n2.vt ) - { - case VT_I2|VT_BYREF: - *( ( &( params->rgvarg[ iArg-i ] ) )->n1.n2.n3.piVal ) = ( short ) hb_itemGetNI( pItemArray[i-1] ); - break; - case VT_I4|VT_BYREF: - *( ( &( params->rgvarg[ iArg-i ] ) )->n1.n2.n3.plVal ) = ( long ) hb_itemGetNL( pItemArray[i-1] ); - break; - case VT_R4|VT_BYREF: - *( ( &( params->rgvarg[ iArg-i ] ) )->n1.n2.n3.pfltVal ) = ( float ) hb_itemGetND( pItemArray[i-1] ); - break; - case VT_R8|VT_BYREF: - *( ( &( params->rgvarg[ iArg-i ] ) )->n1.n2.n3.pdblVal ) = ( double ) hb_itemGetND( pItemArray[i-1] ); - break; - case VT_BOOL|VT_BYREF: - *( ( &( params->rgvarg[ iArg-i ] ) )->n1.n2.n3.pboolVal ) = hb_itemGetL( pItemArray[i-1] ) ? 0xFFFF : 0; - break; - case VT_DATE|VT_BYREF: - *( ( &( params->rgvarg[ iArg-i ] ) )->n1.n2.n3.pdate ) = ( DATE ) ( double ) ( hb_itemGetDL( pItemArray[i-1] )-2415019 ); - break; - } - #endif } } @@ -618,10 +591,14 @@ static HRESULT SetupConnectionPoint( device_interface* pdevice_interface, REFIID hr = m_pIConnectionPoint->lpVtbl->GetConnectionInterface( m_pIConnectionPoint, &rriid ); if ( hr == S_OK ) { - ( ( MyRealIEventHandler* ) thisobj )->device_event_interface_iid = rriid; + /************** This has to be review ******************* + PellesC was generating GPF at this point + After commenting it out, I could not see any difference in objects + I play with. Cannot say why did I retained it so long. + */ + //( ( MyRealIEventHandler* ) thisobj )->device_event_interface_iid = rriid; hr = m_pIConnectionPoint->lpVtbl->Advise( m_pIConnectionPoint, pIUnknown, &dwCookie ); - if ( hr == S_OK ) { ( ( MyRealIEventHandler* ) thisobj )->pIConnectionPoint = m_pIConnectionPoint; diff --git a/harbour/contrib/gtwvg/wvgtabpg.prg b/harbour/contrib/gtwvg/wvgtabpg.prg new file mode 100644 index 0000000000..7ae020f72a --- /dev/null +++ b/harbour/contrib/gtwvg/wvgtabpg.prg @@ -0,0 +1,548 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * Source file for the Wvg*Classes + * + * Copyright 2009 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++ xbpTabPage compatible Class +// +// Pritpal Bedi +// 01Mar2009 +// +//----------------------------------------------------------------------// +//----------------------------------------------------------------------// +//----------------------------------------------------------------------// + +#include 'hbclass.ch' +#include 'common.ch' +#include 'inkey.ch' +#include 'hbgtinfo.ch' + +#include 'hbgtwvg.ch' +#include 'wvtwin.ch' +#include 'wvgparts.ch' + +//----------------------------------------------------------------------// + +#ifndef __DBG_PARTS__ +#xtranslate hb_ToOutDebug( [] ) => +#endif + +/*----------------------------------------------------------------------*/ + +CLASS WvgTabPage INHERIT WvgWindow + + + DATA caption INIT NIL // Character string, Numeric, Object ("") + DATA clipChildren INIT .T. // Determines whether Xbase Parts in the child list are clipped during graphic output. + DATA minimized INIT .T. // Determines whether the XbpTabPage is minimized after it is created (the page is not visible). + DATA postOffset INIT 80 // Determines the distance between the end of the tab and the end of the page as a percentage of the page width. + DATA preOffset INIT 0 // Determines the distance between the start of the tab and the start of the page as a percentage of the page width. + DATA tabHeight INIT -1 // Determines the height of the tab. + DATA type INIT WVGTABPAGE_TAB_TOP // Determines the position of the tab. + + METHOD new() + METHOD create() + METHOD configure() + METHOD destroy() + + METHOD Minimize() + METHOD Maximize() + + DATA sl_tabActivate + METHOD tabActivate() SETGET + + METHOD handleEvent() + ENDCLASS +//----------------------------------------------------------------------// + +METHOD new( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) CLASS WvgTabPage + + ::WvgWindow:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) + + ::style := WS_CHILD + ::className := "SysTabControl32" + ::objType := objTypeTabPage + + RETURN Self + +//----------------------------------------------------------------------// + +METHOD create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) CLASS WvgTabPage + + ::WvgWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) + + IF ::type == WVGTABPAGE_TAB_BOTTOM + ::style += TCS_BOTTOM + ENDIF + IF ::clipSiblings + ::style += WS_CLIPSIBLINGS + ENDIF + //::style += WS_DLGFRAME + + ::style += TCS_FOCUSNEVER + + ::oParent:AddChild( SELF ) + + ::createControl() + + ::SetWindowProcCallback() + + DEFAULT ::caption TO " " + + WAPI_TabCtrl_InsertItem( ::hWnd, 0, ::caption ) + + IF ::visible + ::show() + ENDIF + + IF ::minimized + ::hide()//minimize() + ENDIF + + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD handleEvent( nMessage, aNM ) CLASS WvgTabPage + LOCAL aHdr + + hb_ToOutDebug( " %s:handleEvent( %i )", __ObjGetClsName( self ), nMessage ) + + DO CASE + + CASE nMessage == HB_GTE_SETFOCUS + IF hb_isBlock( ::sl_tabActivate ) + + RETURN( EVENT_HANDELLED ) + ENDIF + + CASE nMessage == HB_GTE_COMMAND + + + CASE nMessage == HB_GTE_RESIZED + ::sendMessage( WM_SIZE, 0, 0 ) + RETURN( EVENT_HANDELLED ) + + CASE nMessage == HB_GTE_NOTIFY + aHdr := Wvg_GetNMHdrInfo( aNM[ 2 ] ) +//hb_ToOutDebug( 'HB_GTE_NOTIFY %i %i %i', aHdr[ NMH_code ], NM_CLICK, NM_DBLCLK ) + DO CASE + CASE aHdr[ NMH_code ] == -551 //TCN_SELCHANGE +//hb_ToOutDebug( 'TCN_SELCHANGE' ) + ENDCASE + + CASE nMessage == HB_GTE_CTLCOLOR + RETURN Win_GetStockObject( NULL_BRUSH ) + + ENDCASE + + RETURN( EVENT_UNHANDELLED ) + +//----------------------------------------------------------------------// + +METHOD tabActivate( xParam ) CLASS WvgTabPage + + IF hb_isBlock( xParam ) + ::sl_tabActivate := xParam + ENDIF + + RETURN self + +/*----------------------------------------------------------------------*/ + +METHOD minimize() CLASS WvgTabPage + + ::hide() + + RETURN .f. + +/*----------------------------------------------------------------------*/ + +METHOD maximize() CLASS WvgTabPage + + ::show() + + RETURN .t. + +//----------------------------------------------------------------------// + +METHOD configure( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) CLASS WvgTabPage + + ::Initialize( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) + + RETURN Self + +//----------------------------------------------------------------------// + +METHOD destroy() CLASS WvgTabPage + + ::wvgWindow:destroy() + + RETURN NIL + +//----------------------------------------------------------------------// +// MSDN on TabPage Control +//----------------------------------------------------------------------// +#if 0 + +Tab +This section contains information about the programming elements used with tab controls. + + +Overviews +About Tab Controls +A tab control is analogous to the dividers in a notebook or the labels in a file cabinet. By using a tab control, an application can define multiple pages for the same area of a window or dialog box. + +Using Tab Controls +This topic contains two examples that use tab controls. + + + +Macros +TabCtrl_AdjustRect +Calculates a tab control s display area given a window rectangle, or calculates the window rectangle that would correspond to a specified display area. You can use this macro or send the TCM_ADJUSTRECT message explicitly. + +TabCtrl_DeleteAllItems +Removes all items from a tab control. You can use this macro or send the TCM_DELETEALLITEMS message explicitly. + +TabCtrl_DeleteItem +Removes an item from a tab control. You can use this macro or send the TCM_DELETEITEM message explicitly. + +TabCtrl_DeselectAll +Resets items in a tab control, clearing any that were set to the TCIS_BUTTONPRESSED state. You can use this macro or send the TCM_DESELECTALL message explicitly. + +TabCtrl_GetCurFocus +Returns the index of the item that has the focus in a tab control. You can use this macro or send the TCM_GETCURFOCUS message explicitly. + +TabCtrl_GetCurSel +Determines the currently selected tab in a tab control. You can use this macro or send the TCM_GETCURSEL message explicitly. + +TabCtrl_GetExtendedStyle +Retrieves the extended styles that are currently in use for the tab control. You can use this macro or send the TCM_GETEXTENDEDSTYLE message explicitly. + +TabCtrl_GetImageList +Retrieves the image list associated with a tab control. You can use this macro or send the TCM_GETIMAGELIST message explicitly. + +TabCtrl_GetItem +Retrieves information about a tab in a tab control. You can use this macro or send the TCM_GETITEM message explicitly. + +TabCtrl_GetItemCount +Retrieves the number of tabs in the tab control. You can use this macro or send the TCM_GETITEMCOUNT message explicitly. + +TabCtrl_GetItemRect +Retrieves the bounding rectangle for a tab in a tab control. You can use this macro or send the TCM_GETITEMRECT message explicitly. + +TabCtrl_GetRowCount +Retrieves the current number of rows of tabs in a tab control. You can use this macro or send the TCM_GETROWCOUNT message explicitly. + +TabCtrl_GetToolTips +Retrieves the handle to the ToolTip control associated with a tab control. You can use this macro or send the TCM_GETTOOLTIPS message explicitly. + +TabCtrl_GetUnicodeFormat +Retrieves the UNICODE character format flag for the control. You can use this macro or send the TCM_GETUNICODEFORMAT message explicitly. + +TabCtrl_HighlightItem +Sets the highlight state of a tab item. You can use this macro or send the TCM_HIGHLIGHTITEM message explicitly. + +TabCtrl_HitTest +Determines which tab, if any, is at a specified screen position. You can use this macro or send the TCM_HITTEST message explicitly. + +TabCtrl_InsertItem +Inserts a new tab in a tab control. You can use this macro or send the TCM_INSERTITEM message explicitly. + +TabCtrl_RemoveImage +Removes an image from a tab control s image list. You can use this macro or send the TCM_REMOVEIMAGE message explicitly. + +TabCtrl_SetCurFocus +Sets the focus to a specified tab in a tab control. You can use this macro or send the TCM_SETCURFOCUS message explicitly. + +TabCtrl_SetCurSel +Selects a tab in a tab control. You can use this macro or send the TCM_SETCURSEL message explicitly. + +TabCtrl_SetExtendedStyle +Sets the extended styles that the tab control will use. You can use this macro or send the TCM_SETEXTENDEDSTYLE message explicitly. + +TabCtrl_SetImageList +Assigns an image list to a tab control. You can use this macro or send the TCM_SETIMAGELIST message explicitly. + +TabCtrl_SetItem +Sets some or all of a tab s attributes. You can use this macro or send the TCM_SETITEM message explicitly. + +TabCtrl_SetItemExtra +Sets the number of bytes per tab reserved for application-defined data in a tab control. You can use this macro or send the TCM_SETITEMEXTRA message explicitly. + +TabCtrl_SetItemSize +Sets the width and height of tabs in a fixed-width or owner-drawn tab control. You can use this macro or send the TCM_SETITEMSIZE message explicitly. + +TabCtrl_SetMinTabWidth +Sets the minimum width of items in a tab control. You can use this macro or send the TCM_SETMINTABWIDTH message explicitly. + +TabCtrl_SetPadding +Sets the amount of space (padding) around each tab s icon and label in a tab control. You can use this macro or send the TCM_SETPADDING message explicitly. + +TabCtrl_SetToolTips +Assigns a ToolTip control to a tab control. You can use this macro or send the TCM_SETTOOLTIPS message explicitly. + +TabCtrl_SetUnicodeFormat +Sets the Unicode character format flag for the control. This message allows you to change the character set used by the control at run time rather than having to re-create the control. You can use this macro or send the TCM_SETUNICODEFORMAT message explicitly. + + + +Messages +TCM_ADJUSTRECT +Calculates a tab control s display area given a window rectangle, or calculates the window rectangle that would correspond to a specified display area. You can send this message explicitly or by using the TabCtrl_AdjustRect macro. + +TCM_DELETEALLITEMS +Removes all items from a tab control. You can send this message explicitly or by using the TabCtrl_DeleteAllItems macro. + +TCM_DELETEITEM +Removes an item from a tab control. You can send this message explicitly or by using the TabCtrl_DeleteItem macro. + +TCM_DESELECTALL +Resets items in a tab control, clearing any that were set to the TCIS_BUTTONPRESSED state. You can send this message explicitly or by using the TabCtrl_DeselectAll macro. + +TCM_GETCURFOCUS +Returns the index of the item that has the focus in a tab control. You can send this message explicitly or by using the TabCtrl_GetCurFocus macro. + +TCM_GETCURSEL +Determines the currently selected tab in a tab control. You can send this message explicitly or by using the TabCtrl_GetCurSel macro. + +TCM_GETEXTENDEDSTYLE +Retrieves the extended styles that are currently in use for the tab control. You can send this message explicitly or by using the TabCtrl_GetExtendedStyle macro. + +TCM_GETIMAGELIST +Retrieves the image list associated with a tab control. You can send this message explicitly or by using the TabCtrl_GetImageList macro. + +TCM_GETITEM +Retrieves information about a tab in a tab control. You can send this message explicitly or by using the TabCtrl_GetItem macro. + +TCM_GETITEMCOUNT +Retrieves the number of tabs in the tab control. You can send this message explicitly or by using the TabCtrl_GetItemCount macro. + +TCM_GETITEMRECT +Retrieves the bounding rectangle for a tab in a tab control. You can send this message explicitly or by using the TabCtrl_GetItemRect macro. + +TCM_GETROWCOUNT +Retrieves the current number of rows of tabs in a tab control. You can send this message explicitly or by using the TabCtrl_GetRowCount macro. + +TCM_GETTOOLTIPS +Retrieves the handle to the ToolTip control associated with a tab control. You can send this message explicitly or by using the TabCtrl_GetToolTips macro. + +TCM_GETUNICODEFORMAT +Retrieves the Unicode character format flag for the control. You can send this message explicitly or use the TabCtrl_GetUnicodeFormat macro. + +TCM_HIGHLIGHTITEM +Sets the highlight state of a tab item. You can send this message explicitly or by using the TabCtrl_HighlightItem macro. + +TCM_HITTEST +Determines which tab, if any, is at a specified screen position. You can send this message explicitly or by using the TabCtrl_HitTest macro. + +TCM_INSERTITEM +Inserts a new tab in a tab control. You can send this message explicitly or by using the TabCtrl_InsertItem macro. + +TCM_REMOVEIMAGE +Removes an image from a tab control s image list. You can send this message explicitly or by using the TabCtrl_RemoveImage macro. + +TCM_SETCURFOCUS +Sets the focus to a specified tab in a tab control. You can send this message explicitly or by using the TabCtrl_SetCurFocus macro. + +TCM_SETCURSEL +Selects a tab in a tab control. You can send this message explicitly or by using the TabCtrl_SetCurSel macro. + +TCM_SETEXTENDEDSTYLE +Sets the extended styles that the tab control will use. You can send this message explicitly or by using the TabCtrl_SetExtendedStyle macro. + +TCM_SETIMAGELIST +Assigns an image list to a tab control. You can send this message explicitly or by using the TabCtrl_SetImageList macro. + +TCM_SETITEM +Sets some or all of a tab s attributes. You can send this message explicitly or by using the TabCtrl_SetItem macro. + +TCM_SETITEMEXTRA +Sets the number of bytes per tab reserved for application-defined data in a tab control. You can send this message explicitly or by using the TabCtrl_SetItemExtra macro. + +TCM_SETITEMSIZE +Sets the width and height of tabs in a fixed-width or owner-drawn tab control. You can send this message explicitly or by using the TabCtrl_SetItemSize macro. + +TCM_SETMINTABWIDTH +Sets the minimum width of items in a tab control. You can send this message explicitly or by using the TabCtrl_SetMinTabWidth macro. + +TCM_SETPADDING +Sets the amount of space (padding) around each tab s icon and label in a tab control. You can send this message explicitly or by using the TabCtrl_SetPadding macro. + +TCM_SETTOOLTIPS +Assigns a ToolTip control to a tab control. You can send this message explicitly or by using the TabCtrl_SetToolTips macro. + +TCM_SETUNICODEFORMAT +Sets the Unicode character format flag for the control. This message allows you to change the character set used by the control at run time rather than having to re-create the control. You can send this message explicitly or use the TabCtrl_SetUnicodeFormat macro. + + + +Notifications +NM_CLICK (tab) +Notifies the parent window of a tab control that the user has clicked the left mouse button within the control. NM_CLICK (tab) is sent in the form of a WM_NOTIFY message. + +NM_DBLCLK (tab) +Notifies a parent window of a tab control that the user has double-clicked the left mouse button within the control. This notification is sent in the form of a WM_NOTIFY message. + +NM_RCLICK (tab) +Notifies the parent window of a tab control that the user has clicked the right mouse button within the control. NM_RCLICK (tab) is sent in the form of a WM_NOTIFY message. + +NM_RDBLCLK (tab) +Notifies the parent window of a tab control that the user has double-clicked the right mouse button within the control. NM_RDBLCLK (tab) is sent in the form of a WM_NOTIFY message. + +NM_RELEASEDCAPTURE (tab) +Notifies a tab control s parent window that the control is releasing mouse capture. This notification is sent in the form of a WM_NOTIFY message. + +TCN_FOCUSCHANGE +Notifies a tab control s parent window that the button focus has changed. + +TCN_GETOBJECT +Sent by a tab control when it has the TCS_EX_REGISTERDROP extended style and an object is dragged over a tab item in the control. This notification message is sent in the form of a WM_NOTIFY message. + +TCN_KEYDOWN +Notifies a tab control s parent window that a key has been pressed. This message is sent in the form of a WM_NOTIFY message. + +TCN_SELCHANGE +Notifies a tab control s parent window that the currently selected tab has changed. This message is sent in the form of a WM_NOTIFY message. + +TCN_SELCHANGING +Notifies a tab control s parent window that the currently selected tab is about to change. This message is sent in the form of a WM_NOTIFY message. + + + +Structures +NMTCKEYDOWN +Contains information about a key press in a tab control. It is used with the TCN_KEYDOWN notification message. This structure supersedes the TC_KEYDOWN structure. + +TCHITTESTINFO +Contains information about a hit test. This structure supersedes the TC_HITTESTINFO structure. + +TCITEM +Specifies or receives the attributes of a tab item. It is used with the TCM_INSERTITEM, TCM_GETITEM, and TCM_SETITEM messages. This structure supersedes the TC_ITEM structure. + +TCITEMHEADER +Specifies or receives the attributes of a tab. It is used with the TCM_INSERTITEM, TCM_GETITEM, and TCM_SETITEM messages. This structure supersedes the TC_ITEMHEADER structure. + + + +Constants +Tab Control Extended Styles +The tab control now supports extended styles. These styles are manipulated using the TCM_GETEXTENDEDSTYLE and TCM_SETEXTENDEDSTYLE messages and should not be confused with extended window styles that are passed to CreateWindowEx. + +Tab Control Item States +Tab control items now support an item state to support the TCM_DESELECTALL message. Additionally, the TCITEM structure supports item state values. + +Tab Control Styles +This section lists supported tab control styles. + +TCS_BOTTOM +Version 4.70. Tabs appear at the bottom of the control. This value equals TCS_RIGHT. This style is not supported if you use ComCtl32.dll version 6. +TCS_BUTTONS +Tabs appear as buttons, and no border is drawn around the display area. +TCS_FIXEDWIDTH +All tabs are the same width. This style cannot be combined with the TCS_RIGHTJUSTIFY style. +TCS_FLATBUTTONS +Version 4.71. Selected tabs appear as being indented into the background while other tabs appear as being on the same plane as the background. This style only affects tab controls with the TCS_BUTTONS style. +TCS_FOCUSNEVER +The tab control does not receive the input focus when clicked. +TCS_FOCUSONBUTTONDOWN +The tab control receives the input focus when clicked. +TCS_FORCEICONLEFT +Icons are aligned with the left edge of each fixed-width tab. This style can only be used with the TCS_FIXEDWIDTH style. +TCS_FORCELABELLEFT +Labels are aligned with the left edge of each fixed-width tab; that is, the label is displayed immediately to the right of the icon instead of being centered. This style can only be used with the TCS_FIXEDWIDTH style, and it implies the TCS_FORCEICONLEFT style. +TCS_HOTTRACK +Version 4.70. Items under the pointer are automatically highlighted. You can check whether or not hot tracking is enabled by calling SystemParametersInfo. +TCS_MULTILINE +Multiple rows of tabs are displayed, if necessary, so all tabs are visible at once. +TCS_MULTISELECT +Version 4.70. Multiple tabs can be selected by holding down the CTRL key when clicking. This style must be used with the TCS_BUTTONS style. +TCS_OWNERDRAWFIXED +The parent window is responsible for drawing tabs. +TCS_RAGGEDRIGHT +Rows of tabs will not be stretched to fill the entire width of the control. This style is the default. +TCS_RIGHT +Version 4.70. Tabs appear vertically on the right side of controls that use the TCS_VERTICAL style. This value equals TCS_BOTTOM. This style is not supported if you use visual styles. +TCS_RIGHTJUSTIFY +The width of each tab is increased, if necessary, so that each row of tabs fills the entire width of the tab control. This window style is ignored unless the TCS_MULTILINE style is also specified. +TCS_SCROLLOPPOSITE +Version 4.70. Unneeded tabs scroll to the opposite side of the control when a tab is selected. +TCS_SINGLELINE +Only one row of tabs is displayed. The user can scroll to see more tabs, if necessary. This style is the default. +TCS_TABS +Tabs appear as tabs, and a border is drawn around the display area. This style is the default. +TCS_TOOLTIPS +The tab control has a ToolTip control associated with it. +TCS_VERTICAL +Version 4.70. Tabs appear at the left side of the control, with tab text displayed vertically. This style is valid only when used with the TCS_MULTILINE style. To make tabs appear on the right side of the control, also use the TCS_RIGHT style. This style is not supported if you use ComCtl32.dll version 6. +Remarks + +The following styles can be modified after the control is created. + +TCS_BOTTOM +TCS_BUTTONS +TCS_FIXEDWIDTH +TCS_FLATBUTTONS +TCS_FORCEICONLEFT +TCS_FORCELABELLEFT +TCS_MULTILINE +TCS_OWNERDRAWFIXED +TCS_RAGGEDRIGHT +TCS_RIGHT +TCS_VERTICAL + +#endif \ No newline at end of file diff --git a/harbour/contrib/gtwvg/wvgwin.c b/harbour/contrib/gtwvg/wvgwin.c index 2f96bba401..ddd0bfb1d0 100644 --- a/harbour/contrib/gtwvg/wvgwin.c +++ b/harbour/contrib/gtwvg/wvgwin.c @@ -1799,8 +1799,8 @@ HB_FUNC( WIN_SETWINDOWPOSTOBACK ) HB_FUNC( WIN_SETWINDOWPOSTOTOP ) { - hb_retl( SetWindowPos( wvg_parhwnd( 1 ), ( HWND ) HWND_BOTTOM, 0, 0, 0, 0 , - SWP_NOSIZE | SWP_NOMOVE ) ); + hb_retl( SetWindowPos( wvg_parhwnd( 1 ), ( HWND ) HWND_TOP, 0, 0, 0, 0 , + SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE ) ); } //----------------------------------------------------------------------// @@ -2669,159 +2669,6 @@ HB_FUNC( WVG_BEGINMOUSETRACKING ) /*----------------------------------------------------------------------*/ -#include "hbapi.h" -#include "hbapiitm.h" -#include "hbapierr.h" -#include "hbstack.h" - -#define HB_MEMSTRU_OSVERSIONINFO 1000001 -#define HB_MEMSTRU_LOGFONT 1000002 - -#define HB_ERR_MEMSTRU_NOT_MEM_BLOCK 4001 -#define HB_ERR_MEMSTRU_WRONG_MEMSTRU_BLOCK 4002 -#define HB_ERR_MEMSTRU_DESTROYED 4003 - -HB_EXTERN_BEGIN - -extern PHB_ITEM hb_memstru_itemPut( PHB_ITEM pItem, void * pMemAddr, int iType ); -extern void * hb_memstru_itemGet( PHB_ITEM pItem, int iType, BOOL fError ); -extern void hb_memstru_ret( void * pMemAddr, int iType ); -extern void * hb_memstru_param( int iParam, int iType, BOOL fError ); - -HB_EXTERN_END - -typedef struct -{ - int type; - void * mem; -} -HB_MEMSTRU_HOLDER, * PHB_MEMSTRU_HOLDER; - -static HB_GARBAGE_FUNC( hb_memstru_destructor ) -{ - PHB_MEMSTRU_HOLDER pStructHolder = ( PHB_MEMSTRU_HOLDER ) Cargo; - - if( pStructHolder->mem ) - { - hb_xfree( pStructHolder->mem ); - pStructHolder->mem = NULL; - } -} - -PHB_ITEM hb_memstru_itemPut( PHB_ITEM pItem, void * pMemAddr, int iType ) -{ - PHB_MEMSTRU_HOLDER pStructHolder; - - if( pItem ) - { - if( HB_IS_COMPLEX( pItem ) ) - hb_itemClear( pItem ); - } - else - pItem = hb_itemNew( pItem ); - - pStructHolder = ( PHB_MEMSTRU_HOLDER ) - hb_gcAlloc( sizeof( HB_MEMSTRU_HOLDER ), hb_memstru_destructor ); - pStructHolder->mem = pMemAddr; - pStructHolder->type = iType; - - return hb_itemPutPtrGC( pItem, pStructHolder ); -} - -void * hb_memstru_itemGet( PHB_ITEM pItem, int iType, BOOL fError ) -{ - PHB_MEMSTRU_HOLDER pStructHolder = ( PHB_MEMSTRU_HOLDER ) - hb_itemGetPtrGC( pItem, hb_memstru_destructor ); - int iError; - - if( !pStructHolder ) - iError = HB_ERR_MEMSTRU_NOT_MEM_BLOCK; - else if( pStructHolder->type != iType ) - iError = HB_ERR_MEMSTRU_WRONG_MEMSTRU_BLOCK; - else if( !pStructHolder->mem ) - iError = HB_ERR_MEMSTRU_DESTROYED; - else - return pStructHolder->mem; - - if( fError ) - hb_errRT_BASE_SubstR( EG_ARG, iError, NULL, - HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); - - return NULL; -} - -void hb_memstru_ret( void * pMemAddr, int iType ) -{ - hb_memstru_itemPut( hb_stackReturnItem(), pMemAddr, iType ); -} - -void * hb_memstru_param( int iParam, int iType, BOOL fError ) -{ - return hb_memstru_itemGet( hb_param( iParam, HB_IT_POINTER ), iType, fError ); -} - -BOOL hb_memstru_store( void * pMemAddr, int iType, int iParam ) -{ - PHB_ITEM pItem = hb_param( iParam, HB_IT_BYREF ); - if( !pItem ) - return FALSE; - - hb_memstru_itemPut( pItem, pMemAddr, iType ); - return TRUE; -} - - -HB_FUNC( WAPI_STRUCT_OSVERSIONINFO ) -{ - OSVERSIONINFO * osvi; - - osvi = ( OSVERSIONINFO * ) memset( hb_xgrab( sizeof( OSVERSIONINFO ) ), - 0, sizeof( OSVERSIONINFO ) ); - osvi->dwOSVersionInfoSize = sizeof( OSVERSIONINFO ); - - hb_memstru_ret( osvi, HB_MEMSTRU_OSVERSIONINFO ); -} - -HB_FUNC( WAPI_GETVERSIONEX ) -{ - OSVERSIONINFO * osvi; - - osvi = ( OSVERSIONINFO * ) - hb_memstru_param( 1, HB_MEMSTRU_OSVERSIONINFO, TRUE ); - - if( osvi ) - hb_retl( GetVersionEx( osvi ) ); -} - - -HB_FUNC( WAPI_MEMBER_OSVERSIONINFO ) -{ - OSVERSIONINFO * osvi; - const char * szMember; - - osvi = ( OSVERSIONINFO * ) - hb_memstru_param( 1, HB_MEMSTRU_OSVERSIONINFO, TRUE ); - szMember = hb_parc( 2 ); - if( osvi && szMember ) - { - if( !strcmp( szMember, "dwMajorVersion" ) ) - hb_retnint( osvi->dwMajorVersion ); - else if( !strcmp( szMember, "dwMinorVersion" ) ) - hb_retnint( osvi->dwMinorVersion ); - else if( !strcmp( szMember, "dwBuildNumber" ) ) - hb_retnint( osvi->dwBuildNumber ); - else if( !strcmp( szMember, "dwPlatformId" ) ) - hb_retnint( osvi->dwPlatformId ); - else if( !strcmp( szMember, "szCSDVersion" ) ) - ;//wapi_rettstr( osvi->dwPlatformId ); - else - { - /* NIL for unknown members or RT error */ - } - } -} -/*----------------------------------------------------------------------*/ - LRESULT CALLBACK ControlWindowProcedure( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ) { PHB_ITEM pBlock = ( PHB_ITEM ) GetProp( hwnd, TEXT( "BLOCKCALLBACK" ) ); diff --git a/harbour/contrib/gtwvg/wvgwnd.prg b/harbour/contrib/gtwvg/wvgwnd.prg index 9e53d24c12..483bb7b81c 100644 --- a/harbour/contrib/gtwvg/wvgwnd.prg +++ b/harbour/contrib/gtwvg/wvgwnd.prg @@ -74,10 +74,17 @@ #include 'wvtwin.ch' #include 'wvgparts.ch' -//----------------------------------------------------------------------// +/*----------------------------------------------------------------------*/ +// To Switch Over from ASCALLBACK() to SET/GET_Prop() calls +// +#if 0 + #define __BYASCALLBACK__ +#else + #define __BYSETPROP__ +#endif #ifndef __DBG_PARTS__ -#xtranslate hb_ToOutDebug( [] ) => + #xtranslate hb_ToOutDebug( [] ) => #endif //----------------------------------------------------------------------// @@ -345,7 +352,9 @@ METHOD destroy() CLASS WvgWindow ::aChildren := {} ENDIF + #ifdef __BYSETPROP__ WVG_ReleaseWindowProcBlock( ::hWnd ) + #endif IF Win_IsWindow( ::hWnd ) Win_DestroyWindow( ::hWnd ) @@ -365,6 +374,20 @@ METHOD destroy() CLASS WvgWindow //----------------------------------------------------------------------// +METHOD SetWindowProcCallback() CLASS WvgWindow + + #ifdef __BYASCALLBACK__ + ::nWndProc := hb_AsCallBack( 'CONTROLWNDPROC', Self ) + ::nOldProc := Win_SetWndProc( ::hWnd, ::nWndProc ) + #endif + + #ifdef __BYSETPROP__ + ::nOldProc := WVG_SetWindowProcBlock( ::hWnd, {|h,m,w,l| ::ControlWndProc( h,m,w,l ) } ) + #endif + + RETURN Self + +/*----------------------------------------------------------------------*/ METHOD captureMouse() CLASS WvgWindow RETURN Self @@ -565,8 +588,8 @@ METHOD toBack() CLASS WvgWindow METHOD toFront() CLASS WvgWindow - RETURN Win_SetForegroundWindow( ::hWnd ) - //RETURN Win_SetWindowPosToTop( ::hWnd ) + //RETURN Win_SetForegroundWindow( ::hWnd ) + RETURN Win_SetWindowPosToTop( ::hWnd ) //----------------------------------------------------------------------// @@ -1361,24 +1384,6 @@ METHOD ControlWndProc( hWnd, nMessage, nwParam, nlParam ) CLASS WvgWindow //----------------------------------------------------------------------// -METHOD SetWindowProcCallback() CLASS WvgWindow - LOCAL bBlock := {|h,m,w,l| ::ControlWndProc( h,m,w,l ) } - - #ifdef __BYASCALLBACK__ - ::nWndProc := hb_AsCallBack( 'CONTROLWNDPROC', Self ) - ::nOldProc := Win_SetWndProc( ::hWnd, ::nWndProc ) - #else - //LOCAL pBlock - //pBlock := Wvg_GetWndProcPointer( bBlock ) - //::nOldProc := WVG_SetWindowProcBlock( ::hWnd, pBlock ) - - ::nOldProc := WVG_SetWindowProcBlock( ::hWnd, bBlock ) - #endif - - RETURN Self - -/*----------------------------------------------------------------------*/ - #if 0 FUNCTION hb_toOut( ... ) RETURN hb_ToOutDebug( ... ) diff --git a/harbour/contrib/gtwvg/wvtwin.ch b/harbour/contrib/gtwvg/wvtwin.ch index ceda34a9b5..f47da19633 100644 --- a/harbour/contrib/gtwvg/wvtwin.ch +++ b/harbour/contrib/gtwvg/wvtwin.ch @@ -1636,6 +1636,31 @@ #define ILC_MASK 1 #define ILC_PALETTE 2048 +/*----------------------------------------------------------------------*/ +// Tab Pages +/*----------------------------------------------------------------------*/ + +#define TCS_SCROLLOPPOSITE 0x0001 // assumes multiline tab +#define TCS_BOTTOM 0x0002 +#define TCS_RIGHT 0x0002 +#define TCS_MULTISELECT 0x0004 // allow multi-select in button mode +#define TCS_FLATBUTTONS 0x0008 +#define TCS_FORCEICONLEFT 0x0010 +#define TCS_FORCELABELLEFT 0x0020 +#define TCS_HOTTRACK 0x0040 +#define TCS_VERTICAL 0x0080 +#define TCS_TABS 0x0000 +#define TCS_BUTTONS 0x0100 +#define TCS_SINGLELINE 0x0000 +#define TCS_MULTILINE 0x0200 +#define TCS_RIGHTJUSTIFY 0x0000 +#define TCS_FIXEDWIDTH 0x0400 +#define TCS_RAGGEDRIGHT 0x0800 +#define TCS_FOCUSONBUTTONDOWN 0x1000 +#define TCS_OWNERDRAWFIXED 0x2000 +#define TCS_TOOLTIPS 0x4000 +#define TCS_FOCUSNEVER 0x8000 + //----------------------------------------------------------------------// #endif //----------------------------------------------------------------------// diff --git a/harbour/contrib/hbwin/hbwapi.h b/harbour/contrib/hbwin/hbwapi.h index 0accce9c01..c9282d6fa9 100644 --- a/harbour/contrib/hbwin/hbwapi.h +++ b/harbour/contrib/hbwin/hbwapi.h @@ -74,6 +74,8 @@ #define wapi_par_INT( n ) ( hb_parni( n ) ) #define wapi_par_UINT( n ) ( ( UINT ) hb_parni( n ) ) #define wapi_par_LONG( n ) ( ( LONG ) hb_parnl( n ) ) +#define wapi_par_WORD( n ) ( ( LONG ) hb_parnl( n ) ) +#define wapi_par_DWORD( n ) ( ( LONG ) hb_parnl( n ) ) #define wapi_ret_NINT( i ) ( hb_retnint( i ) ) #define wapi_ret_NI( i ) ( hb_retni( i ) ) diff --git a/harbour/contrib/hbwin/wapi_commctrl.c b/harbour/contrib/hbwin/wapi_commctrl.c index 79d0b03729..69c2195a61 100644 --- a/harbour/contrib/hbwin/wapi_commctrl.c +++ b/harbour/contrib/hbwin/wapi_commctrl.c @@ -51,6 +51,7 @@ #define HB_OS_WIN_USED #include "hbapi.h" +#include "hbapiitm.h" #include "hbwapi.h" #include @@ -461,3 +462,329 @@ HB_FUNC( WAPI_IMAGELIST_WRITEEX ) /*----------------------------------------------------------------------// // END - ImageList_* - API //----------------------------------------------------------------------*/ + + +/*----------------------------------------------------------------------// + Tab Control Macros +//----------------------------------------------------------------------*/ +// Wapi_TabCtrl_InsertItem( hWndTab, nInsertPos, cText, iImageListIndex ) + +HB_FUNC( WAPI_TABCTRL_INSERTITEM ) +{ + TC_ITEM item; + LPTSTR szText = HB_TCHAR_CONVTO( hb_parc( 3 ) ); + + item.mask = TCIF_TEXT | TCIF_IMAGE; + item.iImage = ISNIL( 4 ) ? -1 : wapi_par_INT( 4 ); + item.pszText = szText; + + wapi_ret_NI( TabCtrl_InsertItem( wapi_par_HWND( 1 ), wapi_par_INT( 3 ), &item ) ); + + HB_TCHAR_FREE( szText ); +} +/*----------------------------------------------------------------------*/ + +HB_FUNC( WAPI_TABCTRL_SETCURSEL ) +{ + wapi_ret_NI( TabCtrl_SetCurSel( wapi_par_HWND( 1 ) , hb_parni (2) ) ); +} +/*----------------------------------------------------------------------*/ + +HB_FUNC( WAPI_TABCTRL_GETCURSEL ) +{ + wapi_ret_NI( TabCtrl_GetCurSel( wapi_par_HWND( 1 ) ) ) ; +} +/*----------------------------------------------------------------------*/ + +HB_FUNC( WAPI_TABCTRL_GETITEM ) +{ + TC_ITEM item; + hb_retl( TabCtrl_GetItem( wapi_par_HWND( 1 ), wapi_par_INT( 2 ), &item ) ); + + // assign item to param 3 +} +/*----------------------------------------------------------------------*/ + +HB_FUNC( WAPI_TABCTRL_GETITEMCOUNT ) +{ + wapi_ret_NI( TabCtrl_GetItemCount( wapi_par_HWND( 1 ) ) ) ; +} +/*----------------------------------------------------------------------*/ + +HB_FUNC( WAPI_TABCTRL_GETITEMRECT ) +{ + RECT rc; + PHB_ITEM aRect = hb_itemArrayNew( 4 ); + PHB_ITEM temp; + + TabCtrl_GetItemRect( wapi_par_HWND( 1 ), wapi_par_INT( 2 ), &rc ); + + temp = hb_itemPutNL( NULL, rc.left ); + hb_arraySet( aRect, 1, temp ); + hb_itemRelease( temp ); + + temp = hb_itemPutNL( NULL, rc.top ); + hb_arraySet( aRect, 2, temp ); + hb_itemRelease( temp ); + + temp = hb_itemPutNL( NULL, rc.right ); + hb_arraySet( aRect, 3, temp ); + hb_itemRelease( temp ); + + temp = hb_itemPutNL( NULL, rc.bottom ); + hb_arraySet( aRect, 4, temp ); + hb_itemRelease( temp ); + + hb_itemReturnRelease( aRect ); +} +/*----------------------------------------------------------------------*/ + +HB_FUNC( WAPI_TABCTRL_GETROWCOUNT ) +{ + wapi_ret_NI( TabCtrl_GetRowCount( wapi_par_HWND( 1 ) ) ) ; +} +/*----------------------------------------------------------------------*/ +// TabCtrl_GetImageList(hwnd) +// (HIMAGELIST)SNDMSG((hwnd), TCM_GETIMAGELIST, 0, 0L) + +HB_FUNC( WAPI_TABCTRL_GETIMAGELIST ) +{ + wapi_ret_NINT( ( LONG ) TabCtrl_GetImageList( wapi_par_HWND( 1 ) ) ) ; +} +/*----------------------------------------------------------------------*/ +// #define TabCtrl_SetImageList(hwnd, himl) +// (HIMAGELIST)SNDMSG((hwnd), TCM_SETIMAGELIST, 0, (LPARAM)(HIMAGELIST)(himl)) + +HB_FUNC( WAPI_TABCTRL_SETIMAGELIST ) +{ + wapi_ret_NINT( ( HB_PTRDIFF ) TabCtrl_SetImageList( wapi_par_HWND( 1 ), + wapi_par_HIMAGELIST( 2 ) ) ) ; +} +/*----------------------------------------------------------------------*/ +// Wapi_TabCtrl_SetItem( hWndTab, nInsertPos, cText, iImageListIndex ) +// (BOOL)SNDMSG((hwnd), TCM_SETITEM, (WPARAM)(int)(iItem), (LPARAM)(TC_ITEM FAR*)(pitem)) + +HB_FUNC( WAPI_TABCTRL_SETITEM ) +{ + TC_ITEM item; + LPTSTR szText = HB_TCHAR_CONVTO( hb_parc( 3 ) ); + + item.mask = TCIF_TEXT | TCIF_IMAGE; + item.iImage = ISNIL( 4 ) ? -1 : wapi_par_INT( 4 ); + item.pszText = szText; + + wapi_ret_L( TabCtrl_SetItem( wapi_par_HWND( 1 ), wapi_par_INT( 2 ), &item ) ) ; + + HB_TCHAR_FREE( szText ); +} +/*----------------------------------------------------------------------*/ +// TabCtrl_DeleteAllItems(hwnd) +// (BOOL)SNDMSG((hwnd), TCM_DELETEALLITEMS, 0, 0L) + +HB_FUNC( WAPI_TABCTRL_DELETEALLITEMS ) +{ + wapi_ret_L( TabCtrl_DeleteAllItems( wapi_par_HWND( 1 ) ) ); +} +/*----------------------------------------------------------------------*/ +// TabCtrl_DeleteItem(hwnd, i) +// (BOOL)SNDMSG((hwnd), TCM_DELETEITEM, (WPARAM)(int)(i), 0L) + +HB_FUNC( WAPI_TABCTRL_DELETEITEM ) +{ + wapi_ret_L( TabCtrl_DeleteItem( wapi_par_HWND( 1 ), ( WPARAM ) wapi_par_INT( 2 ) ) ); +} +/*----------------------------------------------------------------------*/ +// TabCtrl_HitTest(hwndTC, pinfo) +// (int)SNDMSG((hwndTC), TCM_HITTEST, 0, (LPARAM)(TC_HITTESTINFO FAR*)(pinfo)) + +// waiting for structures + +HB_FUNC( WAPI_TABCTRL_HITTEST ) +{ + TCHITTESTINFO tcht ; + + hb_parni( TabCtrl_HitTest( wapi_par_HWND( 1 ), &tcht ) ) ; +} +/*----------------------------------------------------------------------*/ +// TabCtrl_SetItemExtra(hwndTC, cb) +// (BOOL)SNDMSG((hwndTC), TCM_SETITEMEXTRA, (WPARAM)(cb), 0L) + +HB_FUNC( WAPI_TABCTRL_SETITEMEXTRA ) +{ + wapi_ret_L( TabCtrl_SetItemExtra( wapi_par_HWND( 1 ), wapi_par_INT( 2 ) ) ) ; +} +/*----------------------------------------------------------------------*/ +// TabCtrl_AdjustRect(hwnd, bLarger, prc) +// (int)SNDMSG(hwnd, TCM_ADJUSTRECT, (WPARAM)(BOOL)(bLarger), (LPARAM)(RECT FAR *)prc) + +HB_FUNC( WAPI_TABCTRL_ADJUSTRECT ) +{ + RECT rc; + + if ( ISARRAY(3) ) + { + rc.left = hb_parnl( 3, 1 ); + rc.top = hb_parnl( 3, 2 ); + rc.right = hb_parnl( 3, 3 ); + rc.bottom = hb_parnl( 3, 4 ); + + TabCtrl_AdjustRect( wapi_par_HWND( 1 ), wapi_par_BOOL( 2 ), &rc ); + + hb_stornl( rc.left , 3, 1 ); + hb_stornl( rc.top , 3, 2 ); + hb_stornl( rc.right , 3, 3 ); + hb_stornl( rc.bottom, 3, 4 ); + } +} +/*----------------------------------------------------------------------*/ +// TabCtrl_SetItemSize(hwnd, x, y) +// (DWORD)SNDMSG((hwnd), TCM_SETITEMSIZE, 0, MAKELPARAM(x,y)) + +HB_FUNC( WAPI_TABCTRL_SETITEMSIZE ) +{ + wapi_ret_NINT( TabCtrl_SetItemSize( wapi_par_HWND( 1 ), wapi_par_INT( 2 ), wapi_par_INT( 3 ) ) ); +} +/*----------------------------------------------------------------------*/ +// TabCtrl_RemoveImage(hwnd, i) +// (void)SNDMSG((hwnd), TCM_REMOVEIMAGE, i, 0L) + +HB_FUNC( WAPI_TABCTRL_REMOVEIMAGE ) +{ + TabCtrl_RemoveImage( wapi_par_HWND( 1 ), wapi_par_INT( 2 ) ) ; +} +/*----------------------------------------------------------------------*/ +// TabCtrl_SetPadding(hwnd, cx, cy) +// (void)SNDMSG((hwnd), TCM_SETPADDING, 0, MAKELPARAM(cx, cy)) + +HB_FUNC( WAPI_TABCTRL_SETPADDING ) +{ + TabCtrl_SetPadding( wapi_par_HWND( 1 ), wapi_par_INT( 2 ), wapi_par_INT( 3 ) ) ; +} +/*----------------------------------------------------------------------*/ +// TabCtrl_GetToolTips(hwnd) +// (HWND)SNDMSG((hwnd), TCM_GETTOOLTIPS, 0, 0L) + +HB_FUNC( WAPI_TABCTRL_GETTOOLTIPS ) +{ + wapi_ret_NINT( ( HB_PTRDIFF ) TabCtrl_GetToolTips( wapi_par_HWND( 1 ) ) ); +} +/*----------------------------------------------------------------------*/ +// TabCtrl_SetToolTips(hwnd, hwndTT) +// (void)SNDMSG((hwnd), TCM_SETTOOLTIPS, (WPARAM)(hwndTT), 0L) + +HB_FUNC( WAPI_TABCTRL_SETTOOLTIPS ) +{ + TabCtrl_SetToolTips( wapi_par_HWND( 1 ), wapi_par_HWND( 2 ) ) ; +} +/*----------------------------------------------------------------------*/ +// TabCtrl_GetCurFocus(hwnd) +// (int)SNDMSG((hwnd), TCM_GETCURFOCUS, 0, 0) + +HB_FUNC( WAPI_TABCTRL_GETCURFOCUS ) +{ + wapi_ret_NI( TabCtrl_GetCurFocus( wapi_par_HWND( 1 ) ) ); +} +/*----------------------------------------------------------------------*/ +// TabCtrl_SetCurFocus(hwnd, i) +// SNDMSG((hwnd),TCM_SETCURFOCUS, i, 0) + +HB_FUNC( WAPI_TABCTRL_SETCURFOCUS ) +{ + TabCtrl_SetCurFocus( wapi_par_HWND( 1 ), wapi_par_INT( 2 ) ); +} +/*----------------------------------------------------------------------*/ +// TabCtrl_SetMinTabWidth(hwnd, x) +// (int)SNDMSG((hwnd), TCM_SETMINTABWIDTH, 0, x) + +HB_FUNC( WAPI_TABCTRL_SETMINTABWIDTH ) +{ + //wapi_ret_NI( TabCtrl_SetMinTabWidth( wapi_par_HWND( 1 ), wapi_par_INT( 2 ) ) ); + wapi_ret_NI( ( int ) SendMessage( wapi_par_HWND( 1 ), TCM_SETMINTABWIDTH, ( WPARAM ) 0, ( LPARAM ) wapi_par_INT( 2 ) ) ); +} +/*----------------------------------------------------------------------*/ +// TabCtrl_DeselectAll(hwnd, fExcludeFocus) +// (void)SNDMSG((hwnd), TCM_DESELECTALL, fExcludeFocus, 0) + +HB_FUNC( WAPI_TABCTRL_DESELECTALL ) +{ + //TabCtrl_DeselectAll( wapi_par_HWND( 1 ), wapi_par_UINT( 2 ) ) ; + SendMessage( wapi_par_HWND( 1 ), TCM_DESELECTALL, ( WPARAM ) wapi_par_UINT( 2 ), ( LPARAM ) 0 ) ; +} +/*----------------------------------------------------------------------*/ +#if (_WIN32_IE >= 0x0400) +// TabCtrl_HighlightItem(hwnd, i, fHighlight) +// (BOOL)SNDMSG((hwnd), TCM_HIGHLIGHTITEM, (WPARAM)(i), (LPARAM)MAKELONG (fHighlight, 0)) + +HB_FUNC( WAPI_TABCTRL_HIGHLIGHTITEM ) +{ + wapi_ret_L( TabCtrl_HighlightItem( wapi_par_HWND( 1 ), wapi_par_INT( 2 ), wapi_par_WORD( 3 ) ) ); +} +/*----------------------------------------------------------------------*/ +// TabCtrl_SetExtendedStyle(hwnd, dw) +// (DWORD)SNDMSG((hwnd), TCM_SETEXTENDEDSTYLE, 0, dw) + +HB_FUNC( WAPI_TABCTRL_SETEXTENDEDSTYLE ) +{ + wapi_ret_NINT( TabCtrl_SetExtendedStyle( wapi_par_HWND( 1 ), wapi_par_DWORD( 2 ) ) ) ; +} +/*----------------------------------------------------------------------*/ +// TabCtrl_GetExtendedStyle(hwnd) +// (DWORD)SNDMSG((hwnd), TCM_GETEXTENDEDSTYLE, 0, 0) + +HB_FUNC( WAPI_TABCTRL_GETEXTENDEDSTYLE ) +{ + wapi_ret_NINT( TabCtrl_GetExtendedStyle( wapi_par_HWND( 1 ) ) ) ; +} +/*----------------------------------------------------------------------*/ +// TabCtrl_SetUnicodeFormat(hwnd, fUnicode) +// (BOOL)SNDMSG((hwnd), TCM_SETUNICODEFORMAT, (WPARAM)(fUnicode), 0) + +HB_FUNC( WAPI_TABCTRL_SETUNICODEFORMAT ) +{ + wapi_ret_L( TabCtrl_SetUnicodeFormat( wapi_par_HWND( 1 ), wapi_par_BOOL( 2 ) ) ); +} +/*----------------------------------------------------------------------*/ +// TabCtrl_GetUnicodeFormat(hwnd) +// (BOOL)SNDMSG((hwnd), TCM_GETUNICODEFORMAT, 0, 0) + +HB_FUNC( WAPI_TABCTRL_GETUNICODEFORMAT ) +{ + wapi_ret_L( TabCtrl_GetUnicodeFormat( wapi_par_HWND( 1 ) ) ) ; +} +#endif +/*----------------------------------------------------------------------*/ +/*----------------------------------------------------------------------*/ +// not an API + +HB_FUNC( WAPI_TABCTRL_CREATE ) +{ + HWND hwnd; + HWND hbutton; + LONG hFont; + LONG style; + style = ISNIL(6) ? 0 : (LONG) hb_parnl(6); + hwnd = (HWND) hb_parnl (1); + hFont = SendMessage( hwnd, WM_GETFONT, 0, 0); + hbutton = CreateWindowEx(0, WC_TABCONTROL, NULL , style, hb_parni(2), hb_parni(3) , hb_parni(4), hb_parni(5) , hwnd,NULL, GetModuleHandle(NULL) , NULL ) ; + SendMessage(hbutton,(UINT)WM_SETFONT, (WPARAM) hFont, 1 ) ; + hb_retnl ( (LONG) hbutton ); +} + +/*----------------------------------------------------------------------*/ +// not an API + +HB_FUNC( WAPI_TABCTRL_ADDITEM ) +{ + int iCount = TabCtrl_GetItemCount( wapi_par_HWND( 1 ) ); + LPTSTR szText = HB_TCHAR_CONVTO( hb_parc( 2 ) ); + TC_ITEM item; + + item.mask = TCIF_TEXT | TCIF_IMAGE; + item.iImage = ISNIL( 3 ) ? -1 : wapi_par_INT( 3 ); + item.pszText = szText; + + wapi_ret_NI( TabCtrl_InsertItem( wapi_par_HWND( 1 ), iCount, &item ) ); + HB_TCHAR_FREE( szText ); +} +/*----------------------------------------------------------------------*/ +