diff --git a/harbour/ChangeLog b/harbour/ChangeLog index ac442d28d6..3cd6f9c664 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,17 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-06-09 22:44 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * mpkg_deb.sh + + Added hbqt lib. Submitted by Davor Siklic. Thank you. + + * tests/wvtext.prg + ! Filename converted to lowercase. + + - contrib/hbqt/tests/wvtext.prg + - contrib/gtqtc/tests/wvtext.prg + - Deleted duplicates of this demo. + 2009-06-09 21:14 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * INSTALL * Harbour version cleaned from postfix. diff --git a/harbour/contrib/gtqtc/tests/wvtext.prg b/harbour/contrib/gtqtc/tests/wvtext.prg deleted file mode 100644 index 22bfa28399..0000000000 --- a/harbour/contrib/gtqtc/tests/wvtext.prg +++ /dev/null @@ -1,521 +0,0 @@ -/* - * $Id$ - */ - -/*----------------------------------------------------------------------*/ -/*----------------------------------------------------------------------*/ -/*----------------------------------------------------------------------*/ -// -// [x]Harbour Extended Features Deno -// . -// Pritpal Bedi -// -/*----------------------------------------------------------------------*/ -/*----------------------------------------------------------------------*/ -/*----------------------------------------------------------------------*/ - -#include "hbgtinfo.ch" -#include "inkey.ch" -#include "box.ch" - - -#define RGB(r,g,b) ( r + ( g * 256 ) + ( b * 256 * 256 ) ) - -/*----------------------------------------------------------------------*/ - -STATIC nRows := 20, nCols := 60, nColorIndex := 1 - -/*----------------------------------------------------------------------*/ -FUNCTION Main() - Local nKey, lMark, lResize, lClose - Local nHeight := 20 - Local nWidth := Int( nHeight/2 ) - Local cFont - - SET SCOREBOARD OFF - - Hb_GtInfo( HB_GTI_FONTNAME , cFont ) - Hb_GtInfo( HB_GTI_FONTWIDTH, nWidth ) - Hb_GtInfo( HB_GTI_FONTSIZE , nHeight ) - Hb_GtInfo( HB_GTI_ICONFILE, "../../../contrib/hbqt/tests/test.ico" ) - SetCursor( 0 ) - SetColor( "n/w" ) - Hb_GtInfo( HB_GTI_CODEPAGE, 255 ) // DOES NOT WORK - - HB_GtInfo( HB_GTI_NOTIFIERBLOCK, {|nEvent, ...| MyNotifier( nEvent, ... ) } ) - - DispScreen() - - DO WHILE .T. - nKey := Inkey( 0.1 ) - if nKey == K_ESC - exit - endif - - DO CASE - CASE nKey == K_ENTER - Alert( " Pressed" ) - - CASE nKey == K_F2 - lMark := Hb_GtInfo( HB_GTI_SELECTCOPY ) - Hb_GtInfo( HB_GTI_SELECTCOPY, !lMark ) - - CASE nKey == K_F3 - lResize := Hb_GtInfo( HB_GTI_RESIZABLE ) - Hb_GtInfo( HB_GTI_RESIZABLE, !lResize ) - - CASE nKey == K_F4 - lClose := Hb_GtInfo( HB_GTI_CLOSABLE ) - hb_GtInfo( HB_GTI_CLOSABLE, !lClose ) - - CASE nKey == K_F5 - SetPalette( 1 ) - - CASE nKey == K_F6 - SetPalette( 0 ) - - CASE nKey == K_F7 - GetAVariable() - - CASE nKey == K_F8 - Alert( "Menu text changed. Was: " + hb_GtInfo( HB_GTI_SELECTCOPY, DToS(Date()) + " " + Time() ) ) - - CASE nKey == K_F9 - Boxes() - - CASE nKey == K_F10 - hb_threadStart( @thFunc() ) - - ENDCASE - ENDDO - - RETURN NIL -/*----------------------------------------------------------------------*/ -STATIC FUNCTION MyNotifier( nEvent, ... ) - - DO CASE - - CASE nEvent == HB_GTE_SETFOCUS - DispScreen() - DispOutAt( maxrow(), 35, "In Focus", "B/G*" ) - - CASE nEvent == HB_GTE_KILLFOCUS - DispScreen() - DispOutAt( maxrow(), 35, "Out Focus", "B/G*" ) - - CASE nEvent == HB_GTE_CLOSE - DispScreen() - if Alert( "Close Application", {"Yes","No" } ) == 2 - Return ( 1 ) - endif - - ENDCASE - - RETURN 0 -/*----------------------------------------------------------------------*/ -STATIC FUNCTION DispScreen() - Local nRow := 12, nCol := 28 - Local cColor := "N/W" - Local nMaxCol := MaxCol()+1 - - DispBegin() - - CLS - DispOutAt( 0, 0,padc( "Harbour GT - New Features", maxcol()+1 ), "N/GR*" ) - - // Contributed by Massimo Belgrano - DispOutAt( 2, 0, padc( "______ __ ______________________ ",nMaxCol ), "W+/W" ) - DispOutAt( 3, 0, padc( "___ / / /_____ ___________ /___________ _________ __ ____/____/",nMaxCol ), "W+/W" ) - DispOutAt( 4, 0, padc( "__ /_/ /_ __ `/_ ___/_ __ \ __ \ / / /_ ___/ _ / __ __/ ",nMaxCol ), "W+/W" ) - DispOutAt( 5, 0, padc( "_ __ / / /_/ /_ / _ /_/ / /_/ / /_/ /_ / / /_/ / _ / ",nMaxCol ), "W+/W" ) - DispOutAt( 6, 0, padc( "/_/ /_/ \__,_/ /_/ /_.___/\____/\__,_/ /_/ \____/ /_/ ",nMaxCol ), "W+/W" ) - - DispOutAt( ++nRow, nCol, "< F2 MarkCopy Toggle >", cColor ) - DispOutAt( ++nRow, nCol, "< F3 Resize Toggle >", cColor ) - DispOutAt( ++nRow, nCol, "< F4 Closable Toggle >", cColor ) - DispOutAt( ++nRow, nCol, "< F5 Palette L Repeat >", cColor ) - DispOutAt( ++nRow, nCol, "< F6 Palette D Repeat >", cColor ) - DispOutAt( ++nRow, nCol, "< F7 Get a Variable >", cColor ) - DispOutAt( ++nRow, nCol, "< F8 MarkCopy menu text >", cColor ) - DispOutAt( ++nRow, nCol, "< F9 Boxes >", cColor ) - DispOutAt( ++nRow, nCol, "< Click X Button >", cColor ) - DispOutAt( ++nRow, nCol, "< F10 Open New Window >", cColor ) - - DispOutAt( maxrow(), 0, Space( maxcol()+1 ), "N/G*" ) - - DispOutAt( 0, 0 , "TL", "N/GR*" ) - DispOutAt( 0, MaxCol() - 1 , "TR", "N/GR*" ) - DispOutAt( MaxRow(), 0 , "BL", "N/G*" ) - DispOutAt( MaxRow(), MaxCol() - 1, "BR", "N/G*" ) - - DispEnd() - RETURN NIL -/*----------------------------------------------------------------------*/ -PROCEDURE HB_GTSYS() - REQUEST HB_GT_QTC_DEFAULT - RETURN -/*----------------------------------------------------------------------*/ -FUNCTION SetPalette( nMode ) - Local aPalette := Hb_GtInfo( HB_GTI_PALETTE ) - - static nR := 198 - static nG := 198 - static nB := 198 - - nR += iif( nMode == 0, -5, 5 ) - nG += iif( nMode == 0, -5, 5 ) - nB += iif( nMode == 0, -5, 5 ) - - // Change "W" to slightly gray everytime you press F5 - // - aPalette[ 8 ] := RGB( nR, nG, nB ) - - Hb_GtInfo( HB_GTI_PALETTE, aPalette ) - DispScreen() - - RETURN NIL -/*----------------------------------------------------------------------*/ -FUNCTION SetPaletteIndex() - - Hb_GtInfo( HB_GTI_PALETTE, 8, RGB( 120, 200, 240 ) ) - DispScreen() - - RETURN NIL -/*----------------------------------------------------------------------*/ -STATIC FUNCTION Boxes() - LOCAL scr := SaveScreen( 0, 0,maxrow(), maxcol() ) - LOCAL cColor := SetColor( 'W+/B' ) - LOCAL cClr := 'w+/n' - LOCAL cTitle - - CLS - #include "box.ch" - - DispBox ( 2-1, 4,10-1,35,B_SINGLE , cClr ) - DispOutAt( 5-1, 4, chr( 195 ), cClr ) - DispOutAt( 5-1, 5, replicate( chr( 196 ),13 ), cClr ) - DispOutAt( 5-1,18, chr( 197 ), cClr ) - DispOutAt( 5-1,35, chr( 180 ), cClr ) - DispOutAt( 2-1,18, chr( 194 ), cClr ) - DispOutAt( 3-1,18, chr( 179 ), cClr ) - DispOutAt( 4-1,18, chr( 179 ), cClr ) - DispOutAt(10-1,18, chr( 193 ), cClr ) - - DispBox ( 2-1,44,10-1,75,B_DOUBLE_SINGLE, cClr ) - DispOutAt( 5-1,44, chr( 198 ), cClr ) - DispOutAt( 5-1,45, replicate( chr( 205 ),13 ), cClr ) - DispOutAt( 5-1,58, chr( 216 ), cClr ) - DispOutAt( 5-1,75, chr( 181 ), cClr ) - DispOutAt( 2-1,58, chr( 209 ), cClr ) - DispOutAt( 3-1,58, chr( 179 ), cClr ) - DispOutAt( 4-1,58, chr( 179 ), cClr ) - DispOutAt(10-1,58, chr( 207 ), cClr ) - - DispBox (12-1, 4,20-1,35,B_DOUBLE , cClr ) - DispOutAt(15-1, 4, chr( 204 ), cClr ) - DispOutAt(15-1, 5, replicate( chr( 205 ),13 ), cClr ) - DispOutAt(15-1,18, chr( 206 ), cClr ) - DispOutAt(15-1,35, chr( 185 ), cClr ) - DispOutAt(12-1,18, chr( 203 ), cClr ) - DispOutAt(13-1,18, chr( 186 ), cClr ) - DispOutAt(14-1,18, chr( 186 ), cClr ) - DispOutAt(20-1,18, chr( 202 ), cClr ) - - DispBox (12-1,44,20-1,75,B_SINGLE_DOUBLE, cClr ) - DispOutAt(15-1,44, chr( 199 ), cClr ) - DispOutAt(15-1,45, replicate( chr( 196 ),13 ), cClr ) - DispOutAt(15-1,58, chr( 215 ), cClr ) - DispOutAt(15-1,75, chr( 182 ), cClr ) - DispOutAt(12-1,58, chr( 210 ), cClr ) - DispOutAt(13-1,58, chr( 186 ), cClr ) - DispOutAt(14-1,58, chr( 186 ), cClr ) - DispOutAt(20-1,58, chr( 208 ), cClr ) - - DispBox( 21, 4,23,35, B_FAT , cClr ) - DispBox( 21,44,23,75, B_THIN, cClr ) - - cTitle := hb_gtInfo( HB_GTI_WINTITLE, 'Clipper BOX Characters Implementation ' ) - DO WHILE inkey( 0.1 ) <> 27; ENDDO - hb_gtInfo( HB_GTI_WINTITLE, 'Harbour QT Based Terminal' ) - - RestScreen( 0, 0, maxrow(), maxcol(), scr ) - RETURN nil -/*----------------------------------------------------------------------*/ -PROCEDURE thFunc() - Local cTitle, oBrowse, lEnd, nKey, i, aStruct, pGT1, pGT - Local aColor := { 'W+/B', 'W+/G', 'W+/BG', 'W+/N*', 'W+/RB', 'N/W*', 'N/GR*', 'W+/N' } - - static nBrowser := 0 - static nZx := 0 - static nZy := 0 - - ErrorBlock( {|oErr| MyErrorSys( oErr ) } ) - - nBrowser++ - nZx += 20 - nZy += 20 - - /* allocate own GT driver */ - if !( hb_gtReload( 'QTC' ) ) - Alert( 'QTC Driver could not been loaded!' ) - Return NIL - endif - Hb_GtInfo( HB_GTI_PALETTE, 8, RGB( 120, 200, 240 ) ) - - if ( nBrowser % 2 ) != 0 - Hb_GtInfo( HB_GTI_RESIZEMODE, HB_GTI_RESIZEMODE_ROWS ) - endif - Hb_GtInfo( HB_GTI_WINTITLE, 'Test.dbf ['+if( ( nBrowser % 2 ) != 0, 'RESIZABLE_BY_ROWS', 'RESIZABLE_BY_FONT' )+']' ) - Hb_GtInfo( HB_GTI_ICONFILE, "test.ico" ) - - SetColor( aColor[ nColorIndex ] ) - CLS - SetCursor( 0 ) - - nColorIndex++ - if nColorIndex > len( aColor ) - nColorIndex := 1 - endif - - nRows++ - nCols += 2 - - SetMode( nRows,nCols ) - SetColor( aColor[ nColorIndex ] ) - Hb_GtInfo( HB_GTI_WINTITLE, cTitle ) - CLS - Hb_GtInfo( HB_GTI_SETPOS_XY, nZx, nZy ) - - cTitle := 'New Window with '+ltrim( str( MaxRow() ) )+; - ' Rows and '+ltrim( str( MaxCol() ) )+' Columns' - DispOutAt( 0, 0, padc( cTitle, maxcol()+1 ), 'N/GR*' ) - cTitle := ' Modal Dialog ' - DispOutAt( MaxRow(), 0, padc( cTitle, maxcol()+1 ), 'W+/R*' ) - - use ../../../tests/test shared - aStruct := DbStruct() - - oBrowse := TBrowse():New( 1, 0, maxrow()-1, maxcol() ) - - oBrowse:ColSep := " ³ " - oBrowse:HeadSep := "ÄÂÄ" - oBrowse:GoTopBlock := { || dbGoTop() } - oBrowse:GoBottomBlock := { || dbGoBottom() } - oBrowse:SkipBlock := { | nSkip | dbSkipBlock( nSkip,oBrowse ) } - - for i := 1 to len( aStruct ) - oBrowse:AddColumn( TBColumnNew( aStruct[ i,1 ], BlockField( i ) ) ) - next - - oBrowse:configure() - - HB_GtInfo( HB_GTI_NOTIFIERBLOCK, {|nEvent, ...| MyBrwNotifier( nEvent, oBrowse, ... ) } ) - - lEnd := .f. - While !lEnd - oBrowse:ForceStable() - - nKey := InKey( 0, INKEY_ALL ) - - if BrwHandleKey( oBrowse, nKey, @lEnd ) - // - else - if nKey == K_F11 - pGT1 := hb_gtCreate( 'QTC' ) - pGT := hb_gtSelect( pGT1 ) - SetMode( 7,40 ) - - hb_gtInfo( HB_GTI_SETPOS_ROWCOL , 4, 8 ) - hb_gtInfo( HB_GTI_WINTITLE , 'Modal Dialog [ Row:4 Col:8 ]' ) - hb_gtInfo( HB_GTI_RESIZABLE , .F. ) - - // Program Flow - SetColor( 'N/W' ) - CLS - Alert( 'I am in Child Window', {'Good','Bad'} ) - - // Cleanup - pGT1 := NIL - hb_gtSelect( pGT ) - - elseif nKey == K_F12 - pGT1 := NIL - - endif - endif - end - - DbCloseArea() - oBrowse := NIL - hb_gcAll( .t. ) - RETURN -/*----------------------------------------------------------------------*/ -STATIC FUNCTION MyBrwNotifier( nEvent, oBrowse, ... ) - LOCAL cTitle - - DO CASE - - CASE nEvent == HB_GTE_RESIZED - cTitle := 'New Window with '+ltrim( str( MaxRow() ) )+; - ' Rows and '+ltrim( str( MaxCol() ) )+' Columns' - DispOutAt( 0, 0, padc( cTitle, maxcol()+1 ), 'N/GR*' ) - cTitle := ' Modal Dialog ' - DispOutAt( MaxRow(), 0, padc( cTitle, maxcol()+1 ), 'W+/R*' ) - - oBrowse:nBottom := MaxRow()-1 - oBrowse:nRight := MaxCol() - oBrowse:configure() - oBrowse:refreshAll() - oBrowse:forceStable() - - ENDCASE - - RETURN 0 -/*----------------------------------------------------------------------*/ -STATIC FUNCTION DbSkipBlock( n, oTbr ) - - LOCAL nSkipped := 0 - - if n == 0 - DBSkip( 0 ) - - elseif n > 0 - do while nSkipped != n .and. TBNext( oTbr ) - nSkipped++ - enddo - else - do while nSkipped != n .and. TBPrev( oTbr ) - nSkipped-- - enddo - endif - - RETURN nSkipped -/*----------------------------------------------------------------------*/ -STATIC FUNCTION TBNext( oTbr ) - - LOCAL nSaveRecNum := recno() - LOCAL lMoved := .T. - - if Eof() - lMoved := .F. - else - DBSkip( 1 ) - if Eof() - lMoved := .F. - DBGoTo( nSaveRecNum ) - endif - endif - - RETURN lMoved -/*----------------------------------------------------------------------*/ -STATIC FUNCTION TBPrev( oTbr ) - LOCAL nSaveRecNum := Recno() - LOCAL lMoved := .T. - - DBSkip( -1 ) - - if Bof() - DBGoTo( nSaveRecNum ) - lMoved := .F. - endif - - RETURN lMoved -/*----------------------------------------------------------------------*/ -STATIC FUNCTION BlockField( i ) - RETURN {|| fieldget( i ) } -/*----------------------------------------------------------------------*/ -STATIC FUNCTION BrwHandleKey( oBrowse, nKey, lEnd ) - LOCAL lRet := .t. - - do case - case nKey == K_ESC - lEnd := .t. - - case nKey == K_ENTER - lEnd := .t. - - case nKey == K_DOWN - oBrowse:Down() - - case nKey == K_UP - oBrowse:Up() - - case nKey == K_LEFT - oBrowse:Left() - - case nKey == K_RIGHT - oBrowse:Right() - - case nKey == K_PGDN - oBrowse:pageDown() - - case nKey == K_PGUP - oBrowse:pageUp() - - case nKey == K_CTRL_PGUP - oBrowse:goTop() - - case nKey == K_CTRL_PGDN - oBrowse:goBottom() - - case nKey == K_HOME - oBrowse:home() - - case nKey == K_END - oBrowse:end() - - case nKey == K_CTRL_LEFT - oBrowse:panLeft() - - case nKey == K_CTRL_RIGHT - oBrowse:panRight() - - case nKey == K_CTRL_HOME - oBrowse:panHome() - - case nKey == K_CTRL_END - oBrowse:panEnd() - - case nKey == K_MWBACKWARD - oBrowse:down() - - case nKey == K_MWFORWARD - oBrowse:up() - - otherwise - lRet := .f. - - endcase - - RETURN lRet -/*----------------------------------------------------------------------*/ -PROCEDURE MyErrorSys( oError ) - - ? oError:Description - ? oError:args - ? oError:genCode - ? oError:operation - - ? procname(1), procline(1) - ? procname(2), procline(2) - ? procname(3), procline(3) - - do while inkey() <> 27 - enddo - - RETURN -/*----------------------------------------------------------------------*/ - -STATIC FUNCTION GetAVariable() - LOCAL getlist := {} - LOCAL cVrb := space( 20 ) - LOCAL cVrb1 := space( 20 ) - LOCAL xScr := SaveScreen( 9,30,10,50 ) - - @ 9,30 GET cVrb COLOR 'W+/B*' - @10,30 GET cVrb1 COLOR 'W+/B*' - READ - - RestScreen( 9,30,10,50, xScr ) - RETURN NIL -/*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbqt/tests/wvtext.prg b/harbour/contrib/hbqt/tests/wvtext.prg deleted file mode 100644 index 4ce46db297..0000000000 --- a/harbour/contrib/hbqt/tests/wvtext.prg +++ /dev/null @@ -1,615 +0,0 @@ -/* - * $Id$ - */ - -//----------------------------------------------------------------------// -//----------------------------------------------------------------------// -//----------------------------------------------------------------------// -// -// [x]Harbour Extended Features Deno -// . -// Pritpal Bedi -// -//----------------------------------------------------------------------// -//----------------------------------------------------------------------// -//----------------------------------------------------------------------// - -#define __GTQTC__ - -#include "hbgtinfo.ch" -#include "inkey.ch" -#include "box.ch" - -#ifdef __GTWVG__ -#include "hbgtwvg.ch" -#endif - -#define RGB(r,g,b) ( r + ( g * 256 ) + ( b * 256 * 256 ) ) - -//----------------------------------------------------------------------// - -// To be in hbgtinfo.ch -// -#define HB_GTI_SETPARENT 101 -#define HB_GTI_WINHANDLE 102 - -//----------------------------------------------------------------------// - -STATIC nRows := 20, nCols := 60, nColorIndex := 1 - -#define QT_PTROF( oObj ) ( oObj:pPtr ) - -#define QT_EVE_TRIGGERED "triggered(bool)" -#define QT_EVE_TRIGGERED_B "triggered(bool)" -#define QT_EVE_HOVERED "hovered()" -#define QT_EVE_CLICKED "clicked()" - -/*----------------------------------------------------------------------*/ -#if 0 -INIT PROCEDURE Qt_Start() - qt_qapplication() - RETURN - -EXIT PROCEDURE Qt_End() - qt_qapplication_quit() - RETURN -#endif -/*----------------------------------------------------------------------*/ - -FUNCTION Main() - Local nKey, lMark, lResize, lClose - Local nHeight := 20 - Local nWidth := Int( nHeight/2 ) - Local cFont - - Hb_GtInfo( HB_GTI_FONTNAME , cFont ) - Hb_GtInfo( HB_GTI_FONTWIDTH, nWidth ) - Hb_GtInfo( HB_GTI_FONTSIZE , nHeight ) - #ifdef __GTWVG__ - Hb_GtInfo( HB_GTI_ICONFILE, "..\contrib\gtwvg\tests\vr_1.ico" ) - #endif - SetCursor( 0 ) - SetColor( "n/w" ) - - //HB_GtInfo( HB_GTI_NOTIFIERBLOCK, {|nEvent, ...| MyNotifier( nEvent, ... ) } ) - - DispScreen() - - DO WHILE .T. - nKey := Inkey(0.1) - - if nKey == K_ESC - exit - endif - - DO CASE - CASE nKey == K_ENTER - Alert( " Pressed" ) - - CASE nKey == K_F2 - lMark := Hb_GtInfo( HB_GTI_SELECTCOPY ) - Hb_GtInfo( HB_GTI_SELECTCOPY, !lMark ) - - CASE nKey == K_F3 - lResize := Hb_GtInfo( HB_GTI_RESIZABLE ) - Hb_GtInfo( HB_GTI_RESIZABLE, !lResize ) - - CASE nKey == K_F4 - lClose := Hb_GtInfo( HB_GTI_CLOSABLE ) - hb_GtInfo( HB_GTI_CLOSABLE, !lClose ) - - CASE nKey == K_F5 - SetPalette( 1 ) - - CASE nKey == K_F6 - SetPalette( 0 ) - - CASE nKey == K_F7 - SetPaletteIndex() - - CASE nKey == K_F8 - Alert( "Menu text changed. Was: " + hb_GtInfo( HB_GTI_SELECTCOPY, DToS(Date()) + " " + Time() ) ) - - CASE nKey == K_F9 - RunInSysTray() - - CASE nKey == K_F10 - ExeQTWidgets() - - CASE nKey == K_F12 - EXIT - - ENDCASE - ENDDO - - RETURN NIL -//----------------------------------------------------------------------// -STATIC FUNCTION MyNotifier( nEvent, ... ) - - DO CASE - - CASE nEvent == HB_GTE_SETFOCUS - DispScreen() - DispOutAt( maxrow(), 35, "In Focus", "B/G*" ) - - CASE nEvent == HB_GTE_KILLFOCUS - DispScreen() - DispOutAt( maxrow(), 35, "Out Focus", "B/G*" ) - - CASE nEvent == HB_GTE_CLOSE - DispScreen() - if Alert( "Close Application", {"Yes","No" } ) == 2 - Return ( 1 ) - endif - - ENDCASE - - RETURN 0 -//----------------------------------------------------------------------// -STATIC FUNCTION DispScreen() - Local nRow := 12, nCol := 28 - Local cColor := "N/W" - Local nMaxCol := MaxCol()+1 - - DispBegin() - - CLS - DispOutAt( 0, 0,padc( "Harbour GT - New Features", maxcol()+1 ), "N/GR*" ) - - // Contributed by Massimo Belgrano - DispOutAt( 2, 0, padc( "______ __ ______________________ ",nMaxCol ), "W+/W" ) - DispOutAt( 3, 0, padc( "___ / / /_____ ___________ /___________ _________ __ ____/____/",nMaxCol ), "W+/W" ) - DispOutAt( 4, 0, padc( "__ /_/ /_ __ `/_ ___/_ __ \ __ \ / / /_ ___/ _ / __ __/ ",nMaxCol ), "W+/W" ) - DispOutAt( 5, 0, padc( "_ __ / / /_/ /_ / _ /_/ / /_/ / /_/ /_ / / /_/ / _ / ",nMaxCol ), "W+/W" ) - DispOutAt( 6, 0, padc( "/_/ /_/ \__,_/ /_/ /_.___/\____/\__,_/ /_/ \____/ /_/ ",nMaxCol ), "W+/W" ) - - DispOutAt( ++nRow, nCol, "< F2 MarkCopy Toggle >", cColor ) - DispOutAt( ++nRow, nCol, "< F3 Resize Toggle >", cColor ) - DispOutAt( ++nRow, nCol, "< F4 Closable Toggle >", cColor ) - DispOutAt( ++nRow, nCol, "< F5 Palette L Repeat >", cColor ) - DispOutAt( ++nRow, nCol, "< F6 Palette D Repeat >", cColor ) - DispOutAt( ++nRow, nCol, "< F7 Palette By Index R >", cColor ) - DispOutAt( ++nRow, nCol, "< F8 MarkCopy menu text >", cColor ) - DispOutAt( ++nRow, nCol, "< Click Other Window >", cColor ) - DispOutAt( ++nRow, nCol, "< Click X Button >", cColor ) -#ifdef __GTWVG__ - DispOutAt( ++nRow, nCol, "< F9 Run in SysTray >", cColor ) -#endif - DispOutAt( ++nRow, nCol, "< F10 Open QT Widgets >", cColor ) - - DispOutAt( maxrow(), 0, Space( maxcol()+1 ), "N/G*" ) - - DispOutAt( 0, 0 , "TL", "N/GR*" ) - DispOutAt( 0, MaxCol() - 1 , "TR", "N/GR*" ) - DispOutAt( MaxRow(), 0 , "BL", "N/G*" ) - DispOutAt( MaxRow(), MaxCol() - 1, "BR", "N/G*" ) - - DispEnd() - RETURN NIL -//----------------------------------------------------------------------// -PROCEDURE HB_GTSYS() -#ifdef __GTQTC__ - REQUEST HB_GT_QTC_DEFAULT -#endif -#ifdef __GTWVG__ - REQUEST HB_GT_WVG_DEFAULT -#else - REQUEST HB_GT_WVT_DEFAULT - REQUEST HB_GT_WIN -#endif - RETURN -//----------------------------------------------------------------------// -FUNCTION SetPalette( nMode ) - Local aPalette := Hb_GtInfo( HB_GTI_PALETTE ) - - static nR := 198 - static nG := 198 - static nB := 198 - - nR += iif( nMode == 0, -5, 5 ) - nG += iif( nMode == 0, -5, 5 ) - nB += iif( nMode == 0, -5, 5 ) - - // Change "W" to slightly gray everytime you press F5 - // - aPalette[ 8 ] := RGB( nR, nG, nB ) - - Hb_GtInfo( HB_GTI_PALETTE, aPalette ) - DispScreen() - - RETURN NIL -//----------------------------------------------------------------------// -FUNCTION SetPaletteIndex() - - Hb_GtInfo( HB_GTI_PALETTE, 8, RGB( 120, 200, 240 ) ) - DispScreen() - - RETURN NIL -//----------------------------------------------------------------------// -#define HB_GTS_NIM_ADD 0 -#define HB_GTS_NIM_MODIFY 1 -#define HB_GTS_NIM_DELETE 2 - -FUNCTION RunInSysTray() - #ifdef __GTWVG__ - Alert( "Please check your System Tray area after exiting this alert,"+; - ";then right click on the icon"+; - ";displaying tooltip 'Harbour GT in SysTray' !" ) - - Hb_GtInfo( HB_GTI_SPEC, HB_GTS_SYSTRAYICON, { HB_GTS_NIM_ADD, HB_GTS_NIT_FILE, ; - "..\contrib\gtwvg\tests\vr_1.ico", "Harbour GT in SysTray" } ) - #endif - RETURN NIL -//----------------------------------------------------------------------// -PROCEDURE thFunc() - Local cTitle, oBrowse, lEnd, nKey, i, aStruct, pGT1, pGT, hWnd - Local aColor := { 'W+/N', 'W+/B', 'W+/G', 'W+/BG', 'W+/N*', 'W+/RB', 'N/W*', 'N/GR*' } - - static nBrowser := 0 - static nZx := 0 - static nZy := 0 - - ErrorBlock( {|oErr| MyErrorSys( oErr ) } ) - - nBrowser++ - nZx += 20 - nZy += 20 - - /* allocate own GT driver */ - hb_gtReload( 'WVT' ) - Hb_GtInfo( HB_GTI_PALETTE, 8, RGB( 120, 200, 240 ) ) - - if ( nBrowser % 2 ) != 0 - Hb_GtInfo( HB_GTI_RESIZEMODE, HB_GTI_RESIZEMODE_ROWS ) - endif - Hb_GtInfo( HB_GTI_WINTITLE, 'Test.dbf ['+if( ( nBrowser % 2 ) != 0, 'RESIZABLE_BY_ROWS', 'RESIZABLE_BY_FONT' )+']' ) - - SetCursor( 0 ) - - nColorIndex++ - if nColorIndex > len( aColor ) - nColorIndex := 1 - endif - - nRows++ - nCols += 2 - - SetMode( nRows,nCols ) - SetColor( aColor[ nColorIndex ] ) - Hb_GtInfo( HB_GTI_WINTITLE, cTitle ) - CLS - Hb_GtInfo( HB_GTI_SETPOS_XY, nZx, nZy ) - - cTitle := 'New Window with '+ltrim( str( MaxRow() ) )+; - ' Rows and '+ltrim( str( MaxCol() ) )+' Columns' - DispOutAt( 0, 0, padc( cTitle, maxcol()+1 ), 'N/GR*' ) - cTitle := ' Modal Dialog ' - DispOutAt( MaxRow(), 0, padc( cTitle, maxcol()+1 ), 'W+/R*' ) - - use test shared - aStruct := DbStruct() - - oBrowse := TBrowse():New( 1, 0, maxrow()-1, maxcol() ) - - oBrowse:ColSep := " ³ " - oBrowse:HeadSep := "ÄÂÄ" - oBrowse:GoTopBlock := { || dbGoTop() } - oBrowse:GoBottomBlock := { || dbGoBottom() } - oBrowse:SkipBlock := { | nSkip | dbSkipBlock( nSkip,oBrowse ) } - - for i := 1 to len( aStruct ) - oBrowse:AddColumn( TBColumnNew( aStruct[ i,1 ], BlockField( i ) ) ) - next - - oBrowse:configure() - - lEnd := .f. - While !lEnd - oBrowse:ForceStable() - - nKey := InKey( 0, INKEY_ALL ) - - if BrwHandleKey( oBrowse, nKey, @lEnd ) - // - else - if nKey == HB_K_RESIZE - cTitle := 'New Window with '+ltrim( str( MaxRow() ) )+; - ' Rows and '+ltrim( str( MaxCol() ) )+' Columns' - DispOutAt( 0, 0, padc( cTitle, maxcol()+1 ), 'N/GR*' ) - cTitle := ' Modal Dialog ' - DispOutAt( MaxRow(), 0, padc( cTitle, maxcol()+1 ), 'W+/R*' ) - - oBrowse:nBottom := MaxRow()-1 - oBrowse:nRight := MaxCol() - oBrowse:Configure() - oBrowse:RefreshAll() - - elseif nKey == K_F11 - // Initialization Phase . Can be a Dialog Class - // LIKE in Xbase++: - // oWnd := gtDialog():New( oParent, oOwner, aSize, aPos, aPresParam, lVisible ) - // - hWnd := hb_gtInfo( HB_GTI_WINHANDLE ) - - pGT1 := hb_gtCreate( 'WVT' ) - pGT := hb_gtSelect( pGT1 ) - SetMode( 7,40 ) - hb_gtInfo( HB_GTI_SETPARENT , hWnd ) - hb_gtInfo( HB_GTI_SETPOS_ROWCOL , 4, 8 ) - hb_gtInfo( HB_GTI_WINTITLE , 'Modal Dialog [ Row:4 Col:8 ]' ) - hb_gtInfo( HB_GTI_RESIZABLE , .F. ) - - // Program Flow - SetColor( 'N/W' ) - CLS - Alert( 'I am in Child Window', {'Good','Bad'} ) - - // Cleanup - pGT1 := NIL - hb_gtSelect( pGT ) - - elseif nKey == K_F12 - pGT1 := NIL - - endif - endif - end - - DbCloseArea() - - RETURN -//----------------------------------------------------------------------// -STATIC FUNCTION DbSkipBlock( n, oTbr ) - - LOCAL nSkipped := 0 - - if n == 0 - DBSkip( 0 ) - - elseif n > 0 - do while nSkipped != n .and. TBNext( oTbr ) - nSkipped++ - enddo - else - do while nSkipped != n .and. TBPrev( oTbr ) - nSkipped-- - enddo - endif - - RETURN nSkipped -//-------------------------------------------------------------------// -STATIC FUNCTION TBNext( oTbr ) - - LOCAL nSaveRecNum := recno() - LOCAL lMoved := .T. - - if Eof() - lMoved := .F. - else - DBSkip( 1 ) - if Eof() - lMoved := .F. - DBGoTo( nSaveRecNum ) - endif - endif - - RETURN lMoved -//-------------------------------------------------------------------// -STATIC FUNCTION TBPrev( oTbr ) - LOCAL nSaveRecNum := Recno() - LOCAL lMoved := .T. - - DBSkip( -1 ) - - if Bof() - DBGoTo( nSaveRecNum ) - lMoved := .F. - endif - - RETURN lMoved -//-------------------------------------------------------------------// -STATIC FUNCTION BlockField( i ) - RETURN {|| fieldget( i ) } -//-------------------------------------------------------------------// -STATIC FUNCTION BrwHandleKey( oBrowse, nKey, lEnd ) - LOCAL lRet := .t. - - do case - case nKey == K_ESC - lEnd := .t. - - case nKey == K_ENTER - lEnd := .t. - - case nKey == K_DOWN - oBrowse:Down() - - case nKey == K_UP - oBrowse:Up() - - case nKey == K_LEFT - oBrowse:Left() - - case nKey == K_RIGHT - oBrowse:Right() - - case nKey == K_PGDN - oBrowse:pageDown() - - case nKey == K_PGUP - oBrowse:pageUp() - - case nKey == K_CTRL_PGUP - oBrowse:goTop() - - case nKey == K_CTRL_PGDN - oBrowse:goBottom() - - case nKey == K_HOME - oBrowse:home() - - case nKey == K_END - oBrowse:end() - - case nKey == K_CTRL_LEFT - oBrowse:panLeft() - - case nKey == K_CTRL_RIGHT - oBrowse:panRight() - - case nKey == K_CTRL_HOME - oBrowse:panHome() - - case nKey == K_CTRL_END - oBrowse:panEnd() - - case nKey == K_MWBACKWARD - oBrowse:down() - - case nKey == K_MWFORWARD - oBrowse:up() - - otherwise - lRet := .f. - - endcase - - RETURN lRet -//-------------------------------------------------------------------// -PROCEDURE MyErrorSys( oError ) - - ? oError:Description - ? oError:args - ? oError:genCode - ? oError:operation - - ? procname(1), procline(1) - ? procname(2), procline(2) - ? procname(3), procline(3) - - RETURN -//----------------------------------------------------------------------// -FUNCTION ExeQTWidgets() - Local oLabel - Local oWnd, oSize - Local oMenuBar - Local oMenuA, pAction - LOCAL oPS, oPPrv, oMB, oWZ, oCD, oWP - - oWnd := QMainWindow():new() - oWnd:setWindowTitle("Testing - QMainWindow, QMenu, QMenuBar and QAction " ) - /* The method 2 */ - oWnd:resize( 640, 400 ) - #if 0 - /* The method 2 */ - oSize := QSize():new() - oSize:setWidth( 640 ) - oSize:setHeight( 400 ) - oWnd:resize_1( QT_PTROF( oSize ) ) - #endif - - oWnd:Show() - - Build_MenuBar( oWnd ) - - oLabel := QLabel():New( QT_PTROF( oWnd ) ) - oLabel:setText( "Testing Harbour + Qt" ) - oLabel:move( 200,100 ) - oLabel:show() - - RETURN - -/*----------------------------------------------------------------------*/ - -STATIC FUNCTION Build_MenuBar( oWnd ) - LOCAL oMenuBar, oMenu - - oMenuBar := QMenuBar():new( QT_PTROF( oWnd ) ) - oMenuBar:resize( oWnd:width(), 25 ) - - oMenu := QMenu():new( QT_PTROF( oMenuBar ) ) - oMenu:setTitle( "&File" ) - Qt_Connect_Signal( oMenu:addAction_1( "new.png" , "&New" ), QT_EVE_TRIGGERED_B, {|w,l| FileDialog( "New" , w, l ) } ) - Qt_Connect_Signal( oMenu:addAction_1( "open.png", "&Open" ), QT_EVE_TRIGGERED_B, {|w,l| FileDialog( "Open", w, l ) } ) - oMenu:addSeparator() - Qt_Connect_Signal( oMenu:addAction_1( "save.png", "&Save" ), QT_EVE_TRIGGERED_B, {|w,l| FileDialog( "Save", w, l ) } ) - oMenu:addSeparator() - Qt_Connect_Signal( oMenu:addAction( "E&xit" ), QT_EVE_TRIGGERED_B, {|w,l| MsgInfo( "Exit ?" ) } ) - oMenuBar:addMenu( QT_PTROF( oMenu ) ) - - oMenu := QMenu():new( QT_PTROF( oMenuBar ) ) - oMenu:setTitle( "&Dialogs" ) - Qt_Connect_Signal( oMenu:addAction( "&Colors" ), QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "Colors" , w, l ) } ) - Qt_Connect_Signal( oMenu:addAction( "&Fonts" ), QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "Fonts" , w, l ) } ) - oMenu:addSeparator() - Qt_Connect_Signal( oMenu:addAction( "&PageSetup" ), QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "PageSetup", w, l ) } ) - Qt_Connect_Signal( oMenu:addAction( "P&review" ), QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "Preview" , w, l ) } ) - oMenu:addSeparator() - Qt_Connect_Signal( oMenu:addAction( "&Wizard" ), QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "Wizard" , w, l ) } ) - Qt_Connect_Signal( oMenu:addAction( "W&ebPage" ), QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "WebPage" , w, l ) } ) - oMenuBar:addMenu( QT_PTROF( oMenu ) ) - - oMenuBar:show() - - RETURN nil - -/*----------------------------------------------------------------------*/ - -FUNCTION MsgInfo( cMsg ) - LOCAL oMB - - oMB := QMessageBox():new() - oMB:setInformativeText( cMsg ) - oMB:setWindowTitle( "Harbour-QT" ) - oMB:show() - - RETURN nil - -/*----------------------------------------------------------------------*/ - -STATIC FUNCTION FileDialog( cType, w, l ) - LOCAL oFD := QFileDialog():new() - - oFD:setWindowTitle( "Select a File" ) - oFD:show() - - RETURN nil - -/*----------------------------------------------------------------------*/ - -STATIC FUNCTION Dialogs( cType, w, l ) - LOCAL oDlg, oUrl - - DO CASE - CASE cType == "PageSetup" - oDlg := QPageSetupDialog():new() - oDlg:setWindowTitle( "Harbour-QT PageSetup Dialog" ) - oDlg:show() - CASE cType == "Preview" - oDlg := QPrintPreviewDialog():new() - oDlg:setWindowTitle( "Harbour-QT Preview Dialog" ) - oDlg:show() - CASE cType == "Wizard" - oDlg := QWizard():new() - oDlg:setWindowTitle( "Harbour-QT Wizard to Show Slides etc." ) - oDlg:show() - CASE cType == "Colors" - oDlg := QColorDialog():new() - oDlg:setWindowTitle( "Harbour-QT Color Selection Dialog" ) - oDlg:show() - CASE cType == "WebPage" - oDlg := QWebView():new() - oUrl := QUrl():new() - oUrl:setUrl( "http://www.harbour.vouch.info" ) - QT_QWebView_SetUrl( QT_PTROF( oDlg ), QT_PTROF( oUrl ) ) - oDlg:setWindowTitle( "Harbour-QT Web Page Navigator" ) - oDlg:show() - CASE cType == "Fonts" - oDlg := QFontDialog():new() - oDlg:setWindowTitle( "Harbour-QT Font Selector" ) - oDlg:show() - ENDCASE - - RETURN nil - -/*----------------------------------------------------------------------*/ diff --git a/harbour/mpkg_deb.sh b/harbour/mpkg_deb.sh index d476b15688..87e6653804 100755 --- a/harbour/mpkg_deb.sh +++ b/harbour/mpkg_deb.sh @@ -106,6 +106,11 @@ then export HB_CONTRIBLIBS="${HB_CONTRIBLIBS} hbpgsql" fi +if test_reqpkg libqt4-dev +then + export HB_CONTRIBLIBS="${HB_CONTRIBLIBS} hbqt" +fi + if [ -z "${TOINST_LST}" ] || [ "$1" = "--force" ] then . ./bin/pack_src.sh diff --git a/harbour/tests/wvtext.prg b/harbour/tests/wvtext.prg index c54bc1f1df..d0319784ef 100644 --- a/harbour/tests/wvtext.prg +++ b/harbour/tests/wvtext.prg @@ -233,7 +233,7 @@ PROCEDURE thFunc() if ( nBrowser % 2 ) != 0 Hb_GtInfo( HB_GTI_RESIZEMODE, HB_GTI_RESIZEMODE_ROWS ) endif - Hb_GtInfo( HB_GTI_WINTITLE, 'Test.dbf ['+if( ( nBrowser % 2 ) != 0, 'RESIZABLE_BY_ROWS', 'RESIZABLE_BY_FONT' )+']' ) + Hb_GtInfo( HB_GTI_WINTITLE, 'test.dbf ['+if( ( nBrowser % 2 ) != 0, 'RESIZABLE_BY_ROWS', 'RESIZABLE_BY_FONT' )+']' ) SetCursor( 0 )