Page 82 of 106

Re: Welcome to the Project Developers' Table

Posted: Sat Oct 23, 2010 9:15 pm
by mrduck
Just to show a sample of what I meant.

This is "function" based code:

Code: Select all

FUNCTION show_form_1()
LOCAL oForm, iGrid, oListBox, oDividi, oCopia, oSalva

	Define Window oForm				;
		At 20 , 10				;
		Width	1000				;
		Height	550				;
		Title	'Caricamento raccolta'		;
		On Init { || centra_form(oForm) } 

        With Object oGrid := Grid():New( "oGrid" ) 
            :Name = "oGrid" 
            :Row  = 22
  ......
            :ColumnWhen = {{||.F.},;
                     {||.T.};
                    }
        end
        oGrid:ReturnValueOnEnter( .t. )

        With Object oSalva := Button():New()
            :Row        := 490
            :Col        := 880
            :Width      := 100
            :Caption    := 'Salva'
            :OnClick    := { || salva( oForm ) }
        End With

        @ 470,660 TEXTBOX oText INPUTMASK "999.99" NUMERIC

        oText:value( 0 )

End Window

Activate Window oForm

Return

function salva( oF )
....
return .T.

Here a sample of "class" based code... that, by the way, doesn't work at the moment... due to a problem in hmg internals

Code: Select all

CLASS Raccolta
    DATA    oForm
    DATA    oGrid
    DATA    oSalva
    DATA    oText
    METHOD form1()
    METHOD salva()
ENDCLASS

METHOD Raccolta:form1()

	Define Window ::oForm				;
		At 20 , 10				;
		Width	1000				;
		Height	550				;
		Title	'Caricamento raccolta'		;
		On Init { || centra_form(::oForm) } 

        With Object ::oGrid := Grid():New( "::oGrid" ) 
            :Name = "oGrid" 
            :Row  = 22
    ........
            :ColumnWhen = {{||.F.},;
                     {||.T.};
                    }
        end
        ::oGrid:ReturnValueOnEnter( .t. )


        With Object ::oSalva := Button():New()
            :Row        := 490
            :Col        := 880
            :Width      := 100
            :Caption    := 'Salva'
            :OnClick    := { || ::salva( ::oForm ) }
        End With

        @ 470,660 TEXTBOX ::oText INPUTMASK "999.99" NUMERIC

        ::oText:value( 0 )

End Window

Activate Window ::oForm

Return

METHOD Raccolta:salva( )
....
return .T.


Re: Welcome to the Project Developers' Table

Posted: Sun Oct 24, 2010 2:53 pm
by mrduck
I did this patch to make the "class" based code to work:

forum doesn't allow me to send the patch... an error is reported...

I just modified Window:AddData to strip "::" from the name of the object...

I don't know if it is a good way to go, in this way I'd have 2 copies of the object, one inside class raccolta, and one inside the form that is inside raccolta...

I must think more about the "class" way of coding... perhaps it could be good to have window:addData as an optional call.... I need to do some testing....

Re: Welcome to the Project Developers' Table

Posted: Sun Oct 24, 2010 11:22 pm
by Roberto Lopez
2010-10-24 20:20:00 UTC-0300 Roberto Lopez (<mail.box.hmg@gmail.com>)
* include/hmg.ch
! Removed reference to relative path,
+ hmgide
+ hmgide/build.bat
+ hmgide/hbmk.hbm
+ hmgide/ide.prg
+ hmgide/lng
+ hmgide/png
+ hmgide/qt.conf
- samples/ide
* Relocated/renamed ide

Re: Welcome to the Project Developers' Table

Posted: Sun Oct 24, 2010 11:46 pm
by esgici
Wonderful :D

( The best point is : it doesn't ask confirmation when exiting ;)

Thanks a lot Maestro :)

Best Regards

--

Esgici
First Screenshoot of new HMG.4 IDE
First Screenshoot of new HMG.4 IDE
HMG4_IDE.JPG (42.76 KiB) Viewed 3700 times

Re: Welcome to the Project Developers' Table

Posted: Mon Oct 25, 2010 10:08 am
by Ricci
There seems to be a major bug in HMG4 when trying to display a database memo field.

