Page 3 of 4

Re: With a little help of the forum...

Posted: Sun Nov 20, 2011 12:25 pm
by esgici
Ricci wrote:
esgici wrote:Did you heart a thing such as "default" or "defaulting" :?:
Sure, but defaults are set in the background by the Qt- or HMG-objects itself, you don´t have to think about that. Only if you want to give them your own defaults, but NIL isn´t one, it´s invalid.

If you write nothing about ICON than the default is an empty string (= no icon), the same as ICON := "".
This is your personal approach.

NIL isn't invalid, it's unknown or unspecified.

"Defaulting" by ICON NIL isn't my think, this made by system.

Please look at implementation of DEFAULT keyword by a pre-processor directive in documentations.

Re: With a little help of the forum...

Posted: Sun Nov 20, 2011 1:56 pm
by Roberto Lopez
mrduck wrote:Please calm down everybody.

Does anyone uses ICON = NIL to unset the icon ?

If not, change the code as below, adding the .AND. to the ELSEIF...

Code: Select all

METHOD Icon( cValue ) CLASS BASIC

   IF PCOUNT() == 0
      RETURN ::cIcon
   ELSEIF PCOUNT() == 1 .AND. valtype( cValue ) == "C"
      ::cIcon := cValue
      ::oQTObject:setWindowIcon( ::cIcon )
   ENDIF

RETURN NIL
I understand the point about 'icon nil' 'questionability' in IDE form code generator.

I don't want to 'defend' that. It is not really important.

The important issue, is that there are thousands of forms generated by HMG-IDE (its first version is from 2004) that will not work on HMG.4 because this.

The change proposed by Francesco, will solve the problem and I'm sure that there is not a noticeable speed penalty on it.

I have not SVN configured at this time, so please, if someone can be so kind to commit that change, I'll greatly appreciate it.

And please, make this change in hmg.hbc too (it will allow to hbmk2 to find .fmg files)

Code: Select all

incpaths=include;.
There is another little problem only. The '()' needed on method calling.

I'll take a look at that, but, if someone has some idea, is welcome to help me...

Thanks!

Re: With a little help of the forum...

Posted: Sun Nov 20, 2011 2:17 pm
by Roberto Lopez
Roberto Lopez wrote: There is another little problem only. The '()' needed on method calling.

I'll take a look at that, but, if someone has some idea, is welcome to help me...

Thanks!
Ok.

It is done!

To the one that be so kind to upload code for me, please, add this to hmg.ch

Code: Select all

   #xtranslate <window>.Show		=> <window>:Show()
   #xtranslate <window>.Hide		=> <window>:Hide()
   #xtranslate <window>.Center		=> <window>:Center()
   #xtranslate <window>.Maximize	=> <window>:Maximize()
   #xtranslate <window>.Minimize	=> <window>:Minimize()
   #xtranslate <window>.Activate	=> <window>:Activate()
   #xtranslate <window>.Restore	=> <window>:Restore()
   #xtranslate <window>.Release	=> <window>:Release()
   #xtranslate <window>.SetFocus	=> <window>:SetFocus()
These are all the window methods that uses no parameters.

With these modifications (and the ones suggested in the previous message) the basic project created by IDE will work.

Re: With a little help of the forum...

Posted: Sun Nov 20, 2011 2:29 pm
by mrduck
Roberto Lopez wrote: To the one that be so kind to upload code for me, please, add this to hmg.ch

Code: Select all

   #xtranslate <window>.Show		=> <window>:Show()
   #xtranslate <window>.Hide		=> <window>:Hide()
   #xtranslate <window>.Center		=> <window>:Center()
   #xtranslate <window>.Maximize	=> <window>:Maximize()
   #xtranslate <window>.Minimize	=> <window>:Minimize()
   #xtranslate <window>.Activate	=> <window>:Activate()
   #xtranslate <window>.Restore	=> <window>:Restore()
   #xtranslate <window>.Release	=> <window>:Release()
   #xtranslate <window>.SetFocus	=> <window>:SetFocus()
Roberto,
these defines should not be necessary since they already are into hmg3.ch. To include this file, you should
#define HMG3
somewhere before including hmg.ch

If the form doesn't include something strictly confidential, would you mind sending it to me ? So that I can have a better understanding of what is happening ?

Francesco

Re: With a little help of the forum...

Posted: Sun Nov 20, 2011 2:33 pm
by Roberto Lopez
mrduck wrote: If the form doesn't include something strictly confidential, would you mind sending it to me ? So that I can have a better understanding of what is happening ?
I've uploaded the complete project (including the form) in the first message of this thread.

Thanks for your help on this.

Re: With a little help of the forum...

Posted: Sun Nov 20, 2011 2:39 pm
by Roberto Lopez
mrduck wrote: these defines should not be necessary since they already are into hmg3.ch. To include this file, you should
#define HMG3
somewhere before including hmg.ch
I've tested. Sadly it is not working...

Re: With a little help of the forum...

Posted: Sun Nov 20, 2011 2:47 pm
by mrduck
Roberto Lopez wrote: I've tested. Sadly it is not working...
Yes, I see. there is something I don't understand in the preprocessor... give me 30 minutes..

Re: With a little help of the forum...

Posted: Sun Nov 20, 2011 3:12 pm
by Roberto Lopez
mrduck wrote:
Roberto Lopez wrote: I've tested. Sadly it is not working...
Yes, I see. there is something I don't understand in the preprocessor... give me 30 minutes..
I'm not fully sure, but, take a look at LOAD WINDOW definition...

DECLARE WINDOW is missing from it...

Anyway, I could be missing something since part of the code is new for me...

Re: With a little help of the forum...

Posted: Sun Nov 20, 2011 3:26 pm
by mrduck
Roberto Lopez wrote:
mrduck wrote:
Roberto Lopez wrote: I've tested. Sadly it is not working...
Yes, I see. there is something I don't understand in the preprocessor... give me 30 minutes..
I'm not fully sure, but, take a look at LOAD WINDOW definition...

DECLARE WINDOW is missing from it...

Anyway, I could be missing something since part of the code is new for me...

No no, you are right ! Someone overwrote my august 22 commit removing the DECLARE WINDOW part. I'm rebuilding the situation.

Code: Select all

=>;
DECLARE WINDOW <oObj>; __mvPublic( <"oObj">  ) ;;

Re: With a little help of the forum...

Posted: Sun Nov 20, 2011 3:41 pm
by Ricci
Roberto Lopez wrote: The change proposed by Francesco, will solve the problem and I'm sure that there is not a noticeable speed penalty on it.

I have not SVN configured at this time, so please, if someone can be so kind to commit that change, I'll greatly appreciate it.
I´m going to check and correct all of the source code in SVN for wrong parameters. Please give me some time for it.