A "Formal" proposal.

HMG announcements; Latest HMG-related news, releases, fixes and updates.

Moderator: Rathinagiri

User avatar
esgici
Posts: 4346
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 233 times
Been thanked: 80 times
Contact:

Re: A "Formal" proposal.

Post by esgici » Sun Aug 24, 2008 10:21 pm

Roberto Lopez wrote: I could assist (when the code refers to new properties, methods or completely new controls) in adapt it to user components interface.
Here my unsuccesful try :cry: :

Code: Select all

#include "minigui.ch"

#define USR_COMP_PROC_FLAG  63

PROC Main()

    DEFINE WINDOW Form_1 ;
        AT 0,0 ;
        WIDTH 230 ;
        HEIGHT 480 ;
        TITLE 'ExpandAll Method for TREE' ;
        MAIN

        ON KEY ESCAPE ACTION Form_1.Release

        DEFINE TREE Tree_1 AT 10,10 WIDTH 200 HEIGHT 400 

            NODE 'Item 1'
                TREEITEM 'Item 1.1'
                TREEITEM 'Item 1.2' ID 999
                TREEITEM 'Item 1.3'
            END NODE

            NODE 'Item 2'

                TREEITEM 'Item 2.1'

                NODE 'Item 2.2'
                    TREEITEM 'Item 2.2.1'
                    TREEITEM 'Item 2.2.2'
                    TREEITEM 'Item 2.2.3'
                    TREEITEM 'Item 2.2.4'
                    TREEITEM 'Item 2.2.5'
                    TREEITEM 'Item 2.2.6'
                    TREEITEM 'Item 2.2.7'
                    TREEITEM 'Item 2.2.8'
                END NODE

                TREEITEM 'Item 2.3'

            END NODE

            NODE 'Item 3'
                TREEITEM 'Item 3.1'
                TREEITEM 'Item 3.2'

                NODE 'Item 3.3'
                    TREEITEM 'Item 3.3.1'
                    TREEITEM 'Item 3.3.2'
                END NODE

            END NODE

        END TREE

        @ 415,  10 BUTTON btnExpAll  CAPTION "Expand All"   ACTION UC_ExpandAll(  'Form_1' , 'Tree_1' )
        @ 415, 110 BUTTON btnColpAll CAPTION "Collapse All" ACTION NIL

    END WINDOW

    CENTER   WINDOW Form_1
    ACTIVATE WINDOW Form_1

RETU // Main()

*-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.

*------------------------------------------------------------------------------*
Init Procedure _UC_ExpandAll
*------------------------------------------------------------------------------*

    InstallMethodHandler ( 'ExpandAll' , 'UC_ExpandAll' )

Return

*------------------------------------------------------------------------------*
PROC UC_ExpandAll(  cWindowName , cControlName )
*------------------------------------------------------------------------------*

   IF GetControlType ( cControlName , cWindowName ) == 'TREE'
   
       BE_ExpandAll( cWindowName, cControlName  )
   
       _HMG_SYSDATA [USR_COMP_PROC_FLAG] := .T.
   
   ELSE
       _HMG_SYSDATA [USR_COMP_PROC_FLAG] := .F.
   
   ENDIF

RETURN // UC_ExpandAll()

*-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.

PROC BE_ExpandAll( cWindowName, cControlName  )

   LOCA nItemCount := GetProperty( cWindowName, cControlName, 'ItemCount' ),;
        nItemNo    := 0
   
    FOR nItemNo := 1 TO nItemCount
       * * * * * * * * * * * * * * *
       *  Here break Point :
       * * * * * * * * * * * * * * * 
       Domethod ( cWindowName, cControlName, 'Expand(' + LTRIM( STR( nItemNo ) ) + ')' ) 

    NEXT nItemNo     

RETU // BE_ExpandAll()

*-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.

This is on your hands now.
Regards

--

esgici
Viva INTERNATIONAL HMG :D

User avatar
fchirico
Posts: 324
Joined: Sat Aug 23, 2008 11:27 pm
Location: Argentina

Post by fchirico » Sun Aug 24, 2008 10:44 pm

Roberto, solo decirte que tu HMG se mete mucho en los programadores, en mi caso lo mostré a mis colegas, les comenté de las otras versiones, pero les dije que tu versión es sumamente confiable, estable y que siempre está a la vanguardia como por ejemplo con Harbour 1.0 RC. Es más con uno de ellos estamos haciendo un sistema de gestión de locales ( comercios ), en realidad ya lo terminamos y facturamos $$$$, ahora estamos por emprender un MRP.

Yo lo uso desde 2005.

Gracias y hay muchos en silencio.
Saludos, Fernando Chirico.

User avatar
Roberto Lopez
HMG Founder
Posts: 3900
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 13 times
Been thanked: 136 times

Post by Roberto Lopez » Mon Aug 25, 2008 1:28 am

esgici wrote:
Here my unsuccesful try :cry: :

Well... the goal of UCI is to allow user to create their own properties and methods.

If you are creating a method, you must invoke it using 'Domethod(...)' or semi-oop (if you had wrote the appropriate directives). You are not doing that in your sample.

Please, take a look at 'MyButton' sample.

Regards,

Roberto.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
esgici
Posts: 4346
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 233 times
Been thanked: 80 times
Contact:

Post by esgici » Mon Aug 25, 2008 11:40 am

Roberto Lopez wrote: ... you must invoke it using 'Domethod(...)' or semi-oop ...
Already worked :

Form_1.Tree_1.Expand( nItemNo )

instead of :

DoMethod ( cWindowName, cControlName, ...



Regards

--

esgici
Viva INTERNATIONAL HMG :D

User avatar
esgici
Posts: 4346
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 233 times
Been thanked: 80 times
Contact:

Post by esgici » Mon Aug 25, 2008 3:25 pm

Roberto Lopez wrote: ... you must invoke it using 'Domethod(...)' or semi-oop (if you had wrote the appropriate directives). You are not doing that in your sample.
Done ! :) Finally :(
  • DoMethod( cWindowName, cControlName, 'Expand', nItemNo )
Still I don't satisfied :(
  • First : I don't sure is this an appropriate way.

    Second : According to documentations, DoMethod() doesn't have the fourth parameter, only three. It is dangerous using undocumented features.

    Third : I don't like neither "don't touch, if It's working" nor learning by "tried and mistaken" way.
I think to upload the sample to "Samples" section of Forum after your approval.

BTW, your teaching sytle is quite 'Socratic': always let to student find the answer :!: Perhaps best way for learning but
tiresome for us; especially for aged and tired workers like me :D

Special thanks to your special supports for this topic.

I am going to sleep :)

Regards.

---

esgici
Viva INTERNATIONAL HMG :D

User avatar
Roberto Lopez
HMG Founder
Posts: 3900
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 13 times
Been thanked: 136 times

Post by Roberto Lopez » Mon Aug 25, 2008 4:52 pm

esgici wrote: Second : According to documentations, DoMethod() doesn't have the fourth parameter, only three. It is dangerous using undocumented features.
It is not a 'dangerous' undocumented feature... It is an error on documentation :)
esgici wrote: BTW, your teaching sytle is quite 'Socratic': always let to student find the answer :!: Perhaps best way for learning but
tiresome for us; especially for aged and tired workers like me :D
Let the students to experiment temselves along a strong guidance and support, is the ONLY effective way to go :)

Regards,

Roberto.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

Post Reply