Assuming you have a database with a memo field called TEST and it carrys a string with 10 characters.
A "valtype(TEST)" returns "M" and a "len(TEST)" returns 10, so that´s allright.
But a "msginfo(TEST)" returns an empty message window. Only a "msginfo( left(TEST), len(TEST) - 1)" will work, with loosing the last character.

IF you have an EDITBOX and you try to assign the memvar via "<form>.<editbox>.Value := TEST" the result will be a Program Error.

A simple workaround will be: assign the database memvar to a local var and use this one for display: cTest := TEST; msginfo(cTest)

Re: Welcome to the Project Developers' Table

Posted: Mon Oct 25, 2010 8:00 pm
by Roberto Lopez
2010-10-25 17:00:00 UTC-0300 Roberto Lopez (<mail.box.hmg@gmail.com>)
* source/control.prg
! Fixed some problems when adding controls after window creation.
* hmgide
* Some experimental work.

Re: Welcome to the Project Developers' Table

Posted: Mon Oct 25, 2010 11:27 pm
by mrduck
some really really experimental work on edit extended...

there are some things I learnt doing this:

font stuff (set font name and set font size ) should be checked, since when I invoked it ::oFont in control.prg was not defined and so RTE

in h_edit_ex all gui objects declaration must be included in define window ... end window, otherwise they have no ::oParent and RTE

in combobox (and I think other GUI object) we should reflect on a point: :onChange is set BEFORE :items so that for EACH element in items a call of onChange function is done... this is a side-effect we want or not because we may need this or not... I don't know the hmg3 behaviour...
to me, it should :onChange should be set AFTER :items and BEFORE :value() in order to force a call to onChange function

Toolbar buttons defined with this syntax:
button tbbCerrar caption _HMG_SYSDATA [128 ][1] picture "HMG_EDIT_CLOSE" action wndABM2Edit:Release()
doesn't have :name="tbbCerrar" in #xcommand and so they are not added to the window as window:tbbCerrar

More on toolbar.... to me a
DEFINE WINDOW w1
DEFINE TOOLBAR tb1
button tbbCerrar

should create an object w1:tb1:tbbCerrar and not w1:tbbCerrar....
Please also review #xcommand for button, and how it defines/destroy oCurrentToolBar... it is also a DATA member defined in window.prg but it seems to not be used
#xcommand TOOLBUTTON don't use oCurrentToolbar (they don't set a parent....)
There are no samples using TOOLBUTTON, just BUTTON and "with object" that explicitely set :parent.... so, perhaps, toolbutton should have :parent set....
abm2.GIF
abm2.GIF (15.55 KiB) Viewed 3663 times

Re: Welcome to the Project Developers' Table

Posted: Tue Oct 26, 2010 12:00 am
by esgici
Roberto Lopez wrote:2010-10-25 17:00:00 UTC-0300 Roberto Lopez (<mail.box.hmg@gmail.com>)
* source/control.prg
! Fixed some problems when adding controls after window creation.
* hmgide
* Some experimental work.
Hi

Need to change

Code: Select all

   SET PATH=%HMGPATH%\harbour\bin;%HMGPATH%\mingw\bin;%PATH%
line to

Code: Select all

   SET PATH=%HMGPATH%\hmg\harbour\bin;%HMGPATH%\mingw\bin;%PATH%
in buildapp.bat.

Regards

--

Esgici

Re: Welcome to the Project Developers' Table

Posted: Tue Oct 26, 2010 10:26 am
by Ricci
There seems to be a problem in the character conversation when displaying database content using non-english or special characters.

Below you find a screen dump using: 1. HMG3, 2. HMG4 and 3. HMG4 with hb_ansitooem(). Hb_ansitooem isn´t fully working, look at the "×" char.

Image

Re: Welcome to the Project Developers' Table

Posted: Tue Oct 26, 2010 12:52 pm
by Roberto Lopez
mrduck wrote:in h_edit_ex all gui objects declaration must be included in define window ... end window, otherwise they have no ::oParent and RTE
I've already fixed that. Please, update your sources and try again.