HFCL-ComboSearchBox- BugFix & New Features

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

Moderator: Rathinagiri

User avatar
tonton2
Posts: 444
Joined: Sat Jun 29, 2013 1:26 pm
Location: Algerie
Contact:

Re: HFCL-ComboSearchBox- BugFix & New Features

Post by tonton2 »

Bonjour !
Grand merci a vous tous pour votre aide et votre cooperation ;)
Hi
Big thank you for your help and your cooperation :D
It Works very well,I am going to continue to develop the subject in connection with the combobox.
L'Algerie vous salut
Y.TABET
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Re: HFCL-ComboSearchBox- BugFix & New Features

Post by Pablo César »

Rathinagiri wrote:
Pablo César wrote:Hi Youcef,

I did not see your code, but I guess your problem (by what I see of error in display) when there is already another window MODAL type, that probably you tonton2 are using also in you own code.
Because is not allowed 2 modal windows. If is this, Mr. Rathi will confirm, then in HFCL-ComboSearchBox must treat it all modal window like as is doing in HMG_Preview. i.e. to disable for a while all modal windows before executing HFCL-ComboSearchBox. That's it !!

Dear Rathi, have you understood what I mean ?
I don't think so Pablo. Because, the control flow of the program is always within the combosearchbox procedure. However, we can put some checkpoints that this doesn't happen.
Yes Rathi, you are right !

I made this test and was no problem at all:

Code: Select all

#include "hmg.ch"
#include "hfcl.ch"

Function Main()
DEFINE WINDOW Form_1 AT 0,0 ;
	WIDTH 640 HEIGHT 490 ;
	TITLE 'Client system' ;
	MAIN ;
	FONT 'Arial' SIZE 10 

	DEFINE STATUSBAR
		STATUSITEM 'HMG Power Ready!' 
	END STATUSBAR

	DEFINE MAIN MENU 
		DEFINE POPUP '&File'
			ITEM 'Registration' ACTION Edit_RegForm(10)
	    END POPUP
    END MENU
END WINDOW
Form_1.Center
Form_1.Activate
Return Nil

Function Edit_RegForm(nRec)
Local aCountries := HB_ATOKENS( MEMOREAD( "Countries.lst" ), CRLF )
Local cName := "Homer Simpson"
Local cCountry := "United States of America"
Local cAddress := "742 Evergreen Terrace - Springfield"

ASORT( aCountries )

DEFINE WINDOW Form_2 AT 132 , 235 WIDTH 570 HEIGHT 268 ;
    TITLE "Registration Form nº "+StrZero(nRec,4,0) MODAL

    DEFINE LABEL Label_1
        ROW    40
        COL    40
        WIDTH  80
        HEIGHT 24
        VALUE "Full name:"
        FONTNAME "Arial"
        FONTSIZE 12
        TOOLTIP ""
        FONTBOLD .F.
        FONTITALIC .F.
        FONTUNDERLINE .F.
        FONTSTRIKEOUT .F.
        HELPID Nil
        VISIBLE .T.
        TRANSPARENT .F.
        ACTION Nil
        AUTOSIZE .F.
        BACKCOLOR Nil
        FONTCOLOR Nil
    END LABEL

    DEFINE LABEL Label_2
        ROW    80
        COL    40
        WIDTH  80
        HEIGHT 24
        VALUE "Born in:"
        FONTNAME "Arial"
        FONTSIZE 12
        TOOLTIP ""
        FONTBOLD .F.
        FONTITALIC .F.
        FONTUNDERLINE .F.
        FONTSTRIKEOUT .F.
        HELPID Nil
        VISIBLE .T.
        TRANSPARENT .F.
        ACTION Nil
        AUTOSIZE .F.
        BACKCOLOR Nil
        FONTCOLOR Nil
    END LABEL

    DEFINE LABEL Label_3
        ROW    120
        COL    40
        WIDTH  80
        HEIGHT 24
        VALUE "Address:"
        FONTNAME "Arial"
        FONTSIZE 12
        TOOLTIP ""
        FONTBOLD .F.
        FONTITALIC .F.
        FONTUNDERLINE .F.
        FONTSTRIKEOUT .F.
        HELPID Nil
        VISIBLE .T.
        TRANSPARENT .F.
        ACTION Nil
        AUTOSIZE .F.
        BACKCOLOR Nil
        FONTCOLOR Nil
    END LABEL

    DEFINE TEXTBOX Text_1
        ROW    38
        COL    130
        WIDTH  390
        HEIGHT 26
        FONTNAME "Arial"
        FONTSIZE 12
        TOOLTIP ""
        ONCHANGE Nil
        ONGOTFOCUS Nil
        ONLOSTFOCUS Nil
        FONTBOLD .F.
        FONTITALIC .F.
        FONTUNDERLINE .F.
        FONTSTRIKEOUT .F.
        ONENTER Nil
        HELPID Nil
        TABSTOP .T.
        VISIBLE .T.
        READONLY .F.
        RIGHTALIGN .F.
        DISABLEDBACKCOLOR Nil
        DISABLEDFONTCOLOR Nil
        CASECONVERT NONE
        BACKCOLOR Nil
        FONTCOLOR Nil
        INPUTMASK Nil
        FORMAT Nil
        VALUE cName
    END TEXTBOX

	DEFINE COMBOSEARCHBOX s1
        ROW    78
        COL    130
        WIDTH  390
        HEIGHT 26
        FONTNAME "Arial"
        FONTSIZE 12
        fontitalic .t.
        fontbold .t.
        fontcolor {255,255,255}
        backcolor {0,0,255}
        items acountries
        on enter msginfo(Form_2.s1.value)
        anywheresearch .f.
        // dropheight 50
        additive .t.
        rowoffset 0
        coloffset 0
    END COMBOSEARCHBOX

    DEFINE TEXTBOX Text_3
        ROW    120
        COL    130
        WIDTH  390
        HEIGHT 26
        FONTNAME "Arial"
        FONTSIZE 12
        TOOLTIP ""
        ONCHANGE Nil
        ONGOTFOCUS Nil
        ONLOSTFOCUS Nil
        FONTBOLD .F.
        FONTITALIC .F.
        FONTUNDERLINE .F.
        FONTSTRIKEOUT .F.
        ONENTER Nil
        HELPID Nil
        TABSTOP .T.
        VISIBLE .T.
        READONLY .T.
        RIGHTALIGN .F.
        DISABLEDBACKCOLOR Nil
        DISABLEDFONTCOLOR Nil
        CASECONVERT NONE
        BACKCOLOR Nil
        FONTCOLOR Nil
        INPUTMASK Nil
        FORMAT Nil
        VALUE cAddress
    END TEXTBOX
END WINDOW
Form_2.Center
Form_2.s1.Value := cCountry
Form_2.Activate
Return Nil
Now I see was no problem with others MODAL windows.

Thank you for clarifying and sorry for my missunderstood.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Post Reply