1. C:\hmg.3.1.4\SAMPLES\ProgramExecution\CONSOLE, need to add at first lines of source code, following line: REQUEST HB_GT_WIN_DEFAULT
2. C:\hmg.3.1.4\SAMPLES\ProgramExecution\MIXEDCONSOLE, GUI-window would be good to change position, in order to be shown both sessions separeted and add different aproach at console displaying. My changings of this code is:
Code: Select all
#include "hmg.ch"
REQUEST HB_GT_WIN_DEFAULT
Function Main
SetMode(25,80)
DEFINE WINDOW form_1 AT 100 , 700 WIDTH 200 HEIGHT 200 TITLE "Mixed Mode Demo" MAIN
DEFINE BUTTON Button_1
ROW 10
COL 10
CAPTION "Test Console"
ACTION TestConsole()
END BUTTON
END WINDOW
// CENTER WINDOW form_1
ACTIVATE WINDOW form_1
Return Nil
Function TestConsole()
? 'Hello'
If Row()>10
Cls
Endif
Return nil
- a. C:\hmg.3.1.4\SAMPLES\ProgramExecution\MULTIPRG\lib1\buildlib.bat, need to fix HMGPATH. I suggest to replace where the line is actually this SET HMGPATH=\hmg.3.0.45 with this:
for %%A in ("%~dp0..\..\..\..\.") do @SET HMGPATH=%%~fA
Or better than that, change all buildlib.bat file for this:
b. C:\hmg.3.1.4\SAMPLES\ProgramExecution\MULTIPRG\lib1\libtest1.hbp, at line of -olibtest1 needs to be replaced with -otest1@Echo off
SET temp1=%~dp0
SET temp2=%temp1%
SET pos=0
:loop
SET /a pos+=1
echo %temp2%|FINDSTR /b /c:"SAMPLES" >NUL
IF ERRORLEVEL 1 (
SET temp2=%temp2:~1%
IF DEFINED temp2 GOTO loop
SET pos=0
)
SETLOCAL EnableDelayedExpansion
set "temp3=%temp1%"
set /a pos=pos-2
set temp1=!temp3:~0,%pos%!
set PATH=%temp1%\harbour\bin;%temp1%\mingw\bin;%PATH%
if "%1"=="" for %%x in (*.hbp) do (hbmk2 %%x -i%temp1%\include)
c. C:\hmg.3.1.4\SAMPLES\ProgramExecution\MULTIPRG\lib1\libtest2.hbp, at line of -olibtest2 needs to be replaced with -otest2
Code: Select all
/*
* HMG Grid Demo
* (c) 2005 Roberto Lopez
*
* ListView SORT ORDER COLUMN
* Author: BADIK <badik@mail.ru>
*/
#include "hmg.ch"
Memvar fColor
Function Main()
Local aRows [20] [3]
Private fColor := { || if ( This.CellRowIndex/2 == int(This.CellRowIndex/2) , { 0,0,255 } , { 0,255,0 } ) }
DEFINE WINDOW Form_1 ;
AT 0,0 ;
WIDTH 640 ;
HEIGHT 400 ;
TITLE 'Mixed Data Type Grid Test' ;
MAIN
DEFINE MAIN MENU
DEFINE POPUP 'File'
MENUITEM 'Set New Columns Order' ACTION SetOrder()
MENUITEM 'Get Columns Order' ACTION GetOrder()
MENUITEM 'Refresh Grid' ACTION Form_1.Grid_1.Refresh
SEPARATOR
MENUITEM 'Exit' ACTION Form_1.Release
END POPUP
END MENU
aRows [1] := { 113.12,date(),1,1 , .t. }
aRows [2] := { 123.12,date(),2,2 , .f. }
aRows [3] := { 133.12,date(),3,3, .t. }
aRows [4] := { 143.12,date(),1,4, .f. }
aRows [5] := { 153.12,date(),2,5, .t. }
aRows [6] := { 163.12,date(),3,6, .f. }
aRows [7] := { 173.12,date(),1,7, .t. }
aRows [8] := { 183.12,date(),2,8, .f. }
aRows [9] := { 193.12,date(),3,9, .t. }
aRows [10] := { 113.12,date(),1,10, .f. }
aRows [11] := { 123.12,date(),2,11, .t. }
aRows [12] := { 133.12,date(),3,12, .f. }
aRows [13] := { 143.12,date(),1,13, .t. }
aRows [14] := { 153.12,date(),2,14, .f. }
aRows [15] := { 163.12,date(),3,15, .t. }
aRows [16] := { 173.12,date(),1,16, .f. }
aRows [17] := { 183.12,date(),2,17, .t. }
aRows [18] := { 193.12,date(),3,18, .f. }
aRows [19] := { 113.12,date(),1,19, .t. }
aRows [20] := { 123.12,date(),2,20, .f. }
@ 10,10 GRID Grid_1 ;
WIDTH 620 ;
HEIGHT 330 ;
HEADERS {'Column 1','Column 2','Column 3','Column 4','Column 5'} ;
WIDTHS {140,140,140,140,140} ;
ITEMS aRows ;
EDIT ;
COLUMNCONTROLS { ;
{'TEXTBOX' , 'NUMERIC' , '$ 999,999.99'} , ;
{'DATEPICKER' , 'DROPDOWN'} , ;
{'COMBOBOX' , {'One' , 'Two' , 'Three'}} , ;
{ 'SPINNER' , 1 , 20 } , ;
{ 'CHECKBOX' , 'Yes' , 'No' } ;
} ;
COLUMNWHEN { ;
{ || This.CellValue > 120 } , ;
{ || This.CellValue = Date() } , ;
Nil , ;
Nil , ;
Nil ;
} ;
DYNAMICFORECOLOR { fColor , fColor, fColor, fColor, fColor }
END WINDOW
CENTER WINDOW Form_1
ACTIVATE WINDOW Form_1
Return Nil
Function SetOrder()
Local aColumns := { 5, 4, 3, 2, 1 }
_SetColumnOrderArray( "Grid_1", "Form_1", aColumns )
Form_1.Grid_1.Refresh
Return Nil
Function GetOrder()
Local a := _GetColumnOrderArray( "Grid_1", "Form_1" )
// msgdebug(a)
aEval( a, {|x,i| MsgInfo ( "Column " + ltrim( str ( x ) ), ltrim( str ( i ) ) )} )
Return Nil
Function _GetColumnOrderArray( ControlName , ParentForm )
Local i, nColumn, aSort
i := GetControlIndex( ControlName , ParentForm )
nColumn := len(_HMG_SYSDATA [ 33 ] [i])
aSort := array(nColumn)
My_ListView_GetColumnOrderArray( _HMG_SYSDATA [ 3 ] [i], nColumn, @aSort )
Return aSort
Function _SetColumnOrderArray( ControlName , ParentForm, aSort )
Local i, nColumn
i := GetControlIndex( ControlName , ParentForm )
nColumn := len(_HMG_SYSDATA [ 33 ] [i])
ListView_SetColumnOrderArray( _HMG_SYSDATA [ 3 ] [i], nColumn, aSort )
Return Nil
#pragma BEGINDUMP
#define _WIN32_IE 0x0500
#include <windows.h>
#include <commctrl.h>
#include "hbapi.h"
#include "hbvm.h"
HB_FUNC ( MY_LISTVIEW_GETCOLUMNORDERARRAY )
{
int nColumn = hb_parni(2);
LPINT pnOrder = (LPINT) malloc(nColumn*sizeof(int));
int i;
ListView_GetColumnOrderArray( (HWND) hb_parnl(1), nColumn, pnOrder );
for (i=0; i<nColumn; i++)
{
hb_storvni(pnOrder[i]+1, 3, i+1);
}
}
#pragma ENDDUMP
6. C:\hmg.3.1.4\hfcl\Samples\HMGHPDFDoc, not able to compile (by prompt command or clicking Build.bat). Please replace last lines where are:
call %temp%\build.bat %MainFile%
pause
With this:
if "%1"=="" for %%x in (*.hbp) do (call %temp%\build.bat %%x)
if not "%1"=="" call %temp%\build.bat %1
7. C:\hmg.3.1.4\hfcl\Samples\GridPrintPreFormat, Main.,prg need to correct at line of:
a. Form_1.Grid_1.Item (2) := { 123.45 , date() , 2 , 10 , .T. }
to be replaced with this:
Form_1.Grid_1.Item (2) := { 2 , date() , 456.12 , 10 , .T. }
b. Error after Print option. Needs to Rebuild libhbvpdf.a at C:\hmg.3.1.5\SOURCE\hbvpdf.
8. C:\hmg.3.1.4\SAMPLES\TUTORIAL, the Build.bat should be improved just to attend ALL sample projects to be builded at once when is executing without parameter. I suggest to change Build.bat for this:
It was simplified just for better understanding and improved for multiple hbp files. Alias this file should replace all remaining Build.bat, for a project to compile and various existing in the current folder.@Echo OFF
SET temp1=%~dp0
SET temp2=%temp1%
SET pos=0
:loop
SET /a pos+=1
echo %temp2%|FINDSTR /b /c:"SAMPLES" >NUL
IF ERRORLEVEL 1 (
SET temp2=%temp2:~1%
IF DEFINED temp2 GOTO loop
SET pos=0
)
SETLOCAL EnableDelayedExpansion
set "temp3=%temp1%"
set /a pos=pos-2
set temp1=!temp3:~0,%pos%!
if "%1"=="" for %%x in (*.hbp) do (call %temp1%\build.bat %%x)
if not "%1"=="" call %temp1%\build.bat %1
9. C:\hmg.3.1.4\hfcl\Samples\BosTaurus, IMO, the BT_Build_All_Demos.bat file would be replaced by Build.bat just to attend all building demos files and for independent file to be re-builded, like as:
The only difference is subfolder hfcl with other SAMPLES folder.@Echo OFF
SET temp1=%~dp0
SET temp2=%temp1%
SET pos=0
:loop
SET /a pos+=1
echo %temp2%|FINDSTR /b /c:"hfcl" >NUL
IF ERRORLEVEL 1 (
SET temp2=%temp2:~1%
IF DEFINED temp2 GOTO loop
SET pos=0
)
SETLOCAL EnableDelayedExpansion
set "temp3=%temp1%"
set /a pos=pos-2
set temp1=!temp3:~0,%pos%!
if "%1"=="" for %%x in (*.hbp) do (call %temp1%\build.bat %%x)
if not "%1"=="" call %temp1%\build.bat %1
10. C:\hmg.3.1.4\Samples\Ide.bat, this file was also modified, as follows:
Code: Select all
@Echo OFF
SET temp1=%~dp0
SET temp2=%temp1%
SET pos=0
:loop
SET /a pos+=1
echo %temp2%|FINDSTR /b /c:"SAMPLES" >NUL
IF ERRORLEVEL 1 (
SET temp2=%temp2:~1%
IF DEFINED temp2 GOTO loop
SET pos=0
)
SETLOCAL EnableDelayedExpansion
set "temp3=%temp1%"
set /a pos=pos-2
set temp1=!temp3:~0,%pos%!
if "%1"=="" for %%x in (*.hbp) do (%temp1%\ide\ide.exe %%x)
if not "%1"=="" %temp1%\ide\ide.exe %1
11. C:\hmg.3.1.4\Samples\Controls\MENU_ControlContext.2, is missing prg file. There is another ContextMenu sample at c:\hmg.3.1.4\SAMPLES\EXTERNAL.WINDOWS\CONTEXTMENU which can be replaced for. Just to having all ContextMenu in only one place.
12. C:\hmg.3.1.4\Samples\USER.COMPONENTS, it does not compiles. I have some suggestions to let this example workable and make independent sample and not as is now with includes files being part of HMG main project. My suggestions are:
- a. There are two includes files: i_UsrInit.ch and i_UsrSOOP.ch at c:\hmg.3.1.4\INCLUDE folder which will be not necessary to have it as internal HMG file. These files could be deleted.
b. In place of these two files should be created only one with name UserInit.ch at c:\hmg.3.1.4\SAMPLES\USER.COMPONENTS folder (at current folder) and with the following content:c. Edit c:\hmg.3.1.4\SAMPLES\USER.COMPONENTS\demo.prg to add #Include "UserInit.ch"Code: Select all
#define BASEDEF_MYBUTTON #xcommand @ <row>,<col> MYBUTTON <name> ; OF <parent> ; CAPTION <caption> ; ACTION <action> ; =>; _DefineMyButton(<"name">,<row>,<col>,<caption>,<{action}>,<"parent">) #undef BASEDEF_MYBUTTON #xcommand DECLARE CUSTOM COMPONENTS <Window> ; =>; _dummy() ;; #define SOOP_MYBUTTON ;; #xtranslate <Window> . \<Control\> . Disable => Domethod ( <"Window">, \<"Control"\> , "Disable" ) ;; #xtranslate <Window> . \<Control\> . Enable => Domethod ( <"Window">, \<"Control"\> , "Enable" ) ;; #xtranslate <Window> . \<Control\> . Handle => GetProperty ( <"Window">, \<"Control"\> , "Handle" ) ;; #xtranslate <Window> . \<Control\> . Handle := \<v\> => SetProperty ( <"Window">, \<"Control"\> , "Handle" , \<v\> ) ;; #undef SOOP_MYBUTTON ;;
d. Edit c:\hmg.3.1.4\SAMPLES\USER.COMPONENTS\demo.hbp which has been included wrongly mybutton.prg and need to be removed from .hbp file, because in demo.prg is already declared as Set Procedure To MyButton.Prg.
e. Delete Readme.txt which are some unecessary instructions, because now is include file at current folder.
f. Edit Minigui.ch which wrongly contains following lines:
#include "i_UsrInit.ch"
#include "i_UsrSOOP.ch"
These lines must be deleted, because is not part of any internal ressource of HMG, instead it's a simple example and with include file at current sample folder it is enough.
Added later: (In red color)
There is an enhanced code and instructions for this USER_COMPONENTS which is still with error at compilling). Please read at: viewtopic.php?p=47854#p47854
14. C:\hmg.3.1.4\SAMPLES\HELLO.WORLD, folder and same example at C:\hmg.3.1.4\SAMPLES\EXTERNAL.WINDOWS\HELLO, IMO one of this must be deleted.
15. C:\hmg.3.1.4\SAMPLES\Controls\TextBox\CUEBANNER, to add or actual demo be replaced with:
Code: Select all
/* SetCueBanner Demo2.prg which works in ANSI and UNICODE
Author: Carlos Britos
Contributor: Pablo César
Important: SetCueBanner() does not show aAnything in Win XP (any Service Pack).
On some configurations of WinXP, there is a known problem with SetCueBanner().
Solution: In the Control Panel/Regional and Language Options (On the Languages tab)
The removal of Operating System support for Complex Scripts
The removal of Operating System support for East Asian languages
*/
#include <hmg.ch>
Function Main
Define window Form_1 at 0, 0 width 400 height 300 main Title "Demo2 - Carlos example"
DEFINE TEXTBOX Text_1
ROW 10
COL 10
WIDTH 200
TOOLTIP "Put your name"
END TEXTBOX
DEFINE TEXTBOX Text_2
ROW 40
COL 10
WIDTH 200
TOOLTIP "Put your address"
END TEXTBOX
DEFINE EDITBOX Edit_1
ROW 10
COL 230
WIDTH 120
HEIGHT 110
VALUE ""
END EDITBOX
DEFINE COMBOBOX Combo_1
ROW 70
COL 10
WIDTH 200
HEIGHT 100
ITEMS {"Item 1","Item 2","Item 3"}
VALUE 0
DISPLAYEDIT .T. // must be .T. for cuebanner
END COMBOBOX
DEFINE SPINNER Spinner_1
ROW 100
COL 10
WIDTH 200
HEIGHT 24
RANGEMIN 1
RANGEMAX 10
VALUE "" // must be "" for cuebanner
END SPINNER
DEFINE RICHEDITBOX RichEdit_1
ROW 130
COL 230
WIDTH 120
HEIGHT 90
VALUE ""
END RICHEDITBOX
End window
SetCueBanner(GetControlHandle("Text_1","Form_1"),"Enter your name here",.t.) // Third parameter is for not dissapear when getfocus
SetCueBanner(GetControlHandle("Text_2","Form_1"),"Enter address here",.t.)
SetCueBanner(GetControlHandle("Spinner_1","Form_1")[1],"Spinner CueBanner",.t.)
SetCueBanner(FindWindowEx(GetControlHandle("Combo_1","Form_1"),0,"Edit",Nil),"ComboBox CueBanner",.t.)
SetCueBanner(GetControlHandle("Edit_1","Form_1"),"EditBox CueBanner",.t.)
SetCueBanner(GetControlHandle("RichEdit_1","Form_1"),"RichEditBox CueBanner",.t.)
Form_1.center
Form_1.activate
Return Nil
#pragma BEGINDUMP
#define COMPILE_HMG_UNICODE // Remove this for ANSI building
#include <HMG_UNICODE.h> // Remove this for ANSI building
#include <windows.h>
#include <commctrl.h>
#define EM_SETCUEBANNER 5377 // Set the cue banner with the lParm = LPCWSTR
HB_FUNC( SETCUEBANNER ) // (nEditHandle, cMsg, lGetFocus) -> nil
{
#ifdef UNICODE
LPWSTR lpWCStr = HMG_parc(2) ;
#else
LPWSTR lpWCStr = (LPCWSTR) ( hb_parc(2) == NULL ) ? NULL : hb_mbtowc( (const char *) hb_parc(2) ) ;
#endif
SendMessage( (HWND) hb_parnl(1), EM_SETCUEBANNER, (WPARAM) hb_parl(3), (LPARAM) (LPCWSTR) lpWCStr ) ;
SysFreeString( lpWCStr );
}
#pragma ENDDUMP
16. C:\hmg.3.1.4\SOURCE\hbvpdf\hbvpdft.prg, error at line:
nSize := ascan( aSize, { |arr| LEFTEQUAL( arr[ 1 ], _cPageSize ) } ).
So we have not LEFTEQUAL, so at least we need to create this function like as:
#define LEFTEQUAL( l, r ) ( HB_ULeft( l, HMG_Len( r ) ) == r )
17. Changing IDE language. Is being changed on the fly but only in main IDE window and other"Project Browser" and "Object Inspector" windows are not changed the language.
Notes: All itens sinalized with this have been corrected in new releases after version HMG 3.1.4.
Others tests will be done for the rest of samples and this message could be added and re-edited in this same message. But please gentlemen contributors, consider these suggestions in order to improve and not with the idea of criticism. And all this indications, could be improved and put in avaliation, in order to see what is better for everyone, so please is accepted your advices.