From 1f08777480c83693e3dfa258ee02ea1befeb4ddc Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 8 Oct 2012 20:14:46 +0000 Subject: [PATCH] 2012-10-08 22:09 UTC+0200 Viktor Szakats (harbour syenar.net) * contrib/gtwvg/activex.prg * contrib/gtwvg/class.prg * contrib/gtwvg/crt.prg * contrib/gtwvg/menubar.prg * contrib/gtwvg/paint.prg * contrib/gtwvg/parthdlr.prg * contrib/gtwvg/pushbut.prg * contrib/gtwvg/statbar.prg * contrib/gtwvg/static.prg * contrib/gtwvg/syswnd.prg * contrib/gtwvg/tabpage.prg * contrib/gtwvg/toolbar.prg * contrib/gtwvg/wnd.prg * extras/httpsrv/cgifunc.prg * extras/httpsrv/cookie.prg * extras/httpsrv/session.prg * extras/httpsrv/uhttpd.prg * use __defaultNIL() instead of DEFAULT TO * deleted common.ch from all files * contrib/hbmisc/numtxtru.prg % minor optimization * contrib/hbmisc/tests/numtxtru.prg * avoid using a .dbf as output, instead use STDOUT * added lines to make it work using hbrun * switched output and HVM to UTF-8, so it can be displayed on more systems (both as stdalone exe and as hbrun script) --- harbour/ChangeLog | 31 ++++++++ harbour/contrib/gtwvg/3state.prg | 1 - harbour/contrib/gtwvg/activex.prg | 5 +- harbour/contrib/gtwvg/bitmap.prg | 1 - harbour/contrib/gtwvg/checkbox.prg | 1 - harbour/contrib/gtwvg/class.prg | 91 ++++++++++++----------- harbour/contrib/gtwvg/combobox.prg | 1 - harbour/contrib/gtwvg/crt.prg | 35 +++++---- harbour/contrib/gtwvg/dataref.prg | 1 - harbour/contrib/gtwvg/dialog.prg | 1 - harbour/contrib/gtwvg/drawarea.prg | 1 - harbour/contrib/gtwvg/genrc.prg | 1 - harbour/contrib/gtwvg/htmlview.prg | 2 - harbour/contrib/gtwvg/listbox.prg | 1 - harbour/contrib/gtwvg/menubar.prg | 35 +++++---- harbour/contrib/gtwvg/mle.prg | 3 - harbour/contrib/gtwvg/paint.prg | 49 ++++++------ harbour/contrib/gtwvg/parthdlr.prg | 9 +-- harbour/contrib/gtwvg/pushbut.prg | 3 +- harbour/contrib/gtwvg/radiobut.prg | 1 - harbour/contrib/gtwvg/scrollbr.prg | 1 - harbour/contrib/gtwvg/sle.prg | 1 - harbour/contrib/gtwvg/statbar.prg | 11 ++- harbour/contrib/gtwvg/static.prg | 3 +- harbour/contrib/gtwvg/syswnd.prg | 43 +++++------ harbour/contrib/gtwvg/tabpage.prg | 3 +- harbour/contrib/gtwvg/toolbar.prg | 7 +- harbour/contrib/gtwvg/treeview.prg | 1 - harbour/contrib/gtwvg/wnd.prg | 63 ++++++++-------- harbour/contrib/hbmisc/numtxtru.prg | 2 +- harbour/contrib/hbmisc/tests/numtxtru.prg | 25 +++---- harbour/extras/httpsrv/cgifunc.prg | 44 +++++------ harbour/extras/httpsrv/cookie.prg | 12 +-- harbour/extras/httpsrv/session.prg | 33 ++++---- harbour/extras/httpsrv/uhttpd.prg | 10 +-- 35 files changed, 268 insertions(+), 264 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index b694edef71..3afec0c9fa 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,37 @@ The license applies to all entries newer than 2009-04-28. */ +2012-10-08 22:09 UTC+0200 Viktor Szakats (harbour syenar.net) + * contrib/gtwvg/activex.prg + * contrib/gtwvg/class.prg + * contrib/gtwvg/crt.prg + * contrib/gtwvg/menubar.prg + * contrib/gtwvg/paint.prg + * contrib/gtwvg/parthdlr.prg + * contrib/gtwvg/pushbut.prg + * contrib/gtwvg/statbar.prg + * contrib/gtwvg/static.prg + * contrib/gtwvg/syswnd.prg + * contrib/gtwvg/tabpage.prg + * contrib/gtwvg/toolbar.prg + * contrib/gtwvg/wnd.prg + * extras/httpsrv/cgifunc.prg + * extras/httpsrv/cookie.prg + * extras/httpsrv/session.prg + * extras/httpsrv/uhttpd.prg + * use __defaultNIL() instead of DEFAULT TO + * deleted common.ch from all files + + * contrib/hbmisc/numtxtru.prg + % minor optimization + + * contrib/hbmisc/tests/numtxtru.prg + * avoid using a .dbf as output, instead use STDOUT + * added lines to make it work using hbrun + * switched output and HVM to UTF-8, so it can be + displayed on more systems (both as stdalone exe + and as hbrun script) + 2012-10-08 21:55 UTC+0300 Pavel Tsarenko (tpe2 at mail.ru) * contrib/hbmisc/numtxtru.prg * contrib/hbmisc/tests/numtxtru.prg diff --git a/harbour/contrib/gtwvg/3state.prg b/harbour/contrib/gtwvg/3state.prg index cfaf9c7319..1b5a3ffbb0 100644 --- a/harbour/contrib/gtwvg/3state.prg +++ b/harbour/contrib/gtwvg/3state.prg @@ -67,7 +67,6 @@ // #include "hbclass.ch" -#include "common.ch" #include "inkey.ch" #include "hbgtinfo.ch" diff --git a/harbour/contrib/gtwvg/activex.prg b/harbour/contrib/gtwvg/activex.prg index b8cd92b7d5..8000f8d497 100644 --- a/harbour/contrib/gtwvg/activex.prg +++ b/harbour/contrib/gtwvg/activex.prg @@ -68,7 +68,6 @@ // #include "hbclass.ch" -#include "common.ch" #include "inkey.ch" #include "hbgtinfo.ch" @@ -149,8 +148,8 @@ METHOD WvgActiveXControl:Create( oParent, oOwner, aPos, aSize, aPresParams, lVis ::WvgWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) - DEFAULT cCLSID TO ::CLSID - DEFAULT cLicense TO ::license + __defaultNIL( @cCLSID , ::CLSID ) + __defaultNIL( @cLicense, ::license ) ::CLSID := cCLSID ::license := cLicense diff --git a/harbour/contrib/gtwvg/bitmap.prg b/harbour/contrib/gtwvg/bitmap.prg index a91bb17ae5..4ec0365f5b 100644 --- a/harbour/contrib/gtwvg/bitmap.prg +++ b/harbour/contrib/gtwvg/bitmap.prg @@ -67,7 +67,6 @@ // #include "hbclass.ch" -#include "common.ch" #include "inkey.ch" #include "hbgtinfo.ch" diff --git a/harbour/contrib/gtwvg/checkbox.prg b/harbour/contrib/gtwvg/checkbox.prg index 98724970a0..0bb7d039dc 100644 --- a/harbour/contrib/gtwvg/checkbox.prg +++ b/harbour/contrib/gtwvg/checkbox.prg @@ -67,7 +67,6 @@ // #include "hbclass.ch" -#include "common.ch" #include "inkey.ch" #include "hbgtinfo.ch" diff --git a/harbour/contrib/gtwvg/class.prg b/harbour/contrib/gtwvg/class.prg index 6495fe66ac..760e086c35 100644 --- a/harbour/contrib/gtwvg/class.prg +++ b/harbour/contrib/gtwvg/class.prg @@ -67,12 +67,11 @@ // // -#include "hbclass.ch" -#include "inkey.ch" -#include "common.ch" -#include "setcurs.ch" +#include "hbclass.ch" +#include "inkey.ch" +#include "setcurs.ch" -#include "wvtwin.ch" +#include "wvtwin.ch" // @@ -196,14 +195,14 @@ METHOD wvtDialog:New( nRows, nCols, cTitle, cFont, nFontHeight, nFontWidth, nFon LOCAL fnt_ := Wvt_GetFontInfo() - DEFAULT nRows TO 25 - DEFAULT nCols TO 80 - DEFAULT cTitle TO Wvt_GetTitle() - DEFAULT cFont TO fnt_[ 1 ] - DEFAULT nFontHeight TO fnt_[ 2 ] - DEFAULT nFontWidth TO fnt_[ 3 ] - DEFAULT nFontBold TO fnt_[ 4 ] - DEFAULT nFontQuality TO fnt_[ 5 ] + __defaultNIL( @nRows , 25 ) + __defaultNIL( @nCols , 80 ) + __defaultNIL( @cTitle , Wvt_GetTitle() ) + __defaultNIL( @cFont , fnt_[ 1 ] ) + __defaultNIL( @nFontHeight , fnt_[ 2 ] ) + __defaultNIL( @nFontWidth , fnt_[ 3 ] ) + __defaultNIL( @nFontBold , fnt_[ 4 ] ) + __defaultNIL( @nFontQuality , fnt_[ 5 ] ) IF Empty( cFont ) cFont := fnt_[ 1 ] @@ -856,7 +855,9 @@ ENDCLASS METHOD WvtObject:New( oParent, nType, nID, nTop, nLeft, nBottom, nRight ) - DEFAULT nID TO ++::nObjID + IF nID == NIL + nID := ++::nObjID + ENDIF ::oParent := oParent ::nType := nType @@ -1077,12 +1078,12 @@ METHOD WvtBrowse:Create() ::Super:Create() - DEFAULT ::bTotalRecords TO {|| ( ::cAlias )->( ordKeyCount() ) } - DEFAULT ::bCurrentRecord TO {|| ( ::cAlias )->( ordKeyNo() ) } + __defaultNIL( @::bTotalRecords , {|| ( ::cAlias )->( ordKeyCount() ) } ) + __defaultNIL( @::bCurrentRecord, {|| ( ::cAlias )->( ordKeyNo() ) } ) ::SetVBar() - DEFAULT ::bTotalColumns TO {|| ::oBrw:ColCount } - DEFAULT ::bCurrentColumn TO {|| ::oBrw:ColPos } + __defaultNIL( @::bTotalColumns , {|| ::oBrw:ColCount } ) + __defaultNIL( @::bCurrentColumn, {|| ::oBrw:ColPos } ) ::SetHBar() ::oBrw:ForceStable() @@ -1345,10 +1346,10 @@ ENDCLASS METHOD WvtStatusBar:New( oParent, nID, nTop, nLeft, nBottom, nRight ) - DEFAULT nTop TO oParent:MaxRow() - DEFAULT nLeft TO 0 - DEFAULT nBottom TO oParent:MaxRow() - DEFAULT nRight TO oParent:MaxCol() + __defaultNIL( @nTop , oParent:MaxRow() ) + __defaultNIL( @nLeft , 0 ) + __defaultNIL( @nBottom, oParent:MaxRow() ) + __defaultNIL( @nRight , oParent:MaxCol() ) ::Super:New( oParent, DLG_OBJ_STATUSBAR, nID, nTop, nLeft, nBottom, nRight ) @@ -1440,7 +1441,7 @@ METHOD WvtStatusBar:SetText( nPanel, cText, cColor ) LOCAL oPanel - DEFAULT cColor TO ::cColor + __defaultNIL( @cColor, ::cColor ) IF nPanel > 0 .AND. nPanel <= Len( ::aPanels ) oPanel := ::aPanels[ nPanel ] @@ -1553,11 +1554,11 @@ METHOD WvtLabel:New( oParent, nID, nTop, nLeft, nBottom, nRight ) METHOD WvtLabel:Create( lConfg ) - DEFAULT lConfg TO .F. + __defaultNIL( @lConfg , .F. ) - DEFAULT ::nBottom TO ::nTop - DEFAULT ::nRight TO ::nLeft + Len( ::Text ) - DEFAULT ::nTextColor TO RGB( 0, 0, 0 ) + __defaultNIL( @::nBottom , ::nTop ) + __defaultNIL( @::nRight , ::nLeft + Len( ::Text ) ) + __defaultNIL( @::nTextColor, RGB( 0, 0, 0 ) ) ::nTextColorHoverOff := ::nTextColor ::nBackColorHoverOff := ::nBackColor @@ -1718,7 +1719,7 @@ METHOD WvtToolBar:New( oParent, nID, nTop, nLeft, nBottom, nRight ) nTop := 0 nLeft := 0 - DEFAULT nBottom TO 1 + __defaultNIL( @nBottom, 1 ) nRight := oParent:MaxCol() ::Super:New( oParent, DLG_OBJ_TOOLBAR, nID, nTop, nLeft, nBottom, nRight ) @@ -2296,9 +2297,9 @@ METHOD WvtGets:Create() FOR i := 1 TO Len( ::aGetList ) GetList := {} - DEFAULT ::aGetList[ i,7 ] TO "N/W*,N/W*,,,N/GR*" - DEFAULT ::aGetList[ i,5 ] TO {|| .T. } - DEFAULT ::aGetList[ i,6 ] TO {|| .T. } + __defaultNIL( @::aGetList[ i,7 ], "N/W*,N/W*,,,N/GR*" ) + __defaultNIL( @::aGetList[ i,5 ], {|| .T. } ) + __defaultNIL( @::aGetList[ i,6 ], {|| .T. } ) @ ::aGetList[ i,1 ], ::aGetList[ i,2 ] GET ::aGetList[ i,3 ] PICTURE ::aGetList[ i,4 ] COLOR ::aGetList[ i,7 ] @@ -2486,8 +2487,8 @@ METHOD wvtScrollbar:Create() ENDIF IF ::nBarType == WVT_SCROLLBAR_VERT - DEFAULT ::nBottom TO ::nTop + 5 - DEFAULT ::nRight TO ::nLeft + 1 + __defaultNIL( @::nBottom, ::nTop + 5 ) + __defaultNIL( @::nRight , ::nLeft + 1 ) ::nRight := ::nLeft + 1 ::nBottom := Max( 7, ::nBottom ) @@ -2526,8 +2527,8 @@ METHOD wvtScrollbar:Create() {|| Wvt_DrawScrollButton( ::nBtn2Top, ::nBtn2Left, ::nBtn2Bottom, ::nBtn2Right, ::aPxlBtnBtm, 3, .T. ) } ELSE - DEFAULT ::nBottom TO ::nTop - DEFAULT ::nRight TO ::nLeft + 11 + __defaultNIL( @::nBottom, ::nTop ) + __defaultNIL( @::nRight , ::nLeft + 11 ) ::nBottom := ::nTop ::nRight := Max( 11, ::nRight ) @@ -2655,8 +2656,8 @@ METHOD wvtScrollbar:Refresh() METHOD wvtScrollbar:setPos( nTotal, nCurrent ) - DEFAULT nTotal TO Eval( ::bTotal ) - DEFAULT nCurrent TO Eval( ::bCurrent ) + __defaultNIL( @nTotal , Eval( ::bTotal ) ) + __defaultNIL( @nCurrent, Eval( ::bCurrent ) ) ::nTotal := nTotal ::nCurrent := nCurrent @@ -3264,12 +3265,12 @@ METHOD WvtProgressBar:New( oParent, nID, nTop, nLeft, nBottom, nRight ) METHOD WvtProgressBar:Create() - DEFAULT ::nTop TO 0 - DEFAULT ::nLeft TO 0 - DEFAULT ::nBottom TO iif( ::lVertical, ::nTop + 9, ::nTop ) - DEFAULT ::nRight TO iif( ::lVertical, ::nLeft + 1, ::nLeft + 19 ) - DEFAULT ::nTextColor TO RGB( 255, 255, 255 ) - DEFAULT ::nBackColor TO RGB( 198, 198, 198 ) + __defaultNIL( @::nTop , 0 ) + __defaultNIL( @::nLeft , 0 ) + __defaultNIL( @::nBottom , iif( ::lVertical, ::nTop + 9, ::nTop ) ) + __defaultNIL( @::nRight , iif( ::lVertical, ::nLeft + 1, ::nLeft + 19 ) ) + __defaultNIL( @::nTextColor, RGB( 255, 255, 255 ) ) + __defaultNIL( @::nBackColor, RGB( 198, 198, 198 ) ) ::bPaint := {|| ::Display() } AAdd( ::aPaint, { ::bPaint, { WVT_BLOCK_LABEL, ::nTop, ::nLeft, ::nBottom, ::nRight } } ) @@ -3286,8 +3287,8 @@ METHOD WvtProgressBar:Display( nCurrent, nTotal ) RETURN Self ENDIF - DEFAULT nCurrent TO ::nCurrent - DEFAULT nTotal TO ::nTotal + __defaultNIL( @nCurrent, ::nCurrent ) + __defaultNIL( @nTotal , ::nTotal ) ::nCurrent := nCurrent ::nTotal := nTotal diff --git a/harbour/contrib/gtwvg/combobox.prg b/harbour/contrib/gtwvg/combobox.prg index e13fd9f778..0a08b7aee2 100644 --- a/harbour/contrib/gtwvg/combobox.prg +++ b/harbour/contrib/gtwvg/combobox.prg @@ -67,7 +67,6 @@ // #include "hbclass.ch" -#include "common.ch" #include "inkey.ch" #include "hbgtinfo.ch" diff --git a/harbour/contrib/gtwvg/crt.prg b/harbour/contrib/gtwvg/crt.prg index adb498dc00..0e1e4236e0 100644 --- a/harbour/contrib/gtwvg/crt.prg +++ b/harbour/contrib/gtwvg/crt.prg @@ -67,7 +67,6 @@ // #include "hbclass.ch" -#include "common.ch" #include "inkey.ch" #include "hbgtinfo.ch" @@ -291,12 +290,12 @@ METHOD WvgCrt:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) LOCAL lRowCol := .T. - DEFAULT oParent TO ::oParent - DEFAULT oOwner TO ::oOwner - DEFAULT aPos TO ::aPos - DEFAULT aSize TO ::aSize - DEFAULT aPresParams TO ::aPresParams - DEFAULT lVisible TO ::visible + __defaultNIL( @oParent , ::oParent ) + __defaultNIL( @oOwner , ::oOwner ) + __defaultNIL( @aPos , ::aPos ) + __defaultNIL( @aSize , ::aSize ) + __defaultNIL( @aPresParams, ::aPresParams ) + __defaultNIL( @lVisible , ::visible ) ::oParent := oParent ::oOwner := oOwner @@ -367,12 +366,12 @@ METHOD WvgCrt:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) METHOD WvgCrt:configure( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) - DEFAULT oParent TO ::oParent - DEFAULT oOwner TO ::oOwner - DEFAULT aPos TO ::aPos - DEFAULT aSize TO ::aSize - DEFAULT aPresParams TO ::aPresParams - DEFAULT lVisible TO ::visible + __defaultNIL( @oParent , ::oParent ) + __defaultNIL( @oOwner , ::oOwner ) + __defaultNIL( @aPos , ::aPos ) + __defaultNIL( @aSize , ::aSize ) + __defaultNIL( @aPresParams, ::aPresParams ) + __defaultNIL( @lVisible , ::visible ) ::oParent := oParent ::oOwner := oOwner @@ -489,10 +488,10 @@ METHOD WvgCrt:hide() METHOD WvgCrt:invalidateRect( nTop, nLeft, nBottom, nRight ) - DEFAULT nTop TO 0 - DEFAULT nLeft TO 0 - DEFAULT nBottom TO MaxRow() - DEFAULT nRight TO MaxCol() + __defaultNIL( @nTop, 0 ) + __defaultNIL( @nLeft, 0 ) + __defaultNIL( @nBottom, MaxRow() ) + __defaultNIL( @nRight, MaxCol() ) Wvt_InvalidateRect( nTop, nLeft, nBottom, nRight ) @@ -618,7 +617,7 @@ METHOD WvgCrt:setPresParam() METHOD WvgCrt:setSize( aSize, lPaint ) IF HB_ISARRAY( aSize ) - DEFAULT lPaint TO .T. + __defaultNIL( @lPaint, .T. ) hb_gtInfo( HB_GTI_SCREENHEIGHT, aSize[ 1 ] ) hb_gtInfo( HB_GTI_SCREENWIDTH , aSize[ 2 ] ) diff --git a/harbour/contrib/gtwvg/dataref.prg b/harbour/contrib/gtwvg/dataref.prg index 614ca1eb10..7132876ed3 100644 --- a/harbour/contrib/gtwvg/dataref.prg +++ b/harbour/contrib/gtwvg/dataref.prg @@ -67,7 +67,6 @@ // #include "hbclass.ch" -#include "common.ch" #include "inkey.ch" #include "hbgtinfo.ch" diff --git a/harbour/contrib/gtwvg/dialog.prg b/harbour/contrib/gtwvg/dialog.prg index ec84eacccc..929e3e4880 100644 --- a/harbour/contrib/gtwvg/dialog.prg +++ b/harbour/contrib/gtwvg/dialog.prg @@ -67,7 +67,6 @@ // #include "hbclass.ch" -#include "common.ch" #include "inkey.ch" #include "hbgtinfo.ch" diff --git a/harbour/contrib/gtwvg/drawarea.prg b/harbour/contrib/gtwvg/drawarea.prg index 90372cf7e9..08bee00ee7 100644 --- a/harbour/contrib/gtwvg/drawarea.prg +++ b/harbour/contrib/gtwvg/drawarea.prg @@ -67,7 +67,6 @@ // #include "hbclass.ch" -#include "common.ch" #include "inkey.ch" #include "hbgtinfo.ch" diff --git a/harbour/contrib/gtwvg/genrc.prg b/harbour/contrib/gtwvg/genrc.prg index 916232447e..cc36564dcc 100644 --- a/harbour/contrib/gtwvg/genrc.prg +++ b/harbour/contrib/gtwvg/genrc.prg @@ -67,7 +67,6 @@ // #include "hbclass.ch" -#include "common.ch" #include "inkey.ch" #include "hbgtinfo.ch" diff --git a/harbour/contrib/gtwvg/htmlview.prg b/harbour/contrib/gtwvg/htmlview.prg index 55e8aa07ef..3d59143655 100644 --- a/harbour/contrib/gtwvg/htmlview.prg +++ b/harbour/contrib/gtwvg/htmlview.prg @@ -68,7 +68,6 @@ // #include "hbclass.ch" -#include "common.ch" #include "inkey.ch" #include "hbgtinfo.ch" @@ -251,4 +250,3 @@ METHOD WvgHTMLViewer:setHTML( cHTML ) RETURN self // - diff --git a/harbour/contrib/gtwvg/listbox.prg b/harbour/contrib/gtwvg/listbox.prg index 21f7e33690..0d7899f92e 100644 --- a/harbour/contrib/gtwvg/listbox.prg +++ b/harbour/contrib/gtwvg/listbox.prg @@ -67,7 +67,6 @@ // #include "hbclass.ch" -#include "common.ch" #include "inkey.ch" #include "hbgtinfo.ch" diff --git a/harbour/contrib/gtwvg/menubar.prg b/harbour/contrib/gtwvg/menubar.prg index fcdb4fbc7a..9f31ec624b 100644 --- a/harbour/contrib/gtwvg/menubar.prg +++ b/harbour/contrib/gtwvg/menubar.prg @@ -67,7 +67,6 @@ // #include "hbclass.ch" -#include "common.ch" #include "inkey.ch" #include "hbgtinfo.ch" @@ -142,9 +141,9 @@ ENDCLASS METHOD WvgMenuBar:new( oParent, aPresParams, lVisible ) - DEFAULT oParent TO ::oParent - DEFAULT aPresParams TO ::aPresParams - DEFAULT lVisible TO ::visible + __defaultNIL( @oParent , ::oParent ) + __defaultNIL( @aPresParams, ::aPresParams ) + __defaultNIL( @lVisible , ::visible ) ::oParent := oParent ::aPresParams := aPresParams @@ -158,9 +157,9 @@ METHOD WvgMenuBar:new( oParent, aPresParams, lVisible ) METHOD WvgMenuBar:create( oParent, aPresParams, lVisible ) - DEFAULT oParent TO ::oParent - DEFAULT aPresParams TO ::aPresParams - DEFAULT lVisible TO ::visible + __defaultNIL( @oParent , ::oParent ) + __defaultNIL( @aPresParams, ::aPresParams ) + __defaultNIL( @lVisible , ::visible ) ::oParent := oParent ::aPresParams := aPresParams @@ -199,9 +198,9 @@ METHOD WvgMenuBar:create( oParent, aPresParams, lVisible ) METHOD WvgMenuBar:configure( oParent, aPresParams, lVisible ) - DEFAULT oParent TO ::oParent - DEFAULT aPresParams TO ::aPresParams - DEFAULT lVisible TO ::visible + __defaultNIL( @oParent , ::oParent ) + __defaultNIL( @aPresParams, ::aPresParams ) + __defaultNIL( @lVisible , ::visible ) ::oParent := oParent ::aPresParams := aPresParams @@ -295,7 +294,7 @@ METHOD WvgMenuBar:putItem( aItem, nPos, lInsert ) LOCAL nItemIndex, cCaption LOCAL xCaption, bAction, nStyle, nAttrib - DEFAULT lInsert TO .T. + __defaultNIL( @lInsert, .T. ) ASize( aItem, 4 ) @@ -422,7 +421,7 @@ METHOD WvgMenuBar:checkItem( nItemNum, lCheck ) LOCAL nRet := - 1 - DEFAULT lCheck TO .T. + __defaultNIL( @lCheck, .T. ) IF !Empty( ::hMenu ) .AND. HB_ISNUMERIC( nItemNum ) nRet := WVG_CheckMenuItem( ::hMenu, nItemNum - 1, MF_BYPOSITION + iif( lCheck, MF_CHECKED, MF_UNCHECKED ) ) @@ -606,9 +605,9 @@ ENDCLASS METHOD WvgMenu:new( oParent, aPresParams, lVisible ) - DEFAULT oParent TO ::oParent - DEFAULT aPresParams TO ::aPresParams - DEFAULT lVisible TO ::visible + __defaultNIL( @oParent , ::oParent ) + __defaultNIL( @aPresParams, ::aPresParams ) + __defaultNIL( @lVisible , ::visible ) ::oParent := oParent ::aPresParams := aPresParams @@ -620,9 +619,9 @@ METHOD WvgMenu:new( oParent, aPresParams, lVisible ) METHOD WvgMenu:create( oParent, aPresParams, lVisible ) - DEFAULT oParent TO ::oParent - DEFAULT aPresParams TO ::aPresParams - DEFAULT lVisible TO ::visible + __defaultNIL( @oParent , ::oParent ) + __defaultNIL( @aPresParams, ::aPresParams ) + __defaultNIL( @lVisible , ::visible ) ::oParent := oParent ::aPresParams := aPresParams diff --git a/harbour/contrib/gtwvg/mle.prg b/harbour/contrib/gtwvg/mle.prg index 3becd22616..6a555a3fe7 100644 --- a/harbour/contrib/gtwvg/mle.prg +++ b/harbour/contrib/gtwvg/mle.prg @@ -67,7 +67,6 @@ // #include "hbclass.ch" -#include "common.ch" #include "inkey.ch" #include "hbgtinfo.ch" @@ -338,5 +337,3 @@ METHOD WvgMLE:cutMarked() RETURN n // - - diff --git a/harbour/contrib/gtwvg/paint.prg b/harbour/contrib/gtwvg/paint.prg index 1e3c8a061c..c32fa8d95c 100644 --- a/harbour/contrib/gtwvg/paint.prg +++ b/harbour/contrib/gtwvg/paint.prg @@ -61,7 +61,6 @@ // #include "wvtwin.ch" -#include "common.ch" // @@ -222,7 +221,7 @@ FUNCTION wvg_PurgePaint( cID, lDummy ) LOCAL n, aPaint - DEFAULT lDummy TO .F. + __defaultNIL( @lDummy, .F. ) IF ( n := AScan( t_paint_, {| e_ | e_[ 1 ] == cID } ) ) > 0 aPaint := t_paint_[ n ] @@ -242,7 +241,7 @@ FUNCTION wvg_InsertPaint( cID, aPaint, lSet ) LOCAL n - DEFAULT lSet TO .F. + __defaultNIL( @lSet, .F. ) IF ( n := AScan( t_paint_, {| e_ | e_[ 1 ] == cID } ) ) > 0 t_paint_[ n ] := aPaint @@ -296,12 +295,12 @@ FUNCTION Wvt_MakeDlgTemplate( nTop, nLeft, nRows, nCols, aOffSet, cTitle, nStyle aFont := Wvt_GetFontInfo() IF nMode == 0 - DEFAULT aOffSet TO {} + __defaultNIL( @aOffSet, {} ) ASize( aOffSet, 4 ) - DEFAULT aOffSet[ 1 ] TO 0 - DEFAULT aOffSet[ 2 ] TO 0 - DEFAULT aOffSet[ 3 ] TO 0 - DEFAULT aOffSet[ 4 ] TO 0 + __defaultNIL( @aOffSet[ 1 ], 0 ) + __defaultNIL( @aOffSet[ 2 ], 0 ) + __defaultNIL( @aOffSet[ 3 ], 0 ) + __defaultNIL( @aOffSet[ 4 ], 0 ) nBaseUnits := WVG_GetDialogBaseUnits() nBaseUnitsX := WVG_LOWORD( nBaseUnits ) @@ -377,14 +376,14 @@ FUNCTION Wvt_AddDlgItem( aDlg, nTop, nLeft, nRows, nCols, aOffSet, ; nBottom := nTop + nRows - 1 nRight := nLeft + nCols - 1 - DEFAULT aOffSet TO {} + __defaultNIL( @aOffSet, {} ) ASize( aOffSet, 4 ) - DEFAULT aOffSet[ 1 ] TO 0 - DEFAULT aOffSet[ 2 ] TO 0 - DEFAULT aOffSet[ 3 ] TO 0 - DEFAULT aOffSet[ 4 ] TO 0 + __defaultNIL( @aOffSet[ 1 ], 0 ) + __defaultNIL( @aOffSet[ 2 ], 0 ) + __defaultNIL( @aOffSet[ 3 ], 0 ) + __defaultNIL( @aOffSet[ 4 ], 0 ) nBaseUnits := WVG_GetDialogBaseUnits() nBaseUnitsX := WVG_LOWORD( nBaseUnits ) @@ -521,8 +520,8 @@ FUNCTION WVT_GetOpenFileName( hWnd, cPath, cTitle, acFilter, nFlags, cInitDir, c HB_SYMBOL_UNUSED( hWnd ) - DEFAULT cPath TO "" - DEFAULT nFlags TO OFN_EXPLORER + OFN_NOCHANGEDIR + __defaultNIL( @cPath , "" ) + __defaultNIL( @nFlags, OFN_EXPLORER + OFN_NOCHANGEDIR ) /* WIN_GETOPENFILENAME( [[@]], [], [], [],; * [], [[@]], [], [] ) @@ -566,7 +565,7 @@ FUNCTION WVT_GetSaveFileName( hWnd, cDefName, cTitle, acFilter, nFlags, cInitDir HB_SYMBOL_UNUSED( hWnd ) - DEFAULT nFlags TO OFN_EXPLORER + OFN_NOCHANGEDIR + __defaultNIL( @nFlags, OFN_EXPLORER + OFN_NOCHANGEDIR ) /* WIN_GETSAVEFILENAME( [[@]], [], [], [],; * [], [[@]], [], [] ) @@ -634,11 +633,11 @@ FUNCTION Wvt_SetIcon( ncIconRes, cIconName ) FUNCTION Wvt_SetFont( cFontName, nSize, nWidth, nWeight, nQuality ) - DEFAULT cFontName TO hb_gtInfo( HB_GTI_FONTNAME ) - DEFAULT nWidth TO hb_gtInfo( HB_GTI_FONTWIDTH ) - DEFAULT nWeight TO hb_gtInfo( HB_GTI_FONTWEIGHT ) - DEFAULT nQuality TO hb_gtInfo( HB_GTI_FONTQUALITY ) - DEFAULT nSize TO hb_gtInfo( HB_GTI_FONTSIZE ) + __defaultNIL( @cFontName, hb_gtInfo( HB_GTI_FONTNAME ) ) + __defaultNIL( @nWidth , hb_gtInfo( HB_GTI_FONTWIDTH ) ) + __defaultNIL( @nWeight , hb_gtInfo( HB_GTI_FONTWEIGHT ) ) + __defaultNIL( @nQuality , hb_gtInfo( HB_GTI_FONTQUALITY ) ) + __defaultNIL( @nSize , hb_gtInfo( HB_GTI_FONTSIZE ) ) RETURN hb_gtInfo( HB_GTI_SETFONT, { cFontName, nSize, nWidth, nWeight, nQuality } ) @@ -747,8 +746,8 @@ FUNCTION Wvt_GetWindowHandle() FUNCTION Wvt_CenterWindow( lCenter, lRePaint ) - DEFAULT lCenter TO .T. - DEFAULT lRePaint TO .F. + __defaultNIL( @lCenter , .T. ) + __defaultNIL( @lRePaint, .F. ) RETURN hb_gtInfo( HB_GTI_SPEC, HB_GTS_CENTERWINDOW, { lCenter, lRePaint } ) @@ -756,8 +755,8 @@ FUNCTION Wvt_CenterWindow( lCenter, lRePaint ) FUNCTION Wvt_WindowCentre( lCenter, lRePaint ) - DEFAULT lCenter TO .T. - DEFAULT lRePaint TO .F. + __defaultNIL( @lCenter , .T. ) + __defaultNIL( @lRePaint, .F. ) RETURN hb_gtInfo( HB_GTI_SPEC, HB_GTS_CENTERWINDOW, { lCenter, lRePaint } ) diff --git a/harbour/contrib/gtwvg/parthdlr.prg b/harbour/contrib/gtwvg/parthdlr.prg index f24124d36e..0f4c046352 100644 --- a/harbour/contrib/gtwvg/parthdlr.prg +++ b/harbour/contrib/gtwvg/parthdlr.prg @@ -67,7 +67,6 @@ // #include "hbclass.ch" -#include "common.ch" #include "inkey.ch" #include "hbgtinfo.ch" @@ -125,8 +124,8 @@ METHOD WvgPartHandler:new( oParent, oOwner ) METHOD WvgPartHandler:create( oParent, oOwner ) - DEFAULT oParent TO ::oParent - DEFAULT oOwner TO ::oOwner + __defaultNIL( @oParent, ::oParent ) + __defaultNIL( @oOwner , ::oOwner ) ::oParent := oParent ::oOwner := oOwner @@ -137,8 +136,8 @@ METHOD WvgPartHandler:create( oParent, oOwner ) METHOD WvgPartHandler:configure( oParent, oOwner ) - DEFAULT oParent TO ::oParent - DEFAULT oOwner TO ::oOwner + __defaultNIL( @oParent, ::oParent ) + __defaultNIL( @oOwner , ::oOwner ) ::oParent := oParent ::oOwner := oOwner diff --git a/harbour/contrib/gtwvg/pushbut.prg b/harbour/contrib/gtwvg/pushbut.prg index ea8961be83..3cdbd91ecb 100644 --- a/harbour/contrib/gtwvg/pushbut.prg +++ b/harbour/contrib/gtwvg/pushbut.prg @@ -67,7 +67,6 @@ // #include "hbclass.ch" -#include "common.ch" #include "inkey.ch" #include "hbgtinfo.ch" @@ -225,7 +224,7 @@ METHOD WvgPushButton:configure( oParent, oOwner, aPos, aSize, aPresParams, lVisi METHOD WvgPushButton:setCaption( xCaption, cDll ) - DEFAULT xCaption TO ::caption + __defaultNIL( @xCaption, ::caption ) HB_SYMBOL_UNUSED( cDll ) IF HB_ISSTRING( xCaption ) diff --git a/harbour/contrib/gtwvg/radiobut.prg b/harbour/contrib/gtwvg/radiobut.prg index bcd4f1e5b9..b6b9e0df8c 100644 --- a/harbour/contrib/gtwvg/radiobut.prg +++ b/harbour/contrib/gtwvg/radiobut.prg @@ -67,7 +67,6 @@ // #include "hbclass.ch" -#include "common.ch" #include "inkey.ch" #include "hbgtinfo.ch" diff --git a/harbour/contrib/gtwvg/scrollbr.prg b/harbour/contrib/gtwvg/scrollbr.prg index 207270b479..312999ab68 100644 --- a/harbour/contrib/gtwvg/scrollbr.prg +++ b/harbour/contrib/gtwvg/scrollbr.prg @@ -67,7 +67,6 @@ // #include "hbclass.ch" -#include "common.ch" #include "inkey.ch" #include "hbgtinfo.ch" diff --git a/harbour/contrib/gtwvg/sle.prg b/harbour/contrib/gtwvg/sle.prg index 3c3547cfee..8a7badf402 100644 --- a/harbour/contrib/gtwvg/sle.prg +++ b/harbour/contrib/gtwvg/sle.prg @@ -67,7 +67,6 @@ // #include "hbclass.ch" -#include "common.ch" #include "inkey.ch" #include "hbgtinfo.ch" diff --git a/harbour/contrib/gtwvg/statbar.prg b/harbour/contrib/gtwvg/statbar.prg index 84284837fe..a992c95232 100644 --- a/harbour/contrib/gtwvg/statbar.prg +++ b/harbour/contrib/gtwvg/statbar.prg @@ -67,7 +67,6 @@ // #include "hbclass.ch" -#include "common.ch" #include "inkey.ch" #include "hbgtinfo.ch" @@ -231,7 +230,7 @@ METHOD WvgStatusBar:addItem( cCaption, xImage, cDLL, nStyle, cKey, nMode ) LOCAL oPanel, lSuccess - DEFAULT nMode TO 0 + __defaultNIL( @nMode, 0 ) HB_SYMBOL_UNUSED( xImage ) HB_SYMBOL_UNUSED( cDLL ) @@ -364,9 +363,9 @@ ENDCLASS METHOD WvgStatusBarPanel:new( cCaption, nStyle, cKey ) - DEFAULT cCaption TO ::sl_caption - DEFAULT nStyle TO ::style - DEFAULT cKey TO ::key + __defaultNIL( @cCaption , ::sl_caption ) + __defaultNIL( @nStyle , ::style ) + __defaultNIL( @cKey , ::key ) ::sl_caption := cCaption ::style := nStyle @@ -382,7 +381,7 @@ METHOD WvgStatusBarPanel:caption( cCaption ) RETURN ::sl_caption ELSE - DEFAULT cCaption TO ::sl_caption + __defaultNIL( @cCaption, ::sl_caption ) ::sl_caption := cCaption diff --git a/harbour/contrib/gtwvg/static.prg b/harbour/contrib/gtwvg/static.prg index 36a47835c4..6318d01879 100644 --- a/harbour/contrib/gtwvg/static.prg +++ b/harbour/contrib/gtwvg/static.prg @@ -67,7 +67,6 @@ // #include "hbclass.ch" -#include "common.ch" #include "inkey.ch" #include "hbgtinfo.ch" @@ -300,7 +299,7 @@ METHOD WvgStatic:setCaption( xCaption, cDll ) HB_SYMBOL_UNUSED( cDll ) - DEFAULT xCaption TO ::caption + __defaultNIL( @xCaption, ::caption ) ::caption := xCaption DO CASE diff --git a/harbour/contrib/gtwvg/syswnd.prg b/harbour/contrib/gtwvg/syswnd.prg index 9ffae5ec48..138972b3e3 100644 --- a/harbour/contrib/gtwvg/syswnd.prg +++ b/harbour/contrib/gtwvg/syswnd.prg @@ -67,7 +67,6 @@ // #include "hbclass.ch" -#include "common.ch" #include "inkey.ch" #include "hbgtinfo.ch" @@ -118,9 +117,9 @@ ENDCLASS METHOD WvgSysWindow:new( oParent, oOwner, aPos ) - DEFAULT oParent TO ::oParent - DEFAULT oOwner TO ::oOwner - DEFAULT aPos TO ::aPos + __defaultNIL( @oParent, ::oParent ) + __defaultNIL( @oOwner , ::oOwner ) + __defaultNIL( @aPos , ::aPos ) ::oParent := oParent ::oOwner := oOwner @@ -134,9 +133,9 @@ METHOD WvgSysWindow:new( oParent, oOwner, aPos ) METHOD WvgSysWindow:create( oParent, oOwner, aPos ) - DEFAULT oParent TO ::oParent - DEFAULT oOwner TO ::oOwner - DEFAULT aPos TO ::aPos + __defaultNIL( @oParent, ::oParent ) + __defaultNIL( @oOwner , ::oOwner ) + __defaultNIL( @aPos , ::aPos ) ::oParent := oParent ::oOwner := oOwner @@ -297,11 +296,11 @@ ENDCLASS METHOD new( oParent, oOwner, oScreenPS, oPrinterPS, aPos ) CLASS WvgFontDialog - DEFAULT oParent TO ::oParent - DEFAULT oOwner TO ::oOwner - DEFAULT oScreenPS TO ::oScreenPS - DEFAULT oPrinterPS TO ::oPrinterPS - DEFAULT aPos TO ::aPos + __defaultNIL( @oParent , ::oParent ) + __defaultNIL( @oOwner , ::oOwner ) + __defaultNIL( @oScreenPS , ::oScreenPS ) + __defaultNIL( @oPrinterPS, ::oPrinterPS ) + __defaultNIL( @aPos , ::aPos ) ::oParent := oParent ::oOwner := oOwner @@ -317,11 +316,11 @@ METHOD new( oParent, oOwner, oScreenPS, oPrinterPS, aPos ) CLASS WvgFontDialog METHOD create( oParent, oOwner, oScreenPS, oPrinterPS, aPos ) CLASS WvgFontDialog - DEFAULT oParent TO ::oParent - DEFAULT oOwner TO ::oOwner - DEFAULT oScreenPS TO ::oScreenPS - DEFAULT oPrinterPS TO ::oPrinterPS - DEFAULT aPos TO ::aPos + __defaultNIL( @oParent , ::oParent ) + __defaultNIL( @oOwner , ::oOwner ) + __defaultNIL( @oScreenPS , ::oScreenPS ) + __defaultNIL( @oPrinterPS, ::oPrinterPS ) + __defaultNIL( @aPos , ::aPos ) ::oParent := oParent ::oOwner := oOwner @@ -460,7 +459,9 @@ METHOD GetWvgFont( aFont ) CLASS WvgFontDialog LOCAL oWvgFont - DEFAULT aFont TO Wvg_ChooseFont_GetLogFont( ::hWnd ) + IF aFont == NIL + aFont := Wvg_ChooseFont_GetLogFont( ::hWnd ) + ENDIF oWvgFont := WvgFont():new() @@ -541,7 +542,7 @@ ENDCLASS METHOD new( oPS ) CLASS WvgFont - DEFAULT oPS TO ::oPS + __defaultNIL( @oPS, ::oPS ) ::oPS := oPS @@ -551,7 +552,7 @@ METHOD new( oPS ) CLASS WvgFont METHOD create( cFontName ) CLASS WvgFont - DEFAULT cFontName TO ::familyName + __defaultNIL( @cFontName, ::familyName ) ::familyName := cFontName @@ -563,7 +564,7 @@ METHOD create( cFontName ) CLASS WvgFont METHOD configure( cFontName ) CLASS WvgFont - DEFAULT cFontName TO ::familyName + __defaultNIL( @cFontName, ::familyName ) ::familyName := cFontName diff --git a/harbour/contrib/gtwvg/tabpage.prg b/harbour/contrib/gtwvg/tabpage.prg index 7b830aefbf..1387a1c7a8 100644 --- a/harbour/contrib/gtwvg/tabpage.prg +++ b/harbour/contrib/gtwvg/tabpage.prg @@ -67,7 +67,6 @@ // #include "hbclass.ch" -#include "common.ch" #include "inkey.ch" #include "hbgtinfo.ch" @@ -141,7 +140,7 @@ METHOD create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) CLASS WvgTa ::SetWindowProcCallback() - DEFAULT ::caption TO " " + __defaultNIL( @::caption, " " ) WAPI_TabCtrl_InsertItem( ::pWnd, 0, ::caption ) diff --git a/harbour/contrib/gtwvg/toolbar.prg b/harbour/contrib/gtwvg/toolbar.prg index dbf0f6e99e..77a62da461 100644 --- a/harbour/contrib/gtwvg/toolbar.prg +++ b/harbour/contrib/gtwvg/toolbar.prg @@ -67,7 +67,6 @@ // #include "hbclass.ch" -#include "common.ch" #include "inkey.ch" #include "hbgtinfo.ch" @@ -497,9 +496,9 @@ ENDCLASS METHOD WvgToolBarButton:new( cCaption, nStyle, cKey ) - DEFAULT cCaption TO ::caption - DEFAULT nStyle TO ::style - DEFAULT cKey TO ::key + __defaultNIL( @cCaption , ::caption ) + __defaultNIL( @nStyle , ::style ) + __defaultNIL( @cKey , ::key ) ::caption := cCaption ::style := nStyle diff --git a/harbour/contrib/gtwvg/treeview.prg b/harbour/contrib/gtwvg/treeview.prg index f3bc5960ef..e43444344d 100644 --- a/harbour/contrib/gtwvg/treeview.prg +++ b/harbour/contrib/gtwvg/treeview.prg @@ -67,7 +67,6 @@ // #include "hbclass.ch" -#include "common.ch" #include "inkey.ch" #include "hbgtinfo.ch" diff --git a/harbour/contrib/gtwvg/wnd.prg b/harbour/contrib/gtwvg/wnd.prg index 698b66ea88..87cdaf235b 100644 --- a/harbour/contrib/gtwvg/wnd.prg +++ b/harbour/contrib/gtwvg/wnd.prg @@ -67,7 +67,6 @@ // #include "hbclass.ch" -#include "common.ch" #include "inkey.ch" #include "hbgtinfo.ch" @@ -276,12 +275,12 @@ ENDCLASS METHOD WvgWindow:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) - DEFAULT oParent TO ::oParent - DEFAULT oOwner TO ::oOwner - DEFAULT aPos TO ::aPos - DEFAULT aSize TO ::aSize - DEFAULT aPresParams TO ::aPresParams - DEFAULT lVisible TO ::visible + __defaultNIL( @oParent , ::oParent ) + __defaultNIL( @oOwner , ::oOwner ) + __defaultNIL( @aPos , ::aPos ) + __defaultNIL( @aSize , ::aSize ) + __defaultNIL( @aPresParams, ::aPresParams ) + __defaultNIL( @lVisible , ::visible ) ::oParent := oParent ::oOwner := oOwner @@ -298,12 +297,12 @@ METHOD WvgWindow:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) METHOD WvgWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) - DEFAULT oParent TO ::oParent - DEFAULT oOwner TO ::oOwner - DEFAULT aPos TO ::aPos - DEFAULT aSize TO ::aSize - DEFAULT aPresParams TO ::aPresParams - DEFAULT lVisible TO ::visible + __defaultNIL( @oParent , ::oParent ) + __defaultNIL( @oOwner , ::oOwner ) + __defaultNIL( @aPos , ::aPos ) + __defaultNIL( @aSize , ::aSize ) + __defaultNIL( @aPresParams, ::aPresParams ) + __defaultNIL( @lVisible , ::visible ) ::oParent := oParent ::oOwner := oOwner @@ -326,12 +325,12 @@ METHOD WvgWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) METHOD WvgWindow:configure( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) - DEFAULT oParent TO ::oParent - DEFAULT oOwner TO ::oOwner - DEFAULT aPos TO ::aPos - DEFAULT aSize TO ::aSize - DEFAULT aPresParams TO ::aPresParams - DEFAULT lVisible TO ::visible + __defaultNIL( @oParent , ::oParent ) + __defaultNIL( @oOwner , ::oOwner ) + __defaultNIL( @aPos , ::aPos ) + __defaultNIL( @aSize , ::aSize ) + __defaultNIL( @aPresParams, ::aPresParams ) + __defaultNIL( @lVisible , ::visible ) RETURN Self @@ -538,7 +537,7 @@ METHOD WvgWindow:setPos( aPos, lPaint ) LOCAL aPosSz IF HB_ISARRAY( aPos ) - DEFAULT lPaint TO .T. + __defaultNIL( @lPaint, .T. ) SWITCH ::objType @@ -568,11 +567,11 @@ METHOD WvgWindow:setPosAndSize( aPos, aSize, lPaint ) LOCAL aPosSz - DEFAULT aPos TO ::aPos - DEFAULT aSize TO ::aSize + __defaultNIL( @aPos , ::aPos ) + __defaultNIL( @aSize, ::aSize ) IF HB_ISARRAY( aPos ) .AND. HB_ISARRAY( aSize ) - DEFAULT lPaint TO .T. + __defaultNIL( @lPaint, .T. ) SWITCH ::objType @@ -596,7 +595,7 @@ METHOD WvgWindow:setSize( aSize, lPaint ) LOCAL aPosSz IF HB_ISARRAY( aSize ) - DEFAULT lPaint TO .T. + __defaultNIL( @lPaint, .T. ) SWITCH ::objType @@ -1270,12 +1269,12 @@ METHOD WvgWindow:dragDrop( xParam, xParam1 ) METHOD WvgWindow:Initialize( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) - DEFAULT oParent TO ::oParent - DEFAULT oOwner TO ::oOwner - DEFAULT aPos TO ::aPos - DEFAULT aSize TO ::aSize - DEFAULT aPresParams TO ::aPresParams - DEFAULT lVisible TO ::visible + __defaultNIL( @oParent , ::oParent ) + __defaultNIL( @oOwner , ::oOwner ) + __defaultNIL( @aPos , ::aPos ) + __defaultNIL( @aSize , ::aSize ) + __defaultNIL( @aPresParams, ::aPresParams ) + __defaultNIL( @lVisible , ::visible ) ::oParent := oParent ::oOwner := oOwner @@ -1322,8 +1321,8 @@ METHOD WvgWindow:getPosAndSize( aPs, aSz ) LOCAL aPos, aSize LOCAL nFH, nFW - DEFAULT aPs TO AClone( ::aPos ) - DEFAULT aSz TO AClone( ::aSize ) + __defaultNIL( @aPs, AClone( ::aPos ) ) + __defaultNIL( @aSz, AClone( ::aSize ) ) aPos := AClone( aPs ) aSize := AClone( aSz ) diff --git a/harbour/contrib/hbmisc/numtxtru.prg b/harbour/contrib/hbmisc/numtxtru.prg index 55c3cb7630..693493d0ef 100644 --- a/harbour/contrib/hbmisc/numtxtru.prg +++ b/harbour/contrib/hbmisc/numtxtru.prg @@ -509,7 +509,7 @@ STATIC FUNCTION MnyToStrRaw( nValue, cLang, aCur, nMode ) cRetVal := NumToStrRaw( nValue, aMsg, aCur[ 1 ] ) ENDIF ELSE - cRetVal := LTrim( iif( nValue < 100, StrZero( nValue, 2 ), Str( nValue ) ) ) + cRetVal := iif( nValue < 100, StrZero( nValue, 2 ), hb_ntos( nValue ) ) ENDIF IF ! lShort diff --git a/harbour/contrib/hbmisc/tests/numtxtru.prg b/harbour/contrib/hbmisc/tests/numtxtru.prg index f72d086855..48e9d51a77 100644 --- a/harbour/contrib/hbmisc/tests/numtxtru.prg +++ b/harbour/contrib/hbmisc/tests/numtxtru.prg @@ -2,11 +2,16 @@ * $Id$ */ -REQUEST HB_CODEPAGE_RU1251 +#require "hbmisc" + +REQUEST HB_CODEPAGE_UTF8EX PROCEDURE Main() - HB_CDPSelect( "RU1251" ) + CLS + + hb_cdpSelect( "UTF8EX" ) + hb_SetTermCP( "UTF8EX" ) ? "Press ESC to break" ? "Russian" @@ -18,21 +23,14 @@ PROCEDURE Main() RETURN -PROCEDURE test( cLang ) +PROCEDURE Test( cLang ) LOCAL nTemp - dbCreate( "_num_" + cLang, ; - { { "NUM" , "N", 19, 0 },; - { "STR1", "C", 100, 0 },; - { "STR2", "C", 100, 0 },; - { "STR3", "C", 50, 0 } }, , .T. , "num" ) FOR nTemp := 1 TO 1000000000 - num->( dbAppend() ) - num->Num := nTemp - num->Str1 := MnyToTxtRU( nTemp + ( nTemp % 100 ) * 0.01, cLang, , 3 ) - num->Str2 := NumToTxtRU( nTemp, cLang, , .T. ) - num->Str3 := DateToTxtRU( Date() + nTemp, cLang, .T. ) + OutStd( PadR( MnyToTxtRU( nTemp + ( nTemp % 100 ) * 0.01, cLang, , 3 ), 100 ) + " " +; + PadR( NumToTxtRU( nTemp, cLang, , .T. ), 100 ) + " " +; + PadR( DateToTxtRU( Date() + nTemp, cLang, .T. ), 50 ) + hb_eol() ) IF nTemp % 1000 == 0 ? nTemp ENDIF @@ -42,6 +40,5 @@ PROCEDURE test( cLang ) ENDIF ENDIF NEXT - CLOSE RETURN diff --git a/harbour/extras/httpsrv/cgifunc.prg b/harbour/extras/httpsrv/cgifunc.prg index 35be6d8e9e..11d015f580 100644 --- a/harbour/extras/httpsrv/cgifunc.prg +++ b/harbour/extras/httpsrv/cgifunc.prg @@ -50,7 +50,6 @@ * */ -#include "common.ch" #include "error.ch" #include "fileio.ch" @@ -66,7 +65,7 @@ FUNCTION uhttpd_GetVars( cFields, cSeparator ) LOCAL hHashVars := { => } LOCAL aField, cField, aFields LOCAL cName, xValue - DEFAULT cSeparator TO "&" + __defaultNIL( @cSeparator, "&" ) aFields := uhttpd_Split( cSeparator, cFields ) @@ -285,9 +284,9 @@ FUNCTION uhttpd_SplitString( cString, cDelim, lRemDelim, nCount ) LOCAL aLines := {}, cLine LOCAL nHowMany := 0 - DEFAULT cDelim TO ( CHR( 13 ) + CHR( 10 ) ) - DEFAULT lRemDelim TO .T. - DEFAULT nCount TO -1 + __defaultNIL( @cDelim, ( CHR( 13 ) + CHR( 10 ) ) ) + __defaultNIL( @lRemDelim, .T. ) + __defaultNIL( @nCount, -1 ) //WriteToLogFile( "Splitstring: " + cStr( cString ) ) @@ -320,12 +319,12 @@ RETURN aLines */ FUNCTION uhttpd_URLEncode( cString, lComplete ) #ifdef HB_USE_HBTIP - DEFAULT lComplete TO .T. + __defaultNIL( @lComplete, .T. ) RETURN TIPENCODERURL_ENCODE( cString, lComplete ) #else LOCAL cRet := "", i, nVal, cChar - DEFAULT lComplete TO .T. + __defaultNIL( @lComplete, .T. ) FOR i := 1 TO Len( cString ) cChar := SubStr( cString, i, 1) @@ -396,10 +395,10 @@ FUNCTION uhttpd_DateToGMT( dDate, cTime, nDayToAdd, nSecsToAdd ) LOCAL aDays := { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" } LOCAL aMonths := { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" } - DEFAULT dDate TO DATE() - DEFAULT cTime TO TIME() - DEFAULT nDayToAdd TO 0 - DEFAULT nSecsToAdd TO 0 + __defaultNIL( @dDate, DATE() ) + __defaultNIL( @cTime, TIME() ) + __defaultNIL( @nDayToAdd, 0 ) + __defaultNIL( @nSecsToAdd, 0 ) //Tracelog( "DateToGMT - StartingValue", dDate, cTime, nDayToAdd, nSecsToAdd ) @@ -438,9 +437,10 @@ FUNCTION uhttpd_AddSecondsToTime( cTime, nSecsToAdd, nDaysAdded ) LOCAL nOneDaySeconds := 86400 // 24 * 60 * 60 LOCAL cNewTime, nSecs - DEFAULT cTime TO TIME() - DEFAULT nSecsToAdd TO 0 - DEFAULT nDaysAdded TO 0 // nDaysAdded can be already valued, so below i add to this value + __defaultNIL( @cTime, TIME() ) + __defaultNIL( @nSecsToAdd, 0 ) + // nDaysAdded can be already valued, so below i add to this value + __defaultNIL( @nDaysAdded, 0 ) IF nSecsToAdd != 0 nSecs := Secs( cTime ) + nSecsToAdd @@ -456,8 +456,8 @@ RETURN cNewTime FUNCTION uhttpd_TimeDiffAsSeconds( dDateStart, dDateEnd, cTimeStart, cTimeEnd ) LOCAL aRetVal - DEFAULT dDateEnd TO DATE() - DEFAULT cTimeEnd TO TIME() + __defaultNIL( @dDateEnd, DATE() ) + __defaultNIL( @cTimeEnd, TIME() ) aRetVal := FT_ELAPSED( dDateStart, dDateEnd, cTimeStart, cTimeEnd ) @@ -465,8 +465,8 @@ RETURN aRetVal[ 4, 2 ] FUNCTION uhttpd_OutputString( cString, aTranslate, lProtected ) LOCAL cHtml - DEFAULT lProtected TO .F. - DEFAULT aTranslate TO { { '"', '"' }, { ' ', ' ' } } + __defaultNIL( @lProtected, .F. ) + __defaultNIL( @aTranslate, { { '"', '"' }, { ' ', ' ' } } ) //TraceLog( "OutputString( cString, aTranslate, lProtected )", cString, aTranslate, lProtected ) IF lProtected @@ -487,7 +487,7 @@ FUNCTION uhttpd_HtmlSpecialChars( cString, cQuote_style ) RETURN uhttpd_HtmlConvertChars( cString, cQuote_style, aTranslations ) FUNCTION uhttpd_HtmlConvertChars( cString, cQuote_style, aTranslations ) - DEFAULT cQuote_style TO "ENT_COMPAT" + __defaultNIL( @cQuote_style, "ENT_COMPAT" ) DO CASE CASE cQuote_style == "ENT_COMPAT" aAdd( aTranslations, { '"', '"' } ) @@ -709,9 +709,9 @@ PROCEDURE uhttpd_WriteToLogFile( cString, cLog, lCreate ) cSep := hb_ps() - //DEFAULT cLog TO AppFullPath() + cSep + "logfile.log" - DEFAULT cLog TO cSep + "tmp" + cSep + "logfile.log" - DEFAULT lCreate TO .F. +// __defaultNIL( @cLog, AppFullPath() + cSep + "logfile.log" ) + __defaultNIL( @cLog, cSep + "tmp" + cSep + "logfile.log" ) + __defaultNIL( @lCreate, .F. ) IF cLog != NIL diff --git a/harbour/extras/httpsrv/cookie.prg b/harbour/extras/httpsrv/cookie.prg index 241926eb75..e0a1dd6915 100644 --- a/harbour/extras/httpsrv/cookie.prg +++ b/harbour/extras/httpsrv/cookie.prg @@ -50,7 +50,6 @@ * */ -#include "common.ch" #include "hbclass.ch" #command IF THEN <*statement*> =>; @@ -99,10 +98,13 @@ METHOD SetCookieDefaults( cDomain, cPath, nExpireDays, nExpireSecs ) CLASS uhttp METHOD SetCookie( cCookieName, xValue, cDomain, cPath, cExpires, lSecure, lHttpOnly ) CLASS uhttpd_Cookie LOCAL cStr, nPos, nCookies - DEFAULT cDomain TO ::cDomain - DEFAULT cPath TO ::cPath - DEFAULT cExpires TO uhttpd_DateToGMT( Date(), Time(), ::nExpireDays, ::nExpireSecs ) - DEFAULT lHttpOnly TO .F. + __defaultNIL( @cDomain, ::cDomain ) + __defaultNIL( @cPath, ::cPath ) + __defaultNIL( @lHttpOnly, .F. ) + + IF cExpires == NIL + cExpires := uhttpd_DateToGMT( Date(), Time(), ::nExpireDays, ::nExpireSecs ) + ENDIF ::lHttpOnly := lHttpOnly diff --git a/harbour/extras/httpsrv/session.prg b/harbour/extras/httpsrv/session.prg index 520d3a7cf1..50520d9714 100644 --- a/harbour/extras/httpsrv/session.prg +++ b/harbour/extras/httpsrv/session.prg @@ -50,7 +50,6 @@ * */ -#include "common.ch" #include "hbclass.ch" #include "fileio.ch" #include "directry.ch" @@ -165,8 +164,8 @@ METHOD New( cSessionName, cSessionPath ) CLASS uhttpd_Session //hb_ToOutDebug( "cSessionName = %s, cSessionPath = %s\n\r", cSessionName, cSessionPath ) - DEFAULT cSessionName TO "SESSION" - DEFAULT cSessionPath TO ::cSavePath + __defaultNIL( @cSessionName, "SESSION" ) + __defaultNIL( @cSessionPath, ::cSavePath ) //::cSID := ::GenerateSID() @@ -414,7 +413,7 @@ METHOD GetSessionVars( aHashVars, cFields, cSeparator ) CLASS uhttpd_Session LOCAL cSessPrefix := ::cName + "_" LOCAL cFieldsNotInSession := "" LOCAL cSessVarName - DEFAULT cSeparator TO "&" + __defaultNIL( @cSeparator, "&" ) aFields := hb_regexSplit( cSeparator, cFields ) @@ -490,8 +489,9 @@ METHOD GenerateSID( cCRCKey ) CLASS uhttpd_Session LOCAL nLenTemp //LOCAL a := 0 - //DEFAULT cCRCKey TO "3InFoW4lL5" // Max Lenght must to be 10 - DEFAULT cCRCKey TO MY_CRCKEY // Max Lenght must to be 10 + // Max Lenght must to be 10 +// __defaultNIL( @cCRCKey, "3InFoW4lL5" ) + __defaultNIL( @cCRCKey, MY_CRCKEY ) /* Let's generate the sequence */ //cSID := Space( nLenSID ) @@ -529,9 +529,10 @@ METHOD CheckSID( cSID, cCRCKey ) CLASS uhttpd_Session LOCAL lOk //LOCAL a := 0 - DEFAULT ::cSID TO ::RegenerateID() - DEFAULT cSID TO ::cSID - DEFAULT cCRCKey TO MY_CRCKEY // Max Lenght must to be 10 + __defaultNIL( @::cSID, ::RegenerateID() ) + __defaultNIL( @cSID, ::cSID ) + // Max Lenght must to be 10 + __defaultNIL( @cCRCKey, MY_CRCKEY ) //hb_toOutDebug( "cSID = %s, ::cSID = %s\n\r", hb_valtoexp( cSID ), hb_valtoexp( ::cSID ) ) @@ -592,7 +593,7 @@ METHOD SessionRead( cID ) CLASS uhttpd_Session LOCAL cBuffer LOCAL nRetry := 0 - DEFAULT cID TO ::cSID + __defaultNIL( @cID, ::cSID ) cFile := ::cSavePath + hb_ps() + ::cName + "_" + cID //TraceLog( "SessionRead: cFile", cFile ) IF File( cFile ) @@ -632,8 +633,8 @@ METHOD SessionWrite( cID, cData ) CLASS uhttpd_Session LOCAL nRetry := 0 //TraceLog( "SessionWrite() - cID, cData", cID, cData ) - DEFAULT cID TO ::cSID - DEFAULT cData TO "" + __defaultNIL( @cID, ::cSID ) + __defaultNIL( @cData, "" ) nFileSize := Len( cData ) @@ -671,7 +672,7 @@ METHOD SessionDestroy( cID ) CLASS uhttpd_Session LOCAL nRetry := 0 //TraceLog( "SessionDestroy() - cID", cID ) - DEFAULT cID TO ::cSID + __defaultNIL( @cID, ::cSID ) _SESSION := { => } ::oCookie:DeleteCookie( ::cName ) @@ -706,7 +707,7 @@ METHOD SessionGC( nMaxLifeTime ) CLASS uhttpd_Session LOCAL nSecs LOCAL aDir, aFile - DEFAULT nMaxLifeTime TO ::nGc_MaxLifeTime + __defaultNIL( @nMaxLifeTime, ::nGc_MaxLifeTime ) aDir := Directory( ::cSavePath + hb_ps() + ::cName + "_*.*" ) FOR EACH aFile IN aDir @@ -724,8 +725,8 @@ METHOD SessionGC( nMaxLifeTime ) CLASS uhttpd_Session STATIC FUNCTION TimeDiffAsSeconds( dDateStart, dDateEnd, cTimeStart, cTimeEnd ) LOCAL aRetVal - DEFAULT dDateEnd TO DATE() - DEFAULT cTimeEnd TO TIME() + __defaultNIL( @dDateEnd, DATE() ) + __defaultNIL( @cTimeEnd, TIME() ) aRetVal := FT_ELAPSED( dDateStart, dDateEnd, cTimeStart, cTimeEnd ) diff --git a/harbour/extras/httpsrv/uhttpd.prg b/harbour/extras/httpsrv/uhttpd.prg index 3df7e366b3..9d23b50f6c 100644 --- a/harbour/extras/httpsrv/uhttpd.prg +++ b/harbour/extras/httpsrv/uhttpd.prg @@ -85,7 +85,6 @@ #define FIXED_THREADS // This force application to use fixed number of running threads and no service threads #include "fileio.ch" -#include "common.ch" #include "inkey.ch" #include "error.ch" #include "hbmemory.ch" @@ -1639,8 +1638,9 @@ PROCEDURE uhttpd_SetStatusCode(nStatusCode) PROCEDURE uhttpd_SetHeader( cType, cValue ) - //LOCAL nI - //DEFAULT lReplace TO .T. // Needed from SetCookie() +// LOCAL nI +// // Needed from SetCookie() +// __defaultNIL( @lReplace, .T. ) hb_HSet( _HTTP_RESPONSE, cType, cValue ) @@ -1658,7 +1658,7 @@ PROCEDURE uhttpd_SetHeader( cType, cValue ) FUNCTION uhttpd_GetHeader( cType ) RETURN uhttpd_HGetValue( _HTTP_RESPONSE, cType ) /* - DEFAULT nPos TO 1 + __defaultNIL( @nPos, 1 ) nPos := hb_HPos( hHash, cKey )) IF ( nPos := ASCAN( t_aHeader, {| x | UPPER( x[ 1 ] ) == UPPER( cType ) }, nPos ) ) > 0 @@ -1802,7 +1802,7 @@ FUNCTION uhttpd_split( cSeparator, cString, nMax ) LOCAL aRet := {}, nI LOCAL nIter := 0 - DEFAULT nMax TO 0 + __defaultNIL( @nMax, 0 ) DO WHILE ( nI := AT( cSeparator, cString ) ) > 0 AADD( aRet, LEFT( cString, nI - 1 ) )